:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: #101415;
  color: #edf1ec;
  --panel: #181d1e;
  --border: #323a3a;
  --muted: #a3aeaa;
  --accent: #c8ed79;
  --resistance: #efb977;
  --mono: "IBM Plex Mono", Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button { font: inherit; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
[hidden] { display: none !important; }
.wrap { width: min(100% - clamp(2rem, 6vw, 7rem), 1520px); margin-inline: auto; }
.mast { border-bottom: 1px solid var(--border); }
.mast-inner, .brand, .feed, .title-row, .section-bar, .instrument, .instrument-name, .plot-toolbar, .zoom, .score-value, .legend { display: flex; align-items: center; }
.mast-inner { min-height: 3.8rem; justify-content: space-between; gap: 1rem; }
.brand { gap: .56rem; font-size: 1.12rem; font-weight: 700; letter-spacing: -.035em; }
.brandmark { display: flex; gap: 3px; align-items: center; height: 1.35rem; }
.brandmark i { display: block; width: 5px; height: 12px; background: var(--accent); transform: skew(-15deg); }
.brandmark i:nth-child(2) { height: 19px; }
.brandmark i:last-child { height: 9px; }
.brand-sub { margin-left: .55rem; padding-left: .9rem; border-left: 1px solid #485151; font-weight: 400; font-size: .91rem; color: var(--muted); letter-spacing: 0; }
.feed { gap: 1rem; font-size: .83rem; }
.feed time { color: var(--muted); font-family: var(--mono); }
.status { display: inline-flex; gap: .45rem; align-items: center; }
.status::before { content: ""; width: .45rem; height: .45rem; background: #a1aaa5; border-radius: 50%; }
.status.live::before { background: var(--accent); }
.status.warn::before { background: var(--resistance); }
.status.frozen::before { background: #98b5da; }
.title-row { justify-content: space-between; gap: 1rem; margin: clamp(1.4rem, 3vw, 2.65rem) 0 1.6rem; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.35rem); line-height: 1; letter-spacing: -.055em; font-weight: 630; }
.universe { margin-top: .7rem; color: var(--muted); font-size: .94rem; }
.universe span { margin: 0 .4rem; color: #6c7974; }
.coverage { line-height: 1.4; text-align: right; }
.coverage span { font-size: .8rem; color: var(--muted); display: block; }
.coverage strong { font-family: var(--mono); font-size: clamp(.94rem, 1.8vw, 1.3rem); font-weight: 500; }
.section-bar { justify-content: space-between; gap: 1rem; margin-bottom: .7rem; }
.section-bar h2 { font-size: 1.04rem; font-weight: 600; }
.section-bar span { color: var(--muted); font-size: .81rem; }
.case-actions { display: flex; align-items: center; gap: .45rem; }
.sort-caption { margin-right: .3rem; }
.case-actions button { background: #222a28; color: #e1ebde; border: 1px solid #455143; padding: .34rem .66rem; border-radius: 4px; font-size: .81rem; cursor: pointer; }
.case-actions button:hover { background: #344032; }
.case-actions button:disabled { opacity: .45; cursor: default; }
.markets { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 1px; border: 1px solid var(--border); background: var(--border); overflow: hidden; border-radius: 5px; }
.markets:empty { display: none; }
.market { background: #181d1e; color: inherit; border: 0; text-align: left; cursor: pointer; padding: .68rem .82rem; min-width: 0; }
.market:hover { background: #222a28; }
.market[aria-pressed="true"] { background: #293128; box-shadow: inset 3px 0 var(--accent); }
.market-line { display: flex; align-items: baseline; gap: .45rem; }
.rank-no,.market-score,.ticker { font-family: var(--mono); }
.rank-no { color: #a1aea5; font-size: .75rem; }
.ticker { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .91rem; font-weight: 600; }
.market-score { color: var(--accent); margin-left: auto; font-size: .91rem; }
.market-meta { display: block; margin-top: .24rem; color: var(--muted); font-size: .78rem; }
.detail, .empty { margin: 1.2rem 0 2.5rem; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; }
.empty { padding: 2.6rem 1.25rem; color: var(--muted); text-align: center; }
.instrument { padding: 1rem 1.18rem; gap: .8rem; justify-content: space-between; border-bottom: 1px solid var(--border); }
.instrument-name { flex-wrap: wrap; gap: .6rem .8rem; }
.instrument h2 { font-size: clamp(1.45rem, 2.2vw, 2rem); font-weight: 620; letter-spacing: -.035em; }
.market-label { font-size: .78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.tf { border: 1px solid #45513e; border-radius: 3px; padding: .16rem .42rem; font-size: .83rem; color: var(--accent); }
.quote { text-align: right; }
.quote strong { font-family: var(--mono); font-weight: 500; font-size: clamp(1.1rem, 2vw, 1.55rem); white-space: nowrap; }
.quote-time { display: block; margin-top: .2rem; font-size: .77rem; color: var(--muted); }
.quote-time.warn { color: var(--resistance); }
.chart-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(183px,19%); }
.chart-pane { min-width: 0; }
.plot-toolbar { justify-content: space-between; gap: .4rem; padding: .65rem .8rem .55rem 1rem; min-height: 3rem; }
.pattern-label { font-size: .89rem; font-weight: 550; display: inline-flex; align-items: center; gap: .55rem; color: var(--figure); }
.pattern-label::before { content: ""; display: inline-block; width: 15px; height: 2px; background: var(--figure); }
.pattern-label.sloped::before { transform: rotate(-18deg); }
.zoom { gap: .22rem; }
.zoom button { background: #212728; color: #d8e0d9; border: 1px solid #394242; border-radius: 3px; min-width: 1.75rem; min-height: 1.75rem; padding: .12rem .36rem; cursor: pointer; font-size: .88rem; }
.zoom button:last-child { font-size: .77rem; padding-inline: .5rem; }
.zoom button:hover { background: #374032; color: #eaf4dd; }
.zoom button:disabled { opacity: .4; cursor: default; }
.plot { width: 100%; height: clamp(315px, 38vh, 530px); position: relative; }
canvas { display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: pan-y; }
.bar-info { display: flex; flex-wrap: wrap; gap: .35rem 1rem; align-items: center; min-height: 2.15rem; padding: .35rem 1rem .7rem; color: #cfd8d2; font: .77rem/1.4 var(--mono); }
.bar-info span:first-child { color: var(--muted); }
.bar-info em { color: var(--muted); margin-right: .2rem; font-style: normal; }
.facts { border-left: 1px solid var(--border); padding: 1.05rem 1.1rem; }
.facts h3 { color: #bac6bd; font-weight: 500; font-size: .88rem; }
.score-value { gap: .4rem; align-items: baseline; margin: .42rem 0 .5rem; }
.score-value strong { font: 500 clamp(2rem,3vw,2.7rem)/1 var(--mono); letter-spacing: -.07em; color: var(--accent); }
.score-value span { color: var(--muted); font: .8rem var(--mono); }
.score-track { height: 3px; background: #3a433b; }
.score-track i { display: block; height: 100%; background: var(--accent); }
.facts dl { margin: 1.25rem 0 .7rem; }
.facts dl div { padding: .62rem 0; border-bottom: 1px solid var(--border); }
.facts dt { color: var(--muted); font-size: .82rem; }
.facts dd { font: 1.01rem var(--mono); margin-top: .18rem; }
.legend { gap: .5rem; color: var(--muted); font-size: .78rem; padding-top: .4rem; }
.legend i { width: .52rem; height: .52rem; border-radius: 50%; border: 1.6px solid var(--figure); }
.tick-key i { background: var(--accent); border-color: var(--accent); }
@media(max-width:1000px) {
  .wrap { width: calc(100% - 2rem); }
  .market { padding: .58rem .5rem; }
  .market-line { gap: .25rem; }
  .rank-no { display: none; }
  .facts { padding: .95rem .8rem; }
}
@media(max-width:760px) {
  .markets { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2,auto); grid-template-columns: none; grid-auto-columns: minmax(140px,33%); overflow-x: auto; scroll-snap-type:x proximity; }
  .market { scroll-snap-align: start; }
  .chart-layout { grid-template-columns: minmax(0,1fr); }
  .facts { border-left: 0; border-top: 1px solid var(--border); display: grid; grid-template-columns: 5.5rem minmax(0,1fr); gap: .3rem .7rem; padding: .8rem; }
  .facts h3 { grid-column: 1; }
  .facts .score-value { grid-column: 1; margin: 0; }
  .facts .score-track { grid-column: 1; }
  .facts dl { grid-column: 2; grid-row: 1 / 4; margin: 0; display: grid; grid-template-columns: repeat(auto-fit,minmax(6.5rem,1fr)); gap: .5rem; }
  .facts dl div { padding: 0; border: 0; }
  .legend { grid-column: 1 / -1; }
}
@media(max-width:520px) {
  .sort-caption { display: none; }
  .wrap { width: calc(100% - 1.2rem); }
  .mast-inner { min-height: 3.25rem; }
  .brand-sub { display: none; }
  .feed { gap: .4rem; font-size: .73rem; flex-wrap: wrap; justify-content: flex-end; }
  .title-row { align-items: end; margin: 1.3rem 0 1.2rem; }
  .coverage span { max-width: 5.5rem; }
  .universe { font-size: .81rem; }
  .universe span { margin: 0 .12rem; }
  .instrument { padding: .75rem; align-items: end; }
  .instrument-name { gap: .25rem .45rem; }
  .market-label { flex-basis: 100%; }
  .quote-time { font-size: .7rem; }
  .plot-toolbar { padding: .6rem .4rem .3rem .65rem; }
  .pattern-label { font-size: .78rem; }
  .pattern-label::before { display: none; }
  .facts { grid-template-columns: 4.75rem minmax(0,1fr); }
  .facts h3, .facts dt { font-size: .72rem; }
  .facts dd { font-size: .83rem; }
  .bar-info { gap: .25rem .5rem; }
  .plot { height: 315px; }
}
