/* Rift Scanner — v0.9.0 */
/* Multi-theme, unified table layout */

/* ── Theme: Midnight (default) ─────────────────────────────────────────── */
:root, [data-theme="midnight"] {
  --bg-base: #0a0a0f;
  --bg-card: #12121c;
  --bg-card-hover: #181828;
  --bg-header: #0e0e18;
  --bg-row: #10101a;
  --bg-row-hover: #16162a;
  --border: #1e1e2e;
  --border-glow: #2a2a3e;
  --text-primary: #e4e4ef;
  --text-secondary: #8888a0;
  --text-muted: #55556a;
  --accent-cyan: #22d3ee;
  --accent-green: #34d399;
  --accent-red: #f87171;
  --accent-orange: #fb923c;
  --accent-purple: #a78bfa;
  --accent-blue: #60a5fa;
  --accent-yellow: #fbbf24;
  --accent-emerald: #10b981;
  --accent-pink: #f472b6;
  --glow-cyan: rgba(34, 211, 238, 0.15);
  --glow-green: rgba(52, 211, 153, 0.15);
  --glow-red: rgba(248, 113, 113, 0.15);
  --logo-filter: none;
  --symbol-color: #7dd3fc;
  --panel-long-bg: rgba(52, 211, 153, 0.06);
  --panel-short-bg: rgba(248, 113, 113, 0.06);
}

/* ── Theme: Slate (CMC-inspired light grays) ───────────────────────────── */
[data-theme="slate"] {
  --bg-base: #f8f9fb;
  --bg-card: #ffffff;
  --bg-card-hover: #f3f4f6;
  --bg-header: #ffffff;
  --bg-row: #ffffff;
  --bg-row-hover: #f3f5f8;
  --border: #e5e7eb;
  --border-glow: #d1d5db;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --accent-cyan: #0891b2;
  --accent-green: #16a34a;
  --accent-red: #dc2626;
  --accent-orange: #ea580c;
  --accent-purple: #7c3aed;
  --accent-blue: #2563eb;
  --accent-yellow: #d97706;
  --accent-emerald: #059669;
  --accent-pink: #db2777;
  --glow-cyan: rgba(8, 145, 178, 0.08);
  --glow-green: rgba(22, 163, 74, 0.08);
  --glow-red: rgba(220, 38, 38, 0.08);
  --logo-filter: none;
  --symbol-color: #0284c7;
  --panel-long-bg: rgba(22, 163, 74, 0.04);
  --panel-short-bg: rgba(220, 38, 38, 0.04);
}

/* ── Theme: Dim (softer dark) ──────────────────────────────────────────── */
[data-theme="dim"] {
  --bg-base: #15202b;
  --bg-card: #1c2938;
  --bg-card-hover: #22303f;
  --bg-header: #192734;
  --bg-row: #1c2938;
  --bg-row-hover: #243447;
  --border: #2f3f50;
  --border-glow: #384d60;
  --text-primary: #d9e2ec;
  --text-secondary: #8899a6;
  --text-muted: #5e6e7c;
  --accent-cyan: #1da1f2;
  --accent-green: #00c781;
  --accent-red: #e74c5a;
  --accent-orange: #f59e0b;
  --accent-purple: #a78bfa;
  --accent-blue: #4da6ff;
  --accent-yellow: #eab308;
  --accent-emerald: #10b981;
  --accent-pink: #f472b6;
  --glow-cyan: rgba(29, 161, 242, 0.12);
  --glow-green: rgba(0, 199, 129, 0.12);
  --glow-red: rgba(231, 76, 90, 0.12);
  --logo-filter: none;
  --symbol-color: #5bb8f5;
  --panel-long-bg: rgba(0, 199, 129, 0.05);
  --panel-short-bg: rgba(231, 76, 90, 0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ───────────────────────────────────────────────────────────────── */

.header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left { display: flex; align-items: center; gap: 16px; }

.logo {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 3px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.version-badge {
  font-size: 10px; font-weight: 600; color: var(--text-muted);
  padding: 2px 6px; border: 1px solid var(--border); border-radius: 4px;
}

.badge-count {
  background: var(--accent-cyan); color: var(--bg-base);
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px;
}

.category-toggle {
  display: flex; gap: 2px;
  background: rgba(255, 255, 255, 0.04); border-radius: 6px; padding: 2px;
}

.cat-btn {
  background: none; border: none; color: var(--text-muted);
  font-size: 11px; font-weight: 600; padding: 4px 12px;
  border-radius: 4px; cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.cat-btn:hover { color: var(--text-secondary); background: rgba(255,255,255,0.04); }
.cat-btn.active { color: var(--bg-base); background: var(--accent-cyan); }

.header-right {
  display: flex; align-items: center; gap: 16px;
  font-size: 12px; color: var(--text-secondary);
}

.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; margin-right: 4px;
}
.status-dot.ok { background: var(--accent-green); }
.status-dot.error { background: var(--accent-red); }
.status-dot.loading { background: var(--accent-orange); animation: pulse-dot 1.5s infinite; }

@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.scan-info { display: flex; align-items: center; gap: 8px; }
.countdown { font-variant-numeric: tabular-nums; color: var(--text-muted); }

.scan-btn {
  background: rgba(34,211,238,0.1); border: 1px solid rgba(34,211,238,0.3);
  color: var(--accent-cyan); font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 4px; cursor: pointer;
  font-family: inherit; transition: all 0.15s;
}
.scan-btn:hover { background: rgba(34,211,238,0.2); border-color: var(--accent-cyan); }
.scan-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Volume Control ──────────────────────────────────────────────────────── */
.volume-control {
  display: flex; align-items: center; gap: 6px;
}
.volume-icon {
  cursor: pointer; font-size: 14px; user-select: none;
  opacity: 0.7; transition: opacity 0.15s;
}
.volume-icon:hover { opacity: 1; }
.volume-slider {
  -webkit-appearance: none; appearance: none;
  width: 60px; height: 3px; border-radius: 2px;
  background: rgba(255,255,255,0.15); outline: none;
  cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent-cyan); cursor: pointer;
  border: none; box-shadow: 0 0 4px rgba(34,211,238,0.3);
}
.volume-slider::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent-cyan); cursor: pointer;
  border: none;
}

/* ── Stats Bar ────────────────────────────────────────────────────────────── */

.stats-bar {
  display: flex; gap: 24px; padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text-secondary);
  background: rgba(14, 14, 24, 0.6);
}

.stat-item { display: flex; align-items: center; gap: 6px; }
.stat-value { color: var(--text-primary); font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-value.green { color: var(--accent-green); }
.stat-value.red { color: var(--accent-red); }

/* ── Table Container ──────────────────────────────────────────────────────── */

.tables-container {
  display: flex;
  flex-direction: column;
}

.table-panel {
  overflow-x: auto;
}

.panel-header {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 700; letter-spacing: 1px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), inset 0 -1px 0 rgba(0,0,0,0.2);
}

.panel-icon { font-size: 14px; }
.rift-header { background: rgba(34,211,238,0.06); color: var(--accent-cyan); }
.rift-header .panel-icon { color: var(--accent-cyan); }

.panel-count {
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 8px;
}
.rift-header .panel-count { background: rgba(34,211,238,0.2); color: var(--accent-cyan); }

.table-wrap { overflow-x: auto; }

.table-empty {
  text-align: center; padding: 40px 20px;
  color: var(--text-muted); font-size: 13px;
}

/* ── Table ────────────────────────────────────────────────────────────────── */

.rift-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}

.rift-table thead th {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 40%, transparent 60%, rgba(0,0,0,0.15) 100%),
    var(--bg-header);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 4px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid rgba(0,0,0,0.3);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), inset 0 -1px 0 rgba(0,0,0,0.2);
  position: sticky;
  top: 0;
  z-index: 10;
  user-select: none;
  overflow: hidden;
}

.rift-table thead th:not(.no-sort):hover {
  color: var(--text-secondary);
  background: rgba(255,255,255,0.03);
}

/* Sort arrows */
th.sort-asc::after { content: ' ▲'; font-size: 8px; color: var(--accent-cyan); }
th.sort-desc::after { content: ' ▼'; font-size: 8px; color: var(--accent-cyan); }

.rift-table tbody tr {
  border-bottom: none;
  transition: background 0.15s;
}

.rift-table tbody tr:hover { background: var(--bg-row-hover); }

.rift-table td {
  padding: 5px 4px;
  white-space: nowrap;
  vertical-align: middle;
  /* Brushed metal: vertical bevel + fine horizontal grain */
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035) 0%, transparent 35%, transparent 65%, rgba(0,0,0,0.12) 100%),
    repeating-linear-gradient(180deg, rgba(255,255,255,0.015) 0px, transparent 1px, transparent 2px),
    var(--bg-row);
  height: 34px;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), inset 0 -1px 0 rgba(0,0,0,0.18);
  border-bottom: 1px solid rgba(0,0,0,0.25);
}

/* Alternating depth stripe */
.rift-table tbody tr:nth-child(even) td {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.025) 0%, transparent 35%, transparent 65%, rgba(0,0,0,0.10) 100%),
    repeating-linear-gradient(180deg, rgba(255,255,255,0.012) 0px, transparent 1px, transparent 2px),
    rgba(255,255,255,0.012),
    var(--bg-row);
}

.rift-table tbody tr:hover td {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 35%, transparent 65%, rgba(0,0,0,0.08) 100%),
    repeating-linear-gradient(180deg, rgba(255,255,255,0.02) 0px, transparent 1px, transparent 2px),
    var(--bg-row-hover);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), inset 0 -1px 0 rgba(0,0,0,0.15);
}

/* Selected row — dramatic 3D contour with depth */
.rift-table tbody tr.row-selected td,
.rift-table tbody tr.row-selected.row-bias-bullish td,
.rift-table tbody tr.row-selected.row-bias-bearish td {
  background:
    linear-gradient(180deg, rgba(34,211,238,0.18) 0%, rgba(34,211,238,0.06) 40%, rgba(34,211,238,0.03) 60%, rgba(34,211,238,0.10) 100%),
    linear-gradient(90deg, rgba(34,211,238,0.12) 0%, transparent 50%) !important;
  box-shadow:
    inset 0 1px 0 rgba(34,211,238,0.45),
    inset 0 -1px 0 rgba(0,0,0,0.4),
    inset 0 2px 4px rgba(34,211,238,0.12),
    inset 0 -2px 4px rgba(0,0,0,0.25),
    0 0 12px rgba(34,211,238,0.08);
  border-bottom: 1px solid rgba(34,211,238,0.2) !important;
}
/* First cell gets left edge glow */
.rift-table tbody tr.row-selected td:first-child {
  box-shadow:
    inset 3px 0 6px rgba(34,211,238,0.2),
    inset 0 1px 0 rgba(34,211,238,0.45),
    inset 0 -1px 0 rgba(0,0,0,0.4),
    inset 0 2px 4px rgba(34,211,238,0.12),
    inset 0 -2px 4px rgba(0,0,0,0.25);
}
.rift-table tbody tr.row-selected:hover td {
  background:
    linear-gradient(180deg, rgba(34,211,238,0.25) 0%, rgba(34,211,238,0.08) 40%, rgba(34,211,238,0.05) 60%, rgba(34,211,238,0.14) 100%),
    linear-gradient(90deg, rgba(34,211,238,0.16) 0%, transparent 50%) !important;
  box-shadow:
    inset 0 1px 0 rgba(34,211,238,0.55),
    inset 0 -1px 0 rgba(0,0,0,0.4),
    inset 0 2px 6px rgba(34,211,238,0.18),
    inset 0 -2px 4px rgba(0,0,0,0.25),
    0 0 18px rgba(34,211,238,0.12);
}
[data-theme="slate"] .rift-table tbody tr.row-selected td,
[data-theme="slate"] .rift-table tbody tr.row-selected.row-bias-bullish td,
[data-theme="slate"] .rift-table tbody tr.row-selected.row-bias-bearish td {
  background:
    linear-gradient(180deg, rgba(8,145,178,0.14) 0%, rgba(8,145,178,0.04) 40%, rgba(8,145,178,0.02) 60%, rgba(8,145,178,0.08) 100%),
    linear-gradient(90deg, rgba(8,145,178,0.08) 0%, transparent 50%) !important;
  box-shadow:
    inset 0 1px 0 rgba(8,145,178,0.35),
    inset 0 -1px 0 rgba(0,0,0,0.1),
    inset 0 2px 4px rgba(8,145,178,0.08),
    inset 0 -2px 4px rgba(0,0,0,0.06),
    0 0 10px rgba(8,145,178,0.06);
}

/* Stale row */
tr.row-stale td { opacity: 0.45; filter: saturate(0.3); }

/* Demoted row — fading/bearish tokens pushed to bottom */
tr.row-dimmed td { opacity: 0.6; filter: saturate(0.5); }
tr.row-dimmed:hover td { opacity: 0.85; filter: saturate(0.8); }
tr.row-dimmed td:first-child {
  box-shadow: inset 3px 0 0 rgba(136,136,160,0.4),
    inset 0 1px 0 rgba(255,255,255,0.04), inset 0 -1px 0 rgba(0,0,0,0.18);
}

/* Row bias: full gradient on tr; td is completely transparent so tr shows through */
.rift-table tr.row-bias-bullish {
  background:
    linear-gradient(90deg, rgba(52,211,153,0.22) 0%, rgba(52,211,153,0.07) 45%, transparent 75%),
    linear-gradient(180deg, rgba(255,255,255,0.035) 0%, transparent 35%, transparent 65%, rgba(0,0,0,0.12) 100%),
    var(--bg-row);
}
.rift-table tr.row-bias-bearish {
  background:
    linear-gradient(90deg, rgba(248,113,113,0.22) 0%, rgba(248,113,113,0.07) 45%, transparent 75%),
    linear-gradient(180deg, rgba(255,255,255,0.035) 0%, transparent 35%, transparent 65%, rgba(0,0,0,0.12) 100%),
    var(--bg-row);
}
.rift-table tr.row-bias-bullish td,
.rift-table tr.row-bias-bearish td {
  background: transparent;
}
.rift-table tr.row-bias-bullish td:first-child {
  box-shadow: inset 3px 0 0 rgba(52,211,153,0.7),
    inset 0 1px 0 rgba(255,255,255,0.04), inset 0 -1px 0 rgba(0,0,0,0.18);
}
.rift-table tr.row-bias-bearish td:first-child {
  box-shadow: inset 3px 0 0 rgba(248,113,113,0.7),
    inset 0 1px 0 rgba(255,255,255,0.04), inset 0 -1px 0 rgba(0,0,0,0.18);
}
.rift-table tbody tr.row-bias-bullish:hover {
  background:
    linear-gradient(90deg, rgba(52,211,153,0.28) 0%, rgba(52,211,153,0.09) 45%, transparent 75%),
    linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 35%, transparent 65%, rgba(0,0,0,0.08) 100%),
    var(--bg-row-hover);
}
.rift-table tbody tr.row-bias-bearish:hover {
  background:
    linear-gradient(90deg, rgba(248,113,113,0.28) 0%, rgba(248,113,113,0.09) 45%, transparent 75%),
    linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 35%, transparent 65%, rgba(0,0,0,0.08) 100%),
    var(--bg-row-hover);
}

[data-theme="slate"] tr.row-dimmed td:first-child {
  box-shadow: inset 3px 0 0 rgba(107,114,128,0.35),
    inset 0 1px 0 rgba(255,255,255,0.5), inset 0 -1px 0 rgba(0,0,0,0.06);
}
[data-theme="slate"] .rift-table tr.row-bias-bullish {
  background:
    linear-gradient(90deg, rgba(22,163,74,0.15) 0%, rgba(22,163,74,0.05) 45%, transparent 75%),
    linear-gradient(180deg, rgba(0,0,0,0.01) 0%, transparent 35%, transparent 65%, rgba(0,0,0,0.04) 100%),
    var(--bg-row);
}
[data-theme="slate"] .rift-table tr.row-bias-bearish {
  background:
    linear-gradient(90deg, rgba(220,38,38,0.15) 0%, rgba(220,38,38,0.05) 45%, transparent 75%),
    linear-gradient(180deg, rgba(0,0,0,0.01) 0%, transparent 35%, transparent 65%, rgba(0,0,0,0.04) 100%),
    var(--bg-row);
}
[data-theme="slate"] .rift-table tr.row-bias-bullish td,
[data-theme="slate"] .rift-table tr.row-bias-bearish td {
  background: transparent;
}
[data-theme="slate"] .rift-table tr.row-bias-bullish td:first-child {
  box-shadow: inset 3px 0 0 rgba(22,163,74,0.6),
    inset 0 1px 0 rgba(255,255,255,0.5), inset 0 -1px 0 rgba(0,0,0,0.06);
}
[data-theme="slate"] .rift-table tr.row-bias-bearish td:first-child {
  box-shadow: inset 3px 0 0 rgba(220,38,38,0.6),
    inset 0 1px 0 rgba(255,255,255,0.5), inset 0 -1px 0 rgba(0,0,0,0.06);
}
[data-theme="slate"] .rift-table tbody tr.row-bias-bullish:hover {
  background:
    linear-gradient(90deg, rgba(22,163,74,0.20) 0%, rgba(22,163,74,0.06) 45%, transparent 75%),
    linear-gradient(180deg, rgba(0,0,0,0.02) 0%, transparent 35%, transparent 65%, rgba(0,0,0,0.03) 100%),
    var(--bg-row-hover);
}
[data-theme="slate"] .rift-table tbody tr.row-bias-bearish:hover {
  background:
    linear-gradient(90deg, rgba(220,38,38,0.20) 0%, rgba(220,38,38,0.06) 45%, transparent 75%),
    linear-gradient(180deg, rgba(0,0,0,0.02) 0%, transparent 35%, transparent 65%, rgba(0,0,0,0.03) 100%),
    var(--bg-row-hover);
}

/* ── Cell Styles ──────────────────────────────────────────────────────────── */

.cell-token {
  display: inline-flex; align-items: center; gap: 5px;
  min-width: 200px;
}
.token-info {
  display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.token-info .row-symbol { white-space: nowrap; }
.token-badges { display: flex; flex-wrap: wrap; gap: 3px; line-height: 1; }
@media (max-width: 1200px) { .cell-token { min-width: 210px; } }
@media (max-width: 900px)  { .cell-token { min-width: 220px; } }

.row-logo {
  width: 18px; height: 18px; max-width: 18px; max-height: 18px;
  border-radius: 50%; flex-shrink: 0;
  object-fit: cover; vertical-align: middle;
}

a.row-symbol, .row-symbol {
  font-size: 13px; font-weight: 700; color: var(--symbol-color); letter-spacing: 0.3px;
  text-decoration: none; cursor: pointer;
}
a.row-symbol:hover { text-decoration: underline; }

.cat-badge {
  font-size: 8px; font-weight: 700; padding: 1px 4px; border-radius: 3px;
  letter-spacing: 0.5px;
}
.cat-badge.cat-crypto { background: rgba(34,211,238,0.1); color: var(--accent-cyan); }
.cat-badge.cat-xyz { background: rgba(167,139,250,0.1); color: var(--accent-purple); }

/* Micro badges (STALE, VOL) */
.micro-badge {
  font-size: 8px; font-weight: 800; padding: 1px 4px; border-radius: 3px;
  letter-spacing: 0.5px; text-transform: uppercase;
}
.micro-badge.stale-b { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.micro-badge.vol-b {
  background: rgba(251,146,60,0.2); color: var(--accent-orange);
  animation: vlm-pulse 2s infinite;
}

@keyframes vlm-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* RS (Relative Strength) badges */
.micro-badge.rs-badge {
  font-size: 7.5px; font-weight: 800; padding: 1px 4px; border-radius: 3px;
  border: 1px solid transparent; letter-spacing: 0.5px;
}
.micro-badge.rs-decoupled {
  background: #4f46e5; color: #fff;
  border-color: #818cf8;
  text-shadow: 0 0 6px rgba(129,140,248,0.8);
}
.micro-badge.rs-outperform {
  background: #059669; color: #fff;
  border-color: #34d399;
  text-shadow: 0 0 6px rgba(52,211,153,0.8);
}
.micro-badge.rs-both {
  background: #d97706; color: #fff;
  border-color: #fbbf24;
  text-shadow: 0 0 6px rgba(251,191,36,0.9);
}
.micro-badge.rs-dim { opacity: 0.5; }
.micro-badge.rs-med { opacity: 1; }
.micro-badge.rs-hot {
  animation: rs-hot-pulse 1.4s ease-in-out infinite;
}
@keyframes rs-hot-pulse {
  0%, 100% { box-shadow: 0 0 6px 1px currentColor; opacity: 1; transform: scale(1); }
  50% { box-shadow: 0 0 12px 3px currentColor; opacity: 0.85; transform: scale(1.08); }
}

.col-price {
  font-variant-numeric: tabular-nums; font-weight: 500; font-size: 12px;
}

.col-spark { padding: 3px 2px; }
.sparkline { display: block; }

.col-pct {
  font-variant-numeric: tabular-nums; font-weight: 600; font-size: 11px;
  text-align: right;
  padding: 5px 3px !important;
}
.c-green { color: var(--accent-green); }
.c-red { color: var(--accent-red); }

/* Score mini-bar */
.cell-score {
  display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap;
}

.mini-bar {
  width: 40px; height: 5px; border-radius: 3px;
  background: rgba(255,255,255,0.06); overflow: hidden; flex-shrink: 0;
}

.mini-fill { height: 100%; border-radius: 3px; transition: width 0.4s; }
.mini-fill.tier-high { background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue)); }
.mini-fill.tier-mid { background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan)); }
.mini-fill.tier-low { background: linear-gradient(90deg, var(--accent-orange), var(--accent-green)); }

.score-num { font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums; }
.score-num.tier-high { color: var(--accent-cyan); }
.score-num.tier-mid { color: var(--accent-green); }
.score-num.tier-low { color: var(--accent-orange); }

/* ── Signal Donut ────────────────────────────────────────────────────────── */

.signal-donut {
  position: relative;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: default;
}

.signal-donut svg { position: absolute; top: 0; left: 0; }

.signal-donut .signal-num {
  font-size: 9px; font-weight: 800; font-variant-numeric: tabular-nums;
  position: relative; z-index: 1; line-height: 1;
}

.signal-num.sig-inferno { color: #f87171; }
.signal-num.sig-blazing { color: var(--accent-orange); }
.signal-num.sig-hot { color: var(--accent-cyan); }
.signal-num.sig-warm { color: var(--accent-green); }
.signal-num.sig-cold { color: var(--text-muted); }

.signal-ring { fill: none; stroke-width: 3; stroke-linecap: round; }
.signal-ring-bg { fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 3; }

.signal-ring.sig-inferno { stroke: url(#infernoGrad); }
.signal-ring.sig-blazing { stroke: var(--accent-orange); }
.signal-ring.sig-hot { stroke: var(--accent-cyan); }
.signal-ring.sig-warm { stroke: var(--accent-green); opacity: 0.7; }
.signal-ring.sig-cold { stroke: var(--text-muted); opacity: 0.4; }

.signal-donut.sig-inferno { animation: sig-pulse 2s infinite; }

@keyframes sig-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.3); }
}

.signal-donut.sig-blazing { filter: drop-shadow(0 0 3px rgba(251,146,60,0.3)); }

/* ── Breakout Score Donut ───────────────────────────────────────────────── */
.bo-score-donut {
  position: relative;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: default;
}
.bo-score-donut svg { position: absolute; top: 0; left: 0; }
.bo-score-num {
  font-size: 9px; font-weight: 800; font-variant-numeric: tabular-nums;
  position: relative; z-index: 1; line-height: 1;
}
.bo-ring { fill: none; stroke-width: 3; stroke-linecap: round; transition: stroke-dasharray 0.4s ease; }
.bo-ring-bg { fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 3; }

.bo-sc-cold .bo-score-num { color: var(--text-muted); }
.bo-ring.bo-sc-cold { stroke: #64748b; }

.bo-sc-warming .bo-score-num { color: #fbbf24; }
.bo-ring.bo-sc-warming { stroke: #fbbf24; }

.bo-sc-good .bo-score-num { color: #22c55e; text-shadow: 0 0 8px rgba(34,197,94,0.4); }
.bo-ring.bo-sc-good { stroke: #22c55e; filter: drop-shadow(0 0 3px rgba(34,197,94,0.5)); }

.bo-sc-elite .bo-score-num { color: #e879f9; text-shadow: 0 0 12px rgba(232,121,249,0.8); animation: bo-elite-pulse 1.5s ease-in-out infinite; }
.bo-ring.bo-sc-elite { stroke: #c084fc; filter: drop-shadow(0 0 4px rgba(168,85,247,0.7)); animation: bo-elite-ring 1.5s ease-in-out infinite; }

.bo-sc-legendary .bo-score-num { color: #f0abfc; text-shadow: 0 0 15px rgba(240,171,252,1), 0 0 30px rgba(168,85,247,0.8); animation: bo-legend-shimmer 1s ease-in-out infinite; }
.bo-ring.bo-sc-legendary { stroke: #d946ef; filter: drop-shadow(0 0 6px rgba(240,171,252,0.9)); animation: bo-legend-ring 1s ease-in-out infinite; }

@keyframes bo-elite-pulse { 0%,100% { opacity:1; } 50% { opacity:0.7; } }
@keyframes bo-elite-ring { 0%,100% { filter: drop-shadow(0 0 4px rgba(168,85,247,0.7)); } 50% { filter: drop-shadow(0 0 8px rgba(168,85,247,1)); } }
@keyframes bo-legend-shimmer { 0%,100% { text-shadow: 0 0 15px rgba(240,171,252,1), 0 0 30px rgba(168,85,247,0.8); } 50% { text-shadow: 0 0 20px rgba(240,171,252,1), 0 0 40px rgba(168,85,247,1); } }
@keyframes bo-legend-ring { 0%,100% { filter: drop-shadow(0 0 6px rgba(240,171,252,0.9)); } 50% { filter: drop-shadow(0 0 10px rgba(240,171,252,1)); } }

/* Signal tooltip */
.signal-tip {
  position: fixed;
  background: rgba(10,10,18,0.95);
  border: 1px solid var(--border-glow);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 10px;
  color: var(--text-primary);
  z-index: 300;
  pointer-events: none;
  display: none;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  line-height: 1.6;
}

.signal-tip .tip-row { display: flex; justify-content: space-between; gap: 12px; }
.signal-tip .tip-label { color: var(--text-muted); }
.signal-tip .tip-val { font-weight: 700; font-variant-numeric: tabular-nums; }

[data-theme="slate"] .signal-ring-bg { stroke: rgba(0,0,0,0.06); }
[data-theme="slate"] .signal-tip { background: rgba(255,255,255,0.95); border-color: var(--border); color: var(--text-primary); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
[data-theme="slate"] .signal-tip .tip-label { color: var(--text-secondary); }

/* ATR% column */
.col-atr { text-align: right !important; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12px; }
.atr-arrow { font-size: 10px; margin-left: 2px; }
.atr-expand { color: var(--accent-cyan); }
.atr-contract { color: var(--accent-orange); }
.atr-flat { color: var(--text-muted); }

/* RSI coloring */
.col-rsi {
  font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12px;
  text-align: right;
}
.col-rsi.rsi-ob { color: #ff6b6b; text-shadow: 0 0 6px rgba(255,107,107,0.4); }
.col-rsi.rsi-warm { color: var(--accent-orange); }
.col-rsi.rsi-os { color: #69b4ff; text-shadow: 0 0 6px rgba(105,180,255,0.4); }
.col-rsi.rsi-cool { color: var(--accent-blue); }

/* Volume 1h */
.col-vol1h {
  text-align: center;
  padding: 2px 4px;
  vertical-align: middle;
}
.col-vol1h svg { display: block; margin: 0 auto 1px; }
.vol-usd {
  font-size: 9px;
  font-weight: 600;
  color: var(--accent-cyan);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}

/* Liquidity score */
.col-liq {
  text-align: center;
  padding: 5px 2px !important;
  font-size: 12px;
}

/* P&L */
.col-pnl {
  font-variant-numeric: tabular-nums; font-weight: 600; font-size: 11px;
  text-align: right;
  padding: 5px 3px !important;
}
.col-pnl.pnl-bold { font-weight: 800; font-size: 12px; }

/* Momo (runner_score) */
.col-momo {
  text-align: center;
  padding: 5px 2px !important;
}

/* MFE */
.col-mfe {
  font-variant-numeric: tabular-nums; font-size: 11px;
  padding: 5px 3px !important;
}

/* Age */
.col-age {
  font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: 10px;
  padding: 5px 3px !important;
}

.no-data { color: var(--text-muted); }

/* ── Status Pills — vivid & colorful ─────────────────────────────────────── */

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.st-momentum-surge {
  background: linear-gradient(135deg, rgba(34,211,238,0.25), rgba(96,165,250,0.2));
  color: #67e8f9;
  border-color: rgba(34,211,238,0.4);
  box-shadow: 0 0 8px rgba(34,211,238,0.2);
  animation: glow-surge 2s infinite;
}

.st-breaking-out {
  background: linear-gradient(135deg, rgba(52,211,153,0.25), rgba(16,185,129,0.2));
  color: #6ee7b7;
  border-color: rgba(52,211,153,0.4);
  box-shadow: 0 0 8px rgba(52,211,153,0.2);
}

.st-breaking-down {
  background: linear-gradient(135deg, rgba(248,113,113,0.25), rgba(239,68,68,0.2));
  color: #fca5a5;
  border-color: rgba(248,113,113,0.4);
  box-shadow: 0 0 8px rgba(248,113,113,0.2);
}

.st-retest {
  background: linear-gradient(135deg, rgba(96,165,250,0.2), rgba(59,130,246,0.15));
  color: #93c5fd;
  border-color: rgba(96,165,250,0.35);
}

.st-trending-up {
  background: linear-gradient(135deg, rgba(134,239,172,0.15), rgba(52,211,153,0.1));
  color: #86efac;
  border-color: rgba(134,239,172,0.3);
}

.st-trending-down {
  background: linear-gradient(135deg, rgba(252,165,165,0.15), rgba(248,113,113,0.1));
  color: #fca5a5;
  border-color: rgba(252,165,165,0.3);
}

.st-expanding {
  background: linear-gradient(135deg, rgba(251,146,60,0.25), rgba(245,158,11,0.2));
  color: #fdba74;
  border-color: rgba(251,146,60,0.4);
  box-shadow: 0 0 6px rgba(251,146,60,0.15);
}

.st-consolidating {
  background: rgba(136,136,160,0.1);
  color: var(--text-secondary);
  border-color: rgba(136,136,160,0.2);
}

.st-fading {
  background: rgba(248,113,113,0.08);
  color: #e57373;
  border-color: rgba(248,113,113,0.2);
}

.st-bounce {
  background: linear-gradient(135deg, rgba(167,139,250,0.2), rgba(192,132,252,0.15));
  color: #c4b5fd;
  border-color: rgba(167,139,250,0.35);
  box-shadow: 0 0 6px rgba(167,139,250,0.15);
}

@keyframes glow-surge {
  0%, 100% { box-shadow: 0 0 8px rgba(34,211,238,0.2); }
  50% { box-shadow: 0 0 14px rgba(34,211,238,0.35); }
}

/* ── Breakout Phase Badges ────────────────────────────────────────────────── */

.col-status .bo-badge {
  margin-left: 4px;
  vertical-align: middle;
}

.bo-badge {
  display: inline-block;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
  line-height: 1.4;
}

.bo-pop {
  background: rgba(34,211,238,0.2);
  color: #67e8f9;
  border: 1px solid rgba(34,211,238,0.35);
  animation: bo-pulse 1.5s infinite;
}

.bo-drive {
  background: rgba(74,222,128,0.18);
  color: #4ade80;
  border: 1px solid rgba(74,222,128,0.3);
}

.bo-thrust {
  background: rgba(52,211,153,0.2);
  color: #34d399;
  border: 1px solid rgba(52,211,153,0.35);
  box-shadow: 0 0 6px rgba(52,211,153,0.15);
}

.bo-surge {
  background: rgba(16,185,129,0.22);
  color: #6ee7b7;
  border: 1px solid rgba(16,185,129,0.4);
  animation: bo-pulse 1.5s infinite;
}

.bo-rip {
  background: rgba(251,146,60,0.22);
  color: #fdba74;
  border: 1px solid rgba(251,146,60,0.4);
  box-shadow: 0 0 6px rgba(251,146,60,0.15);
}

.bo-escape {
  background: linear-gradient(135deg, rgba(34,211,238,0.2), rgba(96,165,250,0.15));
  color: #67e8f9;
  border: 1px solid rgba(34,211,238,0.4);
  box-shadow: 0 0 8px rgba(34,211,238,0.2);
}

.bo-fade {
  background: rgba(248,113,113,0.12);
  color: #e57373;
  border: 1px solid rgba(248,113,113,0.2);
}

.bo-retest {
  background: rgba(96,165,250,0.15);
  color: #93c5fd;
  border: 1px solid rgba(96,165,250,0.3);
}

.bo-held {
  background: rgba(74,222,128,0.18);
  color: #4ade80;
  border: 1px solid rgba(74,222,128,0.3);
}

.bo-lost {
  background: rgba(239,68,68,0.15);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.3);
}

@keyframes bo-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ── Structure Break Badges (BoS / ChoCH) ──────────────────────────────── */

.bo-bos-bull {
  background: rgba(52,211,153,0.15); color: #6ee7b7;
  border: 1px solid rgba(52,211,153,0.3);
}
.bo-bos-bear {
  background: rgba(248,113,113,0.15); color: #fca5a5;
  border: 1px solid rgba(248,113,113,0.3);
}
.bo-choch-bull {
  background: rgba(52,211,153,0.2); color: #6ee7b7;
  border: 1px solid rgba(52,211,153,0.4);
  animation: bo-pulse 1.5s infinite;
}
.bo-choch-bear {
  background: rgba(248,113,113,0.2); color: #fca5a5;
  border: 1px solid rgba(248,113,113,0.4);
  animation: bo-pulse 1.5s infinite;
}

/* ── Squeeze Badges ──────────────────────────────────────────────────── */
.bo-sqz-active {
  background: rgba(251,146,60,0.15); color: #fb923c;
  border: 1px solid rgba(251,146,60,0.3);
}
.bo-sqz-fire {
  background: rgba(74,222,128,0.2); color: #4ade80;
  border: 1px solid rgba(74,222,128,0.4);
  animation: bo-pulse 1.5s infinite;
}

/* ── MACD Badges ──────────────────────────────────────────────────────── */
.bo-macd-bull {
  background: rgba(52,211,153,0.12); color: #6ee7b7;
  border: 1px solid rgba(52,211,153,0.25);
}
.bo-macd-bear {
  background: rgba(248,113,113,0.12); color: #fca5a5;
  border: 1px solid rgba(248,113,113,0.25);
}

/* ── Status Badges Overflow Hover ───────────────────────────────────────── */

.status-badges {
  display: flex;
  align-items: center;
  gap: 3px;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  mask-image: linear-gradient(to right, #000 80%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, #000 80%, transparent 100%);
}

.col-status:hover {
  overflow: visible !important;
  z-index: 30;
}
.col-status:hover .status-badges {
  overflow: visible;
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  z-index: 50;
  background: #0f0f1a;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--border-glow);
  box-shadow: 0 6px 20px rgba(0,0,0,0.6);
  width: max-content;
  mask-image: none;
  -webkit-mask-image: none;
}

.col-status {
  white-space: nowrap;
  position: relative;
}

/* ── Empty State ──────────────────────────────────────────────────────────── */

.empty-state {
  text-align: center; padding: 80px 20px; color: var(--text-muted);
  grid-column: 1 / -1;
}
.empty-state h2 { font-size: 18px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 13px; max-width: 400px; margin: 0 auto; line-height: 1.5; }

/* ── Responsive ───────────────────────────────────────────────────────────── */

/* ── 1m Delta & Tick Flash ───────────────────────────────────────────────── */

.col-1m {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 11px;
  text-align: right;
  transition: color 0.2s;
}

.col-price {
  transition: background 0.3s;
}

@keyframes tick-flash-up {
  0% { background: rgba(52, 211, 153, 0.25); }
  100% { background: transparent; }
}

@keyframes tick-flash-down {
  0% { background: rgba(248, 113, 113, 0.25); }
  100% { background: transparent; }
}

.tick-up { animation: tick-flash-up 0.5s ease-out forwards; }
.tick-down { animation: tick-flash-down 0.5s ease-out forwards; }

/* ── TV Hover Chart ──────────────────────────────────────────────────────── */

.tv-hover {
  cursor: pointer;
  text-decoration-style: dotted;
  text-decoration-line: underline;
  text-decoration-color: var(--text-muted);
  text-underline-offset: 2px;
}
.tv-hover:hover {
  text-decoration-color: var(--symbol-color);
  filter: brightness(1.2);
}

.tv-drop {
  display: none; position: fixed; z-index: 1999;
  width: 520px; height: 360px;
  background: var(--bg-card); border: 1px solid var(--border-glow);
  border-radius: 8px; box-shadow: 0 10px 32px rgba(0,0,0,0.55);
  overflow: hidden;
}
.tv-drop.open { display: block; }
.tv-chart-inner { width: 100%; height: 100%; }

/* ── Theme Toggle ────────────────────────────────────────────────────────── */

.theme-toggle {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  padding: 2px;
}

.theme-btn {
  background: none; border: none;
  color: var(--text-muted);
  font-size: 13px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
}
.theme-btn:hover { color: var(--text-secondary); background: rgba(255,255,255,0.04); }
.theme-btn.active { color: var(--text-primary); background: rgba(255,255,255,0.08); }

/* ── Slate Theme Overrides ───────────────────────────────────────────────── */

[data-theme="slate"] .header {
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

[data-theme="slate"] .cat-btn.active {
  background: var(--accent-cyan);
  color: #fff;
}

[data-theme="slate"] .scan-btn {
  background: rgba(8,145,178,0.08);
  border-color: rgba(8,145,178,0.25);
}

[data-theme="slate"] .rift-table td {
  background:
    linear-gradient(180deg, rgba(0,0,0,0.01) 0%, transparent 35%, transparent 65%, rgba(0,0,0,0.04) 100%),
    var(--bg-row);
  border-bottom: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), inset 0 -1px 0 rgba(0,0,0,0.06);
}

[data-theme="slate"] .rift-table tbody tr:hover td {
  background:
    linear-gradient(180deg, rgba(0,0,0,0.02) 0%, transparent 35%, transparent 65%, rgba(0,0,0,0.03) 100%),
    var(--bg-row-hover);
}

[data-theme="slate"] .tv-drop {
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

[data-theme="slate"] .status-pill {
  border: 1px solid transparent;
}

[data-theme="slate"] .st-momentum-surge {
  background: rgba(8,145,178,0.12);
  color: #0891b2;
  border-color: rgba(8,145,178,0.25);
  box-shadow: none;
}

[data-theme="slate"] .st-breaking-out {
  background: rgba(22,163,74,0.1);
  color: #16a34a;
  border-color: rgba(22,163,74,0.2);
  box-shadow: none;
}

[data-theme="slate"] .st-breaking-down {
  background: rgba(220,38,38,0.1);
  color: #dc2626;
  border-color: rgba(220,38,38,0.2);
  box-shadow: none;
}

[data-theme="slate"] .st-trending-up {
  background: rgba(22,163,74,0.06);
  color: #15803d;
  border-color: rgba(22,163,74,0.15);
}

[data-theme="slate"] .st-trending-down {
  background: rgba(220,38,38,0.06);
  color: #b91c1c;
  border-color: rgba(220,38,38,0.15);
}

[data-theme="slate"] .st-expanding {
  background: rgba(234,88,12,0.08);
  color: #c2410c;
  border-color: rgba(234,88,12,0.2);
  box-shadow: none;
}

[data-theme="slate"] .st-consolidating {
  background: rgba(107,114,128,0.08);
  color: #6b7280;
  border-color: rgba(107,114,128,0.15);
}

[data-theme="slate"] .st-bounce {
  background: rgba(124,58,237,0.08);
  color: #6d28d9;
  border-color: rgba(124,58,237,0.15);
  box-shadow: none;
}

[data-theme="slate"] .bo-pop {
  background: rgba(8,145,178,0.1);
  color: #0891b2;
  border-color: rgba(8,145,178,0.2);
}

[data-theme="slate"] .bo-drive {
  background: rgba(22,163,74,0.08);
  color: #16a34a;
  border-color: rgba(22,163,74,0.18);
}

[data-theme="slate"] .bo-thrust {
  background: rgba(5,150,105,0.1);
  color: #059669;
  border-color: rgba(5,150,105,0.2);
  box-shadow: none;
}

[data-theme="slate"] .bo-surge {
  background: rgba(5,150,105,0.12);
  color: #059669;
  border-color: rgba(5,150,105,0.25);
}

[data-theme="slate"] .bo-rip {
  background: rgba(234,88,12,0.1);
  color: #c2410c;
  border-color: rgba(234,88,12,0.2);
  box-shadow: none;
}

[data-theme="slate"] .bo-escape {
  background: rgba(8,145,178,0.1);
  color: #0891b2;
  border-color: rgba(8,145,178,0.2);
  box-shadow: none;
}

[data-theme="slate"] .bo-fade {
  background: rgba(220,38,38,0.06);
  color: #b91c1c;
  border-color: rgba(220,38,38,0.12);
}

[data-theme="slate"] .bo-retest {
  background: rgba(37,99,235,0.08);
  color: #2563eb;
  border-color: rgba(37,99,235,0.15);
}

[data-theme="slate"] .bo-held {
  background: rgba(22,163,74,0.08);
  color: #16a34a;
  border-color: rgba(22,163,74,0.18);
}

[data-theme="slate"] .bo-lost {
  background: rgba(220,38,38,0.08);
  color: #dc2626;
  border-color: rgba(220,38,38,0.15);
}

[data-theme="slate"] .bo-bos-bull {
  background: rgba(22,163,74,0.08);
  color: #16a34a;
  border-color: rgba(22,163,74,0.18);
}
[data-theme="slate"] .bo-bos-bear {
  background: rgba(220,38,38,0.08);
  color: #dc2626;
  border-color: rgba(220,38,38,0.18);
}
[data-theme="slate"] .bo-choch-bull {
  background: rgba(22,163,74,0.1);
  color: #16a34a;
  border-color: rgba(22,163,74,0.25);
}
[data-theme="slate"] .bo-choch-bear {
  background: rgba(220,38,38,0.1);
  color: #dc2626;
  border-color: rgba(220,38,38,0.25);
}

[data-theme="slate"] .col-status:hover .status-badges {
  background: #f8fafc;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  border-color: var(--border);
}

[data-theme="slate"] .mini-bar {
  background: rgba(0,0,0,0.06);
}

[data-theme="slate"] .micro-badge.stale-b {
  background: rgba(0,0,0,0.04);
  color: var(--text-muted);
}

[data-theme="slate"] .micro-badge.vol-b {
  background: rgba(234,88,12,0.1);
}

[data-theme="slate"] .theme-btn.active {
  background: rgba(0,0,0,0.06);
}

[data-theme="slate"] .badge-count {
  background: var(--accent-cyan);
  color: #fff;
}

/* ── Event Drawer ────────────────────────────────────────────────────────── */

.event-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  z-index: 150;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  box-shadow: -4px 0 20px rgba(0,0,0,0.3);
}

.event-drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.drawer-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.event-filter {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 11px;
  padding: 4px 8px;
  font-family: inherit;
  outline: none;
}
.event-filter:focus { border-color: var(--accent-cyan); }

.drawer-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.drawer-close:hover { color: var(--text-primary); }

.event-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.event-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 12px;
  font-size: 11px;
  border-left: 3px solid var(--text-muted);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  flex-wrap: wrap;
}

.event-row:hover { background: var(--bg-row-hover); }

.event-icon { font-size: 12px; flex-shrink: 0; }

.event-symbol {
  font-weight: 700;
  color: var(--symbol-color);
  font-size: 11px;
  flex-shrink: 0;
}

.event-message {
  color: var(--text-primary);
  font-size: 11px;
}

.event-reason {
  color: var(--text-muted);
  font-size: 10px;
}

.event-time {
  color: var(--text-muted);
  font-size: 10px;
  margin-left: auto;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.event-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 12px;
}

/* Slate theme overrides for drawer */
[data-theme="slate"] .event-drawer {
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
}

[data-theme="slate"] .event-filter {
  background: rgba(0,0,0,0.03);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 1200px) {
  .header {
    flex-wrap: wrap; gap: 8px; padding: 10px 16px;
  }
  .header-spacer { display: none; }
  .header-left { flex: 1; min-width: 0; }
  .header-center { flex: 0 0 auto; }
  .header-right {
    flex: 1 1 100%; order: 3;
    justify-content: flex-start; gap: 12px;
    border-top: 1px solid var(--border);
    padding-top: 8px; margin-top: 2px;
  }
  .volume-control .volume-slider { width: 40px; }
  .scan-info .countdown { display: none; }
}

@media (max-width: 900px) {
  .header { padding: 8px 12px; }
  .header-left { gap: 10px; }
  .header-left .category-toggle { display: none; }
  .header-right { gap: 8px; font-size: 11px; }
  .volume-control { display: none; }
  .theme-toggle { display: none; }
  .btc-indicator { font-size: 12px; padding: 3px 8px; }
  .stats-bar { flex-wrap: wrap; gap: 10px; padding: 8px 12px; font-size: 11px; }
}

@media (max-width: 768px) {
  .header { flex-wrap: wrap; gap: 6px; padding: 8px 10px; }
  .header-center { flex: 1 1 100%; order: 2; justify-content: center; }
  .btc-dom { display: none; }
  .stats-bar { gap: 8px; padding: 6px 10px; }
  .logo { font-size: 18px; letter-spacing: 2px; }
}
