/* Benny Stock Research (stock.gobennyapp.com)
   Visual system matched 1:1 with report.gobennyapp.com:
   Deep dark obsidian background, gold numbers, emerald/crimson risk accents.
   Fixed 280px left sidebar on desktop; hamburger drawer on mobile.
*/
:root {
  --bg: #070708;
  --bg-elev: #101012;
  --bg-card: #161618;
  --bg-hover: #1e1e22;
  --line: #2a2a2e;
  --line-soft: #1c1c20;
  --text: #eceae6;
  --muted: #9a958c;
  --dim: #6f6b64;
  --gold: #e0b84d;
  --gold-2: #f3d27a;
  --gold-dim: rgba(224, 184, 77, 0.16);
  --green: #3dcf8a;
  --green-dim: rgba(61, 207, 138, 0.14);
  --red: #ef5b5b;
  --red-dim: rgba(239, 91, 91, 0.15);
  --cyan: #5ec8d8;
  --cyan-dim: rgba(94, 200, 216, 0.14);
  --warn: #f0c14b;
  --sidebar-w: 292px;
  --radius: 12px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --font: "PingFang SC", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei",
    "Noto Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.65;
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  overflow: hidden;
  overflow-x: hidden;
  height: 100vh;
}
a { color: var(--gold-2); text-decoration: none; overflow-wrap: anywhere; }
a:hover { text-decoration: underline; }
button, select { font-family: inherit; }
img, svg { max-width: 100%; height: auto; }

/* ---------- layout ---------- */
.nav-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 60;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--gold);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  z-index: 40;
}

.mobile-top-sub {
  display: none;
  position: fixed;
  top: 12px;
  right: max(12px, env(safe-area-inset-right));
  z-index: 60;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: #0c0c0e;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow: hidden;
}
.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.brand {
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--line-soft);
  flex-shrink: 0;
}
.brand h1 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  line-height: 1.35;
}
.brand p {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
}

.picker {
  padding: 14px 16px 12px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line-soft);
}
.picker-label {
  display: block;
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.06em;
  margin: 0 0 6px;
}

.sector-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.sector-switch button {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--muted);
  border-radius: 8px;
  padding: 7px 4px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sector-switch button:hover:not(:disabled) { border-color: var(--gold); color: var(--text); }
.sector-switch button.active {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold-2);
}
.sector-switch button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Subscription card in sidebar */
.sub-box {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.sub-box.is-subscribed {
  border-color: rgba(61, 207, 138, 0.42);
  background: linear-gradient(180deg, rgba(61, 207, 138, 0.08), rgba(22, 22, 24, 0.96));
}
.sub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.sub-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.sub-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dim);
  flex-shrink: 0;
}
.sub-box.is-subscribed .sub-dot {
  background: var(--green);
  box-shadow: 0 0 8px rgba(61, 207, 138, 0.7);
}
.sub-count {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.sub-desc {
  margin: 0 0 8px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
}
.sub-btn {
  display: block;
  width: 100%;
  appearance: none;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: #141414;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s, border-color 0.15s;
}
.sub-btn.is-on {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}
.sub-btn.is-on:hover:not(:disabled) {
  border-color: var(--red);
  color: var(--red);
}
.sub-btn:disabled { opacity: 0.55; cursor: default; }

.date-select {
  width: 100%;
  appearance: none;
  background: var(--bg-elev) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%239a958c' d='M1 1l5 5 5-5'/></svg>") no-repeat right 10px center;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 28px 8px 10px;
  font-size: 14px;
  cursor: pointer;
}
.date-select:focus { outline: 1px solid var(--gold); }

.slot-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}
.slot-switch button {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--muted);
  border-radius: 8px;
  padding: 6px 3px;
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}
.slot-switch button:hover:not(:disabled) { border-color: var(--gold); color: var(--text); }
.slot-switch button.active {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold-2);
}
.slot-switch button:disabled { opacity: 0.35; cursor: not-allowed; }
.slot-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dim);
  flex-shrink: 0;
}
.slot-dot.alert, .slot-dot.escalated { background: var(--red); }
.slot-dot.relief { background: var(--green); }
.slot-dot.stable { background: var(--gold); }

.toc {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px 14px;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}
.toc a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  padding: 7px 12px;
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  line-height: 1.4;
}
.toc a:hover { color: var(--text); background: var(--bg-hover); text-decoration: none; }
.toc a.active {
  color: var(--gold-2);
  background: var(--gold-dim);
  border-left-color: var(--gold);
  font-weight: 650;
}

.sidebar-foot {
  flex-shrink: 0;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 11px;
  color: var(--dim);
  line-height: 1.45;
}

.main {
  margin-left: var(--sidebar-w);
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px 36px 80px;
  scroll-behavior: smooth;
}
.wrap {
  max-width: 1080px;
  margin: 0 auto;
}

/* ---------- banners & typography ---------- */
.disclaimer {
  background: linear-gradient(180deg, rgba(240, 193, 75, 0.1), rgba(240, 193, 75, 0.04));
  border: 1px solid rgba(240, 193, 75, 0.28);
  border-radius: var(--radius);
  padding: 11px 15px;
  color: var(--text);
  font-size: 13.5px;
  margin-bottom: 18px;
}
.disclaimer strong { color: var(--warn); }

.sub-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: linear-gradient(135deg, rgba(224, 184, 77, 0.12), rgba(22, 22, 24, 0.96));
  border: 1px solid rgba(224, 184, 77, 0.36);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.sub-banner strong { display: block; font-size: 14.5px; color: var(--gold-2); margin-bottom: 2px; }
.sub-banner p { margin: 0; font-size: 13px; color: var(--muted); }
.sub-banner .sub-btn { width: auto; min-width: 138px; padding: 9px 14px; flex-shrink: 0; }

.risk-hero {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 20px;
}
.risk-hero.level-alert, .risk-hero.level-escalated {
  border-color: rgba(239, 91, 91, 0.4);
  border-left-color: var(--red);
  background: linear-gradient(180deg, rgba(239, 91, 91, 0.12), rgba(22, 22, 24, 0.96));
}
.risk-hero.level-relief {
  border-color: rgba(61, 207, 138, 0.38);
  border-left-color: var(--green);
  background: linear-gradient(180deg, rgba(61, 207, 138, 0.1), rgba(22, 22, 24, 0.96));
}
.risk-hero-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-bottom: 10px;
}
.risk-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.risk-pill.alert, .risk-pill.escalated { background: var(--red-dim); color: var(--red); }
.risk-pill.relief { background: var(--green-dim); color: var(--green); }
.risk-pill.stable { background: var(--gold-dim); color: var(--gold-2); }
.slot-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-hover);
  color: var(--muted);
}
.risk-hero h1 {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.35;
  color: var(--text);
}
.risk-hero .lede {
  margin: 0 0 12px;
  font-size: 14.5px;
  color: var(--text);
}
.sector-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.sector-tag {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--muted);
}

.meta-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 20px;
  margin: 0 0 24px;
  padding: 12px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  font-size: 13px;
}
.meta-row dt { color: var(--dim); font-size: 11px; letter-spacing: 0.04em; }
.meta-row dd { margin: 2px 0 0; color: var(--text); font-variant-numeric: tabular-nums; }

section.block {
  margin: 0 0 34px;
  scroll-margin-top: 24px;
}
section.block > h2 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.caption { color: var(--muted); font-size: 13px; margin: 0 0 14px; }

/* ---------- KPI metrics ---------- */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 14px 0 18px;
}
.metric {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  min-width: 0;
}
.metric .k { font-size: 11.5px; color: var(--muted); letter-spacing: 0.03em; }
.metric .v-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 5px 0 3px;
  flex-wrap: wrap;
}
.metric .v {
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.metric .v.danger { color: var(--red); }
.metric .v.success { color: var(--green); }
.metric .d { font-size: 11.5px; color: var(--dim); line-height: 1.4; overflow-wrap: anywhere; }

.chip {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  white-space: nowrap;
}
.chip.up { background: var(--green-dim); color: var(--green); }
.chip.down { background: var(--red-dim); color: var(--red); }
.chip.neutral { background: var(--bg-hover); color: var(--muted); }
.chip.warn { background: rgba(240, 193, 75, 0.16); color: var(--warn); }

/* ---------- tables ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 10px 0 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: 0; }
th {
  color: var(--dim);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  background: var(--bg-elev);
}
td { color: var(--text); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.row-alert { background: rgba(239, 91, 91, 0.06); }
.sym-cell { display: flex; align-items: center; gap: 8px; }
.sym-code { font-family: var(--mono); font-weight: 700; color: var(--gold-2); font-size: 13.5px; }
.sym-name { font-size: 11.5px; color: var(--muted); }
.group-tag {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-hover);
  color: var(--muted);
  white-space: nowrap;
}
.group-tag.semiconductor { background: var(--gold-dim); color: var(--gold-2); }
.group-tag.benchmark { background: var(--cyan-dim); color: var(--cyan); }
.vol-hot { color: var(--warn); font-weight: 700; }
.spark-svg { width: 64px; height: 22px; display: block; margin-left: auto; }

/* ---------- cards, callouts, bars ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  min-width: 0;
}
.card.fact-card { border-top: 2px solid var(--green); }
.card.unverified-card { border-top: 2px solid var(--warn); }
.card h3 { margin: 0 0 10px; font-size: 15px; display: flex; align-items: center; gap: 8px; }

.evidence-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.evidence-list li {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.evidence-list li:last-child { padding-bottom: 0; border-bottom: 0; }
.ev-title { font-weight: 700; font-size: 14px; color: var(--text); margin: 0 0 4px; }
.ev-detail { font-size: 13.5px; color: var(--muted); margin: 0 0 6px; line-height: 1.55; }
.ev-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--dim);
}

.callout {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 13px 16px;
  margin: 10px 0 14px;
}
.callout.warn { border-left-color: var(--warn); background: rgba(240, 193, 75, 0.05); }
.callout.danger { border-left-color: var(--red); background: rgba(239, 91, 91, 0.07); }
.callout.info { border-left-color: var(--cyan); }
.callout .lead { font-weight: 700; color: var(--gold-2); margin: 0 0 6px; font-size: 13.5px; }
.callout p { margin: 0 0 6px; font-size: 14px; }
.callout p:last-child { margin: 0; }

.bars { display: grid; gap: 10px; margin: 12px 0; }
.bar-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .lab { color: var(--muted); }
.bar-row .track { height: 8px; background: var(--bg-elev); border-radius: 99px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--gold); border-radius: 99px; }
.bar-row .fill.down { background: var(--red); }
.bar-row .fill.up { background: var(--green); }
.bar-row .val { color: var(--gold); font-variant-numeric: tabular-nums; font-weight: 700; min-width: 72px; text-align: right; }

/* Watchlist cards */
.watch-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.watch-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: inset 3px 0 0 var(--gold);
}
.watch-card.pri-1 { box-shadow: inset 3px 0 0 var(--red); }
.watch-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 14.5px;
}
.pri {
  display: inline-block;
  min-width: 28px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  border-radius: 4px;
  padding: 1px 5px;
  flex-shrink: 0;
}
.pri-1 { background: #ef5b5b; color: #1a0a0a; }
.pri-2 { background: rgba(224, 184, 77, 0.25); color: var(--gold-2); }
.watch-dl {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 4px 10px;
  margin: 0;
  font-size: 13px;
}
.watch-dl dt { color: var(--dim); font-weight: 600; }
.watch-dl dd { margin: 0; color: var(--muted); }

/* History & source links */
.hist-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.hist-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hist-btn.active, .hist-btn:hover {
  border-color: var(--gold);
  color: var(--gold-2);
  background: var(--gold-dim);
}

.links { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.links a {
  display: inline-block;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text);
  text-decoration: none;
}
.links a:hover { border-color: var(--gold); color: var(--gold-2); }

.empty-state {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 22px;
  text-align: center;
}
.empty-state h2 { margin: 0 0 10px; font-size: 20px; color: var(--gold-2); }
.empty-state p { margin: 0 auto 16px; max-width: 560px; color: var(--muted); font-size: 14px; }
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0;
  text-align: left;
}
.schedule-item {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}
.schedule-item strong { display: block; color: var(--gold-2); font-size: 14px; margin-bottom: 4px; }
.schedule-item .t { font-family: var(--mono); font-size: 12.5px; color: var(--text); }
.schedule-item .d { font-size: 12px; color: var(--muted); margin-top: 6px; }

.footer-note {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 12.5px;
}

.backtop {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 30;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--gold);
  cursor: pointer;
  box-shadow: var(--shadow);
  display: none;
}
.backtop.show { display: inline-flex; align-items: center; justify-content: center; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  z-index: 120;
  background: #1d1d22;
  border: 1px solid var(--gold);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: var(--red); color: #ffd4d4; }

/* ---------- Benny Wallet sign-in gate (matched 1:1 with report.gobennyapp.com) ---------- */
body.gated { overflow: hidden; }
body.gated .nav-toggle,
body.gated .mobile-top-sub,
body.gated .sidebar,
body.gated .main,
body.gated .backtop { visibility: hidden; }
.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
}
.gate[hidden] { display: none; }
.gate-card {
  width: 100%;
  max-width: 400px;
  padding: 28px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  text-align: center;
}
.gate-brand {
  color: var(--gold);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  margin-bottom: 18px;
}
.gate-title { margin: 0 0 10px; font-size: 20px; color: var(--text); }
.gate-body { margin: 0 0 20px; color: var(--muted); line-height: 1.6; font-size: 14px; }
.gate-actions { display: flex; flex-direction: column; gap: 10px; }
.gate-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--gold);
  border-radius: 10px;
  background: var(--gold);
  color: #141414;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  text-align: center;
  cursor: pointer;
}
.gate-btn:disabled { opacity: 0.55; cursor: default; }
.gate-btn.ghost { background: transparent; color: var(--gold-2); }
.gate-note { min-height: 1.4em; margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--dim);
}
.account[hidden] { display: none; }
.account-addr { font-family: var(--mono); }
.account-out {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  padding: 4px 10px;
  cursor: pointer;
}
.gate-qr {
  width: 232px;
  height: 232px;
  margin: 4px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.gate-qr svg { width: 100%; height: 100%; display: block; }
.gate-qr .gate-note { color: #6f6b64; margin: 0; }
.gate-qr .gate-btn { width: auto; margin: 0 16px; }
.gate-qr-done { font-size: 64px; color: var(--green); }
.gate-foot { margin: 16px 0 0; font-size: 13px; color: var(--dim); }

/* ---------- mobile drawer ---------- */
@media (max-width: 900px) {
  html, body {
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
    max-width: 100%;
  }
  .nav-toggle { display: inline-flex; left: max(12px, env(safe-area-inset-left)); }
  .mobile-top-sub { display: block; }
  .mobile-top-sub .sub-btn {
    width: auto;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 12px;
    box-shadow: var(--shadow);
  }
  .mobile-top-sub .sub-btn.is-on {
    background: var(--bg-card);
    border-color: rgba(61, 207, 138, 0.5);
    color: var(--green);
  }
  .sidebar {
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    width: min(88vw, 320px);
    max-width: 100%;
    box-shadow: var(--shadow);
  }
  .sidebar .brand {
    padding: 14px 18px 14px 68px;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .nav-backdrop { display: block; }
  body.nav-open .mobile-top-sub { opacity: 0; pointer-events: none; }
  .main {
    margin-left: 0;
    height: auto;
    overflow-x: hidden;
    overflow-y: visible;
    max-width: 100%;
    min-width: 0;
    padding: 66px max(14px, env(safe-area-inset-right)) 72px max(14px, env(safe-area-inset-left));
  }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .watch-grid, .meta-row, .schedule-grid { grid-template-columns: 1fr; }
  .sub-banner { flex-direction: column; align-items: stretch; }
  .sub-banner .sub-btn { width: 100%; }
  .bar-row { grid-template-columns: 1fr; gap: 4px; }
  .bar-row .val { text-align: left; }
  .risk-hero h1 { font-size: 19px; }
}

@media (max-width: 520px) {
  .metric .v { font-size: 18px; }
  section.block > h2 { font-size: 17.5px; }
  th, td { padding: 8px 8px; font-size: 12.5px; }
}
