/* A quiet terminal palette, with color reserved for assets and live activity. */
:root {
  --bg: #f5f6f7;
  --surface: #ffffff;
  --ink: #202529;
  --muted: #687279;
  --faint: #7e888f;
  --line: #e2e6e8;
  --green: #247759;
  --green-light: #edf7f1;
  --shadow: 0 3px 14px #172b3a04;
  --hover: #f6f8f9;
  --surface-soft: #fafbfc;
}
html[data-theme="dark"] {
  --bg: #090b0c;
  --surface: #121517;
  --ink: #eef2f3;
  --muted: #a5afb5;
  --faint: #86949c;
  --line: #282e32;
  --green: #84dcb5;
  --green-light: #172b22;
  --red: #ee9997;
  --red-light: #342021;
  --shadow: 0 3px 18px #00000018;
  --hover: #1a2023;
  --surface-soft: #101315;
}

/* Identity and page rhythm. */
.site-header { height: 72px; background: var(--surface); }
html[data-theme="dark"] .site-header { background: #0e1113; }
.header-inner { max-width: 1536px; gap: 24px; }
.wordmark { gap: 13px; font-size: 1.25rem; letter-spacing: -.055em; }
.brand-logo { display: inline-flex; align-items: center; justify-content: center; width: 27px; height: 36px; flex-shrink: 0; }
.brand-logo img { display: block; width: 22px; height: 36px; object-fit: contain; }
html[data-theme="dark"] .brand-logo img { filter: invert(1); }
.wordmark-divider { margin: 0 9px; color: #a0a9ae; }
.wordmark-live { font-size: .9375rem; font-weight: 500; letter-spacing: .07em; }
.header-description { padding-left: 24px; font-size: .8125rem; color: var(--faint); }
.theme-toggle { min-height: 36px; padding: 7px 10px; border-radius: 9px; color: var(--muted); }
.theme-toggle:hover { color: var(--ink); background: var(--hover); border-color: var(--faint); }
.theme-toggle svg { width: 16px; height: 16px; }
.connection { gap: 10px; }
.connection-detail { font-size: .8125rem; }
.status { font-size: .8125rem; padding: 5px 10px; font-weight: 550; }
html[data-theme="dark"] .status { background: #1b2125; }
html[data-theme="dark"] .status[data-state="live"] { border-color: #284b3b; }
.page-shell { padding-top: 30px; }
.page-heading { margin-bottom: 24px; align-items: flex-end; }
.page-heading h1 { font-size: 2.25rem; line-height: 1.18; letter-spacing: -.055em; font-weight: 600; margin-top: 7px; }
.eyebrow { font-size: .75rem; font-weight: 600; letter-spacing: .12em; }
.page-description { font-size: .9375rem; margin-top: 8px; }
.live-note { padding-bottom: 3px; font-size: .875rem; }
.live-note > span:last-child > span { font-size: .8125rem; }
.signal-icon { opacity: .85; }

/* Individual metric tiles make the overview easier to scan. */
.summary { margin-bottom: 23px; }
.summary-heading { margin-bottom: 11px; }
.summary-heading .small-heading { font-size: .8125rem; font-weight: 550; letter-spacing: .01em; }
.snapshot-meta { gap: 13px; }
.snapshot-meta .text-button { font-size: .8125rem; white-space: nowrap; }
.metrics-grid { border: 0; border-radius: 0; background: transparent; box-shadow: none; gap: 16px; overflow: visible; }
.metrics-grid .metric { position: relative; padding: 19px 21px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.metric-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.metric h2 { font-size: .875rem; font-weight: 450; letter-spacing: -.01em; color: var(--muted); }
.metric-icon { width: 17px; height: 17px; flex-shrink: 0; color: var(--faint); opacity: .8; }
.metric-value { font-size: clamp(1.5rem, 2.35vw, 2rem); font-weight: 550; letter-spacing: -.055em; line-height: 1.3; margin-top: 15px; }
.metric p { margin-top: 6px; color: var(--faint); font-size: .75rem; }
.metrics-grid .metric-live { border-color: #d4e7dc; background: #f0f8f3; }
.metric-live .metric-value { color: var(--green); }
.metric-live h2 { color: #527b65; }
.metric-live .metric-icon { color: var(--green); }
html[data-theme="dark"] .metrics-grid .metric-live { background: #122019; border-color: #294334; }
html[data-theme="dark"] .metric-live h2 { color: #9fbea9; }

/* Tabs and controls share a restrained, tactile treatment. */
.view-tabs { gap: 7px; margin-bottom: 20px; padding-bottom: 12px; }
.view-tab { gap: 8px; padding: 9px 13px; border: 1px solid transparent; border-radius: 8px; margin-bottom: 0; font-size: .875rem; font-weight: 500; }
.view-tab.active, .view-tab[aria-selected="true"] { background: var(--surface); border-color: var(--line); color: var(--ink); box-shadow: 0 1px 3px #0c1f2510; }
.view-tab:hover { color: var(--ink); }
.view-tab.active svg { color: var(--green); }
.view-tab svg { width: 17px; height: 17px; }
.tabs-note { font-size: .8125rem; color: var(--faint); }
.activity-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 15px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.activity-heading h2 { display: inline-flex; align-items: center; gap: 8px; font-size: .9375rem; font-weight: 550; }
.activity-heading h2 svg { width: 18px; height: 18px; color: var(--green); }
.activity-heading > span { color: var(--faint); font-size: .8125rem; }
.tab-count, .market-count { display: inline-flex; align-items: center; justify-content: center; min-width: 23px; height: 22px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--surface-soft); font: 400 .75rem var(--mono); }
.activity-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; }
.activity-main, .activity-sidebar { gap: 20px; }
.panel { min-width: 0; border-radius: 13px; box-shadow: var(--shadow); }
.panel-title-row, .feed-heading { padding: 19px 21px; }
.panel-title-row h2, .feed-heading h2 { font-size: 1rem; font-weight: 550; letter-spacing: -.025em; }
.secondary { font-size: .8125rem; }
.button { min-height: 36px; padding: 7px 11px; font-size: .875rem; border-color: var(--line); border-radius: 8px; background: var(--surface); }
.button:hover { background: var(--hover); border-color: #b7c5bf; }
html[data-theme="dark"] .button:hover { background: #20292a; border-color: #4a5b54; }
.text-button { font-size: .8125rem; }

/* Pulse remains numeric and legible, with slightly more breathing room. */
.flow-panel .panel-title-row { padding-bottom: 12px; }
.pulse-chart { padding: 0 21px 17px; --pulse-bar: #8bbfa7; --pulse-bar-active: #2b805c; }
.pulse-controls { margin-bottom: 20px; }
.pulse-unit { font-size: .8125rem; }
.pulse-frame { height: 150px; }
.pulse-scale { background: var(--surface-soft); border-radius: 8px; }
.pulse-scale button { font-size: .8125rem; }
.pulse-scale button[aria-pressed="true"] { box-shadow: 0 1px 4px #0a201414; }
.pulse-grid i { opacity: .7; }
.pulse-key { margin-top: 15px; }
.pulse-help { font-size: .75rem; color: var(--faint); }
html[data-theme="dark"] .pulse-chart { --pulse-bar: #44765e; --pulse-bar-active: #84dcb5; --pulse-tooltip-bg: #1b2522; }
html[data-theme="dark"] .pulse-scale button[aria-pressed="true"] { background: #26332e; }

/* Asset artwork stays on a consistent neutral plate in either theme. */
.market-identity { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.asset-logo { position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 34px; height: 34px; border: 1px solid #e3e7e8; border-radius: 50%; background: #fff; overflow: hidden; isolation: isolate; }
.asset-fallback { position: absolute; inset: 0; display: grid; place-items: center; background: #eef2f3; color: #54626b; font: 600 .625rem var(--sans); letter-spacing: -.03em; }
.asset-logo img, .asset-image { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; padding: 4px; background: #fff; border-radius: 50%; }
.asset-logo--small { width: 30px; height: 30px; }
.asset-logo--small img { padding: 3px; }
.asset-logo--large { width: 46px; height: 46px; }
.asset-logo--large img { padding: 5px; }
.asset-logo[data-asset="HYPE"], .asset-logo[data-asset="HYPE"] .asset-image { background: #092a24; border-color: #224e42; }
.market-copy { display: flex; flex-direction: column; min-width: 0; gap: 2px; text-align: left; }
.market-symbol { display: block; color: var(--ink); font-size: .875rem; line-height: 1.25; font-weight: 600; letter-spacing: -.015em; }
.market-subtitle { color: var(--faint); font-size: .75rem; line-height: 1.3; font-weight: 400; letter-spacing: 0; }

/* The trade tape feels like a data table, with a readable market identity. */
.feed-heading { align-items: center; }
.feed-heading p { font-size: .8125rem; margin-top: 4px; }
.filter-bar { padding: 0 21px 18px; gap: 10px; }
.field > span:first-child { font-size: .875rem; }
input, select { height: 38px; border-radius: 7px; border-color: var(--line); background: var(--surface-soft); }
input:focus, select:focus { background: var(--surface); }
html[data-theme="dark"] input, html[data-theme="dark"] select { background: #0e1214; border-color: #323b3e; }
html[data-theme="dark"] input:focus, html[data-theme="dark"] select:focus { background: #151c1b; }
.select-wrap:after { top: 14px; }
.search-input svg { top: 11px; }
.feed-meta { padding: 10px 21px; font-size: .75rem; background: var(--surface-soft); }
html[data-theme="dark"] .feed-meta { background: var(--surface-soft); }
.table-scroll { max-height: 600px; scrollbar-gutter: stable; }
.trade-table { min-width: 795px; }
th { position: sticky; top: 0; z-index: 2; padding: 11px 12px; font-size: .8125rem; font-weight: 500; background: var(--surface); }
td { height: 59px; padding: 12px; border-bottom-color: var(--line); }
th:first-child, td:first-child { padding-left: 21px; }
th:last-child, td:last-child { padding-right: 21px; }
.trade-table .time-cell { font-size: .8125rem; }
.trade-table td:nth-child(2) { min-width: 160px; }
.trade-table td:nth-child(n+4) { font-size: .8125rem; letter-spacing: -.02em; }
.trade-table .value-cell { color: var(--ink); }
tbody tr:hover, html[data-theme="dark"] tbody tr:hover { background: var(--hover); }
html[data-theme="dark"] td { border-color: #242b2e; }
.side-badge { padding: 3px 8px; min-width: 43px; border-radius: 5px; justify-content: center; font-size: .75rem; font-weight: 500; }
.trade-id { text-underline-offset: 4px; }
.trade-id:hover { text-decoration: underline; }
.table-footnote { padding: 13px 21px; color: var(--faint); }
.liquidation-tag { margin-left: 6px; }

/* Market watch is a useful catalogue, not a wall of tickers. */
.markets-panel .panel-title-row { border-bottom: 1px solid var(--line); }
.panel-subtitle { margin-top: 4px; color: var(--faint); font-size: .75rem; }
.market-count { white-space: nowrap; }
.market-list { max-height: 465px; scrollbar-gutter: stable; }
.market-list > .market-item { padding: 12px 17px 12px 21px; gap: 10px; border-top: 0; border-bottom: 1px solid var(--line); min-height: 65px; }
.market-list > .market-item:last-child { border-bottom: 0; }
.market-list > .market-item:hover, html[data-theme="dark"] .market-list > .market-item:hover { background: var(--hover); }
.market-list > .market-item.is-active, html[data-theme="dark"] .market-list > .market-item.is-active { background: var(--green-light); box-shadow: inset 3px 0 var(--green); }
.market-item .market-name { margin: 0; color: var(--ink); font-size: .875rem; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; }
.market-item .market-copy small { margin-top: 1px; color: var(--faint); font-size: .75rem; line-height: 1.4; }
.market-item .market-price { flex-shrink: 0; text-align: right; color: var(--ink); font-size: .8125rem; letter-spacing: -.03em; }
.market-item .market-price small { font-family: var(--sans); font-size: .6875rem; font-weight: 400; letter-spacing: 0; color: var(--faint); margin-top: 3px; }
.health-panel .panel-title-row { padding-bottom: 13px; }
.health-value { font-size: 1rem; font-weight: 500; padding-left: 21px; padding-right: 21px; }
.health-description { padding: 7px 21px 16px; font-size: .8125rem; line-height: 1.65; }
#reconnect-feed { margin: 0 21px 16px; font-size: .8125rem; }
.source-link-list { padding: 10px 21px 13px; }
.source-link-list a { font-size: .8125rem; }
.health-icon { width: 18px; height: 18px; }

/* Dialogs and the independent block view use the same visual system. */
.block-heading { padding: 24px; }
.block-heading h2 { font-size: 1.375rem; }
.block-overview { padding: 21px 24px; background: var(--surface-soft); }
html[data-theme="dark"] .block-overview, html[data-theme="dark"] .tx-entry, html[data-theme="dark"] #trade-detail pre { background: var(--surface-soft); }
.block-overview strong { font-size: 2rem; }
.blocks-table th:first-child, .blocks-table td:first-child { padding-left: 24px; }
dialog { padding: 25px; border-radius: 15px; background: var(--surface); }
.dialog-heading h2 { font-size: 1.25rem; }
.detail-market-heading { display: flex; align-items: center; gap: 12px; margin: 3px 0 20px; }
.detail-market-heading h2 { margin: 0; font-size: 1.375rem; font-weight: 550; }
.detail-market-heading .asset-logo { width: 46px; height: 46px; }
.detail-market-heading .market-symbol { font-size: 1.375rem; }
.detail-market-heading .market-subtitle { font-size: .875rem; }
.site-footer { margin-top: 28px; padding-top: 20px; color: var(--faint); }

@media (min-width: 1500px) {
  .activity-layout { grid-template-columns: minmax(0, 1fr) 315px; }
  .metric-value { font-size: 2rem; }
}
@media (max-width: 1180px) {
  .header-inner { gap: 18px; }
  .page-shell { padding: 28px 25px 0; }
  .activity-layout { grid-template-columns: minmax(0, 1fr) 275px; gap: 18px; }
  .metrics-grid { gap: 11px; }
  .metrics-grid .metric { padding: 18px; }
  .metric-value { font-size: 1.65rem; }
  .metric-icon { width: 15px; height: 15px; }
  .metric p { font-size: .6875rem; }
  .market-list > .market-item { padding-left: 17px; padding-right: 14px; gap: 8px; }
  .market-identity { gap: 8px; }
}
@media (max-width: 980px) {
  .activity-layout { grid-template-columns: minmax(0, 1fr); }
  .activity-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .metrics-grid .metric { padding: 17px 15px; }
  .metric-value { font-size: 1.5rem; }
  .metric-heading { gap: 5px; }
  .metric-icon { display: none; }
  .metric h2 { font-size: .875rem; }
  .market-list { max-height: 335px; }
  .connection-detail { display: none; }
  .filter-bar { grid-template-columns: 1.2fr .8fr 1fr 1.3fr; }
}
@media (max-width: 650px) {
  .activity-heading { margin-bottom: 16px; padding-bottom: 12px; }
  .activity-heading > span { display: none; }
  .site-header { height: 64px; }
  .header-inner { padding: 0 17px; gap: 12px; }
  .wordmark { gap: 9px; font-size: 1.125rem; }
  .wordmark-live { font-size: .8125rem; }
  .wordmark-divider { margin: 0 7px; }
  .brand-logo { width: 22px; height: 31px; }
  .brand-logo img { width: 18px; height: 31px; }
  .theme-toggle { width: 34px; min-height: 34px; height: 34px; padding: 7px; border-radius: 8px; }
  .status { padding: 4px 8px; font-size: .75rem; }
  .page-shell { padding: 25px 16px 0; }
  .page-heading { margin-bottom: 23px; }
  .page-heading h1 { font-size: 2rem; }
  .page-description { font-size: .875rem; }
  .summary { margin-bottom: 19px; }
  .summary-heading { gap: 10px; align-items: center; }
  .summary-heading .small-heading { font-size: .75rem; white-space: nowrap; }
  .snapshot-meta { gap: 6px; }
  #stats-asof { max-width: 200px; font-size: .6875rem; text-align: right; }
  .snapshot-meta .text-button { font-size: .75rem; }
  .metrics-grid { gap: 10px; }
  .metrics-grid .metric { border: 1px solid var(--line); padding: 16px 15px; border-radius: 10px; }
  .metric h2 { font-size: .875rem; }
  .metric-value { font-size: 1.55rem; margin-top: 12px; }
  .metric p { font-size: .6875rem; line-height: 1.5; }
  .view-tabs { gap: 5px; padding-bottom: 10px; margin-bottom: 16px; }
  .view-tab { padding: 8px 10px; font-size: .875rem; gap: 6px; }
  .view-tab svg { width: 16px; height: 16px; }
  .tab-count { min-width: 20px; height: 20px; padding: 0 4px; font-size: .6875rem; }
  .panel { border-radius: 11px; }
  .panel-title-row, .feed-heading, .flow-panel .panel-title-row { padding: 16px; }
  .flow-panel .panel-title-row { align-items: flex-start; padding-bottom: 12px; }
  .flow-panel .secondary { max-width: 145px; font-size: .75rem; }
  .pulse-chart { padding: 0 16px 16px; }
  .pulse-controls { gap: 7px; }
  .pulse-unit, .pulse-scale button { font-size: .8125rem; }
  .pulse-frame { height: 150px; }
  .pulse-scale button { padding: 4px 6px; }
  .pulse-tooltip { max-width: calc(100% - 8px); }
  .feed-heading { align-items: flex-start; gap: 10px; }
  .feed-heading p { max-width: 200px; font-size: .75rem; }
  .button { font-size: .875rem; padding: 7px 9px; }
  .filter-bar { grid-template-columns: 1fr 1fr; padding: 0 16px 16px; gap: 12px 10px; }
  .field > span:first-child { font-size: .875rem; }
  input, select { font-size: .875rem; height: 39px; }
  .feed-meta { padding: 10px 16px; font-size: .75rem; }
  .feed-meta > span:last-child { max-width: 140px; }
  .table-scroll { max-height: 520px; }
  th:first-child, td:first-child { padding-left: 16px; }
  th:last-child, td:last-child { padding-right: 16px; }
  .table-footnote { padding: 13px 16px; font-size: .75rem; }
  .activity-sidebar { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .markets-panel .panel-title-row, .health-panel .panel-title-row { padding: 16px; }
  .market-list { max-height: 365px; }
  .market-list > .market-item { padding: 12px 16px; }
  .health-value, .health-description { padding-left: 16px; padding-right: 16px; }
  #reconnect-feed { margin-left: 16px; margin-right: 16px; }
  .source-link-list { padding-left: 16px; padding-right: 16px; }
  .block-heading, .block-overview { padding: 20px; }
  .block-heading h2 { font-size: 1.25rem; }
  .blocks-table th:first-child, .blocks-table td:first-child { padding-left: 20px; }
  dialog { padding: 22px; }
  .site-footer { margin-top: 23px; font-size: .75rem; }
}
@media (max-width: 390px) {
  .header-inner { gap: 9px; padding: 0 13px; }
  .wordmark { flex-shrink: 0; font-size: 1.0625rem; gap: 8px; }
  .wordmark-divider { margin: 0 5px; }
  .header-inner .connection { flex: 1 1 auto; min-width: 0; }
  .header-inner .connection .status { position: relative; display: block; min-width: 0; max-width: 100%; padding-left: 20px; overflow: hidden; text-overflow: ellipsis; }
  .header-inner .connection .status::before { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); }
  .page-shell { padding-left: 13px; padding-right: 13px; }
  .metrics-grid .metric { padding: 15px 12px; }
  .metric-value { font-size: 1.375rem; }
  .metric h2 { font-size: .875rem; }
  .view-tab { padding: 8px; }
  .pulse-unit, .pulse-scale button { font-size: .75rem; }
  .feed-heading p { max-width: 180px; }
}
