  :root {
    --bg: #000000; --bg-1: #08090b; --bg-2: #101216; --bg-3: #181a20;
    --ink: #eaecef; --ink-soft: #b7bdc6; --ink-mute: #848e9c; --ink-faint: #474d57;
    --rule: #1e2329; --rule-soft: #131519;
    --up: #0ecb81; --up-soft: rgba(14, 203, 129, 0.12); --up-glow: rgba(14, 203, 129, 0.3);
    --down: #f6465d; --down-soft: rgba(246, 70, 93, 0.12); --down-glow: rgba(246, 70, 93, 0.3);
    --mint: #00e5a0; --mint-deep: #00b382; --mint-soft: rgba(0, 229, 160, 0.12);
    --gold: #fcd535; --gold-soft: rgba(252, 213, 53, 0.12);
    --font: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, monospace;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }
  body {
    background: var(--bg); color: var(--ink);
    font-family: var(--font); font-size: 14px; line-height: 1.5;
    font-feature-settings: "tnum" 1, "lnum" 1;
    -webkit-font-smoothing: antialiased;
  }
  a { color: inherit; text-decoration: none; }
  ::selection { background: var(--mint); color: var(--bg); }
  .mono { font-family: var(--mono); font-feature-settings: "tnum" 1; }
  .wrap { max-width: 1600px; margin: 0 auto; padding: 0 20px; }

  /* TOPBAR */
  .topbar {
    background: var(--bg); border-bottom: 1px solid var(--rule);
    position: sticky; top: 0; z-index: 85;
  }
  .topbar-inner {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 20px; gap: 24px;
    max-width: 1600px; margin: 0 auto;
  }
  .brand { display: flex; align-items: baseline; gap: 10px; font-weight: 700; letter-spacing: -0.01em; }
  .brand .logo { font-size: 22px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 800; }
  .brand .logo .x { color: var(--mint); }
  .brand .tag {
    font-family: var(--mono); font-size: 9px; font-weight: 500;
    padding: 2px 6px; background: var(--mint-soft); color: var(--mint);
    border-radius: 2px; letter-spacing: 0.1em; text-transform: uppercase;
  }
  .nav-main { display: flex; gap: 6px; flex: 1; justify-content: center; }
  .nav-main a {
    font-size: 13px; font-weight: 500; padding: 8px 14px;
    color: var(--ink-soft); border-radius: 4px; transition: all 0.12s;
  }
  .nav-main a:hover, .nav-main a.active { color: var(--mint); background: var(--mint-soft); }
  .nav-right { display: flex; gap: 10px; align-items: center; }
  .btn {
    font-family: var(--font); font-size: 13px; font-weight: 600;
    padding: 9px 18px; border-radius: 4px; border: 1px solid transparent;
    cursor: pointer; transition: all 0.12s;
    display: inline-flex; align-items: center; gap: 6px;
  }
  .btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
  .btn-ghost:hover { border-color: var(--mint); color: var(--mint); }
  .btn-primary { background: var(--mint); color: var(--bg); }
  .btn-primary:hover { background: var(--mint-deep); }

  /* SYMBOL HEADER BAR (Binance-style, the strip above chart) */
  .symbol-bar {
    background: var(--bg-1); border-bottom: 1px solid var(--rule);
    padding: 14px 20px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 32px;
    align-items: center;
    max-width: 1600px; margin: 0 auto;
  }
  .sym-id {
    display: flex; align-items: center; gap: 14px;
  }
  .sym-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-3), var(--rule));
    display: flex; align-items: center; justify-content: center;
    font-family: var(--mono); font-weight: 700; font-size: 13px;
    color: var(--mint);
  }
  .sym-text {
    display: flex; align-items: baseline; gap: 10px;
    min-width: 0; flex: 1;
  }
  .sym-text .pair { font-family: var(--mono); font-weight: 700; font-size: 20px; color: var(--ink); letter-spacing: 0.02em; flex-shrink: 0; }
  .sym-text .usd { color: var(--ink-mute); font-weight: 400; }
  .sym-text .full {
    font-size: 13px; color: var(--ink-soft);
    min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .sym-text .star { font-size: 11px; color: var(--ink-mute); margin-left: 8px; flex-shrink: 0; }
  .sym-text .star:hover { color: var(--gold); cursor: pointer; }
  /* Mobile — stack pair above truncated full-name. Avoids the 3-line
     wrap on long names like codecrafters-io/build-your-own-x. */
  @media (max-width: 600px) {
    .sym-text { flex-direction: column; align-items: flex-start; gap: 2px; }
    .sym-text .full { max-width: 100%; }
  }

  .sym-stats {
    display: grid;
    grid-template-columns: auto auto auto auto auto auto;
    gap: 28px;
    font-family: var(--mono);
    font-size: 12px;
  }
  .sym-stat .k { color: var(--ink-mute); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; }
  .sym-stat .v { color: var(--ink); font-weight: 500; }
  .sym-stat .v.up { color: var(--up); }
  .sym-stat .v.down { color: var(--down); }
  /* LIVE TICK FLASH — topbar price element flashes on each tick.
     Mint glow on up tick, red glow on down. 600ms fade. */
  #s-price {
    transition: color 0.18s, text-shadow 0.18s;
  }
  #s-price.tick-up   { color: var(--up);   text-shadow: 0 0 8px rgba(14,203,129,0.5); animation: tick-flash-up 0.6s ease-out; }
  #s-price.tick-down { color: var(--down); text-shadow: 0 0 8px rgba(246,70,93,0.5); animation: tick-flash-down 0.6s ease-out; }
  @keyframes tick-flash-up {
    0%   { background: rgba(14,203,129,0.18); }
    100% { background: transparent; }
  }
  @keyframes tick-flash-down {
    0%   { background: rgba(246,70,93,0.18); }
    100% { background: transparent; }
  }
  .sym-stat .price-big {
    font-size: 20px; font-weight: 700; line-height: 1;
    transition: background 0.08s ease-out;
    padding: 2px 6px; margin: -2px -6px; border-radius: 3px;
  }
  .sym-stat .price-big.flash-up {
    background: rgba(14, 203, 129, 0.22);
    animation: flashFadeUp 600ms ease-out forwards;
  }
  .sym-stat .price-big.flash-down {
    background: rgba(246, 70, 93, 0.22);
    animation: flashFadeDown 600ms ease-out forwards;
  }
  @keyframes flashFadeUp {
    0% { background: rgba(14, 203, 129, 0.34); }
    100% { background: transparent; }
  }
  @keyframes flashFadeDown {
    0% { background: rgba(246, 70, 93, 0.34); }
    100% { background: transparent; }
  }

  .sym-actions {
    display: flex; gap: 8px;
  }
  .sym-actions a {
    font-family: var(--mono); font-size: 11px;
    padding: 7px 12px; border: 1px solid var(--rule); border-radius: 4px;
    color: var(--ink-mute); letter-spacing: 0.05em; text-transform: uppercase;
    transition: all 0.12s;
  }
  .sym-actions a:hover { border-color: var(--mint); color: var(--mint); }

  /* TRADING LAYOUT — Binance/Bybit 3-column */
  .trade-layout {
    display: grid;
    grid-template-columns: 1fr 320px 340px;
    gap: 0;
    min-height: 680px;
    max-width: 1600px; margin: 0 auto;
    border-bottom: 1px solid var(--rule);
  }

  .col-chart {
    background: var(--bg); border-right: 1px solid var(--rule);
    display: flex; flex-direction: column;
    /* Grid items default to min-width:auto (= content size). On narrow
       viewports the .chart-bar's wide content (TF + indicators + LIVE pill)
       made .col-chart grow past the 1fr track, defeating its overflow-x
       scroll. min-width:0 lets the grid track contain it. */
    min-width: 0;
  }
  .col-orderbook {
    background: var(--bg); border-right: 1px solid var(--rule);
    padding: 16px;
    overflow-y: auto;
  }
  .col-trade {
    background: var(--bg);
    padding: 20px;
  }

  /* Chart tabs */
  .chart-bar {
    display: flex; align-items: center; gap: 2px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--rule);
    background: var(--bg-1);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .chart-bar::-webkit-scrollbar { display: none; }
  /* Mobile: tighten + ensure all chart bar items remain visible via scroll.
     WCAG 2.5.5: bump min-height to 44px on touch (was 28px). Width can be
     narrower because chart-bar already scrolls horizontally. */
  @media (max-width: 600px) {
    .chart-bar { padding: 6px 8px; gap: 1px; }
    .chart-bar .chart-tab { padding: 12px 10px; font-size: 11px; min-height: 44px; }
    .chart-bar .chart-ind { padding: 12px 8px; font-size: 10px; margin-right: 2px; min-height: 44px; }
    .chart-bar .chart-type { padding: 12px 8px; font-size: 10px; margin-right: 2px; min-height: 44px; }
    .chart-bar .chart-live { padding: 3px 7px; font-size: 9px; gap: 4px; }
    .chart-bar .chart-live .cl-cdlabel { display: none; }
    .chart-bar .spacer { display: none; }
    /* No sticky on mobile — sticky + left-fade box-shadow covers the
       BB / CANDLES buttons that sit just before LIVE in the row.
       Founder caught this 2026-04-27: "live zaslania opcje charts".
       Let LIVE scroll naturally with the rest of the row; user sees
       it by horizontal-scrolling to the end. */
  }
  .chart-tab {
    background: transparent; border: none;
    color: var(--ink-mute); font-family: var(--mono);
    font-size: 11px; font-weight: 500;
    padding: 7px 12px; cursor: pointer;
    letter-spacing: 0.05em; text-transform: uppercase;
    border-radius: 4px;
    transition: all 0.12s;
  }
  .chart-tab.active { color: var(--mint); background: var(--mint-soft); }
  .chart-tab:hover:not(.active) { color: var(--ink); }
  .chart-bar .spacer { flex: 1; }
  .chart-ind {
    background: transparent; border: 1px solid var(--rule);
    color: var(--ink-mute); font-family: var(--mono);
    font-size: 10px; font-weight: 500;
    padding: 5px 9px; cursor: pointer;
    letter-spacing: 0.08em; text-transform: uppercase;
    border-radius: 3px;
    transition: all 0.1s;
    margin-right: 4px;
  }
  .chart-ind:hover { color: var(--ink); border-color: var(--ink-mute); }
  .chart-ind[data-ind="ma20"].active { color: var(--mint); border-color: var(--mint); background: var(--mint-soft); }
  .chart-ind[data-ind="ma50"].active { color: var(--gold); border-color: var(--gold); background: rgba(252,213,53,0.08); }
  .chart-ind[data-ind="boll"].active { color: #8a93a5; border-color: #8a93a5; background: rgba(138,147,165,0.08); }
  /* LIVE indicator z pulse + countdown — at right of chart bar.
     Shows market is refreshing (live ticks every 3s, full reload 30s). */
  .chart-live {
    display: inline-flex; align-items: center; gap: 6px;
    margin-left: 8px;
    padding: 4px 10px;
    border: 1px solid var(--mint);
    background: var(--mint-soft);
    color: var(--mint);
    font-family: var(--mono);
    font-size: 10px; font-weight: 600;
    letter-spacing: 0.12em; text-transform: uppercase;
    border-radius: 12px;
    cursor: default;
  }
  .chart-live .cl-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 0 0 var(--mint);
    animation: chart-live-pulse 1.6s ease-in-out infinite;
  }
  @keyframes chart-live-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0,229,160,0.55); opacity: 1; }
    50% { box-shadow: 0 0 0 6px rgba(0,229,160,0); opacity: 0.6; }
  }
  .chart-live .cl-sep { color: var(--ink-faint); font-weight: 400; opacity: 0.5; }
  .chart-live .cl-cdlabel { color: var(--ink-mute); font-weight: 400; font-size: 9px; }
  .chart-live .cl-cd {
    color: var(--ink); font-weight: 600;
    margin-left: 2px;
    min-width: 36px; text-align: right;
    font-variant-numeric: tabular-nums;
  }
  .chart-live.refreshing { background: rgba(252,213,53,0.12); border-color: var(--gold); color: var(--gold); }
  .chart-live.refreshing .cl-dot { background: var(--gold); }
  .chart-live.imminent { animation: chart-live-imminent 0.5s ease-in-out infinite alternate; }
  @keyframes chart-live-imminent {
    from { box-shadow: 0 0 0 0 rgba(0,229,160,0); }
    to   { box-shadow: 0 0 0 4px rgba(0,229,160,0.3); }
  }
  .chart-type {
    background: transparent;
    border: 1px solid var(--rule);
    cursor: pointer;
    transition: all 0.12s;
    text-transform: uppercase;
    font-weight: 500;
    border-radius: 3px;
    margin-right: 4px;
    font-family: var(--mono); font-size: 10px;
    color: var(--ink-mute); padding: 4px 10px;
    border: 1px solid var(--rule); border-radius: 3px;
    letter-spacing: 0.08em; text-transform: uppercase;
  }

  .chart-canvas {
    flex: 1;
    min-height: 460px;
    position: relative;
    background: var(--bg);
  }
  .chart-canvas .loading {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--ink-mute); font-family: var(--mono); font-size: 12px;
  }
  /* Commit activity heatmap — GitHub-style */
  .commit-heat {
    padding: 14px 16px; border-top: 1px solid var(--rule);
    background: var(--bg-1);
    font-family: var(--mono);
    /* Reserve space matching FINAL rendered height so chart-canvas
       (flex:1 above) doesn't shrink when async load fills cells.
       Measured 2026-04-26: real height ~160px (header 24 + 7 rows ×
       10px + gaps 12 + padding 28 + legend 16). Set 170 for safety
       margin. Round 18 follow-up — was 108, caused 52px reflow into
       chart-canvas → CLS 0.13 on /repo/{T}. */
    min-height: 170px;
  }
  .commit-heat .hd {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 10px; color: var(--ink-mute);
    letter-spacing: 0.1em; text-transform: uppercase;
    margin-bottom: 10px;
  }
  .commit-heat .hd .lbl { color: var(--mint); font-weight: 500; }
  .commit-heat .hd .sum { color: var(--ink); font-variant-numeric: tabular-nums; }
  .commit-heat .grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: 10px;
    gap: 2px;
  }
  .commit-heat .grid .cell {
    background: #0f1114; border-radius: 2px;
    transition: background 0.2s;
  }
  .commit-heat .grid .cell.l1 { background: rgba(14, 203, 129, 0.2); }
  .commit-heat .grid .cell.l2 { background: rgba(14, 203, 129, 0.42); }
  .commit-heat .grid .cell.l3 { background: rgba(14, 203, 129, 0.65); }
  .commit-heat .grid .cell.l4 { background: #0ecb81; }
  .commit-heat .legend {
    display: flex; align-items: center; gap: 4px;
    font-size: 9px; color: var(--ink-mute);
    margin-top: 10px; justify-content: flex-end;
  }
  .commit-heat .legend .sq {
    width: 10px; height: 10px; border-radius: 2px; display: inline-block;
  }
  .commit-heat .legend .sq.l0 { background: #0f1114; }
  .commit-heat .legend .sq.l1 { background: rgba(14, 203, 129, 0.2); }
  .commit-heat .legend .sq.l2 { background: rgba(14, 203, 129, 0.42); }
  .commit-heat .legend .sq.l3 { background: rgba(14, 203, 129, 0.65); }
  .commit-heat .legend .sq.l4 { background: #0ecb81; }

  /* OHLC legend overlay (Binance/Hyperliquid style — top-left of chart) */
  .chart-legend {
    position: absolute; top: 10px; left: 14px; z-index: 3;
    display: flex; flex-wrap: wrap; gap: 14px;
    font-family: var(--mono); font-size: 11px;
    pointer-events: none; letter-spacing: 0.02em;
  }
  .chart-legend .lg-pair {
    color: var(--ink); font-weight: 600; font-size: 12px;
    padding-right: 6px; border-right: 1px solid var(--rule);
    margin-right: 2px;
  }
  .chart-legend .k { color: var(--ink-mute); margin-right: 4px; }
  .chart-legend .v { color: var(--ink); font-variant-numeric: tabular-nums; }
  .chart-legend .v.up { color: var(--up); }
  .chart-legend .v.down { color: var(--down); }
  .chart-watermark {
    position: absolute; right: 18px; bottom: 44px; z-index: 1;
    font-family: var(--font); font-size: 64px; font-weight: 800;
    color: rgba(234, 236, 239, 0.03); letter-spacing: -0.02em;
    pointer-events: none; user-select: none;
  }
  .chart-stats {
    position: absolute; right: 14px; top: 10px; z-index: 3;
    display: flex; gap: 14px;
    font-family: var(--mono); font-size: 11px;
    pointer-events: none;
  }
  .chart-stats .k { color: var(--ink-mute); margin-right: 4px; }
  .chart-stats .v { color: var(--ink); font-variant-numeric: tabular-nums; }
  .chart-stats .v.up { color: var(--up); }
  .chart-stats .v.down { color: var(--down); }
  @media (max-width: 1180px) {
    /* On tablet (portrait + landscape) + mobile: hide .chart-stats (24h
       H/L/%) — it collides with .chart-legend's right edge (both absolute
       @ top:10). Symbol-bar above chart already shows 24H HIGH/LOW.
       Founder report 2026-04-25 (768px): "Δ +4.98%24hVol" overlap.
       Promoted to 1100px after 1024 landscape verification. */
    .chart-stats { display: none; }
  }
  @media (max-width: 900px) {
    .chart-legend { font-size: 10px; gap: 8px; }
  }

  /* ORDER BOOK */
  .ob-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px;
  }
  .ob-head h3 {
    font-family: var(--mono); font-size: 11px; color: var(--mint);
    letter-spacing: 0.15em; text-transform: uppercase; font-weight: 500;
  }
  .ob-head .precision { font-family: var(--mono); font-size: 10px; color: var(--ink-mute); }

  .ob-cols {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    font-family: var(--mono); font-size: 10px;
    color: var(--ink-mute);
    padding: 6px 0 8px;
    border-bottom: 1px solid var(--rule-soft);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  .ob-cols .right { text-align: right; }

  .ob-list {
    font-family: var(--mono); font-size: 12px;
    /* CLS guard: 11 rows × ~22px (.ob-row padding 7 + content 15px) = 242.
       Reserve 250 so async orderbook fetch doesn't expand col-orderbook
       which would expand the grid → all 3 cols stretch → chart-canvas
       (flex:1 in col-chart) reflows. Round 18 follow-up — was the real
       cause of /repo/{T} CLS 0.13 (commit-heat was a symptom, not source). */
    min-height: 250px;
  }
  .ob-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 3.5px 0;
    position: relative;
    cursor: pointer;
    transition: background 0.1s;
  }
  .ob-row .bg {
    position: absolute; right: 0; top: 0; bottom: 0;
    opacity: 0.15;
    pointer-events: none;
  }
  .ob-row.ask .bg { background: var(--down); }
  .ob-row.bid .bg { background: var(--up); }
  .ob-row .p { text-align: left; position: relative; z-index: 1; }
  .ob-row.ask .p { color: var(--down); }
  .ob-row.bid .p { color: var(--up); }
  .ob-row .q { text-align: right; color: var(--ink-soft); position: relative; z-index: 1; }
  .ob-row .t { text-align: right; color: var(--ink-mute); position: relative; z-index: 1; }
  .ob-row:hover { background: var(--bg-2); }

  .ob-depth {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--rule);
  }
  .ob-depth .hd {
    display: flex; justify-content: space-between; align-items: center;
    font-family: var(--mono); font-size: 10px; color: var(--ink-mute);
    letter-spacing: 0.12em; text-transform: uppercase;
    margin-bottom: 8px;
  }
  .ob-depth .hd h4 { color: var(--mint); font-weight: 500; font-size: 11px; }
  .ob-depth .wall { color: var(--ink); font-variant-numeric: tabular-nums; }
  .ob-depth svg { width: 100%; height: 110px; display: block; }
  .ob-depth .legend {
    display: flex; justify-content: space-between;
    font-family: var(--mono); font-size: 10px; color: var(--ink-mute);
    margin-top: 6px;
  }
  .ob-depth .legend .bid { color: var(--up); }
  .ob-depth .legend .ask { color: var(--down); }

  .ob-spread {
    margin: 8px 0;
    padding: 12px 0;
    border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
    display: flex; justify-content: space-between; align-items: center;
    font-family: var(--mono); font-size: 13px;
  }
  .ob-spread .big { font-size: 16px; font-weight: 700; color: var(--ink); }
  .ob-spread .arrow { color: var(--mint); font-size: 13px; }
  .ob-spread .delta { color: var(--ink-mute); font-size: 11px; }

  /* TRADE PANEL */
  .trade-tabs {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 2px;
    padding: 3px;
    background: var(--bg-2);
    border-radius: 6px;
    margin-bottom: 18px;
  }
  .trade-tab {
    padding: 10px;
    font-size: 13px; font-weight: 700;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.12s;
    letter-spacing: 0.02em;
  }
  .trade-tab.active.buy { background: var(--up); color: #033d24; }
  .trade-tab.active.sell { background: var(--down); color: #3c0d14; }
  .trade-tab:not(.active) { color: var(--ink-mute); }
  .trade-tab:not(.active):hover { color: var(--ink); }

  .trade-section {
    margin-bottom: 16px;
  }
  .trade-label {
    font-family: var(--mono); font-size: 10px;
    color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.1em;
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 6px;
  }
  .trade-label .right { color: var(--ink-soft); }
  .trade-label .right b { color: var(--ink); font-weight: 500; }

  .trade-input-wrap {
    display: flex; align-items: center;
    background: var(--bg-2);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 0 12px;
    transition: border-color 0.12s;
  }
  .trade-input-wrap:focus-within { border-color: var(--mint); }
  .trade-input-wrap input {
    flex: 1; background: transparent; border: none;
    font-family: var(--mono); font-size: 15px; color: var(--ink);
    padding: 11px 0;
    font-weight: 500;
  }
  .trade-input-wrap input:focus { outline: none; }
  .trade-input-wrap .unit {
    font-family: var(--mono); font-size: 12px; color: var(--ink-mute); font-weight: 500;
  }
  .trade-input-wrap .max {
    font-family: var(--mono); font-size: 10px; color: var(--mint);
    padding: 2px 6px; border: 1px solid var(--rule); border-radius: 2px;
    cursor: pointer; margin-left: 8px;
    text-transform: uppercase; letter-spacing: 0.05em;
  }
  .trade-input-wrap .max:hover { background: var(--mint-soft); }

  .quick-usd {
    display: grid;
    grid-template-columns: auto repeat(4, 1fr);
    gap: 6px;
    align-items: center;
    margin-top: 10px;
  }
  .quick-usd .quick-label {
    font-family: var(--mono); font-size: 9px; color: var(--gold);
    letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700;
    padding-right: 6px;
  }
  .quick-usd button {
    font-family: var(--mono); font-size: 11px; font-weight: 600;
    padding: 8px 0; border-radius: 4px; cursor: pointer;
    background: var(--bg-2); border: 1px solid var(--rule);
    color: var(--ink); letter-spacing: 0.04em;
    transition: all 0.12s;
  }
  .quick-usd button:hover {
    background: var(--gold); color: var(--bg); border-color: var(--gold);
    transform: translateY(-1px);
  }
  @media (max-width: 540px) {
    .quick-usd { grid-template-columns: repeat(4, 1fr); }
    .quick-usd .quick-label { grid-column: 1 / -1; }
  }

  .trade-slider {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-top: 8px;
  }
  .trade-slider button {
    padding: 6px;
    background: var(--bg-2);
    border: 1px solid var(--rule);
    color: var(--ink-mute);
    font-family: var(--mono); font-size: 11px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.12s;
  }
  .trade-slider button:hover, .trade-slider button.active {
    border-color: var(--mint); color: var(--mint);
  }

  .trade-summary {
    padding: 12px 0;
    border-top: 1px solid var(--rule);
    margin-top: 14px;
    font-family: var(--mono); font-size: 12px;
  }
  .trade-summary .row {
    display: flex; justify-content: space-between;
    padding: 4px 0;
  }
  .trade-summary .row .k { color: var(--ink-mute); }
  .trade-summary .row .v { color: var(--ink); font-weight: 500; }
  .trade-summary .row.total .v { font-size: 14px; color: var(--ink); font-weight: 700; }

  .trade-cta {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 4px;
    font-family: var(--font); font-size: 14px; font-weight: 700;
    cursor: pointer;
    margin-top: 14px;
    letter-spacing: 0.02em;
    transition: all 0.12s;
  }
  .trade-cta.buy { background: var(--up); color: #033d24; }
  .trade-cta.buy:hover { background: #12dd8f; }
  .trade-cta.sell { background: var(--down); color: #3c0d14; }
  .trade-cta.sell:hover { background: #ff5f75; }

  .impact-viz {
    display: none;
    margin-top: 14px;
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 10px 12px;
    background: var(--bg-1);
  }
  .impact-viz.visible { display: block; }
  .impact-viz .hd {
    display: flex; justify-content: space-between; align-items: center;
    font-family: var(--mono); font-size: 10px; color: var(--ink-mute);
    letter-spacing: 0.08em; text-transform: uppercase;
    margin-bottom: 8px;
  }
  .impact-viz .hd .slip { color: var(--ink); font-weight: 600; }
  .impact-viz .hd .slip.up { color: var(--up); }
  .impact-viz .hd .slip.down { color: var(--down); }
  .impact-viz svg { width: 100%; height: 60px; display: block; }
  .impact-viz .lg {
    display: flex; justify-content: space-between;
    font-family: var(--mono); font-size: 10px; color: var(--ink-mute);
    margin-top: 6px;
  }
  .impact-viz .lg .mid { color: var(--ink); }
  .impact-viz .lg .fill { color: var(--ink); font-weight: 600; }

  .trade-quote-result {
    background: var(--bg-2);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 10px 12px;
    margin-top: 10px;
    display: none;
    font-family: var(--mono); font-size: 11px;
    color: var(--ink-soft);
  }
  .trade-quote-result.visible { display: block; }
  .trade-quote-result .row { display: flex; justify-content: space-between; padding: 2px 0; }
  .trade-quote-result .row.final { border-top: 1px solid var(--rule); padding-top: 6px; margin-top: 4px; color: var(--ink); font-weight: 700; }

  /* BELOW-CHART PANELS: recent trades + metrics + stats */
  .below-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 0;
    border-bottom: 1px solid var(--rule);
    max-width: 1600px; margin: 0 auto;
    /* CLS guard: reserve vertical space for "Repository metrics" + "About"
       + "Recent activity" panels which fetch + render async (~430px when
       hydrated). Prevents commit-heat / col-chart shifts when the panels
       finally appear. */
    min-height: 430px;
  }

  .panel-section {
    padding: 20px;
    border-right: 1px solid var(--rule);
  }
  .panel-section:last-child { border-right: none; }
  .panel-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--rule);
  }
  .panel-head h3 {
    font-family: var(--mono); font-size: 11px; color: var(--mint);
    letter-spacing: 0.15em; text-transform: uppercase; font-weight: 500;
  }
  .panel-tabs {
    display: flex; gap: 16px;
  }
  .panel-tab {
    font-family: var(--mono); font-size: 11px;
    color: var(--ink-mute); background: transparent; border: none;
    padding: 0; cursor: pointer;
    letter-spacing: 0.05em; text-transform: uppercase;
    transition: color 0.12s;
  }
  .panel-tab.active { color: var(--ink); }
  .panel-tab:hover:not(.active) { color: var(--ink-soft); }

  /* METRICS GRID */
  .metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
  }
  .metric {
    padding: 14px 16px;
    border-right: 1px solid var(--rule-soft);
    border-bottom: 1px solid var(--rule-soft);
  }
  .metric:nth-child(4n) { border-right: none; }
  .metric:nth-last-child(-n+4) { border-bottom: none; }
  .metric .l {
    font-family: var(--mono); font-size: 10px; color: var(--ink-mute);
    text-transform: uppercase; letter-spacing: 0.1em;
  }
  .metric .v {
    font-family: var(--mono); font-size: 18px; color: var(--ink);
    font-weight: 600; margin-top: 6px; line-height: 1.1;
  }
  .metric .v.up { color: var(--up); }
  .metric .sub {
    font-family: var(--mono); font-size: 10px; color: var(--ink-faint); margin-top: 3px;
  }

  /* RECENT TRADES */
  .trades-cols {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    font-family: var(--mono); font-size: 10px;
    color: var(--ink-mute);
    padding: 6px 0 10px;
    border-bottom: 1px solid var(--rule-soft);
    text-transform: uppercase; letter-spacing: 0.05em;
  }
  .trades-cols .right { text-align: right; }
  .trades-list {
    font-family: var(--mono); font-size: 12px;
    max-height: 320px;
    overflow-y: auto;
  }
  .trade-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 4px 0;
    transition: background 0.1s;
  }
  .trade-row:hover { background: var(--bg-2); }
  .trade-row .p { color: var(--up); }
  .trade-row .p.p2p { color: var(--signal, #5aa9ff); }
  .trade-row .q { text-align: right; color: var(--ink-soft); }
  .trade-row .t { text-align: right; color: var(--ink-mute); }

  /* REPO DETAILS */
  .repo-details {
    padding: 20px;
    background: var(--bg-1);
    border-bottom: 1px solid var(--rule);
  }
  .details-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 40px;
    max-width: 1600px; margin: 0 auto;
  }
  .details-grid h3 {
    font-family: var(--mono); font-size: 11px; color: var(--mint);
    letter-spacing: 0.15em; text-transform: uppercase; font-weight: 500;
    margin-bottom: 14px;
  }
  .details-grid p {
    color: var(--ink-soft);
    max-width: 60em;
    margin-bottom: 16px;
  }
  .topics { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
  .topic {
    font-family: var(--mono); font-size: 11px;
    border: 1px solid var(--rule); padding: 4px 10px;
    border-radius: 2px;
    color: var(--ink-soft);
    transition: all 0.12s;
  }
  .topic:hover { border-color: var(--mint); color: var(--mint); }
  .details-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
  .details-link {
    font-family: var(--mono); font-size: 11px;
    padding: 6px 12px; border: 1px solid var(--rule); border-radius: 3px;
    color: var(--ink-soft);
    display: inline-flex; align-items: center; gap: 6px;
    transition: all 0.12s;
    letter-spacing: 0.03em;
  }
  .details-link:hover { border-color: var(--mint); color: var(--mint); }

  .details-side {
    border-left: 1px solid var(--rule);
    padding-left: 40px;
  }
  .details-side dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px 20px;
    font-family: var(--mono); font-size: 12px;
  }
  .details-side dt { color: var(--ink-mute); text-transform: uppercase; font-size: 10px; letter-spacing: 0.1em; }
  .details-side dd { color: var(--ink); text-align: right; font-weight: 500; }

  .similar-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
  .similar-row {
    display: grid;
    grid-template-columns: 72px 1fr 62px;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid var(--rule); border-radius: 4px;
    background: var(--bg-1);
    text-decoration: none; color: inherit;
    transition: border-color 0.12s, background 0.12s;
  }
  .similar-row:hover { border-color: var(--mint); background: var(--bg-2); }
  .similar-row .tk {
    font-family: var(--mono); font-size: 11px; color: var(--mint);
    font-weight: 600; letter-spacing: 0.04em;
  }
  .similar-row .nm {
    font-family: var(--font); font-size: 12px; color: var(--ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    min-width: 0;
  }
  .similar-row .ch {
    font-family: var(--mono); font-size: 11px; text-align: right;
    font-variant-numeric: tabular-nums; font-weight: 500;
  }
  .similar-row .ch.up { color: var(--up); }
  .similar-row .ch.down { color: var(--down); }
  .similar-placeholder {
    padding: 14px 0; font-family: var(--mono); font-size: 11px;
    color: var(--ink-mute); text-align: center;
  }

  /* FOOTER */
  .footer {
    background: var(--bg); border-top: 1px solid var(--rule);
    padding: 24px 0; color: var(--ink-mute); font-size: 12px;
    font-family: var(--mono);
  }
  .footer-inner {
    display: flex; justify-content: space-between; align-items: center;
    max-width: 1600px; margin: 0 auto; padding: 0 20px; gap: 20px;
  }
  .footer-inner a { color: var(--ink-soft); }
  .footer-inner a:hover { color: var(--mint); }

  /* RESPONSIVE */
  @media (max-width: 1200px) {
    .trade-layout { grid-template-columns: 1fr 300px; }
    .col-orderbook { display: none; }
  }
  /* Tablet landscape (901-1100): sym-actions still overflows the grid
     because sym-id + sym-stats(6) + 4 actions ≈ 1214px min content.
     Hide sym-actions early so symbol-bar fits cleanly under 1100px. */
  @media (max-width: 1180px) {
    .sym-actions { display: none; }
  }
  @media (max-width: 900px) {
    .trade-layout { grid-template-columns: 1fr; }
    .col-chart { border-right: none; border-bottom: 1px solid var(--rule); }
    .col-trade { border-top: 1px solid var(--rule); }
    .below-layout { grid-template-columns: 1fr; }
    .panel-section { border-right: none; border-bottom: 1px solid var(--rule); }
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .metric:nth-child(4n) { border-right: 1px solid var(--rule-soft); }
    .metric:nth-child(2n) { border-right: none; }
    .sym-stats { grid-template-columns: repeat(3, 1fr); gap: 16px; }
    .details-grid { grid-template-columns: 1fr; gap: 24px; }
    .details-side { border-left: none; border-top: 1px solid var(--rule); padding-left: 0; padding-top: 24px; }
    .nav-main { display: none; }
  }
  @media (max-width: 600px) {
    .symbol-bar { grid-template-columns: 1fr; gap: 16px; }
    .sym-stats { grid-template-columns: repeat(2, 1fr); }
    .chart-canvas { min-height: 340px; }
    .chart-legend { font-size: 9px; gap: 6px; flex-wrap: wrap; }
    .chart-legend .lg-pair { font-size: 11px; }
    .commit-heat { padding: 10px 12px; }
    .commit-heat .grid { grid-auto-rows: 8px; gap: 1.5px; }
    .ob-depth svg { height: 88px; }
  }
