    :root {
      color-scheme: light;
      --bg: #f5f6f8;
      --panel: #ffffff;
      --ink: #20242a;
      --muted: #626b76;
      --line: #e5e8ed;
      --grid: #d9dee6;
      --blue: #3478f6;
      --green: #16885f;
      --red: #e14d4d;
      --amber: #f0a42b;
      --violet: #9657e8;
      --shadow: 0 14px 32px rgba(30, 38, 49, .08);
    }

    * { box-sizing: border-box; }

    body {
      margin: 0;
      min-height: 100vh;
      background: var(--bg);
      color: var(--ink);
      font: 14px/1.45 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    .app {
      width: min(1280px, calc(100vw - 28px));
      margin: 0 auto;
      padding: 18px 0 28px;
    }

    header {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 16px;
      align-items: center;
      margin-bottom: 12px;
    }

    .brand {
      display: inline-flex;
      min-width: 0;
      align-items: center;
      gap: 11px;
      color: inherit;
      text-decoration: none;
    }

    .brand:focus-visible { outline: 3px solid rgba(37, 99, 235, .25); outline-offset: 4px; border-radius: 12px; }

    .brand-mark {
      display: block;
      flex: 0 0 44px;
      width: 44px;
      height: 44px;
      border-radius: 12px;
      box-shadow: 0 7px 18px rgba(15, 23, 42, .18);
    }

    .brand-copy { min-width: 0; }

    h1 {
      margin: 0;
      font-size: clamp(21px, 2.7vw, 30px);
      font-weight: 760;
      letter-spacing: -.025em;
      line-height: 1.05;
    }

    .brand-tagline {
      margin-top: 5px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 650;
      letter-spacing: .06em;
    }

    .subline {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 9px;
      color: var(--muted);
    }

    .pill {
      display: inline-flex;
      align-items: center;
      min-height: 26px;
      padding: 0 9px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: rgba(255, 255, 255, .82);
      white-space: nowrap;
    }

    .actions {
      display: flex;
      gap: 8px;
      align-items: center;
    }
    .account-menu { position: relative; }
    .account-menu-list {
      position: absolute;
      top: calc(100% + 6px);
      left: 0;
      z-index: 40;
      display: none;
      min-width: 100%;
      padding: 6px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      box-shadow: 0 16px 36px rgba(30, 38, 49, .18);
    }
    .account-menu.is-open .account-menu-list { display: block; }
    .account-menu-list button { width: 100%; border: 0; white-space: nowrap; text-align: left; }
    .notification-button { position: relative; min-width: 38px; padding: 0 10px; font-size: 18px; }
    .delisting-calendar-button { color: #8a5a08; border-color: rgba(240, 164, 43, .5); background: rgba(240, 164, 43, .1); }
    .notification-count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: 10px; line-height: 18px; text-align: center; }
    .notification-count:empty { display: none; }
    .notification-banner { display: none; align-items: center; gap: 10px; margin: 0 0 10px; padding: 7px 8px 7px 14px; border: 1px solid #f0c36a; border-radius: 8px; background: #fff7df; color: #76500a; font-weight: 700; box-shadow: var(--shadow); }
    .notification-banner.is-visible { display: flex; }
    .notification-banner-text { min-width: 0; flex: 1; overflow-wrap: anywhere; }
    .notification-banner-close { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: 50%; background: transparent; color: inherit; font: inherit; font-size: 22px; line-height: 1; cursor: pointer; }
    .notification-banner-close:hover { border-color: rgba(118, 80, 10, .24); background: rgba(118, 80, 10, .08); }
    .notification-banner-close:focus-visible { outline: 2px solid #9d6b0d; outline-offset: 1px; }
    .notification-modal { width: min(680px, 94vw); max-height: 80vh; overflow: auto; border-radius: 10px; background: #fff; box-shadow: 0 24px 60px rgba(20,28,38,.24); }
    .notification-list { display: grid; gap: 8px; padding: 12px 14px 16px; }
    .announcement-modal { width: min(900px, 94vw); max-height: 86vh; overflow: hidden; border-radius: 14px; background: #f7f9fc; box-shadow: 0 28px 70px rgba(20,28,38,.28); }
    .announcement-modal .help-head { background: #fff; }
    .announcement-body { max-height: calc(86vh - 68px); overflow: auto; padding: 16px; }
    .announcement-toolbar { display: flex; flex-wrap: wrap; gap: 4px; width: fit-content; max-width: 100%; padding: 4px; border: 1px solid #dce3ee; border-radius: 11px; background: #eef2f7; }
    .announcement-toolbar button { flex: 1 1 auto; min-height: 36px; padding: 7px 14px; border: 0; border-radius: 8px; background: transparent; color: #5d6878; font: inherit; font-weight: 800; cursor: pointer; white-space: nowrap; }
    .announcement-toolbar button.is-active { background: #fff; color: #245fc8; box-shadow: 0 2px 8px rgba(31,65,115,.13); }
    .announcement-title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
    .announcement-title-row h2 { min-width: 0; }
    .announcement-summary-row { margin-top: 12px; }
    .announcement-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; color: #344054; font-size: 13px; font-weight: 750; line-height: 1.5; }
    .announcement-cache-help { flex: 0 0 auto; width: 24px; height: 24px; padding: 0; border: 1px solid #a8b7ca; border-radius: 50%; background: #fff; color: #53657d; font: inherit; font-size: 14px; font-weight: 850; line-height: 22px; cursor: help; }
    .announcement-cache-help:hover, .announcement-cache-help:focus-visible { border-color: #245fc8; background: #edf3ff; color: #245fc8; }
    .announcement-source-label { font-weight: 750; }
    .announcement-source-pill { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 8px; border: 1px solid #dfe5ee; border-radius: 999px; background: #fff; color: #475467; font: inherit; font-weight: 750; cursor: pointer; }
    .announcement-source-pill.is-empty { border-color: #e5e7eb; background: #f8fafc; color: #98a2b3; }
    .announcement-source-pill.is-error { border-color: #f3c4c0; background: #fff3f2; color: #b42318; }
    .announcement-source-pill.is-selected { border-color: #245fc8; background: #edf3ff; color: #245fc8; box-shadow: 0 0 0 1px rgba(36,95,200,.12); }
    .announcement-summary-text { color: #344054; font-weight: 750; }
    .announcement-list { display: grid; gap: 10px; }
    .announcement-item { display: grid; gap: 9px; padding: 14px 15px; border: 1px solid #dfe5ee; border-radius: 11px; background: #fff; box-shadow: 0 2px 8px rgba(30,42,60,.04); transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease; }
    .announcement-item:hover { border-color: #b8c9e6; box-shadow: 0 7px 20px rgba(35,64,110,.09); transform: translateY(-1px); }
    .announcement-item.is-unread { border-color: rgba(225, 77, 77, .42); background: linear-gradient(90deg, rgba(225,77,77,.06), #fff 26%); }
    .announcement-item-top { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
    .announcement-exchange, .announcement-category { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 850; }
    .announcement-exchange { color: #245fc8; background: #edf3ff; }
    .announcement-exchange.binance { color: #7d5b00; background: #fff5cf; }
    .announcement-exchange.bitget { color: #087d72; background: #e8faf7; }
    .announcement-exchange.okx { color: #263238; background: #e9eef0; }
    .announcement-exchange.bybit { color: #8a4b08; background: #fff0df; }
    .announcement-exchange.kucoin { color: #147a55; background: #e6f7ee; }
    .announcement-category { color: #667085; background: #f0f2f5; }
    .announcement-time { margin-left: auto; color: var(--muted); font-size: 12px; }
    .announcement-item a { color: var(--ink); font-size: 15px; font-weight: 800; line-height: 1.45; text-decoration: none; }
    .announcement-item a:hover { color: var(--blue); }
    .announcement-link-arrow { display: inline-block; margin-left: 6px; color: #7d8aa0; font-size: 12px; }
    .announcement-delisting-item { display: grid; gap: 9px; padding: 14px 15px; border: 1px solid #e4d9c5; border-radius: 11px; background: #fffdf8; box-shadow: 0 2px 8px rgba(60,45,20,.04); }
    .announcement-delisting-head { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
    .announcement-delisting-exchange, .announcement-delisting-market, .announcement-delisting-status { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 850; }
    .announcement-delisting-exchange { color: #245fc8; background: #edf3ff; }
    .announcement-delisting-market { color: #8a4b08; background: #fff0df; }
    .announcement-delisting-status { color: #8a4b08; background: #fff5cf; }
    .announcement-delisting-time { margin-left: auto; color: #7a5b2e; font-size: 12px; font-weight: 750; }
    .announcement-delisting-title { color: var(--ink); font-size: 15px; font-weight: 800; line-height: 1.45; }
    .announcement-delisting-detail { display: flex; flex-wrap: wrap; gap: 8px 18px; color: #667085; font-size: 12px; }
    .announcement-delisting-detail a { color: #245fc8; font-weight: 750; text-decoration: none; }
    .announcement-delisting-detail a:hover { text-decoration: underline; }
    .announcement-delisting-history { display: grid; gap: 9px; margin-top: 8px; padding-top: 14px; border-top: 1px solid #d9dee7; }
    .announcement-delisting-history h3 { margin: 0; color: #667085; font-size: 13px; font-weight: 850; }
    .announcement-delisting-history-list { display: grid; gap: 10px; }
    .announcement-delisting-item.is-historical { border-color: #d9dee7; background: #f5f6f8; box-shadow: none; }
    .announcement-delisting-item.is-historical .announcement-delisting-exchange { color: #5d6878; background: #e8ecf1; }
    .announcement-delisting-item.is-historical .announcement-delisting-market { color: #5d6878; background: #edf0f4; }
    .announcement-delisting-item.is-historical .announcement-delisting-status { color: #5d6878; background: #e1e5ea; }
    .announcement-delisting-item.is-historical .announcement-delisting-time { color: #667085; }
    .announcement-delisting-item.is-historical .announcement-delisting-title { color: #475467; }
    .announcement-empty { padding: 34px 18px; border: 1px dashed #cfd8e6; border-radius: 11px; background: rgba(255,255,255,.72); color: var(--muted); text-align: center; }
    .notification-item { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
    .notification-item.is-unread { border-color: #9db9ee; background: #f3f7ff; }
    .notification-item-time { margin-top: 4px; color: var(--muted); font-size: 11px; }
    .subscription-modal { width: min(1040px, 96vw); max-height: 82vh; overflow: auto; border-radius: 10px; background: #fff; box-shadow: 0 24px 60px rgba(20,28,38,.24); }
    .subscription-body { display: grid; gap: 12px; padding: 14px 16px 18px; }
    .subscription-actions { display: flex; flex-wrap: wrap; gap: 8px; }
    .subscription-list { display: grid; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
    .subscription-row { display: grid; grid-template-columns: 28px minmax(130px,.65fr) minmax(180px,1fr) minmax(390px,1.55fr); gap: 8px; align-items: center; min-width: 780px; }
    .subscription-row select, .subscription-row input { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 7px; padding: 0 9px; }
    .subscription-monitors { display: grid; grid-template-columns: repeat(4, max-content); align-items: center; gap: 12px; }
    .subscription-monitor { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; color: var(--muted); font-size: 13px; }
    .subscription-monitor input { width: 16px; height: 16px; padding: 0; }
    .subscription-remove { display: inline-flex; align-items: center; justify-content: center; width: 28px; min-width: 28px; height: 28px; padding: 0; border-color: #f1b5b0; border-radius: 50%; background: #fff2f1; color: #d92d20; font-size: 20px; font-weight: 800; line-height: 1; }
    .subscription-remove:hover { border-color: #d92d20; background: #ffe4e1; }
    .subscription-channel { padding-top: 10px; border-top: 1px solid var(--line); }
    .subscription-channel summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 38px; color: var(--ink); font-size: 14px; font-weight: 780; cursor: pointer; }
    .subscription-channel-summary { min-width: 0; color: var(--muted); font-size: 12px; font-weight: 650; overflow-wrap: anywhere; text-align: right; }
    .notification-form { display: grid; grid-template-columns: auto auto minmax(240px, 1fr) auto; gap: 8px; align-items: center; padding: 8px 0 2px; }
    .notification-form label { color: var(--muted); font-size: 12px; font-weight: 720; }
    .notification-form > input { width: 100%; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: #fff; font: inherit; }
    .notification-channel-tabs { display: inline-grid; grid-template-columns: repeat(2, minmax(64px, 1fr)); padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: #f4f6f9; }
    .notification-channel-tabs button { min-height: 32px; padding: 4px 12px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); box-shadow: none; }
    .notification-channel-tabs button.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20,28,38,.14); }
    .notification-actions { display: flex; flex-wrap: wrap; gap: 6px; }
    .notification-actions button { min-height: 36px; }
    .notification-status { grid-column: 3 / -1; min-height: 18px; overflow-wrap: anywhere; }
    .settings-modal { width: min(1500px, 96vw); max-height: 86vh; overflow: auto; border-radius: 10px; background: #fff; box-shadow: 0 24px 60px rgba(20,28,38,.24); }
    .settings-body { display: grid; gap: 18px; padding: 16px; }
    .settings-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
    .settings-links button { min-height: 42px; padding: 8px 10px; font-weight: 750; }
    .settings-links button[hidden] { display: none; }
    .settings-section { display: grid; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
    .settings-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
    .settings-section-head h3 { margin: 0; font-size: 15px; }
    .settings-section-head button { min-height: 32px; padding: 5px 10px; }
    .settings-exchange-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .connection-signal { position: relative; margin-left: auto; cursor: help; flex-shrink: 0; color: #92651a; background: #fff5df; border-radius: 20px; padding: 4px 8px; font-size: 11px; font-weight: 600; }
    .connection-signal[data-state="missing"], .connection-signal[data-state="error"] { color: #b73838; background: #fff0ef; }
    .connection-signal[data-state="available"] { color: #168060; background: #e8f7ef; }
    .connection-signal[data-state="disabled"] { color: #7c8490; }
    .connection-tooltip { display: none; position: absolute; right: 0; top: 100%; z-index: 5; width: min(420px, 70vw); padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); box-shadow: 0 4px 16px #0002; font-size: 12px; white-space: normal; overflow-wrap: anywhere; }
    .connection-signal:hover .connection-tooltip, .connection-signal:focus .connection-tooltip { display: block; }
    .settings-exchange-option { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfd; font-weight: 650; font-size: 13px; }
    .settings-exchange-option label { display: flex; align-items: center; gap: 7px; min-width: 0; cursor: pointer; }
    .settings-exchange-option:focus-within, .settings-exchange-option:hover { border-color: #9ebaf3; background: #f2f6ff; }
    @media (max-width: 600px) { .settings-exchange-grid { grid-template-columns: minmax(0, 1fr); } }
    .settings-exchange-option input { width: 17px; height: 17px; margin: 0; }
    .settings-exchange-option.has-quote-options { flex-wrap: wrap; }
    .settings-quote-options { display: flex; flex-wrap: wrap; gap: 8px 18px; flex-basis: 100%; padding-left: 24px; font-size: 14px; }
    .settings-quote-options label { min-height: 44px; }
    .settings-save-row { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
    .settings-save-row .mapping-status { flex: 1; }

    .mobile-menu { display: none; position: relative; }
    .mobile-menu-button { width: 42px; min-width: 42px; padding: 0; font-size: 22px; font-weight: 800; }
    .mobile-menu-list {
      position: absolute;
      top: calc(100% + 6px);
      right: 0;
      z-index: 40;
      display: none;
      min-width: 150px;
      padding: 6px;
      border: 1px solid var(--line);
      border-radius: 10px;
      background: #fff;
      box-shadow: 0 16px 36px rgba(30, 38, 49, .18);
    }
    .mobile-menu.is-open .mobile-menu-list { display: grid; gap: 4px; }
    .mobile-menu-list button { width: 100%; border: 0; text-align: left; }

    .query-summary-wrap { display: none; }

    .query-summary {
      display: none;
      width: 100%;
      min-height: 44px;
      padding: 8px 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--panel);
      color: var(--ink);
      box-shadow: var(--shadow);
      text-align: left;
      font-weight: 720;
    }
    .query-summary-values { min-width: 0; }
    .query-summary-values strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .query-summary small { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 11px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
    .query-summary-edit { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; min-height: 28px; padding: 0 8px; border-radius: 999px; background: #edf3ff; color: #285fc4; font-size: 11px; font-weight: 800; }
    .query-summary[aria-expanded="true"] .query-summary-edit { background: #eef0f3; color: #586270; }

    .delisting-badge {
      position: relative;
      z-index: 2;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: auto;
      min-width: 0;
      height: 24px;
      padding: 0 9px;
      border: 1px solid rgba(240, 164, 43, .52);
      border-radius: 999px;
      background: rgba(240, 164, 43, .12);
      color: #8a5a08;
      font-size: 12px;
      font-weight: 800;
      line-height: 1;
      white-space: nowrap;
      pointer-events: auto;
      cursor: pointer;
      transition: border-color .12s ease, background .12s ease, box-shadow .12s ease, transform .12s ease;
    }
    .delisting-badge[hidden] { display: none !important; }
    .delisting-badge:hover, .delisting-badge:focus-visible { border-color: #d68a13; background: rgba(240, 164, 43, .2); box-shadow: 0 0 0 3px rgba(240, 164, 43, .13); transform: translateY(-1px); }
    .delisting-badge.danger { border-color: rgba(225, 77, 77, .4); background: rgba(225, 77, 77, .1); color: #9f2f2f; }
    .delisting-badge.danger:hover, .delisting-badge.danger:focus-visible { border-color: #ce3f3f; background: rgba(225, 77, 77, .18); box-shadow: 0 0 0 3px rgba(225, 77, 77, .11); }
    .token-coverage-badge, .announcement-button { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 0; min-height: 24px; padding: 2px 9px; border: 1px solid rgba(52, 120, 246, .34); border-radius: 999px; background: rgba(52, 120, 246, .08); color: #225fc4; font-size: 12px; font-weight: 800; line-height: 1; white-space: nowrap; cursor: pointer; }
    .token-coverage-badge[hidden] { display: none !important; }
    .token-coverage-badge:hover, .token-coverage-badge:focus-visible, .announcement-button:hover, .announcement-button:focus-visible { border-color: #2f6ed9; background: rgba(52,120,246,.15); box-shadow: 0 0 0 3px rgba(52,120,246,.11); }
    .token-coverage-badge.is-warning { border-color: rgba(217,145,34,.52); background: #fff6df; color: #865708; }
    .token-coverage-badge.is-warning:hover, .token-coverage-badge.is-warning:focus-visible { border-color: #c47b0b; background: #ffedbd; box-shadow: 0 0 0 3px rgba(217,145,34,.14); }
    .announcement-button[hidden] { display: none !important; }
    .announcement-count { position: absolute; top: -8px; right: -8px; min-width: 18px; height: 18px; padding: 0 4px; border: 2px solid #fff; border-radius: 999px; background: var(--red); color: #fff; font-size: 10px; line-height: 14px; text-align: center; }
    .announcement-count:empty { display: none; }
    .delisting-badge.mobile, .token-coverage-badge.mobile { display: none; align-self: stretch; height: auto; padding: 0 10px; }

    .query-panel {
      display: grid;
      grid-template-columns: 105px 110px 110px minmax(260px, 1fr) 92px 96px auto auto;
      gap: 8px;
      align-items: end;
      margin: 0 0 12px;
      padding: 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--panel);
      box-shadow: var(--shadow);
    }

    .reverse-query { color: #315eaa; background: #eef4ff; border-color: #bfd2f5; }

    .risk-alerts {
      display: none;
      gap: 8px;
      margin: 10px 0 14px;
    }

    .risk-alerts.is-visible { display: grid; }

    .risk-alert {
      padding: 10px 12px;
      border: 1px solid rgba(225, 77, 77, .38);
      border-radius: 10px;
      background: rgba(225, 77, 77, .08);
      color: #9f2f2f;
      font-size: 13px;
      font-weight: 700;
    }

    .risk-alert.warning {
      border-color: rgba(240, 164, 43, .5);
      background: rgba(240, 164, 43, .1);
      color: #8a5a08;
    }

    .field {
      display: grid;
      gap: 4px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 620;
    }

    .field-label {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      min-width: 0;
    }

    .query-token-field > .field-label { flex-wrap: wrap; }
    .instrument-identity {
      display: inline-flex;
      flex-wrap: wrap;
      gap: 3px 10px;
      max-width: 100%;
      padding: 4px 8px;
      border: 1px solid #ccd5e3;
      border-radius: 6px;
      color: #566579;
      background: #f7f9fc;
      font-size: 12px;
      line-height: 1.5;
      overflow-wrap: anywhere;
    }
    .instrument-identity[hidden] { display: none; }
    .instrument-identity.is-conflict { border: 2px solid #dc4848; color: #a82323; background: #fff3f3; }
    .instrument-identity-note { flex-basis: 100%; font-weight: 400; }
    .coinglass-links { display: inline-flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
    .coinglass-link {
      display: inline-flex;
      align-items: center;
      min-height: 22px;
      padding: 2px 6px;
      border: 1px solid #c9d2dc;
      border-radius: 5px;
      background: #f7f9fb;
      color: #31465b;
      font-size: 11px;
      font-weight: 760;
      line-height: 1;
      text-decoration: none;
      white-space: nowrap;
    }
    .coinglass-link:hover, .coinglass-link:focus-visible { border-color: #2f7d61; background: #edf7f2; color: #176b4d; box-shadow: 0 0 0 3px rgba(47, 125, 97, .11); }

    .help-tip {
      position: relative;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 15px;
      height: 15px;
      border: 1px solid #b9c1cc;
      border-radius: 50%;
      color: var(--muted);
      background: #fff;
      font-size: 10px;
      font-weight: 800;
      line-height: 1;
      cursor: help;
      flex: 0 0 auto;
    }

    .help-tip::after {
      content: attr(data-tip);
      position: absolute;
      left: 0;
      bottom: calc(100% + 8px);
      z-index: 20;
      width: min(320px, 78vw);
      padding: 9px 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #20242a;
      color: #fff;
      font-size: 12px;
      font-weight: 520;
      line-height: 1.45;
      white-space: normal;
      box-shadow: 0 14px 28px rgba(30, 38, 49, .18);
      opacity: 0;
      pointer-events: none;
      transform: translateY(4px);
      transition: opacity .12s ease, transform .12s ease;
    }

    .help-tip:hover::after,
    .help-tip:focus::after {
      opacity: 1;
      transform: translateY(0);
    }

    .floating-help-enabled .help-tip::after { display: none; }
    .floating-help-tooltip {
      position: fixed;
      z-index: 200;
      width: max-content;
      max-width: min(320px, calc(100vw - 16px));
      padding: 9px 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #20242a;
      color: #fff;
      box-shadow: 0 14px 28px rgba(30, 38, 49, .22);
      font-size: 12px;
      font-weight: 520;
      line-height: 1.45;
      pointer-events: none;
      white-space: normal;
    }
    .floating-help-tooltip[hidden] { display: none; }

    .field input,
    .field select {
      height: 34px;
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 7px;
      background: #fff;
      color: var(--ink);
      padding: 0 10px;
      font: inherit;
      font-size: 14px;
    }
    .field input.is-ambiguous {
      border-color: #d92d20;
      background: #fff5f4;
      color: #b42318;
      box-shadow: 0 0 0 3px rgba(217, 45, 32, .12);
      font-weight: 750;
    }

    .confirm {
      min-width: 78px;
      padding: 0 14px;
      font-weight: 700;
      border-color: var(--blue);
      background: var(--blue);
      color: #fff;
    }

    .suggest-field {
      position: relative;
      min-width: 0;
    }

    .token-input-row { display: grid; grid-template-columns: minmax(0, 1fr) 34px 72px 72px; gap: 5px; }
    .token-entry { position: relative; min-width: 0; }
    .token-input-row .token-clear, .token-input-row .opportunity-search, .token-input-row .lending-search { min-width: 0; height: 34px; padding: 0; }
    .token-input-row .opportunity-search { min-width: 68px; }
    .token-input-row .lending-search { min-width: 72px; }
    .token-clear { color: #5f6874; background: #f4f5f7; border-color: #d9dde3; font-size: 20px; line-height: 1; }
    .opportunity-search { color: #fff; background: #2267d9; border-color: #2267d9; font-size: 12px; font-weight: 760; white-space: nowrap; word-break: keep-all; }
    .lending-search { color: #176b4d; background: #edf7f2; border-color: #add7c6; font-size: 12px; font-weight: 760; white-space: nowrap; word-break: keep-all; }

    .token-suggest {
      position: absolute;
      top: calc(100% + 5px);
      left: 0;
      right: 0;
      z-index: 35;
      display: none;
      max-height: 240px;
      overflow: auto;
      padding: 5px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      box-shadow: 0 16px 34px rgba(30, 38, 49, .16);
    }

    .token-suggest.is-open {
      display: grid;
      gap: 3px;
    }

    .token-suggest button {
      height: 30px;
      padding: 0 9px;
      border: 0;
      border-radius: 6px;
      background: transparent;
      text-align: left;
      font-weight: 700;
    }

    .token-suggest button:hover {
      background: #f3f6fb;
    }
    .token-suggest button.is-api-symbol {
      height: 34px;
      border-left: 3px solid #d92d20;
      border-radius: 4px;
      color: #b42318;
      font-size: 13px;
    }

    .template-panel {
      display: grid;
      gap: 9px;
      margin: -4px 0 12px;
      padding: 10px 12px 0;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--panel);
      box-shadow: var(--shadow);
      position: relative;
    }
    .template-panel[hidden], .opportunity-panel[hidden] { display: none !important; }

    .opportunity-panel { display: grid; gap: 10px; margin: -4px 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: var(--shadow); }
    .opportunity-panel.is-collapsed { gap: 0; }
    .opportunity-panel.is-collapsed .opportunity-controls, .opportunity-panel.is-collapsed .opportunity-list, .opportunity-panel.is-collapsed .dex-opportunity-section { display: none; }
    .opportunity-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
    .opportunity-title { font-size: 15px; font-weight: 760; }
    .opportunity-status { min-height: 18px; margin-top: 3px; color: var(--muted); font-size: 12px; }
    .opportunity-head-actions { display: flex; align-items: flex-start; gap: 8px; }
    .opportunity-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
    .opportunity-filter { display: inline-flex; align-items: center; gap: 5px; }
    .opportunity-filter-option { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 4px 7px; border: 1px solid; border-radius: 6px; font-size: 12px; font-weight: 800; cursor: pointer; }
    .opportunity-filter-option input { width: 14px; height: 14px; margin: 0; }
    .opportunity-filter-option.mode-ff { color: #245fc8; border-color: #b9cdf3; background: #edf3ff; }
    .opportunity-filter-option.mode-sf { color: #12694f; border-color: #a9d8c5; background: #eaf8f2; }
    .opportunity-filter-option.mode-fs { color: #8a5a08; border-color: #e7c37c; background: #fff5df; }
    .opportunity-filter-option.same-exchange { color: #4d5968; border-color: #cbd3de; background: #f5f7fa; }
    .opportunity-filter-option.mode-ff input { accent-color: #3478f6; }
    .opportunity-filter-option.mode-sf input { accent-color: #168760; }
    .opportunity-filter-option.mode-fs input { accent-color: #b77912; }
    .opportunity-filter-option.same-exchange input { accent-color: #56677b; }
    .opportunity-sort, .opportunity-period-sort { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid #d9dfe8; border-radius: 7px; background: #f1f3f6; }
    .opportunity-sort button, .opportunity-period-sort button { min-height: 32px; padding: 5px 10px; border: 0; background: transparent; color: var(--muted); font-size: 12px; white-space: nowrap; }
    .opportunity-sort button.is-active, .opportunity-period-sort button.is-active { background: #fff; color: #1f5fca; box-shadow: 0 1px 5px rgba(30,38,49,.12); }
    .opportunity-reverse { min-height: 38px; padding: 6px 11px; color: #7b4f07; border-color: #e7bd70; background: #fff7e3; font-weight: 750; }
    .opportunity-collapse { flex: 0 0 38px; width: 38px; height: 38px; padding: 0; color: #536171; border-color: #cdd6e2; background: #f7f9fb; font-size: 18px; line-height: 1; }
    .opportunity-list { display: grid; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
    .dex-opportunity-section { display: grid; gap: 7px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
    .dex-opportunity-head { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
    .dex-opportunity-list { display: grid; gap: 7px; }
    .dex-opportunity-card { display: grid; gap: 6px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fbfcfe; }
    .dex-opportunity-tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
    .dex-opportunity-tier { padding: 6px; border-radius: 5px; background: #f2f4f7; font-size: 12px; overflow-wrap: anywhere; }
    .dex-opportunity-tier.is-complete { color: #12694f; background: #eaf8f2; }
    .dex-opportunity-card small { color: var(--muted); }
    @media (max-width: 540px) {
      .dex-opportunity-tiers { grid-template-columns: 1fr; }
      .dex-opportunity-head { flex-direction: column; }
    }
    .opportunity-row { display: grid; grid-template-columns: 74px minmax(220px, 1.25fr) minmax(120px, .7fr) minmax(140px, .8fr) minmax(140px, .8fr) auto; grid-template-rows: auto auto; gap: 10px; align-items: center; height: auto; min-height: 86px; padding: 9px 10px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
    .opportunity-row:last-child { border-bottom: 0; }
    .opportunity-row:hover, .opportunity-row:focus-visible { position: relative; z-index: 1; background: #f7faff; box-shadow: inset 3px 0 #3478f6; }
    .opportunity-row.is-mode-preferred { background: #eef4ff; box-shadow: inset 4px 0 #3478f6; }
    .opportunity-row.is-mode-preferred:hover, .opportunity-row.is-mode-preferred:focus-visible { background: #e5efff; box-shadow: inset 4px 0 #245fc8; }
    .opportunity-row.is-exchange-preferred { background: #edf8f3; box-shadow: inset 4px 0 #168760; }
    .opportunity-row.is-exchange-preferred:hover, .opportunity-row.is-exchange-preferred:focus-visible { background: #e3f4ec; box-shadow: inset 4px 0 #0f7654; }
    .opportunity-mode { display: inline-flex; align-items: center; justify-content: center; width: fit-content; min-width: 40px; min-height: 25px; padding: 3px 7px; border: 1px solid; border-radius: 6px; font-size: 12px; font-weight: 850; }
    .opportunity-mode-ff { color: #245fc8; border-color: #b9cdf3; background: #edf3ff; }
    .opportunity-mode-sf { color: #12694f; border-color: #a9d8c5; background: #eaf8f2; }
    .opportunity-mode-fs { color: #8a5a08; border-color: #e7c37c; background: #fff5df; }
    .opportunity-mode-ss, .opportunity-filter-option.mode-ss { color: #6951a1; border-color: #cbbbea; background: #f4f0fb; }
    .opportunity-depth-tiers { display: none; gap: 3px; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 400; }
    .opportunity-depth:hover .opportunity-depth-tiers, .opportunity-depth:focus .opportunity-depth-tiers { display: grid; }
    .opportunity-depth-tiers > span { overflow-wrap: anywhere; }
    .opportunity-route { min-width: 0; }
    .opportunity-route strong, .opportunity-route small { display: block; overflow-wrap: anywhere; }
    .opportunity-exchange { font-weight: 800; }
    .opportunity-exchange-s { color: #12694f; }
    .opportunity-exchange-f { color: #245fc8; }
    .opportunity-route-arrow { margin: 0 5px; color: #7b8795; }
    .opportunity-route small { margin-top: 2px; color: var(--muted); font-size: 11px; }
    .opportunity-metric span { display: block; color: var(--muted); font-size: 10px; }
    .opportunity-metric.has-explanation > span { text-decoration: underline dotted #aab4c2; text-underline-offset: 3px; }
    .opportunity-metric.has-explanation { cursor: help; }
    .opportunity-metric strong { display: block; margin-top: 2px; font-size: 14px; font-variant-numeric: tabular-nums; }
    .opportunity-metric strong.pos { color: var(--green); }
    .opportunity-metric strong.neg { color: var(--red); }
    .opportunity-realized-group { grid-column: 2 / 6; grid-row: 2; display: grid; grid-template-columns: repeat(4, minmax(88px, 1fr)); gap: 10px; min-width: 0; padding-top: 7px; border-top: 1px dashed #dde4ed; }
    .opportunity-realized-group .opportunity-metric { min-width: 0; }
    .opportunity-realized-group .opportunity-metric > span { overflow-wrap: anywhere; }
    .opportunity-detail-tooltip { position: fixed; z-index: 210; width: max-content; max-width: min(430px, calc(100vw - 18px)); padding: 10px 12px; border: 1px solid #cbd7e7; border-radius: 8px; background: #fff; color: #334155; box-shadow: 0 14px 30px rgba(30, 42, 61, .2); font-size: 12px; line-height: 1.55; pointer-events: none; }
    .opportunity-detail-tooltip[hidden] { display: none; }
    .opportunity-detail-formula { display: flex; align-items: center; gap: 7px; padding-bottom: 6px; border-bottom: 1px solid #e1e7ef; color: #4c5b70; font-weight: 680; }
    .opportunity-detail-formula .opportunity-mode { min-width: 34px; min-height: 21px; padding: 1px 6px; font-size: 11px; }
    .opportunity-detail-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px; padding-top: 5px; }
    .opportunity-detail-exchange { font-weight: 800; }
    .opportunity-detail-time { color: #52647b; font-variant-numeric: tabular-nums; }
    .opportunity-detail-rate { font-weight: 800; font-variant-numeric: tabular-nums; }
    .opportunity-detail-rate.pos { color: var(--green); }
    .opportunity-detail-rate.neg { color: var(--red); }
    .opportunity-detail-rate.flat { color: #a06a10; }
    .opportunity-detail-interval { padding: 1px 5px; border-radius: 4px; background: #edf3fb; color: #476585; white-space: nowrap; }
    .opportunity-detail-muted { color: #9a6a18; font-weight: 700; }
    .opportunity-detail-borrow { justify-content: space-between; border-top: 1px dashed #dbe3ed; }
    .dex-market-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; min-width: 0; margin-block: 12px; border: 1px solid var(--line); }
    .dex-market-row label { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 12px; }
    .dex-market-row input, .dex-market-row select { width: 100%; min-width: 0; box-sizing: border-box; }
    .dex-market-row .dex-market-confirm { grid-column: 1 / -1; flex-direction: row; align-items: center; }
    .dex-market-confirm input { width: auto; }
    #dex-market-editor p, #dex-market-status { overflow-wrap: anywhere; font-size: 12px; }
    @media (max-width: 540px) { .dex-market-row { grid-template-columns: minmax(0, 1fr); } }
    .opportunity-depth { display: block; margin-top: 4px; color: #536171; font-size: 11px; font-weight: 750; overflow-wrap: anywhere; }
    .opportunity-depth.pos { color: var(--green); }
    .opportunity-depth.neg { color: var(--red); }
    .opportunity-borrow { grid-column: 6; grid-row: 1 / 3; display: inline-flex; align-items: center; justify-content: center; min-height: 25px; padding: 3px 7px; border: 1px solid #cdd6e2; border-radius: 6px; color: #536171; background: #f7f9fb; font-size: 11px; font-weight: 750; white-space: nowrap; }
    .opportunity-borrow.open { justify-self: end; min-width: 28px; padding: 3px 6px; border-color: transparent; background: transparent; color: #788696; font-size: 18px; }
    .opportunity-borrow.available { color: #0f7250; border-color: #9fd6c2; background: #ecfaf4; }
    .opportunity-borrow.required { color: #8a5a08; border-color: #e7c37c; background: #fff7e3; }
    .opportunity-empty { padding: 24px 14px; color: var(--muted); text-align: center; }

    @media (min-width: 1101px) {
      .opportunity-row {
        grid-template-columns: 52px minmax(190px, 1.35fr) minmax(130px, .9fr) minmax(104px, .72fr) minmax(108px, .74fr) minmax(332px, 2.35fr) auto;
        grid-template-rows: minmax(44px, auto);
        gap: 8px;
        min-height: 64px;
        padding-block: 8px;
      }
      .opportunity-realized-group {
        grid-column: 6;
        grid-row: 1;
        align-items: center;
        align-self: stretch;
        gap: 8px;
        padding-top: 0;
        border-top: 0;
      }
      .opportunity-borrow {
        grid-column: 7;
        grid-row: 1;
        max-width: 118px;
        white-space: normal;
        text-align: center;
      }
    }

    .template-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
    }

    .template-title {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-weight: 760;
    }

    .template-status {
      margin-left: 4px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 500;
    }

    .template-save {
      min-width: 96px;
      padding: 0 12px;
      font-weight: 650;
    }

    .template-list {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: stretch;
      position: relative;
    }

    .template-list.is-collapsed {
      max-height: 50px;
      overflow: hidden;
    }

    .template-list.is-sorting {
      user-select: none;
    }

    .template-card {
      display: inline-grid;
      grid-template-columns: 34px minmax(0, 1fr) auto;
      align-items: stretch;
      max-width: 360px;
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: hidden;
      background: #fff;
      transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, opacity .16s ease;
    }

    .template-card.is-dragging {
      position: fixed;
      z-index: 80;
      pointer-events: none;
      opacity: .96;
      box-shadow: 0 18px 40px rgba(30, 38, 49, .22);
      transform: scale(1.02);
      transition: none;
    }

    .template-drag-handle {
      display: grid;
      place-items: center;
      height: auto;
      border: 0;
      border-right: 1px solid var(--line);
      border-radius: 0;
      background: #f7f9fc;
      color: var(--muted);
      font-size: 18px;
      font-weight: 800;
      cursor: grab;
      touch-action: none;
      user-select: none;
    }

    .template-drag-handle:active {
      cursor: grabbing;
    }

    .template-placeholder {
      display: inline-block;
      width: 260px;
      min-height: 44px;
      border: 2px dashed var(--blue);
      border-radius: 8px;
      background: rgba(52, 120, 246, .08);
      box-shadow: inset 0 0 0 1px rgba(52, 120, 246, .14);
    }

    .template-use {
      display: grid;
      gap: 1px;
      height: auto;
      min-height: 42px;
      min-width: 180px;
      padding: 6px 10px;
      border: 0;
      border-radius: 0;
      text-align: left;
    }

    .template-use strong {
      font-size: 14px;
      line-height: 1.15;
    }

    .template-use span {
      color: var(--muted);
      font-size: 12px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .template-delete {
      width: 42px;
      height: auto;
      border-width: 0 0 0 1px;
      border-radius: 0;
      color: var(--red);
      font-size: 20px;
      font-weight: 760;
    }

    .template-more {
      display: none;
      width: calc(100% + 24px);
      min-width: 0;
      height: 24px;
      margin: -9px -12px 0;
      padding: 0;
      border-width: 1px 0 0;
      border-color: var(--line);
      border-radius: 0 0 8px 8px;
      background: #fafbfc;
      color: var(--blue);
      font-size: 16px;
      font-weight: 900;
      line-height: 1;
      cursor: pointer;
    }

    .template-more.is-visible {
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .template-more:hover {
      background: #f1f5fb;
      color: #1f63d6;
    }

    .mobile-template-controls { display: none; }

    .template-empty,
    .template-status {
      color: var(--muted);
      font-size: 12px;
    }

    .mapping-panel {
      margin: -4px 0 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--panel);
      box-shadow: var(--shadow);
    }

    .mapping-panel summary {
      min-height: 38px;
      display: flex;
      align-items: center;
      padding: 0 12px;
      cursor: pointer;
      color: var(--muted);
      font-weight: 700;
    }

    .mapping-body {
      display: grid;
      gap: 12px;
      padding: 0 12px 12px;
    }

    .mapping-identity-form {
      display: grid;
      grid-template-columns: minmax(240px, 460px) auto;
      gap: 10px 18px;
      align-items: center;
      padding: 10px 12px;
      border: 1px solid #dbe2eb;
      border-radius: 7px;
      background: #f8fafc;
    }

    .mapping-editor-section-title {
      padding: 4px 0 0;
      color: var(--ink);
      font-size: 14px;
      font-weight: 800;
    }

    .mapping-form {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 10px;
      min-width: 0;
    }
    .mapping-form > * { min-width: 0; }

    .mapping-exchange-field {
      grid-column: 1 / -1;
      margin: 0;
      padding: 0;
      border: 0;
    }

    .mapping-exchange-field legend { padding: 0; }

    .mapping-exchange-options {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      min-height: 40px;
      padding: 6px;
      border: 1px solid #d8e0ea;
      border-radius: 7px;
      background: #f8fafc;
    }

    .mapping-exchange-option {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      min-height: 28px;
      padding: 3px 8px;
      border: 1px solid #d7dde6;
      border-radius: 6px;
      background: #fff;
      color: #445268;
      cursor: pointer;
      font-size: 12px;
      font-weight: 700;
      line-height: 1;
      white-space: nowrap;
    }

    .mapping-exchange-option:has(input:checked) {
      border-color: #aeb8c5;
      background: #edf1f5;
      color: #344054;
      box-shadow: 0 1px 3px rgba(31, 43, 58, .1);
    }

    .mapping-exchange-option input,
    .mapping-form .mapping-exchange-option input {
      width: 14px;
      height: 14px;
      margin: 0;
      accent-color: #526273;
    }

    .mapping-stock-target-field {
      margin: 0;
      padding: 0;
      border: 0;
    }

    .mapping-stock-target-field legend { padding: 0; }

    .mapping-stock-market-options {
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
      min-height: 36px;
      padding: 4px;
      border: 1px solid #dce2ea;
      border-radius: 6px;
      background: #f8fafc;
    }

    .mapping-stock-market-option {
      --stock-ink: #445268;
      --stock-bg: #eef2f6;
      --stock-border: #bac4d0;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      min-height: 26px;
      padding: 2px 7px;
      border: 1px solid #d7dde6;
      border-radius: 5px;
      background: #fff;
      color: #445268;
      cursor: pointer;
      font-size: 11px;
      font-weight: 700;
      line-height: 1;
      white-space: nowrap;
    }

    .mapping-stock-market-option:has(input:checked) {
      border-color: var(--stock-border);
      background: var(--stock-bg);
      color: var(--stock-ink);
    }

    [data-stock-market="korea"] { --stock-ink: #235f9f; --stock-bg: #edf5ff; --stock-border: #8ab5e1; }
    [data-stock-market="us"] { --stock-ink: #62439a; --stock-bg: #f4effc; --stock-border: #ad97d1; }
    [data-stock-market="hongkong"] { --stock-ink: #a13e45; --stock-bg: #fff1f2; --stock-border: #e09aa0; }
    [data-stock-market="china"] { --stock-ink: #94610b; --stock-bg: #fff7e5; --stock-border: #dfbc6a; }
    [data-stock-market="adr"] { --stock-ink: #176b5b; --stock-bg: #eaf7f3; --stock-border: #80bdad; }

    .mapping-stock-market-option input,
    .mapping-form .mapping-stock-market-option input {
      width: 14px;
      height: 14px;
      margin: 0;
      accent-color: var(--stock-ink);
    }

    .mapping-rule-actions {
      display: flex;
      justify-content: flex-end;
      gap: 7px;
    }

    .mapping-rule-actions button { min-width: 120px; height: 36px; padding: 0 14px; }
    .mapping-rule-actions #append-mapping-rule { border-color: #aeb8c5; background: #f4f6f8; color: #344054; font-weight: 720; }
    .mapping-rule-actions #add-mapping { border-color: #2f6ed9; background: #2f6ed9; color: #fff; font-weight: 760; }
    .mapping-rule-actions #add-mapping:hover { border-color: #245dbb; background: #245dbb; }

    .mapping-rule-rows {
      display: grid;
      gap: 7px;
      min-width: 0;
    }

    .mapping-rule-row {
      position: relative;
      display: grid;
      grid-template-columns: 124px 112px minmax(180px, .85fr) 104px minmax(330px, 1.5fr);
      gap: 8px;
      align-items: end;
      min-width: 0;
      padding: 9px 46px 9px 8px;
      border: 1px solid #dce2ea;
      border-left: 4px solid #b5bfcb;
      border-radius: 7px;
      background: #fff;
    }

    .mapping-rule-field { min-width: 0; }
    .mapping-rule-field .field-label,
    .mapping-rule-stock-target > .field-label { min-height: 18px; }
    .mapping-rule-row input,
    .mapping-rule-row select { width: 100%; height: 36px; min-width: 0; }
    .mapping-rule-row[data-market="spot"] .map-rule-market { border-color: #87b7a1; background: #f0f8f4; color: #176b4d; }
    .mapping-rule-row[data-market="futures"] .map-rule-market { border-color: #79b8c6; background: #eaf7fa; color: #0b6577; }
    .mapping-rule-row input:disabled { background: #f1f3f6; color: #8a94a3; cursor: not-allowed; }

    .mapping-rule-stock-target { min-width: 0; }
    .mapping-rule-suggestion {
      grid-column: 2 / -1;
      margin-top: -2px;
      padding-left: 2px;
      color: #80520d;
      font-size: 11px;
      font-weight: 650;
    }
    .mapping-rule-remove {
      position: absolute;
      top: 29px;
      right: 8px;
      width: 30px;
      min-width: 30px;
      height: 36px;
      padding: 0;
      border-color: #e3b8b8;
      background: #fff;
      color: #b42318;
      font-size: 17px;
    }
    .mapping-rule-filter-empty { padding: 14px 10px; border: 1px dashed #cbd3dd; border-radius: 6px; color: var(--muted); font-size: 12px; text-align: center; }

    .mapping-enhancement-toggle {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      width: fit-content;
      min-height: 34px;
      padding: 5px 9px;
      border: 1px solid #cbd6e3;
      border-radius: 6px;
      background: #fff;
      color: #425166;
      font-size: 12px;
      font-weight: 700;
      cursor: pointer;
    }
    .mapping-enhancement-toggle:has(input:checked) { border-color: #80bdad; background: #eaf7f3; color: #176b5b; }
    .mapping-enhancement-toggle input { width: 15px; height: 15px; margin: 0; accent-color: #247b67; }

    .mapping-stock-form {
      display: grid;
      gap: 7px;
      padding: 8px;
      border: 1px solid #d7e0e9;
      border-radius: 7px;
      background: #f8fafc;
      min-width: 0;
    }
    .mapping-stock-form > * { min-width: 0; }
    .mapping-stock-form:not(.is-open) { display: none; }

    .mapping-stock-form .field input,
    .mapping-stock-form .field select { height: 32px; }

    .mapping-stock-toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      min-width: 0;
    }
    .mapping-stock-toolbar strong { color: #2c394a; font-size: 12px; }
    .mapping-stock-toolbar button { height: 30px; min-width: 96px; padding: 0 10px; border-color: #247b67; background: #247b67; color: #fff; font-size: 12px; font-weight: 750; }
    .mapping-stock-toolbar button:hover { border-color: #196653; background: #196653; }

    .mapping-stock-listings {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 6px;
      min-width: 0;
    }

    .mapping-stock-listing,
    .mapping-adr-form {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 76px;
      gap: 4px 6px;
      align-items: end;
      min-width: 0;
      padding: 7px;
      border: 1px solid var(--stock-border);
      border-top: 3px solid var(--stock-border);
      border-radius: 6px;
      background: var(--stock-bg);
    }

    .mapping-stock-listing strong,
    .mapping-adr-form strong {
      grid-column: 1 / -1;
      color: var(--stock-ink);
      font-size: 12px;
    }

    .mapping-adr-form { grid-template-columns: 82px minmax(0, 1fr); }

    .mapping-group-list { display: grid; gap: 10px; }
    .mapping-search {
      width: 100%;
      height: 46px;
      padding: 0 14px;
      border-color: #b9c6d8;
      background: #fbfcfe;
      font-size: 15px;
      font-weight: 650;
    }
    .mapping-group { overflow: hidden; border: 1px solid #dce2ea; border-radius: 7px; background: #fff; }
    .mapping-group-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; min-height: 48px; padding: 8px 10px 8px 12px; background: #fafbfc; }
    .mapping-group-title { color: #202c3b; font-size: 16px; font-weight: 800; }
    .mapping-group-summary { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 12px 9px; background: #fafbfc; }
    .mapping-stock-badge { display: inline-flex; align-items: center; min-height: 25px; padding: 2px 8px; border: 1px solid var(--stock-border); border-radius: 5px; background: var(--stock-bg); color: var(--stock-ink); font-size: 11px; font-weight: 700; white-space: nowrap; }
    .mapping-group-rules { display: grid; border-top: 1px solid #e1e6ed; }
    .mapping-rule-chip {
      display: grid;
      grid-template-columns: 118px 82px minmax(150px, 1fr) 88px minmax(160px, .9fr) auto;
      gap: 8px;
      align-items: center;
      min-height: 50px;
      padding: 7px 10px 7px 12px;
      border-left: 3px solid #c5ccd6;
      background: #fff;
      font-size: 11px;
      line-height: 1.35;
    }
    .mapping-rule-chip + .mapping-rule-chip { border-top: 1px solid #e6eaf0; }
    .mapping-rule-chip:hover { background: #fbfcfe; }
    .mapping-group-actions { display: flex; gap: 6px; }
    .mapping-group-actions button { height: 30px; padding: 0 9px; }

    .mapping-rule-exchange-badge,
    .mapping-rule-market-badge { display: inline-flex; align-items: center; width: fit-content; min-height: 26px; padding: 3px 8px; border-radius: 5px; font-weight: 760; white-space: nowrap; }
    .mapping-rule-exchange-badge { border: 1px solid #c8d0da; background: #f2f4f7; color: #344054; }
    .mapping-rule-market-badge { border: 1px solid #9fc7b5; background: #eff8f4; color: #176b4d; }
    .mapping-rule-chip[data-market="futures"] .mapping-rule-market-badge { border-color: #79b8c6; background: #eaf7fa; color: #0b6577; }
    .mapping-rule-symbol-value,
    .mapping-rule-multiplier-value,
    .mapping-rule-stock-value { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
    .mapping-rule-symbol-value small,
    .mapping-rule-multiplier-value small,
    .mapping-rule-stock-value small { flex: 0 0 auto; color: #7b8797; font-size: 10px; font-weight: 650; }
    .mapping-rule-symbol-value strong,
    .mapping-rule-multiplier-value strong,
    .mapping-rule-stock-value strong { min-width: 0; color: #253244; font-size: 12px; overflow-wrap: anywhere; }
    .mapping-rule-symbol-value em { flex: 0 0 auto; padding: 1px 5px; border-radius: 4px; background: #edf1f5; color: #687586; font-size: 9px; font-style: normal; font-weight: 700; }
    .mapping-rule-stock-value strong { color: #5d4a25; }
    .mapping-rule-row-actions { display: flex; justify-content: flex-end; gap: 4px; }
    .mapping-rule-empty { padding: 12px; color: var(--muted); font-size: 11px; }

    .mapping-rule-edit,
    .mapping-rule-chip .mapping-delete {
      height: 28px;
      min-width: 28px;
      margin: 0;
      padding: 0 7px;
      font-size: 11px;
    }

    .mapping-delete {
      height: 28px;
      padding: 0 10px;
      color: var(--red);
    }

    .mapping-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
    }

    .mapping-actions button {
      padding: 0 12px;
      font-weight: 650;
    }

    .mapping-status {
      color: var(--muted);
      font-size: 12px;
    }

    @media (max-width: 1100px) {
      .mapping-stock-listings { grid-template-columns: repeat(3, minmax(0, 1fr)); }
      .mapping-rule-row { grid-template-columns: 112px 104px minmax(160px, 1fr) 96px; }
      .mapping-rule-stock-target,
      .mapping-rule-suggestion { grid-column: 1 / -1; }
    }

    button {
      height: 34px;
      border: 1px solid var(--line);
      border-radius: 7px;
      background: #fff;
      color: var(--ink);
      font: inherit;
      cursor: pointer;
    }

    button:hover { border-color: #b8c0cb; }
    button:disabled { cursor: wait; color: var(--muted); }

    .refresh {
      min-width: 72px;
      padding: 0 14px;
      font-weight: 650;
    }

    .help-button {
      min-width: 72px;
      padding: 0 14px;
      font-weight: 650;
      border-color: #cbd2dc;
    }

    .range-bar {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
    }

    .range-button {
      min-width: 62px;
      padding: 0 14px;
      font-weight: 650;
    }

    .range-button.is-active {
      border-color: var(--blue);
      background: var(--blue);
      color: #fff;
    }

    .mobile-chart-range { display: none; }

    .status {
      min-height: 20px;
      margin: 0 0 12px;
      color: var(--muted);
      font-size: 13px;
    }

    .status:empty {
      display: none;
    }

    .metrics {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      align-items: stretch;
      gap: 10px;
      margin-bottom: 12px;
    }

    .baseline-panel {
      display: none;
      gap: 8px;
      margin-bottom: 12px;
    }

    .baseline-panel.is-visible { display: grid; }
    .stock-toggles { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
    .stock-toggles label { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); font-weight: 700; }
    .stock-toggles input { width: 16px; height: 16px; }

    .baseline-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      color: var(--muted);
      font-size: 12px;
    }

    .baseline-title { color: var(--ink); font-size: 15px; font-weight: 780; }
    #baseline-note { white-space: nowrap; }
    #baseline-note:empty { display: none; }

    .baseline-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
      align-items: stretch;
    }

    .baseline-grid.has-visible-stocks {
      min-height: 184px;
      grid-auto-rows: 184px;
    }

    .baseline-card {
      min-width: 0;
      display: flex;
      min-height: 142px;
      box-sizing: border-box;
      flex-direction: column;
      padding: 12px 14px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--panel);
      box-shadow: var(--shadow);
    }

    .baseline-card .label { color: var(--muted); font-size: 13px; }
    .baseline-card .label { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
    .baseline-card .value { min-height: 34px; margin-top: 6px; font-size: 27px; font-weight: 780; line-height: 1.2; }
    .baseline-card .detail { min-height: 0; margin-top: 6px; overflow-y: auto; color: var(--muted); font-size: 12px; line-height: 1.4; scrollbar-width: thin; }
    .baseline-stock-usd { display: block; margin-top: 5px; color: #526174; font-size: 12px; font-weight: 700; line-height: 1.25; white-space: nowrap; }
    .baseline-inline-value { display: inline-flex; margin-left: 8px; padding: 3px 7px; border-radius: 6px; background: #eef3f8; color: #526174; font-size: 12px; font-weight: 700; vertical-align: middle; }
    .baseline-compact-line { margin-top: 3px; }
    .baseline-price-limit { font-weight: 780; }
    .baseline-limit-regime { color: #667487; }
    .baseline-stock-session { color: #526174; font-weight: 650; }
    .baseline-intraday-halt { color: #7b5c22; font-weight: 700; }
    .baseline-intraday-halt.triggered { color: #b33d37; }
    .baseline-trading-halt { color: #b33d37; font-weight: 760; }
    .baseline-comparison-summary { padding-bottom: 9px; }
    .baseline-comparison-list { display: grid; gap: 0; margin-top: 5px !important; }
    .baseline-comparison-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(58px, auto); align-items: center; gap: 7px; min-height: 27px; border-top: 1px solid #edf0f4; }
    .baseline-comparison-row:first-child { border-top: 0; }
    .baseline-comparison-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
    .baseline-comparison-basis { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
    .baseline-comparison-row strong { text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; }
    .market-hours-trigger { display: inline-flex; align-items: center; justify-content: center; width: 19px; height: 19px; padding: 0; border: 1px solid #b9c4d2; border-radius: 999px; color: #526174; background: #fff; font-size: 13px; line-height: 1; cursor: pointer; }
    .market-hours-trigger:hover { border-color: var(--blue); color: var(--blue); background: #f4f8ff; }
    .market-status-tag { display: inline-flex; padding: 2px 6px; border-radius: 999px; background: #edf1f6; color: #4c5868; font-size: 11px; font-weight: 750; }
    .market-status-tag.open { background: #e6f6ee; color: #1f7b4d; }
    .market-status-tag.halt { background: #fdebea; color: #b33d37; }

    .metric,
    .chart-panel {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--panel);
      box-shadow: var(--shadow);
    }

    .metric {
      height: auto;
      min-height: 100px;
      box-sizing: border-box;
      padding: 11px 12px;
      overflow: visible;
    }

    .metric .label {
      color: var(--muted);
      font-size: 12px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .metric .value {
      margin-top: 6px;
      font-size: clamp(20px, 2.2vw, 28px);
      font-weight: 780;
      letter-spacing: 0;
      line-height: 1.08;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: clip;
    }

    .metric .value.compact { font-size: clamp(17px, 1.8vw, 23px); }
    .metric .value.tiny { font-size: clamp(14px, 1.45vw, 18px); }

    .metric .value.metric-stack {
      display: grid;
      gap: 3px;
      margin-top: 5px;
      font-size: 18px;
      line-height: 1.12;
      white-space: normal;
      overflow: visible;
    }

    .metric-line {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 10px;
      min-width: 0;
    }

    .metric-line span {
      flex: 0 0 auto;
      color: var(--muted);
      font-size: 12px;
      font-weight: 740;
    }

    .metric-line strong {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: clamp(17px, 1.85vw, 23px);
      font-weight: 780;
      letter-spacing: 0;
    }

    .metric .detail {
      margin-top: 2px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.35;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .pos { color: var(--green); }
    .neg { color: var(--red); }
    .flat { color: var(--amber); }

    .funding-details {
      display: none;
      margin-top: 10px;
      padding-top: 10px;
      border-top: 1px solid var(--line);
    }

    .funding-details.is-open { display: block; }

    .funding-details-toggle {
      margin-left: auto;
      height: 30px;
      padding: 0 12px;
      font-weight: 650;
    }

    .chart-panel {
      position: relative;
      padding: 14px;
      overflow: hidden;
    }

    .chart-head {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      gap: 12px;
      margin-bottom: 8px;
    }

    .chart-head-actions { display: flex; flex: 1 1 auto; align-items: center; justify-content: flex-end; gap: 9px; min-width: 0; }
    .liquidity-warning,
    .granularity-warning { position: relative; flex: 0 0 auto; }
    .liquidity-warning { display: inline-flex; align-items: center; align-self: center; }
    .liquidity-warning[hidden] { display: none; }
    .liquidity-warning-button,
    .granularity-warning-button { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 1px solid #e1a53b; border-radius: 50%; background: #fff6df; color: #9a6814; font-size: 16px; font-weight: 850; line-height: 1; cursor: pointer; box-shadow: 0 2px 7px rgba(154,104,20,.13); }
    .liquidity-warning-button { width: 26px; height: 26px; border-color: rgba(225,77,77,.55); background: #fff1f1; color: #b42318; font-size: 15px; box-shadow: 0 2px 8px rgba(180,35,24,.14); transition: border-color .14s ease, background .14s ease, box-shadow .14s ease, transform .14s ease; }
    .liquidity-warning-button:hover,
    .liquidity-warning-button[aria-expanded="true"] { border-color: #cc3d3d; background: #ffe1e1; color: #8f2424; box-shadow: 0 0 0 3px rgba(225,77,77,.12); transform: translateY(-1px); }
    .liquidity-warning-button:focus-visible { outline: 3px solid rgba(225,77,77,.22); outline-offset: 2px; }
    .granularity-warning-button:hover, .granularity-warning-button[aria-expanded="true"] { border-color: #cc8611; background: #ffedbd; color: #7d5008; }
    .granularity-warning-button:focus-visible { outline: 3px solid rgba(225,165,59,.28); outline-offset: 2px; }
    .liquidity-warning-popover { position: fixed; z-index: 60; top: 0; left: 0; display: grid; width: min(420px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; border: 1px solid var(--line); border-top: 3px solid var(--red); border-radius: 8px; background: #fff; color: var(--ink); box-shadow: 0 20px 48px rgba(20,28,38,.22); font-size: 13px; line-height: 1.5; }
    .granularity-warning-popover { position: absolute; z-index: 45; top: calc(100% + 9px); right: 0; display: grid; gap: 5px; width: min(390px, calc(100vw - 36px)); padding: 11px 13px; border: 1px solid #edc26f; border-radius: 9px; background: #fffaf0; color: #6f4b0d; box-shadow: 0 13px 32px rgba(63,47,19,.18); font-size: 13px; line-height: 1.55; }
    .liquidity-warning-popover[hidden],
    .granularity-warning-popover[hidden] { display: none; }
    .liquidity-warning-popover-head { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
    .liquidity-warning-popover-head strong { min-width: 0; font-size: 14px; font-weight: 800; }
    .liquidity-warning-popover-icon { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(225,77,77,.12); color: #a52d2d; font-weight: 850; }
    .liquidity-warning-popover-close { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 28px; height: 28px; margin-left: auto; padding: 0; border: 1px solid transparent; border-radius: 50%; background: transparent; color: var(--muted); font-size: 21px; line-height: 1; cursor: pointer; }
    .liquidity-warning-popover-close:hover { border-color: var(--line); background: #f1f3f6; color: var(--ink); }
    .liquidity-warning-popover-close:focus-visible { outline: 2px solid rgba(52,120,246,.3); outline-offset: 1px; }
    .liquidity-warning-section { display: grid; gap: 7px; }
    .liquidity-warning-section[hidden] { display: none; }
    .liquidity-warning-section + .liquidity-warning-section { padding-top: 10px; border-top: 1px solid var(--line); }
    .liquidity-warning-section > strong { padding: 0 12px; font-size: 13px; font-weight: 800; }
    .liquidity-warning-details { display: grid; gap: 7px; padding: 11px 12px; }
    .liquidity-warning-leg { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: #fafbfd; }
    .liquidity-warning-leg.is-low { border-color: rgba(225,77,77,.32); border-left: 3px solid var(--red); background: rgba(225,77,77,.06); }
    .liquidity-warning-leg-label { min-width: 0; overflow-wrap: anywhere; color: #394150; }
    .liquidity-warning-leg-value { white-space: nowrap; color: #344054; font-variant-numeric: tabular-nums; font-weight: 780; }
    .liquidity-warning-leg.is-low .liquidity-warning-leg-value { color: #b33232; }
    .liquidity-warning-help { padding: 10px 12px 12px; border-top: 1px solid var(--line); background: #fafbfd; color: var(--muted); font-size: 12px; }
    .granularity-warning-help { color: #8a6a32; font-size: 12px; }

    .chart-title {
      font-size: 16px;
      font-weight: 760;
    }

    .instrument-index-link {
      display: inline;
      height: auto;
      padding: 0;
      border: 0;
      border-bottom: 1px dashed currentColor;
      border-radius: 0;
      background: transparent;
      color: #315eaa;
      font: inherit;
      cursor: pointer;
    }
    .instrument-index-link:disabled { border-bottom: 0; color: var(--muted); cursor: default; }

    .index-modal { width: min(920px, 94vw); max-height: 86vh; overflow: auto; border-radius: 10px; background: #fff; box-shadow: 0 24px 60px rgba(20,28,38,.24); }
    .index-body { padding: 14px 16px 18px; }
    .index-tabs { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin-bottom: 12px; }
    .index-tabs > button { min-width: 0; overflow-wrap: anywhere; }
    .index-back-button { display: none; align-items: center; gap: 7px; margin: 0 0 12px; padding: 5px 11px 5px 7px; border: 1px solid #cfd7e3; border-radius: 999px; background: #f8fafc; color: #344054; font: inherit; font-weight: 700; cursor: pointer; }
    .index-back-button span { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: #e8eef7; color: #245bb8; font-size: 25px; line-height: 1; }
    .index-back-button:hover { border-color: #9fb8e6; background: #f0f5ff; color: #245bb8; }
    .index-tabs button.is-active { border-color: var(--blue); background: #eef4ff; color: #1f63d6; }
    .index-similarity {
      display: grid;
      grid-template: "label value" auto "method value" auto / minmax(0, 1fr) auto;
      align-items: center;
      column-gap: 10px;
      min-width: 164px;
      min-height: 46px;
      margin-left: auto;
      padding: 6px 10px;
      border: 1px solid #cfd8e6;
      border-radius: 8px;
      background: #f7f9fc;
      color: #344054;
    }
    .index-similarity.is-fallback { border-color: #e4c884; background: #fffaf0; }
    .index-similarity.is-unavailable { border-style: dashed; color: var(--muted); }
    .index-similarity-label { grid-area: label; display: inline-flex; align-items: center; gap: 5px; min-width: 0; font-size: 11px; font-weight: 750; white-space: nowrap; }
    .index-similarity-value { grid-area: value; font-size: 18px; line-height: 1; }
    .index-similarity-method { grid-area: method; overflow-wrap: anywhere; color: var(--muted); font-size: 10px; line-height: 1.25; }
    .index-similarity-help { width: 15px; height: 15px; font-size: 9px; }
    .index-price-summary { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin-bottom: 10px; }
    .index-price-card { flex: 1 1 150px; min-width: 0; padding: 10px 12px; border: 1px solid #dbe3ef; border-radius: 8px; background: #f8fafc; }
    .index-price-label { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
    .index-price-help { width: 14px; height: 14px; font-size: 9px; }
    .index-price-help::after { width: min(260px, 72vw); }
    .index-price-help.opens-left::after { right: 0; left: auto; }
    .index-price-value { display: block; overflow-wrap: anywhere; color: var(--text); font-size: 15px; font-weight: 800; }
    .index-price-value.pos { color: var(--green); }
    .index-price-value.neg { color: var(--red); }
    .index-price-empty { flex: 1 1 100%; padding: 10px 12px; border: 1px dashed #cfd7e3; border-radius: 8px; color: var(--muted); font-size: 12px; }
    .index-summary { margin-bottom: 10px; color: var(--muted); font-size: 12px; }
    .index-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
    .index-history-toggle { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; padding: 8px 12px; border: 1px solid #ccd9ef; border-radius: 8px; background: #f2f6fd; color: #315cc5; font: inherit; font-weight: 650; cursor: pointer; }
    .index-history-toggle:hover { background: #e8effc; border-color: #9eb8e6; }
    .index-history-count { padding: 2px 7px; border-radius: 5px; background: #dfe9fc; font-variant-numeric: tabular-nums; }
    .index-history-period { color: var(--muted); font-weight: 400; }
    .index-history-back { flex-shrink: 0; padding: 8px 10px; border: 1px solid #ccd9ef; border-radius: 7px; background: #f2f6fd; color: #315cc5; font: inherit; font-size: 12px; cursor: pointer; }
    .index-history-back[hidden] { display: none; }
    .index-history-controls { flex: 1 0 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; }
    .index-history-controls[hidden] { display: none; }
    .index-history-controls button { padding: 6px 10px; font-size: 12px; }
    .index-history-controls button:disabled { opacity: .45; cursor: not-allowed; }
    .index-modal.is-history > .help-head { position: sticky; top: 0; z-index: 2; flex-wrap: wrap; gap: 8px; background: #fff; }
    .index-modal.is-history > .help-head h2 { flex: 1 1 160px; font-size: 15px; }
    .index-history-toggle:focus-visible { outline: 2px solid #315cc5; outline-offset: 2px; }
    .index-change-history { margin-bottom: 14px; font-size: 12px; overflow-wrap: anywhere; }
    .index-change-history > p { color: var(--muted); margin: 0 0 8px; }
    .index-history-group { margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f7f9fc; }
    .index-history-group h3 { margin: 0 0 8px; font-size: 12px; }
    .index-history-group ul { list-style: none; margin: 0; padding: 0; }
    .index-history-group li { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 7px 0; border-top: 1px solid var(--line); }
    .index-history-group li strong { flex: 1 1 180px; }
    .index-history-group li > span { flex: 2 1 240px; }
    .index-weight-direction { display: inline-block; margin-right: 6px; font-weight: 700; }
    .index-weight-direction.up { color: var(--green); }
    .index-weight-direction.down { color: var(--red); }
    .index-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
    .index-table { width: 100%; min-width: 760px; border-collapse: collapse; }
    .index-table th, .index-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
    .index-table th { background: #f7f9fc; color: var(--muted); font-size: 12px; }
    .index-table tr:last-child td { border-bottom: 0; }
    .index-change-tag { display: inline-flex; align-items: center; margin-left: 7px; padding: 2px 7px; border-radius: 999px; font-family: inherit; font-size: 11px; font-weight: 800; line-height: 1.2; vertical-align: middle; cursor: help; }
    .index-change-tag.added { color: #137a55; border: 1px solid rgba(22, 136, 95, .25); background: rgba(22, 136, 95, .10); }
    .index-change-tag.changed { color: #936018; border: 1px solid rgba(217, 151, 42, .32); background: rgba(217, 151, 42, .12); }
    .index-change-tag.removed { color: var(--red); border: 1px solid rgba(225, 77, 77, .28); background: rgba(225, 77, 77, .10); }
    .index-change-tag:hover, .index-change-tag:focus-visible, .index-change-tag[aria-expanded="true"] { outline: none; box-shadow: 0 0 0 3px rgba(52, 120, 246, .16); }
    .index-weight-change { display: block; margin-top: 3px; color: #936018; font-size: 11px; font-weight: 650; white-space: nowrap; }
    .index-component-removed td { color: var(--muted); background: #fff8f8; }
    .index-action-link { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border: 1px solid #b9cdf6; border-radius: 999px; background: #f2f6ff; color: #245bb8; font: inherit; font-weight: 750; cursor: pointer; }
    .index-action-link::after { content: "→"; font-size: 11px; }
    .index-action-link:hover { border-color: var(--blue); background: #e8f0ff; color: #174da8; }
    .index-network-status { display: grid; gap: 6px; }
    .index-network-group { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
    .index-network-label { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; background: #eef1f5; color: var(--muted); font-size: 11px; font-weight: 800; }
    .coin-network-tag { display: inline-flex; padding: 2px 7px; border-radius: 999px; font-size: 12px; font-weight: 750; overflow-wrap: anywhere; }
    .coin-network-tag.available { color: var(--green); background: rgba(22, 136, 95, .10); border: 1px solid rgba(22, 136, 95, .24); }
    .coin-network-tag.paused { color: var(--red); background: rgba(225, 77, 77, .10); border: 1px solid rgba(225, 77, 77, .24); }
    .coin-network-empty { color: var(--muted); font-size: 12px; }
    .network-detail { width: min(680px, 94vw); max-height: 84vh; overflow: auto; border-radius: 10px; background: #fff; box-shadow: 0 24px 60px rgba(20,28,38,.24); }
    .network-detail-body { padding: 16px; display: grid; gap: 14px; }
    .network-section { padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
    .network-section h3 { margin: 0 0 8px; }
    .delisting-modal { position: fixed; inset: 50% auto auto 50%; z-index: 70; display: none; width: min(620px, 94vw); max-height: 84vh; margin: 0; padding: 0; overflow: auto; transform: translate(-50%, -50%); border: 0; border-radius: 10px; background: #fff; box-shadow: 0 24px 60px rgba(20,28,38,.24); }
    .delisting-modal.is-open { display: block; }
    .delisting-modal:popover-open { display: block; }
    .delisting-modal::backdrop { background: rgba(32, 36, 42, .42); }
    .delisting-body { display: grid; gap: 12px; padding: 16px; }
    .delisting-list { display: grid; gap: 10px; }
    .delisting-item { display: grid; gap: 7px; padding: 12px; border: 1px solid rgba(240, 164, 43, .42); border-radius: 9px; background: rgba(240, 164, 43, .07); }
    .delisting-item.danger { border-color: rgba(225, 77, 77, .34); background: rgba(225, 77, 77, .06); }
    .delisting-item-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-weight: 800; }
    .delisting-item-status { color: #8a5a08; }
    .delisting-item.danger .delisting-item-status { color: #9f2f2f; }
    .delisting-item-detail { display: grid; gap: 3px; color: var(--muted); font-size: 12px; }
    .delisting-item-detail strong { color: var(--ink); }
    .delisting-item-time { margin-top: 3px; color: #8a5a08; font-size: 14px; font-weight: 800; }
    .delisting-item.danger .delisting-item-time { color: #9f2f2f; }
    .token-coverage-modal { width: min(920px, 96vw); max-height: 88vh; overflow: auto; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: 0 24px 60px rgba(20,28,38,.24); }
    .token-coverage-modal .help-head { z-index: 4; }
    .token-coverage-modal .help-tip::after { top: calc(100% + 8px); bottom: auto; left: 0; transform: translateY(-4px); }
    .token-coverage-modal .help-tip:hover::after,
    .token-coverage-modal .help-tip:focus::after { transform: translateY(0); }
    .token-coverage-body { display: grid; gap: 12px; padding: 15px 16px 18px; }
    .token-coverage-list { display: grid; gap: 8px; }
    .token-coverage-token-group { display: grid; gap: 8px; padding: 14px; border: 1px solid #dce3ec; border-radius: 10px; background: #f8fafc; }
    .token-coverage-token-group.is-warning { border-color: #edcb83; background: #fffaf0; }
    .token-coverage-token-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 16px; }
    .token-coverage-token-counts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
    .token-coverage-token-count { padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 780; white-space: nowrap; }
    .token-coverage-token-count.is-spot { background: #e5f6ed; color: #176b4d; box-shadow: inset 0 0 0 1px #b9dfce; }
    .token-coverage-token-count.is-futures { background: #eaf1fc; color: #315eaa; box-shadow: inset 0 0 0 1px #c9d8f1; }
    .token-coverage-token-count.is-unknown { background: #eef1f5; color: #687587; }
    .token-coverage-token-group.is-warning .token-coverage-token-count.is-unknown { background: #ffedbd; color: #865708; }
    .token-coverage-token-status { color: var(--muted); font-size: 11px; }
    .token-coverage-columns { display: grid; grid-template-columns: minmax(110px, .58fr) minmax(210px, 1fr) minmax(145px, .8fr) minmax(145px, .8fr); gap: 16px; padding: 2px 12px 0; color: #8a96a6; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
    .token-coverage-item { display: grid; grid-template-columns: minmax(110px, .58fr) minmax(210px, 1fr) minmax(145px, .8fr) minmax(145px, .8fr); gap: 16px; align-items: center; padding: 11px 12px; border: 1px solid #dce3ec; border-radius: 9px; background: #fff; box-shadow: 0 2px 6px rgba(39,56,78,.04); }
    .token-coverage-exchange { font-size: 14px; font-weight: 820; }
    .token-coverage-markets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
    .token-coverage-market { padding: 3px 7px; border-radius: 999px; font-size: 11px; font-weight: 750; overflow-wrap: anywhere; }
    .token-coverage-market.is-spot { background: #e5f6ed; color: #176b4d; box-shadow: inset 0 0 0 1px #b9dfce; }
    .token-coverage-market.is-futures { background: #eaf1fc; color: #315eaa; box-shadow: inset 0 0 0 1px #c9d8f1; }
    .token-coverage-coin-action { display: block; min-width: 0; }
    .token-coverage-coin-action-label { display: none; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; font-size: 11px; font-weight: 850; }
    .token-coverage-coin-action.is-deposit .token-coverage-coin-action-label { background: #e5f6ed; color: #176b4d; box-shadow: inset 0 0 0 1px #b9dfce; }
    .token-coverage-coin-action.is-withdraw .token-coverage-coin-action-label { background: #eaf1fc; color: #315eaa; box-shadow: inset 0 0 0 1px #c9d8f1; }
    .token-coverage-coin-networks { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; width: 100%; min-width: 0; }
    .token-coverage-coin-network { display: inline-flex; max-width: 100%; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 750; line-height: 1.25; overflow-wrap: anywhere; }
    .token-coverage-coin-network.is-available { border: 1px solid rgba(22, 136, 95, .24); background: rgba(22, 136, 95, .10); color: var(--green); }
    .token-coverage-coin-network.is-paused { border: 1px solid rgba(225, 77, 77, .24); background: rgba(225, 77, 77, .10); color: var(--red); }
    .token-coverage-coin-empty { color: var(--muted); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
    .delisting-calendar-modal { width: min(980px, 96vw); max-height: 88vh; overflow: auto; border-radius: 10px; background: #fff; box-shadow: 0 24px 60px rgba(20,28,38,.24); }
    .delisting-calendar-head { position: sticky; z-index: 5; }
    .delisting-calendar-head-actions { position: relative; display: flex; align-items: center; gap: 8px; }
    .delisting-calendar-help { width: 32px; min-width: 32px; height: 32px; padding: 0; border-radius: 999px; color: #526174; font-weight: 800; }
    .delisting-calendar-help-popover { position: absolute; z-index: 6; top: calc(100% + 6px); right: 42px; display: none; width: min(390px, calc(100vw - 34px)); padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); box-shadow: 0 14px 34px rgba(20,28,38,.18); font-size: 12px; line-height: 1.55; }
    .delisting-calendar-help:hover + .delisting-calendar-help-popover,
    .delisting-calendar-help:focus-visible + .delisting-calendar-help-popover,
    .delisting-calendar-help-popover.is-open { display: grid; gap: 5px; }
    .delisting-calendar-help-popover strong { color: var(--ink); }
    .delisting-calendar-help-popover span { display: flex; align-items: center; gap: 7px; }
    .delisting-calendar-help-popover small { margin-top: 3px; }
    .urgency-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
    .urgency-dot.critical { background: #d93c3c; }
    .urgency-dot.urgent { background: #e98024; }
    .urgency-dot.warning { background: #d5a315; }
    .urgency-dot.normal { background: #3975f6; }
    .delisting-calendar-body { display: grid; gap: 12px; padding: 16px; }
    .delisting-calendar-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
    .delisting-calendar-search input { width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
    .delisting-calendar-search button { height: 38px; }
    .delisting-calendar-multi-filter { display: inline-flex; align-items: center; gap: 8px; width: fit-content; color: var(--muted); font-size: 13px; cursor: pointer; user-select: none; }
    .delisting-calendar-multi-filter input { width: 16px; height: 16px; margin: 0; accent-color: var(--blue); cursor: pointer; }
    .delisting-calendar-list { display: grid; gap: 9px; }
    .delisting-group { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
    .delisting-group-head { width: 100%; height: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: 0; background: #f5f7fa; text-align: left; }
    .delisting-group-name { color: var(--ink); font-size: 15px; font-weight: 800; }
    .delisting-group-count { color: var(--muted); font-size: 12px; font-weight: 700; }
    .delisting-group-chevron { color: var(--muted); font-size: 13px; transition: transform .15s ease; }
    .delisting-group-head[aria-expanded="false"] .delisting-group-chevron { transform: rotate(-90deg); }
    .delisting-table-wrap { overflow-x: auto; }
    .delisting-calendar-table { width: 100%; min-width: 700px; border-collapse: collapse; }
    .delisting-calendar-table th, .delisting-calendar-table td { padding: 9px 11px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
    .delisting-calendar-table th { position: static; background: #fff; color: var(--muted); font-size: 11px; }
    .delisting-calendar-table tr:last-child td { border-bottom: 0; }
    .delisting-calendar-table td:first-child { font-weight: 800; overflow-wrap: anywhere; white-space: normal; }
    .delisting-calendar-table tr.critical { background: rgba(217, 60, 60, .07); }
    .delisting-calendar-table tr.urgent { background: rgba(233, 128, 36, .08); }
    .delisting-calendar-table tr.warning { background: rgba(213, 163, 21, .08); }
    .delisting-calendar-table tr.normal { background: rgba(57, 117, 246, .05); }
    .delisting-calendar-empty { padding: 22px 12px; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); text-align: center; }
    @media (max-width: 700px) {
      .delisting-calendar-body { padding: 12px 10px 16px; }
      .delisting-calendar-search { grid-template-columns: 1fr auto; }
      .delisting-calendar-search input, .delisting-calendar-search button { height: 42px; }
    }

    .chart-title-group {
      display: flex;
      flex-wrap: wrap;
      align-items: baseline;
      gap: 8px 12px;
      min-width: 0;
    }

    .range-extremes {
      display: inline-flex;
      flex-wrap: wrap;
      gap: 5px 10px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 650;
    }

    .range-extremes .range-high { color: var(--green); }
    .range-extremes .range-low { color: var(--red); }

    .settlement-tag {
      display: inline-block;
      margin-left: 6px;
      padding: 1px 5px;
      border: 1px solid var(--line);
      border-radius: 999px;
      color: var(--muted);
      font-size: 10px;
      line-height: 1.4;
      vertical-align: 1px;
    }

    .parameter-tag {
      display: inline-flex;
      align-items: center;
      margin-left: 7px;
      padding: 1px 6px;
      border: 1px solid rgba(240, 164, 43, .55);
      border-radius: 999px;
      background: rgba(240, 164, 43, .12);
      color: #9a640a;
      font-size: 11px;
      font-weight: 760;
      line-height: 1.4;
      vertical-align: 1px;
      white-space: nowrap;
    }

    .funding-value-with-parameters { white-space: nowrap; }
    .rate-annual { display: block; margin-top: 2px; color: #7a8696; font-size: 11px; font-weight: 500; }
    .funding-rate-status { display: block; margin-top: 3px; color: #9a640a; font-size: 10px; font-weight: 700; }
    .funding-rate-status.not-due { color: var(--muted); }

    .parameter-event-line {
      stroke: var(--amber);
      stroke-width: 2;
      stroke-dasharray: 5 4;
      pointer-events: none;
    }

    .parameter-event-trigger {
      color: #9a640a;
      cursor: pointer;
      outline: none;
    }

    .parameter-event-badge {
      fill: #fff9ed;
      stroke: currentColor;
      stroke-width: 1.3;
      transition: fill .15s ease, stroke-width .15s ease;
    }

    .parameter-event-badge-text {
      fill: currentColor;
      font-size: 10px;
      font-weight: 760;
      letter-spacing: 0;
      pointer-events: none;
    }

    .parameter-event-line.short { stroke: var(--violet); }
    .parameter-event-trigger.short { color: #7040b5; }
    .parameter-event-trigger.short .parameter-event-badge { fill: #f8f2ff; }
    .parameter-event-line.both { stroke: var(--blue); }
    .parameter-event-trigger.both { color: #315fc8; }
    .parameter-event-trigger.both .parameter-event-badge { fill: #eef4ff; }
    .parameter-event-trigger:hover .parameter-event-badge,
    .parameter-event-trigger:focus .parameter-event-badge { fill: #fff; stroke-width: 2; }
    .parameter-event-trigger:focus-visible .parameter-event-badge { filter: drop-shadow(0 0 3px rgba(49, 95, 200, .38)); }
    .parameter-event-tooltip-item { display: grid; gap: 2px; padding-top: 8px; border-top: 1px solid var(--line); }
    .parameter-event-tooltip-item + .parameter-event-tooltip-item { margin-top: 8px; }
    .parameter-event-tooltip-item > strong { color: #344054; }
    .parameter-event-tooltip-item > span { line-height: 1.45; }
    .parameter-event-tooltip-item > small { color: var(--muted); }

    .funding-parameter-row td { background: #fff9ed; color: #6f5420; }
    .funding-parameter-detail { display: block; margin-top: 3px; color: #8a6828; font-size: 12px; }
    .funding-head-title { display: block; }
    .funding-head-parameter-note {
      display: block;
      margin-top: 4px;
      color: #a56a0b;
      font-size: 11px;
      font-weight: 650;
      line-height: 1.25;
      white-space: nowrap;
    }
    .funding-head-parameter-time { display: block; margin-top: 2px; color: #7a8696; font-weight: 550; }
    .parameter-change-tag { color: #936018; border-color: rgba(217, 151, 42, .38); background: rgba(217, 151, 42, .12); }

    .funding-scenario-modal { width: min(920px, 94vw); max-height: 90vh; overflow: auto; border-radius: 10px; background: #fff; box-shadow: 0 24px 60px rgba(20,28,38,.24); }
    .funding-scenario-body { padding: 14px 16px 18px; }
    .funding-scenario-warning { margin-bottom: 10px; padding: 10px 12px; border: 1px solid #f0c879; border-radius: 8px; background: #fff8e8; color: #80520c; font-size: 12px; font-weight: 700; }
    .funding-scenario-context { margin-bottom: 12px; color: var(--muted); font-size: 12px; }
    .funding-scenario-tabs { display: inline-flex; gap: 4px; margin-bottom: 14px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #f3f6fa; }
    .funding-scenario-tabs button { padding: 7px 14px; border: 0; border-radius: 7px; background: transparent; color: #5c6675; font: inherit; font-weight: 750; cursor: pointer; }
    .funding-scenario-tabs button[aria-selected="true"] { background: #fff; color: #245fd0; box-shadow: 0 1px 4px rgba(33,48,73,.14); }
    .funding-scenario-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; }
    .funding-scenario-grid .field { min-width: 0; }
    .funding-scenario-grid .field:nth-child(3n+2) .help-tip::after,
    .funding-scenario-grid .field:nth-child(3n) .help-tip::after { right: 0; left: auto; }
    .funding-scenario-mode { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
    .funding-scenario-mode > .field { max-width: 420px; }
    .funding-scenario-position { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .funding-scenario-secondary { margin-top: 10px; padding: 7px 11px; border: 1px solid #c9d4e4; border-radius: 7px; background: #f8fafc; color: #3f5878; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
    .funding-scenario-actions { display: flex; gap: 8px; margin-top: 14px; }
    .funding-scenario-actions button { min-height: 36px; padding: 8px 14px; border: 1px solid #c9d4e4; border-radius: 7px; background: #fff; font: inherit; font-weight: 750; cursor: pointer; }
    .funding-scenario-actions .confirm { border-color: var(--blue); background: var(--blue); color: #fff; }
    .funding-scenario-error { min-height: 18px; margin-top: 8px; color: var(--red); font-size: 12px; }
    .funding-scenario-result { margin-top: 8px; }
    .funding-scenario-result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
    .funding-scenario-result-card { min-width: 0; padding: 10px 12px; border: 1px solid #dbe3ef; border-radius: 8px; background: #f8fafc; }
    .funding-scenario-result-card:nth-child(n+4) .help-tip::after { right: 0; left: auto; }
    .funding-scenario-result-label { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
    .funding-scenario-result-value { display: block; margin-top: 5px; overflow-wrap: anywhere; font-size: 16px; font-weight: 800; }
    .funding-scenario-result-value.pos { color: var(--green); }
    .funding-scenario-result-value.neg { color: var(--red); }
    .funding-scenario-formula-panel { display: grid; gap: 7px; margin-top: 10px; padding: 12px 14px; border: 1px solid #cfdcf0; border-radius: 9px; background: #f5f8fe; color: #465164; font-size: 12px; line-height: 1.55; }
    .funding-scenario-formula-panel > strong { color: #28364b; font-size: 13px; }
    .funding-scenario-formula-panel p { margin: 0; }
    .funding-scenario-formula-text { overflow-x: auto; padding: 8px 10px; border-radius: 7px; background: #20242a; color: #fff; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; white-space: nowrap; }
    .funding-scenario-confidence-reason { padding-top: 7px; border-top: 1px dashed #cbd6e7; color: #785415; font-weight: 680; }
    .funding-scenario-breakdown { margin-top: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #465164; font-size: 12px; line-height: 1.7; }
    .funding-scenario-breakdown-row { display: grid; grid-template-columns: auto 16px minmax(0, 1fr); align-items: center; gap: 5px; padding: 3px 0; }
    .funding-scenario-breakdown-row + .funding-scenario-breakdown-row { border-top: 1px dashed #e4e8ef; }
    .funding-scenario-breakdown-label { color: var(--muted); font-weight: 700; }
    .funding-scenario-breakdown-row strong { text-align: right; overflow-wrap: anywhere; }
    .funding-scenario-breakdown-row:nth-child(n+4) .help-tip::after { right: 0; left: auto; }
    .funding-scenario-result-warning { margin-top: 8px; color: #8a5c16; font-size: 11px; line-height: 1.55; }

    .chart-note {
      flex: 0 1 1040px;
      width: clamp(760px, 64vw, 1040px);
      min-width: 0;
      max-width: 1040px;
      color: var(--muted);
      font-size: 12px;
      text-align: right;
      line-height: 1.45;
    }

    .book-depth-line {
      display: grid;
      grid-template-columns: minmax(205px, 1fr) 104px 92px 6px 104px 92px minmax(205px, 1fr);
      align-items: baseline;
      gap: 3px 8px;
      height: 27px;
      min-width: 0;
      overflow: hidden;
      padding: 3px 0;
      line-height: 1.45;
      white-space: nowrap;
      font-variant-numeric: tabular-nums;
    }
    .book-depth-line + .book-depth-line { border-top: 1px solid #edf0f4; }
    .book-depth-instrument { display: flex; align-items: baseline; gap: 6px; min-width: 0; overflow: visible; overflow-wrap: anywhere; }
    .book-depth-instrument .instrument-index-link { display: inline; max-width: 100%; overflow: visible; overflow-wrap: anywhere; text-overflow: clip; vertical-align: bottom; white-space: normal; }
    .book-side-label { display: inline-flex; flex: 0 0 20px; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 5px; font-size: 11px; font-weight: 850; line-height: 1; }
    .book-side-label.long { background: #eaf1ff; color: #245fc5; }
    .book-side-label.short { background: #f1eafb; color: #7040b5; }
    .book-quote-field { display: inline-flex; align-items: baseline; gap: 4px; min-width: 0; }
    .book-quote-field.buy-price, .book-quote-field.buy-depth, .book-quote-field.sell-price, .book-quote-field.sell-depth { width: auto; }
    .book-quote-label { flex: 0 0 auto; color: #7a8696; white-space: nowrap; }
    .book-quote-value { min-width: 0; overflow: hidden; font-weight: 760; text-overflow: ellipsis; white-space: nowrap; }
    .book-quote-field.buy-price .book-quote-value { color: #2463d4; }
    .book-quote-field.buy-depth .book-quote-value { color: #16885f; }
    .book-quote-field.sell-price .book-quote-value { color: #d14c45; }
    .book-quote-field.sell-depth .book-quote-value { color: #b7791f; }
    .book-quote-separator { flex: 0 0 8px; color: #a0a8b4; text-align: center; }
    .book-depth-metrics { min-width: 0; overflow-wrap: anywhere; color: #6b7280; font-size: 11px; text-align: right; white-space: nowrap; }
    .book-depth-ratio { flex: 0 0 auto; padding: 1px 5px; border-radius: 4px; background: #f0f2f5; color: #6b7280; font-size: 10px; white-space: nowrap; }
    .depth-spread-help-button, .book-spread-help-button { display: inline; height: auto; padding: 0; border: 0; border-bottom: 1px dashed currentColor; border-radius: 0; background: transparent; font: inherit; font-weight: 700; cursor: pointer; }
    .book-spread-help-button { color: #315fc8; }
    .depth-spread-help-button { color: #b64c3e; }
    .book-spread-help-button:hover { color: #174da8; }
    .depth-spread-help-button:hover { color: #8f2f24; }
    .depth-spread-help-button:focus-visible, .book-spread-help-button:focus-visible { outline: 2px solid rgba(72,111,190,.28); outline-offset: 2px; }
    .depth-spread-modal { width: min(620px, 100%); }
    .depth-spread-current { padding: 10px 12px; border: 1px solid #f0d0ca; border-radius: 8px; background: #fff7f5; color: #6f342d; font-weight: 650; line-height: 1.65; }

    @media (max-width: 1100px) {
      .chart-head { display: block; }
      .chart-head-actions { justify-content: flex-start; margin-top: 5px; }
      .chart-note { width: 100%; max-width: none; text-align: left; }
    }

    @media (max-width: 1400px) and (min-width: 1101px) {
      .book-depth-line { grid-template-columns: minmax(210px, 1fr) 112px 92px 8px 112px 92px; height: 47px; }
      .book-depth-metrics { grid-column: 2 / -1; grid-row: 2; text-align: right; }
    }

    @media (min-width: 1101px) {
      #spread-view .chart-panel > .chart-head { display: grid; grid-template-columns: minmax(280px, .42fr) minmax(0, 1fr); align-items: start; }
      #spread-view .chart-head-actions, #spread-view .chart-note { width: 100%; max-width: none; }
      #spread-view .chart-note { flex: none; }
    }

    @media (max-width: 900px) and (min-width: 541px) {
      .book-depth-line { grid-template-columns: minmax(190px, 1fr) 108px 92px 8px 108px 92px; height: 47px; }
      .book-depth-metrics { grid-column: 2 / -1; grid-row: 2; text-align: right; }
    }

    .inline-chart-head {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      gap: 12px;
      margin: 10px 0 2px;
      padding-top: 12px;
      border-top: 1px solid var(--line);
    }

    .inline-chart-title {
      font-size: 14px;
      font-weight: 760;
    }

    .inline-chart-note {
      color: var(--muted);
      font-size: 12px;
      text-align: right;
    }
    .inline-chart-note.funding-summary { display: flex; flex: 0 1 980px; justify-content: flex-end; gap: 8px; width: clamp(650px, 58vw, 980px); max-width: 980px; font-variant-numeric: tabular-nums; }
    .funding-summary-item { display: grid; grid-template-columns: 78px 62px 92px 72px 126px; align-items: center; gap: 5px; min-height: 30px; padding: 3px 7px; border: 1px solid #dce4ef; border-radius: 8px; background: #fbfcfe; text-align: left; box-sizing: border-box; }
    .funding-summary-item.long { border-left: 3px solid #4b7bec; }
    .funding-summary-item.short { border-left: 3px solid #8d5bd4; }
    .funding-summary-exchange { overflow: hidden; color: #27364b; text-overflow: ellipsis; white-space: nowrap; }
    .funding-summary-item.long .funding-summary-exchange { color: #315fc8; }
    .funding-summary-item.short .funding-summary-exchange { color: #7040b5; }
    .funding-summary-interval { padding: 2px 5px; border-radius: 5px; background: #edf2f8; color: #526176; text-align: center; white-space: nowrap; }
    .funding-summary-rate { font-weight: 800; text-align: right; white-space: nowrap; }
    .funding-summary-rate.pos, .funding-summary-annual.pos { color: var(--green); }
    .funding-summary-rate.neg, .funding-summary-annual.neg { color: var(--red); }
    .funding-summary-range { padding: 2px 5px; border-radius: 5px; background: #fff5dc; color: #946313; text-align: center; white-space: nowrap; }
    .funding-summary-annual { color: #596579; text-align: right; white-space: nowrap; }
    .funding-summary-context { align-self: center; color: var(--muted); font-size: 12px; line-height: 1.35; text-align: left; white-space: normal; }
    @media (max-width: 1200px) {
      .inline-chart-head { display: block; }
      .inline-chart-note.funding-summary { justify-content: flex-start; width: 100%; max-width: none; margin-top: 7px; text-align: left; }
    }
    @media (max-width: 700px) {
      .inline-chart-note.funding-summary { display: grid; grid-template-columns: 1fr; }
      .funding-summary-item { grid-template-columns: 72px 58px minmax(80px, 1fr) 66px minmax(105px, 1fr); width: 100%; }
    }
    @media (max-width: 480px) {
      .funding-summary-item { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 8px; padding: 7px 9px; }
      .funding-summary-exchange { grid-column: 1 / -1; }
      .funding-summary-rate, .funding-summary-annual { text-align: left; }
    }
    .borrow-support-status {
      margin: 8px 0 10px;
      padding: 9px 12px;
      border: 1px solid #f1c27d;
      border-radius: 9px;
      background: #fff8eb;
      color: #975a00;
      font-size: 13px;
      font-weight: 700;
    }

    .legend {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 16px;
      margin: 4px 0 0;
      color: var(--muted);
      font-weight: 620;
    }

    .legend-item {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      white-space: nowrap;
    }

    #mean-reversion-legend[hidden],
    #toggle-mean-reversion-label[hidden] { display: none; }

    .legend-dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: var(--blue);
    }

    .legend-dot.orange { background: var(--amber); }
    .legend-dot.purple { background: var(--violet); }
    .legend-dot.mean-reversion { background: #0f8b8d; }
    .spread-tools .legend-dot { flex: 0 0 10px; }

    svg.chart {
      display: block;
      width: 100%;
      height: 430px;
      touch-action: none;
    }

    svg.chart.mini-chart {
      height: 300px;
    }

    .axis,
    .gridline {
      stroke: var(--grid);
      stroke-width: 1;
      shape-rendering: crispEdges;
    }

    .zero {
      stroke: #929aa5;
      stroke-width: 1.2;
      stroke-dasharray: 6 6;
    }

    .crosshair {
      stroke: #aeb7c3;
      stroke-width: 1.2;
      stroke-dasharray: 5 4;
    }

    .measure-line { stroke: #e24a3b; stroke-width: 1.5; stroke-dasharray: 6 4; }
    .measure-layer.is-locked .measure-line { stroke-width: 2; stroke-dasharray: none; }
    .measure-label-bg { fill: rgba(226,74,59,.94); rx: 5; }
    .measure-label-text { fill: #fff; font-size: 12px; font-weight: 800; }

    .spread-zoom-reset[hidden] { display: none; }

    .series-line {
      fill: none;
      stroke: var(--blue);
      stroke-width: 2.4;
      stroke-linejoin: round;
      stroke-linecap: round;
    }

    .series-line.estimated-line {
      stroke-dasharray: 7 6;
    }

    .estimated-dot {
      fill: #fff;
      stroke: var(--blue);
      stroke-width: 2.4;
    }

    .fund-long {
      stroke: var(--amber);
      stroke-width: 2;
      stroke-dasharray: 6 5;
    }

    .fund-short {
      stroke: var(--violet);
      stroke-width: 2;
      stroke-dasharray: 6 5;
    }

    .funding-axis-title { fill: var(--muted); font-size: 12px; font-weight: 700; }
    .funding-axis-title-right { fill: var(--violet); }
    svg.chart.funding-net-chart { height: 330px; }
    .funding-leg-axis-label { fill: var(--violet); font-size: 12px; }

    .close-line {
      stroke: var(--blue);
      stroke-width: 2.1;
      stroke-dasharray: 6 4;
    }

    .mean-reversion-band { fill: rgba(15, 139, 141, .12); }
    .mean-reversion-line { stroke: #0f7779; stroke-width: 1.8; stroke-dasharray: 9 5; }
    .mean-reversion-value { pointer-events: none; }
    .mean-reversion-value-bg { fill: #f3fbfb; stroke: #0f7779; stroke-width: 1; }
    .mean-reversion-value-text { fill: #0f7779; font-size: 11px; font-weight: 800; }
    .index-spread-line { stroke: var(--violet); stroke-width: 2.1; stroke-dasharray: 4 4; }
    .legend-dot.index-spread, .hover-dot.index-spread { background: var(--violet); fill: var(--violet); }
    .hover-dot,
    .series-point {
      stroke: #fff;
      stroke-width: 2;
    }

    .hover-dot { fill: var(--blue); }
    .hover-dot.orange { fill: var(--amber); }
    .hover-dot.purple { fill: var(--violet); }

    .series-point {
      fill: var(--blue);
      opacity: .8;
    }

    .series-point.orange { fill: var(--amber); }
    .series-point.purple { fill: var(--violet); }

    .extreme-marker {
      pointer-events: none;
    }

    .extreme-marker[data-extreme-time] {
      pointer-events: auto;
      cursor: pointer;
      outline: none;
    }

    .extreme-marker[data-extreme-time]:focus-visible circle:not(.extreme-click-target) {
      stroke-width: 3.2;
    }

    .extreme-click-target {
      fill: transparent;
      stroke: transparent;
      pointer-events: all;
    }

    .extreme-marker circle:not(.extreme-click-target) {
      fill: #fff;
      stroke: currentColor;
      stroke-width: 2.2;
    }

    .extreme-marker.high { color: var(--blue); }
    .extreme-marker.low { color: var(--red); }

    .extreme-label {
      fill: currentColor;
      stroke: #fff;
      stroke-width: 4px;
      paint-order: stroke;
      font-size: 12px;
      font-weight: 780;
    }

    .funding-bar {
      opacity: .5;
    }

    .funding-bar.positive { fill: var(--green); }
    .funding-bar.negative { fill: var(--red); }

    .funding-bar.estimated {
      fill-opacity: .16;
      stroke-width: 1.8;
      stroke-dasharray: 5 4;
    }

    .funding-bar.estimated.positive { stroke: var(--green); }
    .funding-bar.estimated.negative { stroke: var(--red); }

    .mini-chart-wrap .empty {
      min-height: 160px;
    }

    .label-text {
      fill: var(--muted);
      font-size: 12px;
    }

    .hitbox { fill: transparent; pointer-events: all; }
    .hitbox.is-zoomed { cursor: grab; }
    #spread-chart.is-panning { user-select: none; }
    #spread-chart.is-panning .hitbox { cursor: grabbing; }
    .hover-layer { pointer-events: none; }

    .range-footer {
      position: fixed;
      z-index: 45;
      top: 50%;
      left: calc(50% + 650px);
      right: auto;
      transform: translateY(-50%);
      margin: 0;
      padding: 8px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: rgba(255,255,255,.94);
      box-shadow: 0 12px 32px rgba(20,28,38,.16);
      backdrop-filter: blur(8px);
      transition: opacity .12s ease, visibility .12s ease;
    }

    body.chart-tooltip-active .range-footer {
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
    }

    .range-footer .range-bar {
      flex-direction: column;
      flex-wrap: nowrap;
      gap: 6px;
    }

    .range-footer .range-button {
      min-width: 64px;
      height: 38px;
      padding: 0 10px;
    }

    @media (max-width: 1480px) and (min-width: 541px) {
      .range-footer {
        left: auto;
        right: max(10px, env(safe-area-inset-right));
      }
    }

    .spread-tools {
      display: flex;
      flex-wrap: wrap;
      gap: 14px;
      align-items: center;
      margin: 0 0 6px;
      color: var(--muted);
      font-size: 13px;
      font-weight: 620;
    }
    .spread-primary-tools { padding-top: 8px; border-top: 1px solid #edf0f4; }
    .spread-tool-action { margin-left: auto; }
    .spread-tool-action.spread-zoom-reset { margin-left: 0; }

    .toggle {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      cursor: pointer;
      user-select: none;
    }

    .toggle input {
      width: 16px;
      height: 16px;
      accent-color: var(--blue);
    }

    .tooltip {
      position: fixed;
      z-index: 60;
      display: none;
      min-width: 230px;
      max-width: min(330px, calc(100vw - 22px));
      padding: 12px 13px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: rgba(255, 255, 255, .98);
      box-shadow: 0 14px 34px rgba(25, 33, 44, .18);
      pointer-events: none;
      color: var(--ink);
      font-size: 13px;
      overflow-wrap: anywhere;
    }

    .tooltip b {
      display: block;
      margin-bottom: 7px;
      font-size: 15px;
    }

    .tooltip .row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, auto);
      gap: 18px;
      align-items: baseline;
      min-height: 22px;
    }

    .tooltip .row > * {
      min-width: 0;
    }

    .tooltip .muted { color: var(--muted); }

    .table-wrap {
      margin-top: 14px;
      max-height: 430px;
      overflow: auto;
      border-top: 1px solid var(--line);
    }

    table {
      width: 100%;
      border-collapse: collapse;
      min-width: 720px;
    }

    th,
    td {
      padding: 12px 10px;
      border-bottom: 1px solid var(--line);
      text-align: left;
      white-space: nowrap;
    }

    th {
      position: sticky;
      top: 0;
      z-index: 1;
      background: #fafbfc;
      color: var(--ink);
      font-size: 13px;
      font-weight: 760;
    }

    td {
      color: #3d444d;
      font-weight: 620;
    }

    .empty {
      display: grid;
      place-items: center;
      min-height: 260px;
      color: var(--muted);
      border: 1px dashed var(--line);
      border-radius: 8px;
    }

    .modal-backdrop {
      position: fixed;
      inset: 0;
      z-index: 50;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 18px;
      background: rgba(32, 36, 42, .42);
    }

    .modal-backdrop.is-open { display: flex; }

    .help-modal {
      width: min(760px, 100%);
      max-height: min(82vh, 760px);
      overflow: auto;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      box-shadow: 0 24px 60px rgba(20, 28, 38, .24);
    }

    .market-hours-modal { width: min(840px, 96vw); max-height: 88vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 24px 60px rgba(20,28,38,.24); }
    .market-hours-head { position: sticky; }
    .market-hours-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; min-width: 0; }
    .market-hours-head-actions { display: flex; align-items: center; gap: 8px; }
    .market-hours-help { width: 32px; min-width: 32px; height: 32px; padding: 0; border-radius: 999px; font-weight: 800; color: #526174; }
    .market-hours-head-legend { display: flex; flex-wrap: wrap; gap: 7px 14px; color: var(--muted); font-size: 12px; font-weight: 650; }
    .market-hours-head-legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
    .market-hours-head-legend i { width: 9px; height: 9px; border-radius: 999px; }
    .market-hours-help-popover { position: absolute; z-index: 4; top: calc(100% + 6px); right: 50px; display: none; width: min(430px, calc(100vw - 34px)); padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); box-shadow: 0 14px 34px rgba(20,28,38,.18); font-size: 12px; line-height: 1.55; }
    .market-hours-help-popover.is-open { display: block; }
    .market-hours-body { padding: 14px 18px 18px; }
    .market-clock { display: grid; justify-items: center; gap: 4px; margin-bottom: 5px; }
    .market-clock-time { padding: 8px 15px; border-radius: 8px; background: #40454d; color: #fff; font-size: 18px; font-weight: 760; }
    .market-clock-zone { color: var(--muted); font-size: 12px; }
    .market-phase-summary { margin: 8px 0 13px; text-align: center; color: var(--ink); font-size: 13px; font-weight: 730; }
    .market-phase-summary .open { color: var(--green); }
    .market-phase-summary .closed { color: var(--muted); }
    .market-hours-axis { display: grid; grid-template-columns: 72px 1fr; align-items: end; margin-bottom: 4px; color: var(--muted); font-size: 11px; }
    .market-hours-axis-labels { display: flex; justify-content: space-between; }
    .market-day-row { display: grid; grid-template-columns: 72px 1fr; gap: 8px; align-items: center; min-height: 35px; padding: 3px 7px; border-radius: 8px; }
    .market-day-row.is-today { background: #f4f6f9; }
    .market-day-label { display: grid; line-height: 1.15; font-size: 13px; font-weight: 750; }
    .market-day-label small { color: var(--muted); font-size: 10px; font-weight: 600; }
    .market-day-track { position: relative; height: 12px; border-radius: 999px; background: #edf0f3; }
    .market-session-bar { position: absolute; top: 1px; height: 8px; border-radius: 999px; }
    .market-session-bar.pre { background: #f0a42b; }
    .market-session-bar.regular { background: #17b978; }
    .market-session-bar.after { background: #8b5cf6; }
    .market-session-bar.overnight { background: #3b82c4; }
    .market-session-bar.auction { background: #d84d8b; }
    .market-current-line { position: absolute; z-index: 2; top: -8px; bottom: -8px; width: 0; border-left: 2px dashed #8993a1; }
    .market-day-closed { display: flex; align-items: center; height: 100%; color: #a06924; font-size: 11px; font-weight: 720; }
    .market-day-early-close { position: absolute; right: 4px; top: -15px; color: #b56a16; font-size: 9px; font-weight: 750; }
    .market-hours-color.pre { background: #f0a42b; }
    .market-hours-color.regular { background: #17b978; }
    .market-hours-color.after { background: #8b5cf6; }
    .market-hours-color.overnight { background: #3b82c4; }
    .market-hours-color.auction { background: #d84d8b; }

    @media (max-width: 700px) {
      .market-hours-heading { display: grid; gap: 7px; }
      .market-hours-head-legend { gap: 5px 10px; }
      .market-hours-head-legend span { white-space: normal; }
      .market-hours-body { padding: 12px 10px 16px; }
      .market-clock-time { font-size: 14px; }
      .market-day-row, .market-hours-axis { grid-template-columns: 58px 1fr; }
    }

    .mapping-modal {
      width: min(1500px, 96vw);
      max-height: 86vh;
      overflow-x: hidden;
      overflow-y: auto;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      box-shadow: 0 24px 60px rgba(20, 28, 38, .24);
    }

    .lending-modal {
      display: flex;
      flex-direction: column;
      width: min(1760px, 98vw);
      max-height: 96dvh;
      overflow: hidden;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #f7f9fb;
      box-shadow: 0 24px 60px rgba(20, 28, 38, .24);
    }
    .lending-modal .help-head { position: relative; flex: 0 0 auto; }
    .lending-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; min-width: 0; }
    .lending-heading h2 { margin: 0; }
    .lending-heading span { color: var(--muted); font-size: 12px; font-weight: 650; }
    .lending-toolbar {
      display: grid;
      grid-template-columns: minmax(330px, 460px) minmax(150px, 1fr) auto;
      grid-template-areas: "query status sort";
      align-items: center;
      gap: 10px;
      padding: 5px 12px;
      border-bottom: 1px solid var(--line);
      background: #fff;
    }
    .lending-query-form { grid-area: query; display: grid; grid-template-columns: auto minmax(180px, 1fr) auto; align-items: center; gap: 6px; min-width: 0; }
    .lending-query-form label { color: var(--muted); font-size: 12px; font-weight: 720; }
    .lending-query-form input { height: 32px; min-width: 0; border: 1px solid var(--line); border-radius: 6px; padding: 0 9px; color: var(--ink); background: #fff; font: inherit; }
    .lending-query-form button { height: 32px; }
    .lending-status { grid-area: status; min-width: 0; padding: 0; color: var(--muted); font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
    .lending-status.is-error { color: #b42318; }
    .lending-sort-bar { grid-area: sort; display: inline-flex; justify-self: end; gap: 2px; padding: 2px; border: 1px solid #d7dee7; border-radius: 7px; background: #f3f5f7; }
    .lending-sort-button { min-width: 108px; height: 28px; padding: 0 9px; border: 0; border-radius: 5px; background: transparent; color: #536273; font-size: 11px; font-weight: 740; }
    .lending-sort-button:hover:not(:disabled) { background: #fff; color: #176b4d; }
    .lending-sort-button.is-active { background: #fff; color: #176b4d; box-shadow: 0 1px 3px rgba(20, 28, 38, .14); }
    .lending-sort-button:disabled { cursor: default; opacity: .5; }
    .lending-column-guide {
      display: grid;
      grid-template-columns: 130px minmax(0, 1.05fr) minmax(0, 1.55fr);
      padding: 0 10px 5px;
      color: #536273;
      font-size: 11px;
    }
    .lending-column-guide > * { padding: 0 10px; }
    .lending-list { min-height: 180px; overflow: auto; padding: 0 10px 10px; }
    .lending-empty { display: grid; place-items: center; min-height: 180px; color: var(--muted); }
    .lending-exchange {
      display: grid;
      grid-template-columns: 130px minmax(0, 1.05fr) minmax(0, 1.55fr);
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
    }
    .lending-exchange + .lending-exchange { margin-top: 6px; }
    .lending-exchange-head { padding: 10px; border-right: 1px solid var(--line); }
    .lending-exchange-head strong { display: block; font-size: 15px; }
    .lending-exchange-head small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
    .lending-section { min-width: 0; padding: 9px 10px; }
    .lending-exchange > .lending-section, .lending-right { border-left: 1px solid var(--line); }
    .lending-right { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 0; }
    .lending-right .lending-section + .lending-section { border-left: 1px solid var(--line); }
    .lending-section-head { display: flex; justify-content: space-between; align-items: center; gap: 7px; margin-bottom: 6px; }
    .lending-section-head h3 { margin: 0; font-size: 13px; }
    .lending-section-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; }
    .lending-monitor-toggle { display: inline-flex; align-items: center; gap: 5px; color: #536273; font-size: 10px; font-weight: 700; white-space: nowrap; cursor: pointer; }
    .lending-monitor-toggle input { margin: 0; }
    .lending-status-tag { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 7px; border: 1px solid #d5dbe3; border-radius: 999px; background: #f4f6f8; color: #5e6875; font-size: 10px; font-weight: 760; white-space: nowrap; }
    .lending-status-tag.available { border-color: #a8d8c3; background: #eef8f3; color: #176b4d; }
    .lending-status-tag.available.quota-available { border-color: #8cc9ad; background: #e5f6ed; color: #176b4d; }
    .lending-status-tag.available.quota-empty { border-color: #efb1aa; background: #fff1ef; color: #b42318; }
    .lending-status-tag.available.quota-failed { border-color: #efb1aa; background: #fff1ef; color: #b42318; }
    .lending-status-tag.credentials_required { border-color: #ebcf9d; background: #fff7e7; color: #8a5713; }
    .lending-status-tag.unsupported { border-color: #aebfd1; background: #eef3f8; color: #34536f; }
    .lending-status-tag.api_unavailable { border-color: #d5dbe3; background: #f4f6f8; color: #5e6875; }
    .lending-status-tag.error { border-color: #efb1aa; background: #fff1ef; color: #b42318; }
    .lending-section-reason { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
    .lending-account-notice { display: grid; gap: 2px; margin: 0 0 7px; padding: 5px 7px; border-left: 3px solid #d7a33d; background: #fff8e8; color: #765113; font-size: 10px; line-height: 1.4; overflow-wrap: anywhere; }
    .lending-account-notice-title { color: #60400c; font-size: 12px; }
    .lending-account-notice-reason { display: block; }
    .lending-quota-reason { grid-column: 1 / -1; margin: 0; color: #9a5b13; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
    .lending-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 10px; }
    .lending-borrow-section .lending-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lending-fact { min-width: 0; }
    .lending-fact span { display: block; color: var(--muted); font-size: 10px; }
    .lending-fact strong { display: block; margin-top: 2px; color: var(--ink); font-size: 13px; overflow-wrap: anywhere; }
    .lending-fact.quota-available strong { color: #176b4d; }
    .lending-fact.quota-empty strong { color: #b42318; }
    .lending-fact.rate strong { color: #176b4d; font-size: 16px; }
    .lending-product + .lending-product { margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--line); }
    .lending-product-head { display: flex; align-items: baseline; justify-content: space-between; gap: 7px; margin-bottom: 5px; }
    .lending-product-head strong { font-size: 13px; }
    .lending-product-rate { color: #176b4d; font-size: 17px; font-weight: 780; white-space: nowrap; }
    .lending-tier-list { grid-column: 1 / -1; color: var(--muted); font-size: 11px; line-height: 1.5; }
    @media (max-width: 1100px) {
      .lending-right { grid-template-columns: 1fr; }
      .lending-right .lending-section + .lending-section { border-top: 1px solid var(--line); border-left: 0; }
      .lending-borrow-section .lending-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }

    .mapping-modal .mapping-body {
      padding: 14px 16px 16px;
      min-width: 0;
    }

    .mapping-form .field:nth-of-type(4) .help-tip::after,
    .mapping-form .field:nth-of-type(5) .help-tip::after {
      right: 0;
      left: auto;
    }

    .help-head {
      position: sticky;
      top: 0;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      padding: 14px 16px;
      border-bottom: 1px solid var(--line);
      background: #fff;
    }

    .help-head h2 {
      margin: 0;
      font-size: 18px;
      line-height: 1.2;
    }

    .settings-child-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
    .settings-child-heading h2 { min-width: 0; }

    .settings-back-button {
      display: inline-flex;
      flex: 0 0 34px;
      align-items: center;
      justify-content: center;
      width: 34px;
      height: 34px;
      padding: 0;
      border-radius: 50%;
      color: #245bb8;
      background: #eef3fb;
      font-size: 22px;
      line-height: 1;
    }
    .settings-back-button[hidden] { display: none; }

    .settings-back-button:hover { background: #dce8fb; }
    .settings-back-button:focus-visible { outline: 2px solid rgba(72,111,190,.45); outline-offset: 2px; }

    .help-close {
      width: 34px;
      min-width: 34px;
      padding: 0;
      font-size: 22px;
      line-height: 1;
    }

    .help-content {
      display: grid;
      gap: 14px;
      padding: 16px;
      color: #323943;
    }

    .help-content section {
      display: grid;
      gap: 7px;
    }

    .help-content h3 {
      margin: 0;
      font-size: 15px;
    }

    .help-content p {
      margin: 0;
      color: var(--muted);
      overflow-wrap: anywhere;
    }

    .help-content code {
      padding: 1px 5px;
      border-radius: 5px;
      background: #f1f3f6;
      color: #17202c;
    }
    .help-content pre { margin: 10px 0; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
    .help-content pre code { display: block; padding: 10px; }

    @media (max-width: 900px) {
      header { grid-template-columns: 1fr; align-items: stretch; }
      .actions { justify-content: space-between; }
      .query-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .mapping-identity-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .mapping-form { grid-template-columns: minmax(0, 1fr); }
      .mapping-stock-form { grid-template-columns: 1fr; }
      .mapping-stock-listings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .mapping-rule-row { grid-template-columns: 112px 104px minmax(160px, 1fr) 96px; }
      .mapping-rule-stock-target { grid-column: 1 / -1; }
      .mapping-rule-suggestion { grid-column: 1 / -1; }
      .mapping-rule-chip { grid-template-columns: 108px 78px minmax(140px, 1fr) 84px auto; }
      .mapping-rule-stock-value { grid-column: 1 / -2; }
      .mapping-rule-row-actions { grid-column: -2; grid-row: 1 / span 2; }
      .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .metrics .metric:first-child { grid-column: 1 / -1; }
      .baseline-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      svg.chart { height: 350px; }
      .lending-toolbar { grid-template-columns: minmax(300px, 420px) 1fr; grid-template-areas: "query sort" "status status"; gap: 5px 10px; }
      .query-panel .token-input-row { grid-template-columns: minmax(0, 1fr) 34px max-content max-content; }
    }

    @media (max-width: 540px) {
      body { font-size: 13px; }
      .app { width: 100%; padding: 8px 8px calc(20px + env(safe-area-inset-bottom)); }
      header { gap: 8px; margin-bottom: 8px; }
      h1 { font-size: 20px; line-height: 1.2; }
      .brand { gap: 8px; }
      .brand-mark { flex-basis: 38px; width: 38px; height: 38px; border-radius: 10px; }
      .brand-tagline { margin-top: 2px; font-size: 10px; letter-spacing: .02em; }
      .actions {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 6px;
      }
      .actions > .help-button, .actions > .refresh { display: none; }
      .mobile-menu { display: block; margin-left: auto; }
      .actions button,
      .query-panel button,
      .help-button,
      .refresh {
        width: 100%;
        min-width: 0;
        padding: 0 8px;
      }
      .field input,
      .field select,
      button {
        height: 42px;
        font-size: 14px;
      }
      .query-panel .field input,
      .query-panel .field select { height: 46px; font-size: 16px; }
      .query-panel .token-input-row { grid-template-columns: minmax(0, 1fr) 42px 68px 68px; }
      .query-panel .token-input-row button { width: auto; height: 46px; }
      .risk-alerts { gap: 6px; margin: 8px 0 10px; }
      .risk-alert { padding: 9px 10px; border-radius: 8px; font-size: 12px; }
      .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-bottom: 8px; }
      .metrics .metric:first-child { grid-column: 1 / -1; }
      .metric { height: auto; min-height: 78px; padding: 9px 10px; }
      .metric .label { font-size: 11px; white-space: normal; line-height: 1.25; }
      .metric .value { margin-top: 4px; font-size: clamp(18px, 6vw, 24px); }
      .metric .value.compact { font-size: clamp(15px, 4.8vw, 20px); }
      .metric .value.tiny { font-size: clamp(13px, 4vw, 17px); }
      .metric .value.metric-stack { font-size: 15px; }
      .metric-line { gap: 5px; }
      .metric-line span { font-size: 10px; }
      .metric-line strong { font-size: clamp(15px, 4.8vw, 20px); }
      .metric .detail { margin-top: 3px; font-size: 10px; }
      .chart-head { display: block; }
      .chart-note { max-width: none; margin-top: 4px; text-align: left; }
      .chart-head-actions { align-items: flex-start; }
      .book-depth-line { grid-template-columns: minmax(120px, 1fr) 82px 4px 82px; gap: 3px 5px; height: 21px; padding: 1px 0; line-height: 1.3; white-space: nowrap; }
      .book-depth-instrument { min-width: 120px; }
      .book-side-label { flex-basis: 17px; width: 17px; height: 17px; border-radius: 4px; font-size: 9px; }
      .book-quote-field.buy-price, .book-quote-field.sell-price { width: auto; }
      .book-quote-field.buy-depth, .book-quote-field.sell-depth, .book-depth-metrics { display: none; }
      .book-quote-separator { width: auto; }
      .granularity-warning { margin-top: 2px; }
      .granularity-warning-popover { right: -2px; }
      .inline-chart-head { display: block; }
      .inline-chart-note { margin-top: 4px; text-align: left; }
      .range-extremes { display: flex; margin-top: 3px; }
      .query-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 8px;
        gap: 7px;
        margin-bottom: 8px;
      }
      .query-panel.is-collapsed { display: none; }
      .query-summary-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 7px; margin-bottom: 8px; }
      .query-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-bottom: 0; }
      .delisting-badge.mobile:not([hidden]) { display: inline-flex; }
      .token-coverage-badge.mobile:not([hidden]) { display: inline-flex; }
      .query-panel .delisting-badge { width: auto; height: 24px; padding: 0 7px; font-size: 11px; }
      .query-panel .query-token-field { grid-column: 1 / -1; grid-row: 1; }
      .query-panel .query-mode-field { grid-column: 1; grid-row: 2; }
      .query-panel .query-ratio-field { grid-column: 2; grid-row: 2; }
      .query-panel .query-exchange-a-field { grid-column: 1; grid-row: 3; }
      .query-panel .query-exchange-b-field { grid-column: 2; grid-row: 3; }
      .query-panel .query-granularity-field { grid-column: 1 / -1; grid-row: 4; }
      .query-panel button[type="submit"] { grid-column: 1; grid-row: 5; }
      .query-panel .reverse-query { grid-column: 2; grid-row: 5; }
      .baseline-head { display: block; }
      .baseline-grid { grid-template-columns: minmax(0, 1fr); gap: 7px; }
      .baseline-grid.has-visible-stocks { min-height: 168px; grid-auto-rows: 168px; }
      .baseline-card { min-height: 0; padding: 10px 11px; }
      .baseline-card .value { min-height: 29px; font-size: 22px; }
      .baseline-comparison-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 7px; padding: 4px 0; }
      .baseline-comparison-basis { grid-column: 1; grid-row: 2; }
      .baseline-comparison-row strong { grid-column: 2; grid-row: 1 / span 2; }
      .mapping-form { grid-template-columns: 1fr; }
      .mapping-identity-form { grid-template-columns: 1fr; }
      .mapping-stock-form { grid-template-columns: 1fr; }
      .mapping-stock-listings { grid-template-columns: 1fr; }
      .mapping-stock-listing,
      .mapping-adr-form { grid-template-columns: minmax(0, 1fr) minmax(88px, .45fr); }
      .mapping-rule-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 8px 44px 8px 8px; }
      .mapping-rule-symbol-field,
      .mapping-rule-stock-target,
      .mapping-rule-suggestion { grid-column: 1 / -1; }
      .mapping-rule-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
      .mapping-rule-actions button { width: 100%; min-width: 0; }
      .mapping-group-head { align-items: flex-start; }
      .mapping-group-actions { flex-wrap: wrap; justify-content: flex-end; }
      .mapping-rule-chip { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 7px; padding: 8px; }
      .mapping-rule-symbol-value,
      .mapping-rule-multiplier-value,
      .mapping-rule-stock-value { grid-column: auto; }
      .mapping-rule-stock-value { grid-column: 1 / -1; }
      .mapping-rule-row-actions { grid-column: 1 / -1; grid-row: auto; justify-content: flex-end; }
      .template-panel { margin-bottom: 8px; padding: 9px 9px 0; }
      .template-head { align-items: center; gap: 8px; }
      .template-title { min-width: 0; }
      .template-status { display: none; }
      .template-save { min-width: 88px; padding: 0 8px; }
      .template-list, .template-more { display: none !important; }
      .mobile-template-controls {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 6px;
        padding-bottom: 9px;
      }
      .mobile-template-controls select { min-width: 0; height: 42px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 0 8px; }
      .mobile-template-controls button { min-width: 58px; padding: 0 9px; }
      .template-more { display: none !important; }
      .opportunity-panel { margin-bottom: 8px; padding: 9px; }
      .opportunity-head { display: grid; gap: 8px; }
      .opportunity-panel.is-collapsed .opportunity-head { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
      .opportunity-panel.is-collapsed .opportunity-head-actions { display: block; }
      .opportunity-head-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
      .opportunity-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
      .opportunity-filter { grid-column: 1 / -1; justify-content: flex-start; }
      .opportunity-sort { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .opportunity-sort button { width: auto; }
      .opportunity-period-sort { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
      .opportunity-period-sort button { width: auto; min-width: 0; padding-inline: 4px; white-space: normal; }
      .opportunity-reverse { width: auto; white-space: nowrap; }
      .opportunity-row { grid-template-columns: 48px minmax(0, 1fr) minmax(82px, .55fr); grid-template-rows: auto auto auto auto; gap: 7px; height: auto; min-height: 72px; padding: 8px; }
      .opportunity-row .opportunity-mode { grid-column: 1; grid-row: 1; }
      .opportunity-row .opportunity-route { grid-column: 2; grid-row: 1; }
      .opportunity-row .opportunity-spread { grid-column: 3; grid-row: 1; }
      .opportunity-row .opportunity-funding { grid-column: 2; grid-row: 2; }
      .opportunity-row .opportunity-last-settled { grid-column: 3; grid-row: 2; }
      .opportunity-row .opportunity-realized-group { grid-column: 1 / -1; grid-row: 3; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
      .opportunity-row .opportunity-borrow { grid-column: 2 / 4; grid-row: 4; justify-self: end; white-space: normal; text-align: center; }
      .opportunity-row .opportunity-borrow.open { display: none; }
      .settings-exchange-grid { grid-template-columns: minmax(0, 1fr); }
      .range-footer { justify-content: flex-start; }
      .range-footer {
        position: static;
        transform: none;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
      }
      .range-footer .range-bar {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        width: 100%;
        gap: 5px;
        overflow-x: auto;
        scrollbar-width: none;
      }
      .range-footer .range-bar::-webkit-scrollbar { display: none; }
      .range-button { flex: 0 0 auto; min-width: 58px; height: 38px; padding: 0 10px; }
      .chart-panel { padding: 9px; overflow: hidden; }
      .chart-title { font-size: 15px; }
      .chart-note, .inline-chart-note { font-size: 11px; }
      .spread-tools { gap: 6px 10px; margin: 6px 0; font-size: 11px; }
      .spread-tool-action { margin-left: 0; }
      .spread-tools .toggle { margin-left: 0; }
      .funding-details-toggle { margin-left: auto; }
      svg.chart { height: 270px; }
      svg.chart.mini-chart { height: 190px; }
      svg.chart.funding-net-chart { height: 300px; }
      .label-text { font-size: 11px; }
      .extreme-label, .parameter-event-badge-text { font-size: 9px; }
      .funding-details { margin-top: 7px; padding-top: 7px; }
      .table-wrap { max-height: none; overflow: visible; border-top: 0; }
      .funding-details table { min-width: 0; border-collapse: separate; border-spacing: 0 7px; }
      .funding-details thead { display: none; }
      .funding-details tbody, .funding-details tr, .funding-details td { display: block; width: 100%; }
      .funding-details tr {
        padding: 9px 10px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #fafbfc;
      }
      .funding-details td {
        display: grid;
        grid-template-columns: minmax(86px, .8fr) minmax(0, 1.2fr);
        gap: 10px;
        align-items: baseline;
        padding: 4px 0;
        border: 0;
        text-align: right;
        white-space: normal;
        overflow-wrap: anywhere;
      }
      .funding-details td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 11px;
        font-weight: 650;
        text-align: left;
      }
      .funding-details td:first-child {
        display: block;
        padding-bottom: 6px;
        border-bottom: 1px solid var(--line);
        text-align: left;
      }
      .funding-details td:first-child::before { content: none; }
      .parameter-tag { margin: 3px 0 0 5px; font-size: 10px; }
      .modal-backdrop { align-items: flex-end; padding: 0; }
      .help-modal, .mapping-modal, .settings-modal, .lending-modal {
        width: 100%;
        max-height: 92dvh;
        border-radius: 14px 14px 0 0;
      }
      .mapping-modal { max-height: 86vh; }
      .lending-toolbar { grid-template-columns: 1fr; grid-template-areas: "query" "sort" "status"; gap: 6px; padding: 8px 10px; }
      .lending-query-form { grid-template-columns: auto minmax(0, 1fr) auto; }
      .lending-query-form input, .lending-query-form button { height: 36px; }
      .lending-sort-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-self: stretch; }
      .lending-sort-button { min-width: 0; width: 100%; height: 32px; }
      .lending-list { padding: 0 8px 12px; }
      .lending-column-guide { display: none; }
      .lending-exchange { grid-template-columns: 1fr; }
      .lending-exchange-head { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
      .lending-exchange-head small { margin: 0; }
      .lending-section { padding: 10px 12px; }
      .lending-exchange > .lending-section, .lending-right { border-left: 0; }
      .lending-exchange > .lending-section, .lending-right .lending-section { border-top: 1px solid var(--line); }
      .mapping-modal .mapping-body { padding: 10px; }
      .tooltip {
        max-width: calc(100vw - 18px);
        font-size: 12px;
      }
    }

    @media (max-width: 540px), (orientation: landscape) and (max-height: 500px) {
      .query-panel .token-coverage-badge,
      .query-panel .delisting-badge,
      .query-panel .announcement-button { display: none !important; }
      .mobile-chart-range {
        display: block;
        margin: 0 0 7px;
      }
      .mobile-chart-range .range-bar {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 4px;
      }
      .mobile-chart-range .range-button {
        width: 100%;
        min-width: 0;
        height: 34px;
        padding: 0 4px;
        font-size: 12px;
      }
      .range-footer { display: none; }
      .inline-chart-note.funding-summary {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        width: 100%;
        max-width: none;
        margin-top: 5px;
      }
      .inline-chart-note.funding-summary.single-leg-summary { grid-template-columns: minmax(0, 1fr); }
      .funding-summary-item {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
          "exchange interval"
          "rate annual"
          "range range";
        gap: 3px 5px;
        width: 100%;
        min-width: 0;
        min-height: 0;
        padding: 5px 6px;
        font-size: 10px;
      }
      .funding-summary-exchange { grid-area: exchange; grid-column: auto; font-size: 11px; }
      .funding-summary-interval { grid-area: interval; padding: 1px 4px; font-size: 9px; }
      .funding-summary-rate { grid-area: rate; font-size: 12px; text-align: left; }
      .funding-summary-range { grid-area: range; justify-self: start; padding: 1px 4px; font-size: 9px; }
      .funding-summary-annual { grid-area: annual; font-size: 9px; text-align: right; }
      .funding-summary-context { grid-column: 1 / -1; font-size: 10px; }
      svg.chart { touch-action: pan-y pinch-zoom; }
    }

    @media (orientation: landscape) and (max-height: 500px) {
      body { font-size: 12px; }
      .app { width: 100%; padding: 5px max(7px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left)); }
      header { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-bottom: 6px; }
      h1 { font-size: 16px; line-height: 1.15; }
      .brand { gap: 7px; }
      .brand-mark { flex-basis: 32px; width: 32px; height: 32px; border-radius: 8px; }
      .brand-tagline { display: none; }
      .actions { justify-content: flex-end; }
      .actions > .help-button, .actions > .refresh, .actions > .notification-button { display: none; }
      .mobile-menu { display: block; margin-left: auto; }
      .mobile-menu-button { width: 38px; min-width: 38px; height: 34px; }
      .query-summary-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 5px; margin-bottom: 6px; }
      .query-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; min-height: 38px; padding: 5px 8px; margin: 0; }
      .query-summary-edit { min-height: 24px; }
      .delisting-badge.mobile:not([hidden]), .token-coverage-badge.mobile:not([hidden]) { display: inline-flex; }
      .query-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 7px; margin-bottom: 6px; }
      .query-panel.is-collapsed { display: none; }
      .query-panel .field input, .query-panel .field select { height: 42px; font-size: 16px; }
      .query-panel .token-input-row { grid-template-columns: minmax(0, 1fr) 40px 66px 66px; }
      .query-panel .token-input-row button { width: auto; height: 42px; }
      .query-panel .query-token-field { grid-column: 1 / -1; grid-row: 1; }
      .query-panel .query-mode-field { grid-column: 1; grid-row: 2; }
      .query-panel .query-ratio-field { grid-column: 2; grid-row: 2; }
      .query-panel .query-exchange-a-field { grid-column: 1; grid-row: 3; }
      .query-panel .query-exchange-b-field { grid-column: 2; grid-row: 3; }
      .query-panel .query-granularity-field { grid-column: 1 / -1; grid-row: 4; }
      .query-panel button[type="submit"] { grid-column: 1; grid-row: 5; }
      .query-panel .reverse-query { grid-column: 2; grid-row: 5; }
      .chart-panel { padding: 7px; }
      .chart-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
      .chart-head-actions { justify-content: flex-end; margin: 0; }
      .chart-note { width: auto; max-width: 70vw; margin: 0; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
      .book-depth-line { grid-template-columns: minmax(120px, 1fr) 82px 4px 82px; gap: 3px 5px; height: 21px; padding: 1px 0; line-height: 1.3; white-space: nowrap; }
      .book-depth-instrument { min-width: 120px; }
      .book-side-label { flex-basis: 17px; width: 17px; height: 17px; border-radius: 4px; font-size: 9px; }
      .book-quote-field.buy-price, .book-quote-field.sell-price { width: auto; }
      .book-quote-field.buy-depth, .book-quote-field.sell-depth, .book-depth-metrics { display: none; }
      .book-quote-separator { width: auto; }
      .range-extremes { font-size: 10px; }
      .mobile-chart-range { margin-bottom: 4px; }
      .mobile-chart-range .range-button { height: 30px; }
      .spread-tools { flex-wrap: wrap; gap: 5px 9px; margin: 3px 0; padding-bottom: 2px; overflow-x: visible; font-size: 10px; }
      .spread-tools > * { flex: 0 0 auto; }
      .spread-tool-action, .funding-details-toggle { margin-left: 0; }
      #spread-chart svg.chart { height: clamp(260px, calc(100dvh - 112px), 320px); }
      svg.chart.mini-chart, svg.chart.funding-net-chart { height: 240px; }
      .chart-title { font-size: 14px; }
      .label-text { font-size: 13px; }
      .extreme-label { font-size: 11px; }
      .parameter-event-badge-text { font-size: 10px; }
      .inline-chart-head { margin-top: 7px; padding-top: 7px; }
      .template-panel { margin-bottom: 6px; }
      .metrics { gap: 6px; margin-bottom: 6px; }
    }

.account-chip { min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #fff; font: inherit; cursor: pointer; }
.account-chip::after { content: "▾"; margin-left: 7px; font-size: 10px; }
.account-menu.is-open .account-chip::after { content: "▴"; }
.auth-backdrop { display: none; z-index: 100; background: rgba(19, 27, 38, .72); }
.auth-backdrop.is-open { display: flex; }
.auth-modal, .user-admin-modal { width: min(520px, 94vw); border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 28px 80px rgba(0,0,0,.28); }
.auth-modal { display: grid; gap: 16px; padding: 28px; }
.auth-modal h2, .auth-modal p { margin: 0; }
.auth-modal p { color: var(--muted); }
.auth-brand { display: flex; align-items: center; gap: 13px; }
.auth-brand-mark { display: block; flex: 0 0 52px; width: 52px; height: 52px; border-radius: 14px; box-shadow: 0 10px 24px rgba(15, 23, 42, .2); }
.auth-product-name { color: #0f172a; font-size: 23px; font-weight: 800; letter-spacing: -.025em; line-height: 1.05; }
.auth-brand h2 { margin-top: 5px; color: var(--muted); font-size: 14px; font-weight: 650; }
.auth-error { min-height: 22px; color: var(--red); }
.user-admin-modal { width: min(900px, 96vw); max-height: 90vh; overflow: auto; }
.server-metrics-section { margin: 14px 16px 4px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.server-metrics-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.server-metrics-head h3, .user-admin-subtitle { margin: 0; }
.server-metrics-status { margin-top: 8px; color: var(--muted); font-size: 13px; }
.server-metrics-status.is-warning { color: #9a6400; font-weight: 800; }
.server-metrics-status.is-critical { color: var(--red); font-weight: 800; }
.server-metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.server-metric-card { min-width: 0; padding: 10px; border: 1px solid #dfe6ef; border-radius: 8px; background: #fff; }
.server-metric-card span { display: block; color: var(--muted); font-size: 11px; }
.server-metric-card strong { display: block; margin-top: 5px; overflow-wrap: anywhere; font-size: 14px; }
.server-alert-list { display: grid; gap: 6px; margin-top: 10px; }
.server-alert-item { padding: 8px 10px; border-left: 3px solid #d6a31c; border-radius: 6px; background: #fff8df; color: #76500a; font-size: 12px; }
.server-alert-item.is-critical { border-left-color: var(--red); background: #fff0f0; color: #a22929; }
.server-alert-item.is-resolved { border-left-color: var(--green); background: #eefbf3; color: #237b48; }
.user-admin-subtitle { padding: 14px 16px 0; font-size: 16px; }
.user-form { display: grid; grid-template-columns: 1fr 160px 1fr auto auto; gap: 10px; align-items: end; padding: 16px; }
.check-field { display: flex; gap: 7px; align-items: center; min-height: 42px; white-space: nowrap; }
.user-list { display: grid; gap: 8px; padding: 0 16px 18px; }
.user-row { display: grid; grid-template-columns: 1fr 130px 100px auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.user-row button { justify-self: end; }
#user-admin-error { padding: 0 16px; }
@media (max-width: 760px) {
  .user-form, .user-row { grid-template-columns: 1fr; }
  .server-metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-row button { justify-self: stretch; }
  .notification-form { grid-template-columns: 1fr; align-items: stretch; }
  .notification-form > input { height: 42px; font-size: 16px; }
  .notification-channel-tabs { width: 100%; }
  .notification-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
  .notification-actions button { min-width: 0; }
  .notification-status { grid-column: 1; }
}
@media (max-width: 540px), (orientation: landscape) and (max-height: 500px) {
  .account-menu { display: none; }
}

.risk-panel { margin-top: 16px; }
.risk-panel .chart-title .help-tip { margin-left: 2px; vertical-align: middle; }
@media (min-width: 1101px) {
  .risk-panel .chart-head { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 5px 12px; align-items: baseline; }
  .risk-panel .chart-title-group { display: contents; }
  .risk-panel .chart-title { grid-column: 1; grid-row: 1; }
  .risk-panel .chart-note { grid-column: 2; grid-row: 1; width: auto; max-width: none; justify-self: end; white-space: nowrap; }
  .risk-panel .range-extremes { grid-column: 1 / -1; grid-row: 2; flex-wrap: nowrap; white-space: nowrap; }
}
.risk-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; padding: 14px 0; }
.risk-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: #fff; }
.risk-card-title { font-weight: 800; margin-bottom: 10px; }
.risk-card-grid { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; color: var(--muted); }
.risk-card-grid strong { color: var(--text); text-align: right; }
.risk-unsupported { color: var(--muted); font-size: 13px; margin-top: 10px; }
.risk-table-wrap { max-height: 380px; }
.notification-head-actions { display: flex; align-items: center; gap: 8px; }
#notification-clear { color: var(--red); }
.risk-range-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.risk-range-bar button.is-active { color: #fff; border-color: var(--blue); background: var(--blue); }
.risk-chart { min-height: 360px; margin-top: 8px; }
.risk-chart svg { display: block; width: 100%; height: 360px; }
.risk-subchart-head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.risk-subchart-title { font-weight: 700; color: var(--text); }
.risk-fund-title { padding-top: 14px; border-top: 1px solid var(--line); }
.risk-fund-loading { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.risk-fund-loading[hidden] { display: none; }
.risk-fund-loading-item { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid #dce5f2; border-radius: 9px; background: #f6f9fe; color: #526176; font-size: 13px; font-weight: 700; }
.risk-fund-loading-item.is-warning { border-color: #f0cf91; background: #fff9ed; color: #86611e; }
.risk-fund-loading-spinner { width: 13px; height: 13px; border: 2px solid #c9d7ed; border-top-color: #3975f6; border-radius: 50%; animation: risk-fund-spin .8s linear infinite; }
@keyframes risk-fund-spin { to { transform: rotate(360deg); } }
.risk-fund-chart { min-height: 280px; }
.risk-fund-chart svg { height: 280px; }
.risk-legends { display: contents; }
.risk-fund-dot { background: #6d7785; }
.risk-crosshair { display: none; stroke: #9aa7b8; stroke-width: 1; stroke-dasharray: 5 5; pointer-events: none; }
.risk-hover-dot { display: none; fill: #fff; stroke: #3975f6; stroke-width: 3; pointer-events: none; }
.risk-hover-capture { cursor: default; }
.risk-detail-link { padding: 0; border: 0; border-bottom: 1px dashed currentColor; border-radius: 0; background: transparent; color: inherit; font: inherit; font-weight: inherit; cursor: pointer; }
.risk-detail-link:hover { border-bottom-style: solid; }
.risk-detail-modal { width: min(720px, 94vw); max-height: 86vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 24px 60px rgba(20,28,38,.24); }
.risk-detail-body { padding: 16px; }
.risk-detail-grid { display: grid; grid-template-columns: minmax(160px,1fr) auto; gap: 12px 20px; }
.risk-detail-grid strong { text-align: right; }
.risk-pool-toggle { padding: 0; border: 0; border-bottom: 1px dashed currentColor; border-radius: 0; background: transparent; color: #2f64d6; font: inherit; font-weight: 700; cursor: pointer; }
.risk-pool-toggle:hover { border-bottom-style: solid; }
.risk-pool-panel { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.risk-pool-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.risk-pool-search { width: min(260px, 48%); min-width: 150px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); font: inherit; }
.risk-pool-list { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; max-height: 320px; overflow: auto; padding: 2px; }
.risk-pool-symbol { padding: 7px 10px; border: 1px solid #dce3ed; border-radius: 8px; background: #f7f9fc; color: #394454; font-size: 13px; font-weight: 700; }
.risk-pool-symbol.is-current { border-color: #3975f6; background: #edf3ff; color: #285cc8; }
.risk-pool-empty, .risk-pool-note { margin: 16px 0 0; color: var(--muted); }
.risk-secondary { color: #d99122; }
:is(.settings-modal, .user-admin-modal, .help-modal:not(.depth-spread-modal)) {
  width: min(1680px, 96vw);
  max-height: 94dvh;
  font-size: 16px;
  line-height: 1.6;
}
:is(.settings-modal, .user-admin-modal, .help-modal:not(.depth-spread-modal)) .help-head { padding: 20px 24px; z-index: 6; }
:is(.settings-modal, .user-admin-modal, .help-modal:not(.depth-spread-modal)) .help-head h2 { font-size: 24px; }
:is(.settings-modal, .user-admin-modal, .help-modal:not(.depth-spread-modal)) button { min-height: 44px; font-size: 16px; }
:is(.settings-modal, .user-admin-modal, .help-modal:not(.depth-spread-modal)) :is(.help-close, .settings-back-button) { width: 44px; min-width: 44px; height: 44px; flex-basis: 44px; font-size: 26px; }
:is(.settings-modal, .user-admin-modal) :is(input, select) { min-width: 0; max-width: 100%; font-size: 16px; }
:is(.settings-modal, .user-admin-modal) input:not([type="checkbox"]), :is(.settings-modal, .user-admin-modal) select { min-height: 44px; }
:is(.settings-modal, .user-admin-modal) input[type="checkbox"] { width: 20px; height: 20px; flex-shrink: 0; }
.settings-body, #help-modal .help-content { padding: 24px; gap: 24px; }
.settings-links { gap: 12px; }
.settings-links button { min-height: 52px; }
.settings-section { gap: 16px; padding-top: 22px; }
.settings-section-head h3, #help-modal .help-content h3 { font-size: 20px; }
.settings-exchange-grid { gap: 12px; }
.settings-exchange-option { min-height: 58px; padding: 12px 16px; font-size: 16px; }
.connection-signal { font-size: 13px; padding: 5px 10px; }
.connection-tooltip { font-size: 14px; }
.settings-modal .mapping-status, .settings-modal .dex-market-row label, #dex-market-editor p, #dex-market-status { font-size: 14px; }
#help-modal .help-content section { gap: 12px; min-width: 0; }
#help-modal .help-content :is(p, li, code) { font-size: 16px; }
#help-modal .help-content pre code { padding: 16px; }
.user-admin-modal .server-metrics-section { margin: 24px 24px 8px; padding: 20px; }
.user-admin-modal :is(.server-metrics-head h3, .user-admin-subtitle) { font-size: 20px; }
.user-admin-modal :is(.server-metrics-status, .server-alert-item, .field, .server-metric-card span) { font-size: 14px; }
.user-admin-modal .server-metric-card { padding: 16px; }
.user-admin-modal .server-metric-card strong { font-size: 20px; }
.user-admin-modal .user-admin-subtitle { padding: 20px 24px 0; }
.user-admin-modal .user-form { padding: 24px; gap: 16px; grid-template-columns: minmax(0, 1fr) 180px minmax(0, 1fr) auto auto; }
.user-admin-modal .user-list { padding: 0 24px 24px; gap: 12px; }
.user-admin-modal .user-row { padding: 14px 16px; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .user-admin-modal .user-form, .user-admin-modal .user-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  :is(.settings-modal, .user-admin-modal, .help-modal:not(.depth-spread-modal)) { width: 100%; max-height: 94dvh; border-radius: 14px 14px 0 0; }
  :is(.settings-modal, .user-admin-modal, .help-modal:not(.depth-spread-modal)) .help-head { padding: 16px; }
  .settings-body, #help-modal .help-content { padding: 16px; gap: 20px; }
  .settings-exchange-option { padding: 10px 12px; }
  .settings-modal .settings-save-row { flex-wrap: wrap; }
  .settings-modal .mapping-status { min-width: 0; overflow-wrap: anywhere; }
  .user-admin-modal .server-metrics-section { margin: 16px 12px 8px; padding: 12px; }
  .user-admin-modal .server-metric-card { padding: 12px; }
  .user-admin-modal .user-form { padding: 16px; }
  .user-admin-modal .user-list { padding: 0 16px 16px; }
}
@media (max-width: 640px) {
  .index-price-card { flex-basis: calc(50% - 4px); }
  .funding-scenario-grid, .funding-scenario-position { grid-template-columns: 1fr; }
  .funding-scenario-grid .field .help-tip::after { right: 0; left: auto; }
  .funding-scenario-actions { flex-direction: column; }
  .token-coverage-columns { display: none; }
  .token-coverage-item { grid-template-columns: 1fr; gap: 6px; }
  .token-coverage-coin-action { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 7px; align-items: center; }
  .token-coverage-coin-action-label { display: inline-flex; }
  .risk-detail-grid { grid-template-columns: minmax(110px, .8fr) minmax(0, 1.2fr); gap: 10px 12px; }
  .risk-detail-grid strong { overflow-wrap: anywhere; }
  .risk-pool-head { align-items: stretch; flex-direction: column; }
  .risk-pool-search { width: 100%; }
}
