/* ============================================================================
   RJStreams Portfolio — design system
   "Trading terminal for card investors": dark, precise, financial-app
   confidence with baseball-card warmth. Big monospace figures, sharp red
   accent, gains in green. Fully responsive (viewed on iPhone).
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700;800;900&family=Hanken+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600;700&display=swap');

:root {
  /* surfaces */
  --bg: #0a0a0c;
  --bg-elev: #141418;
  --bg-elev-2: #1b1b21;
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-strong: rgba(255, 255, 255, 0.14);

  /* brand + semantic */
  --red: #ff3b3b;
  --red-deep: #b30000;
  --gain: #22d67f;
  --gain-dim: rgba(34, 214, 127, 0.14);
  --loss: #ff4d4d;
  --loss-dim: rgba(255, 77, 77, 0.14);

  /* rarity accents */
  --diamond: #5fd3ff;
  --gold: #ffbf3b;
  --silver: #cfd6e0;
  --bronze: #d08b4f;

  /* text */
  --text: #f5f5f7;
  --text-muted: #9a9aa5;
  --text-faint: #6a6a76;

  /* type */
  --font-display: 'Archivo', system-ui, sans-serif;
  --font-body: 'Hanken Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1080px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Atmospheric background: red glow up top + faint rotated "diamond" grid */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(179, 0, 0, 0.28), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(179, 0, 0, 0.10), transparent 55%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  inset: -50%;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 46px 46px;
  transform: rotate(45deg);
  pointer-events: none;
  z-index: 0;
}

main { position: relative; z-index: 1; }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0; gap: 16px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 36px;
}
.brand {
  font-family: var(--font-display); font-weight: 900; font-size: 1.15rem;
  letter-spacing: -0.02em; text-transform: uppercase; color: var(--text);
  display: flex; align-items: center; gap: 11px; text-decoration: none;
  transition: opacity .15s;
}
.brand:hover { opacity: 0.85; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(255, 59, 59, 0.35);
  box-shadow: 0 0 16px rgba(179, 0, 0, 0.5);
}
.topbar-right { display: flex; align-items: center; gap: 14px; font-size: 0.9rem; color: var(--text-muted); }
.topbar-right a { color: var(--text-muted); text-decoration: none; transition: color .15s; }
.topbar-right a:hover, .topbar-right a:focus-visible { color: var(--text); }

/* ---------- nav ---------- */
.nav { display: flex; gap: 4px; margin-right: auto; margin-left: 26px; }
.nav a {
  font-family: var(--font-display); font-weight: 700; font-size: 0.8rem;
  letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none;
  color: var(--text-muted); padding: 7px 13px; border-radius: 9px;
  position: relative; transition: color .15s, background .15s;
}
.nav a:hover, .nav a:focus-visible { color: var(--text); background: rgba(255,255,255,0.05); }
.nav a:active { background: rgba(255,255,255,0.08); }
.nav a.active { color: var(--text); }
.nav a.active::after {
  content: ''; position: absolute; left: 13px; right: 13px; bottom: 1px; height: 2px;
  background: var(--red); border-radius: 2px; box-shadow: 0 0 8px var(--red);
}
/* Admin-only Insights link (only rendered for admins). A small red dot marks it
   as the operator view without shouting. */
.nav a.admin-link { padding-left: 20px; }
.nav a.admin-link::before {
  content: ''; position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 6px var(--red);
}

/* ---------- inner page header ---------- */
.page-head { padding: 6px 0 30px; }
.page-head .kicker {
  font-family: var(--font-display); font-weight: 700;
  font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 10px;
}
.page-head h1 {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(2rem, 6vw, 3rem); line-height: 1; letter-spacing: -0.025em;
}
.page-head .sub { margin-top: 12px; }

/* ---------- badges ---------- */
.badge {
  font-family: var(--font-mono); font-weight: 700; font-size: 0.68rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 6px; display: inline-block;
}
.badge-buy { background: rgba(255,255,255,0.07); color: var(--text-muted); border: 1px solid var(--hairline-strong); }
.badge-sell { background: rgba(255,59,59,0.12); color: var(--red); border: 1px solid rgba(255,59,59,0.3); }
.badge-owned { background: var(--gain-dim); color: var(--gain); border: 1px solid rgba(34,214,127,0.3); }
.badge-live { background: rgba(255,59,59,0.12); color: var(--red); border: 1px solid rgba(255,59,59,0.3); }
.badge-lf { background: rgba(255,191,59,0.1); color: var(--gold); border: 1px solid rgba(255,191,59,0.3); }
.badge-cell { width: 1%; white-space: nowrap; padding-right: 14px; }
.card-name .badge { margin-left: 8px; vertical-align: 1px; }

/* trade tables */
.holdings td.pl { font-weight: 700; }
.holdings td.pl.up { color: var(--gain); }
.holdings td.pl.down { color: var(--loss); }
.holdings td.date { color: var(--text-faint); font-size: 0.84rem; white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  font-family: var(--font-display); font-weight: 700; font-size: 0.9rem;
  letter-spacing: 0.01em; text-decoration: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 20px; border-radius: 12px; border: 0;
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  color: #fff; transition: transform .15s ease, box-shadow .15s ease, filter .15s;
  box-shadow: 0 6px 22px rgba(179,0,0,0.35);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(179,0,0,0.5); filter: brightness(1.06); }
.btn:active { transform: translateY(0); }
.btn-ghost {
  background: var(--bg-elev); color: var(--text);
  border: 1px solid var(--hairline-strong); box-shadow: none;
}
.btn-ghost:hover { background: var(--bg-elev-2); box-shadow: none; }
/* landing hero CTA — sits between the headline and the lede */
.btn-hero { font-size: 1rem; padding: 15px 26px; margin: 10px 0 28px; }
/* landing-page community buttons — the lede's own margin provides the gap above */
.btn-row { display: flex; gap: 14px; margin-top: 0; flex-wrap: wrap; justify-content: center; }
.btn-blurple {
  --glow: 154, 164, 255;
  background: linear-gradient(135deg, #5865F2, #4550c9);
  box-shadow: 0 6px 22px rgba(88, 101, 242, 0.35);
}
.btn-blurple:hover { box-shadow: 0 10px 30px rgba(88, 101, 242, 0.5); }
.btn-whop {
  --glow: 255, 150, 110;
  background: linear-gradient(135deg, #ff6243, #d63d1f);
  box-shadow: 0 6px 22px rgba(255, 98, 67, 0.35);
}
.btn-whop:hover { box-shadow: 0 10px 30px rgba(255, 98, 67, 0.5); }

/* Spotlight glow: a cursor-tracking light that runs along the button's border
   ring as the pointer approaches. --bx/--by are set per-button by base.html's
   pointermove handler (element-relative coords -- viewport-fixed backgrounds
   would break inside the .reveal transform wrappers). Defaults park the
   spotlight far off-element so nothing renders until the pointer is near. */
.btn { position: relative; }
/* soft halo hugging the outside edge near the cursor */
.btn::before {
  content: ""; pointer-events: none;
  position: absolute; inset: -5px; padding: 5px; border-radius: 17px;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  background: radial-gradient(
    150px 150px at calc(var(--bx, -9999) * 1px + 3px) calc(var(--by, -9999) * 1px + 3px),
    rgba(var(--glow, 255, 110, 110), 0.9), transparent 100%
  );
  filter: blur(5px) brightness(1.5);
}
/* crisp white-hot core running along the border ring itself */
.btn::after {
  content: ""; pointer-events: none;
  position: absolute; inset: -2px; padding: 2px; border-radius: 14px;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  background: radial-gradient(
    70px 70px at calc(var(--bx, -9999) * 1px) calc(var(--by, -9999) * 1px),
    rgba(255, 255, 255, 1), transparent 100%
  );
}

/* ---------- panels ---------- */
.panel {
  background: linear-gradient(180deg, var(--bg-elev), #101014);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 26px;
  position: relative;
  overflow: hidden;
}
.panel-label {
  font-family: var(--font-display); font-weight: 700;
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 18px;
}

/* ---------- hero value ---------- */
.hero {
  text-align: center; padding: 30px 0 42px;
  position: relative;
}
/* the hero sits directly on the site-wide atmospheric background (same as
   the sign-in page) -- RJ's call 2026-07-05, replacing the aurora waves */
.hero .kicker {
  font-family: var(--font-display); font-weight: 700;
  font-size: 0.74rem; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 14px;
}
.hero .value {
  font-family: var(--font-mono); font-weight: 700;
  font-size: clamp(3.2rem, 12vw, 6.4rem); line-height: 0.95;
  letter-spacing: -0.02em; color: #fff;
  text-shadow: 0 0 40px rgba(255, 59, 59, 0.35);
  font-variant-numeric: tabular-nums;
}
.hero .value .stub { color: var(--text-faint); font-size: 0.42em; margin-left: 10px; letter-spacing: 0.1em; }
.hero .breakdown {
  font-family: var(--font-mono); font-size: 0.92rem; color: var(--text-muted);
  margin-top: 12px; font-variant-numeric: tabular-nums;
}
.hero .sub { margin-top: 18px; display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }

.pill {
  font-family: var(--font-mono); font-weight: 600; font-size: 0.9rem;
  padding: 7px 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 7px;
}
.pill.up { background: var(--gain-dim); color: var(--gain); }
.pill.down { background: var(--loss-dim); color: var(--loss); }
.pill.neutral { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.sync-note { font-size: 0.82rem; color: var(--text-faint); }

/* ---------- stat strip ---------- */
.stat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px;
}
.stat-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1080px) { .stat-grid-4 { grid-template-columns: repeat(2, 1fr); } }

/* glow layer behind each stat tile (ported from a React motion GlowEffect
   component -- "static" mode + medium blur, recolored from the original
   blue/purple/orange to the brand red family and kept deliberately dim) */
.glow-card { position: relative; }
.glow-card::before {
  content: ''; position: absolute; inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(to right, #b30000, #ff3b3b, #dc143c, #7a0d1a);
  filter: blur(12px);
  opacity: 0.28;
  pointer-events: none;
}
.glow-card > .stat, .glow-card > .panel { position: relative; height: 100%; }
/* the glow replaces the old red accent line on any tile it wraps */
.glow-card .stat::before { display: none; }

.stat {
  background: linear-gradient(180deg, var(--bg-elev), #101014);
  border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 22px; position: relative; overflow: hidden;
}
.stat::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--red), transparent);
}
.stat .stat-label {
  font-family: var(--font-display); font-weight: 700; font-size: 0.7rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 12px;
}
.stat .stat-value {
  font-family: var(--font-mono); font-weight: 700; font-size: 1.9rem;
  letter-spacing: -0.01em; font-variant-numeric: tabular-nums; color: #fff;
}
.stat .stat-value.up { color: var(--gain); }
.stat .stat-value.down { color: var(--loss); }
.stat .stat-meta { font-size: 0.82rem; color: var(--text-muted); margin-top: 6px; }

/* win-rate ring */
.ring-wrap { display: flex; align-items: center; gap: 16px; }
.ring {
  --pct: 0;
  width: 62px; height: 62px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--gain) calc(var(--pct) * 1%), rgba(255,255,255,0.08) 0);
  display: grid; place-items: center; position: relative;
}
.ring::after {
  content: ''; position: absolute; inset: 6px; border-radius: 50%; background: var(--bg-elev);
}
.ring span {
  position: relative; z-index: 1; font-family: var(--font-mono); font-weight: 700;
  font-size: 0.92rem; color: #fff;
}

/* ---------- two column ---------- */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

/* ---------- holdings table ---------- */
.holdings { width: 100%; border-collapse: collapse; }
.holdings th {
  font-family: var(--font-display); font-weight: 700; font-size: 0.68rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint);
  text-align: left; padding: 0 0 12px; border-bottom: 1px solid var(--hairline);
}
.holdings th.num, .holdings td.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; padding-left: 14px; }
/* click-to-sort headers (holdings page Qty/Value) */
.holdings th.sortable { cursor: pointer; user-select: none; transition: color .12s; }
.holdings th.sortable:hover { color: var(--text); }
.holdings th.sortable::after { content: ' ↕'; opacity: 0.35; }
.holdings th.sortable.sort-desc::after { content: ' ↓'; opacity: 1; color: var(--red); }
.holdings th.sortable.sort-asc::after { content: ' ↑'; opacity: 1; color: var(--red); }
.holdings td { padding: 14px 0; border-bottom: 1px solid var(--hairline); font-size: 0.95rem; }
.holdings tr:last-child td { border-bottom: 0; }
.holdings tr { transition: background .12s; }
.holdings tbody tr:hover { background: rgba(255,255,255,0.02); }
.rank { color: var(--text-faint); font-family: var(--font-mono); font-size: 0.82rem; width: 28px; }
.card-name { font-weight: 600; }
.val-strong { color: #fff; font-weight: 700; }

/* diamond hands rows */
.dh-row { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.dh-row:last-child { border-bottom: 0; }
.dh-row .lbl { color: var(--text-muted); font-size: 0.92rem; }
.dh-row .amt { font-family: var(--font-mono); font-weight: 700; font-variant-numeric: tabular-nums; }
.dh-row.total .lbl { color: var(--text); font-weight: 600; }
.dh-row.total .amt { font-size: 1.15rem; }

/* diversification meter */
.meter { height: 10px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; margin: 16px 0 10px; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--red), var(--gold)); }
.big-pct { font-family: var(--font-mono); font-weight: 700; font-size: 2.4rem; color: #fff; }

/* panel header row: label left, bucket total / filter pills right */
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.bucket-total {
  font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.bucket-total span { color: var(--text-faint); font-size: 0.72em; letter-spacing: 0.08em; }
.view-all {
  display: inline-block; margin-top: 14px; text-decoration: none;
  font-family: var(--font-display); font-weight: 700; font-size: 0.84rem;
  color: var(--red);
}
.view-all:hover { text-decoration: underline; }

/* ---------- win share-card ---------- */
.share-cell { width: 1%; white-space: nowrap; }
.share-flip, .share-pill {
  font-family: var(--font-display); font-weight: 700; font-size: 0.74rem;
  padding: 5px 12px; border-radius: 999px; cursor: pointer;
  background: rgba(255,59,59,0.1); color: var(--red);
  border: 1px solid rgba(255,59,59,0.3);
  transition: background .15s, border-color .15s;
}
.share-flip:hover, .share-pill:hover { background: rgba(255,59,59,0.2); border-color: rgba(255,59,59,0.55); }
.share-modal {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: rgba(5,5,7,0.82); padding: 24px;
}
.share-modal[hidden] { display: none; }
.share-modal-box { display: flex; flex-direction: column; align-items: center; gap: 18px; max-width: 460px; width: 100%; }
.share-canvas {
  width: 100%; height: auto; border-radius: var(--radius);
  border: 1px solid var(--hairline-strong); display: block;
}
.share-modal-row { display: flex; gap: 12px; }

/* quiet settings row (connect page) */
.settings-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  font-size: 0.86rem; color: var(--text-muted); flex-wrap: wrap;
  padding: 4px 2px; margin-bottom: 22px;
}
.settings-row label { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.settings-row input[type="checkbox"] { accent-color: var(--red); width: 15px; height: 15px; }
.settings-row .btn { padding: 7px 14px; font-size: 0.8rem; }

/* ---------- leaderboard ---------- */
.lb-rank-col { width: 1%; }
.lb-rank { font-family: var(--font-mono); font-weight: 700; padding-right: 22px !important; }
.lb-rank-1 { color: var(--gold); }
.lb-rank-2 { color: var(--silver); }
.lb-rank-3 { color: var(--bronze); }
.lb-rank-rest { color: var(--text-faint); }

/* ---------- portfolio history chart ---------- */
.chart-host { position: relative; margin-top: 10px; }
.chart-host svg { display: block; }
.chart-host svg:focus { outline: none; }
.chart-host svg:focus-visible { outline: 1px solid var(--hairline-strong); border-radius: 8px; }
.chart-grid { stroke: rgba(255,255,255,0.06); stroke-width: 1; }
.chart-tick {
  fill: var(--text-faint); font-size: 11px;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
}
.chart-crosshair { stroke: rgba(255,255,255,0.2); stroke-width: 1; }
.chart-tip {
  position: absolute; pointer-events: none; opacity: 0; transition: opacity .12s;
  background: #1b1b21; border: 1px solid var(--hairline-strong);
  border-radius: 8px; padding: 8px 12px; text-align: center; white-space: nowrap;
}
.chart-tip-value { font-family: var(--font-mono); font-weight: 700; font-size: 0.9rem; color: var(--text); }
.chart-tip-label { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

/* UpgradeAI projection cell + freshness note */
.proj-col { white-space: nowrap; }
.proj-col .proj { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.proj-note { font-size: 0.78rem; color: var(--text-faint); margin: 8px 0 4px; }

/* bucket filter pills (holdings page) */
.filter-pills { display: flex; gap: 8px; }
.filter-pill {
  font-family: var(--font-display); font-weight: 700; font-size: 0.78rem;
  padding: 6px 14px; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,0.05); color: var(--text-muted);
  border: 1px solid var(--hairline-strong);
  transition: background .15s, color .15s, border-color .15s;
}
.filter-pill:hover { background: rgba(255,255,255,0.09); color: var(--text); }
.filter-pill.active { background: rgba(255,59,59,0.14); color: var(--red); border-color: rgba(255,59,59,0.4); }

/* ---------- section heading ---------- */
.section-h {
  font-family: var(--font-display); font-weight: 800; font-size: 1.05rem;
  letter-spacing: -0.01em; margin: 0 0 16px; display: flex; align-items: center; gap: 10px;
}

/* ---------- login / gate pages ---------- */
.center-stage {
  min-height: 82vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 40px 0;
}
/* brand logo medallion on the gate pages */
.hero-logo {
  width: 118px; height: 118px; border-radius: 50%;
  border: 1px solid rgba(255, 59, 59, 0.4);
  box-shadow: 0 0 60px rgba(179, 0, 0, 0.55), 0 12px 40px rgba(0,0,0,0.6);
  margin-bottom: 26px;
}
/* "MLB The Show Investing" wordmark lockup (mirrors the banner) */
.brand-lockup {
  font-family: var(--font-display); font-weight: 800;
  font-size: 0.9rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 18px;
}
.brand-lockup span { color: var(--text); }

.hero-title {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(2.6rem, 8vw, 5rem); line-height: 0.98; letter-spacing: -0.03em;
  max-width: 15ch; margin-bottom: 20px;
}
.hero-title .accent { color: var(--red); }
.lede { font-size: 1.1rem; color: var(--text-muted); max-width: 46ch; margin-bottom: 34px; }
.eyebrow {
  font-family: var(--font-display); font-weight: 700; font-size: 0.74rem;
  letter-spacing: 0.24em; text-transform: uppercase; color: var(--red);
  margin-bottom: 20px; padding: 6px 14px; border: 1px solid rgba(255,59,59,0.3); border-radius: 999px;
}
.feature-row { display: flex; gap: 28px; margin-top: 46px; flex-wrap: wrap; justify-content: center; color: var(--text-faint); font-size: 0.86rem; }
.feature-row b { color: var(--text); font-family: var(--font-mono); }

/* ---------- connect page ---------- */
.doc { max-width: 720px; margin: 0 auto; }
.doc h1 { font-family: var(--font-display); font-weight: 900; font-size: 2rem; letter-spacing: -0.02em; margin-bottom: 8px; }
.doc .sub { color: var(--text-muted); margin-bottom: 30px; }
.steps { counter-reset: step; list-style: none; margin: 8px 0; }
.steps li { position: relative; padding: 0 0 18px 44px; color: var(--text-muted); }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: -2px; width: 28px; height: 28px;
  background: var(--bg-elev-2); border: 1px solid var(--hairline-strong);
  border-radius: 8px; display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 0.82rem; color: var(--red);
}
.steps li b { color: var(--text); }
.info-list { list-style: none; margin: 6px 0; }
.info-list li { padding: 8px 0 8px 22px; position: relative; color: var(--text-muted); font-size: 0.92rem; }
.info-list li::before { content: ''; position: absolute; left: 0; top: 13px; width: 6px; height: 6px; background: var(--red); border-radius: 1px; transform: rotate(45deg); }
.info-list li b { color: var(--text); }
textarea {
  width: 100%; font-family: var(--font-mono); font-size: 0.85rem;
  background: var(--bg); color: var(--text); border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm); padding: 14px; margin: 10px 0 18px; resize: vertical; min-height: 96px;
}
textarea:focus { outline: none; border-color: var(--red); }
label { font-family: var(--font-display); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); }
.error {
  background: var(--loss-dim); border: 1px solid rgba(255,77,77,0.3); color: #ffd7d7;
  padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 0.92rem;
}

/* ---------- reveal animation ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.reveal { opacity: 0; animation: rise .6s cubic-bezier(.2,.7,.2,1) forwards; }
.reveal:nth-child(1) { animation-delay: .04s; }
.reveal:nth-child(2) { animation-delay: .10s; }
.reveal:nth-child(3) { animation-delay: .16s; }
.reveal:nth-child(4) { animation-delay: .22s; }
.reveal:nth-child(5) { animation-delay: .28s; }
.reveal:nth-child(6) { animation-delay: .34s; }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; opacity: 1; } }

.spacer { height: 16px; }
.muted { color: var(--text-muted); }
.footer-note { text-align: center; color: var(--text-faint); font-size: 0.82rem; padding: 40px 0; }

/* ---------- responsive (iPhone-first viewing) ---------- */
@media (max-width: 720px) {
  .stat-grid { grid-template-columns: 1fr; }
  .cols { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .nav { order: 3; width: 100%; margin: 4px -13px 0; }
  .panel { padding: 20px; }
  .holdings th.hide-sm, .holdings td.hide-sm { display: none; }
  .portfolio-holdings th:nth-child(3), .portfolio-holdings td:nth-child(3) { display: none; } /* hide qty on narrow */
}
