* { box-sizing: border-box; }
html { font: 13px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", system-ui, sans-serif; color: var(--ink); background: var(--bg); }
body { margin: 0; background: var(--bg); }
button, input, select { font: inherit; color: var(--ink); }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { background: transparent; cursor: pointer; }
button:disabled { cursor: default; opacity: .4; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }
::selection { background: #284c76; color: #fff; }
* { scrollbar-width: thin; scrollbar-color: var(--control-line) transparent; }
.top { height: 48px; position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 28px; padding: 0 18px; background: var(--nav); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; white-space: nowrap; }
.mark { display: grid; place-items: center; width: 23px; height: 23px; border: 1px solid var(--selected-line); border-radius: 3px; color: var(--blue); font-size: 18px; }
.mode-nav { display: flex; align-self: stretch; gap: 20px; }
.mode-nav a { display: flex; align-items: center; position: relative; color: var(--muted); font-size: 12px; white-space: nowrap; }
.mode-nav a.active { color: var(--ink); }
.mode-nav a.active::after { content: ""; position: absolute; height: 2px; background: var(--blue); bottom: 0; inset-inline: 0; }
.top-spacer { flex: 1; }
.settings-link { font-size: 12px; color: var(--muted); }
.connection { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.connection i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); }
.connection i.live { background: var(--green); }
.market-workspace { display: grid; grid-template-columns: 222px minmax(0, 1fr); }
.index-sidebar { position: sticky; top: 48px; height: calc(100dvh - 48px); min-height: 0; overflow: hidden; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--panel); }
.sidebar-heading { display: flex; justify-content: space-between; flex-shrink: 0; padding: 14px 14px 10px; color: var(--muted); font-size: 11px; }
.sidebar-heading>span { font-family: var(--numeric); }
.category-list { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.category-item { flex: 0 0 auto; display: grid; width: 100%; min-height: 68px; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 30px 20px; gap: 3px 8px; padding: 7px 13px; align-items: center; text-align: left; border: 0; border-left: 2px solid transparent; border-bottom: 1px solid var(--row-line); border-radius: 0; overflow: hidden; font-size: 12px; }
.category-item:hover { background: var(--hover); }
.category-item.active { border-left-color: var(--blue); background: var(--selected); }
.category-item>span { min-width: 0; }
.category-item>span:first-child { line-height: 16px; }
.category-item small { display: block; margin-top: 1px; color: var(--muted); font-size: 10px; line-height: 12px; font-weight: 400; }
.category-number { font: 12px/1.4 var(--numeric); text-align: right; }
.mini-curve { display: flex; flex-direction: column; align-items: center; gap: 0; width: 100px; }
.mini-curve svg { display: block; width: 100px; height: 27px; overflow: hidden; }
.mini-curve small { font: 10px/13px var(--numeric); }
.category-item>.category-curve { grid-column: 1 / -1; flex-direction: row; gap: 10px; width: 100%; height: 20px; min-height: 20px; overflow: hidden; }
.category-item>.category-curve svg { flex: 1 1 0; min-width: 0; width: 0; height: 20px; overflow: hidden; }
.category-item>.category-curve small { flex-shrink: 0; min-width: 49px; margin: 0; text-align: right; line-height: 20px; }
.sidebar-bottom { flex-shrink: 0; padding: 12px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.sidebar-bottom progress { display: block; appearance: none; width: 100%; height: 2px; margin: 8px 0; border: 0; background: var(--line); }
.sidebar-bottom progress::-webkit-progress-bar { background: var(--line); }
.sidebar-bottom progress::-webkit-progress-value { background: #5076a3; }
.sidebar-bottom progress::-moz-progress-bar { background: #5076a3; }
.sidebar-bottom p { margin: 6px 0 12px; }
.sidebar-bottom a { display: flex; justify-content: space-between; color: var(--ink); border-top: 1px solid var(--line); padding-top: 10px; }
.market-main { min-width: 0; padding: 12px 16px 16px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; min-height: 32px; }
.page-heading>div:first-child { display: flex; align-items: baseline; gap: 12px; }
.section-label { font-size: 10px; color: var(--muted); }
h1 { margin: 0; font-size: 19px; font-weight: 600; }
h2 { margin: 0; font-size: 13px; font-weight: 600; }
.price-mode, .range-tabs { display: flex; align-items: center; gap: 2px; }
.price-mode { border: 1px solid var(--line); border-radius: 3px; padding: 2px; }
.price-mode button, .range-tabs button { padding: 4px 9px; border: 0; border-radius: 2px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.price-mode button.active, .range-tabs button.active { color: var(--ink); background: var(--control-active); }
.price-mode button:hover, .range-tabs button:hover, .volume-controls button:hover { color: var(--ink); }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.index-panel, .market-flow { min-width: 0; border: 1px solid var(--line); background: var(--panel); border-radius: 3px; overflow: hidden; }
.index-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 0; }
.index-number { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; min-height: 38px; }
.index-number strong { font: 600 30px/1.2 var(--numeric); letter-spacing: -.04em; }
.index-number span { font: 11px/1.5 var(--numeric); color: var(--muted); }
.volume-controls { display: flex; align-items: center; gap: 3px; padding: 8px 16px 0; }
.volume-controls button { padding: 4px 7px; border: 0; border-radius: 2px; font-size: 10px; color: var(--muted); }
.volume-controls button.active { color: var(--blue); background: var(--selected); }
.volume-controls>span { margin-left: auto; color: var(--muted); font-size: 10px; }
.chart-surface { position: relative; height: 270px; margin: 8px 8px 0; }
#indexChart, #flowChart { display: block; width: 100%; height: 100%; }
.chart-empty { position: absolute; inset: 10px 0 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--panel); }
.chart-empty strong { color: var(--ink); font-size: 13px; font-weight: 500; }
.chart-empty p { margin: 8px 0; max-width: 340px; color: var(--muted); font-size: 11px; text-align: center; }
.chart-tooltip { position: absolute; z-index: 2; pointer-events: none; border: 1px solid var(--control-line); border-radius: 3px; padding: 8px 10px; background: var(--tip); box-shadow: 0 4px 16px #0005; font-size: 11px; white-space: pre-line; font-variant-numeric: tabular-nums; }
.index-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.index-foot>div { display: flex; gap: 12px; flex-wrap: wrap; }
.index-foot b { color: var(--ink); font-weight: 500; margin-left: 3px; font-family: var(--numeric); }
.market-flow { display: flex; flex-direction: column; }
.products-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.flow-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.flow-metrics>div { min-width: 0; padding: 14px; border-bottom: 1px solid var(--line); }
.flow-metrics>div+div { border-left: 1px solid var(--line); }
.flow-metrics span, .preview-metrics span { display: block; margin-bottom: 5px; font-size: 10px; color: var(--muted); }
.flow-metrics strong { font: 500 20px/1.5 var(--numeric); letter-spacing: -.04em; }
.flow-metrics small { margin-left: 4px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.flow-chart-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 10px 14px 0; color: var(--muted); font-size: 10px; }
.flow-chart-surface { position: relative; height: 140px; margin: 6px 4px 0; }
.flow-orders { margin: 0; padding: 8px 14px; color: var(--muted); font: 10px/1.5 var(--numeric); border-top: 1px solid var(--line); }
.product-section { margin-top: 12px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel); overflow: hidden; }
#resultCount, .table-caption { font-size: 10px; font-weight: 400; color: var(--muted); }
#resultCount { margin-left: 8px; }
.table-caption { font-family: var(--numeric); }
.product-toolbar { display: flex; align-items: center; gap: 14px; padding: 10px 14px; }
.search-field { display: flex; align-items: center; gap: 8px; width: 280px; max-width: 40%; padding: 0 9px; border: 1px solid var(--line); border-radius: 3px; background: var(--input); }
.search-field:focus-within { border-color: var(--selected-line); }
.search-field svg { flex-shrink: 0; stroke: var(--muted); fill: none; stroke-width: 1.5; }
.search-field input { width: 100%; min-width: 0; height: 30px; background: transparent; border: 0; outline: none; font-size: 11px; }
.search-field input::placeholder { color: var(--muted); }
.sort-field, .volume-window { display: flex; align-items: center; gap: 7px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.sort-field select, .volume-window select { height: 31px; max-width: 160px; padding: 0 7px; border: 1px solid var(--line); border-radius: 3px; background: var(--input); font-size: 11px; }
.watch-shortcut { margin-left: auto; color: var(--blue); white-space: nowrap; font-size: 11px; }
.table-scroll { overflow-x: auto; }
.market-table { width: 100%; border-collapse: collapse; white-space: nowrap; font: 12px/1.5 var(--numeric); }
.market-table th, .market-table td { text-align: right; border-bottom: 1px solid var(--row-line); padding: 8px 12px; }
.market-table th { padding-top: 9px; padding-bottom: 9px; border-top: 1px solid var(--line); border-bottom-color: var(--line); color: var(--muted); background: var(--p2); font: 10px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", system-ui, sans-serif; }
.market-table th:first-child, .market-table td:first-child { width: 28%; min-width: 230px; text-align: left; }
.market-table th:last-child, .market-table td:last-child { width: 72px; padding-left: 8px; padding-right: 14px; }
.market-table tbody tr:hover { background: var(--hover); }
.market-table tbody tr:last-child td { border-bottom: 0; }
.product-link { display: flex; align-items: center; gap: 10px; min-height: 40px; max-width: 340px; }
.product-art { flex-shrink: 0; position: relative; display: block; width: 56px; height: 40px; overflow: hidden; background: var(--thumb); border-radius: 2px; }
.product-art svg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); stroke: var(--muted); fill: none; opacity: .55; }
.product-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 1; }
.product-art.has-image svg { visibility: hidden; }
.product-name { min-width: 0; font: 500 12px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", system-ui, sans-serif; }
.product-name>span:first-child { display: block; overflow: hidden; text-overflow: ellipsis; }
.product-link:hover .product-name { color: var(--blue); }
.product-sub { display: block; margin-top: 2px; color: var(--muted); font: 10px/1.4 -apple-system, BlinkMacSystemFont, "PingFang SC", system-ui, sans-serif; }
.mini-curve-cell { width: 112px; min-width: 112px; padding: 5px 6px !important; }
.buy, .down { color: var(--green) !important; }
.sell, .up { color: var(--red) !important; }
.flat { color: var(--blue) !important; }
.follow-button { min-width: 62px; padding: 4px 6px; border: 1px solid var(--control-line); border-radius: 3px; font: 10px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", system-ui, sans-serif; white-space: nowrap; }
.follow-button:hover { border-color: var(--blue); color: var(--blue); }
.follow-button.watched { border-color: transparent; color: var(--blue); }
.table-empty { padding: 44px 16px !important; text-align: center !important; color: var(--muted); font: 12px/1.5 system-ui; }
.table-footer { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted); font: 10px/1.5 var(--numeric); }
.table-footer>div { display: flex; gap: 5px; }
.table-footer button { width: 28px; height: 25px; border: 1px solid var(--line); border-radius: 2px; }
.market-notice { position: sticky; top: 60px; z-index: 10; display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding: 10px 12px; border: 1px solid var(--selected-line); border-radius: 3px; background: var(--selected); color: var(--ink); font-size: 11px; }
.market-notice button { flex-shrink: 0; border: 1px solid var(--control-line); border-radius: 2px; background: var(--panel); padding: 3px 8px; color: var(--blue); font: inherit; }
.market-footer { display: flex; gap: 16px; margin-top: 14px; color: var(--muted); font-size: 10px; }
.product-preview { width: min(620px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 24px; overflow: auto; border: 1px solid var(--control-line); border-radius: 4px; color: var(--ink); background: var(--panel); box-shadow: 0 24px 80px #0008; }
.product-preview::backdrop { background: #02060bb0; }
.preview-close { position: absolute; right: 10px; top: 8px; width: 28px; height: 28px; border: 0; border-radius: 2px; color: var(--muted); font-size: 24px; }
.preview-close:hover { background: var(--hover); }
.preview-heading { display: flex; align-items: center; gap: 16px; padding-right: 18px; }
.preview-art { display: grid; place-items: center; width: 94px; height: 72px; flex-shrink: 0; background: var(--p2); border-radius: 2px; }
.preview-art img { max-width: 100%; max-height: 100%; object-fit: contain; }
.preview-heading h2 { margin: 4px 0; font-size: 18px; white-space: normal; line-height: 1.4; }
.preview-heading p { margin: 5px 0; color: var(--muted); font-size: 11px; }
.preview-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 20px 0 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.preview-metrics strong { font: 500 20px/1.5 var(--numeric); }
.preview-chart { position: relative; height: 180px; }
.preview-chart canvas { display: block; width: 100%; height: 100%; }
.preview-chart>span { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.preview-footer { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 11px; }
.preview-dashboard { margin-left: auto; color: var(--blue); }
.preview-trade { padding: 6px 10px; border: 1px solid var(--selected-line); border-radius: 3px; color: var(--blue); background: var(--selected); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (min-width: 1280px) {
  .overview-grid { grid-template-columns: minmax(0, 1fr) 330px; }
  .market-flow .products-heading { padding-inline: 12px; }
  .market-flow .range-tabs button { padding-inline: 7px; }
  .flow-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-metrics>div { padding: 12px; }
  .flow-metrics>div:nth-child(3) { border-left: 0; }
  .flow-metrics strong { font-size: 20px; }
  .flow-chart-heading { flex-wrap: wrap; padding-inline: 12px; gap: 8px; }
  .flow-chart-heading>span { flex-basis: 100%; }
  .flow-chart-surface { flex: 1 1 auto; min-height: 116px; height: 116px; }
  .index-foot { flex-wrap: wrap; }
}
@media (min-width: 1700px) {
  .market-workspace { grid-template-columns: 238px minmax(0, 1fr); }
  .overview-grid { grid-template-columns: minmax(0, 1fr) 360px; }
  .chart-surface { height: 300px; }
}
@media (max-width: 1100px) {
  .market-workspace { grid-template-columns: 202px minmax(0, 1fr); }
  .market-main { padding-inline: 12px; }
  .index-foot { flex-wrap: wrap; }
  .flow-metrics strong { font-size: 18px; }
  .product-toolbar { flex-wrap: wrap; gap: 10px; }
  .watch-shortcut { display: none; }
}
@media (max-width: 800px) {
  .top { height: auto; min-height: 48px; flex-wrap: wrap; gap: 12px 16px; padding: 8px 12px; }
  .mode-nav { min-height: 28px; }
  .brand { font-size: 12px; }
  .mark, .connection { display: none; }
  .mode-nav { gap: 14px; }
  .market-workspace { display: block; }
  .index-sidebar { position: static; height: auto; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-heading, .sidebar-bottom { display: none; }
  .category-list { flex: initial; flex-direction: row; overflow-x: auto; overflow-y: hidden; }
  .category-item { display: block; width: auto; min-height: 40px; padding: 10px 12px; border-left: 0; border-bottom: 2px solid transparent; white-space: nowrap; }
  .category-item.active { border-bottom-color: var(--blue); }
  .category-item small, .category-number, .category-item>.category-curve { display: none; }
  .market-main { padding: 12px 10px; }
  .page-heading>div:first-child { gap: 8px; }
  .index-heading { align-items: flex-start; padding: 14px 12px 0; }
  .index-number { display: block; }
  .index-number strong { font-size: 26px; }
  .index-number span { display: block; margin-top: 5px; }
  .range-tabs button { padding-inline: 6px; }
  .volume-controls { padding-inline: 12px; flex-wrap: wrap; }
  .volume-controls>span { display: none; }
  .chart-surface { height: 240px; margin-inline: 0; }
  .index-foot { padding: 10px 12px; }
  .flow-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-metrics>div:nth-child(3) { border-left: 0; }
  .flow-chart-heading { flex-wrap: wrap; }
  .search-field { width: 100%; max-width: none; }
  .sort-field { flex: 1; }
  .preview-heading { gap: 12px; }
  .preview-art { width: 70px; height: 60px; }
  .preview-heading h2 { font-size: 16px; }
  .product-preview { padding: 22px 16px; }
  .preview-metrics strong { font-size: 16px; }
  .preview-footer { flex-wrap: wrap; gap: 10px; }
}

.sort-field select, .volume-window select { display: block; min-height: 31px; line-height: normal; margin: 0; padding-right: 24px; }
.product-section[aria-busy="true"] .table-scroll { opacity: .65; }
@media(max-width:640px) { .top { height: auto; min-height: 48px; flex-wrap: wrap; padding-block: 8px; gap: 10px 16px; } .mode-nav { min-height: 28px; } .market-workspace { min-height: 0; } .theme-switch { margin-left: auto; } .product-toolbar { gap: 10px; } .sort-field { min-width: 0; } .sort-field select { min-width: 0; max-width: 150px; } }

@media(max-width:640px){.market-notice { position: static; }}
.currency-switch { display: flex; flex: 0 0 auto; align-items: center; gap: 1px; padding: 2px; border: 1px solid var(--line); border-radius: 3px; }
.currency-switch button { border: 0; padding: 3px 7px; border-radius: 2px; color: var(--muted); font-size: 10px; }
.currency-switch button.active { background: var(--control-active); color: var(--ink); }
.market-footer { flex-wrap: wrap; gap: 6px 16px; }
@media(max-width:1100px){.top { gap: 14px; } .connection { display: none; }}
