:root {
  --bg: #080a0d;
  --surface: #11151b;
  --surface-2: #181e27;
  --surface-3: #222a36;
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-strong: rgba(255, 255, 255, 0.16);
  --text: #f3f5f7;
  --text-2: #9eaab9;
  --text-3: #667283;

  --gold: #d4a853;
  --gold-dim: rgba(212, 168, 83, 0.15);
  --emerald: #2db87d;
  --emerald-dim: rgba(45, 184, 125, 0.15);
  --sky: #4ba3e3;
  --sky-dim: rgba(75, 163, 227, 0.15);
  --amber: #e59f38;
  --amber-dim: rgba(229, 159, 56, 0.15);
  --crimson: #e5534b;
  --crimson-dim: rgba(229, 83, 75, 0.15);

  --felt-center: #16362b;
  --felt-edge: #0c1f19;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  font-size: 13.5px;
  line-height: 1.38;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

.tabular { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

.app-shell {
  max-width: 500px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 720px) {
  .app-shell { max-width: 660px; }
}

/* Minimal iOS Top Bar */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 44px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(8, 10, 13, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--hairline);
}

.filter-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.top-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.top-hand-id {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.street-dots {
  display: flex;
  gap: 4px;
  margin-top: 2px;
}
.s-dot {
  width: 12px;
  height: 3px;
  border-radius: 999px;
  background: var(--surface-3);
}
.s-dot.done { background: var(--emerald); }
.s-dot.now { background: var(--gold); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--hairline-strong); }

.page {
  display: none;
  padding: 8px 10px 14px;
  flex: 1;
}
.page.active { display: block; }

/* Persistent 1-Line Street Breadcrumb Strip */
.crumb-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 2px 7px;
  cursor: pointer;
}
.crumb-bar::-webkit-scrollbar { display: none; }
.crumb-pill {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 7px;
  padding: 2px 7px;
  white-space: nowrap;
}
.crumb-sep {
  color: var(--text-3);
  font-size: 11px;
  flex: 0 0 auto;
}
.crumb-expanded {
  font-size: 11.5px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 7px 10px;
  margin-bottom: 7px;
  line-height: 1.4;
}

/* ==========================================================================
   COMPACT OVERHEAD STUDIO POKER TABLE (~200px total height!)
   ========================================================================== */
.table-stage {
  border-radius: 22px;
  padding: 4px;
  background: linear-gradient(180deg, #2a303a 0%, #171b22 100%);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  margin-bottom: 8px;
}

.table-felt {
  border-radius: 18px;
  background: radial-gradient(ellipse at 50% 44%, var(--felt-center) 0%, var(--felt-edge) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), inset 0 8px 22px rgba(0, 0, 0, 0.45);
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Villain Top Rail */
.villain-rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.seat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.pos-chip {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  background: rgba(8, 10, 13, 0.72);
  color: var(--gold);
  border: 1px solid rgba(212, 168, 83, 0.35);
  padding: 2px 7px;
  border-radius: 6px;
}
.arch-text {
  font-size: 11.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.action-chip {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(8, 10, 13, 0.78);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.16);
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.action-chip.agg {
  color: #fde68a;
  border-color: rgba(212, 168, 83, 0.5);
  background: rgba(212, 168, 83, 0.16);
}
.action-chip.react {
  color: #cfe9ff;
  border-color: rgba(75, 163, 227, 0.45);
  background: rgba(75, 163, 227, 0.16);
}
.action-chip.off {
  color: #fde68a;
  border-color: rgba(229, 159, 56, 0.5);
  background: rgba(229, 159, 56, 0.16);
}

.off-script-banner {
  font-size: 11.5px;
  color: #fde68a;
  background: rgba(229, 159, 56, 0.12);
  border: 1px solid rgba(229, 159, 56, 0.34);
  border-radius: 9px;
  padding: 5px 9px;
  margin-bottom: 6px;
  line-height: 1.35;
}

/* Center Pot + Community Cards */
.center-felt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.pot-readout {
  display: flex;
  align-items: baseline;
  gap: 6px;
  line-height: 1;
}
.pot-amt {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--gold);
}
.pot-stakes {
  font-size: 11px;
  color: rgba(243, 245, 247, 0.62);
  font-weight: 600;
}

.board-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

/* Crisp Casino Cards */
.p-card {
  width: 39px;
  height: 52px;
  border-radius: 6px;
  background: linear-gradient(180deg, #ffffff 0%, #edf1f6 100%);
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.38), inset 0 0 0 1px rgba(15, 23, 42, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  line-height: 1;
  user-select: none;
  animation: cardPop 160ms ease;
}
@keyframes cardPop {
  from { opacity: 0; transform: translateY(-3px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.p-card .rk { font-size: 17px; letter-spacing: -0.04em; }
.p-card .st { font-size: 15px; margin-top: 1px; }
.p-card.suit-s { color: #111827; }
.p-card.suit-h { color: #d92d20; }
.p-card.suit-d { color: #d92d20; }
.p-card.suit-c { color: #111827; }
.four-color .p-card.suit-d { color: #1570ef; }
.four-color .p-card.suit-c { color: #079455; }

.p-card.hero-card {
  width: 40px;
  height: 54px;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.45), 0 0 0 1.5px rgba(212, 168, 83, 0.45);
}
.p-card.hero-card .rk { font-size: 17.5px; }
.p-card.hero-card .st { font-size: 15px; }

.p-card.mini {
  width: 30px;
  height: 41px;
  border-radius: 5px;
}
.p-card.mini .rk { font-size: 13px; }
.p-card.mini .st { font-size: 11px; }

.p-card.ghost {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  animation: none;
}

/* Hero Bottom Rail */
.hero-rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.hero-pair {
  display: flex;
  align-items: center;
  gap: 9px;
}
.hero-cards {
  display: flex;
  gap: 4px;
}
.hero-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.hero-pos {
  font-size: 12px;
  font-weight: 700;
}
.hero-sub {
  font-size: 11px;
  color: var(--text-2);
}

.stack-btn {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(8, 10, 13, 0.6);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 600;
  min-height: 32px;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.stack-btn.peeked {
  color: var(--gold);
  border-color: rgba(212, 168, 83, 0.45);
}

/* ==========================================================================
   UNIFIED SINGLE CONTROL SURFACE (Always-On High-Level HHP Matrix + Actions)
   ========================================================================== */
.control-surface {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 9px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.matrix-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.row-lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  display: flex;
  justify-content: space-between;
}

/* Row 1: Two Side-by-Side Binary Switches (Capped|Uncapped & Elastic|Inelastic) */
.binary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.seg-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 9px;
  padding: 2px;
  gap: 2px;
}
.seg-opt {
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  min-height: 34px;
  padding: 6px 4px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 100ms, color 100ms;
}
.seg-opt.sel {
  background: var(--gold);
  color: #080a0d;
  font-weight: 700;
}

/* Row 2: Two-Row Hand Class Matrix (4 Made + 3 Draws/Air — Zero Truncation!) */
.hc-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hc-row-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}
.hc-row-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}
.hc-pill {
  border: 1px solid var(--hairline-strong);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 600;
  min-height: 34px;
  padding: 6px 4px;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
}
.hc-pill.sel {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: #f8e7bc;
  font-weight: 700;
}

/* Row 3: Multi-Select High-Level Spot Flags */
.flags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.flag-chip {
  border: 1px solid var(--hairline);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 600;
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.flag-chip.sel {
  background: var(--sky-dim);
  border-color: var(--sky);
  color: #dceeff;
}

/* Hairline Divider Between Read Matrix and Action Bar */
.dock-divider {
  height: 1px;
  background: var(--hairline);
  margin: 0;
}

/* Casino Action Bar */
.action-bar {
  display: flex;
  gap: 6px;
}
.primary-act {
  flex: 1;
  min-height: 44px;
  border-radius: 11px;
  border: 1px solid var(--hairline-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.primary-act .sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
}
.primary-act.t-fold { background: #1a1617; border-color: rgba(229, 83, 75, 0.28); }
.primary-act.t-check { background: #131d1a; border-color: rgba(45, 184, 125, 0.28); }
.primary-act.t-bet { background: #1d1912; border-color: rgba(212, 168, 83, 0.34); }
.primary-act.picked {
  border-color: var(--gold);
  box-shadow: 0 0 0 1.5px var(--gold);
  background: var(--gold-dim);
}
.primary-act.picked .sub { color: #f8e7bc; }

/* Inline Sizing Strip */
.sizing-pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  gap: 5px;
}
.size-pill {
  border: 1px solid var(--hairline-strong);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 9px;
  min-height: 40px;
  padding: 5px 4px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.size-pill .s-amt { font-size: 12.5px; font-weight: 700; }
.size-pill .s-pct { font-size: 11px; color: var(--text-2); }
.size-pill.picked {
  background: var(--gold);
  color: #080a0d;
  border-color: var(--gold);
}
.size-pill.picked .s-pct { color: #1f190b; font-weight: 600; }

.cta-btn {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 11px;
  background: var(--gold);
  color: #080a0d;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.cta-btn:disabled {
  background: var(--surface-3);
  color: var(--text-3);
  cursor: not-allowed;
}

.btn-pair {
  display: flex;
  gap: 7px;
  margin-top: 8px;
}
.sec-btn {
  height: 44px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid var(--hairline-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

/* ==========================================================================
   TRANSPARENT PER-AXIS RESULT CARD (In-Place Under Table)
   ========================================================================== */
.result-card {
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: 16px;
  padding: 12px;
  animation: fadeUp 150ms ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.grade-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.badges-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}
.b-ok { background: var(--emerald-dim); color: var(--emerald); }
.b-info { background: var(--sky-dim); color: var(--sky); }
.b-warn { background: var(--amber-dim); color: var(--amber); }
.b-bad { background: var(--crimson-dim); color: var(--crimson); }
.b-muted { background: var(--surface-3); color: var(--text-2); }

.result-copy {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.42;
  margin-bottom: 8px;
}
.after-note {
  font-size: 12px;
  color: #cfe9ff;
  background: rgba(75, 163, 227, 0.11);
  border: 1px solid rgba(75, 163, 227, 0.28);
  padding: 6px 9px;
  border-radius: 8px;
  margin-bottom: 8px;
  line-height: 1.38;
}
.after-note.off {
  color: #fde68a;
  background: rgba(229, 159, 56, 0.12);
  border-color: rgba(229, 159, 56, 0.34);
}
.default-compare {
  font-size: 12px;
  color: var(--emerald);
  background: var(--emerald-dim);
  padding: 6px 9px;
  border-radius: 8px;
  margin-bottom: 8px;
}

/* Clean 4-Axis Audit Grid */
.axis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin: 8px 0;
}
.axis-cell {
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 9px;
  padding: 6px 8px;
  font-size: 11.5px;
}
.axis-cell.ok { border-color: rgba(45, 184, 125, 0.4); }
.axis-cell.bad { border-color: rgba(229, 83, 75, 0.45); }
.axis-cell.miss { border-color: rgba(229, 159, 56, 0.4); }
.axis-k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); font-weight: 700; }
.axis-v { font-weight: 600; margin-top: 1px; }

.trap-alert {
  font-size: 11.5px;
  color: #fecaca;
  background: var(--crimson-dim);
  padding: 6px 9px;
  border-radius: 8px;
  margin-top: 5px;
}
.mismatch-alert {
  font-size: 11.5px;
  color: #fde68a;
  background: var(--amber-dim);
  padding: 6px 9px;
  border-radius: 8px;
  margin-top: 5px;
}

/* Debrief Panel */
.debrief-panel {
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: 16px;
  padding: 14px;
}
.debrief-panel h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}
.debrief-lesson {
  background: var(--surface-2);
  border-left: 3px solid var(--gold);
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 12.5px;
  line-height: 1.44;
  margin: 10px 0;
}
.debrief-steps {
  list-style: none;
  margin: 8px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.debrief-steps li {
  background: var(--surface-2);
  border-radius: 9px;
  padding: 7px 9px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.meta-footnote {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 8px;
  line-height: 1.45;
}

/* Bottom Sheet */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet {
  width: 100%;
  max-width: 500px;
  max-height: 82dvh;
  overflow-y: auto;
  background: var(--surface);
  border-top: 1px solid var(--hairline-strong);
  border-radius: 20px 20px 0 0;
  padding: 10px 15px calc(18px + env(safe-area-inset-bottom, 0px));
}
.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--surface-3);
  margin: 0 auto 12px;
}
.sheet-sec { margin-bottom: 13px; }
.sheet-sec-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  margin-bottom: 6px;
}
.seg-control {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 2px;
  gap: 2px;
}
.seg-btn {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  min-height: 34px;
  padding: 7px 6px;
  border-radius: 8px;
  cursor: pointer;
}
.seg-btn.active { background: var(--surface-3); color: var(--text); }

.search-wrap {
  position: relative;
}
.search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.input-clean {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--hairline-strong);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 13px;
  outline: none;
}
.input-clean:focus { border-color: var(--gold); }
.jump-list { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.jump-item {
  width: 100%;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 9px;
  padding: 9px 10px;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

/* Flowcharts (Mobile-Friendly Capped Indentation!) */
.pill-strip {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.pill-strip::-webkit-scrollbar { display: none; }
.nav-pill {
  flex: 0 0 auto;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 600;
  min-height: 32px;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
}
.nav-pill.active { background: var(--gold); color: #080a0d; border-color: var(--gold); }

.fc-banner {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 13px;
  padding: 11px;
  margin-bottom: 8px;
}
.fc-children {
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1.5px solid var(--hairline-strong);
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* Cap indentation at depth >= 2 so 390px iPhone stays wide and readable */
.fc-children.deep-flat {
  margin-left: 0;
  padding-left: 8px;
  border-left: 2px solid rgba(212, 168, 83, 0.35);
}
.fc-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 11px;
  padding: 9px 10px;
  cursor: pointer;
}
.fc-card.hi { border-color: var(--gold); background: #181713; }
.fc-card.dim { opacity: 0.3; }
.fc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.fc-lbl { font-size: 12.5px; font-weight: 600; }
.fc-sub { font-size: 11.5px; color: var(--text-2); margin-top: 3px; line-height: 1.38; }
.fc-note-warn { margin-top: 5px; padding: 5px 7px; border-radius: 7px; background: var(--amber-dim); color: #fde68a; font-size: 11px; }
.fc-note-err { margin-top: 5px; padding: 5px 7px; border-radius: 7px; background: var(--crimson-dim); color: #fecaca; font-size: 11px; }

/* Scorecard */
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 9px; }
.kpi { background: var(--surface); border: 1px solid var(--hairline); border-radius: 13px; padding: 12px; }
.kpi-val { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.kpi-val.accent { color: var(--gold); }
.kpi-lbl { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.bar-item { margin-bottom: 9px; }
.bar-top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 3px; }
.bar-bg { height: 7px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.bar-fg { height: 100%; background: var(--gold); border-radius: 999px; }

/* Startup Error Card & SW Update Toast */
.error-card {
  background: var(--surface);
  border: 1px solid rgba(229, 83, 75, 0.4);
  border-radius: 16px;
  padding: 18px 14px;
  text-align: center;
  margin-top: 20px;
}
.update-toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  z-index: 55;
  background: var(--surface-2);
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 7px 8px 7px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}
.toast-btn {
  border: 0;
  border-radius: 999px;
  background: var(--gold);
  color: #080a0d;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
}

/* Bottom Tab Bar */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  max-width: 500px;
  margin: 0 auto;
  background: rgba(10, 13, 17, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--hairline);
  padding: 5px 8px calc(7px + env(safe-area-inset-bottom, 0px));
  display: flex;
}
@media (min-width: 720px) {
  .tab-bar { max-width: 660px; }
}
.tab-item {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 0;
  cursor: pointer;
}
.tab-item svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab-item.active { color: var(--gold); }
