:root {
  color-scheme: dark;
  --bg: #07100f;
  --panel: rgba(13, 27, 25, 0.86);
  --panel-2: rgba(18, 37, 34, 0.72);
  --line: rgba(155, 207, 190, 0.15);
  --text: #edf8f3;
  --muted: #8da8a0;
  --mint: #66e2b3;
  --cyan: #65c7e8;
  --amber: #f2c66d;
  --coral: #f17f6f;
  --violet: #ab94f4;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body {
  background:
    radial-gradient(circle at 15% -10%, rgba(48, 151, 122, .18), transparent 30rem),
    radial-gradient(circle at 92% 10%, rgba(73, 117, 145, .14), transparent 34rem),
    var(--bg);
}
button, input { font: inherit; }

.shell { width: min(1760px, 100%); margin: 0 auto; padding: 28px 30px 48px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.eyebrow { color: var(--mint); text-transform: uppercase; letter-spacing: .16em; font-size: 11px; font-weight: 750; }
h1 { margin: 5px 0 4px; font-size: clamp(28px, 4vw, 44px); line-height: 1; letter-spacing: -.045em; }
.subtitle { color: var(--muted); font-size: 13px; }
.controls { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.symbol-input { width: 138px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: rgba(0,0,0,.2); color: var(--text); text-transform: uppercase; outline: none; }
.symbol-input:focus { border-color: rgba(102,226,179,.55); box-shadow: 0 0 0 3px rgba(102,226,179,.08); }
.button { cursor: pointer; border: 1px solid rgba(102,226,179,.35); border-radius: 10px; padding: 10px 14px; color: #06110d; background: var(--mint); font-weight: 760; }
.button:hover { filter: brightness(1.08); }
.status { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; min-width: 136px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px currentColor; }
.status.live .status-dot { background: var(--mint); }

.metrics { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 10px; margin-bottom: 12px; }
.metric, .panel { border: 1px solid var(--line); background: linear-gradient(145deg, var(--panel), rgba(8,17,16,.92)); box-shadow: 0 20px 50px rgba(0,0,0,.18); }
.metric { border-radius: 12px; padding: 13px 15px; min-height: 76px; }
.metric-label { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .11em; }
.metric-value { margin-top: 7px; font-size: 18px; font-variant-numeric: tabular-nums; font-weight: 680; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-value.small { font-size: 13px; color: var(--mint); }

.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; }
.panel { border-radius: 14px; padding: 16px; min-width: 0; overflow: hidden; }
.panel h2 { margin: 0; font-size: 15px; letter-spacing: -.01em; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.panel-note { color: var(--muted); font-size: 11px; }
.candles { grid-column: span 6; }
.ticks { grid-column: span 6; }
.ndf-main { grid-column: span 8; }
.lattice { grid-column: span 4; }
.compare { grid-column: span 12; }
.chart { width: 100%; height: 260px; display: block; border-radius: 8px; background: rgba(1,8,7,.34); }
.compare .chart { height: 210px; }
.grid-line { stroke: rgba(170,220,205,.09); stroke-width: 1; vector-effect: non-scaling-stroke; }
.axis-label { fill: #78948c; font-size: 11px; }
.line { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.legend { display: flex; flex-wrap: wrap; gap: 13px; color: var(--muted); font-size: 11px; }
.key { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 16px; height: 2px; border-radius: 2px; }
.empty { fill: #718c84; font-size: 14px; text-anchor: middle; }

.scale-list { display: grid; gap: 8px; margin-top: 14px; }
.scale-row { display: grid; grid-template-columns: 28px 62px 1fr 34px; align-items: center; gap: 8px; font-size: 11px; font-variant-numeric: tabular-nums; }
.scale-id { color: var(--muted); }
.scale-period { color: #bfd2cc; }
.energy-track { height: 7px; background: rgba(255,255,255,.06); border-radius: 10px; overflow: hidden; }
.energy-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--mint)); }
.basin { text-align: right; color: var(--amber); }
.readout { margin-top: 14px; padding: 12px; border-radius: 10px; background: var(--panel-2); color: var(--muted); font-size: 11px; line-height: 1.5; }
.footer { color: #667f78; font-size: 11px; margin-top: 15px; display: flex; justify-content: space-between; gap: 20px; }

@media (max-width: 980px) {
  .shell { padding: 20px 16px 36px; }
  .topbar { flex-direction: column; }
  .controls { justify-content: flex-start; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .candles, .ticks, .ndf-main, .lattice, .compare { grid-column: span 12; }
}

@media (max-width: 560px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric:last-child { grid-column: span 2; }
  .chart { height: 220px; }
  .controls { width: 100%; }
  .symbol-input { flex: 1; }
  .footer { flex-direction: column; }
}

