/* BTC / ETH / SOL 每日研究 — public static site
   Dark theme: black background, gold numbers, green/red accents.
   Fixed left sidebar TOC 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.14);
  --cyan: #5ec8d8;
  --cyan-dim: rgba(94, 200, 216, 0.14);
  --blue: #8aa4ff;
  --warn: #f0c14b;
  --sidebar-w: 280px;
  --header-h: 0px;
  --radius: 12px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --font: "Source Han Sans TC", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei",
    "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: 16px;
  line-height: 1.65;
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden; /* safety net; real overflow is fixed on the elements below */
  -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; }
a:hover { text-decoration: underline; }
button, select { font-family: inherit; }
img, svg, canvas, video { 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.55);
  z-index: 40;
}

.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: 22px 20px 14px;
  border-bottom: 1px solid var(--line-soft);
  flex-shrink: 0;
}
.brand h1 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  line-height: 1.35;
}
.brand p {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}
.picker {
  padding: 14px 16px 10px;
  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;
}
.coin-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.coin-switch button {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--muted);
  border-radius: 8px;
  padding: 7px 0;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.coin-switch button:hover { border-color: var(--gold); color: var(--text); }
.coin-switch button.active {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold-2);
}
.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: 16px;
  cursor: pointer;
}
.date-select:focus { outline: 1px solid var(--gold); }

.toc {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px 16px;
  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); }
.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 16px;
  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;
}

/* ---------- typography / sections ---------- */
.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: 12px 16px;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 22px;
}
.disclaimer strong { color: var(--warn); }
.meta-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 24px;
  margin: 0 0 28px;
  font-size: 13px;
  color: var(--muted);
}
.meta-row dt { color: var(--dim); font-size: 11px; letter-spacing: 0.04em; }
.meta-row dd { margin: 2px 0 0; color: var(--text); }

section.block {
  margin: 0 0 36px;
  scroll-margin-top: 24px;
}
section.block > h2 {
  margin: 0 0 8px;
  font-size: 20px;
  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; }
.lede { margin: 0 0 8px; color: var(--text); }
.sub { margin: 0 0 16px; color: var(--muted); font-size: 14.5px; }

/* ---------- metrics ---------- */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 14px 0;
}
.metric {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.metric .k { font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }
.metric .v {
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  margin: 4px 0 2px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.metric .v.danger { color: var(--red); }
.metric .v.success { color: var(--green); }
.metric .d { font-size: 12px; color: var(--muted); line-height: 1.4; }

/* ---------- tables ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 10px 0 14px;
  max-width: 100%;
  min-width: 0;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 0;
}
th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
th {
  color: var(--dim);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
td { color: var(--text); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.now, .tone-warning { color: var(--gold-2); font-weight: 650; }
.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  background: var(--bg-hover);
  color: var(--text);
}
.badge.up, .badge.偏多, .badge.观察多 { background: var(--green-dim); color: var(--green); }
.badge.down, .badge.偏空, .badge.观察空 { background: var(--red-dim); color: var(--red); }
.badge.中性, .badge.震荡, .badge.结构 { background: var(--cyan-dim); color: var(--cyan); }

/* ---------- charts ---------- */
.chart {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 8px 8px 4px;
  margin: 10px 0 12px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}
.chart svg { display: block; width: 100%; max-width: 100%; height: auto; overflow: hidden; }
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  font-size: 12px;
  color: var(--muted);
  padding: 0 8px 4px;
}
.chart-legend i {
  display: inline-block;
  width: 16px;
  height: 2px;
  margin-right: 6px;
  vertical-align: middle;
  background: currentColor;
}
.bars { display: grid; gap: 8px; margin: 12px 0; }
.bar-row { display: grid; grid-template-columns: 140px 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 .val { color: var(--gold); font-variant-numeric: tabular-nums; font-weight: 650; }

/* ---------- cards / lists ---------- */
.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: 14px 16px;
}
.card h3 { margin: 0 0 4px; font-size: 14px; }
.card .role { color: var(--gold); font-size: 12px; margin: 0 0 8px; }
.card ul, .bullets { margin: 0; padding-left: 18px; }
.card li, .bullets li { margin: 0 0 6px; }
.turns { list-style: none; margin: 0 0 16px; padding: 0; }
.turns li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}
.turns .t { color: var(--gold); font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 650; }
.turns .title { font-weight: 650; }
.turns .sub { color: var(--muted); font-size: 13px; }

.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: 12px 14px;
  margin: 10px 0 14px;
}
.callout.info { border-left-color: var(--cyan); }
.callout.warn { border-left-color: var(--warn); background: rgba(240, 193, 75, 0.05); }
.callout .lead { font-weight: 700; color: var(--gold-2); margin: 0 0 6px; font-size: 13px; }
.callout p { margin: 0 0 6px; }
.callout p:last-child { margin: 0; }

.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); }

.hist-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 12px;
  margin: 0 8px 8px 0;
  cursor: pointer;
  font-size: 13px;
}
.hist-btn.active, .hist-btn:hover {
  border-color: var(--gold);
  color: var(--gold-2);
  background: var(--gold-dim);
}

.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; }

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

/* ---------- 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)); }
  .sidebar {
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    width: min(88vw, 320px);
    max-width: 100%;
    box-shadow: var(--shadow);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .nav-backdrop { display: block; }
  /* Opening the drawer must not widen the document */
  body.nav-open { overflow-x: hidden; }
  .main {
    margin-left: 0;
    height: auto;
    overflow-x: hidden;
    overflow-y: visible;
    max-width: 100%;
    min-width: 0;
    padding: 64px max(16px, env(safe-area-inset-right)) 72px max(16px, env(safe-area-inset-left));
  }
  .wrap { max-width: 100%; min-width: 0; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .meta-row { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 1fr; gap: 4px; min-width: 0; }
  .turns li { grid-template-columns: 1fr; gap: 2px; }
  table { min-width: 0; width: 100%; }
  th, td { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
  th { white-space: normal; }
}

@media (max-width: 520px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric .v { font-size: 18px; }
  section.block > h2 { font-size: 18px; }
}

/* ---------- language switcher ---------- */
.lang-switch {
  display: flex;
  gap: 4px;
  margin: 10px 0 0;
}
.lang-switch button {
  flex: 1;
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--muted);
  border-radius: 7px;
  padding: 5px 0;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.lang-switch button:hover { border-color: var(--gold); color: var(--text); }
.lang-switch button.active {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold-2);
}
.lang-switch-mobile {
  display: none;
  position: fixed;
  top: 12px;
  right: max(12px, env(safe-area-inset-right));
  z-index: 60;
  gap: 4px;
  max-width: calc(100% - 72px);
  flex-wrap: wrap;
  justify-content: flex-end;
}
.lang-switch-mobile button {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--muted);
  border-radius: 8px;
  padding: 8px 9px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.lang-switch-mobile button.active {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold-2);
}

/* ---------- metric cards: value + chip + footnote, never a paragraph as the value ---------- */
.metric .v-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 4px 0 2px;
  flex-wrap: wrap;
}
.metric .v-row .v { margin: 0; }
.metric.prose .v {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  letter-spacing: 0;
}
.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); }
.metric .d { font-size: 11.5px; color: var(--dim); line-height: 1.4; }
.note-tip {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--dim);
  cursor: help;
  font-size: 12px;
  padding: 0 0 0 2px;
  line-height: 1;
}
.note-tip:hover { color: var(--gold); }

/* ---------- event priority ---------- */
.pri {
  display: inline-block;
  min-width: 28px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  border-radius: 4px;
  padding: 1px 5px;
  margin-right: 6px;
}
.pri-1 { background: #ef5b5b; color: #1a0a0a; }
.pri-2 { background: rgba(239, 91, 91, 0.45); color: #ffd6d6; }
.pri-3 { background: #3a3a3e; color: #b0aca6; }
tr.pri-row-1 td:first-child, .event-card.pri-1, .day-card.pri-1 {
  box-shadow: inset 3px 0 0 #ef5b5b;
}
tr.pri-row-2 td:first-child, .event-card.pri-2, .day-card.pri-2 {
  box-shadow: inset 3px 0 0 rgba(239, 91, 91, 0.5);
}
tr.pri-row-3 td:first-child, .event-card.pri-3, .day-card.pri-3 {
  box-shadow: inset 3px 0 0 #5a5752;
}

/* ---------- sentiment / long-short / scenarios ---------- */
tr.tone-bull td:first-child, .idea-card.tone-bull, .x-item.tone-bull, .sc-bull {
  box-shadow: inset 3px 0 0 var(--green);
}
tr.tone-bear td:first-child, .idea-card.tone-bear, .x-item.tone-bear, .sc-bear {
  box-shadow: inset 3px 0 0 var(--red);
}
tr.tone-range td:first-child, .idea-card.tone-range, .x-item.tone-neutral, .sc-range {
  box-shadow: inset 3px 0 0 #8a8680;
}
.badge.bull, .badge.tone-bull { background: var(--green-dim); color: var(--green); }
.badge.bear, .badge.tone-bear { background: var(--red-dim); color: var(--red); }
.badge.range, .badge.tone-range, .badge.tone-neutral { background: #2a2a2e; color: #c8c4bc; }

/* ---------- ETF bar chart ---------- */
.etf-chart { margin: 8px 0 12px; }
.etf-sums {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}
.etf-sums strong { color: var(--gold); font-variant-numeric: tabular-nums; }
.etf-sums strong.up { color: var(--green); }
.etf-sums strong.down { color: var(--red); }

@media (max-width: 900px) {
  .lang-switch-mobile { display: flex; }
  .nav-toggle { left: max(12px, env(safe-area-inset-left)); }
}

/* ---------- five-day / idea / x-news cards ---------- */
.day-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 10px;
  margin: 12px 0;
}
.day-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 12px 10px 14px;
}
.day-card .day-h {
  font-weight: 700;
  color: var(--gold-2);
  margin: 0 0 8px;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.event-line {
  font-size: 13px;
  color: var(--text);
  margin: 0 0 6px;
  line-height: 1.45;
}
.day-card .caption { margin: 8px 0 0; }

.idea-grid, .x-list {
  display: grid;
  gap: 10px;
  margin: 8px 0 14px;
}
.idea-card, .x-item {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 12px 10px 14px;
}
.idea-card .idea-h, .x-item .x-h {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 8px;
  font-weight: 700;
  color: var(--text);
}
.idea-dl {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 4px 10px;
  margin: 0;
  font-size: 13px;
}
.idea-dl dt { color: var(--muted); font-weight: 600; }
.idea-dl dd { margin: 0; color: var(--text); }
.x-item .x-meta {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 6px;
}
.x-item p { margin: 0; font-size: 13.5px; line-height: 1.5; }
.x-item a, .idea-card a { color: var(--gold-2); }
.scenario-row td:first-child { white-space: nowrap; }
.etf-sub { margin: 0 0 8px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.lang-switch-mobile { align-items: center; }

/* ---------- prose split: short paragraphs with spacing ---------- */
.prose-split { display: flex; flex-direction: column; gap: 8px; }
.prose-split p { margin: 0; line-height: 1.55; }
.callout .prose-split { margin-top: 2px; }
.lede.prose-split, .sub.prose-split { margin: 8px 0; }
.card .prose-split, .day-card .prose-split { margin-top: 4px; }

/* ---------- collapsed sources ---------- */
details.src-fold {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}
details.src-fold summary {
  cursor: pointer;
  color: var(--gold-2);
  font-weight: 650;
  font-size: 12px;
  letter-spacing: 0.02em;
  list-style-position: inside;
}
details.src-fold summary:hover { color: var(--gold); }
details.src-fold .src-body {
  margin: 8px 0 0;
  padding: 8px 10px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: anywhere;
  overflow-x: auto;
  max-width: 100%;
  min-width: 0;
}
details.src-fold .src-body a { color: var(--gold-2); }
.src-fold.block-fold { margin: 10px 0 0; }
.src-fold.block-fold .src-body { padding: 10px 12px; }
.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: 1px;
  background: var(--bg-hover);
  color: var(--muted);
}
.tag.ok { background: var(--green-dim); color: var(--green); }
.tag.warn { background: rgba(240, 193, 75, 0.15); color: var(--warn); }

/* ---------- structured trade idea cards ---------- */
.idea-card .idea-h { margin-bottom: 10px; }
.idea-grid-rows {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px 14px;
  margin: 0;
  align-items: start;
  min-width: 0;
}
.idea-grid-rows dt {
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: none;
  padding-top: 4px;
}
.idea-grid-rows dd { margin: 0; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.idea-px {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 20px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: var(--gold-2);
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}
.idea-px.sl { color: var(--red); }
.idea-px.tp { color: var(--green); }
.idea-px.sm { font-size: 16px; }
.tp-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
}
.tp-pair .tp-lab {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 2px;
  font-family: inherit;
}
.idea-mid, .idea-hint {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}
.idea-rr {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.idea-empty { color: var(--dim); font-size: 16px; }
@media (max-width: 900px) {
  .idea-px { font-size: 18px; }
  .idea-grid-rows { grid-template-columns: 64px minmax(0, 1fr); gap: 8px 10px; }
}

.src-short {
  margin-left: 6px;
  font-size: 12px;
  color: var(--muted);
}
.idea-h .tag { margin-left: 8px; }
.bullets .tag, .bullets .src-fold, .bullets .src-short { display: inline-block; }
.bullets li .src-fold { margin-top: 6px; }

/* ---------- mobile overflow / iOS zoom ---------- */
.idea-card, .x-item, .card, .day-card, .callout, .metric, .disclaimer,
.x-list, .idea-grid, section.block, .src-fold, .prose-split, .etf-sums {
  max-width: 100%;
  min-width: 0;
}
.metrics, .grid-2, .meta-row, .tp-pair { min-width: 0; }
.metric .v, .metric .d, .lede, .sub, .caption, .event-line, .x-item p, .bullets li {
  overflow-wrap: anywhere;
}
a { overflow-wrap: anywhere; }
.scenario-row td:first-child { white-space: nowrap; }
@media (max-width: 900px) {
  .scenario-row td:first-child { white-space: normal; }
  .lang-switch-mobile { display: flex; }
}

/* ---------- Benny Wallet sign-in gate ---------- */
body.gated { overflow: hidden; }
body.gated .nav-toggle,
body.gated .lang-switch-mobile,
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: 10px;
  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;
}

/* QR sign-in (computers) */
.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); }
