:root {
  color-scheme: dark;
  font-family: Inter, system-ui, sans-serif;
  --bg: #0c1017;
  --surface: #111720;
  --border: #222d3a;
  --text: #e9effa;
  --muted: #95a4b9;
  --accent: #7ff2ca;
  --red: #ff8290;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  background: var(--bg);
  color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; }
button, input { font: inherit; }
button { cursor: pointer; color: inherit; }
button:focus-visible, input:focus-visible, canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.site-header { min-height: 68px; padding: 0 max(24px, calc((100vw - 1512px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); background: #10151d; }
.brand, .header-right, .symbol-line, .quote-meta { display: flex; align-items: center; gap: 10px; }
.mark { width: 33px; height: 33px; display: flex; gap: 3px; justify-content: center; align-items: flex-end; padding: 8px; background: var(--accent); border-radius: 8px; }
.mark i { width: 3px; height: 7px; border-radius: 1px; background: #10251f; }
.mark i:nth-child(2) { height: 11px; }
.mark i:nth-child(3) { height: 17px; }
.brand strong { font-size: 22px; letter-spacing: -.055em; }
.brand strong span { color: var(--accent); }
.brand-domain { color: var(--muted); font: 12px var(--mono); }
.header-right { gap: 17px; }
.clock, .feed { font: 11px var(--mono); white-space: nowrap; }
.clock { color: var(--muted); }
.feed { border: 1px solid #2b4842; background: #172c2a; border-radius: 6px; color: var(--accent); padding: 7px 9px; }
.feed i, .chart-dot { display: inline-block; width: 6px; height: 6px; margin-right: 4px; vertical-align: 1px; border-radius: 50%; background: currentColor; }
.feed[data-state="demo"], .feed[data-state="error"] { color: #ffd189; background: #30261c; border-color: #50402d; }
main { max-width: 1560px; margin: auto; padding: 22px 24px; }
.market-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.market-card, .panel { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.market-card { padding: 14px 15px; text-align: left; min-width: 0; }
.market-card:hover, .market-card[aria-pressed="true"] { border-color: #43766b; background: #141f29; }
.card-top, .card-bottom { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.card-top { margin-bottom: 8px; }
.card-top strong { font-size: 13px; }
.card-top span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.card-bottom { font: 12px var(--mono); }
.card-bottom strong { font-size: 20px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) clamp(300px, 27%, 380px); gap: 16px; align-items: start; }
.terminal { min-width: 0; overflow: hidden; }
.instrument { display: flex; align-items: center; gap: 13px; padding: 22px 20px; }
.symbol-icon { border: 1px solid #374454; background: #1d2834; color: var(--accent); width: 47px; height: 47px; flex: 0 0 47px; display: grid; place-items: center; border-radius: 12px; font: 700 23px var(--mono); }
.symbol-line { gap: 8px; }
h1, h2 { margin: 0; }
h1 { font-size: 24px; letter-spacing: -.035em; }
.symbol-line > span { color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 3px 4px; font: 9px var(--mono); white-space: nowrap; }
#company { color: var(--muted); font-size: 12px; margin-top: 2px; }
.price-block { margin-left: auto; text-align: right; }
#price { font: 700 clamp(22px, 3vw, 34px) var(--mono); white-space: nowrap; letter-spacing: -.045em; }
.quote-meta { justify-content: flex-end; gap: 9px; font: 11px var(--mono); margin-top: 4px; }
#quoteTime { color: var(--muted); white-space: nowrap; }
.positive { color: var(--accent); }
.negative { color: var(--red); }
.toolbar { padding: 10px 16px; display: flex; justify-content: space-between; gap: 8px; border-block: 1px solid var(--border); }
.segmented { display: flex; gap: 3px; }
.segmented button { background: transparent; border: 0; border-radius: 5px; color: var(--muted); font-size: 12px; padding: 6px 9px; white-space: nowrap; }
.segmented button:hover { background: #202b37; color: var(--text); }
.segmented button[aria-pressed="true"] { color: var(--accent); background: #1d3535; }
.chart-panel { position: relative; background: #0e141d; }
#chart { width: 100%; height: clamp(340px, 49vh, 600px); display: block; touch-action: pan-y; cursor: crosshair; }
.ohlc { position: absolute; top: 12px; left: 15px; right: 65px; display: flex; gap: 9px; flex-wrap: wrap; pointer-events: none; color: var(--muted); font: 11px var(--mono); }
.ohlc b { color: var(--text); font-weight: 500; }
#chartStatus { position: absolute; top: 48%; left: 12px; right: 12px; text-align: center; color: var(--muted); font-size: 13px; pointer-events: none; }
.chart-footer, .page-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 11px; }
.chart-footer { border-top: 1px solid var(--border); padding: 11px 15px; }
.chart-dot { color: var(--accent); }
.watchlist { overflow: hidden; }
.watchlist-title { display: flex; align-items: center; justify-content: space-between; padding: 16px 14px 13px; }
.watchlist-title h2 { font-size: 15px; }
#instrumentCount { color: var(--muted); font: 11px var(--mono); }
.search { margin: 0 14px 10px; display: flex; align-items: center; gap: 6px; padding: 0 9px; background: #0d131c; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); }
.search > span { font-size: 20px; line-height: 1; }
.search input { width: 100%; min-width: 0; background: transparent; color: var(--text); border: 0; font-size: 12px; padding: 8px 4px; }
.search input::placeholder { color: var(--muted); }
.filters { padding: 0 10px 10px; }
.table-head, .ticker-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 63px; gap: 5px; align-items: center; padding: 0 13px; }
.table-head { height: 30px; color: var(--muted); background: #0e141d; border-block: 1px solid var(--border); font-size: 10px; }
.table-head > :not(:first-child), .ticker-row > :not(:first-child) { text-align: right; }
.ticker-row { background: none; border: 0; border-bottom: 1px solid #1c2632; width: 100%; height: 47px; text-align: left; font: 12px var(--mono); }
.ticker-row:last-child { border-bottom: 0; }
.ticker-row:hover, .ticker-row[aria-pressed="true"] { background: #182831; }
.ticker-row[aria-pressed="true"] { box-shadow: inset 2px 0 var(--accent); }
.row-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row-name > span { min-width: 0; }
.row-name small { display: block; color: var(--muted); font: 10px Inter, system-ui, sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.row-dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 6px; }
.empty-list { color: var(--muted); padding: 12px; font-size: 12px; }
.page-footer { padding: 12px 1px 0; }
@media (max-width: 850px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .watchlist { order: -1; }
  .list { max-height: 188px; overflow: auto; }
}
@media (max-width: 540px) {
  .site-header { min-height: 56px; padding: 0 12px; }
  .brand-domain { display: none; }
  .header-right { gap: 7px; }
  main { padding: 12px 9px; }
  .market-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .market-card { padding: 9px; }
  .card-bottom strong { font-size: 17px; }
  .instrument { padding: 14px 9px; gap: 8px; }
  .symbol-icon { width: 34px; height: 34px; flex-basis: 34px; font-size: 15px; }
  h1 { font-size: 18px; }
  .symbol-line { flex-wrap: wrap; gap: 3px; }
  .quote-meta { flex-wrap: wrap; gap: 3px; }
  .toolbar { padding-inline: 5px; }
  .segmented button { padding-inline: 6px; }
}
