:root {
  --bg: #0d1117;
  --card: #161b22;
  --line: #30363d;
  --txt: #e6edf3;
  --muted: #7d8590;
  --green: #3fb950;
  --red: #f85149;
  --yellow: #d29922;
  --accent: #58a6ff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--txt);
  font-size: 16px;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto auto 1fr;
  gap: 12px;
  padding: 12px;
  height: 100vh;
  grid-template-areas:
    "header header header"
    "price bounds today"
    "chart chart log"
    "chart chart log";
}
.bar {
  grid-area: header;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 18px;
}
.brand { font-size: 28px; font-weight: 800; letter-spacing: 2px; }
.brand .sub { color: var(--muted); font-weight: 400; font-size: 18px; margin-left: 8px; }
.clock { font-family: ui-monospace, monospace; font-size: 24px; color: var(--muted); }
.next-tick { text-align: right; }
.next-tick .lbl { font-size: 11px; color: var(--muted); letter-spacing: 1.5px; }
.watch {
  font-family: ui-monospace, monospace;
  font-size: 36px;
  font-weight: 700;
  color: var(--yellow);
  line-height: 1;
}
.watch.imminent { color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .5; } }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  overflow: hidden;
}
.lbl { font-size: 11px; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; }
.big { font-size: 56px; font-weight: 800; font-family: ui-monospace, monospace; line-height: 1.1; margin: 6px 0; }
.num { font-family: ui-monospace, monospace; font-weight: 600; }
.small { font-size: 14px; }
.row { display: flex; gap: 16px; align-items: center; margin-top: 6px; }
.row.between { justify-content: space-between; }
.dist { color: var(--muted); font-family: ui-monospace, monospace; font-size: 13px; }

.price { grid-area: price; }
.bounds { grid-area: bounds; }
.today { grid-area: today; }
.chart-card { grid-area: chart; display: flex; flex-direction: column; }
#chart { flex: 1; min-height: 300px; }
.log { grid-area: log; overflow-y: auto; }

.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  background: var(--line);
}
.pill.long { background: var(--green); color: #000; }
.pill.short { background: var(--red); color: #fff; }

.bounds .vwap { border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); padding: 6px 0; }

#signal-log .entry {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-family: ui-monospace, monospace;
}
#signal-log .entry.ENTRY { color: var(--accent); }
#signal-log .entry.EXIT { color: var(--muted); }
#signal-log .entry .pnl-pos { color: var(--green); }
#signal-log .entry .pnl-neg { color: var(--red); }
