:root {
  --bg: #06080d;
  --panel: #0b0f17;
  --edge: #1a2130;
  --text: #cfd6e4;
  --muted: #5b6577;
  --green: #26a69a;
  --bright-green: #00e676;
  --red: #ef5350;
  --blue: #4f7cff;
  --orange: #ffa726;
  --yellow: #ffd54f;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 13px; height: 100vh; display: flex; flex-direction: column;
  overflow: hidden;
}

#topbar {
  display: flex; gap: 8px; padding: 8px 12px; align-items: stretch;
  border-bottom: 1px solid var(--edge); flex-wrap: wrap;
}
.tile {
  background: var(--panel); border: 1px solid var(--edge); border-radius: 6px;
  padding: 6px 12px; min-width: 110px;
}
.tile label { display: block; font-size: 9px; letter-spacing: .12em; color: var(--muted); }
.tile b { font-size: 15px; font-weight: 600; }
.tile.brand { display: flex; align-items: center; font-weight: 700; color: var(--yellow); }
.pos { color: var(--bright-green); }
.neg { color: var(--red); }
.warn { color: var(--orange); }

#layout { flex: 1; display: flex; min-height: 0; }
#charts { flex: 1; display: flex; flex-direction: column; position: relative; min-width: 0; }
#price-chart { flex: 1; min-height: 0; }

#callout {
  position: absolute; top: 14px; left: 14px; z-index: 10; max-width: 420px;
  background: rgba(11,15,23,.92); border: 1px solid var(--edge); border-left: 3px solid var(--orange);
  border-radius: 6px; padding: 10px 14px;
}
#callout.bull { border-left-color: var(--bright-green); }
#callout.bear { border-left-color: var(--red); }
#callout-title { font-weight: 700; letter-spacing: .06em; font-size: 12px; }
#callout p { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.hidden { display: none !important; }

#phases-legend {
  display: flex; gap: 18px; padding: 5px 14px; border-top: 1px solid var(--edge);
  font-size: 10px; letter-spacing: .08em; color: var(--muted);
}
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.dot.bull { background: var(--bright-green); }
.dot.cont { background: var(--blue); }
.dot.bear { background: var(--red); }
.dot.div { background: var(--orange); }

#sidebar {
  width: 320px; border-left: 1px solid var(--edge); overflow-y: auto;
  padding: 10px; display: flex; flex-direction: column; gap: 10px;
}
.panel { background: var(--panel); border: 1px solid var(--edge); border-radius: 8px; padding: 12px; }
.panel h3 { font-size: 10px; letter-spacing: .18em; color: var(--muted); margin-bottom: 8px; }

.verdict { font-size: 20px; font-weight: 800; letter-spacing: .04em; margin-bottom: 8px; }
.verdict small { font-size: 10px; color: var(--muted); font-weight: 400; margin-left: 8px; }

#matrix { width: 100%; border-collapse: collapse; }
#matrix td { padding: 6px 4px; border-top: 1px solid var(--edge); font-size: 11px; }
#matrix td:last-child { text-align: right; font-weight: 700; }

.kv { width: 100%; border-collapse: collapse; }
.kv td { padding: 5px 4px; border-top: 1px solid var(--edge); font-size: 11px; }
.kv td:last-child { text-align: right; font-weight: 600; }
#dmp-spark { width: 100%; margin-top: 8px; background: #070a10; border-radius: 4px; }

#session-select {
  width: 100%; background: #070a10; color: var(--text); border: 1px solid var(--edge);
  border-radius: 4px; padding: 6px; font-family: inherit; margin-bottom: 8px;
}
#scrub-row { display: flex; gap: 8px; align-items: center; }
#scrub { flex: 1; accent-color: var(--yellow); }
#live-btn {
  background: #070a10; color: var(--muted); border: 1px solid var(--edge);
  border-radius: 4px; padding: 4px 10px; font-family: inherit; font-size: 11px; cursor: pointer;
}
#live-btn.on { color: var(--bright-green); border-color: var(--bright-green); }
.muted { color: var(--muted); }
.small { font-size: 10px; margin-top: 6px; }

@media (max-width: 900px) {
  #layout { flex-direction: column; overflow-y: auto; }
  #charts { min-height: 460px; }
  #sidebar { width: 100%; border-left: none; border-top: 1px solid var(--edge); }
  body { overflow: auto; }
}
