/* ==========================================================================
   EARNINGS PULSE — visual system
   Bloomberg terminal density, modern SaaS finish.
   ========================================================================== */

:root {
  --bg: #0a0e17;
  --surface: #0f1521;
  --surface-2: #141c2e;
  --border: #1e2942;
  --border-strong: #2a3a5c;
  --text: #f4f7fb;
  --muted: #b8c3d9;
  --dim: #8390ad;
  --up: #00ffa3;
  --down: #ff4d6d;
  --warn: #f0b90b;
  --accent: #3ee0ff;

  --up-soft: rgba(0, 255, 163, 0.12);
  --down-soft: rgba(255, 77, 109, 0.12);
  --warn-soft: rgba(240, 185, 11, 0.12);
  --accent-soft: rgba(62, 224, 255, 0.1);

  --r: 12px;
  --r-sm: 8px;
  --hdr: 56px;

  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 24px -12px rgba(0, 0, 0, 0.8);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(1200px 500px at 20% -10%, rgba(62, 224, 255, 0.06), transparent 70%),
    radial-gradient(900px 420px at 88% -6%, rgba(0, 255, 163, 0.045), transparent 70%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv05' 1, 'ss01' 1;
}

::selection { background: rgba(62, 224, 255, 0.28); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono, .num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--muted); }
.warn { color: var(--warn); }
.acc { color: var(--accent); }

/* ---------- scrollbars ---------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #22304d; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ==========================================================================
   HEADER
   ========================================================================== */
.hdr {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--hdr);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 16px;
  background: rgba(10, 14, 23, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand svg { display: block; color: var(--accent); }
.brand .wm {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.14em;
  white-space: nowrap;
}
.brand .wm b { color: var(--accent); font-weight: 600; }
.brand .tag {
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--dim);
  text-transform: uppercase;
  border-left: 1px solid var(--border-strong);
  padding-left: 10px;
  margin-left: 2px;
}

.hdr-center {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 0;
}

.gauge-wrap { display: flex; align-items: center; gap: 10px; }
.gauge-wrap svg { display: block; }
.gauge-read { line-height: 1.1; }
.gauge-read .v { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.gauge-read .l {
  font-size: 8.5px;
  letter-spacing: 0.14em;
  color: var(--dim);
  text-transform: uppercase;
}

.hdr-right { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.clock { font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }
.refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.refresh-btn:hover { color: var(--accent); border-color: var(--accent); background: rgba(62, 224, 255, 0.08); }
.refresh-btn.spinning svg { animation: spin 0.9s linear infinite; color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.conn { display: flex; align-items: center; gap: 7px; font-size: 10px; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; }
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--dim);
  box-shadow: 0 0 0 0 rgba(0, 255, 163, 0.5);
}
.dot.ok { background: var(--up); animation: pulseDot 2.6s ease-out infinite; }
.dot.degraded { background: var(--warn); }
.dot.down { background: var(--down); }
.dot.refreshing { background: var(--accent); animation: pulseDot 0.9s ease-out infinite; }
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(0, 255, 163, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(0, 255, 163, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 255, 163, 0); }
}

/* ---------- badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.badge.is-up { color: var(--up); border-color: rgba(0, 255, 163, 0.35); background: var(--up-soft); }
.badge.is-down { color: var(--down); border-color: rgba(255, 77, 109, 0.35); background: var(--down-soft); }
.badge.is-warn { color: var(--warn); border-color: rgba(240, 185, 11, 0.4); background: var(--warn-soft); }
.badge.is-acc { color: var(--accent); border-color: rgba(62, 224, 255, 0.35); background: var(--accent-soft); }

/* ==========================================================================
   DEGRADED BANNER
   ========================================================================== */
.banner {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  font-size: 11.5px;
  color: #ffdf8a;
  background: linear-gradient(90deg, rgba(240, 185, 11, 0.16), rgba(240, 185, 11, 0.04));
  border-bottom: 1px solid rgba(240, 185, 11, 0.3);
}
.banner.show { display: flex; }
.banner svg { flex: 0 0 auto; }

/* ==========================================================================
   LAYOUT
   ========================================================================== */
.wrap { padding: 12px 16px 40px; max-width: 2100px; margin: 0 auto; }

.grid3 {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  gap: 12px;
  align-items: start;
  margin-top: 12px;
}
.col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.col-side { position: sticky; top: calc(var(--hdr) + 12px); }

/* ==========================================================================
   CARDS
   ========================================================================== */
.card {
  position: relative;
  background: linear-gradient(180deg, var(--surface) 0%, #0d1320 100%);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px;
  box-shadow: var(--shadow);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow), 0 0 0 1px rgba(62, 224, 255, 0.06);
}

.card-hd {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}
.card-hd h3 {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}
.card-hd .spacer { flex: 1 1 auto; }
.ago { font-size: 11px; color: var(--muted); font-family: var(--mono); white-space: nowrap; }

.q-btn {
  flex: 0 0 auto;
  width: 17px; height: 17px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--dim);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  padding: 0;
}
.q-btn:hover, .q-btn[aria-expanded='true'] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 10px -2px rgba(62, 224, 255, 0.6);
}

.big {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.sub { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.5; }

.bar-track {
  height: 5px;
  border-radius: 3px;
  background: #16203a;
  overflow: hidden;
  margin-top: 9px;
}
.bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--up));
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================================
   EXPLAIN & TRADE
   ========================================================================== */
.xp {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease, margin-top 0.3s ease;
  margin-top: 0;
}
.xp.open {
  max-height: 1400px;
  opacity: 1;
  margin-top: 12px;
}
.xp-inner {
  border: 1px solid rgba(62, 224, 255, 0.22);
  border-left: 2px solid var(--accent);
  border-radius: var(--r-sm);
  background: linear-gradient(180deg, rgba(62, 224, 255, 0.055), rgba(62, 224, 255, 0.012));
  padding: 12px 13px;
}
.xp h4 {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.1;
  text-transform: uppercase;
  font-variant: small-caps;
  color: var(--accent);
}
.xp h4:not(:first-child) { margin-top: 15px; }
.xp p { margin: 0; font-size: 14px; color: #c6d2e6; line-height: 1.65; white-space: pre-line; }
.xp ul { margin: 0; padding-left: 0; list-style: none; }
.xp li {
  font-size: 12px;
  color: #c6d2e6;
  line-height: 1.5;
  padding: 5px 0 5px 13px;
  position: relative;
}
.xp li::before {
  content: '';
  position: absolute;
  left: 0; top: 12px;
  width: 5px; height: 5px;
  border-radius: 1px;
  background: var(--accent);
  opacity: 0.65;
  transform: rotate(45deg);
}
.xp li.risk::before { background: var(--warn); }
.xp li b { color: var(--text); font-weight: 600; }
.xp .cond {
  display: block;
  color: var(--text);
  font-weight: 600;
  font-size: 11.5px;
  margin-bottom: 2px;
}
.xp .ssrn {
  font-family: var(--mono);
  font-size: 11px;
  border-bottom: 1px dotted rgba(62, 224, 255, 0.5);
}
.xp sup {
  font-size: 9px;
  line-height: 0;
  margin-left: 1px;
}
.xp sup .ssrn {
  color: var(--accent);
  border-bottom: none;
  font-weight: 700;
  padding: 0 1px;
}
.xp sup .ssrn:hover { text-decoration: underline; }

/* ==========================================================================
   COMMAND STRIP
   ========================================================================== */
.cmd {
  position: relative;
  display: grid;
  grid-template-columns: 35fr 35fr 30fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: linear-gradient(180deg, #101828 0%, #0d1320 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.cmd::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent) 18%, rgba(0, 255, 163, 0.7) 55%, transparent);
  opacity: 0.85;
}
.cmd-pane { padding: 14px 16px; min-width: 0; }
.cmd-pane + .cmd-pane { border-left: 1px solid var(--border); }

.read-text {
  font-size: 15.5px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  color: #dbe5f3;
  margin: 0;
}
.read-text b { color: #fff; font-weight: 600; }
.read-meta { margin-top: 10px; font-size: 11px; color: var(--muted); font-family: var(--mono); }
.rules { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.rule-chip {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  color: var(--dim);
  text-transform: uppercase;
}

.pills { display: flex; flex-direction: column; gap: 7px; }
.pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.pill .pl {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  width: 92px;
  flex: 0 0 auto;
}
.pill .pv {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.pill .ps { font-size: 10.5px; color: var(--muted); margin-left: auto; text-align: right; }

.prints { display: flex; flex-direction: column; gap: 6px; }
.print-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.print-row:hover { border-color: var(--accent); background: #16203a; }
.print-row .tk {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--text);
}
.print-row .meta { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.print-row .em {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--warn);
  font-variant-numeric: tabular-nums;
}
.impact-line {
  margin-top: 9px;
  font-size: 10.5px;
  color: var(--muted);
  border-top: 1px dashed var(--border);
  padding-top: 8px;
  line-height: 1.4;
}

/* ==========================================================================
   SECTOR HEATMAP
   ========================================================================== */
.heat { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.heat-cell {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 7px;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease;
  min-width: 0;
}
.heat-cell:hover { transform: translateY(-1px); border-color: var(--accent); }
.heat-cell.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.heat-cell .hs {
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: #ffffff;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.heat-cell .hv {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.heat-cell .hn {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.82);
  font-family: var(--mono);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   TABS + TOOLBAR
   ========================================================================== */
.tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 7px 13px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active {
  color: #061018;
  background: linear-gradient(180deg, var(--accent), #21bede);
  box-shadow: 0 0 16px -4px rgba(62, 224, 255, 0.8);
}
.tab kbd {
  font-family: var(--mono);
  font-size: 8px;
  opacity: 0.55;
  margin-left: 5px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.toolbar .spacer { flex: 1 1 auto; }

.search {
  position: relative;
  display: flex;
  align-items: center;
}
.search input {
  width: 168px;
  height: 30px;
  padding: 0 10px 0 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s ease, width 0.2s ease;
}
.search input:focus { border-color: var(--accent); width: 210px; }
.search input::placeholder { color: var(--dim); }
.search svg { position: absolute; left: 8px; color: var(--dim); pointer-events: none; }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease;
}
.toggle:hover { border-color: var(--border-strong); color: var(--text); }
.toggle.on { color: var(--accent); border-color: rgba(62, 224, 255, 0.4); background: var(--accent-soft); }
.toggle .sw {
  width: 24px; height: 13px;
  border-radius: 99px;
  background: #22304d;
  position: relative;
  transition: background 0.18s ease;
}
.toggle.on .sw { background: rgba(62, 224, 255, 0.35); }
.toggle .sw::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--dim);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), background 0.18s ease;
}
.toggle.on .sw::after { transform: translateX(11px); background: var(--accent); }

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 6px 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(62, 224, 255, 0.4);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}
.filter-chip button {
  border: 0; background: transparent; color: inherit;
  cursor: pointer; font-size: 13px; line-height: 1; padding: 0 3px;
}

/* ==========================================================================
   TABLE
   ========================================================================== */
.sect-hd {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 16px 0 7px;
}
.sect-hd:first-child { margin-top: 2px; }
.sect-hd .lbl {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--accent);
}
.sect-hd .rule { flex: 1 1 auto; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }
.sect-hd .cnt { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.tbl th {
  text-align: right;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 7px 9px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  background: #0d1320;
}
table.tbl th:first-child, table.tbl td:first-child { text-align: left; }
table.tbl th:hover { color: var(--accent); }
table.tbl th .arw { opacity: 0.9; font-size: 8px; margin-left: 3px; }

table.tbl td {
  padding: 8px 9px;
  border-bottom: 1px solid rgba(30, 41, 66, 0.55);
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
table.tbl tbody tr { cursor: pointer; transition: background 0.12s ease; }
table.tbl tbody tr:hover { background: rgba(62, 224, 255, 0.05); }
table.tbl tbody tr.heavy td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
table.tbl tbody tr.reported td:first-child { }

.tk-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tk-sym { font-family: var(--mono); font-weight: 600; font-size: 12.5px; letter-spacing: 0.02em; }
.tk-name {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 190px;
}
.chip {
  font-size: 9.5px;
  letter-spacing: 0.07em;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--sans);
  font-weight: 600;
  white-space: nowrap;
  flex: 0 0 auto;
}
.tag-live {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--up);
  border: 1px solid rgba(0, 255, 163, 0.4);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: var(--sans);
}

.empty {
  text-align: center;
  padding: 40px 18px;
  color: var(--muted);
}
.empty svg { opacity: 0.55; margin-bottom: 12px; }
.empty .t { font-size: 15px; color: var(--text); font-weight: 600; letter-spacing: -0.01em; }
.empty .d { font-size: 12px; margin-top: 6px; }
.empty .nx { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }

/* ---------- week grid ---------- */
.week {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.day {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: 9px;
  min-height: 200px;
}
.day.today { border-color: rgba(62, 224, 255, 0.45); background: linear-gradient(180deg, rgba(62, 224, 255, 0.05), transparent); }
.day-hd { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.day-hd .dn { font-size: 11.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text); }
.day-hd .dw { font-family: var(--mono); font-size: 11.5px; color: var(--accent); }
.day-slot { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 8px 0 4px; font-weight: 600; }
.day-tk {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 4px; border-radius: 5px; cursor: pointer;
  transition: background 0.12s ease;
}
.day-tk:hover { background: var(--surface-2); }
.day-tk .d2 { border-radius: 50%; flex: 0 0 auto; }
.day-tk .s { font-family: var(--mono); font-size: 11px; }
.day-tk .w { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-left: auto; }

/* ---------- scatter ---------- */
.scatter-wrap { width: 100%; overflow: hidden; }

/* ---------- replay ---------- */
.replay-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
input[type='date'] {
  height: 30px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  color-scheme: dark;
  outline: none;
}
input[type='date']:focus { border-color: var(--accent); }
.btn {
  height: 30px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid rgba(62, 224, 255, 0.4);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn:hover { background: rgba(62, 224, 255, 0.2); }

.kv { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; }
.kv .k { font-size: 12px; color: var(--muted); }
.kv .v { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; color: var(--text); }
.col-left .kv { gap: 5px 8px; }
.col-left .kv .k { font-size: 11.5px; white-space: nowrap; }
.col-left .kv .v { font-size: 11.5px; color: var(--text); }

/* ==========================================================================
   ATTRIBUTION
   ========================================================================== */
.attr-row { margin: 9px 0; }
.attr-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.attr-top .n { font-size: 11px; color: var(--muted); }
.attr-top .v { font-family: var(--mono); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.attr-bar {
  position: relative;
  height: 6px;
  margin-top: 4px;
  background: #131c30;
  border-radius: 3px;
  overflow: hidden;
}
.attr-bar .zero { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--border-strong); }
.attr-bar i {
  position: absolute;
  top: 0; bottom: 0;
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1), left 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================================
   DRAWER + MODAL
   ========================================================================== */
.scrim {
  position: fixed; inset: 0;
  background: rgba(4, 7, 13, 0.68);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
  z-index: 80;
}
.scrim.show { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(480px, 96vw);
  background: linear-gradient(180deg, #101827, var(--bg));
  border-left: 1px solid var(--border-strong);
  box-shadow: -24px 0 60px -20px rgba(0, 0, 0, 0.9);
  transform: translateX(102%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 90;
  display: flex;
  flex-direction: column;
}
.drawer.show { transform: none; }
.drawer-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.drawer-hd .sym { font-family: var(--mono); font-size: 19px; font-weight: 600; letter-spacing: 0.01em; }
.drawer-hd .nm { font-size: 11px; color: var(--muted); }
.drawer-bd { padding: 14px 16px 40px; overflow-y: auto; flex: 1 1 auto; }
.x-btn {
  margin-left: auto;
  width: 26px; height: 26px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: all 0.15s ease;
}
.x-btn:hover { color: var(--down); border-color: var(--down); }

.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -46%) scale(0.98);
  width: min(680px, 94vw);
  max-height: 82vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #111a2b, #0b1120);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.95);
  padding: 20px 22px 24px;
  z-index: 95;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.modal h2 { margin: 0 0 4px; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.modal h5 {
  margin: 18px 0 6px;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.modal p { font-size: 12.5px; color: #c6d2e6; line-height: 1.6; margin: 0 0 8px; }
.modal code {
  font-family: var(--mono);
  font-size: 11.5px;
  background: #0a1120;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 11px;
  display: block;
  color: var(--up);
  white-space: pre-wrap;
  line-height: 1.6;
}
.cite-list { list-style: none; padding: 0; margin: 0; }
.cite-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.5;
  color: #c6d2e6;
}
.cite-list li:last-child { border-bottom: 0; }
.cite-list .id { font-family: var(--mono); color: var(--accent); font-size: 11px; }

.glossary { display: block; margin: 0 0 4px; }
.glossary .g-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 4px 14px;
}
.glossary .g-row:last-child { border-bottom: 1px solid var(--border); }
.glossary dt {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.5;
}
.glossary dd {
  margin: 0;
  font-size: 12.5px;
  color: #c6d2e6;
  line-height: 1.55;
}
@media (max-width: 560px) {
  .glossary .g-row { grid-template-columns: 1fr; }
}

/* ==========================================================================
   SKELETONS
   ========================================================================== */
.sk {
  position: relative;
  overflow: hidden;
  background: #131c2e;
  border-radius: 6px;
  height: 12px;
}
.sk + .sk { margin-top: 8px; }
.sk.tall { height: 30px; }
.sk.w60 { width: 60%; }
.sk.w40 { width: 40%; }
.sk.w80 { width: 80%; }
.sk::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(138, 151, 178, 0.16), transparent);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

.fade-in { animation: fadeIn 0.32s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.foot {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 10.5px;
  color: var(--dim);
}
.foot .spacer { flex: 1 1 auto; }
kbd {
  font-family: var(--mono);
  font-size: 9.5px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 4px;
  color: var(--muted);
  background: var(--surface-2);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1500px) {
  .grid3 { grid-template-columns: 260px minmax(0, 1fr) 300px; }
}
@media (max-width: 1280px) {
  .grid3 { grid-template-columns: minmax(0, 1fr) 300px; }
  .col-left { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; position: static; }
}
@media (max-width: 1024px) {
  .cmd { grid-template-columns: 1fr; }
  .cmd-pane + .cmd-pane { border-left: 0; border-top: 1px solid var(--border); }
  .grid3 { grid-template-columns: minmax(0, 1fr); }
  .col-left, .col-right { position: static; }
  .col-left { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .wrap { padding: 10px 10px 32px; }
  .hdr { gap: 8px; padding: 0 10px; overflow: hidden; }
  .brand .tag { display: none; }
  .brand .wm { font-size: 11px; letter-spacing: 0.08em; }
  .brand svg { width: 20px; height: 20px; }
  .hdr-center { justify-content: flex-end; gap: 8px; }
  .hdr-center #regimeBadge { display: none; }
  .gauge-wrap { gap: 6px; }
  .gauge-wrap svg { width: 62px; height: 36px; }
  .gauge-read .v { font-size: 14px; }
  .gauge-read .l { font-size: 7.5px; letter-spacing: 0.08em; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hdr-right { gap: 8px; }
  .clock { display: none; }
  .conn span { display: none; }
  .col-left { grid-template-columns: minmax(0, 1fr); }
  .week { grid-template-columns: minmax(0, 1fr); }
  .read-text { font-size: 14px; }
  .tk-name { display: none; }
  .tab { padding: 7px 9px; font-size: 10px; }
  .tab kbd { display: none; }
  .search input { width: 130px; }
  .search input:focus { width: 150px; }
  table.tbl th { position: static; }
  .pill .pl { width: 74px; }
}
