
:root {
  /* CHOAM Control Room — light, teal readout accent. Shared with the /app console and the
     brief/swing documents (same token values). Legacy names kept so existing inline styles
     keep working. IBM Plex named first with a clean system fallback: these server-rendered
     pages deliberately do NOT fetch external fonts (2026-07-30 opsec hardening), so Plex is
     used where present (e.g. after a console visit) and system-ui otherwise. */
  --bg: #eef1f5; --surface: #ffffff; --surface-2: #f4f6fa; --surface-3: #e9edf4;
  --border: #dbe1ea; --border-soft: #e8ecf2;
  --hair: rgba(16,24,40,.08); --hair-2: rgba(16,24,40,.05);
  --text: #26303f; --text-bright: #0d1420; --muted: #5a6575; --faint: #8791a0;
  --accent: #0e8f9e; --accent-hi: #0b7581; --accent-2: #7c5cbf;
  --accent-soft: rgba(14,143,158,.11); --accent-line: rgba(14,143,158,.5);
  --green: #168750; --green-soft: rgba(22,135,80,.12);
  --red: #ce383d;   --red-soft: rgba(206,56,61,.10);
  --yellow: #b0761a; --yellow-soft: rgba(176,118,26,.13); --orange: #b0761a;
  --purple: #7c5cbf; --teal: #0e8f9e;
  --radius: 12px; --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 14px 30px -22px rgba(16,24,40,.26);
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: clip; }
body, main { max-width: 100%; overflow-x: clip; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 15px; line-height: 1.5; letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  max-width: 1040px; margin: 0 auto; min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: flex-start;
  padding: calc(1.7rem + env(safe-area-inset-top, 0px)) calc(1.4rem + env(safe-area-inset-right, 0px))
           calc(2rem + env(safe-area-inset-bottom, 0px)) calc(1.4rem + env(safe-area-inset-left, 0px));
}
h1 {
  font-size: 1.32rem; font-weight: 640; letter-spacing: -0.02em; color: var(--text-bright);
  margin-bottom: 0.2rem; display: flex; align-items: center; gap: 0.6rem;
  padding-right: 3.4rem; /* clear the fixed hamburger button */
}
h1::before {
  content: "C"; width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: grid; place-items: center; color: #fff; font-family: var(--mono); font-size: .95rem; font-weight: 700;
  background: linear-gradient(150deg, var(--accent), var(--accent-hi));
  box-shadow: inset 0 0 0 .5px rgba(255,255,255,.25), 0 4px 14px -6px var(--accent-line);
}
.brand-sub { font-size: 0.62rem; color: var(--faint); letter-spacing: 0.2em; text-transform: uppercase; margin: 0.2rem 0 0 2.5rem; }
.brand-sub .i { color: var(--accent); font-weight: 700; }
h2 {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--faint); margin: 1.9rem 0 0.75rem;
}
a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--text-bright); }
p { margin-bottom: 0.4rem; }
code { font-family: var(--mono); font-size: 0.85em; color: var(--accent); }
td, .num, .stat-val, .balance-num, .pct-up, .pct-flat, .live-meta, .live-levels,
.progress-labels { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* Navigation */
.nav { display: flex; flex-wrap: wrap; gap: 0.2rem; align-items: center; margin: 0.9rem 0 1.8rem; font-size: 0.82rem; }
.nav a { color: var(--muted); padding: 0.35rem 0.7rem; border-radius: 8px; font-weight: 500; transition: background .15s, color .15s; }
.nav a:hover { background: var(--surface-2); color: var(--text-bright); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }

/* Hamburger drawer nav – frees the whole top row (pure CSS, JS only enhances) */
.nav-toggle { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.nav-burger {
  position: fixed; top: calc(env(safe-area-inset-top, 0px) + 15px); right: calc(env(safe-area-inset-right, 0px) + 15px);
  z-index: 70; width: 42px; height: 42px; border-radius: 12px; cursor: pointer;
  background: rgba(255,255,255,.72); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
  border: 1px solid var(--border); box-shadow: 0 2px 8px -3px rgba(16,24,40,.2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  transition: background .2s, transform .12s;
}
.nav-burger:hover { background: rgba(255,255,255,.92); }
.nav-burger:active { transform: scale(.94); }
.nav-burger span { display: block; width: 17px; height: 2px; border-radius: 2px; background: var(--text-bright); transition: transform .26s, opacity .2s; }
.nav-scrim {
  position: fixed; inset: 0; z-index: 60; background: rgba(16,24,40,.4);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; cursor: pointer;
}
.drawer {
  position: fixed; top: 0; right: 0; z-index: 65; height: 100dvh; width: min(300px, 82vw);
  background: linear-gradient(180deg, var(--surface), var(--surface-2)); border-left: 1px solid var(--border);
  box-shadow: -24px 0 60px -30px rgba(16,24,40,.28);
  padding: calc(env(safe-area-inset-top) + 4.6rem) 1rem calc(env(safe-area-inset-bottom) + 1.2rem);
  display: flex; flex-direction: column; gap: .12rem; overflow-y: auto;
  transform: translateX(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
}
.drawer a { color: var(--text); font-size: .98rem; font-weight: 530; padding: .78rem .85rem; border-radius: 10px; text-decoration: none; transition: background .15s, color .15s; }
.drawer a:hover { background: var(--surface-2); color: var(--text-bright); }
.drawer a.active { background: var(--accent-soft); color: var(--accent); }
.nav-toggle:checked ~ .nav-scrim { opacity: 1; visibility: visible; }
.nav-toggle:checked ~ .drawer { transform: translateX(0); }
.nav-toggle:checked ~ .nav-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle:checked ~ .nav-burger span:nth-child(2) { opacity: 0; }
.nav-toggle:checked ~ .nav-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Cards */
.card { background: linear-gradient(180deg, rgba(255,255,255,.028), rgba(255,255,255,.006)), var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: 1.25rem 1.35rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.card:has(table) { overflow-x: auto; }
.card.ok  { border-color: rgba(22,135,80,.4); background: linear-gradient(var(--green-soft), var(--green-soft)), var(--surface); }
.card.err { border-color: rgba(206,56,61,.45); background: linear-gradient(var(--red-soft), var(--red-soft)), var(--surface); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem; background: var(--accent);
  color: #fff; font-family: var(--sans); font-size: 0.9rem; font-weight: 590;
  letter-spacing: -0.01em; padding: 0.62rem 1.15rem; border: 1px solid transparent;
  border-radius: 12px; cursor: pointer; text-decoration: none;
  transition: transform .12s, box-shadow .2s, filter .2s, background .2s;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 8px 22px -8px var(--accent-line); color: #fff; }
.btn:active { transform: translateY(0) scale(.985); }
.btn.secondary { background: rgba(255,255,255,.04); color: var(--text-bright); border-color: var(--hair); }
.btn.secondary:hover { background: rgba(255,255,255,.08); filter: none; box-shadow: none; color: var(--text-bright); }

/* Forms */
label { display: block; margin-bottom: 0.3rem; font-size: 0.82rem; color: var(--muted); font-weight: 500; }
input, select {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-bright);
  padding: 0.6rem 0.7rem; border-radius: 9px; margin-bottom: 0.9rem; font-family: var(--sans);
  font-size: 0.92rem; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox] { width: auto; accent-color: var(--accent); }

/* Range sliders */
input[type=range].slider {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px;
  background: var(--surface-2); border-radius: 999px; margin: 0.35rem 0 1.1rem;
  cursor: pointer; border: none; padding: 0;
}
input[type=range].slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--accent), 0 2px 6px rgba(0,0,0,.45);
  transition: transform .12s; cursor: pointer;
}
input[type=range].slider::-webkit-slider-thumb:hover { transform: scale(1.18); }
input[type=range].slider::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: var(--accent);
  border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--accent); cursor: pointer;
}
input[type=range].slider:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.slider-val {
  font-family: var(--mono); color: var(--accent); font-weight: 600;
  font-size: 0.9rem; background: var(--accent-soft); padding: 0.05rem 0.4rem; border-radius: 6px;
}

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th { text-align: left; color: var(--faint); padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--hair); font-weight: 600; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em; }
td { padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--hair-2); }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(16,24,40,.03); }

/* Utilities */
.green { color: var(--green); } .red { color: var(--red); } .yellow { color: var(--yellow); }
.muted { color: var(--muted); font-size: 0.84rem; }
.auth { max-width: 420px; width: 100%; margin: 0 auto; }
/* Login/landing pages: center the lockup vertically + horizontally.
   Content pages top-align (body default is flex-start). */
body.centered { align-items: center; justify-content: safe center; }
body.centered h1 { justify-content: center; }
body.centered .brand-sub { margin-left: 0; text-align: center; margin-bottom: 1.4rem; }
body.centered .nav { justify-content: center; }

/* Home tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.7rem; }
.tile { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 0.2rem; background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.006)), var(--surface); border: 1px solid var(--hair); border-radius: var(--radius-sm); padding: 1.05rem 1.1rem; color: var(--text-bright); font-weight: 600; box-shadow: var(--shadow); transition: transform .16s, border-color .2s, box-shadow .2s; }
.tile:hover { transform: translateY(-3px); border-color: var(--accent-line); box-shadow: 0 12px 26px -14px var(--accent-line); color: var(--text-bright); }
.tile .ico { font-size: 1.2rem; margin-bottom: 0.2rem; }
.tile .sub { font-size: 0.72rem; color: var(--muted); font-weight: 400; }
.tile::after { content: "\203A"; position: absolute; top: 0.9rem; right: 1.05rem; color: var(--faint); font-size: 1.1rem; transition: transform .16s, color .2s; }
.tile:hover::after { color: var(--accent); transform: translateX(3px); }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; }
.stats-grid.stats-4 { grid-template-columns: repeat(4, 1fr); }
.stats-grid.stats-5 { grid-template-columns: repeat(5, 1fr); }
.stat { background: linear-gradient(180deg, rgba(255,255,255,.028), rgba(255,255,255,.006)), var(--surface); border: 1px solid var(--hair); border-radius: var(--radius-sm); padding: 1.05rem 1.1rem; text-align: left; box-shadow: var(--shadow); }
.stat-val { font-size: 1.55rem; font-weight: 590; margin-bottom: 0.3rem; font-family: var(--mono); letter-spacing: -0.02em; line-height: 1; }
.stat-lbl { font-size: 0.64rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.07em; font-weight: 600; }

/* Tracker */
.section-title { font-size: 0.74rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); margin: 1.8rem 0 0.6rem; }
.header-card { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.9rem; background: linear-gradient(140deg, var(--accent-soft), rgba(124,92,191,.06) 70%), var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: 1.5rem 1.6rem; margin-bottom: 1.2rem; box-shadow: var(--shadow); }
.header-name { font-size: 1.12rem; color: var(--text-bright); font-weight: 620; }
.header-balance { text-align: right; }
.balance-num { font-size: 2.35rem; font-weight: 590; letter-spacing: -0.035em; color: var(--text-bright); font-family: var(--mono); line-height: 1; }
.balance-sub { font-size: 0.8rem; color: var(--muted); margin-top: 0.15rem; }
.progress-bar-wrap { background: var(--surface-2); border-radius: 6px; height: 10px; margin: 0.7rem 0; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.progress-labels { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--muted); }
.proj { font-size: 0.85rem; margin-top: 0.6rem; }
.chart-wrap { position: relative; height: 240px; }
.live-card { border-color: var(--accent-line); position: relative; }
.live-badge { position: absolute; top: 1rem; right: 1.1rem; background: var(--accent-soft); color: var(--accent); font-size: 0.7rem; font-weight: 600; padding: 0.2rem 0.55rem; border-radius: 6px; letter-spacing: 0.04em; }
.live-name { font-size: 1.1rem; font-weight: 600; color: var(--text-bright); margin-bottom: 0.4rem; }
.live-meta { font-size: 0.84rem; color: var(--muted); margin-bottom: 0.5rem; }
.live-levels { font-size: 0.9rem; }

/* Live positions page */
.refresh-bar { display: flex; gap: 0.6rem; align-items: center; font-size: 0.8rem; color: var(--muted); margin-bottom: 1rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 2s infinite; }
.dot.stale { background: var(--red); box-shadow: 0 0 8px var(--red); animation: none; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
#pos-table td, #pos-table th { white-space: nowrap; }
.badge { display: inline-block; padding: 0.12rem 0.5rem; border-radius: 6px; font-size: 0.72rem; font-weight: 600; }
.badge-owner { background: var(--accent-soft); color: var(--accent); }
.badge-friend { background: rgba(124,92,191,.14); color: var(--accent-2); }
.badge-event { background: var(--yellow); color: #fff; }
.badge-sched { background: var(--surface-2); color: var(--muted); }
.zone-ratchet { color: var(--green); font-weight: 600; }
.zone-tightened { color: var(--yellow); font-weight: 600; }
.zone-hard_sl { color: var(--red); font-weight: 600; }
.zone-unknown { color: var(--muted); }
.zone-na { color: var(--muted); }
.monitor-ok { color: var(--green); } .monitor-dead { color: var(--red); }
.pct-up { color: var(--green); } .pct-flat { color: var(--muted); }
.empty { color: var(--muted); display: block; text-align: center; padding: 2rem 0; }

/* Health page – clean status rows/pills instead of dense tables */
.hrow { display: flex; align-items: center; gap: 0.75rem; padding: 0.72rem 0; border-bottom: 1px solid var(--hair-2); }
.hrow:last-child { border-bottom: none; }
.hdot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.hname { font-weight: 530; min-width: 8rem; color: var(--text-bright); }
.hbar { flex: 1; height: 6px; border-radius: 999px; background: rgba(16,24,40,.06); overflow: hidden; min-width: 50px; }
.hbar i { display: block; height: 100%; border-radius: 999px; }
.hval { font-family: var(--mono); font-size: 0.82rem; white-space: nowrap; }
.hpills { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.hpill { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; font-weight: 590; padding: 0.34rem 0.75rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--hair); }
.hstrat { display: flex; align-items: center; gap: 0.75rem; padding: 0.8rem 0; border-bottom: 1px solid var(--hair-2); flex-wrap: wrap; }
.hstrat:last-child { border-bottom: none; }
.hstrat .nm { font-weight: 590; min-width: 9rem; color: var(--text-bright); }
.hstrat .tally { font-size: 0.82rem; color: var(--muted); margin-left: auto; text-align: right; }
.mode-live { color: var(--green); } .mode-shadow { color: var(--muted); } .mode-warn { color: var(--yellow); }
.strat { padding: 0.9rem 0; border-bottom: 1px solid var(--hair-2); }
.strat:last-child { border-bottom: none; }
.strat .top { display: flex; align-items: center; gap: 0.55rem; margin-bottom: 0.5rem; }
.strat .top .nm { font-weight: 590; color: var(--text-bright); }
.strat .top .mode { margin-left: auto; font-size: 0.78rem; font-weight: 590; white-space: nowrap; }
.strat .bar { height: 8px; border-radius: 999px; background: rgba(16,24,40,.06); overflow: hidden; }
.strat .bar i { display: block; height: 100%; border-radius: 999px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.strat .sub { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.75rem; color: var(--muted); margin-top: 0.4rem; font-variant-numeric: tabular-nums; }
.strat .sub b { font-family: var(--mono); font-weight: 600; }

/* Flag chips (show-don't-tell replacement for the "Live flags:" sentence) */
.chips-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.7rem 0 0; }
.flag-chip { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.74rem; font-weight: 590; padding: 0.28rem 0.62rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--hair); }
.flag-chip.on { background: var(--yellow-soft); color: var(--yellow); border-color: transparent; }

/* Session badge */
.sess { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; font-weight: 600; padding: 0.3rem 0.75rem; border-radius: 999px; }
.sess-on { background: var(--green-soft); color: var(--green); }
.sess-soon { background: var(--accent-soft); color: var(--accent); }
.sess-off { background: var(--surface-2); color: var(--muted); }

/* Toasts (zone-change / connection alerts) */
#toasts { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 50; max-width: 90vw; }
.toast { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 8px; padding: 0.6rem 0.9rem; font-size: 0.85rem; color: var(--text-bright); box-shadow: var(--shadow); animation: toastin .2s ease; }
.toast.up { border-left-color: var(--green); } .toast.down { border-left-color: var(--red); } .toast.warn { border-left-color: var(--yellow); }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Calendar heatmap (#5b) */
.heatmap { display: grid; grid-template-rows: repeat(5, 14px); grid-auto-flow: column; gap: 3px; overflow-x: auto; padding-bottom: 2px; }
.hm-cell { width: 14px; height: 14px; border-radius: 3px; background: var(--surface-2); }

/* Loading skeletons (#10) */
.skeleton { display: inline-block; background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 6px; color: transparent; min-width: 8rem; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Pull-to-refresh + floating refresh (#10) */
#refresh-fab { position: fixed; left: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); width: 42px; height: 42px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); color: var(--accent); font-size: 1.15rem; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); cursor: pointer; z-index: 40; }
#refresh-fab:active { transform: scale(0.9); }
#ptr { position: fixed; top: 0; left: 0; right: 0; text-align: center; color: var(--accent); background: var(--surface); font-size: 0.8rem; padding: 0.5rem; transform: translateY(-100%); transition: transform .15s; z-index: 60; pointer-events: none; border-bottom: 1px solid var(--border); }

/* Accessibility (#13) */
.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff; padding: 0.5rem 1rem; border-radius: 6px; z-index: 100; }
.skip-link:focus { left: 0.6rem; top: 0.6rem; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; } }

/* ── Instruments & shared components (redesign) ─────────────────────── */
/* Segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface); border: 1px solid var(--hair); border-radius: 11px; }
.seg a, .seg button { font-family: var(--sans); font-size: 0.82rem; font-weight: 590; color: var(--muted); background: none; border: none; padding: 0.42rem 1rem; border-radius: 8px; cursor: pointer; text-decoration: none; transition: .15s; }
.seg a.sel, .seg button.sel { background: var(--surface-3); color: var(--text-bright); box-shadow: 0 1px 1px rgba(16,24,40,.12); }

/* Inline "i" help – a paragraph collapses into a tap/hover note (show, don't tell) */
.info { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--hair); color: var(--faint); font-size: 0.62rem; font-weight: 700; font-style: italic; cursor: help; position: relative; vertical-align: middle; }
.info:hover, .info:focus { color: var(--accent); border-color: var(--accent); outline: none; }
.info .tip { position: absolute; bottom: calc(100% + 9px); left: 50%; transform: translateX(-50%); width: min(240px, 72vw); background: var(--surface-3); border: 1px solid var(--hair); border-radius: 11px; padding: 0.65rem 0.75rem; font-size: 0.76rem; font-weight: 400; font-style: normal; color: var(--text); line-height: 1.5; letter-spacing: -.01em; text-align: left; text-transform: none; box-shadow: var(--shadow); opacity: 0; visibility: hidden; transition: .16s; z-index: 9; }
.info:hover .tip, .info:focus .tip { opacity: 1; visibility: visible; }

/* KPI card with optional sparkline */
.kpi { position: relative; overflow: hidden; }
.kpi .k { font-size: 0.64rem; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); font-weight: 600; }
.kpi .v { font-family: var(--mono); font-size: 1.55rem; font-weight: 590; letter-spacing: -.02em; margin-top: .35rem; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 0.73rem; color: var(--muted); margin-top: .4rem; }
.kpi .spark { position: absolute; right: .6rem; bottom: .6rem; opacity: .95; }

/* Market backdrop strip */
.mkt { display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; }
.mkt::-webkit-scrollbar { display: none; }
.mkt .m { flex: 1; min-width: 90px; padding: .15rem 1rem; border-right: 1px solid var(--hair-2); }
.mkt .m:last-child { border-right: none; }
.mkt .t { font-size: .72rem; color: var(--muted); font-weight: 590; }
.mkt .p { font-family: var(--mono); font-size: 1rem; font-weight: 590; margin-top: .15rem; font-variant-numeric: tabular-nums; }
.mkt .d { font-size: .72rem; margin-top: .05rem; }

/* Allocation ring + legend */
.alloc { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.alloc .legend { display: flex; flex-direction: column; gap: .55rem; font-size: .86rem; min-width: 190px; flex: 1; }
.alloc .legend .row { display: flex; align-items: center; gap: .6rem; }
.alloc .legend .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.alloc .legend .amt { margin-left: auto; font-family: var(--mono); font-weight: 590; }

/* Verdict block */
.verdict { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.vbadge { font-family: var(--mono); font-weight: 590; font-size: .82rem; padding: .42rem .8rem; border-radius: 10px; letter-spacing: .01em; }
.vbadge.call { background: var(--green-soft); color: var(--green); }
.vbadge.put { background: var(--red-soft); color: var(--red); }
.vbadge.flat { background: var(--surface-2); color: var(--muted); }
.tkr { font-size: 1.5rem; font-weight: 640; letter-spacing: -.02em; color: var(--text-bright); }
.metaline { display: flex; gap: .45rem; flex-wrap: wrap; font-size: .77rem; color: var(--muted); margin-top: .2rem; }
.metaline .sep { color: var(--faint); }

/* Stop ladder */
.ladder { display: flex; flex-direction: column; gap: .7rem; }
.rung { display: flex; align-items: center; gap: .75rem; font-size: .8rem; }
.rung .nm { width: 70px; font-weight: 590; flex: none; }
.rung .bar2 { flex: 1; height: 7px; border-radius: 999px; background: rgba(16,24,40,.06); position: relative; }
.rung .bar2 i { position: absolute; height: 100%; border-radius: 999px; left: 0; }
.rung .mark-dot { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); top: -2px; box-shadow: 0 0 0 3px var(--surface), 0 0 10px var(--accent-soft); }

/* number helper */
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
  .stats-grid, .stats-grid.stats-5 { grid-template-columns: repeat(2, 1fr); }
  .alloc { flex-direction: column; align-items: stretch; }
  .alloc .legend { min-width: 0; }
}
@media (max-width: 600px) {
  body { padding: calc(1.5rem + env(safe-area-inset-top, 0px)) 1rem 2.5rem; }
  .card { padding: 1.1rem; }
  .stats-grid, .stats-grid.stats-4, .stats-grid.stats-5 { grid-template-columns: repeat(2, 1fr); }
  .brand-sub { display: none; }
  .tkr { font-size: 1.3rem; }
  .balance-num { font-size: 2rem; }
}

/* Friend settings page (collapsible sections + opt-in tiles) */
.chip { display:inline-flex; align-items:center; padding:0.22rem 0.7rem; border-radius:999px;
  background:var(--surface-2); font-size:0.8rem; font-weight:590; margin-right:0.4rem }
.chip.red { background:var(--red-soft); color:var(--red) }
.chip.amber { background:var(--yellow-soft); color:var(--yellow) }
details.sect { margin-bottom:0.75rem }
details.sect summary { cursor:pointer; list-style:none; display:flex;
  justify-content:space-between; align-items:center; gap:1rem; padding:0.25rem 0 }
details.sect summary::-webkit-details-marker { display:none }
details.sect summary h2 { margin:0; font-size:1rem; font-weight:600; text-transform:none;
  letter-spacing:-0.01em; color:var(--text-bright) }
details.sect summary .sum { font-size:0.8rem; text-align:right; color:var(--muted) }
details.sect summary:after { content:"\203A"; color:var(--faint); font-size:1.25rem;
  line-height:1; margin-left:0.4rem; transition:transform .2s, color .2s }
details.sect[open] summary:after { transform:rotate(90deg); color:var(--accent) }
details.sect .inner { padding-top:0.5rem }
.lsgrid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr));
  gap:0.5rem; margin-top:0.5rem }
.ls-tile { display:flex; gap:0.55rem; align-items:flex-start; cursor:pointer;
  padding:0.7rem 0.8rem; border:1px solid var(--hair); border-radius:11px;
  transition:border-color .15s, background .15s }
.ls-tile:hover { border-color:var(--border) }
.ls-tile.on { border-color:rgba(176,118,26,0.55); background:rgba(176,118,26,0.09) }
.ls-name { font-size:0.9rem; line-height:1.25; font-weight:530 }
.ls-gate { font-size:0.75rem; color:var(--muted); margin-top:2px }
