/* Personal market terminal · local system fonts, no remote assets. */
:root {
  color-scheme: dark;
  --bg: #10161f;
  --rail: #0c121a;
  --panel: #151e29;
  --panel-alt: #18222e;
  --panel-hover: #1b2835;
  --border: #293440;
  --border-soft: #222d39;
  --text: #edf0f3;
  --muted: #91a0b1;
  --dim: #6d7d8f;
  --gold: #e8bb6c;
  --gold-soft: #28271f;
  --positive: #72c6ad;
  --negative: #e68e91;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 13px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .42; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: #f3d29b; text-decoration: underline; text-underline-offset: 4px; }
button, a, select, input { outline: none; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}
button { transition: background-color .16s ease, border-color .16s ease, color .16s ease; }
::selection { color: var(--text); background: #58492e; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 29px; letter-spacing: -.9px; line-height: 1.2; font-weight: 620; margin-bottom: 10px; }
h2 { font-size: 19px; letter-spacing: -.35px; line-height: 1.3; font-weight: 600; margin-bottom: 0; }
h3 { font-size: 16px; letter-spacing: -.2px; line-height: 1.4; font-weight: 600; margin-bottom: 12px; }
p { color: var(--muted); }
.muted { color: var(--muted); }
.positive { color: var(--positive) !important; }
.negative { color: var(--negative) !important; }
.neutral { color: var(--muted) !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.app-shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 620px;
  display: flex;
  flex-direction: column;
  padding: 29px 16px 24px;
  background: var(--rail);
  border-right: 1px solid var(--border-soft);
}
.brand { display: flex; gap: 11px; align-items: center; margin: 0 11px 53px; color: var(--text); font-size: 10px; line-height: 1.55; letter-spacing: 2px; }
.brand:hover { color: var(--text); text-decoration: none; }
.brand b { font-weight: 600; letter-spacing: 1.55px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 40px; color: var(--gold); font-size: 30px; font-weight: 400; line-height: 1; }
.rail-label { color: var(--dim); margin: 0 12px 13px; font-size: 9px; font-weight: 650; letter-spacing: 1.8px; }
.main-nav { display: grid; gap: 6px; }
.nav-button { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 43px; padding: 11px 10px; border: 1px solid transparent; background: transparent; border-radius: 6px; text-align: left; font-size: 11px; white-space: nowrap; color: var(--muted); }
.nav-button > span { width: 18px; font-size: 18px; line-height: 1; color: var(--dim); text-align: center; }
.nav-button:hover { color: var(--text); background: #151e28; }
.nav-button.active { color: var(--gold); background: #24251f; border-color: #3c382b; }
.nav-button.active > span { color: var(--gold); }
.tiny-dot { display: inline-block; width: 4px; height: 4px; margin-left: auto; flex: none; border-radius: 50%; background: var(--dim); }
.rail-bottom { margin: auto 11px 0; padding-top: 26px; border-top: 1px solid var(--border-soft); font-size: 10px; color: #bac5d0; }
.rail-bottom p { font-size: 10px; line-height: 1.8; margin: 9px 0 22px; }
.rail-bottom small { color: var(--dim); font-size: 9px; }
.source-dot, .offline-dot { display: inline-block; vertical-align: middle; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--positive); flex: none; }
.offline-dot { background: #6c7785; }

main { width: 100%; max-width: 1760px; min-width: 0; padding: 34px 38px 0; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.eyebrow { margin-bottom: 8px; color: var(--dim); font-size: 9px; font-weight: 650; letter-spacing: 1.9px; line-height: 1.5; }
.topbar > div > .eyebrow { color: var(--gold); margin-bottom: 11px; }
.topbar p { margin: 0; font-size: 12px; }
.header-actions { display: flex; flex-direction: column; gap: 11px; align-items: flex-end; flex: none; }
.cadence { color: var(--dim); font-size: 9px; font-weight: 600; letter-spacing: 1.4px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 38px; border: 1px solid #3d4855; border-radius: 6px; padding: 9px 15px; background: #1b2632; color: var(--text); font-size: 11px; font-weight: 600; line-height: 1.4; }
.button:hover:not(:disabled) { background: #253341; border-color: #647285; }
.button:active:not(:disabled) { background: #304051; }
.button.primary { color: #191b1c; background: var(--gold); border-color: var(--gold); }
.button.primary:hover:not(:disabled) { background: #f1ca85; border-color: #f1ca85; }
.button.primary:active:not(:disabled) { background: #d7aa5c; border-color: #d7aa5c; }
.text-button { padding: 4px 0; border: 0; border-radius: 2px; background: transparent; color: var(--gold); font-size: 11px; font-weight: 500; white-space: nowrap; }
.text-button:hover:not(:disabled) { color: #f3d29b; text-decoration: underline; text-underline-offset: 4px; }
.announcement { display: flex; align-items: center; min-height: 39px; padding: 10px 13px; margin-bottom: 18px; border: 1px solid #3d3b2b; border-radius: 6px; background: #22231e; color: #d4bc8e; font-size: 11px; line-height: 1.5; }
.announcement.notice-error, .notice-error { border-color: #644046; background: #2a2027; color: #efb1b3; }
.announcement.notice-success, .notice-success { border-color: #2d4944; background: #172824; color: #9fcebd; }
.boundary-note { display: flex; gap: 10px; align-items: flex-start; padding: 0 0 21px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.boundary-note b { color: #b8c4d0; font-weight: 500; }
.info-icon { display: grid; place-items: center; width: 15px; height: 15px; margin-top: 2px; border: 1px solid #647285; border-radius: 50%; color: #9caabc; font-size: 10px; line-height: 1; flex: none; font-family: Georgia, serif; }
.market-tabs { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-bottom: 24px; }
.market-tab { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 12px; row-gap: 7px; min-height: 89px; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); text-align: left; }
.market-tab:hover { background: var(--panel-hover); border-color: #4c5866; }
.market-tab.active, .market-tab[aria-selected="true"] { background: #21241f; border-color: #8c7448; }
.market-tab.active::after, .market-tab[aria-selected="true"]::after { content: ""; position: absolute; top: 17px; right: 16px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.market-code { color: var(--text); font-size: 23px; font-weight: 650; letter-spacing: -.6px; line-height: 1.15; }
.market-tab.active .market-code { color: var(--gold); }
.market-name { padding-right: 12px; color: #b2bfcc; font-size: 12px; font-weight: 500; }
.market-meta { grid-column: 1 / -1; color: var(--dim); font-size: 10px; line-height: 1.4; }
.report-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 12px; font-size: 11px; }
.report-toolbar strong { color: #d7dfe8; font-size: 12px; font-weight: 600; margin-left: 6px; }
.report-kind { display: inline-block; margin-left: 12px; color: var(--dim); font-size: 10px; }
.metrics-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 22px; }
.metric-card { min-width: 0; min-height: 115px; padding: 17px 18px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.metric-label { min-height: 18px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.metric-value { font-size: clamp(22px,2.05vw,31px); font-weight: 560; line-height: 1.25; letter-spacing: -.7px; margin: 9px 0 6px; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.metric-foot { color: var(--dim); font-size: 9px; line-height: 1.5; }
.panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.panel-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.chart-panel { margin-bottom: 22px; padding: 23px 24px 0; }
.chart-controls { display: flex; align-items: center; gap: 12px; flex: none; }
.segmented { display: inline-flex; gap: 2px; padding: 3px; background: #0f1821; border: 1px solid var(--border); border-radius: 6px; }
.segmented button { min-width: 47px; padding: 5px 9px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--muted); font-size: 10px; line-height: 1.5; }
.segmented button:hover { color: var(--text); background: #202a35; }
.segmented button.active, .segmented button[aria-pressed="true"] { background: #34404b; color: #f4f0e7; border-color: #44515d; }
.range-label { display: block; }
select { min-height: 34px; border: 1px solid var(--border); border-radius: 6px; padding: 7px 27px 7px 10px; background: #111a24; color: #b9c4cf; font-size: 10px; cursor: pointer; }
select:hover { border-color: #5c6978; }
.category-legend { display: flex; flex-wrap: wrap; gap: 7px; margin: 19px 0 4px; }
.category-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted); font-size: 10px; line-height: 1.4; }
.category-chip:hover { color: var(--text); background: #202c38; }
.category-chip.active, .category-chip[aria-pressed="true"] { border-color: #4b4a3c; background: #2b2b23; color: #dfd3b7; }
.color-dot { display: inline-block; width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--gold); }
.chart-container { position: relative; width: 100%; padding-top: 3px; }
#chart { display: block; width: 100%; height: auto; min-height: 255px; max-height: 415px; overflow: visible; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; touch-action: pan-y; }
#chart text { font-size: 10px; font-variant-numeric: tabular-nums; }
.gridline, .grid-line { stroke: #2a3541; stroke-width: 1; stroke-dasharray: 3 5; }
.zero-line { stroke: #66717c; stroke-width: 1; stroke-dasharray: 4 5; }
.area { fill: var(--gold); fill-opacity: .075; }
.net-line { fill: none; stroke: var(--gold); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.axis-label { fill: #718294; font-size: 10px; }
.cursor-line { stroke: #a5977b; stroke-width: 1; stroke-dasharray: 3 4; opacity: .8; pointer-events: none; }
.chart-dot { fill: var(--gold); stroke: var(--panel); stroke-width: 3; pointer-events: none; }
.chart-tooltip { position: absolute; z-index: 4; min-width: 140px; max-width: 260px; padding: 10px 12px; color: #dce4eb; border: 1px solid #59606a; border-radius: 6px; background: #1c2733; box-shadow: 0 9px 28px #0005; pointer-events: none; font-size: 11px; line-height: 1.7; font-variant-numeric: tabular-nums; }
.chart-tooltip strong { color: var(--gold); font-weight: 600; }
.history-control { display: flex; align-items: center; gap: 14px; min-height: 51px; padding: 9px 0 15px; color: var(--muted); font-size: 10px; }
.history-control label { flex: none; }
.history-control input { flex: 1; min-width: 40px; height: 3px; margin: 0 6px; border-radius: 9px; accent-color: var(--gold); cursor: pointer; }
.history-control input:disabled { opacity: .4; cursor: default; }
.history-control output { color: #c6d0db; font-size: 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.history-control .text-button { margin-left: 7px; font-size: 10px; }
.chart-caption { display: flex; justify-content: space-between; gap: 20px; padding: 12px 0 13px; border-top: 1px solid var(--border-soft); color: var(--dim); font-size: 9px; line-height: 1.6; }
.table-panel { overflow: hidden; margin-bottom: 22px; }
.table-panel .panel-header { padding: 22px 24px 20px; }
.subtle-badge { display: inline-flex; align-items: center; padding: 4px 8px; border: 1px solid #34404c; border-radius: 4px; color: #98a7b6; font-size: 9px; font-weight: 500; line-height: 1.5; white-space: nowrap; }
.table-scroll { width: 100%; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #435160 #141e29; }
table { width: 100%; border-collapse: collapse; font-size: 11px; font-variant-numeric: tabular-nums lining-nums; }
th { padding: 12px 18px; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border); color: #7f91a3; background: #121b25; text-align: right; font-size: 9px; font-weight: 500; white-space: nowrap; }
td { padding: 16px 18px; border-bottom: 1px solid var(--border-soft); color: #c5cfd9; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; padding-left: 24px; }
th:last-child, td:last-child { padding-right: 24px; }
td:first-child { color: #d5dee7; font-weight: 500; }
td:first-child .color-dot { margin-right: 9px; vertical-align: 1px; }
td button { display: inline-flex; align-items: center; gap: 9px; padding: 0; background: transparent; border: none; color: inherit; text-align: left; font-size: inherit; font-weight: inherit; }
tbody tr { transition: background-color .15s ease; }
tbody tr:hover { background: #1b2733; }
tbody tr.selected-row { background: #23281f; }
tbody tr.selected-row td:first-child { color: var(--gold); box-shadow: inset 2px 0 var(--gold); }
tbody tr:last-child td { border-bottom: 0; }
.table-note { margin: 0; padding: 15px 24px 17px; border-top: 1px solid var(--border-soft); color: var(--dim); font-size: 10px; line-height: 1.7; }
.two-col { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; margin-bottom: 22px; }
.context-panel { padding: 23px 24px; }
.context-panel p { margin-bottom: 13px; color: var(--muted); font-size: 11px; line-height: 1.85; }
.context-panel .eyebrow { margin-bottom: 9px; }
.context-panel a { display: block; width: fit-content; margin-top: 9px; font-size: 10px; }
.context-panel .muted { font-size: 10px; }
.page > .context-panel { margin-bottom: 22px; }
.empty-terminal { padding: 46px 48px 36px; }
.flow-icon { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 21px; border: 1px solid #495041; background: #252a23; border-radius: 12px; font-size: 30px; color: var(--gold); }
.empty-terminal > .subtle-badge { margin-bottom: 17px; letter-spacing: 1px; font-size: 8px; }
.empty-terminal > h2 { max-width: 600px; font-size: 27px; line-height: 1.3; letter-spacing: -.7px; margin-bottom: 16px; }
.empty-terminal > p { max-width: 720px; font-size: 12px; line-height: 1.85; margin-bottom: 28px; }
.flow-features { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 36px; margin: 30px 0 24px; padding: 25px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.flow-features b { font-weight: 550; font-size: 12px; }
.flow-features ul { padding-left: 15px; color: var(--muted); font-size: 11px; line-height: 1.85; margin: 12px 0 0; }
.flow-features li { padding-left: 4px; margin: 6px 0; }
.flow-features li::marker { color: #596b7c; }
.empty-terminal .plain-note { margin-bottom: 25px; color: #b6aa91; font-size: 11px; }
.sources-panel { margin-bottom: 22px; padding: 27px 28px; }
.sources-panel > h2 { margin-bottom: 15px; }
.sources-panel > p { max-width: 830px; margin-bottom: 23px; font-size: 12px; line-height: 1.85; }
.source-item { margin-bottom: 13px; border: 1px solid var(--border); border-radius: 7px; padding: 17px 18px; background: #121b25; }
.source-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 12px; }
.source-header strong, .source-header b { color: #d5dee7; font-size: 12px; font-weight: 600; }
.source-header span { color: var(--muted); font-size: 10px; }
.source-item p { margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.source-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px 20px; margin: 12px 0; color: #bcc7d2; font-size: 10px; }
.source-grid > div { min-width: 0; }
.source-grid span, .source-grid small { color: var(--dim); }
.source-grid b, .source-grid strong { font-weight: 500; }
.source-link { display: inline-block; overflow-wrap: anywhere; font-size: 10px; }
.sources-panel > .button { margin-top: 9px; }
.status-list { padding: 0; margin: 14px 0 0; list-style: none; }
.status-list li { display: flex; align-items: baseline; color: var(--muted); font-size: 11px; line-height: 1.75; margin: 12px 0; }
.status-list li .source-dot, .status-list li .offline-dot { transform: translateY(-1px); }
footer { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 18px 0 23px; border-top: 1px solid var(--border-soft); margin-top: 5px; color: var(--dim); font-size: 9px; line-height: 1.8; }
footer .text-button { margin-left: 2px; font-size: 9px; }

@media (min-width: 1600px) {
  main { padding-right: 48px; padding-left: 48px; }
  .metric-card { padding: 20px 22px; }
  .metric-value { margin-top: 10px; }
}

@media (max-width: 1190px) {
  main { padding: 30px 25px 0; }
  h1 { font-size: 26px; }
  .market-tab { column-gap: 9px; padding: 15px; }
  .market-name { font-size: 11px; }
  .metric-card { padding: 15px 13px; }
  .metric-label { font-size: 9px; }
  .metric-foot { font-size: 8px; }
  .metric-value { font-size: 24px; }
  .chart-panel { padding-right: 19px; padding-left: 19px; }
  .report-kind { display: block; margin: 3px 0 0; }
  .chart-caption { font-size: 8px; }
  .source-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  th, td { padding-right: 13px; padding-left: 13px; }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .rail { position: relative; width: 100%; height: auto; min-height: 0; padding: 16px 24px 12px; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand { width: fit-content; margin: 0 0 16px; font-size: 8px; letter-spacing: 1.7px; gap: 8px; }
  .brand-mark { width: 26px; height: 29px; font-size: 27px; }
  .rail-label, .rail-bottom { display: none; }
  .main-nav { display: flex; gap: 8px; }
  .nav-button { width: auto; min-height: 37px; padding: 8px 11px; font-size: 10px; }
  .nav-button > span { width: 15px; font-size: 16px; }
  .tiny-dot { margin-left: 3px; }
  main { padding: 27px 24px 0; }
  .topbar { gap: 18px; margin-bottom: 21px; }
  .topbar p { font-size: 11px; }
  .metrics-grid { gap: 10px; }
  .metric-value { font-size: 25px; }
  .market-tab { min-height: 86px; }
  #chart { min-height: 235px; }
  .flow-features { gap: 25px; }
  .empty-terminal { padding: 32px; }
}

@media (max-width: 650px) {
  body { font-size: 12px; }
  .rail { padding: 14px 16px 11px; }
  .brand { margin-bottom: 13px; }
  .main-nav { gap: 5px; overflow-x: auto; scrollbar-width: none; padding-bottom: 3px; }
  .main-nav::-webkit-scrollbar { display: none; }
  .nav-button { padding: 8px 9px; gap: 7px; font-size: 10px; flex: none; }
  .nav-button > span { font-size: 15px; }
  .tiny-dot { display: none; }
  main { padding: 23px 16px 0; }
  .topbar { align-items: flex-start; flex-direction: column; gap: 17px; }
  h1 { font-size: 27px; margin-bottom: 9px; }
  .topbar p { max-width: 350px; font-size: 11px; line-height: 1.8; }
  .header-actions { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; }
  .header-actions .button { min-height: 35px; padding: 8px 12px; font-size: 10px; }
  .cadence { font-size: 8px; letter-spacing: 1px; }
  .announcement { font-size: 10px; padding: 10px 11px; margin-bottom: 15px; }
  .boundary-note { font-size: 10px; gap: 8px; padding-bottom: 17px; }
  .boundary-note b { display: block; margin-bottom: 3px; }
  .market-tabs { gap: 7px; margin-bottom: 20px; }
  .market-tab { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; min-height: 112px; padding: 12px 10px; border-radius: 7px; }
  .market-code { font-size: 22px; }
  .market-name { font-size: 10px; padding: 0; line-height: 1.35; }
  .market-meta { font-size: 8px; line-height: 1.5; }
  .market-tab.active::after, .market-tab[aria-selected="true"]::after { top: 13px; right: 10px; width: 4px; height: 4px; }
  .report-toolbar { font-size: 10px; margin-bottom: 12px; }
  .report-toolbar strong { font-size: 11px; }
  .report-toolbar .text-button { font-size: 10px; }
  .report-kind { font-size: 9px; }
  .metrics-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin-bottom: 16px; }
  .metric-card { min-height: 111px; padding: 14px 13px; border-radius: 7px; }
  .metric-label { font-size: 9px; }
  .metric-value { font-size: 25px; margin: 8px 0 5px; }
  .metric-foot { font-size: 8px; }
  .chart-panel { padding: 19px 13px 0; margin-bottom: 16px; border-radius: 8px; }
  .panel-header { gap: 15px; }
  .chart-panel > .panel-header { flex-wrap: wrap; gap: 15px; }
  h2 { font-size: 17px; }
  .eyebrow { font-size: 8px; letter-spacing: 1.5px; }
  .chart-controls { width: 100%; justify-content: space-between; gap: 10px; }
  .segmented button { min-width: 44px; }
  .category-legend { gap: 4px; margin-top: 15px; margin-bottom: 6px; }
  .category-chip { font-size: 9px; padding: 5px 6px; gap: 5px; }
  .category-chip .color-dot { width: 5px; height: 5px; }
  #chart { min-height: 205px; max-height: none; }
  #chart .axis-label { font-size: 12px; }
  .history-control { display: grid; grid-template-columns: 1fr auto; gap: 12px 14px; padding: 10px 2px 15px; }
  .history-control label { grid-column: 1; font-size: 9px; }
  .history-control input { grid-column: 1 / -1; grid-row: 2; width: calc(100% - 12px); margin: 3px 6px 5px; }
  .history-control output { grid-column: 2; grid-row: 1; font-size: 9px; }
  .history-control .text-button { grid-column: 1 / -1; grid-row: 3; justify-self: start; margin-left: 0; font-size: 9px; }
  .chart-caption { display: block; font-size: 8px; padding-top: 11px; }
  .chart-caption span { display: block; }
  .chart-caption span + span { margin-top: 5px; }
  .table-panel { margin-bottom: 16px; border-radius: 8px; }
  .table-panel .panel-header { padding: 18px 15px; align-items: flex-start; }
  .subtle-badge { font-size: 8px; padding: 3px 6px; }
  .table-panel .subtle-badge { white-space: normal; text-align: right; max-width: 105px; }
  table { min-width: 660px; font-size: 10px; }
  th { font-size: 8px; padding: 11px 14px; }
  td { padding: 14px; }
  th:first-child, td:first-child { padding-left: 15px; }
  .table-note { padding: 13px 15px; font-size: 9px; }
  .two-col { grid-template-columns: 1fr; gap: 14px; margin-bottom: 16px; }
  .context-panel { padding: 20px 18px; }
  .context-panel h3 { font-size: 15px; }
  .context-panel p { font-size: 10px; }
  .context-panel a, .context-panel .muted { font-size: 9px; }
  .empty-terminal { padding: 26px 20px; }
  .flow-icon { width: 46px; height: 46px; font-size: 26px; }
  .empty-terminal > h2 { font-size: 23px; }
  .empty-terminal > p { font-size: 11px; }
  .flow-features { grid-template-columns: 1fr; gap: 22px; margin: 22px 0; padding: 22px 0; }
  .flow-features ul { font-size: 10px; }
  .empty-terminal .plain-note { font-size: 10px; }
  .empty-terminal .button { width: 100%; font-size: 10px; padding: 11px; }
  .sources-panel { padding: 22px 18px; margin-bottom: 16px; }
  .sources-panel > p { font-size: 11px; }
  .source-item { padding: 14px 13px; }
  .source-header { flex-wrap: wrap; gap: 6px; }
  .source-grid { grid-template-columns: 1fr; gap: 8px; }
  .source-header strong, .source-header b { font-size: 11px; }
  .source-grid, .source-item p, .source-link { font-size: 10px; }
  .status-list li { font-size: 10px; }
  footer { font-size: 8px; margin-top: 0; padding-top: 14px; padding-bottom: 20px; }
  footer .text-button { font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  button, tbody tr { transition: none; }
}

@media print {
  .rail, .header-actions, .nav-button, .chart-controls, .history-control, .text-button { display: none !important; }
  .app-shell { display: block; }
  main { padding: 0; }
  body { font-size: 11px; }
  .panel, .metric-card, .market-tab { break-inside: avoid; }
  .chart-panel { break-inside: avoid; }
}

/* Price and participant workspace. */
.price-workspace { margin-bottom: 22px; overflow: hidden; }
.price-workspace > .panel-header { padding: 23px 24px 18px; align-items: flex-start; flex-wrap: wrap; }
.price-marker-toolbar {display:flex;align-items:center;flex-wrap:wrap;gap:12px 18px;padding:0 24px 10px;color:var(--muted);font-size:11px;}
.price-marker-toolbar label {display:flex;align-items:center;gap:7px;}
.marker-switch {color:var(--text);cursor:pointer;}
.marker-switch input {accent-color:var(--gold);width:15px;height:15px;}
.price-marker-toolbar select {max-width:100%;min-height:34px;font-size:11px;}
.price-marker-note {margin:0;padding:0 24px 16px;color:var(--muted);font-size:11px;line-height:1.7;}
.report-day-band {fill:var(--gold);fill-opacity:.055;pointer-events:none;}
.report-day-band.selected {fill-opacity:.1;}
.report-marker {cursor:pointer;outline:none;}
.report-date-line {stroke:#9c8a62;stroke-width:1;stroke-dasharray:3 5;opacity:.65;}
.report-label-box {fill:#15212b;stroke:#69705f;stroke-width:1;}
.report-marker.selected .report-label-box,.report-marker:focus .report-label-box {stroke:var(--gold);stroke-width:1.5;}
.report-marker:hover .report-label-box {fill:#202c32;stroke:var(--gold);}
#price-chart .report-label-date {fill:#b2b9b6;font-size:10px;}
#price-chart .report-long-text {fill:#8ddcbe;font-size:12px;font-weight:600;}
#price-chart .report-short-text {fill:#f1a1a4;font-size:12px;font-weight:600;}
.report-small-marker {fill:#28352e;stroke:#baa16c;stroke-width:1;}
#price-chart .report-small-symbol {fill:#e8bb6c;font-size:9px;}
.report-marker:focus .report-small-marker {stroke:var(--text);stroke-width:2;}
@media(max-width:650px){.price-marker-toolbar {padding:0 15px 10px;gap:10px;}.price-marker-toolbar label:not(.marker-switch) {max-width:100%;}.price-marker-toolbar select {font-size:10px;}.price-marker-note {padding:0 15px 14px;font-size:10px;}}
.price-workspace h2 { font-size: 20px; }
.workspace-controls { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-left: auto; }
.workspace-controls > label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.workspace-controls select { min-height: 35px; }
.workspace-controls .button { min-height: 35px; padding: 8px 12px; font-size: 10px; }
.workspace-note { padding: 0 24px 17px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.75; }
.workspace-note b, .workspace-note strong { color: #b9c6d2; font-weight: 500; }
.workspace-grid { display: grid; grid-template-columns: minmax(0,1fr) 340px; border-top: 1px solid var(--border); }
.price-column { min-width: 0; padding: 17px 20px 0; }
.price-topline { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 9px 14px; min-height: 31px; margin-bottom: 8px; }
.price-ohlc { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; min-height: 18px; color: #c7d2dd; font-size: 10px; font-variant-numeric: tabular-nums; }
.price-ohlc span { color: var(--muted); }
.price-ohlc b, .price-ohlc strong { margin-left: 3px; color: #dce4ec; font-weight: 500; }
.price-topline > .subtle-badge { font-size: 8px; }
.price-chart-wrap { position: relative; min-height: 300px; }
#price-chart { display: block; width: 100%; height: auto; min-height: 300px; overflow: visible; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; touch-action: pan-y; }
#price-chart text { fill: #8193a5; font-size: 11px; }
#price-chart .price-axis, .price-axis { fill: #8193a5; font-size: 11px; }
#price-chart .gridline, #price-chart .grid-line, .price-grid { fill: none; stroke: #283541; stroke-width: 1; stroke-dasharray: 3 5; }
.price-wick { stroke: #8b9ba8; stroke-width: 1.2; }
.price-candle-up { fill: #72c6ad; stroke: #72c6ad; stroke-width: 1; }
.price-candle-down { fill: #d8868b; stroke: #d8868b; stroke-width: 1; }
.price-candle-up .price-wick { stroke: #72c6ad; }
.price-candle-down .price-wick { stroke: #d8868b; }
.price-crosshair { fill: none; stroke: #91a1b1; stroke-width: 1; stroke-dasharray: 3 5; pointer-events: none; }
.price-last-line { fill: none; stroke: #b6a27a; stroke-width: 1; stroke-dasharray: 4 5; opacity: .8; }
.price-close-line { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.price-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 32px; text-align: center; background: #131d27; border: 1px solid var(--border-soft); border-radius: 6px; }
.price-empty::before { content: ""; display: block; width: 30px; height: 24px; margin-bottom: 3px; border-top: 1px solid #778069; border-bottom: 1px solid #778069; background: linear-gradient(90deg,transparent 0 18%,#4c594c 18% 23%,transparent 23% 48%,#7f805c 48% 53%,transparent 53% 77%,#4c594c 77% 82%,transparent 82%); opacity: .9; }
.price-empty h3, .price-empty h4 { color: #d1dbe5; font-size: 15px; font-weight: 550; margin: 0; }
.price-empty p { max-width: 370px; color: var(--muted); font-size: 11px; line-height: 1.8; margin: 0; }
.price-empty .button { margin-top: 4px; font-size: 10px; }
.price-navigation { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 12px; min-height: 55px; padding: 14px 0 13px; color: var(--muted); font-size: 10px; }
.price-navigation label { flex: none; }
.price-navigation input[type="range"] { flex: 1; min-width: 90px; height: 3px; margin: 0 5px; border-radius: 9px; accent-color: var(--gold); cursor: pointer; }
.price-navigation input:disabled { opacity: .4; cursor: default; }
.price-navigation output { color: #b7c4d1; font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-navigation .text-button { font-size: 10px; margin-left: auto; }
.price-column > .chart-caption { font-size: 8px; }
.participants-column { min-width: 0; padding: 20px 19px; background: #121b25; border-left: 1px solid var(--border); }
.participants-column h3 { font-size: 14px; line-height: 1.4; margin-bottom: 12px; }
.participants-column > select, #participant-report { display: block; width: 100%; min-height: 35px; margin: 0 0 14px; font-size: 10px; }
.position-key { display: flex; align-items: center; gap: 16px; margin: 0 0 13px; color: var(--muted); font-size: 9px; }
.position-key > span { display: inline-flex; align-items: center; gap: 6px; }
.long-key::before, .short-key::before { content: ""; display: inline-block; width: 12px; height: 3px; background: var(--positive); border-radius: 2px; }
.short-key::before { background: var(--negative); }
#participant-profiles { display: grid; gap: 8px; }
.participant-profile { width: 100%; min-width: 0; padding: 12px 11px 10px; text-align: left; border: 1px solid #2c3845; border-radius: 6px; background: #17212c; color: #cbd6df; }
.participant-profile:hover { border-color: #566475; background: #1d2a37; }
.participant-profile.active, .participant-profile[aria-pressed="true"] { border-color: #827047; background: #24271f; }
.profile-name { display: block; margin-bottom: 9px; color: #ccd7e1; font-size: 10px; font-weight: 550; line-height: 1.5; }
.participant-profile.active .profile-name { color: #e7d5ad; }
.profile-line { display: grid; grid-template-columns: 31px minmax(0,1fr) 76px; align-items: center; gap: 8px; margin-top: 6px; font-size: 9px; line-height: 1.3; }
.profile-line > span { color: var(--muted); }
.profile-line > strong { grid-column: 3; grid-row: 1; color: #d5dee7; text-align: right; font-size: 10px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.profile-track { grid-column: 2; grid-row: 1; display: block; height: 5px; overflow: hidden; background: #26343f; border-radius: 2px; }
.profile-track > i { display: block; height: 100%; border-radius: 2px; background: var(--gold); }
.long-side .profile-track > i { background: #72c6ad; }
.short-side .profile-track > i { background: #d8868b; }
.long-side > span { color: #8ccbb8; }
.short-side > span { color: #dc9c9f; }
.profile-net { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px solid #ffffff0b; color: var(--muted); font-size: 9px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.profile-net strong { color: #ced8e0; font-weight: 500; }
.participant-history-block { padding: 21px 24px 0; border-top: 1px solid var(--border); }
.participant-history-block > header, .participant-history-block > .panel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 12px; }
.participant-history-block h3 { font-size: 14px; margin: 0; }
.position-mini-metrics { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 9px; line-height: 1.65; font-variant-numeric: tabular-nums; }
.position-mini-metrics b, .position-mini-metrics strong { color: #d1dce5; font-weight: 550; margin-left: 5px; }
#participant-history { display: block; width: 100%; height: auto; min-height: 155px; max-height: 260px; overflow: visible; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; }
#participant-history text { fill: #8193a5; font-size: 10px; }
.participant-long-line { fill: none; stroke: #72c6ad; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.participant-short-line { fill: none; stroke: #d8868b; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.participant-long-area { fill: #72c6ad; fill-opacity: .045; }
.participant-short-area { fill: #d8868b; fill-opacity: .035; }
.participant-detail { padding: 11px 0 15px; margin: 0; border-top: 1px solid var(--border-soft); color: var(--dim); font-size: 9px; line-height: 1.7; }

@media (min-width: 1101px) and (max-width: 1400px) {
  .workspace-grid { grid-template-columns: minmax(0,1fr) 294px; }
  .workspace-controls { gap: 7px; }
  .workspace-controls .segmented button { min-width: 36px; padding-right: 6px; padding-left: 6px; }
  .participants-column { padding: 18px 14px; }
  .price-column { padding-right: 15px; padding-left: 15px; }
  .price-navigation { column-gap: 8px; }
  .price-navigation output { width: 100%; order: 4; }
  .price-navigation .text-button { margin-left: 0; }
}

@media (max-width: 1100px) {
  .workspace-grid { grid-template-columns: minmax(0,1fr); }
  .participants-column { border-left: 0; border-top: 1px solid var(--border); padding: 20px 22px; }
  .participants-column > select, #participant-report { max-width: 330px; }
  .price-chart-wrap, #price-chart { min-height: 290px; }
  .workspace-controls { justify-content: flex-start; margin-left: 0; }
  .participant-history-block { padding-top: 20px; }
}

@media (min-width: 650px) and (max-width: 1100px) {
  #participant-profiles { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .profile-line { grid-template-columns: 31px minmax(0,1fr) 78px; }
}

@media (max-width: 650px) {
  .price-workspace { margin-bottom: 16px; border-radius: 8px; }
  .price-workspace > .panel-header { display: block; padding: 20px 15px 14px; }
  .price-workspace h2 { font-size: 18px; }
  .workspace-controls { margin-top: 15px; gap: 10px 9px; }
  .workspace-controls .segmented { flex: 1 1 100%; width: fit-content; max-width: 250px; }
  .workspace-controls .segmented button { flex: 1; min-height: 29px; font-size: 10px; }
  .workspace-controls > label { font-size: 9px; }
  .workspace-controls select { min-height: 36px; font-size: 10px; }
  .workspace-controls .button { min-height: 36px; margin-left: auto; font-size: 9px; }
  .workspace-note { padding: 0 15px 16px; font-size: 9px; }
  .price-column { padding: 13px 11px 0; }
  .price-topline { gap: 8px; margin-bottom: 10px; }
  .price-ohlc { gap: 5px 10px; font-size: 9px; }
  .price-chart-wrap { min-height: 240px; }
  #price-chart { min-height: 240px; }
  #price-chart text, #price-chart .price-axis { font-size: 13px; }
  .price-empty { gap: 9px; padding: 22px 17px; }
  .price-empty h3, .price-empty h4 { font-size: 14px; }
  .price-empty p { font-size: 10px; }
  .price-navigation { display: grid; grid-template-columns: 1fr auto; gap: 12px 10px; padding: 15px 2px; font-size: 9px; }
  .price-navigation label { grid-column: 1; grid-row: 1; }
  .price-navigation input[type="range"] { grid-column: 1 / -1; grid-row: 2; width: calc(100% - 10px); min-width: 0; margin: 3px 5px 5px; }
  .price-navigation output { grid-column: 1 / -1; grid-row: 3; white-space: normal; font-size: 8px; }
  .price-navigation .text-button { grid-column: 2; grid-row: 1; margin-left: 0; justify-self: end; font-size: 9px; }
  .price-column > .chart-caption { font-size: 8px; }
  .participants-column { padding: 20px 15px; }
  .participants-column h3 { font-size: 14px; }
  .participants-column > select, #participant-report { max-width: none; min-height: 37px; }
  #participant-profiles { grid-template-columns: minmax(0,1fr); }
  .participant-profile { padding: 13px 12px 11px; }
  .profile-name { font-size: 11px; }
  .profile-line { grid-template-columns: 31px minmax(0,1fr) 83px; gap: 10px; font-size: 9px; margin-top: 7px; }
  .profile-line > strong { font-size: 11px; }
  .profile-track { height: 5px; }
  .profile-net { margin-top: 11px; padding-top: 9px; font-size: 9px; }
  .participant-history-block { padding: 20px 13px 0; }
  .participant-history-block > header, .participant-history-block > .panel-header { flex-direction: column; align-items: flex-start; gap: 9px; }
  .participant-history-block h3 { font-size: 13px; }
  .position-mini-metrics { justify-content: flex-start; gap: 6px 15px; font-size: 9px; }
  #participant-history { min-height: 165px; max-height: none; }
  #participant-history text { font-size: 12px; }
  .participant-detail { font-size: 8px; padding: 12px 0 14px; }
}

@media print {
  .workspace-controls, .price-navigation { display: none !important; }
  .workspace-grid { grid-template-columns: minmax(0,1fr) 280px; }
  .price-workspace, .participant-history-block { break-inside: avoid; }
}

/* HSI reuses the price workspace with contract facts and genuine trade prints. */
.hsi-market-panel > .muted { color: var(--muted); font-size: 10px; line-height: 1.7; margin-bottom: 14px; overflow-wrap: anywhere; }
.contract-facts { margin: 17px 0 23px; padding: 0; }
.contract-facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: 15px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); font-size: 10px; line-height: 1.5; }
.contract-facts dt { color: var(--dim); flex: none; }
.contract-facts dd { margin: 0; color: #cbd6df; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.trade-prints-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 11px; }
.trade-prints-heading h3 { margin: 0; }
.trade-prints-heading .subtle-badge { font-size: 8px; }
.trade-prints-scroll { max-height: 232px; overflow-y: auto; border: 1px solid var(--border); border-radius: 5px; scrollbar-width: thin; scrollbar-color: #435160 #141e29; }
.trade-prints { font-size: 10px; }
.trade-prints th { position: sticky; top: 0; font-size: 8px; background: #15202b; }
.trade-prints th, .trade-prints td { padding: 9px 10px; }
.trade-prints td { color: #bccbd8; }
.trade-prints td:first-child { color: var(--muted); font-weight: 400; }
.trade-prints tbody td[colspan] { text-align: left; padding: 17px 12px; color: var(--dim); font-size: 10px; line-height: 1.7; white-space: normal; }
.hsi-data-note { margin: 12px 0 0; color: var(--dim); font-size: 9px; line-height: 1.8; }
.fx-metrics.hsi-metrics { grid-template-columns: repeat(4,minmax(0,1fr)); }
#fx-last-detail { font-size: 8px; line-height: 1.65; }
@media (min-width: 650px) and (max-width: 1100px) {
  .hsi-market-panel { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 0 25px; align-items: start; }
  .hsi-market-panel > .eyebrow, .hsi-market-panel > h3, #hsi-contract-status, .contract-facts { grid-column: 1; }
  .hsi-market-panel > .eyebrow { grid-row: 1; }
  .hsi-market-panel > h3 { grid-row: 2; }
  #hsi-contract-status { grid-row: 3; }
  .contract-facts { grid-row: 4 / 7; margin: 0; }
  .trade-prints-heading { grid-column: 2; grid-row: 1 / 3; }
  #hsi-trade-status { grid-column: 2; grid-row: 3; }
  .trade-prints-scroll { grid-column: 2; grid-row: 4 / 6; width: 100%; }
  .hsi-data-note { grid-column: 2; grid-row: 6; }
}
@media (max-width: 650px) {
  .fx-metrics.hsi-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .hsi-metrics .metric-value { font-size: 24px; }
  .hsi-market-panel .contract-facts { margin-bottom: 24px; }
  .trade-prints { min-width: 0; }
  .trade-prints th, .trade-prints td { padding: 10px 12px; }
  .trade-prints-scroll { max-height: 240px; }
}

.fx-panel {padding:24px;} .fx-panel > p {color:var(--muted, #94a3b8);line-height:1.6;} .fx-toolbar {display:flex;justify-content:space-between;align-items:center;gap:16px;margin:20px 0;} .fx-metrics {grid-template-columns:repeat(3,minmax(0,1fr));} .fx-panel details {margin-top:16px;color:#94a3b8;} .fx-panel pre {white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;max-height:240px;overflow:auto;} .market-tabs {grid-template-columns:repeat(auto-fit,minmax(170px,1fr));} @media(max-width:650px){.fx-panel {padding:16px;} .fx-toolbar {align-items:stretch;flex-direction:column;} .fx-metrics {grid-template-columns:1fr;}}

/* Weekly GC / CL comparison */
.commodity-overview { margin-bottom:20px; padding:22px; }
.co-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;}
.co-card {min-width:0;border:1px solid var(--border);border-radius:10px;background:var(--panel-alt);padding:16px;}
.co-card-title,.co-actions,.co-controls {display:flex;align-items:center;justify-content:space-between;gap:12px;}
.co-controls {flex-wrap:wrap;justify-content:flex-end;}
.co-controls label {color:var(--muted);font-size:12px;display:flex;gap:8px;align-items:center;}
.co-card-title h3 {margin:0;font-size:18px;}.co-card-title span {color:var(--muted);font-size:11px;}
.co-date,.co-source,.co-explanation {font-size:12px;color:var(--muted);line-height:1.6;}
.co-explanation {margin:4px 0 18px;max-width:950px;}
.co-card table {width:100%;font-size:12px;min-width:410px;}
.co-card th,.co-card td {padding:12px 7px;border-bottom:1px solid var(--border-soft);white-space:nowrap;}
.co-card tbody th {text-align:left;font-weight:500;white-space:normal;max-width:135px;}
.co-card td {text-align:right;font-variant-numeric:tabular-nums;}
.co-card small {display:block;color:var(--muted);font-size:10px;margin-top:4px;}
.co-long b {color:var(--positive);}.co-short b {color:var(--negative);}
.co-track {display:block;height:3px;margin-top:8px;background:var(--border);border-radius:3px;overflow:hidden;}
.co-track i {display:block;height:100%;}.co-long i {background:var(--positive);}.co-short i {background:var(--negative);}
.co-net {font-size:11px;}.co-actions {margin-top:12px;flex-wrap:wrap;}.co-actions a {font-size:11px;}
@media(max-width:1200px){.co-grid{grid-template-columns:1fr;}.commodity-overview>.panel-header{align-items:flex-start;gap:16px;flex-wrap:wrap;}}
@media(max-width:600px){.commodity-overview{padding:14px;}.co-card{padding:10px;}.co-controls{justify-content:flex-start;}}
