:root {
  color-scheme: dark;
  --bg: #080a0d;
  --bg-soft: #0d1014;
  --panel: #11151a;
  --panel-2: #151a20;
  --line: #252b32;
  --line-soft: #1b2026;
  --text: #f2efe8;
  --muted: #929aa4;
  --gold: #4d8dff;
  --gold-bright: #7aabff;
  --gold-dim: rgba(77, 141, 255, .13);
  --green: #57d99a;
  --red: #ff6270;
  --blue: #5b95ff;
  --shadow: 0 22px 60px rgba(0, 0, 0, .28);
  --radius: 8px;
}

body.theme-red { --gold: #ff5565; --gold-bright: #ff8490; --gold-dim: rgba(255, 85, 101, .13); }
body.theme-green { --gold: #39c98a; --gold-bright: #72e2ac; --gold-dim: rgba(57, 201, 138, .13); }
body.theme-blue { --gold: #4d8dff; --gold-bright: #7aabff; --gold-dim: rgba(77, 141, 255, .13); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: "Manrope", sans-serif; font-size: 16px; min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.app-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 18px 18px; border-right: 1px solid var(--line); background: var(--bg-soft); display: flex; flex-direction: column; z-index: 5; }
.brand { color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 11px; padding: 0 9px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--gold); color: var(--gold-bright); font-family: "DM Mono", monospace; font-size: .76rem; letter-spacing: -.08em; transform: rotate(45deg); }
.brand-mark::first-letter { transform: rotate(-45deg); }
.brand > span:last-child { display: flex; align-items: baseline; gap: 5px; }
.brand strong { font-size: 1.1rem; letter-spacing: -.03em; }
.brand small { font-family: "DM Mono", monospace; font-size: .62rem; color: var(--gold); letter-spacing: .12em; }
.primary-nav { margin-top: 52px; display: grid; gap: 7px; }
.nav-item { border: 0; background: transparent; color: var(--muted); min-height: 46px; border-radius: 6px; padding: 0 13px; display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer; font-size: .88rem; font-weight: 600; }
.nav-item span { font-size: 1.04rem; width: 18px; text-align: center; }
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: var(--gold-dim); color: var(--gold-bright); box-shadow: inset 2px 0 var(--gold); }
.sidebar-foot { margin-top: auto; display: grid; gap: 12px; }
.mode-card { border: 1px solid var(--line); padding: 14px; background: var(--panel); }
.status-line { font-size: .76rem; font-family: "DM Mono", monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--green); display: flex; align-items: center; gap: 8px; }
.status-dot { width: 7px; height: 7px; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 10%, transparent); }
.mode-card p { margin: 9px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.55; }
.profile-chip { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; border: 0; background: transparent; text-align: left; padding: 10px 7px; cursor: pointer; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--panel-2); color: var(--gold-bright); display: grid; place-items: center; font-family: "DM Mono"; font-size: .72rem; }
.profile-chip strong, .profile-chip small { display: block; }
.profile-chip strong { font-size: .8rem; }
.profile-chip small { color: var(--muted); font-size: .68rem; margin-top: 2px; }

main { min-width: 0; padding: 0 42px 56px; max-width: 1680px; width: 100%; margin: 0 auto; }
.topbar { height: 108px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); }
.topbar h1 { margin: 4px 0 0; font-size: 1.45rem; letter-spacing: -.04em; font-weight: 600; }
.eyebrow, .kicker { margin: 0; color: var(--gold); font-family: "DM Mono", monospace; font-size: .68rem; letter-spacing: .11em; text-transform: uppercase; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.install-button { min-height: 44px; border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); background: var(--gold-dim); color: var(--gold-bright); padding: 0 13px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: .875rem; }
.install-button:hover { border-color: var(--gold); }
.install-button span { font: 500 1rem "DM Mono"; }
.install-button[hidden] { display: none; }
.instrument-pill { border: 1px solid var(--line); height: 42px; padding: 0 12px; display: flex; align-items: center; gap: 8px; font-family: "DM Mono", monospace; font-size: .76rem; }
.instrument-pill select { width: auto; min-width: 96px; border: 0; background: transparent; padding: 0 16px 0 0; color: var(--text); font: 500 .875rem "DM Mono"; cursor: pointer; }
.instrument-pill small { color: var(--muted); border-left: 1px solid var(--line); padding-left: 9px; }
.metal-dot { width: 7px; height: 7px; background: var(--gold); border-radius: 50%; }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; display: grid; place-items: center; }
.theme-switcher { height: 42px; padding: 5px; border: 1px solid var(--line); background: var(--panel); display: flex; align-items: center; gap: 2px; }
.theme-switcher button { width: 30px; height: 30px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; border-radius: 3px; }
.theme-switcher button:hover { background: var(--panel-2); }
.theme-switcher button.active { background: var(--gold-dim); box-shadow: inset 0 0 0 1px var(--gold); }
.theme-dot { width: 11px; height: 11px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.06); }
.theme-dot.red { background: var(--red); }
.theme-dot.green { background: var(--green); }
.theme-dot.blue { background: var(--blue); }
.view { display: none; animation: fade .22s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.market-strip { display: grid; grid-template-columns: 1.1fr 1.8fr .85fr; border-bottom: 1px solid var(--line); min-height: 210px; }
.market-strip > div { padding: 32px 28px; }
.market-strip > div:first-child { padding-left: 0; }
.market-strip > div + div { border-left: 1px solid var(--line-soft); }
.label, .field-label { display: block; color: var(--muted); font-size: .73rem; text-transform: uppercase; letter-spacing: .08em; font-family: "DM Mono", monospace; }
.quote-row { display: flex; align-items: baseline; margin-top: 13px; }
.currency { font-family: "DM Mono"; font-size: 1.05rem; color: var(--gold); margin-right: 4px; }
.price-input { border: 0; background: transparent; color: var(--text); width: 210px; font-family: "DM Mono", monospace; font-size: clamp(2rem, 4vw, 3.15rem); font-weight: 500; letter-spacing: -.08em; padding: 0; }
.price-input::-webkit-inner-spin-button { display: none; }
.quote-block p, .session-block p, .pulse-card p { color: var(--muted); font-size: .76rem; line-height: 1.55; margin: 12px 0 0; max-width: 240px; }
.spark-wrap svg { width: 100%; height: 118px; overflow: visible; color: var(--gold); }
.chart-grid { fill: none; stroke: var(--line-soft); stroke-width: 1; }
.area { fill: url(#goldFill); }
.line { fill: none; stroke: var(--gold); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-caption { display: flex; justify-content: space-between; color: var(--muted); font-size: .68rem; font-family: "DM Mono"; }
.session-block { display: grid; align-content: center; justify-items: center; text-align: center; }
.session-ring { width: 68px; height: 68px; border-radius: 50%; border: 1px solid var(--gold); display: flex; align-items: baseline; justify-content: center; padding-top: 19px; margin: 12px 0; box-shadow: inset 0 0 0 7px var(--gold-dim); }
.session-ring span { font: 500 1.55rem "DM Mono"; }
.session-ring small { color: var(--muted); font-size: .72rem; }
.session-block strong { font-size: .8rem; }

.command-deck { display: grid; grid-template-columns: 1.15fr 1fr 1.15fr; gap: 12px; padding-top: 18px; }
.deck-card { min-width: 0; min-height: 148px; padding: 19px; border: 1px solid var(--line); background: linear-gradient(145deg, var(--panel), var(--bg-soft)); }
.deck-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.deck-head h2 { margin: 6px 0 0; font-size: 1rem; letter-spacing: -.03em; }
.live-rune { border: 1px solid var(--line); color: var(--muted); padding: 4px 6px; font: 500 .6rem "DM Mono"; letter-spacing: .08em; }
.market-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 15px 0 11px; }
.market-tabs button { min-width: 0; border: 1px solid var(--line-soft); background: var(--bg); color: var(--muted); padding: 8px 2px; cursor: pointer; font: 500 .875rem "DM Mono"; }
.market-tabs button:hover { color: var(--text); border-color: var(--line); }
.market-tabs button.active { color: var(--gold-bright); border-color: var(--gold); background: var(--gold-dim); }
.market-radar > p, .guardian-card > p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.clock-pulse { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px color-mix(in srgb, var(--green) 9%, transparent); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; transform: scale(.82); } }
.session-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 18px; }
.session-list > span { padding: 9px 7px; border: 1px solid var(--line-soft); color: var(--muted); }
.session-list b, .session-list small { display: block; }
.session-list b { font-size: .8rem; }
.session-list small { margin-top: 3px; font: 400 .58rem "DM Mono"; }
.session-list > span.active { color: var(--green); border-color: color-mix(in srgb, var(--green) 38%, var(--line)); background: color-mix(in srgb, var(--green) 8%, transparent); }
.guardian-eye { color: var(--gold); font-size: 1.5rem; line-height: 1; }
.guardian-bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin: 21px 0 13px; }
.guardian-bar span { height: 5px; background: var(--line); transition: background .2s ease, box-shadow .2s ease; }
.guardian-bar span.active { background: var(--gold); box-shadow: 0 0 12px var(--gold-dim); }
.guardian-card.awake { border-color: color-mix(in srgb, var(--gold) 48%, var(--line)); }

.dashboard-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; padding-top: 26px; }
.panel { background: var(--panel); border: 1px solid var(--line); padding: 24px; box-shadow: var(--shadow); }
.focus-panel { grid-column: span 7; grid-row: span 2; }
.bias-panel { grid-column: span 5; }
.strategy-card { grid-column: span 5; }
.pulse-card { grid-column: span 7; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.panel h2 { margin: 6px 0 0; font-size: 1.15rem; letter-spacing: -.03em; }
.progress-count, .score { color: var(--gold-bright); font: 500 .86rem "DM Mono"; }
.score { font-size: 1.5rem; }
.checklist { margin: 25px 0 14px; display: grid; }
.checklist label { display: flex; align-items: center; gap: 14px; padding: 13px 2px; border-top: 1px solid var(--line-soft); cursor: pointer; }
.checklist input { appearance: none; width: 20px; height: 20px; border: 1px solid #49515a; border-radius: 2px; display: grid; place-items: center; flex: none; }
.checklist input:checked { background: var(--gold); border-color: var(--gold); }
.checklist input:checked::after { content: "✓"; color: #14110b; font-size: .78rem; font-weight: 800; }
.checklist input:checked + span strong { color: var(--muted); text-decoration: line-through; }
.checklist strong, .checklist small { display: block; }
.checklist strong { font-size: .84rem; font-weight: 600; }
.checklist small { font-size: .71rem; color: var(--muted); margin-top: 3px; }
.text-button, .tiny-button { background: transparent; border: 0; color: var(--gold-bright); padding: 7px 0; cursor: pointer; font-size: .77rem; font-weight: 600; }
.text-button { display: flex; width: 100%; justify-content: space-between; border-top: 1px solid var(--line-soft); padding-top: 17px; }
.tiny-button { color: var(--muted); }
.bias-switch { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--bg); padding: 4px; margin: 22px 0; }
.bias-switch button { border: 0; background: transparent; color: var(--muted); padding: 9px; cursor: pointer; font-size: .74rem; }
.bias-switch button.active { background: var(--panel-2); }
.bias-switch button[data-bias="Bullish"].active { color: var(--green); box-shadow: inset 0 -2px var(--green); }
.bias-switch button[data-bias="Neutral"].active { color: var(--blue); box-shadow: inset 0 -2px var(--blue); }
.bias-switch button[data-bias="Bearish"].active { color: var(--red); box-shadow: inset 0 -2px var(--red); }
textarea, input, select { width: 100%; border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 3px; padding: 12px 13px; }
textarea { min-height: 105px; resize: vertical; line-height: 1.55; }
.bias-panel textarea { margin-top: 9px; }
.thesis-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; color: var(--muted); font-size: .68rem; }
.strategy-card > p { color: var(--muted); font-size: .79rem; line-height: 1.65; margin: 20px 0; }
.tag { font: 500 .68rem "DM Mono"; border: 1px solid var(--line); padding: 5px 8px; color: var(--muted); white-space: nowrap; }
.tag.gold { border-color: color-mix(in srgb, var(--gold) 35%, transparent); color: var(--gold-bright); background: var(--gold-dim); }
.rule-grid { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 18px; }
.rule-grid div { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.rule-grid div:nth-child(even) { padding-left: 18px; border-left: 1px solid var(--line-soft); }
.rule-grid span, .rule-grid strong { display: block; }
.rule-grid span { color: var(--muted); font-size: .68rem; }
.rule-grid strong { font: 500 .76rem "DM Mono"; margin-top: 5px; }
.bars { height: 90px; display: flex; align-items: end; gap: 7px; margin: 26px 0 0; border-bottom: 1px solid var(--line); }
.bars span { flex: 1; max-width: 28px; background: linear-gradient(to top, var(--gold-dim), var(--gold)); opacity: .8; }

.section-intro { min-height: 160px; display: flex; align-items: center; justify-content: space-between; gap: 30px; border-bottom: 1px solid var(--line); }
.section-intro h2 { margin: 7px 0; font-size: 1.8rem; letter-spacing: -.05em; }
.section-intro p { margin: 0; color: var(--muted); max-width: 680px; line-height: 1.6; font-size: .86rem; }
.button { border: 1px solid var(--line); padding: 11px 16px; cursor: pointer; font-size: .79rem; font-weight: 700; border-radius: 3px; }
.button.primary { background: var(--gold); border-color: var(--gold); color: #15120c; }
.button.primary:hover { background: var(--gold-bright); }
.button.secondary { background: transparent; color: var(--text); }
.button.small { padding: 7px 11px; }
.button.wide { width: 100%; min-height: 47px; }

.strategy-layout { display: grid; grid-template-columns: minmax(260px, .7fr) minmax(420px, 1.3fr); gap: 20px; padding-top: 25px; }
.strategy-list { display: grid; gap: 10px; align-content: start; }
.strategy-list-item { border: 1px solid var(--line); background: var(--panel); padding: 18px; cursor: pointer; text-align: left; }
.strategy-list-item.active { border-color: var(--gold); box-shadow: inset 3px 0 var(--gold); }
.strategy-list-item h3 { margin: 0; font-size: .92rem; }
.strategy-list-item p { color: var(--muted); font-size: .72rem; line-height: 1.5; margin: 7px 0 0; }
.strategy-list-item .item-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.editor-panel { min-height: 470px; }
.empty-editor { min-height: 420px; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--muted); }
.empty-editor > span { color: var(--gold); font-size: 2rem; }
.empty-editor h3 { color: var(--text); margin: 15px 0 4px; }
.empty-editor p { margin: 0; font-size: .8rem; }
.strategy-detail h2 { font-size: 1.5rem; }
.strategy-detail > p { color: var(--muted); line-height: 1.65; font-size: .85rem; }
.detail-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.detail-section h3 { font-size: .77rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); font-family: "DM Mono"; }
.detail-section ul { padding-left: 20px; color: var(--muted); font-size: .82rem; line-height: 1.8; }
.research-shelf { margin-top: 20px; border: 1px solid var(--line); display: grid; grid-template-columns: 1.1fr repeat(3, 1fr); background: var(--panel); }
.research-title, .research-shelf a { padding: 22px; }
.research-title h2 { margin: 6px 0 0; font-size: 1.1rem; }
.research-shelf a { color: var(--text); text-decoration: none; border-left: 1px solid var(--line); display: grid; align-content: center; gap: 6px; transition: background .18s ease; }
.research-shelf a:hover { background: var(--gold-dim); }
.research-shelf a span { color: var(--gold); font: 500 .65rem "DM Mono"; text-transform: uppercase; letter-spacing: .07em; }
.research-shelf a strong { font-size: .8rem; }
.research-shelf a small { color: var(--muted); font-size: .68rem; line-height: 1.45; }

.risk-layout { display: grid; grid-template-columns: minmax(500px, 1.15fr) minmax(320px, .85fr); gap: 20px; padding-top: 25px; }
.calculator { box-shadow: none; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 24px 0; }
form label { display: grid; gap: 8px; color: var(--muted); font-size: .74rem; }
form input, form select { min-height: 45px; }
.risk-result { background: var(--gold); color: #16120b; padding: 30px; }
.risk-result .kicker { color: #594111; }
.big-result { font: 500 clamp(2.8rem, 6vw, 5rem) "DM Mono"; letter-spacing: -.08em; margin: 25px 0 4px; }
.big-result small { font-size: 1rem; letter-spacing: 0; }
.risk-result > p { font-size: .75rem; line-height: 1.55; max-width: 350px; }
.result-list { border-top: 1px solid rgba(0,0,0,.25); margin-top: 28px; }
.result-list div { display: flex; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid rgba(0,0,0,.18); font-size: .78rem; }
.result-list strong { font-family: "DM Mono"; }
.risk-warning { background: rgba(0,0,0,.12); padding: 13px; margin-top: 22px; font-size: .7rem; line-height: 1.5; }
.risk-result .button.secondary { color: #16120b; border-color: rgba(0,0,0,.35); margin-top: 16px; }

.journal-summary { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); margin-top: 25px; }
.journal-summary div { padding: 20px; }
.journal-summary div + div { border-left: 1px solid var(--line); }
.journal-summary span, .journal-summary strong { display: block; }
.journal-summary span { color: var(--muted); font-size: .7rem; }
.journal-summary strong { font: 500 1.15rem "DM Mono"; margin-top: 8px; }
.table-panel { margin-top: 18px; padding: 0; overflow: hidden; box-shadow: none; }
.table-head, .journal-row { display: grid; grid-template-columns: .75fr 1.6fr .55fr .75fr .6fr 72px; align-items: center; gap: 15px; padding: 14px 20px; }
.table-head { background: var(--panel-2); color: var(--muted); font: 500 .68rem "DM Mono"; text-transform: uppercase; letter-spacing: .06em; }
.journal-row { border-top: 1px solid var(--line-soft); font-size: .78rem; }
.journal-row .setup-cell strong, .journal-row .setup-cell small { display: block; }
.journal-row .setup-cell small { color: var(--muted); margin-top: 3px; }
.result-positive { color: var(--green); }
.result-negative { color: var(--red); }
.journal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.edit-row { border: 0; background: transparent; color: var(--gold-bright); cursor: pointer; font-size: .75rem; }
.delete-row { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1.1rem; }
.empty-row { padding: 60px 20px; text-align: center; color: var(--muted); font-size: .82rem; }

.lore-panel { position: relative; display: grid; grid-template-columns: 92px minmax(280px, 1.3fr) minmax(230px, .8fr); gap: 24px; align-items: center; margin-top: 25px; padding: 26px 72px 26px 26px; border: 1px solid var(--gold); background: linear-gradient(105deg, var(--gold-dim), var(--panel) 46%, var(--bg-soft)); overflow: hidden; }
.lore-panel::after { content: "II"; position: absolute; right: 18px; top: 12px; color: var(--gold); opacity: .18; font: 500 5rem/1 "DM Mono"; letter-spacing: -.35em; }
.lore-sigil { width: 66px; height: 66px; border: 1px solid var(--gold); color: var(--gold-bright); display: grid; place-items: center; transform: rotate(45deg); font: 500 .9rem "DM Mono"; box-shadow: inset 0 0 0 8px var(--gold-dim); }
.lore-copy { min-width: 0; }
.lore-companion { color: var(--gold-bright); font: 500 .68rem "DM Mono"; letter-spacing: .09em; }
.lore-copy h2 { margin: 7px 0 8px; font-size: 1.4rem; letter-spacing: -.04em; }
.lore-copy p { max-width: 720px; margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.65; }
.lore-laws { display: grid; border-left: 1px solid var(--line); padding-left: 22px; }
.lore-laws span { padding: 8px 0; color: var(--text); font-size: .76rem; border-bottom: 1px solid var(--line-soft); }
.lore-laws span:last-child { border-bottom: 0; }
.lore-laws b { color: var(--gold); margin-right: 9px; font: 500 .68rem "DM Mono"; }
.lore-source { position: absolute; right: 18px; bottom: 13px; color: var(--muted); font-size: .66rem; text-decoration: none; }
.lore-source:hover { color: var(--gold-bright); }
.coach-layout { display: grid; grid-template-columns: minmax(420px, 1fr) minmax(420px, 1fr); gap: 20px; padding-top: 25px; }
.prompt-panel { box-shadow: none; }
.coach-mark { color: var(--gold); font-size: 1.5rem; }
.prompt-panel > h2 { font-size: 1.45rem; margin-top: 18px; }
.prompt-panel > p { color: var(--muted); font-size: .82rem; line-height: 1.6; }
.oracle-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 20px; }
.oracle-modes button { border: 1px solid var(--line); background: var(--bg); color: var(--muted); padding: 10px 6px; cursor: pointer; font-size: .875rem; }
.oracle-modes button span { color: var(--gold); margin-right: 4px; font-family: "DM Mono"; }
.oracle-modes button.active { color: var(--text); border-color: var(--gold); background: var(--gold-dim); }
.prompt-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 20px 0; }
.prompt-chips button { border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-size: .68rem; padding: 8px 10px; cursor: pointer; }
.prompt-chips button:hover { color: var(--text); border-color: var(--gold); }
.prompt-panel textarea { min-height: 150px; margin-bottom: 14px; }
.coach-response { min-height: 520px; background: var(--panel-2); border: 1px solid var(--line); padding: 28px; }
.response-placeholder { min-height: 460px; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--muted); }
.response-placeholder > span { color: var(--gold); font-size: 2rem; }
.response-placeholder h3 { color: var(--text); margin: 15px 0 5px; }
.response-placeholder p { max-width: 300px; margin: 0; font-size: .78rem; line-height: 1.6; }
.response-content > p { color: var(--muted); font-size: .8rem; line-height: 1.6; }
.response-section { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.response-section h3 { font: 500 .7rem "DM Mono"; color: var(--gold); text-transform: uppercase; letter-spacing: .08em; }
.response-section p { color: var(--muted); font-size: .8rem; line-height: 1.6; }
.response-section ul { padding-left: 18px; color: var(--muted); font-size: .8rem; line-height: 1.75; }
.response-question { background: var(--gold-dim); border-left: 2px solid var(--gold); padding: 13px; margin-top: 18px; font-size: .8rem; line-height: 1.55; }

dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--panel); color: var(--text); border: 1px solid var(--line); padding: 0; box-shadow: 0 35px 100px rgba(0,0,0,.55); }
dialog::backdrop { background: rgba(0,0,0,.74); backdrop-filter: blur(4px); }
dialog form { padding: 26px; display: grid; gap: 18px; }
.dialog-head { display: flex; justify-content: space-between; align-items: start; margin-bottom: 4px; }
.dialog-head h2 { margin: 6px 0 0; font-size: 1.4rem; }
.dialog-note { padding: 13px; background: var(--gold-dim); color: var(--muted); font-size: .72rem; line-height: 1.5; border-left: 2px solid var(--gold); }
.install-identity { display: flex; gap: 15px; align-items: center; padding: 15px; border: 1px solid var(--line); background: var(--bg); }
.install-identity img { border-radius: 12px; flex: none; }
.install-identity strong { font-size: .9rem; }
.install-identity p { color: var(--muted); margin: 5px 0 0; font-size: .74rem; line-height: 1.5; }
.install-steps { margin: 0; padding: 4px 0 4px 24px; color: var(--muted); font-size: .8rem; line-height: 1.75; }
.install-steps strong { color: var(--text); }
.toast { position: fixed; right: 25px; bottom: 25px; background: var(--text); color: var(--bg); padding: 12px 16px; font-size: .75rem; font-weight: 700; transform: translateY(100px); opacity: 0; transition: .25s ease; z-index: 20; box-shadow: var(--shadow); }
.toast.show { transform: none; opacity: 1; }
.mobile-nav { display: none; }
.mobile-profile { display: none; font-size: 1.3rem; }

.today-intro { padding: 48px 0 30px; max-width: 760px; }
.today-intro h2 { font-size: clamp(2.1rem, 4vw, 3.3rem); line-height: 1.12; letter-spacing: -.06em; margin: 14px 0; }
.today-intro p { color: var(--muted); font-size: 1rem; line-height: 1.65; margin: 0; max-width: 620px; }
.today-progress { border: 1px solid var(--line); background: linear-gradient(115deg, var(--gold-dim), var(--panel) 55%); padding: 22px 26px; }
.today-progress > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.today-progress strong { font: 500 1.5rem "DM Mono", monospace; color: var(--gold-bright); }
.today-progress-track { height: 7px; background: var(--bg); margin-top: 16px; overflow: hidden; border-radius: 7px; }
.today-progress-track span { display: block; height: 100%; background: var(--gold); transition: width .25s ease; }
.today-progress p { color: var(--muted); margin: 12px 0 0; font-size: .875rem; }
.today-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.today-step { border: 1px solid var(--line); background: var(--panel); padding: 24px; min-height: 260px; display: flex; flex-direction: column; align-items: flex-start; }
.today-step.done { border-color: color-mix(in srgb, var(--green) 55%, var(--line)); }
.today-step.done .step-number::after { content: " · DONE"; color: var(--green); }
.step-number { color: var(--gold); font: 500 .75rem "DM Mono", monospace; letter-spacing: .07em; }
.today-step h3 { margin: 28px 0 7px; font-size: 1.2rem; letter-spacing: -.03em; }
.today-step p { color: var(--muted); line-height: 1.6; font-size: .9rem; margin: 0 0 22px; }
.today-step .button { margin-top: auto; min-height: 44px; text-align: left; }
.today-bottom { max-width: 760px; margin: 24px 0 44px; }
.today-bottom p { color: var(--muted); font-size: .875rem; line-height: 1.6; }
.today-bottom strong { color: var(--text); }
.today-bottom .text-button { font-size: .875rem; min-height: 48px; text-align: left; }
.scroll-invite { margin-top: 16px; padding: 25px; border: 1px solid color-mix(in srgb, var(--gold) 42%, var(--line)); background: radial-gradient(circle at 85% 10%, var(--gold-dim), transparent 48%), var(--panel); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.scroll-invite h3 { margin: 9px 0 6px; font-size: 1.3rem; letter-spacing: -.04em; }
.scroll-invite p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.6; max-width: 540px; }
.scroll-invite .button { min-height: 46px; white-space: nowrap; }

.scroll-intro { min-height: 145px; }
.scroll-controls { display: flex; gap: 8px; padding: 17px 0; overflow-x: auto; }
.scroll-controls button { min-height: 42px; padding: 0 17px; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); color: var(--muted); cursor: pointer; white-space: nowrap; font-size: .82rem; font-weight: 700; }
.scroll-controls button.active { color: var(--gold-bright); border-color: var(--gold); background: var(--gold-dim); }
.scroll-frame { max-width: 760px; margin: 0 auto; }
.scroll-topline { display: flex; justify-content: space-between; gap: 12px; padding: 3px 2px 9px; color: var(--muted); font: 500 .68rem "DM Mono", monospace; letter-spacing: .09em; }
.scroll-topline span:first-child { color: var(--gold-bright); }
.scroll-feed { height: min(68vh, 650px); min-height: 440px; overflow-y: auto; overscroll-behavior-y: contain; scroll-snap-type: y mandatory; scrollbar-width: thin; scrollbar-color: var(--gold) var(--panel); border: 1px solid var(--line); }
.scroll-card { --card-glow: var(--gold-dim); height: 100%; min-height: 0; padding: clamp(21px, 4vw, 36px); background: radial-gradient(circle at 75% 24%, var(--card-glow), transparent 48%), linear-gradient(145deg, var(--panel), var(--bg-soft)); display: flex; flex-direction: column; scroll-snap-align: start; scroll-snap-stop: always; border-bottom: 1px solid var(--line); }
.scroll-card-journal { --card-glow: rgba(87, 217, 154, .13); }
.scroll-card-study { --card-glow: rgba(255, 180, 87, .12); }
.scroll-card-clip { --card-glow: rgba(156, 110, 255, .14); }
.scroll-card-head { display: flex; justify-content: space-between; gap: 12px; color: var(--gold-bright); font: 500 .68rem "DM Mono", monospace; letter-spacing: .1em; }
.scroll-card-head span:last-child { color: var(--muted); }
.scroll-card-main { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; justify-content: center; padding: 20px 0; scrollbar-width: thin; }
.scroll-mark { font-size: 2.2rem; line-height: 1; color: var(--gold-bright); }
.scroll-card h3 { margin: 19px 0 14px; font-size: clamp(1.6rem, 4vw, 2.6rem); letter-spacing: -.055em; line-height: 1.12; overflow-wrap: anywhere; }
.scroll-card-main > p { margin: 0; max-width: 620px; font-size: clamp(.95rem, 2.2vw, 1.15rem); line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.scroll-detail { margin-top: 23px; padding-left: 13px; border-left: 2px solid var(--gold); color: var(--muted); font-size: .83rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.scroll-card-foot { border-top: 1px solid var(--line); padding-top: 15px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.scroll-source-actions, .scroll-card-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.scroll-source, .scroll-link { border: 0; background: transparent; padding: 8px 0; color: var(--gold-bright); cursor: pointer; font-size: .8rem; text-decoration: none; }
.scroll-link { color: var(--muted); }
.scroll-source:hover, .scroll-link:hover { text-decoration: underline; }
.scroll-save, .scroll-next { min-height: 44px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; }
.scroll-save { padding: 0 12px; font-size: .8rem; white-space: nowrap; }
.scroll-save.saved { color: var(--gold-bright); border-color: var(--gold); background: var(--gold-dim); }
.scroll-next { width: 44px; color: var(--gold-bright); font-size: 1.25rem; }
.scroll-end { align-items: flex-start; justify-content: center; }
.scroll-end h3 { max-width: 520px; }
.scroll-end p { color: var(--muted); line-height: 1.65; max-width: 500px; }
.scroll-end > div { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.scroll-note { max-width: 760px; margin: 13px auto 32px; color: var(--muted); font-size: .78rem; line-height: 1.5; }

.learn-intro { min-height: 150px; }
.learn-intro > strong { color: var(--gold-bright); font: 500 .875rem "DM Mono", monospace; white-space: nowrap; }
.learn-layout { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(0, 1.5fr); gap: 18px; padding-top: 22px; }
.lesson-list { display: grid; gap: 9px; align-content: start; }
.lesson-item { min-height: 105px; border: 1px solid var(--line); background: var(--panel); padding: 17px; text-align: left; cursor: pointer; display: grid; gap: 5px; }
.lesson-item.active { border-color: var(--gold); box-shadow: inset 3px 0 var(--gold); }
.lesson-item span, .lesson-item small { color: var(--muted); font: 500 .75rem "DM Mono", monospace; }
.lesson-item strong { font-size: .95rem; }
.lesson-item small { color: var(--gold-bright); }
.lesson-panel { border: 1px solid var(--line); background: var(--panel); padding: clamp(22px, 3vw, 40px); }
.lesson-panel h2 { margin: 12px 0; font-size: clamp(1.7rem, 3vw, 2.4rem); letter-spacing: -.05em; }
.lesson-lead { color: var(--text); line-height: 1.6; font-size: 1.05rem; }
.lesson-points { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); list-style: none; padding: 16px 0; margin: 26px 0; }
.lesson-points li { position: relative; padding: 9px 0 9px 25px; color: var(--muted); font-size: .95rem; line-height: 1.6; }
.lesson-points li::before { content: "•"; position: absolute; left: 3px; color: var(--gold); }
.lesson-quiz h3 { font-size: 1.1rem; margin: 14px 0 18px; line-height: 1.45; }
.quiz-options { display: grid; gap: 9px; }
.quiz-options button { background: var(--bg); border: 1px solid var(--line); min-height: 50px; padding: 12px 15px; text-align: left; cursor: pointer; font-size: .9rem; line-height: 1.4; }
.quiz-options button:hover, .quiz-options button.selected { border-color: var(--gold); background: var(--gold-dim); }
#quiz-feedback { min-height: 48px; color: var(--muted); font-size: .875rem; line-height: 1.55; }
#quiz-feedback.correct { color: var(--green); }
.lesson-sources { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 18px; }
.lesson-source { color: var(--gold-bright); font-size: .8rem; }

.login-page { min-height: 100vh; padding: 0; background: radial-gradient(circle at 75% 12%, var(--gold-dim), transparent 35%), var(--bg); }
.login-layout { min-height: 100vh; max-width: 720px; padding: 34px 24px 28px; display: flex; flex-direction: column; margin: 0 auto; }
.login-brand { display: inline-flex; align-items: center; gap: 12px; width: fit-content; color: var(--text); text-decoration: none; font-size: 1.1rem; }
.login-brand img { border-radius: 10px; }
.login-card { margin: auto 0; border: 1px solid var(--line); background: var(--panel); padding: clamp(28px, 6vw, 52px); }
.login-card h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.06em; line-height: 1.1; margin: 14px 0; }
.login-card p { color: var(--muted); line-height: 1.65; max-width: 510px; }
.google-signin-button { min-height: 44px; margin: 28px 0 20px; }
.login-error { color: var(--red) !important; font-size: .9rem; }
.login-error[hidden] { display: none; }
.login-note { padding-top: 18px; border-top: 1px solid var(--line); font-size: .875rem; }
.login-footer { color: var(--muted); font-size: .875rem; }
.login-footer a, .privacy-card a { color: var(--gold-bright); }
.privacy-layout { max-width: 820px; }
.privacy-card p { max-width: none; }
.login-card .button { display: inline-block; text-decoration: none; margin-top: 12px; }
.account-settings { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); background: var(--bg); }
.account-settings[hidden] { display: none; }
.account-settings strong { font-size: .9rem; overflow-wrap: anywhere; }
.account-settings p { color: var(--muted); font-size: .875rem; line-height: 1.5; margin: 0; }
.account-settings .button { width: fit-content; min-height: 44px; }
.danger-button { color: var(--red); margin-top: 6px; text-align: left; }

@media (max-width: 1080px) {
  .today-steps { grid-template-columns: 1fr; }
  .today-step { min-height: 0; }
  .today-step h3 { margin-top: 15px; }
  .app-shell { grid-template-columns: 210px minmax(0, 1fr); }
  main { padding-left: 26px; padding-right: 26px; }
  .market-strip { grid-template-columns: 1fr 1.5fr; }
  .session-block { display: none; }
  .command-deck { grid-template-columns: 1fr 1fr; }
  .guardian-card { grid-column: 1 / -1; }
  .focus-panel, .pulse-card { grid-column: span 7; }
  .bias-panel, .strategy-card { grid-column: span 5; }
  .risk-layout, .coach-layout { grid-template-columns: 1fr; }
  .research-shelf { grid-template-columns: 1fr 1fr; }
  .research-shelf a:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .research-shelf a:nth-child(4) { border-top: 1px solid var(--line); }
  .lore-panel { grid-template-columns: 72px 1fr; padding-right: 26px; }
  .lore-laws { grid-column: 2; border-left: 0; border-top: 1px solid var(--line); padding: 10px 0 0; }
  .lore-source { position: static; grid-column: 2; }
}

@media (max-width: 760px) {
  .login-page { padding-bottom: 0; }
  .login-layout { padding: 20px 16px; }
  body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .app-shell { display: block; }
  .sidebar { display: none; }
  main { padding: 0 16px 30px; }
  .topbar { height: 83px; }
  .topbar h1 { font-size: 1.15rem; }
  .topbar .eyebrow { display: none; }
  .instrument-pill { display: none; }
  .install-button { padding: 0 10px; justify-content: center; }
  .mobile-profile { display: grid; }
  .theme-switcher { display: none; }
  .today-intro { padding: 34px 0 25px; }
  .today-intro h2 { font-size: 2.1rem; }
  .today-progress { padding: 19px; }
  .today-steps { margin-top: 12px; gap: 12px; }
  .today-step { padding: 20px; }
  .today-step .button { width: 100%; }
  .scroll-invite { display: block; padding: 20px; }
  .scroll-invite .button { width: 100%; margin-top: 18px; }
  .scroll-intro { gap: 16px; }
  .scroll-intro .button { width: 100%; min-height: 44px; }
  .scroll-feed { height: clamp(360px, calc(100dvh - 318px), 620px); min-height: 0; }
  .scroll-card { padding: 20px; }
  .scroll-card-main { padding: 13px 0; }
  .scroll-card h3 { margin: 12px 0 10px; font-size: clamp(1.55rem, 8vw, 2.2rem); }
  .scroll-card-main > p { font-size: .94rem; line-height: 1.5; }
  .scroll-detail { margin-top: 14px; font-size: .76rem; }
  .scroll-card-foot { padding-top: 9px; }
  .scroll-source-actions { gap: 6px 10px; }
  .scroll-source, .scroll-link { font-size: .72rem; }
  .scroll-save { padding: 0 8px; font-size: .72rem; }
  .learn-layout { display: block; }
  .lesson-list { display: flex; overflow-x: auto; gap: 9px; margin-bottom: 14px; padding-bottom: 6px; scroll-snap-type: x mandatory; }
  .lesson-item { flex: 0 0 min(73vw, 270px); scroll-snap-align: start; }
  .lesson-panel { padding: 21px; }
  .theme-switcher button { width: 28px; }
  .market-strip { grid-template-columns: 1fr; }
  .market-strip > div { padding: 24px 0; }
  .market-strip > div + div { border-left: 0; border-top: 1px solid var(--line-soft); }
  .spark-wrap { display: none; }
  .dashboard-grid { display: block; }
  .command-deck { display: block; }
  .deck-card { min-height: 0; margin-top: 12px; }
  .panel { margin-bottom: 14px; padding: 20px; }
  .section-intro { min-height: 150px; align-items: flex-start; flex-direction: column; justify-content: center; padding: 24px 0; }
  .section-intro h2 { font-size: 1.45rem; }
  .strategy-layout, .risk-layout, .coach-layout { display: block; }
  .research-shelf { display: block; }
  .research-shelf > * { border-left: 0 !important; border-top: 1px solid var(--line); }
  .research-shelf .research-title { border-top: 0; }
  .strategy-list, .calculator { margin-bottom: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .journal-summary { grid-template-columns: 1fr 1fr; }
  .journal-summary div:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .journal-summary div:nth-child(4) { border-top: 1px solid var(--line); }
  .table-head { display: none; }
  .journal-row { grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; }
  .journal-row > span:first-child, .journal-row > span:nth-child(3) { display: none; }
  .journal-row > span:nth-child(5) { display: none; }
  .mobile-nav { position: fixed; bottom: 0; left: 0; right: 0; height: calc(65px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(6, 1fr); background: color-mix(in srgb, var(--bg-soft) 94%, transparent); border-top: 1px solid var(--line); backdrop-filter: blur(14px); z-index: 10; }
  .mobile-nav button { border: 0; background: transparent; color: var(--muted); display: grid; place-content: center; gap: 2px; font-size: .68rem; min-height: 48px; }
  .mobile-nav button span { font-size: 1rem; }
  .mobile-nav button.active { color: var(--gold-bright); }
  .mobile-nav button[data-view="tradescroll"] { color: var(--gold-bright); }
  .mobile-nav button[data-view="tradescroll"].active { background: var(--gold-dim); }
  .coach-response { min-height: 400px; }
  .response-placeholder { min-height: 340px; }
  .lore-panel { display: block; padding: 22px; }
  .lore-sigil { width: 52px; height: 52px; margin: 5px 0 24px 7px; }
  .lore-copy p { font-size: .78rem; }
  .lore-laws { margin-top: 18px; padding-top: 10px; }
  .lore-source { display: inline-block; margin-top: 14px; }
  .toast { left: 16px; right: 16px; bottom: 80px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
.coach-answer { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
