:root {
  color-scheme: dark;
  --page: #101415;
  --topbar: #111617;
  --panel: #151a1b;
  --panel-raised: #1a2121;
  --surface: #1e2727;
  --line: #2a3434;
  --line-subtle: #242e2e;
  --text: #eef2ef;
  --muted: #a2aeaa;
  --secondary: #879691;
  --green: #ace6be;
  --green-strong: #c2efce;
  --green-ink: #172a20;
  --red: #ff9c9c;
  --amber: #ecc383;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --sans: "Golos Text", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--sans);
  background: var(--page);
  color: var(--text);
  font-size: 16px;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 1rem; }
body { margin: 0; min-width: 320px; }
button, input, select { color: inherit; font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, .table-scroll:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }
small { font-size: .8125rem; }
.sr-only { position: absolute; overflow: hidden; width: 1px; height: 1px; clip-path: inset(50%); white-space: nowrap; }
.topbar { border-bottom: 1px solid var(--line-subtle); background: var(--topbar); }
.topbar-inner, .workspace { width: min(100% - 88px, 1432px); margin-inline: auto; }
.topbar-inner { display: flex; align-items: center; min-height: 70px; gap: clamp(26px, 4vw, 72px); }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; font-weight: 800; font-size: 1.125rem; letter-spacing: -.05em; }
.brand-accent { color: var(--green); }
.brand-icon { display: flex; align-items: center; justify-content: center; gap: 2px; width: 32px; height: 32px; border-radius: 7px; background: var(--green); }
.brand-icon i { width: 2px; background: var(--green-ink); border-radius: 1px; }
.brand-icon i:nth-child(1), .brand-icon i:nth-child(5) { height: 7px; }
.brand-icon i:nth-child(2), .brand-icon i:nth-child(4) { height: 12px; }
.brand-icon i:nth-child(3) { height: 19px; }
.header-nav { display: flex; align-self: stretch; align-items: stretch; gap: 28px; }
.header-nav a { position: relative; display: flex; align-items: center; color: var(--muted); font-size: .875rem; font-weight: 500; }
.header-nav a:hover, .header-nav a[aria-current] { color: var(--text); }
.header-nav a[aria-current]::after { content: ""; position: absolute; height: 2px; inset: auto 0 -1px; background: var(--green); }
.quiet-button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-raised); font-weight: 500; white-space: nowrap; }
.quiet-button { min-height: 38px; padding-inline: 12px; font-size: .875rem; }
.quiet-button:hover, .icon-button:enabled:hover { background: var(--surface); border-color: #405050; }
.alert-button { margin-left: auto; }
.icon-button { width: 38px; height: 38px; flex: none; padding: 0; color: var(--muted); }
.line-icon { position: relative; display: inline-block; width: 16px; height: 16px; flex: none; color: currentColor; }
.bell-icon::before { content: ""; position: absolute; inset: 1px 3px 4px; border: 1.5px solid; border-radius: 6px 6px 2px 2px; }
.bell-icon::after { content: ""; position: absolute; bottom: 1px; left: 6px; width: 4px; border-top: 1.5px solid; border-radius: 2px; }
.search-icon::before { content: ""; position: absolute; top: 1px; left: 1px; width: 11px; height: 11px; border: 1.5px solid; border-radius: 50%; }
.search-icon::after { content: ""; position: absolute; width: 6px; height: 1.5px; right: 0; bottom: 3px; background: currentColor; border-radius: 2px; transform: rotate(45deg); }
.refresh-icon::before { content: ""; position: absolute; inset: 2px; border: 1.5px solid; border-right-color: transparent; border-radius: 50%; transform: rotate(34deg); }
.refresh-icon::after { content: ""; position: absolute; top: 1px; right: 1px; width: 5px; height: 5px; border-right: 1.5px solid; border-bottom: 1.5px solid; }
#refresh[aria-busy="true"] .refresh-icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.workspace { padding-block: 38px 16px; }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 29px; }
.live-status { display: inline-flex; align-items: center; gap: 8px; font: 600 .75rem var(--mono); letter-spacing: .075em; color: var(--muted); margin-bottom: 13px; }
.live-status[data-state="ok"] { color: var(--green); }
.live-status[data-state="stale"], .live-status[data-state="error"] { color: var(--amber); }
.status-indicator { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.live-status[data-state="ok"] .status-indicator { box-shadow: 0 0 0 4px #2c4839; }
h1 { font-size: clamp(2.2rem, 5vw, 3.625rem); font-weight: 700; line-height: 1.04; letter-spacing: -.065em; }
.intro p { color: var(--muted); font-size: 1rem; line-height: 1.5; margin-top: 11px; }
.position-control { flex: 0 0 210px; display: grid; gap: 6px; }
.position-control label { color: var(--muted); font-size: .875rem; font-weight: 500; }
.position-input { display: flex; align-items: center; gap: 10px; min-height: 43px; padding: 0 12px; background: var(--panel); border: 1px solid #3a4745; border-radius: 7px; }
.position-input:focus-within { border-color: var(--green); }
.position-input span { color: var(--green); font: 500 .9375rem var(--mono); }
.position-input input { width: 100%; padding: 0; border: 0; outline: 0; background: transparent; font: 500 1rem var(--mono); }
.position-input input:focus-visible { outline: 0; }
.position-input input[aria-invalid="true"] { color: var(--red); }
.position-control small { min-height: 16px; color: var(--secondary); }
.market-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 25px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.metric { min-width: 0; display: grid; justify-items: start; gap: 6px; min-height: 116px; padding: 17px 20px 15px; }
.metric + .metric { border-left: 1px solid var(--line); }
.metric-highlight { background: linear-gradient(120deg, #1c2b25 0%, #192321 62%, var(--panel) 100%); }
.metric-label { font-size: .875rem; color: var(--muted); font-weight: 500; line-height: 1.25; }
.metric-number { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 clamp(1.5rem, 2.25vw, 2rem)/1.15 var(--mono); letter-spacing: -.055em; }
.metric-highlight .metric-number { color: var(--green-strong); }
.metric-detail { overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; font: inherit; font-size: .8125rem; color: var(--secondary); }
.text-button { border: 0; padding: 0; background: transparent; color: var(--green); text-align: left; }
.text-button:hover { text-decoration: underline; text-underline-offset: 4px; }
.dashboard { display: grid; grid-template-columns: minmax(0, 1fr) clamp(242px, 20vw, 286px); gap: 20px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: 9px; background: var(--panel); min-width: 0; }
.market-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 17px 15px; }
.panel-title { display: flex; align-items: center; gap: 9px; }
h2 { font-size: 1.0625rem; font-weight: 700; line-height: 1.3; letter-spacing: -.025em; }
.market-heading p { margin-top: 4px; color: var(--muted); font-size: .8125rem; line-height: 1.4; }
.count-badge, .side-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 21px; padding: 0 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel-raised); color: var(--muted); font: 500 .75rem var(--mono); }
.view-switch { display: flex; align-items: center; flex: none; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--page); }
.view-switch button { min-height: 31px; border: 0; background: transparent; color: var(--muted); padding: 0 11px; border-radius: 4px; font-size: .875rem; font-weight: 500; }
.view-switch button:hover { color: var(--text); }
.view-switch button[aria-pressed="true"] { background: var(--surface); color: var(--text); }
.filter-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 0 17px 12px; }
.search-control, .select-control { position: relative; display: flex; align-items: center; min-height: 38px; background: var(--page); border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: .875rem; }
.search-control { flex: 1 1 145px; gap: 9px; padding-inline: 11px 6px; }
.search-control:focus-within, .select-control:focus-within { border-color: var(--green); }
.search-control input { width: 100%; min-width: 45px; height: 36px; padding: 0 4px 0 0; background: transparent; color: var(--text); border: 0; outline: 0; }
.search-control input::placeholder { color: var(--secondary); opacity: 1; }
.search-control input:focus-visible { outline: none; }
.select-control::after, .chevron { width: 7px; height: 7px; border-right: 1.5px solid; border-bottom: 1.5px solid; transform: translateY(-2px) rotate(45deg); }
.select-control::after { content: ""; position: absolute; right: 12px; pointer-events: none; }
.select-control select { height: 36px; max-width: 170px; appearance: none; color-scheme: dark; border: 0; background: transparent; color: var(--text); border-radius: 7px; padding: 0 27px 0 10px; font-weight: 500; }
.select-control select:focus-visible { outline: 0; }
.select-control option { background-color: var(--page); color: var(--text); }
.category-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 17px 10px; }
.category-list { min-width: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.category-list::-webkit-scrollbar { display: none; }
.category { flex: none; min-height: 31px; padding: 0 8px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: .8125rem; font-weight: 500; }
.category:hover { color: var(--text); background: var(--panel-raised); }
.category[aria-pressed="true"] { background: #26392e; color: var(--green-strong); }
.category:focus-visible { outline-offset: -2px; }
.threshold-toggle { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 31px; border: 1px solid var(--line); border-radius: 6px; background: var(--page); padding: 0 8px; color: var(--muted); font: 500 .75rem var(--mono); }
.threshold-toggle:hover { color: var(--text); }
.threshold-toggle[aria-pressed="true"] { background: #26392e; color: var(--green-strong); border-color: #476552; }
.threshold-toggle:disabled { opacity: .42; }
.toggle-mark { width: 10px; height: 10px; border: 1px solid currentColor; border-radius: 2px; }
.threshold-toggle[aria-pressed="true"] .toggle-mark { background: currentColor; box-shadow: inset 0 0 0 2px #26392e; }
.table-scroll { overflow-x: auto; scrollbar-width: thin; scrollbar-color: #455650 var(--panel); }
.table-scroll:focus-visible { outline-offset: -2px; }
.rates-table { width: 100%; border-collapse: separate; border-spacing: 0; white-space: nowrap; text-align: left; font-size: .875rem; }
.rates-table th { height: 38px; position: relative; background: var(--panel-raised); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); text-align: left; font-size: .8125rem; font-weight: 500; }
.rates-table th, .rates-table td { padding: 0 8px; }
.rates-table th:first-child, .rates-table td:first-child { padding-left: 17px; }
.rates-table th:last-child, .rates-table td:last-child { padding-right: 17px; }
.rates-table th.numeric, .rates-table td.numeric { text-align: right; }
.rates-table th button { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 0; margin-block: 2px; padding: 4px 0; color: inherit; font: inherit; text-align: inherit; white-space: nowrap; }
.rates-table th button:hover, .rates-table th[aria-sort] { color: var(--text); }
.sort-symbol { color: var(--green); font-family: var(--mono); font-size: .8125rem; }
.rates-table td { height: 53px; border-bottom: 1px solid var(--line-subtle); }
.rates-table tr:last-child td { border-bottom: 0; }
.rates-table tbody tr:hover td { background-color: #192021; }
.asset-button { display: inline-flex; align-items: center; gap: 9px; max-width: 100%; background: none; border: 0; padding: 0; text-align: left; }
.asset-button:hover .asset-main { text-decoration: underline; text-underline-offset: 4px; }
.asset-icon { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; border: 1px solid #465b4e; border-radius: 7px; background: #25372f; color: #cae8d4; font: 600 .6875rem var(--mono); text-align: center; }
.asset-icon[data-category="stock"] { border-color: #42596a; background: #243541; color: #c1daee; }
.asset-icon[data-category="metal"], .asset-icon[data-category="commodity"] { border-color: #62533b; background: #3b3122; color: #f7d79d; }
.asset-icon[data-category="forex"], .asset-icon[data-category="index"] { border-color: #544b66; background: #342c46; color: #e5d6f2; }
.asset-icon[data-category="other"] { border-color: #4c5555; background: #303939; color: #d1d9d7; }
.asset-main { display: block; font-size: .875rem; font-weight: 700; line-height: 1.25; }
.sub-data { display: block; color: var(--secondary); font-size: .75rem; line-height: 1.25; margin-top: 3px; }
.venue-name { display: inline-block; white-space: nowrap; font-size: .8125rem; font-weight: 600; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.numeric-rate { display: inline-block; font-size: .875rem; font-weight: 600; line-height: 1.25; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.neutral { color: var(--muted); }
.stale-text { color: var(--amber); }
.money { font-size: .875rem; }
.timing { font-size: .8125rem; }
.stale-row .numeric-rate, .stale-row .money { color: var(--muted); }
.table-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 264px; padding: 26px 20px; text-align: center; color: var(--muted); }
.state-icon { display: grid; place-items: center; width: 39px; height: 39px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-raised); color: var(--green); font: 600 1.125rem var(--mono); }
.table-state strong { color: var(--text); margin-bottom: 6px; }
.table-state > span:last-of-type { font-size: .875rem; line-height: 1.4; }
.table-state button { margin-top: 13px; }
.table-footer { min-height: 53px; display: flex; flex-wrap: wrap; gap: 7px; align-items: center; justify-content: space-between; padding: 8px 17px; border-top: 1px solid var(--line); color: var(--secondary); font-size: .8125rem; }
.page-controls { display: flex; align-items: center; gap: 9px; font: 500 .75rem var(--mono); }
.page-controls .icon-button { width: 29px; height: 29px; }
.chevron.previous { transform: translateX(1px) rotate(135deg); }
.chevron.next { transform: translateX(-1px) rotate(-45deg); }
.sidebar { display: grid; gap: 15px; }
.side-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 13px 12px; border-bottom: 1px solid var(--line-subtle); }
.side-heading h2 { font-size: 1rem; }
.side-chip { background: #262d3a; border-color: #39445a; color: #c5d5f5; }
.side-meta { color: var(--secondary); font: 500 .75rem var(--mono); }
.watch-items, .source-items { margin: 0; padding: 0 13px; list-style: none; }
.watch-items li + li, .source-items li + li { border-top: 1px solid var(--line-subtle); }
.watch-button { min-height: 55px; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 6px 0; border: 0; background: none; color: inherit; text-align: left; }
.watch-button:hover { color: var(--green); }
.watch-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.watch-values { text-align: right; }
.watch-values .numeric-rate { font-size: .8125rem; }
.watch-name .sub-data { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 96px; }
.watch-footer, .source-footer { display: flex; min-height: 37px; align-items: center; gap: 7px; border-top: 1px solid var(--line-subtle); padding: 7px 13px; color: var(--secondary); font-size: .75rem; }
.watch-footer .status-indicator { width: 5px; height: 5px; color: var(--green); }
.source-footer { justify-content: space-between; }
.source-footer time { color: var(--muted); font: 500 .75rem var(--mono); }
.source-item { min-height: 36px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 5px; }
.source-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: .8125rem; font-weight: 500; }
.source-name .status-indicator { width: 6px; height: 6px; }
.source-name .status-indicator[data-state="ok"] { color: var(--green); }
.source-name .status-indicator[data-state="stale"], .source-name .status-indicator[data-state="error"] { color: var(--amber); }
.source-name .status-indicator[data-state="pending"] { color: var(--secondary); }
.source-value { font: 400 .75rem var(--mono); color: var(--muted); text-align: right; }
.empty-sources { padding-block: 14px; font-size: .8125rem; color: var(--muted); line-height: 1.35; }
.footer { display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; margin-block: 19px 0; padding-block: 13px 4px; color: var(--secondary); font-size: .8125rem; }
.footer span:first-child { color: var(--muted); font-weight: 600; }

.dialog { width: min(100% - 30px, 520px); max-height: 90vh; color: var(--text); border: 1px solid #3b4845; border-radius: 10px; background: var(--panel); padding: 0; }
.dialog::backdrop { background: rgb(6 9 9 / .78); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.dialog-heading h2 { font-size: 1.125rem; }
.dialog-heading .icon-button { width: 32px; height: 32px; }
.close-icon { width: 14px; height: 14px; position: relative; }
.close-icon::before, .close-icon::after { content: ""; position: absolute; inset: 6px 0 auto; height: 1.5px; background: currentColor; transform: rotate(45deg); }
.close-icon::after { transform: rotate(-45deg); }
.dialog-body { display: grid; gap: 12px; padding: 16px 17px 20px; }
.dialog-body p { color: var(--muted); font-size: .875rem; line-height: 1.5; }
.dialog-body dl { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin: 0; font-size: .875rem; align-items: baseline; }
.dialog-body dt { color: var(--muted); }
.dialog-body dd { margin: 0; text-align: right; font-family: var(--mono); }
.dialog a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 1150px) {
  .topbar-inner, .workspace { width: calc(100% - 56px); }
  .dashboard { grid-template-columns: minmax(0, 1fr) 230px; gap: 14px; }
  .rates-table { min-width: 624px; }
  .category-bar { gap: 7px; }
  .category { padding-inline: 6px; }
}
@media (max-width: 965px) {
  .topbar-inner, .workspace { width: calc(100% - 38px); }
  .dashboard { grid-template-columns: minmax(0, 1fr); }
  .sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 620px) {
  .topbar-inner, .workspace { width: calc(100% - 28px); }
  .topbar-inner { min-height: 59px; gap: 11px; }
  .brand { font-size: 1.0625rem; gap: 7px; }
  .brand-icon { width: 29px; height: 29px; }
  .header-nav { display: none; }
  .workspace { padding-top: 23px; }
  .intro { display: grid; gap: 15px; margin-bottom: 15px; }
  .intro p { max-width: 35ch; margin-top: 7px; font-size: .875rem; }
  .live-status { margin-bottom: 9px; }
  .position-control { width: min(100%, 210px); gap: 5px; }
  .market-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 13px; }
  .metric { min-height: 91px; padding: 10px 12px; gap: 5px; }
  .metric:nth-child(3) { border-left: 0; }
  .metric:nth-child(n+3) { border-top: 1px solid var(--line); }
  .metric-number { font-size: 1.375rem; }
  .metric-label, .metric-detail { font-size: .75rem; }
  .market-heading { align-items: flex-start; }
  .market-heading, .table-footer { padding-inline: 11px; }
  .market-heading p { font-size: .75rem; }
  .view-switch button { padding-inline: 6px; font-size: .75rem; min-height: 29px; }
  .filter-controls, .category-bar { padding-inline: 10px; }
  .search-control { flex-basis: 100%; }
  .select-control { flex: 1 1 105px; }
  .select-control select { width: 100%; max-width: none; }
  .category { padding-inline: 7px; }
  .table-scroll { position: relative; }
  .rates-table th:first-child, .rates-table td:first-child { position: sticky; left: 0; z-index: 1; padding-left: 10px; border-right: 1px solid var(--line-subtle); }
  .rates-table td:first-child { background: var(--panel); }
  .sidebar { grid-template-columns: 1fr; gap: 13px; }
  .footer { gap: 6px; margin-top: 12px; font-size: .75rem; }
}
@media (prefers-reduced-motion: reduce) {
  #refresh[aria-busy="true"] .refresh-icon { animation: none; }
}


.rates-table tr[data-market-row] { cursor: pointer; }
.spread-leg-price { margin-block: 2px 3px; }
body:has(.ticker-dialog[open]) { overflow: hidden; }
.ticker-dialog {
  width: min(100% - 48px, 790px);
  max-width: none;
  max-height: min(88dvh, 790px);
  padding: 0;
  overflow: hidden;
  color: var(--text);
  background: var(--panel);
  border: 1px solid #43524f;
  border-radius: 16px;
  box-shadow: 0 24px 88px rgb(0 0 0 / .52);
}
.ticker-dialog[open] { display: flex; flex-direction: column; animation: ticker-in 130ms ease-out; }
.ticker-dialog::backdrop { background: rgb(7 11 10 / .77); backdrop-filter: blur(3px); }
@keyframes ticker-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
.ticker-heading { display: flex; align-items: center; justify-content: space-between; flex: none; gap: 12px; padding: 19px 24px; border-bottom: 1px solid var(--line); background: #171d1d; }
.ticker-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ticker-identity .asset-icon { width: 44px; height: 44px; font-size: .9375rem; border-radius: 10px; }
.ticker-identity h2 { overflow-wrap: anywhere; font-family: var(--mono); font-size: clamp(1.2rem, 4.5vw, 1.625rem); line-height: 1.15; }
.ticker-identity p { margin-top: 4px; color: var(--muted); font-size: .8125rem; }
.ticker-close { width: 38px; height: 38px; background: transparent; }
.ticker-body { display: grid; gap: 20px; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #4b5c57 transparent; padding: 20px 24px 24px; }
.ticker-overview { display: grid; gap: 20px; }
.ticker-summary { display: grid; grid-template-columns: 1fr 1.35fr; gap: 10px; }
.ticker-stat { min-width: 0; min-height: 116px; display: flex; flex-direction: column; gap: 7px; padding: 13px 15px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-raised); }
.ticker-anchor { background: linear-gradient(115deg, #252935, #1a2326 68%); border-color: #3c4851; }
.ticker-opportunity { background: linear-gradient(120deg, #1d3027, #192522 72%); border-color: #394c44; }
.ticker-stat-label { color: var(--text); font-size: .875rem; font-weight: 650; }
.ticker-stat-label span { color: var(--muted); font: 400 .75rem/1.4 var(--mono); }
.ticker-stat-symbol { margin-left: 3px; overflow-wrap: anywhere; }
.ticker-stat-number { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 2px; }
.ticker-stat-number .numeric-rate { font-size: clamp(1.15rem, 3.7vw, 1.64rem); letter-spacing: -.035em; }
.ticker-stat-number small { color: var(--muted); font: 500 .8125rem/1.4 var(--mono); white-space: nowrap; }
.ticker-stat-foot { margin-top: auto; color: var(--text); font-size: .8125rem; line-height: 1.45; overflow-wrap: anywhere; }
.ticker-stat-foot small { color: var(--muted); margin-left: 2px; font-size: .6875rem; }
.ticker-separator { color: var(--secondary); margin: 0 2px; }
.ticker-section { display: grid; gap: 9px; min-width: 0; }
.ticker-section-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.ticker-section-heading h3 { margin: 0; font-size: .9375rem; font-weight: 700; line-height: 1.3; }
.ticker-section-heading time { color: var(--secondary); font: .75rem var(--mono); white-space: nowrap; }
.ticker-table-frame { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; }
.ticker-markets { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ticker-markets thead { background: var(--panel-raised); color: var(--muted); font-size: .8125rem; }
.ticker-markets thead th { padding: 8px 12px; text-align: right; font-weight: 550; }
.ticker-markets thead th:first-child { width: 55%; text-align: left; }
.ticker-markets td, .ticker-markets tbody th { padding: 9px 12px; border-top: 1px solid var(--line-subtle); vertical-align: middle; }
.ticker-markets tbody th { text-align: left; font-weight: 400; }
.ticker-markets tbody td { text-align: right; }
.ticker-market-weex { background: #1c2827; }
.ticker-market-weex th { box-shadow: inset 2px 0 #75c995; }
.ticker-venue { display: grid; align-items: center; grid-template-columns: minmax(0, 1fr) auto; column-gap: 6px; }
.ticker-venue-label { display: flex; align-items: baseline; flex-wrap: wrap; min-width: 0; column-gap: 6px; row-gap: 2px; }
.ticker-venue strong { font-size: .875rem; }
.ticker-venue-label span { overflow: hidden; color: var(--secondary); font: .6875rem var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.book-launch { min-height: 28px; padding: 0 8px; border: 1px solid #3c504a; border-radius: 5px; background: #1c2926; color: #c9e4d7; font-size: .75rem; white-space: nowrap; }
.book-launch:hover { border-color: #628274; background: #243831; color: var(--text); }
.ticker-price-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 1px 7px; margin-top: 3px; }
.ticker-price { font-size: .8125rem; color: #d5e2de; }
.ticker-price-diff, .ticker-rate-diff { font: .6875rem/1.45 var(--mono); color: var(--secondary); white-space: nowrap; }
.ticker-markets td small { display: block; margin-top: 1px; font-size: .6875rem; color: var(--secondary); }
.ticker-price-line small { font-size: .625rem; color: var(--secondary); }
.ticker-market-note { padding: 6px 1px 0; color: var(--secondary); font-size: .75rem; line-height: 1.45; }
.ticker-empty { min-height: 43px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: .8125rem; line-height: 1.45; }
.history-controls { align-items: center; }
.history-controls .select-control { flex: 0 1 auto; min-height: 32px; }
.history-controls select { height: 30px; max-width: 230px; font-size: .8125rem; }
.ticker-chart { display: grid; gap: 2px; min-width: 0; padding: 10px 12px 9px; border: 1px solid var(--line); border-radius: 9px; background: #171f1d; }
.ticker-chart-value { display: flex; align-items: baseline; gap: 6px; }
.ticker-chart-value span:last-child { color: var(--secondary); font-size: .75rem; }
.ticker-chart canvas { display: block; width: 100%; height: 68px; }
.ticker-chart-axis { display: flex; justify-content: space-between; gap: 8px; color: var(--secondary); font: .6875rem/1.3 var(--mono); }
.ticker-events { border: 1px solid var(--line-subtle); border-radius: 7px; }
.ticker-events summary { padding: 8px 10px; color: var(--muted); font-size: .8125rem; cursor: pointer; }
.ticker-events ul { max-height: 152px; overflow: auto; list-style: none; margin: 0 10px 5px; padding: 0; scrollbar-width: thin; }
.ticker-events li { display: flex; align-items: center; justify-content: space-between; min-height: 27px; gap: 8px; padding: 3px 0; border-top: 1px solid var(--line-subtle); }
.ticker-events li time { color: var(--muted); font: .75rem var(--mono); }
.ticker-events li .numeric-rate { font-size: .75rem; }
.ticker-dialog:has(.ticker-book:not([hidden])) { min-height: min(88dvh, 756px); }
.ticker-book { display: grid; align-content: start; gap: 12px; min-width: 0; }
.book-back { justify-self: start; min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--muted); font-size: .8125rem; }
.book-back:hover { color: var(--text); border-color: #4a5a57; background: var(--panel-raised); }
.book-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 10px; min-width: 0; }
.book-heading { min-width: 0; }
.book-heading h3 { margin: 0; font-size: 1.125rem; font-weight: 700; }
.book-feed { display: flex; align-items: center; flex-wrap: wrap; column-gap: 10px; row-gap: 4px; margin-top: 5px; color: var(--muted); font-size: .75rem; }
.book-status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.book-status::before { width: 6px; height: 6px; flex: none; border-radius: 50%; background: currentColor; content: ""; }
.book-status[data-status="live"] { color: var(--green); }
.book-status[data-status="stale"] { color: var(--amber); }
.book-status[data-status="error"] { color: var(--red); }
.book-feed time { font-family: var(--mono); }
.book-select { flex: 0 1 auto; min-width: 0; }
.book-select select { width: min(280px, 36vw); max-width: none; min-width: 0; text-overflow: ellipsis; }
@supports (appearance: base-select) and selector(::picker(select)) {
  .book-select select, .book-select select::picker(select) { appearance: base-select; }
  .book-select select::picker-icon { display: none; }
  .book-select select::picker(select) {
    max-inline-size: min(360px, 100vw - 20px);
    max-block-size: min(50dvh, 340px);
    margin-block: 4px;
    padding: 4px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--page);
    color: var(--text);
  }
  .book-select option { min-height: 34px; padding: 6px 8px; border-radius: 4px; overflow-wrap: anywhere; }
  .book-select option:is(:hover, :focus-visible) { background: var(--surface); }
  .book-select option:checked { background: #26392e; color: var(--green-strong); }
}
.book-frame { overflow: hidden; min-width: 0; background: #121718; border: 1px solid var(--line); border-radius: 9px; }
.book-table { width: 100%; border-collapse: collapse; table-layout: fixed; font: .875rem/1.32 var(--mono); font-variant-numeric: tabular-nums; }
.book-table thead { background: #1c2324; color: var(--muted); }
.book-table th, .book-table td { overflow: hidden; padding: 2px 13px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.book-table th:first-child, .book-table td:first-child { text-align: left; }
.book-table th { font-weight: 500; }
.book-table thead th { padding-block: 7px; font: 500 .75rem/1.3 var(--sans); }
.book-level { background: linear-gradient(to left, var(--book-depth) var(--depth), transparent var(--depth)); color: #c6d0ce; }
.book-level td:first-child { color: var(--book-price); }
.book-ask { --book-depth: rgb(187 84 91 / .14); --book-price: #f3a6a7; }
.book-bid { --book-depth: rgb(72 158 111 / .16); --book-price: #a4e4c0; }
.book-spread { color: var(--text); background: #212b2a; border-block: 1px solid #34413e; }
.book-spread td, .book-spread th { padding-block: 6px; }
.book-spread th { color: var(--muted); }
.book-side-empty td { padding-block: 10px; color: var(--secondary); }
.book-message { padding: 12px; color: var(--muted); font-size: .875rem; line-height: 1.45; }
.book-table[hidden] + .book-message { display: grid; min-height: 155px; place-items: center; text-align: center; }
.book-retry { justify-self: start; }
@media (max-width: 620px) {
  .ticker-dialog { width: calc(100% - 16px); max-height: 94dvh; border-radius: 12px; }
  .ticker-heading { padding: 13px 12px; }
  .ticker-body { padding: 12px 10px 16px; }
  .ticker-overview { gap: 16px; }
  .ticker-summary { grid-template-columns: minmax(0, 1fr) minmax(0, 1.22fr); gap: 6px; }
  .ticker-stat { padding: 10px 8px; gap: 5px; }
  .ticker-stat-label { font-size: .8125rem; }
  .ticker-stat-label span, .ticker-stat-number small { font-size: .6875rem; }
  .ticker-stat-foot { font-size: .75rem; }
  .ticker-stat-foot small { margin-left: 0; }
  .ticker-markets thead th, .ticker-markets td, .ticker-markets tbody th { padding-inline: 7px; }
  .ticker-markets thead th:first-child { width: 49%; }
  .ticker-markets thead th { font-size: .75rem; }
  .ticker-markets .numeric-rate { font-size: .8125rem; }
  .ticker-venue, .ticker-venue-label { column-gap: 4px; }
  .ticker-venue strong { font-size: .8125rem; }
  .ticker-venue-label span, .ticker-price-diff, .ticker-markets td small { font-size: .625rem; }
  .ticker-price { font-size: .75rem; }
  .book-launch { min-height: 29px; padding: 0 5px; font-size: .6875rem; }
  .history-controls { align-items: baseline; }
  .history-controls .select-control { max-width: 100%; }
  .ticker-dialog:has(.ticker-book:not([hidden])) { min-height: min(94dvh, 756px); }
  .ticker-book { gap: 9px; }
  .book-select select { width: min(191px, 47vw); }
  .book-table { font-size: .8125rem; }
  .book-table th, .book-table td { padding-inline: 6px; }
  .book-table thead th { font-size: .6875rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-dialog[open] { animation: none; }
}
