* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body { margin: 0; font: 15px/1.48 "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-underline-offset: .26em; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only, .skip:not(:focus) { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; inset: 10px auto auto 10px; z-index: 10; padding: 10px; background: white; color: #152137; }

.picker { display: flex; align-items: center; justify-content: center; gap: 24px; padding: 8px clamp(12px, 3vw, 35px); color: #182033; background: #fff; border-bottom: 1px solid #dce2e9; }
.picker-mark { display: flex; align-items: baseline; gap: 9px; white-space: nowrap; font-weight: 750; }
.picker-mark small { color: #526076; font-weight: 500; }
.design-options, .segmented { display: flex; flex-wrap: wrap; align-items: center; border: 0; margin: 0; padding: 0; min-inline-size: 0; gap: 3px; }
.design-options input, .segmented input { position: absolute; inline-size: 1px; block-size: 1px; clip-path: inset(50%); }
.design-options label span, .segmented label span { display: grid; align-items: center; text-align: center; min-block-size: 42px; padding: 4px 12px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; }
.design-options input:checked + span { background: #152137; color: #fff; font-weight: 700; }
.design-options input:focus-visible + span { outline: 2px solid #245cdb; outline-offset: 2px; }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

body {
  --bg: #071320; --panel: #101e2e; --surface: #15273a; --ink: #eef6ff; --muted: #a5b8cc; --rule: #294158;
  --accent: #79f0d4; --positive: #7aead1; --negative: #ff9f9c; --hero: #142c48;
  --curve-fill: rgba(120,241,214,.27); --curve-fade: rgba(120,241,214,.025); --radius: 14px;
  --mono: "Cascadia Mono", "Consolas", monospace; --ui: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}
.app-frame { min-block-size: 100vh; min-block-size: 100dvh; color: var(--ink); background: var(--bg); }
.workbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 22px; padding: 10px clamp(14px, 5vw, 78px); border-bottom: 1px solid var(--rule); }
.workmark { display: flex; gap: 9px; align-items: center; font-weight: 750; white-space: nowrap; }
.workmark img { border-radius: 8px; display: block; }
.workbar nav, .archive-links { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 16px; }
.workbar nav a, .sources a { display: inline-flex; min-block-size: 42px; align-items: center; color: var(--muted); text-decoration: none; }
.workbar nav a:hover, .sources a:hover { color: var(--ink); text-decoration: underline; }
.data-button, .text-button { min-block-size: 42px; border: 1px solid var(--rule); border-radius: 8px; color: var(--ink); padding: 5px 12px; background: var(--surface); }
.data-button { display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; text-decoration: none; }
.text-button { font-size: .83rem; }
.text-button:hover, .data-button:hover { border-color: var(--accent); }
.fallback-link { display: inline-flex; }
.js .fallback-link, body:not(.js) .js-only { display: none; }

.dash { display: grid; grid-template-columns: minmax(0, 2.45fr) minmax(240px, 1fr); grid-template-areas: "hero hero" "metrics metrics" "chart sessions" "orders orders" "sources sources"; align-items: start; gap: 14px; max-inline-size: 1440px; margin-inline: auto; padding: 19px clamp(12px, 4vw, 56px) 30px; }
.dash > * { min-inline-size: 0; }
.hero { grid-area: hero; position: relative; overflow: hidden; isolation: isolate; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--hero); padding: clamp(16px, 3vw, 30px) clamp(15px, 4vw, 36px); }
.hero > * { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font: 700 .88rem/1.35 var(--mono); letter-spacing: .055em; }
.state-dot { display: inline-block; inline-size: 7px; block-size: 7px; margin-inline-end: 5px; border-radius: 50%; background: currentColor; vertical-align: 2px; }
h1, h2, p, figure, dl { margin: 0; }
h1 { font-size: clamp(2.1rem, 1.5rem + 3.1vw, 4.5rem); font-weight: 780; letter-spacing: -.065em; line-height: 1.06; }
h2 { font-size: 1.12rem; line-height: 1.2; letter-spacing: -.025em; }
.hero-copy { display: flex; flex-wrap: wrap; column-gap: 14px; row-gap: 4px; margin-block-start: 12px; color: var(--muted); }
.hero-copy > :not(:last-child)::after { content: ""; display: inline-block; height: .8em; width: 1px; background: var(--rule); margin-inline-start: 14px; }
.metrics { grid-area: metrics; display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric, .panel { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--panel); }
.metric { min-inline-size: 0; display: grid; gap: 5px; padding: 12px 15px; }
.metric > p, .metric > small { color: var(--muted); font-size: .84rem; }
.metric strong { font: 690 clamp(1.18rem, 1rem + 1.1vw, 1.82rem)/1.07 var(--mono); letter-spacing: -.055em; white-space: nowrap; }
.metric strong small { font: 500 .82rem/1 var(--ui); letter-spacing: 0; }
.positive, .daygain { color: var(--positive); }
.dayloss { color: var(--negative); }
.panel { min-inline-size: 0; container-type: inline-size; padding: 15px; }
.panel-head, .plot-header { display: flex; min-inline-size: 0; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.panel-head { margin-block-end: 10px; }
.subdued, figcaption { color: var(--muted); font-size: .79rem; margin-block-start: 4px; }
.chart-panel { grid-area: chart; }
.segmented { border: 1px solid var(--rule); background: var(--surface); border-radius: 9px; gap: 2px; padding: 3px; }
.segmented label span { min-block-size: 34px; padding-inline: 9px; color: var(--muted); font-size: .78rem; border-radius: 6px; }
.segmented input:checked + span { color: var(--accent); background: var(--panel); border-color: var(--rule); font-weight: 750; }
.plot-header { padding: 2px 0 5px; }
.plot-header strong { font: 700 clamp(1.4rem, 1.25rem + 1.15vw, 2.15rem)/1.2 var(--mono); letter-spacing: -.055em; }
.plot-header time, #cursor-position { color: var(--muted); font-family: var(--mono); font-size: .8rem; }
#chart { inline-size: 100%; block-size: clamp(208px, 34vw, 330px); }
body:not(.js) #chart { display: none; }
figcaption { margin-block: 7px 0; }
.scrubber { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; margin-block-start: 11px; padding-block-start: 9px; border-top: 1px solid var(--rule); }
.scrubber > div:first-child { display: flex; gap: 7px; align-items: baseline; font-size: .83rem; color: var(--muted); }
.scrubber input { grid-column: 1; inline-size: 100%; block-size: 32px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.scrub-actions { grid-column: 2; grid-row: 1 / span 2; align-self: end; display: flex; gap: 5px; }
.session-panel { grid-area: sessions; }
.day-list { display: grid; gap: 6px; }
.day { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 9px; min-block-size: 49px; width: 100%; padding: 6px 9px; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); color: var(--ink); text-align: start; }
.day:hover, .day[aria-pressed="true"] { border-color: var(--accent); }
.day[aria-pressed="true"] { background: var(--panel); }
.day-date { font: 640 .88rem var(--mono); }
.day-equity, .day-change { font-family: var(--mono); text-align: end; white-space: nowrap; font-size: .8rem; }
.day-bar { grid-column: 1 / -1; display: block; block-size: 2px; background: var(--rule); }
.day-bar > span { width: var(--relative); height: 100%; display: block; background: currentColor; }
.session-table { border-block-start: 1px solid var(--rule); margin-block-start: 10px; }
.session-table summary { min-block-size: 42px; padding-block: 10px; cursor: pointer; color: var(--muted); font-size: .84rem; }
table { border-collapse: collapse; inline-size: 100%; font-size: .85rem; }
th, td { padding: 5px 7px; border-block-end: 1px solid var(--rule); text-align: start; }
td:last-child, thead th:last-child { text-align: end; }
td { font-family: var(--mono); }
.order-panel { grid-area: orders; }
.order-panel a, .archive-links a { min-block-size: 42px; display: inline-flex; align-items: center; color: var(--accent); }
.fill { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 0; border-block: 1px solid var(--rule); }
.fill > div { flex: 1; min-inline-size: 110px; }
.fill > strong { text-align: end; font-family: var(--mono); }
.fill small { display: block; color: var(--muted); font: 500 .78rem/1.4 var(--ui); }
.side { border-radius: 6px; border: 1px solid var(--rule); color: var(--positive); padding: 2px 7px; font-size: .8rem; }
.mini-ledger { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 10px; margin-block: 10px 0; font-size: .85rem; }
.mini-ledger dt { color: var(--muted); }
.mini-ledger dd { margin: 0; text-align: end; }
.sources { grid-area: sources; display: flex; flex-wrap: wrap; align-items: center; gap: 1px 15px; color: var(--muted); font-size: .83rem; }
.sources span { margin-inline-start: auto; }
dialog { max-inline-size: min(480px, calc(100% - 24px)); max-block-size: calc(100% - 24px); margin: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--panel); color: var(--ink); padding: 18px; }
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { overflow: hidden; overscroll-behavior: contain; background: rgba(9,16,31,.69); }
dialog .mini-ledger { padding-block: 9px; border-block: 1px solid var(--rule); }
dialog > p { margin-block: 12px; color: var(--muted); }

/* Night terminal: wide analysis canvas and a vertical session feed. */
[data-design="terminal"] .hero { background: radial-gradient(ellipse at 78% 15%, #224f76, transparent 62%), linear-gradient(115deg, #11223c, #0b2633 77%); }
[data-design="terminal"] .hero::after { content: ""; position: absolute; z-index: 0; inset: -45% -12% -50% 44%; border-radius: 50%; border: 1px solid #6ad9e640; box-shadow: 0 0 0 28px #6ad9e611, 0 0 0 64px #6ad9e618, 0 0 0 104px #6ad9e611; transform: rotate(-14deg); }

/* Editorial: large type with a chart occupying the facing column. */
[data-design="editorial"] { --bg: #f2eee5; --panel: #fffcf5; --surface: #f8f2e8; --ink: #24211b; --muted: #5e5346; --rule: #d8ccba; --accent: #8f292b; --positive: #176649; --negative: #9a3030; --hero: #ebe2d1; --curve-fill: rgba(146,49,47,.16); --curve-fade: rgba(146,49,47,.02); --radius: 2px; }
[data-design="editorial"] .dash { grid-template-columns: minmax(260px, .82fr) minmax(0, 1.6fr); grid-template-areas: "hero chart" "metrics chart" "sessions sessions" "orders orders" "sources sources"; }
[data-design="editorial"] .hero { padding-block: 30px; border-block-start: 4px solid var(--accent); }
[data-design="editorial"] h1, [data-design="editorial"] h2 { font-family: Georgia, "Songti SC", "SimSun", serif; letter-spacing: -.07em; font-weight: 700; }
[data-design="editorial"] h1 { max-inline-size: 6em; overflow-wrap: anywhere; }
[data-design="editorial"] .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
[data-design="editorial"] .metric { padding-inline: 10px; }
[data-design="editorial"] .workbar { background: #ece2ce; border-block-end: 1px solid #bb9e82; }
[data-design="editorial"] .day-list { grid-template-columns: repeat(5, minmax(0, 1fr)); }
[data-design="editorial"] .day { grid-template-columns: 1fr auto; padding: 12px 10px; }
[data-design="editorial"] .day-equity { grid-row: 2; grid-column: 1 / -1; text-align: start; }
[data-design="editorial"] .day-change { grid-column: 2; grid-row: 1; }

/* Prism: translucent bento cards and a risk-first view. */
[data-design="prism"] { --bg: #130f26; --panel: #201a36; --surface: #2b2345; --ink: #f6f0ff; --muted: #c5b7dd; --rule: #504571; --accent: #e0b9ff; --positive: #a3f6cc; --negative: #ffb3c5; --hero: #332353; --curve-fill: rgba(206,158,255,.31); --curve-fade: rgba(206,158,255,.02); --radius: 22px; }
[data-design="prism"] .dash { grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr); grid-template-areas: "hero hero" "chart metrics" "chart sessions" "orders orders" "sources sources"; }
[data-design="prism"] .hero { background: radial-gradient(ellipse at 77% 0, #713844, transparent 53%), linear-gradient(115deg, #282051, #382757 64%, #1d2651); box-shadow: inset 0 1px 0 #fff2; }
[data-design="prism"] .hero::after { content: ""; position: absolute; inset: -122% 2% -95% auto; aspect-ratio: 1; border-radius: 30%; border: 1px solid #fbcfff59; box-shadow: 0 0 0 20px #eeb2ff15, 0 0 0 48px #eeb2ff14; transform: rotate(29deg); }
[data-design="prism"] .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
[data-design="prism"] .metric { background: linear-gradient(140deg, #34264d, #241c40); }
[data-design="prism"] .metric:nth-child(3) { background: linear-gradient(135deg, #46304b, #321d38); }
[data-design="prism"] .metric:nth-child(4) { background: linear-gradient(135deg, #2e3054, #1e2343); }

/* Tape matrix: three rails with an OHLC equity view. */
[data-design="matrix"] { --bg: #171712; --panel: #202018; --surface: #292820; --ink: #fbf4e5; --muted: #c3b9a3; --rule: #474335; --accent: #ffc569; --positive: #a9e5a7; --negative: #ff9b86; --hero: #282419; --curve-fill: rgba(255,184,99,.23); --curve-fade: rgba(255,184,99,.02); --radius: 5px; }
[data-design="matrix"] .dash { grid-template-columns: minmax(190px, .77fr) minmax(0, 2.15fr) minmax(225px, .95fr); grid-template-areas: "hero chart sessions" "metrics chart sessions" "orders orders orders" "sources sources sources"; gap: 10px; }
[data-design="matrix"] .hero { padding: 18px 12px; border-block-start: 3px solid var(--accent); }
[data-design="matrix"] h1 { font-size: clamp(1.7rem, 1.15rem + 1.35vw, 2.55rem); }
[data-design="matrix"] h2, [data-design="matrix"] .workmark { font-family: var(--mono); }
[data-design="matrix"] .app-frame { background-image: repeating-linear-gradient(90deg, transparent 0 31px, #ffffff0b 31px 32px); }
[data-design="matrix"] .metrics { grid-template-columns: 1fr; gap: 5px; }
[data-design="matrix"] .metric { border-inline-start: 3px solid #91724a; padding: 9px 11px; }
[data-design="matrix"] .hero-copy > :not(:last-child)::after { display: none; }
[data-design="matrix"] .day { padding-inline: 6px; }
[data-design="matrix"] .day-equity, [data-design="matrix"] .day-change { font-size: .74rem; }

/* Session replay: a horizontal date selector and a dedicated scrubber. */
[data-design="replay"] { --bg: #eaf1ff; --panel: #fff; --surface: #f0f5ff; --ink: #162c55; --muted: #425982; --rule: #cbd8ef; --accent: #174dc8; --positive: #14654e; --negative: #ab374a; --hero: #dceaff; --curve-fill: rgba(38,96,228,.22); --curve-fade: rgba(38,96,228,.025); --radius: 17px; }
[data-design="replay"] .dash { grid-template-columns: minmax(0, 2.1fr) minmax(245px, 1fr); grid-template-areas: "hero hero" "sessions sessions" "chart metrics" "chart orders" "sources sources"; }
[data-design="replay"] .hero { background: linear-gradient(112deg, #d5e6ff, #f4f9ff 72%, #d5e4ff); padding-block: 18px; }
[data-design="replay"] h1 { font-size: clamp(2.1rem, 1.5rem + 2.5vw, 3.6rem); }
[data-design="replay"] #chart { block-size: clamp(210px, 32vw, 282px); }
[data-design="replay"] .workbar { background: #fbfdff; }
[data-design="replay"] .day-list { grid-template-columns: repeat(5, minmax(0, 1fr)); }
[data-design="replay"] .day { grid-template-columns: 1fr auto; padding-block: 9px; border-radius: 11px; }
[data-design="replay"] .day-equity { grid-row: 2; grid-column: 1 / -1; text-align: start; }
[data-design="replay"] .day-change { grid-column: 2; grid-row: 1; }
[data-design="replay"] .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
[data-design="replay"] .metric { padding-inline: 10px; }
[data-design="replay"] .scrubber { padding: 9px 10px; border: 1px solid var(--rule); border-radius: 11px; background: var(--surface); }

@container (max-width: 470px) {
  .chart-panel .panel-head > div { flex-basis: 100%; }
}
@container (max-width: 310px) {
  .day { grid-template-columns: auto minmax(0,1fr) auto; padding-inline: 6px; gap: 4px 6px; }
  .day-equity { font-size: .75rem; }
}
@media (max-width: 980px) {
  [data-design="matrix"] .dash { grid-template-columns: minmax(0, 2fr) minmax(225px, 1fr); grid-template-areas: "hero hero" "metrics metrics" "chart sessions" "orders orders" "sources sources"; }
  [data-design="matrix"] .metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  [data-design="prism"] .dash { grid-template-columns: minmax(0, 1.5fr) minmax(245px, 1fr); }
}
@media (max-width: 740px) {
  .picker { display: block; padding: 7px 11px; }
  .picker-mark { min-block-size: 25px; font-size: .9rem; }
  .design-options label { flex: 1 1 auto; }
  .design-options label span { padding-inline: 6px; min-block-size: 42px; font-size: .8rem; }
  body[data-design] .dash { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hero" "metrics" "chart" "sessions" "orders" "sources"; padding-block-start: 12px; gap: 10px; }
  body[data-design] .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  body[data-design] .day-list { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: 11px; }
  .scrub-actions { grid-column: 1 / -1; grid-row: auto; justify-content: flex-end; }
  .workbar { padding: 6px 11px; gap: 2px 8px; }
  .workbar nav { order: 2; flex: 1 0 100%; gap: 1px 16px; }
  .workbar nav a { min-block-size: 34px; font-size: .82rem; }
  .workmark img { inline-size: 26px; block-size: 26px; }
  .hero-copy { font-size: .82rem; }
  .metric { padding: 9px 10px; }
  .sources span { margin-inline-start: 0; }
}
@media (pointer: coarse) {
  .segmented label span, .text-button, .data-button { min-block-size: 44px; }
}
@media (forced-colors: active) {
  .segmented input:checked + span, .design-options input:checked + span, .day[aria-pressed="true"] { outline: 2px solid Highlight; }
}

/* Styles for the public market pages. The design chooser keeps its own header. */
body[data-market] .site-topbar { color: var(--ink); background: var(--bg); border-color: var(--rule); }
body[data-market] .site-topbar .primary-nav { max-inline-size: 1440px; padding-inline: clamp(12px, 4vw, 56px); }
body[data-market] .site-topbar a.nav-item { color: var(--ink); }
body[data-market] .site-topbar a.nav-item:hover { background: var(--surface); }
body[data-market] .site-topbar a.nav-item[aria-current="page"] {
  color: var(--accent); background: var(--surface); border-bottom-color: var(--accent);
}
body[data-market] .site-topbar a.nav-item:focus-visible { outline-color: var(--accent); }
body[data-market] .workbar { padding-inline: clamp(12px, 4vw, 56px); }
body[data-market] .workbar a.directory-link { color: var(--accent); font-weight: 750; }
body[data-market="ag"] { --buy: #a62c33; --sell: #1c6c4b; }
body[data-market] .workbar-actions { display: flex; flex-wrap: wrap; gap: 7px 12px; align-items: center; }
body[data-market] .metric strong { white-space: normal; overflow-wrap: anywhere; }
body[data-market] .methodology { grid-area: sources; }
body[data-market] .methodology .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 14px 28px; margin-block-start: 12px; }
body[data-market] .methodology h3 { font-size: .98rem; margin: 0 0 8px; }
body[data-market] .methodology p { margin-block-end: 9px; color: var(--muted); }
body[data-market] code, body[data-market] .methodology a { overflow-wrap: anywhere; }
body[data-market] .trade-list details { border-block-start: 1px solid var(--rule); padding: 0 2px 5px; }
body[data-market] .trade-list summary { min-block-size: 42px; padding-block: 10px; cursor: pointer; }
body[data-market] .trade-list button { margin-block: 8px; }
body[data-market] #selection:empty { display: none; }
body[data-market] #selection { margin-block: 8px 0; color: var(--accent); }
@media (max-width: 740px) {
  body[data-market] .workbar nav { order: initial; }
  body[data-market] .workbar-actions { margin-block-end: 4px; }
}


/* Decorative layers are independent of hit testing and chart data. */
.chart-stage { position: relative; overflow: hidden; isolation: isolate; }
.chart-sweep { position: absolute; inset: 0 auto 0 0; width: 38%; pointer-events: none; opacity: 0; z-index: 2; background: linear-gradient(110deg, transparent 8%, #9b63ff30 37%, #ebd7ff58 52%, #8273f52e 64%, transparent 91%); }
.trade-pulse { position: absolute; inset-inline-start: var(--pulse-x, -100px); inset-block-start: var(--pulse-y, -100px); inline-size: 15px; block-size: 15px; translate: -50% -50%; pointer-events: none; z-index: 3; color: var(--accent); }
.trade-pulse > span { position: absolute; inset: 0; border: 2px solid currentColor; border-radius: 50%; opacity: 0; }
[data-design="prism"] .trade-pulse > span { box-shadow: 0 0 14px currentColor, inset 0 0 7px currentColor; }
