/* ============================================================
   ForexFin Pro — design tokens + dual theme
   Two aesthetics share one structure, switched via
   [data-aesthetic="evolved" | "bolder"] on <html>.
   Accent + density are independent tweaks.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
::selection { background: color-mix(in oklch, var(--accent) 35%, transparent); color: var(--text); }

:root {
  /* accent (independent tweak) */
  --accent: #f0b000;
  --accent-ink: #1a1404;

  /* data / ghost line / compliant chips (brand blue) */
  --data: #3b82f6;

  /* semantic P&L */
  --pos: oklch(0.80 0.15 158);
  --neg: oklch(0.68 0.20 24);
  --warn: oklch(0.83 0.14 80);

  /* density multiplier (tweak: compact .85 / regular 1 / comfy 1.18) */
  --d: 1;

  --r-sm: 7px;
  --r: 11px;
  --r-lg: 16px;
  --r-xl: 22px;

  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 30px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 30px 70px -25px rgba(0,0,0,.75);

  --ease: cubic-bezier(.2,.7,.2,1);
}

/* ---------- EVOLVED : the real ForexFin brand, refined ----------
   amber #f0b000 + blue #3b82f6 on near-black #0a0a0a (matches the live site) */
[data-aesthetic="evolved"] {
  --bg:      #0a0a0a;
  --bg-1:    #0e0e0f;
  --bg-2:    #141414;
  --bg-3:    #1b1b1c;
  --raise:   #202021;
  --line:    rgba(255,255,255,.08);
  --line-2:  rgba(255,255,255,.15);
  --text:    #ededed;
  --text-2:  #a5a5a8;
  --text-3:  #6c6c70;

  --font-display: "IBM Plex Sans", system-ui, sans-serif;
  --font-ui: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --h1: 30px; --h2: 21px; --h3: 16px;
  --display-wght: 600; --display-tracking: -0.01em;
  --metric: 30px; --metric-wght: 600;
  --card-bd: 1px solid var(--line);
  --card-bg: var(--bg-2);
}

/* ---------- BOLDER : the striking refresh ---------- */
[data-aesthetic="bolder"] {
  --bg:      #06080d;
  --bg-1:    #0a0d14;
  --bg-2:    #0e121b;
  --bg-3:    #121722;
  --raise:   #161c28;
  --line:    rgba(255,255,255,.10);
  --line-2:  rgba(255,255,255,.18);
  --text:    #f3f6fb;
  --text-2:  #aab6c7;
  --text-3:  #66748a;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-ui: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --h1: 42px; --h2: 26px; --h3: 17px;
  --display-wght: 700; --display-tracking: -0.03em;
  --metric: 40px; --metric-wght: 700;
  --card-bd: 1px solid var(--line);
  --card-bg: var(--bg-2);
}

/* ============================================================
   BASE
   ============================================================ */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
#root { min-height: 100vh; }

h1,h2,h3,h4 { margin: 0; font-family: var(--font-display); letter-spacing: var(--display-tracking); font-weight: var(--display-wght); line-height: 1.1; }
h1 { font-size: var(--h1); }
h2 { font-size: var(--h2); }
h3 { font-size: var(--h3); letter-spacing: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
[data-action] { cursor: pointer; }
.nav-section { cursor: default; user-select: none; }
input, select, textarea { font-family: inherit; }
.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.dim { color: var(--text-2); }
.mute { color: var(--text-3); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.up::before { content: "▲ "; font-size: .7em; }
.down::before { content: "▼ "; font-size: .7em; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-3);
}

/* ============================================================
   APP SHELL
   ============================================================ */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.shell.collapsed { grid-template-columns: 76px 1fr; }

/* Sidebar */
.sidebar {
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-1), var(--bg));
  display: flex; flex-direction: column;
  padding: 18px 14px;
  gap: 4px;
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--accent), color-mix(in oklch, var(--accent) 55%, #000));
  display: grid; place-items: center; color: var(--accent-ink);
  font-family: var(--font-display); font-weight: 800; font-size: 16px;
  box-shadow: 0 6px 18px -6px var(--accent);
}
.brand .word { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand .word b { color: var(--accent); font-weight: 800; }
.brand .pro {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .12em;
  border: 1px solid var(--line-2); color: var(--text-2);
  padding: 2px 5px; border-radius: 5px; margin-left: auto; text-transform: uppercase;
}
.collapsed .brand .word, .collapsed .brand .pro, .collapsed .nav-link span, .collapsed .nav-section { display: none; }

.nav-section { font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); padding: 16px 10px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: calc(9px * var(--d)) 10px; border-radius: var(--r-sm);
  color: var(--text-2); font-size: 13.5px; font-weight: 500;
  transition: background .15s var(--ease), color .15s var(--ease);
  position: relative; white-space: nowrap;
}
.nav-link svg { width: 18px; height: 18px; flex: 0 0 auto; }
.nav-link:hover { background: var(--bg-2); color: var(--text); }
.nav-link.active { background: color-mix(in oklch, var(--accent) 14%, transparent); color: var(--text); }
.nav-link.active::before { content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%); width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-link .tag { margin-left: auto; font-family: var(--font-mono); font-size: 9px; padding: 1px 5px; border-radius: 20px; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.collapsed .nav-link { justify-content: center; padding-left: 0; padding-right: 0; }
.collapsed .nav-link .tag { display: none; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.upgrade-card {
  border: 1px solid color-mix(in oklch, var(--accent) 30%, var(--line));
  background: radial-gradient(120% 120% at 0% 0%, color-mix(in oklch, var(--accent) 16%, transparent), transparent 60%), var(--bg-2);
  border-radius: var(--r); padding: 14px;
}
.collapsed .upgrade-card .u-body, .collapsed .upgrade-card h4 { display: none; }
.upgrade-card h4 { font-size: 14px; margin-bottom: 4px; }
.upgrade-card .u-body { font-size: 12px; color: var(--text-2); margin-bottom: 11px; line-height: 1.45; }

.acct { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-sm); }
.acct:hover { background: var(--bg-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto; background: linear-gradient(135deg, #3a4763, #232c3e); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--text); border: 1px solid var(--line-2); }
.acct .who { min-width: 0; }
.acct .who b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct .who span { display: block; font-size: 11px; color: var(--text-3); }
.collapsed .acct .who { display: none; }

/* Main column */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 28px;
  background: color-mix(in oklch, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.collapse-btn, .icon-btn {
  width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center;
  color: var(--text-2); border: 1px solid transparent; transition: .15s var(--ease);
}
.icon-btn:hover, .collapse-btn:hover { background: var(--bg-2); color: var(--text); }
.icon-btn { position: relative; }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
.searchbar {
  flex: 1; max-width: 440px; display: flex; align-items: center; gap: 9px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 8px 12px; color: var(--text-3);
}
.searchbar input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 13px; }
.searchbar kbd { font-family: var(--font-mono); font-size: 10px; border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 5px; color: var(--text-3); }
.spacer { flex: 1; }

.content { padding: 26px 28px 80px; max-width: 1320px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--text-2); font-size: 13.5px; margin-top: 6px; }

/* ============================================================
   PRIMITIVES
   ============================================================ */
.card { background: var(--card-bg); border: var(--card-bd); border-radius: var(--r); padding: calc(18px * var(--d)); position: relative; }
.card.pad-lg { padding: calc(22px * var(--d)); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3 { font-size: 14px; }
.card-title-row { display: flex; align-items: center; gap: 9px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--line-2); color: var(--text); background: var(--bg-2);
  transition: .15s var(--ease); white-space: nowrap;
}
.btn:hover { border-color: var(--line-2); background: var(--bg-3); transform: translateY(-1px); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 700; box-shadow: 0 10px 24px -12px var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--bg-2); color: var(--text); }
.btn.sm { padding: 7px 12px; font-size: 12.5px; }
.btn.lg { padding: 13px 22px; font-size: 15px; }
.btn.block { width: 100%; }
.btn.locked:disabled, .btn.locked:disabled:hover { opacity: .45; cursor: not-allowed; transform: none; background: transparent; color: var(--text-2); }   /* 2026-09-16: a locked "Write retrospective" looked clickable */

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; border: 1px solid var(--line); color: var(--text-2);
  background: var(--bg-1); white-space: nowrap;
}
.chip.on { border-color: color-mix(in oklch, var(--accent) 45%, transparent); color: var(--text); background: color-mix(in oklch, var(--accent) 14%, transparent); }
.chip button { display: grid; place-items: center; color: inherit; opacity: .6; }
.chip button:hover { opacity: 1; }

.badge { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .03em; padding: 3px 8px; border-radius: 6px; text-transform: uppercase; }
.badge.win { color: var(--pos); background: color-mix(in oklch, var(--pos) 16%, transparent); }
.badge.loss { color: var(--neg); background: color-mix(in oklch, var(--neg) 16%, transparent); }
.badge.open { color: var(--accent); background: color-mix(in oklch, var(--accent) 16%, transparent); }
.badge.be { color: var(--text-2); background: var(--bg-3); }

/* ---- behavioral journal: tag selects, detector chips, tilt banner, matrix ---- */
.tags-cell { white-space: nowrap; }
.tags-cell .tag-sel + .tag-sel { margin-left: 5px; }
.tag-sel {
  appearance: none; -webkit-appearance: none;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
  padding: 3px 18px 3px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg-1); color: var(--text-2);
  cursor: pointer; max-width: 128px; outline: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 10px) 9px, calc(100% - 6px) 9px; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat;
}
.tag-sel:focus { border-color: color-mix(in oklch, var(--accent) 55%, transparent); }
.tag-sel.untagged { border-style: dashed; color: var(--text-3); }
.tag-sel.ok  { color: var(--data); background-color: color-mix(in oklch, var(--data) 14%, var(--bg-1)); border-color: color-mix(in oklch, var(--data) 40%, transparent); }
.tag-sel.bad { color: var(--neg);  background-color: color-mix(in oklch, var(--neg) 14%, var(--bg-1));  border-color: color-mix(in oklch, var(--neg) 40%, transparent); }
.tag-sel.none { display: inline-block; background-image: none; padding-right: 8px; cursor: default; }
.tag-sel option { background: var(--bg-2); color: var(--text); font-family: var(--font-ui); font-size: 13px; }
.flags-cell { white-space: nowrap; }
.flag-chip { display: inline-block; font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .03em; padding: 2px 7px; border-radius: 6px; margin-right: 4px; white-space: nowrap; }
.flag-chip.violation { color: var(--neg); background: color-mix(in oklch, var(--neg) 16%, transparent); border: 1px solid color-mix(in oklch, var(--neg) 30%, transparent); }
.flag-chip.info { color: var(--text-2); background: var(--bg-3); border: 1px solid var(--line); }
.tilt-banner {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 12px 16px; border-radius: var(--r);
  border: 1px solid color-mix(in oklch, var(--neg) 35%, var(--line));
  background: linear-gradient(100deg, color-mix(in oklch, var(--neg) 10%, var(--bg-2)), var(--bg-2) 60%);
  font-size: 13px; line-height: 1.45;
}
.tilt-banner > svg { color: var(--neg); flex: 0 0 auto; }
.tilt-banner > div { flex: 1; min-width: 0; }
.tbl.matrix td, .tbl.matrix th { padding: 9px 12px; }
.tbl.matrix tbody tr { cursor: default; }
.tbl.matrix tbody tr:hover { background: transparent; }
.tbl.matrix tr.dimrow td { color: var(--text-3); }
.dot-tag { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.dot-tag.ok { background: var(--data); }
.dot-tag.bad { background: var(--neg); }
.dot-tag.none { background: var(--text-3); }
@media (max-width: 860px) {
  .tilt-banner { flex-wrap: wrap; }
}

.beta-badge { display: inline-block; vertical-align: middle; margin-left: 6px; font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px; border-radius: 20px; color: var(--data); border: 1px solid color-mix(in oklch, var(--data) 45%, transparent); background: color-mix(in oklch, var(--data) 10%, transparent); white-space: nowrap; cursor: help; }
.pill-tag { font-size: 11px; padding: 3px 9px; border-radius: 6px; background: var(--bg-3); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }

.divider { height: 1px; background: var(--line); margin: 0; border: 0; }

/* metric */
.metric-val { font-family: var(--font-display); font-size: var(--metric); font-weight: var(--metric-wght); line-height: 1; letter-spacing: -.02em; }
.metric-lab { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }

/* grids */
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; } /* wide tables scroll inside .tbl-wrap instead of stretching the column */
.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi-row .metric-val { overflow-wrap: anywhere; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3,1fr); }
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }

/* table */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); font-weight: 600; padding: 0 14px 11px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { transition: background .12s var(--ease); cursor: pointer; }
.tbl tbody tr:hover { background: var(--bg-1); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.pair-cell { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.dir-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.dir-dot.long { background: var(--pos); }
.dir-dot.short { background: var(--neg); }

/* watchlist row */
.wl-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.wl-row:last-child { border-bottom: none; }
.wl-pair { font-weight: 600; font-size: 13.5px; }
.wl-px { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 13.5px; }
.wl-chg { font-family: var(--font-mono); font-size: 12px; text-align: right; min-width: 64px; }

/* progress / bars */
.bar-track { height: 7px; border-radius: 20px; background: var(--bg-3); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 20px; background: var(--accent); }

/* segmented control */
.seg { display: inline-flex; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg button { padding: 6px 13px; border-radius: 5px; font-size: 12.5px; font-weight: 600; color: var(--text-2); transition: .12s var(--ease); }
.seg button.on { background: var(--bg-3); color: var(--text); box-shadow: var(--shadow); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button { padding: 11px 4px; margin-right: 18px; font-size: 13.5px; font-weight: 600; color: var(--text-3); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: .15s var(--ease); }
.tabs button:hover { color: var(--text-2); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }

/* calendar heatmap */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cal > * { min-width: 0; }   /* amounts with cents wrap inside the cell instead of widening the month */
.cal-cell { aspect-ratio: 1; border-radius: 6px; background: var(--bg-1); border: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; padding: 5px 6px; font-size: 10px; color: var(--text-3); position: relative; transition: transform .12s var(--ease); }
.cal-cell.has:hover { transform: scale(1.08); z-index: 2; }
.cal-cell .pl { font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; line-height: 1.15; overflow-wrap: anywhere; }
.cal-dow { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); text-align: center; padding-bottom: 4px; }

/* tooltip-ish */
.kbar { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.kbar .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.kbar .col .b { width: 100%; border-radius: 5px 5px 2px 2px; min-height: 3px; transition: height .5s var(--ease); }
.kbar .col .lab { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); }

/* banner / monetization */
.broker-banner {
  border: 1px solid color-mix(in oklch, var(--warn) 30%, var(--line));
  background: linear-gradient(100deg, color-mix(in oklch, var(--warn) 9%, var(--bg-2)), var(--bg-2) 55%);
  border-radius: var(--r); padding: 16px 18px; display: flex; align-items: center; gap: 16px;
}
.broker-banner .ico { width: 40px; height: 40px; border-radius: 10px; background: color-mix(in oklch, var(--warn) 18%, transparent); display: grid; place-items: center; color: var(--warn); flex: 0 0 auto; }

.affil-note { font-size: 10.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }

/* empty / gate */
.gate {
  border: 1px dashed var(--line-2); border-radius: var(--r); padding: 30px; text-align: center;
  background: repeating-linear-gradient(135deg, transparent, transparent 9px, color-mix(in oklch, var(--accent) 4%, transparent) 9px, color-mix(in oklch, var(--accent) 4%, transparent) 10px);
}
.lock-ico { width: 44px; height: 44px; border-radius: 12px; background: color-mix(in oklch, var(--accent) 14%, transparent); color: var(--accent); display: grid; place-items: center; margin: 0 auto 14px; }

/* pricing */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
.price-card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; background: var(--bg-2); display: flex; flex-direction: column; position: relative; }
.price-card.feature { border-color: color-mix(in oklch, var(--accent) 50%, transparent); background: radial-gradient(130% 90% at 50% 0%, color-mix(in oklch, var(--accent) 12%, transparent), transparent 60%), var(--bg-2); box-shadow: var(--shadow-lg); }
.price-card .tier { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.price-card .amt { font-family: var(--font-display); font-size: 44px; font-weight: var(--display-wght); letter-spacing: -.03em; margin: 14px 0 2px; }
.price-card .amt small { font-size: 15px; color: var(--text-3); font-weight: 500; letter-spacing: 0; }
.price-feat { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); padding: 8px 0; }
.price-feat svg { width: 16px; height: 16px; color: var(--accent); flex: 0 0 auto; margin-top: 2px; }
.ribbon { position: absolute; top: 16px; right: 16px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; background: var(--accent); color: var(--accent-ink); padding: 4px 10px; border-radius: 20px; font-weight: 700; }

/* modal */
.scrim { position: fixed; inset: 0; background: rgba(3,5,9,.66); backdrop-filter: blur(3px); z-index: 90; display: grid; place-items: center; padding: 24px; animation: fade .2s var(--ease); }
.modal { width: 100%; max-width: 540px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); animation: pop .24s var(--ease); max-height: 90vh; overflow: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 3; background: var(--bg-2); }   /* above .retro-item (position: relative), which painted over it */
.modal-body { padding: 22px; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 10px 12px; color: var(--text); font-size: 13.5px; outline: none; transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: color-mix(in oklch, var(--accent) 55%, transparent); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* 2026-10-09: grid children default to min-width:auto, so a datetime-local input pushed the second column past the modal edge at 400px. */
.field-row > .field { min-width: 0; }
.field-row input, .field-row select { min-width: 0; max-width: 100%; }

/* toast */
.toast { pointer-events: none; position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 120; background: var(--raise); border: 1px solid var(--line-2); border-radius: var(--r); padding: 12px 18px; display: flex; gap: 10px; align-items: center; font-size: 13.5px; box-shadow: var(--shadow-lg); animation: pop .25s var(--ease); }
.toast .ok { color: var(--pos); }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes rise { from { transform: translateY(10px); } to { transform: none; } }
/* base state is fully visible; only animate when motion is welcome so capture/print/
   reduced-motion always show content even if the animation timeline is paused */
.rise { will-change: transform; }
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise .5s var(--ease) both; }
}

/* ============================================================
   MOBILE
   ============================================================ */
.mobile-tabbar { display: none; }
.mobile-only { display: none; }

@media (max-width: 1080px) {
  .dash-grid { grid-template-columns: 1fr; }
  .price-grid { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; }
  .price-card.feature { order: -1; }
}

@media (max-width: 860px) {
  .shell, .shell.collapsed { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-only { display: flex; }
  .content { padding: 18px 16px 96px; }
  .topbar { padding: 12px 16px; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .searchbar { display: none; }
  .mobile-tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    background: color-mix(in oklch, var(--bg-1) 94%, transparent); backdrop-filter: blur(16px);
    border-top: 1px solid var(--line); padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  }
  .mtab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; color: var(--text-3); font-size: 10px; font-weight: 600; }
  .mtab svg { width: 21px; height: 21px; }
  .mtab.active { color: var(--accent); }
  h1 { font-size: calc(var(--h1) * .82); }
  .metric-val { font-size: calc(var(--metric) * .8); }
  .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl { min-width: 640px; }
}

/* ============================================================
   PUBLIC SITE (tools funnel)
   ============================================================ */
.pub { min-height: 100vh; display: flex; flex-direction: column; }
.pub-wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 28px; }

.pub-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklch, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.pub-header .pub-wrap { display: flex; align-items: center; gap: 22px; height: 64px; }
.pub-nav { display: flex; align-items: center; gap: 4px; margin-left: 10px; }
.pub-nav a { padding: 8px 12px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 500; color: var(--text-2); transition: .15s var(--ease); }
.pub-nav a:hover { color: var(--text); background: var(--bg-2); }
.pub-nav a.cur { color: var(--text); }
.pub-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* hero */
.hero { padding: 60px 0 30px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 80% at 85% -10%, color-mix(in oklch, var(--accent) 14%, transparent), transparent 60%),
    radial-gradient(50% 60% at 0% 0%, color-mix(in oklch, var(--accent) 7%, transparent), transparent 55%);
}
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(34px, 4.4vw, 56px); line-height: 1.04; margin-bottom: 18px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lede { font-size: 17px; line-height: 1.6; color: var(--text-2); max-width: 30em; margin-bottom: 26px; }
.hero-tags { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.trust-row { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; color: var(--text-3); font-size: 13px; }
.trust-row b { color: var(--text); font-weight: 600; }

/* calculator card */
.calc { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: hidden; }
.calc-tabs { display: flex; border-bottom: 1px solid var(--line); background: var(--bg-1); }
.calc-tabs button { flex: 1; padding: 14px 8px; font-size: 13px; font-weight: 600; color: var(--text-3); border-bottom: 2px solid transparent; transition: .15s var(--ease); }
.calc-tabs button.on { color: var(--text); border-bottom-color: var(--accent); background: var(--bg-2); }
.calc-body { padding: 24px; }
.calc-out {
  margin-top: 20px; padding: 20px; border-radius: var(--r);
  background: radial-gradient(120% 120% at 100% 0%, color-mix(in oklch, var(--accent) 12%, transparent), transparent 60%), var(--bg-1);
  border: 1px solid color-mix(in oklch, var(--accent) 24%, var(--line));
}
.calc-out .big { font-family: var(--font-display); font-size: 40px; font-weight: var(--metric-wght); letter-spacing: -.02em; line-height: 1; color: var(--accent); }

.range-field { margin-bottom: 16px; }
.range-field .rl { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-size: 13px; }
.range-field .rl b { font-family: var(--font-mono); font-weight: 600; font-size: 14px; }
input[type=range].slider { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 20px; background: var(--bg-3); outline: none; }
input[type=range].slider::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); cursor: pointer; box-shadow: 0 2px 8px -2px var(--accent); border: 2px solid var(--bg-2); }
input[type=range].slider::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); cursor: pointer; border: 2px solid var(--bg-2); }

/* sections */
.sec { padding: 56px 0; }
.sec-head { text-align: center; max-width: 640px; margin: 0 auto 38px; }
.sec-head h2 { font-size: clamp(26px, 3vw, 36px); margin-bottom: 12px; }
.sec-head p { color: var(--text-2); font-size: 15.5px; line-height: 1.6; }

.feature-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-card { padding: 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-2); }
.feature-card .fi { width: 42px; height: 42px; border-radius: 11px; background: color-mix(in oklch, var(--accent) 14%, transparent); color: var(--accent); display: grid; place-items: center; margin-bottom: 16px; }
.feature-card h3 { font-size: 17px; margin-bottom: 8px; }
.feature-card p { color: var(--text-2); font-size: 13.5px; line-height: 1.55; }

/* funnel banner */
.funnel {
  border-radius: var(--r-xl); padding: 44px; text-align: center; position: relative; overflow: hidden;
  border: 1px solid color-mix(in oklch, var(--accent) 32%, var(--line));
  background: radial-gradient(120% 130% at 50% 0%, color-mix(in oklch, var(--accent) 16%, transparent), transparent 60%), var(--bg-2);
}
.funnel h2 { font-size: clamp(26px, 3vw, 38px); margin-bottom: 14px; }
.funnel p { color: var(--text-2); font-size: 16px; max-width: 34em; margin: 0 auto 26px; line-height: 1.6; }

/* FAQ (GEO/AEO) */
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q { width: 100%; text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 4px; font-size: 16px; font-weight: 600; color: var(--text); }
.faq-q .pm { color: var(--accent); flex: 0 0 auto; transition: transform .2s var(--ease); }
.faq-q[aria-expanded="true"] .pm { transform: rotate(45deg); }
.faq-a { overflow: hidden; max-height: 0; transition: max-height .28s var(--ease); }
.faq-a.open { max-height: 320px; }
.faq-a p { padding: 0 4px 20px; color: var(--text-2); font-size: 14.5px; line-height: 1.65; max-width: 70ch; }

/* footer */
.pub-footer { margin-top: auto; border-top: 1px solid var(--line); padding: 40px 0; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.foot-col h4 { font-size: 12px; font-family: var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin-bottom: 14px; }
.foot-col a { display: block; color: var(--text-2); font-size: 13.5px; padding: 5px 0; }
.foot-col a:hover { color: var(--text); }

/* auth modal extra */
.auth-aside { background: radial-gradient(120% 120% at 0% 0%, color-mix(in oklch, var(--accent) 18%, transparent), transparent 55%), var(--bg-1); padding: 26px; border-right: 1px solid var(--line); }
.auth-benefit { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text-2); padding: 7px 0; }
.auth-benefit svg { color: var(--accent); flex: 0 0 auto; margin-top: 1px; }
.seg-auth { display: flex; gap: 0; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; margin-bottom: 20px; }
.seg-auth button { flex: 1; padding: 10px; font-size: 13.5px; font-weight: 600; color: var(--text-2); background: var(--bg-1); }
.seg-auth button.on { background: var(--bg-3); color: var(--text); }

@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .feature-3 { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .pub-nav { display: none; }
}
@media (max-width: 560px) {
  .pub-wrap { padding: 0 16px; }
  .funnel { padding: 30px 22px; }
}

/* ============================================================
   TOOLS PAGE — expressive tweak axes (scoped to .pub)
   Each axis reshapes several properties at once, not one knob.
   Defaults equal the shipped look, so "off" = unchanged.
   ============================================================ */
.pub {
  /* Energy (typographic temperament) */
  --hero-fs: clamp(34px, 4.4vw, 56px); --hero-wght: 700; --hero-track: -0.02em; --hero-pt: 60px;
  --head-fs: clamp(26px, 3vw, 36px); --eyebrow-track: .18em;
  /* Surface (material) */
  --surf-bg: var(--bg-2); --surf-bd: 1px solid var(--line-2); --surf-sh: var(--shadow-lg); --surf-blur: 0px; --surf-r: var(--r-xl);
}
.pub[data-energy="calm"] {
  --hero-fs: clamp(28px, 3vw, 41px); --hero-wght: 600; --hero-track: 0; --hero-pt: 50px;
  --head-fs: clamp(23px, 2.4vw, 30px); --eyebrow-track: .14em;
}
.pub[data-energy="loud"] {
  --hero-fs: clamp(42px, 6.4vw, 84px); --hero-wght: 800; --hero-track: -0.045em; --hero-pt: 78px;
  --head-fs: clamp(30px, 4.2vw, 50px); --eyebrow-track: .26em;
}
.pub .hero { padding-top: var(--hero-pt); }
.pub .hero h1 { font-size: var(--hero-fs); font-weight: var(--hero-wght); letter-spacing: var(--hero-track); }
.pub .sec-head h2, .pub .funnel h2 { font-size: var(--head-fs); }
.pub .eyebrow { letter-spacing: var(--eyebrow-track); }
.pub[data-energy="loud"] .hero .lede { font-size: 18.5px; }
.pub[data-energy="loud"] .calc-body > .btn.primary,
.pub[data-energy="loud"] .funnel .btn.primary,
.pub[data-energy="loud"] .calc-body > .btn[style] { padding: 15px 18px; font-size: 15.5px; }
.pub[data-energy="calm"] .hero-tags { opacity: .85; }

.pub[data-surface="flat"]  { --surf-bg: var(--bg-1); --surf-bd: 1px solid var(--line); --surf-sh: none; --surf-blur: 0px; --surf-r: 10px; }
.pub[data-surface="glass"] { --surf-bg: color-mix(in oklch, var(--bg-2) 52%, transparent); --surf-bd: 1px solid rgba(255,255,255,.16); --surf-sh: 0 34px 90px -32px rgba(0,0,0,.85); --surf-blur: 18px; --surf-r: 22px; }
.pub .calc { background: var(--surf-bg); border: var(--surf-bd); box-shadow: var(--surf-sh); border-radius: var(--surf-r); -webkit-backdrop-filter: blur(var(--surf-blur)); backdrop-filter: blur(var(--surf-blur)); }
.pub .feature-card { background: var(--surf-bg); border: var(--surf-bd); border-radius: var(--surf-r); -webkit-backdrop-filter: blur(var(--surf-blur)); backdrop-filter: blur(var(--surf-blur)); }
.pub[data-surface="glass"] .calc-tabs { background: transparent; }

/* reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---- behavioral journal v2: alert bridge + weekly retrospective ---- */
.alert-chip { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; vertical-align: middle; font-family: var(--font-mono); font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 6px; color: var(--accent); background: color-mix(in oklch, var(--accent) 12%, transparent); border: 1px solid color-mix(in oklch, var(--accent) 30%, transparent); }
.alert-suggest { margin-left: 4px; vertical-align: middle; font-family: var(--font-mono); font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 6px; color: var(--data); background: transparent; border: 1px dashed color-mix(in oklch, var(--data) 55%, transparent); cursor: pointer; }
.alert-suggest:hover { background: color-mix(in oklch, var(--data) 14%, transparent); }
.tag-sel.retro-week { max-width: 100%; }
.retro-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.retro-sec { margin-bottom: 16px; }
.retro-sec .metric-lab { margin-bottom: 5px; }
.retro-sec p, .retro-sec li { font-size: 13.5px; line-height: 1.6; color: var(--text); }
.retro-sec ul, .retro-sec ol { margin: 0; padding-left: 18px; }
.retro-sec li + li { margin-top: 6px; }
.retro-minis { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 14px; }
.ref-chip { display: inline-block; font-family: var(--font-mono); font-size: 10.5px; padding: 1px 5px; margin-right: 4px; border-radius: 5px; background: var(--bg-3); border: 1px solid var(--line); color: var(--text-2); }
.retro-foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
/* retrospective period switch (week / month / lifetime) */
.retro-tabs { display: inline-flex; gap: 2px; padding: 2px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 8px; }
.retro-tab { background: none; border: 0; border-radius: 6px; padding: 4px 11px; font: inherit; font-size: 12.5px; color: var(--text-3); cursor: pointer; }
.retro-tab:hover { color: var(--text); }
.retro-tab.on { background: rgba(240, 176, 0, 0.12); color: var(--accent); }
/* retrospective modal: layout from the AI Studio prototype (hero summary, tinted sections) in ForexFin's palette */
.modal.modal-retro { max-width: 640px; }
.retro-mhead { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 12px; }
.retro-tile { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: var(--accent); background: color-mix(in oklch, var(--accent) 12%, transparent); border: 1px solid color-mix(in oklch, var(--accent) 28%, transparent); }
.retro-mhead .pill-tag { display: inline-block; margin-top: 8px; }
.retro-hero { padding: 14px 16px; margin-bottom: 18px; border-radius: var(--r); background: var(--bg-1); border: 1px solid var(--line-2); }
.retro-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; margin-bottom: 8px; font-size: 12.5px; }
.retro-hero p { margin: 0; font-size: 14.5px; font-weight: 500; line-height: 1.6; color: var(--text); }
.retro-hero .retro-minis { margin-bottom: 0; }
.retro-h { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.retro-hero-top .retro-h { margin-bottom: 0; }
.retro-h.accent svg { color: var(--accent); }
.retro-h.data svg { color: var(--data); }
.retro-h.neg svg { color: var(--neg); }
.retro-h.pos svg { color: var(--pos); }
.retro-sec .retro-box { margin: 0; padding: 11px 13px; border-radius: var(--r-sm); background: var(--bg-1); border: 1px solid var(--line); }
.retro-sec .retro-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.retro-sec .retro-list li + li { margin-top: 0; }
.retro-item { position: relative; padding: 10px 12px 10px 27px; border-radius: var(--r-sm); border: 1px solid var(--line); }
.retro-item::before { content: ""; position: absolute; left: 12px; top: 19px; width: 5px; height: 5px; border-radius: 50%; }
.retro-item.neg { background: color-mix(in oklch, var(--neg) 7%, transparent); border-color: color-mix(in oklch, var(--neg) 26%, transparent); }
.retro-item.neg::before { background: var(--neg); }
.retro-item.pos { background: color-mix(in oklch, var(--pos) 6%, transparent); border-color: color-mix(in oklch, var(--pos) 24%, transparent); }
.retro-item.pos::before { background: var(--pos); }
.retro-item.accent { background: color-mix(in oklch, var(--accent) 6%, transparent); border-color: color-mix(in oklch, var(--accent) 24%, transparent); }
.retro-item.accent::before { background: var(--accent); }
.retro-item.q { padding-left: 13px; font-style: italic; }
/* retrospective depth tiers */
.retro-depth { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; margin-bottom: 14px; font-size: 12px; line-height: 1.5; }
.retro-basis { display: inline-block; margin-right: 6px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.retro-figs { margin: 4px 0 12px; }
.retro-figs > summary { cursor: pointer; margin-bottom: 12px; font-size: 12.5px; color: var(--text-2); }
.retro-figs > summary:hover { color: var(--text); }
.retro-item.q::before { display: none; }
.btn.copied svg { color: var(--pos); }

/* back to top (app.js, outside #root) */
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 60; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); cursor: pointer; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s, transform .2s, border-color .2s, color .2s; }
.to-top svg { transform: rotate(-90deg); }
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 860px) { .to-top { right: 14px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } }
/* bug report button (AgentDelivery style: round, blue ring) */
.icon-btn.bug-btn { border-radius: 50%; color: #3b82f6; background: color-mix(in oklch, #3b82f6 12%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in oklch, #3b82f6 55%, transparent); }
.icon-btn.bug-btn:hover { background: color-mix(in oklch, #3b82f6 22%, transparent); color: #60a5fa; }
.retro-tile.bug-tile { color: #3b82f6; }
#bug-scrim textarea, #bug-scrim input, #bug-scrim select { width: 100%; }

/* topbar at phone width: 2026-09-15 the bar was ~100px wider than a 400px screen (brand pushed off-screen,
   "Try free" shown despite .mobile-hide, bug button out of view) */
@media (max-width: 860px) { .topbar .mobile-hide { display: none; } }
@media (max-width: 480px) {
  .topbar .brand.mobile-only .word { display: none; }
  #acct-switch { max-width: 42vw; min-width: 0; }
}
/* dashboard card headers at phone width: 2026-09-15 "Set starting equity" + "Open journal" beside the title ran 15px past
   a 400px screen (55px at 360); the actions now wrap under the title. The topbar was 1px over at 320px. */
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; min-width: 0; }
@media (max-width: 480px) { .card-head { flex-wrap: wrap; row-gap: 10px; } }
@media (max-width: 360px) { .topbar { gap: 10px; } }
