/* MarketMind — app styling. Premium market cockpit: calm surfaces, dense mono
   numbers, restrained emerald/cyan/amber. Consumes tokens.css variables. */

/* ─────────────────────────── App shell ─────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

.app-root {
  --app-content-max: 860px;
  position: relative;
  height: 100vh;
  height: var(--app-viewport-h, 100dvh);
  width: 100%;
  max-width: none;
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: transparent;
}
#screens { position: relative; flex: 1; overflow: hidden; }
.screen {
  position: absolute; inset: 0;
  opacity: 0; transform: translateY(8px) scale(0.996);
  transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out);
  pointer-events: none;
}
.screen.is-active { opacity: 1; transform: none; pointer-events: auto; }
.screen:focus { outline: none; }

.scroll {
  width: 100%;
  max-width: var(--app-content-max);
  margin: 0 auto;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: max(20px, env(safe-area-inset-top)) clamp(16px, 4vw, 30px) calc(100px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: clamp(16px, 2.2vw, 22px);
}

/* ─────────────────────────── Splash ─────────────────────────── */
.mm-splash {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-content: center; justify-items: center; gap: 10px;
  background: var(--app-backdrop, var(--bg-canvas));
  transition: opacity 260ms var(--ease-out);
}
.mm-splash.is-hiding { opacity: 0; }
.mm-splash-glow { position: absolute; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, var(--emerald-glow), transparent 70%); filter: blur(8px); }
.mm-splash-mark {
  position: relative; width: 84px; height: 84px; border-radius: 22px;
  display: grid; place-content: center;
  background: linear-gradient(145deg, #11161f, #0a0d13);
  border: 1px solid var(--border); box-shadow: var(--shadow-3), inset 0 1px 0 rgba(255,255,255,0.05);
}
.mm-splash-mark span { font-family: var(--font-display); font-size: 44px; font-weight: 500; background: linear-gradient(135deg, var(--cyan), var(--emerald)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mm-splash-name { position: relative; font-family: var(--font-display); font-size: 26px; letter-spacing: -0.01em; color: var(--text-primary); }
.mm-splash-tag { position: relative; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-tertiary); }

/* ─────────────────────────── Tab bar ─────────────────────────── */
.tabbar {
  width: 100%;
  max-width: var(--app-content-max);
  margin: 0 auto;
  flex-shrink: 0;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px;
  padding: 9px clamp(6px, 2vw, 12px) calc(9px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-elevated) 84%, transparent), var(--bg-glass));
  -webkit-backdrop-filter: blur(20px) saturate(150%); backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--border-hair);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -16px 42px rgba(0,0,0,0.30);
}
.app-root[data-show-tabbar="false"] .tabbar { display: none; }
.tabbar button {
  position: relative; appearance: none; border: 0; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 4px 5px; border-radius: var(--r-m);
  color: var(--text-tertiary); transition: color var(--dur-2) var(--ease-out), background var(--dur-2);
}
.tabbar button svg { width: 22px; height: 22px; }
.tabbar button span { font-size: 10px; font-weight: 600; letter-spacing: 0.01em; }
.tabbar button[aria-pressed="true"] { color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 72%, transparent); }
.tabbar button[aria-pressed="true"] svg { filter: drop-shadow(0 2px 6px var(--accent-glow)); }
.tab-pip {
  position: absolute; top: 4px; right: calc(50% - 20px);
  min-width: 15px; height: 15px; padding: 0 4px; border-radius: 999px;
  background: var(--amber); color: #1a1206; font-size: 9px; font-weight: 800; font-style: normal;
  display: grid; place-content: center; line-height: 1;
}

/* ─────────────────────────── Type + common ─────────────────────────── */
.eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.muted { color: var(--text-secondary); font-size: var(--t-caption); line-height: 1.5; }
.mini-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); letter-spacing: 0.04em; }
em { font-style: normal; color: var(--accent); }
.display-l em, .display-m em, h1 em, h2 em { font-style: italic; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-head h2 { margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
.seeall { appearance: none; border: 0; background: var(--bg-subtle); color: var(--text-secondary); font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 999px; cursor: pointer; }
.seeall:hover { color: var(--accent); }

.card {
  position: relative;
  min-width: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-surface) 94%, white 6%), var(--bg-surface));
  border: 1px solid var(--border);
  border-radius: var(--r-l);
  padding: clamp(15px, 2.2vw, 20px);
  box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255,255,255,0.035);
}

/* ─────────────────────────── Buttons ─────────────────────────── */
.mm-btn {
  appearance: none; cursor: pointer; font-family: var(--font-ui); font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 18px; border-radius: var(--r-m); border: 1px solid transparent;
  transition: transform var(--dur-1) var(--ease-out), background var(--dur-2), opacity var(--dur-2), box-shadow var(--dur-2), border-color var(--dur-2);
}
.mm-btn:active { transform: scale(0.97); }
.mm-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.mm-btn.lg { width: 100%; padding: 14px 20px; font-size: 15px; }
.mm-btn.sm { padding: 8px 13px; font-size: 13px; border-radius: var(--r-s); }
.mm-btn.primary { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 88%, white 12%), var(--accent) 58%, color-mix(in srgb, var(--accent) 72%, #000)); color: var(--text-on-accent); box-shadow: 0 10px 26px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.20); }
.mm-btn.primary:hover { box-shadow: 0 14px 34px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.24); }
.mm-btn.primary.is-blocked { background: var(--bg-inset); color: var(--text-tertiary); box-shadow: none; }
.mm-btn.ghost { background: var(--bg-subtle); color: var(--text-primary); border-color: var(--border); }
.mm-btn.tertiary { background: transparent; color: var(--text-secondary); }
.mm-btn.tertiary:hover { color: var(--accent); }
.mm-btn.danger { background: var(--loss-soft); color: var(--loss); border-color: color-mix(in srgb, var(--loss) 30%, transparent); }

/* ─────────────────────────── Inputs ─────────────────────────── */
.mm-field { display: flex; flex-direction: column; gap: 6px; }
.mm-field-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.mm-field-hint { font-size: 11px; color: var(--text-tertiary); }
.mm-input, .mm-select, .mm-textarea {
  width: 100%; appearance: none; font-family: var(--font-ui); font-size: 15px;
  padding: 11px 13px; border-radius: var(--r-s);
  background: var(--bg-canvas-2); color: var(--text-primary);
  border: 1px solid var(--border); transition: border var(--dur-2), box-shadow var(--dur-2);
}
.mm-input.mono, .mm-select.mono { font-family: var(--font-mono); }
.mm-textarea { resize: vertical; min-height: 64px; line-height: 1.5; }
.mm-input:focus, .mm-select:focus, .mm-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mm-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238A96A8' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }

.seg { display: inline-flex; background: var(--bg-canvas-2); border: 1px solid var(--border); border-radius: var(--r-s); padding: 3px; gap: 2px; }
.seg-btn { flex: 1; appearance: none; border: 0; background: transparent; cursor: pointer; padding: 8px 14px; border-radius: 7px; font-weight: 700; font-size: 13px; color: var(--text-secondary); transition: all var(--dur-2); }
.seg-btn.is-on { background: var(--accent); color: var(--text-on-accent); box-shadow: 0 4px 12px var(--accent-glow); }

/* ─────────────────────────── Toasts ─────────────────────────── */
.mm-toast-host { position: fixed; left: 0; right: 0; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 9000; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.mm-toast { pointer-events: auto; max-width: 480px; width: max-content; max-width: calc(100% - 8px); background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border); border-radius: var(--r-m); padding: 11px 16px; box-shadow: var(--shadow-3); font-size: 13.5px; font-weight: 500; opacity: 0; transform: translateY(12px) scale(0.97); transition: all var(--dur-3) var(--ease-spring); }
.mm-toast.is-in { opacity: 1; transform: none; }
.mm-toast.is-out { opacity: 0; transform: translateY(8px); }
.mm-update-toast, .mm-install-hint { display: flex; align-items: center; gap: 14px; }
.mm-update-copy { display: flex; flex-direction: column; gap: 2px; }
.mm-update-copy b { font-size: 14px; } .mm-update-copy span { font-size: 12px; color: var(--text-secondary); }
.mm-update-btn { appearance: none; border: 0; cursor: pointer; background: var(--accent); color: var(--text-on-accent); font-weight: 700; font-size: 13px; padding: 8px 14px; border-radius: var(--r-s); white-space: nowrap; }
.mm-install-close { appearance: none; border: 0; background: var(--bg-subtle); color: var(--text-secondary); cursor: pointer; width: 28px; height: 28px; border-radius: 50%; display: grid; place-content: center; }

/* ─────────────────────────── Sheets / dialogs ─────────────────────────── */
.mm-sheet-overlay, .mm-dialog { position: fixed; inset: 0; z-index: 8000; background: var(--bg-overlay); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity var(--dur-2); }
.mm-dialog { align-items: center; padding: 20px; }
.mm-sheet-overlay.is-open, .mm-dialog.is-open { opacity: 1; }
.mm-sheet-overlay.is-closing, .mm-dialog.is-closing { opacity: 0; }
.mm-sheet { width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; background: var(--bg-surface); border: 1px solid var(--border-hair); border-radius: var(--r-2xl) var(--r-2xl) 0 0; padding: 8px 18px calc(24px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-4); transform: translateY(100%); transition: transform var(--dur-3) var(--ease-emphasized); }
.mm-sheet-overlay.is-open .mm-sheet { transform: none; }
.mm-sheet::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 999px; background: var(--border-strong); margin: 8px auto 14px; }
.mm-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.mm-sheet-eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--accent); }
.mm-sheet-title { margin: 2px 0 0; font-family: var(--font-display); font-size: 24px; font-weight: 500; }
.mm-close { appearance: none; border: 0; background: var(--bg-subtle); color: var(--text-secondary); cursor: pointer; width: 32px; height: 32px; border-radius: 50%; display: grid; place-content: center; flex-shrink: 0; }

.mm-dialog-sheet { width: 100%; max-width: 420px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 22px; box-shadow: var(--shadow-4); transform: scale(0.95); transition: transform var(--dur-2) var(--ease-spring); }
.mm-dialog.is-open .mm-dialog-sheet { transform: none; }
.mm-dialog-title { margin: 0 0 6px; font-family: var(--font-display); font-size: 21px; font-weight: 500; }
.mm-dialog-body { margin: 0 0 16px; color: var(--text-secondary); font-size: 14px; line-height: 1.5; }
.mm-dialog-fields { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.mm-dialog-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ─────────────────────────── Top nav + disclaimer ─────────────────────────── */
.topnav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.topnav-back { appearance: none; border: 0; background: var(--bg-subtle); color: var(--text-secondary); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px 8px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.topnav-meta { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.07em; color: var(--text-tertiary); text-align: right; }

.mm-disclaimer { appearance: none; cursor: pointer; width: 100%; display: flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: var(--r-s); background: var(--bg-subtle); border: 1px solid var(--border-hair); color: var(--text-secondary); font-size: 12px; }
.mm-disclaimer svg { color: var(--cyan); flex-shrink: 0; }
.mm-disclaimer-more { margin-left: auto; color: var(--accent); font-weight: 700; }
.disclaimer-body p { color: var(--text-secondary); font-size: 14px; line-height: 1.6; }
.disclaimer-sources { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.disclaimer-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 14px; border-radius: var(--r-s); background: var(--bg-canvas-2); border: 1px solid var(--border-hair); color: var(--text-primary); text-decoration: none; font-size: 13px; font-weight: 600; }
.disclaimer-link svg { color: var(--text-tertiary); }
.disclaimer-fine { font-size: 12px !important; color: var(--text-tertiary) !important; }

/* ─────────────────────────── Home ─────────────────────────── */
.home-head { display: flex; flex-direction: column; gap: 14px; padding-top: clamp(2px, 1.5vw, 16px); }
.home-head-top { display: flex; align-items: center; justify-content: space-between; }
.home-date-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; background: var(--bg-subtle); color: var(--text-secondary); font-size: 12px; font-weight: 600; }
.home-date-pill svg { color: var(--accent); }
.home-head-actions { display: flex; align-items: center; gap: 10px; }
.home-gear { appearance: none; border: 0; background: var(--bg-subtle); color: var(--text-secondary); cursor: pointer; width: 36px; height: 36px; border-radius: 50%; display: grid; place-content: center; }
.home-av { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--cyan)); color: #06120c; display: grid; place-content: center; font-weight: 800; font-size: 15px; }
.home-greet-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.home-greet { margin: 0; font-family: var(--font-display); font-size: clamp(34px, 6.5vw, 56px); font-weight: 400; line-height: 1.05; letter-spacing: -0.02em; }
.home-greet .name { color: var(--text-primary); }
.home-logo { width: 46px; height: 46px; border-radius: 14px; background: linear-gradient(145deg, #11161f, #0a0d13); border: 1px solid var(--border); display: grid; place-content: center; box-shadow: var(--shadow-2); }
.home-logo-mark { font-family: var(--font-display); font-size: 26px; background: linear-gradient(135deg, var(--cyan), var(--emerald)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.stat-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat { min-width: 0; background: linear-gradient(180deg, var(--bg-surface), color-mix(in srgb, var(--bg-surface) 88%, var(--bg-canvas-2))); border: 1px solid var(--border); border-radius: var(--r-l); padding: clamp(14px, 2vw, 18px); box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255,255,255,0.035); }
.stat-top { display: flex; align-items: center; gap: 11px; }
.glyph { width: 36px; height: 36px; border-radius: 11px; display: grid; place-content: center; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.stat-streak .glyph { background: var(--amber-soft); color: var(--amber); }
.stat-figures .num { font-family: var(--font-mono); font-size: 26px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.stat-figures .lbl { font-size: 11px; color: var(--text-tertiary); font-weight: 600; margin-top: 2px; }
.stat-foot { margin-top: 10px; font-size: 11.5px; color: var(--text-secondary); overflow-wrap: anywhere; }

.quest-card {
  display: flex; align-items: center; gap: 18px;
  background:
    radial-gradient(52% 80% at 90% 100%, var(--accent-glow), transparent 62%),
    linear-gradient(160deg, var(--bg-elevated), var(--bg-surface));
}
.quest-card.is-complete { border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.quest-ring-shell { flex-shrink: 0; }
.quest-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.quest-body .ttl { font-size: 15px; font-weight: 700; }
.quest-body .muted { margin: 0 0 4px; }
.mm-ring { position: relative; width: 72px; height: 72px; color: var(--accent); }
.mm-ring svg { width: 72px; height: 72px; }
.mm-ring-arc { transition: stroke-dashoffset var(--dur-5) var(--ease-out); }
.mm-ring-center { position: absolute; inset: 0; display: grid; place-content: center; }
.mm-ring-center b { font-family: var(--font-mono); font-size: 19px; font-weight: 700; color: var(--text-primary); }
.mm-ring-center b i { font-size: 11px; font-style: normal; color: var(--text-tertiary); }
.mm-ring.is-complete .mm-ring-center { color: var(--accent); }

.nextup-card .section-head, .portfolio-summary .section-head { margin-bottom: 10px; }
.nextup-row { width: 100%; appearance: none; border: 0; cursor: pointer; background: var(--bg-canvas-2); border: 1px solid var(--border-hair); border-radius: var(--r-m); padding: 12px; display: flex; align-items: center; gap: 12px; margin-bottom: 8px; text-align: left; color: var(--text-primary); transition: border var(--dur-2), background var(--dur-2), transform var(--dur-1); }
.nextup-row:last-child { margin-bottom: 0; }
.nextup-row:hover { border-color: var(--border); background: color-mix(in srgb, var(--bg-canvas-2) 82%, var(--accent-soft)); transform: translateY(-1px); }
.nextup-row.is-static { cursor: default; }
.nextup-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-content: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); flex-shrink: 0; }
.nextup-copy { flex: 1; min-width: 0; }
.nextup-copy .lbl { font-size: 11px; color: var(--text-tertiary); font-weight: 600; }
.nextup-copy .ttl { color: var(--text-primary); font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nextup-row > svg:last-child { color: var(--text-tertiary); }

.pf-equity { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pf-equity-main .lbl { font-size: 11px; color: var(--text-tertiary); font-weight: 600; }
.pf-equity-val { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.pf-equity-pl { text-align: right; display: flex; flex-direction: column; }
.pf-equity-pl span:first-child { font-size: 16px; font-weight: 700; }
.pf-equity-pl span:last-child { font-size: 12px; opacity: 0.8; }
.pf-grid, .account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pf-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mini-stat { min-width: 0; background: var(--bg-canvas-2); border-radius: var(--r-s); padding: 9px 10px; }
.mini-stat .lbl { font-size: 10px; color: var(--text-tertiary); font-weight: 600; overflow-wrap: anywhere; }
.mini-stat .val { font-size: 14px; font-weight: 700; margin-top: 2px; overflow-wrap: anywhere; }

/* Risk card */
.risk-card { border-left: 3px solid var(--success); }
.risk-card.risk-warn { border-left-color: var(--warning); }
.risk-card.risk-fail { border-left-color: var(--danger); }
.risk-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.risk-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-content: center; background: var(--profit-soft); color: var(--profit); flex-shrink: 0; }
.risk-warn .risk-icon { background: var(--amber-soft); color: var(--amber); }
.risk-fail .risk-icon { background: var(--loss-soft); color: var(--loss); }
.risk-top .ttl { font-size: 15px; font-weight: 700; }
.risk-checks { display: flex; flex-wrap: wrap; gap: 7px; }
.risk-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--bg-canvas-2); color: var(--text-secondary); }
.risk-chip.is-pass { color: var(--profit); } .risk-chip.is-pass svg { color: var(--profit); }
.risk-chip.is-warn { color: var(--amber); } .risk-chip.is-warn svg { color: var(--amber); }
.risk-chip.is-fail { color: var(--loss); } .risk-chip.is-fail svg { color: var(--loss); }

/* ─────────────────────────── Learn / skill tree ─────────────────────────── */
.learn-head, .sim-head { display: flex; flex-direction: column; gap: 6px; }
.learn-head h1, .sim-head h1 { margin: 2px 0; }
.learn-head .muted, .sim-head .muted { margin: 0; }
.sim-head { flex-direction: row; align-items: flex-end; justify-content: space-between; }
.sim-head > div { display: flex; flex-direction: column; gap: 4px; }
.sim-head h1 { margin: 0; }

.skill-tree { display: flex; flex-direction: column; }
.skill-node { appearance: none; border: 0; cursor: pointer; background: transparent; text-align: left; color: var(--text-primary); display: flex; gap: 14px; padding: 0; align-items: stretch; }
.skill-node[aria-disabled="true"] { cursor: default; }
.skill-spine-col { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.skill-dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-content: center; background: var(--bg-surface); border: 2px solid var(--accent); color: var(--accent); font-family: var(--font-mono); font-weight: 700; font-size: 14px; z-index: 1; box-shadow: 0 0 0 4px var(--bg-canvas), 0 6px 16px var(--accent-glow); }
.skill-node.is-coming .skill-dot { border-color: var(--border-strong); color: var(--text-tertiary); box-shadow: 0 0 0 4px var(--bg-canvas); }
.skill-node.is-complete .skill-dot { background: var(--accent); color: var(--text-on-accent); }
.skill-line { flex: 1; width: 2px; background: linear-gradient(var(--accent), var(--border)); opacity: 0.4; min-height: 12px; }
.skill-node.is-coming .skill-line { background: var(--border); }
.skill-body { flex: 1; min-width: 0; background: var(--bg-surface); border: 1px solid var(--border-hair); border-radius: var(--r-l); padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow-1); transition: border var(--dur-2), transform var(--dur-2); }
.skill-node:not([aria-disabled="true"]):hover .skill-body { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.skill-node.is-coming .skill-body { opacity: 0.72; }
.skill-kicker { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.skill-node.is-coming .skill-kicker { color: var(--text-tertiary); }
.skill-title { font-size: 17px; font-weight: 700; margin: 3px 0 5px; letter-spacing: -0.01em; }
.skill-sum { margin: 0; font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }
.skill-prog { margin-top: 10px; height: 5px; border-radius: 999px; background: var(--bg-inset); overflow: hidden; }
.skill-prog i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--cyan)); transition: width var(--dur-4) var(--ease-out); }
.skill-node > svg:last-child { align-self: center; color: var(--text-tertiary); flex-shrink: 0; margin-bottom: 12px; }

/* Module spine */
.module-hero { display: flex; flex-direction: column; gap: 6px; }
.module-hero .label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.module-hero h1 { margin: 2px 0; }
.module-hero .muted { margin: 0; }
.module-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mstat { background: var(--bg-surface); border: 1px solid var(--border-hair); border-radius: var(--r-m); padding: 12px; text-align: center; }
.mstat .num { display: block; font-size: 20px; font-weight: 700; }
.mstat .lbl { font-size: 10px; color: var(--text-tertiary); font-weight: 600; margin-top: 2px; }

.spine { display: flex; flex-direction: column; gap: 8px; }
.chapter { margin: 14px 0 4px; }
.chapter .lbl { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-tertiary); }
.chapter .ttl { font-family: var(--font-display); font-size: 19px; font-weight: 500; margin-top: 2px; }
.level { display: flex; gap: 13px; padding: 13px 14px; background: var(--bg-surface); border: 1px solid var(--border-hair); border-radius: var(--r-m); color: var(--text-primary); cursor: pointer; transition: border var(--dur-2), transform var(--dur-1); }
.level:active { transform: scale(0.99); }
.level[data-state="current"] { border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 6px 18px var(--accent-glow); }
.level[data-locked="true"] { opacity: 0.55; cursor: default; }
.level[data-capstone="true"] { background: linear-gradient(135deg, var(--accent-soft), transparent); }
.level .dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-content: center; background: var(--bg-inset); color: var(--text-secondary); font-family: var(--font-mono); font-weight: 700; font-size: 13px; flex-shrink: 0; }
.level[data-state="current"] .dot, .level[data-state="unlocked"] .dot { background: var(--accent-soft); color: var(--accent); }
.level[data-state="mastered"] .dot { background: var(--accent); color: var(--text-on-accent); }
.level-body { flex: 1; min-width: 0; }
.level-body .ttl { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.level-body .ttl > span:first-child { font-size: 14.5px; font-weight: 600; }
.level-body .xp { font-size: 11px; color: var(--accent); font-weight: 700; flex-shrink: 0; }
.level-body .detail { font-size: 12px; color: var(--text-secondary); margin-top: 3px; line-height: 1.4; }
.level-kind { display: flex; align-items: center; gap: 8px; margin-top: 7px; font-size: 11px; color: var(--text-tertiary); font-weight: 600; }
.retake-chip { padding: 2px 8px; border-radius: 999px; background: var(--bg-inset); font-size: 10px; }

/* ─────────────────────────── Lesson player ─────────────────────────── */
.lesson { display: flex; flex-direction: column; height: 100%; }
.lesson-top { display: flex; align-items: center; gap: 12px; padding: max(14px, env(safe-area-inset-top)) 16px 10px; }
.lesson-close, .lesson-glossary { appearance: none; border: 0; background: var(--bg-subtle); color: var(--text-secondary); cursor: pointer; width: 34px; height: 34px; border-radius: 50%; display: grid; place-content: center; flex-shrink: 0; }
.lesson-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--bg-inset); overflow: hidden; }
.lesson-bar > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--cyan)); transition: width var(--dur-3) var(--ease-out); }
.lesson-content { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 18px 18px; }
.lesson-foot { padding: 12px 18px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border-hair); background: var(--bg-glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.lesson-eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.lesson-prompt { font-family: var(--font-display); font-size: 24px; font-weight: 500; line-height: 1.2; margin: 8px 0 6px; }
.lesson-help { font-size: 13px; color: var(--text-secondary); margin: 0 0 16px; }

/* Reading */
.reading-page { animation: fadeUp var(--dur-3) var(--ease-out); }
.reading-page.slide-left { animation: slideL var(--dur-3) var(--ease-out); }
.reading-page.slide-right { animation: slideR var(--dur-3) var(--ease-out); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } } @keyframes slideL { from { opacity: 0; transform: translateX(24px); } } @keyframes slideR { from { opacity: 0; transform: translateX(-24px); } }
.reading-eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.reading-ref { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.reading-passage { margin: 16px 0; }
.reading-passage-body p { font-family: var(--font-display); font-size: 19px; line-height: 1.5; font-weight: 400; letter-spacing: -0.01em; margin: 0 0 14px; color: var(--text-primary); }
.reading-key { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); border-radius: var(--r-m); padding: 14px; margin: 16px 0; }
.reading-key .lbl { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.reading-key .ttl { font-size: 16px; font-weight: 700; margin: 4px 0; }
.reading-key .def { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.reading-reflection { display: flex; flex-direction: column; gap: 5px; padding: 14px; background: var(--bg-canvas-2); border-radius: var(--r-m); }
.reading-reflection .ttl { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.04em; }
.reading-reflection > span:last-child { font-size: 13.5px; color: var(--text-secondary); line-height: 1.55; }
.reading-pager-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 16px; }
.reading-pager { display: flex; gap: 6px; }
.reading-pager span { width: 7px; height: 7px; border-radius: 50%; background: var(--bg-inset); transition: all var(--dur-2); }
.reading-pager span.is-active { width: 20px; border-radius: 999px; background: var(--accent); }
.reading-page-count { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); }

/* Quiz */
.quiz-pager { display: flex; gap: 5px; margin-bottom: 14px; }
.quiz-dot { flex: 1; height: 4px; border-radius: 999px; background: var(--bg-inset); }
.quiz-dot.is-past { background: var(--accent); opacity: 0.5; } .quiz-dot.is-active { background: var(--accent); }
.mcq-list { display: flex; flex-direction: column; gap: 10px; }
.mcq-opt { appearance: none; cursor: pointer; text-align: left; display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--r-m); background: var(--bg-surface); border: 1.5px solid var(--border); color: var(--text-primary); transition: all var(--dur-2); }
.mcq-opt .badge { width: 26px; height: 26px; border-radius: 8px; background: var(--bg-inset); color: var(--text-secondary); display: grid; place-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.opt-ttl { font-size: 14px; font-weight: 600; line-height: 1.4; }
.opt-detail { font-size: 12px; color: var(--text-tertiary); margin-top: 3px; }
.mcq-opt[data-state="correct"] { border-color: var(--profit); background: var(--profit-soft); }
.mcq-opt[data-state="correct"] .badge { background: var(--profit); color: #04130c; }
.mcq-opt[data-state="incorrect"] { border-color: var(--loss); background: var(--loss-soft); }
.mcq-opt[data-state="incorrect"] .badge { background: var(--loss); color: #fff; }
.mcq-opt[data-state="dimmed"] { opacity: 0.5; }
.mcq-explain { margin-top: 14px; padding: 14px; border-radius: var(--r-m); background: var(--bg-canvas-2); border: 1px solid var(--border-hair); animation: fadeUp var(--dur-2) var(--ease-out); }
.mcq-explain[data-feedback="correct"] { border-color: color-mix(in srgb, var(--profit) 40%, transparent); }
.mcq-explain[data-feedback="incorrect"] { border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
.mcq-explain .hd { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.mcq-explain[data-feedback="correct"] .hd { color: var(--profit); } .mcq-explain[data-feedback="incorrect"] .hd { color: var(--amber); }
.mcq-explain .txt { font-size: 13px; color: var(--text-secondary); line-height: 1.55; }
.mcq-explain .src { font-size: 11px; color: var(--text-tertiary); margin-top: 8px; font-style: italic; }

/* Matching */
.match-source { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.match-source.is-empty { display: none; }
.match-card { appearance: none; cursor: pointer; background: var(--bg-surface); border: 1.5px solid var(--border); border-radius: var(--r-s); padding: 10px 13px; text-align: left; color: var(--text-primary); transition: all var(--dur-2); }
.match-card[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.match-card .t { font-size: 13.5px; font-weight: 600; }
.match-card .s { font-size: 11px; color: var(--text-tertiary); }
.match-targets { display: flex; flex-direction: column; gap: 10px; }
.match-target { appearance: none; cursor: pointer; text-align: left; padding: 13px 14px; border-radius: var(--r-m); background: var(--bg-canvas-2); border: 1.5px dashed var(--border); color: var(--text-primary); transition: all var(--dur-2); }
.match-target[data-state="active"] { border-style: solid; border-color: var(--accent); }
.match-target[data-state="filled"] { border-style: solid; background: var(--bg-surface); }
.match-target .ttl { font-size: 14px; font-weight: 700; }
.match-target .detail { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.match-target .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.match-target .chip { padding: 4px 10px; border-radius: 999px; background: var(--accent); color: var(--text-on-accent); font-size: 11px; font-weight: 600; }
.match-shake { animation: shake 0.32s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.glossary-list { display: flex; flex-direction: column; gap: 12px; }
.glossary-item { padding: 12px 14px; border-radius: var(--r-m); background: var(--bg-canvas-2); }
.glossary-term { font-size: 14px; font-weight: 700; color: var(--accent); }
.glossary-def { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-top: 3px; }

/* ─────────────────────────── Complete ─────────────────────────── */
.complete-wrap { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding-top: 28px; }
.fade-in { animation: fadeUp var(--dur-4) var(--ease-out); }
.complete-medal { width: 76px; height: 76px; border-radius: 22px; display: grid; place-content: center; background: var(--accent-soft); color: var(--accent); box-shadow: 0 12px 32px var(--accent-glow); margin-bottom: 6px; }
.complete-eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--accent); }
.complete-sub { font-size: 14px; color: var(--text-secondary); }
.complete-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; margin: 22px 0; }
.cstat { background: var(--bg-surface); border: 1px solid var(--border-hair); border-radius: var(--r-m); padding: 14px 8px; }
.cstat .num { font-size: 22px; font-weight: 700; }
.cstat .lbl { font-size: 10px; color: var(--text-tertiary); font-weight: 600; margin-top: 3px; }
.complete-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.unlock-toast { display: flex; align-items: center; gap: 12px; background: var(--bg-elevated); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: var(--r-m); padding: 12px 16px; margin-bottom: 8px; box-shadow: var(--shadow-2); }
.unlock-glyph { width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-content: center; font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.toast-kicker { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); font-weight: 700; }
.toast-title { font-size: 15px; font-weight: 700; }

/* ─────────────────────────── Review card ─────────────────────────── */
.review-card { background: var(--bg-canvas-2); border: 1px solid var(--border-hair); border-left: 3px solid var(--accent); border-radius: var(--r-m); padding: 14px; }
.review-top .lbl { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.review-top .ttl { font-size: 16px; font-weight: 700; margin: 5px 0; line-height: 1.3; }
.review-top .src { font-size: 11px; color: var(--text-tertiary); }
.review-hint { font-size: 12px; color: var(--text-tertiary); margin: 10px 0; font-style: italic; }
.answer { font-size: 14px; color: var(--text-primary); line-height: 1.55; white-space: pre-line; padding: 12px; background: var(--bg-surface); border-radius: var(--r-s); margin: 10px 0; }
.review-actions { display: flex; gap: 10px; margin-top: 10px; }
.review-actions .mm-btn { flex: 1; }

/* ─────────────────────────── Simulator ─────────────────────────── */
.account-card { background: linear-gradient(160deg, var(--bg-elevated), var(--bg-surface)); }
.account-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.account-top .lbl { font-size: 11px; color: var(--text-tertiary); font-weight: 600; }
.account-equity { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.account-pl { text-align: right; } .account-pl .mono { font-size: 17px; font-weight: 700; } .account-pl .sub { font-size: 12px; opacity: 0.8; }
.account-grid { margin-bottom: 12px; }
.account-note { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--text-tertiary); }
.account-note svg { color: var(--cyan); flex-shrink: 0; }

.pos-list, .order-list, .watch-list, .journal-list { display: flex; flex-direction: column; gap: 8px; }
.pos-row { width: 100%; appearance: none; cursor: pointer; background: var(--bg-canvas-2); border: 1px solid var(--border-hair); border-radius: var(--r-m); padding: 12px 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; color: var(--text-primary); }
.pos-sym { font-size: 15px; font-weight: 700; }
.pos-sub { font-size: 11.5px; color: var(--text-tertiary); margin-top: 2px; }
.pos-figs { text-align: right; }
.pos-val { font-size: 14px; font-weight: 700; }
.pos-pl { font-size: 12px; margin-top: 2px; }
.pos-weight { font-size: 10px; color: var(--text-tertiary); margin-top: 1px; }

.watch-row { display: flex; align-items: stretch; gap: 8px; }
.watch-main { flex: 1; appearance: none; cursor: pointer; background: var(--bg-canvas-2); border: 1px solid var(--border-hair); border-radius: var(--r-m); padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; color: var(--text-primary); }
.watch-sym { font-size: 14px; font-weight: 700; }
.watch-name { font-size: 11px; color: var(--text-tertiary); margin-top: 1px; }
.watch-price { text-align: right; } .watch-price .mono { font-size: 14px; font-weight: 700; } .watch-price .sub { font-size: 11px; }
.watch-remove { appearance: none; border: 0; background: var(--bg-subtle); color: var(--text-tertiary); cursor: pointer; width: 34px; border-radius: var(--r-m); display: grid; place-content: center; }

.order-row { display: flex; align-items: center; gap: 11px; padding: 10px 12px; background: var(--bg-canvas-2); border-radius: var(--r-m); }
.order-side { font-family: var(--font-mono); font-size: 10px; font-weight: 800; padding: 4px 8px; border-radius: 6px; flex-shrink: 0; }
.order-side.is-buy { background: var(--profit-soft); color: var(--profit); } .order-side.is-sell { background: var(--loss-soft); color: var(--loss); }
.order-main { flex: 1; min-width: 0; } .order-main .ttl { font-size: 13px; font-weight: 600; } .order-main .sub { font-size: 11px; color: var(--text-tertiary); margin-top: 1px; }
.order-val { font-size: 13px; font-weight: 700; }

.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 22px 16px; }
.empty-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-content: center; background: var(--bg-inset); color: var(--text-tertiary); }
.empty-state h3 { margin: 4px 0 0; font-size: 16px; } .empty-state p { margin: 0 0 8px; font-size: 13px; color: var(--text-secondary); line-height: 1.5; max-width: 320px; }

.symbol-pick-list { display: flex; flex-direction: column; gap: 6px; }
.symbol-pick { appearance: none; cursor: pointer; background: var(--bg-canvas-2); border: 1px solid var(--border-hair); border-radius: var(--r-m); padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; color: var(--text-primary); }
.symbol-pick.is-in { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); }
.symbol-pick .sym { font-size: 14px; font-weight: 700; } .symbol-pick .nm { font-size: 11px; color: var(--text-tertiary); margin-top: 1px; }
.symbol-pick-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.symbol-pick-tag { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bg-inset); color: var(--text-secondary); }
.symbol-pick.is-in .symbol-pick-tag { background: var(--accent); color: var(--text-on-accent); }
.sheet-foot-note { font-size: 11.5px; color: var(--text-tertiary); margin: 12px 0 0; }

/* Order ticket */
.ticket-form { display: flex; flex-direction: column; gap: 14px; }
.ticket-sizes { display: flex; gap: 6px; margin-top: 8px; }
.size-chip { appearance: none; cursor: pointer; flex: 1; background: var(--bg-subtle); border: 1px solid var(--border-hair); border-radius: var(--r-s); padding: 7px; font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.size-chip:hover { color: var(--accent); border-color: var(--accent); }
.ticket-preview { background: var(--bg-canvas-2); border-radius: var(--r-m); padding: 13px 14px; display: flex; flex-direction: column; gap: 7px; }
.tp-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--text-secondary); }
.tp-row b { color: var(--text-primary); font-weight: 700; }
.tp-total { border-top: 1px solid var(--border-hair); padding-top: 8px; margin-top: 1px; }
.tp-total span, .tp-total b { font-size: 14.5px; color: var(--text-primary); font-weight: 700; }
.ticket-checks { display: flex; flex-direction: column; gap: 7px; }
.ticket-check { display: flex; gap: 9px; align-items: flex-start; padding: 9px 11px; border-radius: var(--r-s); background: var(--bg-canvas-2); }
.ticket-check svg { flex-shrink: 0; margin-top: 1px; }
.ticket-check b { display: block; font-size: 12.5px; font-weight: 700; }
.ticket-check span { font-size: 11px; color: var(--text-tertiary); line-height: 1.4; }
.ticket-check.is-pass { color: var(--profit); } .ticket-check.is-pass b { color: var(--text-primary); }
.ticket-check.is-warn { color: var(--amber); } .ticket-check.is-warn b { color: var(--text-primary); }
.ticket-check.is-fail { color: var(--loss); background: var(--loss-soft); } .ticket-check.is-fail b { color: var(--text-primary); }
.ticket-journal-cta { appearance: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 11px 13px; border-radius: var(--r-s); background: var(--violet-soft); border: 1px dashed color-mix(in srgb, var(--violet) 40%, transparent); color: var(--violet); font-size: 13px; font-weight: 600; }
.ticket-disclaimer { font-size: 11px; color: var(--text-tertiary); text-align: center; margin: 2px 0 0; line-height: 1.4; }

/* ─────────────────────────── Journal ─────────────────────────── */
.journal-row { width: 100%; appearance: none; cursor: pointer; text-align: left; background: var(--bg-canvas-2); border: 1px solid var(--border-hair); border-radius: var(--r-m); padding: 13px; display: flex; flex-direction: column; gap: 7px; color: var(--text-primary); }
.journal-row.is-open { border-left: 3px solid var(--violet); }
.journal-row.is-reviewed { opacity: 0.82; }
.jr-top { display: flex; align-items: center; gap: 8px; }
.jr-sym { font-size: 14px; font-weight: 700; }
.jr-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.jr-tag { font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--bg-inset); color: var(--text-secondary); }
.jr-status { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--violet-soft); color: var(--violet); }
.journal-row.is-reviewed .jr-status { background: var(--profit-soft); color: var(--profit); }
.jr-thesis { font-size: 13.5px; color: var(--text-primary); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.jr-foot { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--text-tertiary); flex-wrap: wrap; }
.jr-emotion { padding: 2px 8px; border-radius: 999px; background: var(--bg-inset); }
.jr-linked { display: inline-flex; align-items: center; gap: 3px; color: var(--cyan); }
.jr-review-cta { margin-left: auto; color: var(--violet); font-weight: 700; }

.journal-form { display: flex; flex-direction: column; gap: 13px; }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.journal-detail { display: flex; flex-direction: column; gap: 14px; }
.jd-head { display: flex; align-items: center; gap: 10px; }
.jd-sym { font-size: 20px; font-weight: 700; }
.jd-thesis { font-size: 15px; line-height: 1.55; color: var(--text-primary); margin: 0; }
.jd-grid { display: flex; flex-direction: column; gap: 1px; background: var(--border-hair); border-radius: var(--r-m); overflow: hidden; }
.jd-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 13px; background: var(--bg-canvas-2); }
.jd-row .lbl { font-size: 12px; color: var(--text-tertiary); } .jd-row .val { font-size: 13px; font-weight: 600; text-align: right; }
.jd-order { display: flex; align-items: center; gap: 8px; padding: 11px 13px; border-radius: var(--r-m); background: var(--cyan-soft); color: var(--cyan); font-size: 12.5px; font-weight: 600; }
.jd-review { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; border-top: 1px solid var(--border-hair); }
.jd-outcome { display: flex; align-items: center; justify-content: space-between; padding: 11px 13px; border-radius: var(--r-m); background: var(--bg-canvas-2); }
.jd-outcome.is-win { background: var(--profit-soft); color: var(--profit); } .jd-outcome.is-loss { background: var(--loss-soft); color: var(--loss); }
.jd-outcome .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.jd-note { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin: 0; }

/* ─────────────────────────── Portfolio / broker ─────────────────────────── */
.broker-card { display: flex; flex-direction: column; gap: 13px; }
.broker-top { display: flex; align-items: center; gap: 13px; }
.broker-logo { width: 46px; height: 46px; border-radius: 13px; background: var(--cyan-soft); color: var(--cyan); display: grid; place-content: center; flex-shrink: 0; }
.broker-top .ttl { font-size: 16px; font-weight: 700; }
.broker-status { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.broker-status .dot { width: 8px; height: 8px; border-radius: 50%; }
.broker-status .dot.is-off { background: var(--text-tertiary); } .broker-status .dot.is-demo { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.broker-copy { font-size: 13px; color: var(--text-secondary); line-height: 1.55; margin: 0; }
.broker-actions { display: flex; flex-direction: column; gap: 8px; }
.broker-mock { display: flex; flex-direction: column; gap: 12px; }
.mock-banner { display: flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: var(--r-s); background: var(--amber-soft); color: var(--amber); font-size: 11.5px; font-weight: 700; }
.mock-acct { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 8px; } .mock-acct b { font-size: 16px; } .mock-acct span { font-size: 12px; color: var(--text-tertiary); }

.readiness-card .muted { margin: 0 0 12px; }
.checklist { display: flex; flex-direction: column; gap: 9px; }
.check-item { display: flex; align-items: center; gap: 11px; font-size: 13.5px; }
.check-box { width: 24px; height: 24px; border-radius: 7px; border: 1.5px solid var(--border-strong); display: grid; place-content: center; flex-shrink: 0; color: var(--text-on-accent); }
.check-item.is-done .check-box { background: var(--accent); border-color: var(--accent); }
.check-item.is-done { color: var(--text-primary); } .check-item.is-todo { color: var(--text-secondary); }
.readiness-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-hair); font-size: 11.5px; color: var(--text-tertiary); }
.readiness-foot svg { color: var(--amber); flex-shrink: 0; }
.block-error { display: flex; align-items: center; gap: 9px; color: var(--loss); font-size: 14px; margin-bottom: 8px; }

/* ─────────────────────────── Onboarding ─────────────────────────── */
.onb { height: 100%; display: flex; flex-direction: column; padding: max(18px, env(safe-area-inset-top)) 22px calc(22px + env(safe-area-inset-bottom)); }
.onb-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.onb-dots { display: flex; gap: 6px; }
.onb-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--bg-inset); transition: all var(--dur-2); }
.onb-dots span.is-active { width: 22px; border-radius: 999px; background: var(--accent); }
.onb-skip { appearance: none; border: 0; background: transparent; color: var(--text-tertiary); cursor: pointer; font-size: 13px; font-weight: 600; }
.onb-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.onb-body.is-slide-in { animation: fadeUp var(--dur-3) var(--ease-out); }
.onb-brand { width: 64px; height: 64px; border-radius: 18px; background: linear-gradient(145deg, #11161f, #0a0d13); border: 1px solid var(--border); display: grid; place-content: center; margin-bottom: 18px; box-shadow: var(--shadow-2); }
.onb-mark { font-family: var(--font-display); font-size: 34px; background: linear-gradient(135deg, var(--cyan), var(--emerald)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.onb-eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.onb-title { margin: 10px 0 12px; }
.onb-lede { font-size: 15px; color: var(--text-secondary); line-height: 1.55; margin: 0; }
.onb-input { width: 100%; margin-top: 10px; padding: 14px 16px; border-radius: var(--r-m); background: var(--bg-canvas-2); border: 1.5px solid var(--border); color: var(--text-primary); font-size: 16px; }
.onb-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.onb-choice-col { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.onb-choice { appearance: none; cursor: pointer; text-align: left; display: flex; align-items: center; gap: 12px; padding: 15px; border-radius: var(--r-m); background: var(--bg-surface); border: 1.5px solid var(--border); color: var(--text-primary); transition: all var(--dur-2); }
.onb-choice.is-on { border-color: var(--accent); background: var(--accent-soft); }
.onb-choice-main { flex: 1; } .onb-choice-main b { display: block; font-size: 15px; } .onb-choice-main span { font-size: 12.5px; color: var(--text-secondary); }
.onb-choice-tick { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--border); display: grid; place-content: center; color: var(--accent); }
.onb-choice.is-on .onb-choice-tick { border-color: var(--accent); background: var(--accent); color: var(--text-on-accent); }
.onb-goal-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.goal { appearance: none; cursor: pointer; aspect-ratio: 1; border-radius: var(--r-m); background: var(--bg-surface); border: 1.5px solid var(--border); color: var(--text-primary); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; transition: all var(--dur-2); }
.goal.sm { aspect-ratio: auto; padding: 10px 8px; flex-direction: row; gap: 4px; }
.goal.is-on { border-color: var(--accent); background: var(--accent-soft); }
.goal .n { font-size: 22px; font-weight: 700; } .goal.sm .n { font-size: 16px; } .goal .l { font-size: 11px; color: var(--text-tertiary); }
.onb-disclaimer { display: flex; align-items: flex-start; gap: 8px; margin-top: 20px; padding: 12px 14px; border-radius: var(--r-m); background: var(--bg-subtle); font-size: 12px; color: var(--text-secondary); line-height: 1.45; }
.onb-disclaimer svg { color: var(--cyan); flex-shrink: 0; margin-top: 1px; }
.onb-foot { display: flex; gap: 10px; margin-top: 18px; }
.onb-foot .mm-btn { flex: 1; }

/* ─────────────────────────── Settings ─────────────────────────── */
.settings-body { display: flex; flex-direction: column; gap: 18px; }
.set-section { display: flex; flex-direction: column; gap: 8px; }
.set-theme { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-choice { appearance: none; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border-radius: var(--r-m); background: var(--bg-canvas-2); border: 1.5px solid var(--border); color: var(--text-primary); }
.theme-choice.is-on { border-color: var(--accent); }
.theme-preview { width: 100%; height: 34px; border-radius: 8px; border: 1px solid var(--border-hair); }
.theme-preview.theme-ink { background: linear-gradient(135deg, #0a0d13, #161c28); }
.theme-preview.theme-paper { background: linear-gradient(135deg, #f4f1ea, #fcfaf5); }
.theme-choice b { font-size: 13px; } .theme-choice small { font-size: 11px; color: var(--text-tertiary); }
.set-goal { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.set-link { width: 100%; appearance: none; cursor: pointer; display: flex; align-items: center; gap: 11px; padding: 12px 13px; border-radius: var(--r-m); background: var(--bg-canvas-2); border: 1px solid var(--border-hair); color: var(--text-primary); font-size: 13.5px; font-weight: 600; text-align: left; }
.set-link svg:first-child { color: var(--accent); } .set-link svg:last-child { margin-left: auto; color: var(--text-tertiary); }
.set-link span { flex: 1; } .set-link.danger { color: var(--loss); } .set-link.danger svg:first-child { color: var(--loss); }

@media (min-width: 720px) {
  .home-head { padding-top: 24px; }
  .quest-card { padding: 22px; }
  .section-head h2 { font-size: 26px; }
  .sim-head h1, .learn-head h1 { font-size: 34px; }
}

@media (max-width: 620px) {
  .app-root { --app-content-max: 100%; }
  .tabbar { border-radius: 18px 18px 0 0; }
}

@media (max-width: 430px) {
  .pf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quest-card { flex-direction: column; align-items: stretch; }
  .quest-ring-shell { align-self: center; }
}

@media (max-width: 360px) {
  .home-greet { font-size: 30px; }
  .stat-row { grid-template-columns: 1fr; }
}

/* ─────────────────────────── Masterclass polish pass ─────────────────────────── */
html { background: var(--bg-canvas); }
body {
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}
body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
body::before {
  background:
    radial-gradient(70% 38% at 50% -12%, color-mix(in srgb, var(--accent-glow) 72%, transparent), transparent 62%),
    radial-gradient(42% 34% at 108% 14%, color-mix(in srgb, var(--cyan-glow) 54%, transparent), transparent 72%),
    linear-gradient(180deg, rgba(255,255,255,0.025), transparent 38%);
}
body::after {
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.026) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), transparent 68%);
}
.scroll {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text-tertiary) 44%, transparent) transparent;
  scroll-padding: 20px 0 120px;
}
.scroll::-webkit-scrollbar { width: 7px; }
.scroll::-webkit-scrollbar-track { background: transparent; }
.scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 40%, var(--text-tertiary)), color-mix(in srgb, var(--text-tertiary) 42%, transparent));
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, white 20%);
  outline-offset: 3px;
}
.card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.032), transparent 34%),
    radial-gradient(100% 90% at 100% 0%, color-mix(in srgb, var(--accent-soft) 42%, transparent), transparent 56%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg-elevated) 72%, var(--bg-surface)), var(--bg-surface));
  border-color: color-mix(in srgb, var(--border) 82%, var(--accent-soft));
  box-shadow:
    0 18px 48px rgba(0,0,0,0.34),
    0 1px 0 rgba(255,255,255,0.035) inset,
    0 -1px 0 rgba(0,0,0,0.30) inset;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,0.035);
  mask-image: linear-gradient(180deg, #000, transparent 68%);
}
.card::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,0.045), transparent 30%, transparent 72%, rgba(255,255,255,0.018));
  opacity: 0.55;
}
.card > * { position: static; z-index: auto; }
.card::before,
.card::after { content: none; }

.tabbar {
  position: relative;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg-elevated) 72%, transparent), color-mix(in srgb, var(--bg-canvas-2) 92%, transparent));
  box-shadow: 0 -20px 58px rgba(0,0,0,0.42), inset 0 1px 0 rgba(255,255,255,0.06);
}
.tabbar::before {
  content: '';
  position: absolute;
  left: 18px; right: 18px; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 50%, transparent), transparent);
}
.tabbar button { min-height: 58px; }
.tabbar button[aria-pressed="true"] {
  background:
    radial-gradient(120% 100% at 50% 0%, color-mix(in srgb, var(--accent-glow) 42%, transparent), transparent 72%),
    color-mix(in srgb, var(--accent-soft) 72%, transparent);
}

.home-head {
  position: relative;
  margin: 0 -2px;
  padding: clamp(4px, 1.5vw, 18px) 2px 2px;
}
.home-head::before {
  content: '';
  position: absolute;
  inset: -34px -22px -8px;
  pointer-events: none;
  background:
    radial-gradient(64% 72% at 12% 26%, color-mix(in srgb, var(--accent-glow) 34%, transparent), transparent 62%),
    linear-gradient(180deg, rgba(255,255,255,0.025), transparent 76%);
  border-radius: 0 0 var(--r-2xl) var(--r-2xl);
}
.home-head > * { position: relative; z-index: 1; }
.home-date-pill,
.home-gear,
.home-logo,
.home-av {
  border: 1px solid var(--border-hair);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 8px 22px rgba(0,0,0,0.24);
}
.home-date-pill { background: color-mix(in srgb, var(--bg-glass) 78%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.home-gear { transition: color var(--dur-2), background var(--dur-2), transform var(--dur-1); }
.home-gear:hover { color: var(--accent); background: var(--accent-soft); }
.home-greet .name {
  color: var(--accent);
  text-shadow: 0 0 34px color-mix(in srgb, var(--accent-glow) 46%, transparent);
}
.home-logo {
  background:
    radial-gradient(82% 82% at 50% 0%, color-mix(in srgb, var(--accent-soft) 65%, transparent), transparent 72%),
    linear-gradient(145deg, var(--bg-elevated), var(--bg-canvas-2));
}
.home-av { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent), 0 14px 32px var(--accent-glow); }

.mm-disclaimer {
  background: color-mix(in srgb, var(--bg-glass) 82%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-color: color-mix(in srgb, var(--border) 70%, var(--cyan-soft));
  min-height: 40px;
}
.mm-disclaimer-more { display: inline-flex; align-items: center; gap: 6px; }
.mm-disclaimer-more::after { content: ''; width: 6px; height: 6px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); opacity: 0.8; }

.stat {
  position: relative;
  overflow: hidden;
  min-height: 112px;
}
.stat::before {
  content: '';
  position: absolute;
  inset: -40% -20% auto auto;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent-glow) 50%, transparent), transparent 66%);
  opacity: 0.55;
}
.stat-streak::before { background: radial-gradient(circle, color-mix(in srgb, var(--amber-glow) 58%, transparent), transparent 66%); }
.stat-top { position: relative; align-items: flex-start; }
.glyph {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), 0 10px 24px rgba(0,0,0,0.28);
}
.stat-figures .num { font-size: clamp(28px, 5vw, 36px); letter-spacing: -0.045em; }
.stat-figures .lbl {
  text-transform: uppercase;
  letter-spacing: 0.10em;
  font-size: 10px;
}
.stat-foot { font-size: 13px; margin-top: 14px; }
.stat-spark,
.pf-spark {
  margin-left: auto;
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 38px;
  min-width: 62px;
  padding: 5px 7px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--bg-inset), transparent);
}
.stat-spark i,
.pf-spark i {
  display: block;
  width: 4px;
  height: var(--h);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 45%, transparent));
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent-glow) 54%, transparent);
}
.stat-state-pill {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.quest-card {
  position: relative;
  overflow: hidden;
  align-items: stretch;
  padding: clamp(17px, 2.6vw, 24px);
  border-color: color-mix(in srgb, var(--accent) 20%, var(--border));
}
.quest-card::before {
  background:
    radial-gradient(64% 100% at 98% 98%, color-mix(in srgb, var(--accent-glow) 72%, transparent), transparent 68%),
    linear-gradient(180deg, rgba(255,255,255,0.06), transparent 55%);
}
.quest-ring-shell {
  display: grid;
  place-content: center;
  min-width: 92px;
}
.mm-ring {
  width: 90px;
  height: 90px;
  color: var(--cyan);
  filter: drop-shadow(0 12px 28px rgba(0,0,0,0.30));
}
.mm-ring svg { width: 90px; height: 90px; }
.mm-ring-center b { font-size: 23px; }
.quest-body .ttl { font-size: clamp(19px, 3.5vw, 24px); letter-spacing: -0.02em; }
.quest-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 2px 0 8px;
}
.quest-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}
.quest-step svg { color: var(--cyan); }
.quest-step + .quest-step::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-tertiary);
  margin-right: 4px;
}
.quest-card .mm-btn.primary { width: min(100%, 420px); min-height: 44px; }

.nextup-card,
.portfolio-summary { padding: clamp(16px, 2.6vw, 22px); }
.nextup-row {
  min-height: 66px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg-canvas-2) 88%, white 4%), var(--bg-canvas-2));
  border-color: color-mix(in srgb, var(--border-hair) 70%, var(--accent-soft));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.nextup-icon {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 10px 24px color-mix(in srgb, var(--accent-glow) 38%, transparent);
}
.nextup-copy .lbl {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
}
.nextup-copy .ttl { font-size: 14.5px; letter-spacing: -0.01em; }
.nextup-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.nextup-meta.is-muted { color: var(--text-tertiary); }
.nextup-row > svg:last-child {
  width: 28px;
  height: 28px;
  padding: 7px;
  border-radius: 999px;
  background: var(--bg-subtle);
}

.portfolio-summary {
  overflow: hidden;
  background:
    radial-gradient(90% 80% at 95% 22%, color-mix(in srgb, var(--cyan-soft) 50%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg-elevated) 78%, var(--bg-surface)), var(--bg-surface));
}
.pf-cockpit {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(80px, 0.7fr) auto;
  align-items: stretch;
  gap: 14px;
  padding: 12px;
  border-radius: var(--r-m);
  background: color-mix(in srgb, var(--bg-canvas-2) 84%, transparent);
  border: 1px solid var(--border-hair);
  margin-bottom: 12px;
}
.pf-equity {
  margin: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}
.pf-equity-val { font-size: clamp(24px, 4.8vw, 34px); }
.pf-equity-pl { text-align: left; }
.pf-signal {
  display: grid;
  place-content: center;
  min-width: 86px;
  border-left: 1px solid var(--border-hair);
  border-right: 1px solid var(--border-hair);
}
.pf-spark {
  height: 54px;
  min-width: 80px;
  background: transparent;
}
.pf-spark i { width: 5px; }
.pf-position-ring {
  --pf-deg: 0deg;
  align-self: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-content: center;
  text-align: center;
  background:
    radial-gradient(circle at center, var(--bg-canvas-2) 0 54%, transparent 55%),
    conic-gradient(var(--cyan) var(--pf-deg), color-mix(in srgb, var(--cyan-soft) 46%, transparent) 0);
  box-shadow: inset 0 0 0 1px var(--border-hair), 0 12px 30px rgba(0,0,0,0.24);
}
.pf-position-ring span { font-size: 18px; font-weight: 900; }
.pf-position-ring small {
  max-width: 58px;
  margin-top: 2px;
  color: var(--text-tertiary);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.mini-stat {
  border: 1px solid var(--border-hair);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-canvas-2) 92%, white 3%), var(--bg-canvas-2));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.025);
}

.learn-head,
.sim-head,
.module-hero {
  position: relative;
  padding-top: 4px;
}
.learn-head::before,
.sim-head::before,
.module-hero::before {
  content: '';
  position: absolute;
  inset: -18px -10px -10px;
  pointer-events: none;
  background: radial-gradient(70% 80% at 0% 0%, color-mix(in srgb, var(--accent-soft) 44%, transparent), transparent 70%);
  border-radius: var(--r-2xl);
}
.learn-head > *,
.sim-head > *,
.module-hero > * { position: relative; z-index: 1; }
.skill-body,
.level,
.pos-row,
.watch-main,
.journal-row,
.order-row,
.review-card,
.mstat {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035), 0 8px 22px rgba(0,0,0,0.20);
}
.skill-node:not([aria-disabled="true"]):hover .skill-body,
.level:hover,
.pos-row:hover,
.watch-main:hover,
.journal-row:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
}
.skill-body {
  background:
    radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--accent-soft) 46%, transparent), transparent 70%),
    var(--bg-surface);
}
.level[data-state="current"],
.account-card,
.broker-card {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
}
.account-card {
  position: relative;
  overflow: hidden;
}
.account-card::before {
  background:
    radial-gradient(70% 90% at 100% 0%, color-mix(in srgb, var(--accent-glow) 50%, transparent), transparent 70%),
    linear-gradient(180deg, rgba(255,255,255,0.055), transparent 50%);
}
.mm-sheet {
  background:
    radial-gradient(90% 70% at 50% -20%, color-mix(in srgb, var(--accent-soft) 42%, transparent), transparent 70%),
    linear-gradient(180deg, var(--bg-elevated), var(--bg-surface));
  border-color: var(--border);
}
.mm-dialog-sheet { background: linear-gradient(180deg, var(--bg-elevated), var(--bg-surface)); }

@media (min-width: 720px) {
  .scroll { --app-gutter: 30px; padding-inline: var(--app-gutter); }
  .stat-row { gap: 16px; }
  .quest-card { gap: 24px; }
}

@media (max-width: 620px) {
  .home-greet { font-size: clamp(42px, 12vw, 62px); }
  .tabbar { margin-inline: 0; border-left: 0; border-right: 0; }
}

@media (max-width: 520px) {
  .nextup-meta { display: none; }
  .pf-cockpit { grid-template-columns: 1fr; }
  .pf-signal { display: none; }
  .pf-position-ring { width: 64px; height: 64px; position: absolute; top: 58px; right: 22px; }
  .portfolio-summary .pf-equity { padding-right: 86px; }
}

@media (max-width: 430px) {
  .quest-card .mm-btn.primary { width: 100%; }
  .quest-ring-shell { min-width: 0; }
  .mm-ring, .mm-ring svg { width: 84px; height: 84px; }
  .stat-state-pill { position: static; display: inline-flex; width: fit-content; margin-top: 9px; }
  .stat-foot { margin-top: 8px; }
}

@media (max-width: 360px) {
  .home-greet { font-size: 36px; }
  .home-logo { display: none; }
  .quest-step + .quest-step::before { display: none; }
}

.quest-card,
.portfolio-summary,
.account-card { overflow: visible; }
