/* TRADE MASTERY — dark trading-terminal design system
   Layout: fixed left rail navigation + scrolling workspace; terminal pages use a 3-column grid that collapses on tablets/phones. */
:root {
  --bg: #0a0d12;
  --bg2: #0d1117;
  --panel: #11161e;
  --panel2: #161c26;
  --raise: #1c2330;
  --line: #222a36;
  --line2: #2c3644;
  --text: #d9dee7;
  --muted: #8a94a6;
  --dim: #5d6778;
  --green: #16c784;
  --green-d: rgba(22, 199, 132, 0.13);
  --red: #f0465a;
  --red-d: rgba(240, 70, 90, 0.13);
  --accent: #4d8dff;
  --accent-d: rgba(77, 141, 255, 0.14);
  --gold: #f2b84b;
  --gold-d: rgba(242, 184, 75, 0.14);
  --purple: #a78bfa;
  --orange: #ff9f43;
  --f-display: 'Sora', 'Inter', system-ui, sans-serif;
  --f-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --r: 10px;
  --r-sm: 7px;
  --side-w: 236px;
  --top-h: 58px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before { content: ''; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--bg2); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--f-display); margin: 0 0 0.4em; line-height: 1.25; text-wrap: balance; letter-spacing: -0.01em; }
h2 { font-size: 1.55rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 600; }
h4 { font-size: 0.95rem; margin-top: 1em; }
p { margin: 0 0 0.7em; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 0.86em; }
.tiny { font-size: 0.76em; }
.big { font-size: 1.3em; font-weight: 700; }
.center { text-align: center; justify-content: center; }
.nowrap { white-space: nowrap; }
.up { color: var(--green) !important; }
.down { color: var(--red) !important; }
.up-bg { background: var(--green); }
.down-bg { background: var(--red); }
.xp { color: var(--gold); font-weight: 700; }
.warn { background: var(--gold-d); border-left: 3px solid var(--gold); padding: 8px 12px; border-radius: 6px; font-size: 0.92em; }
.warn-t { color: var(--gold); }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0 2px; font: inherit; font-size: 0.85em; }

/* ---------- layout ---------- */
#app { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
#side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--bg2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 14px 10px max(14px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px)); z-index: 50;
}
#main { min-width: 0; display: flex; flex-direction: column; }
#top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; height: var(--top-h); display: flex; align-items: center; gap: 12px;
  padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: rgba(13, 17, 23, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
#top h1 { font-size: 1.05rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.view { padding: 20px max(18px, env(safe-area-inset-right, 0px)) 120px max(18px, env(safe-area-inset-left, 0px)); max-width: 1500px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
#scrim { display: none; }
.logo { display: flex; align-items: center; gap: 9px; padding: 4px 8px 16px; color: var(--text); text-decoration: none !important; }
.logo-mark svg { width: 30px; height: 30px; display: block; }
.logo-t { font-family: var(--f-display); font-weight: 600; letter-spacing: 0.08em; font-size: 0.95rem; }
.logo-t b { font-weight: 800; color: var(--green); margin-left: 3px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--muted); text-decoration: none !important; font-weight: 500; font-size: 0.92rem; position: relative; }
.nav a:hover { background: var(--panel2); color: var(--text); }
.nav a.on { background: var(--accent-d); color: #fff; }
.nav a.on::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--accent); }
.nic { width: 22px; text-align: center; font-size: 1rem; }
.nl { flex: 1; }
.nbadge { background: var(--gold); color: #1a1405; font-size: 0.7rem; font-weight: 700; border-radius: 10px; padding: 0 6px; min-width: 18px; text-align: center; }
.side-foot { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.side-foot p { margin: 0; }
.burger { display: none; }
.sim-badge { font-family: var(--f-mono); font-size: 0.68rem; letter-spacing: 0.08em; color: var(--gold); border: 1px solid rgba(242, 184, 75, 0.35); border-radius: 20px; padding: 3px 9px; white-space: nowrap; }
#top-stats { margin-left: auto; display: flex; gap: 8px; align-items: center; min-width: 0; }
.tchip { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 5px 10px; color: var(--text); text-decoration: none !important; white-space: nowrap; }
.tchip:hover { border-color: var(--line2); }
.rc-t { display: flex; flex-direction: column; gap: 3px; font-size: 0.78rem; line-height: 1.1; }
.rank-chip .xpbar { width: 90px; }
.bal-chip { gap: 8px; }
.bal-chip b { font-size: 0.92rem; }

/* ---------- primitives ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line2); background: var(--raise); color: var(--text);
  padding: 8px 14px; border-radius: 8px; font: 600 0.88rem var(--f-body); cursor: pointer; text-decoration: none !important; transition: background 0.15s, border-color 0.15s, transform 0.08s; white-space: nowrap;
}
.btn:hover:not(:disabled) { background: #232b3a; border-color: #3a4557; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #5f9bff; border-color: #5f9bff; }
.btn-buy { background: var(--green); border-color: var(--green); color: #04150d; }
.btn-buy:hover:not(:disabled) { background: #22d891; border-color: #22d891; }
.btn-sell { background: var(--red); border-color: var(--red); color: #fff; }
.btn-sell:hover:not(:disabled) { background: #ff5a6d; border-color: #ff5a6d; }
.btn-ghost { background: transparent; }
.btn-ok { background: var(--green-d) !important; border-color: var(--green) !important; color: var(--green) !important; }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-lg { padding: 11px 20px; font-size: 0.98rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.icon-btn { background: transparent; border: 1px solid var(--line); color: var(--text); border-radius: 8px; width: 34px; height: 34px; cursor: pointer; font-size: 1rem; flex: none; }
.icon-btn:hover { background: var(--panel2); }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 20px; background: var(--raise); color: var(--muted); border: 1px solid var(--line2); white-space: nowrap; vertical-align: middle; }
.pill-ok { color: var(--green); border-color: rgba(22, 199, 132, 0.4); background: var(--green-d); }
.pill-real { color: var(--accent); border-color: rgba(77, 141, 255, 0.4); background: var(--accent-d); }
.sim-tag { font-family: var(--f-mono); font-size: 0.62rem; letter-spacing: 0.07em; color: var(--gold); background: var(--gold-d); border-radius: 4px; padding: 1px 5px; vertical-align: middle; font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 20px; background: var(--raise); border: 1px solid var(--line2); color: var(--text); font-size: 0.8rem; text-decoration: none !important; margin: 2px; }
.chip:hover { border-color: var(--accent); }
.chip-bad { color: #ff9aa6; border-color: rgba(240, 70, 90, 0.35); }
.chip-ok { color: var(--green); border-color: rgba(22, 199, 132, 0.35); }
.eyebrow { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.xpbar { height: 6px; background: var(--raise); border-radius: 6px; overflow: hidden; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #ffd788); border-radius: 6px; transition: width 0.5s; }
.xpbar-lg { height: 9px; margin: 6px 0 4px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 0.9rem; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--muted); font-weight: 500; min-width: 0; }
.fld > span { display: flex; justify-content: space-between; align-items: center; }
input, select, textarea { background: var(--bg2); border: 1px solid var(--line2); border-radius: 7px; color: var(--text); padding: 8px 10px; font: 0.9rem var(--f-body); width: 100%; min-width: 0; }
input[type='number'] { font-family: var(--f-mono); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-d); }
input[type='range'] { padding: 0; accent-color: var(--accent); background: transparent; border: 0; box-shadow: none; }
textarea { resize: vertical; }
.seg { display: inline-flex; background: var(--bg2); border: 1px solid var(--line2); border-radius: 8px; padding: 2px; gap: 2px; max-width: 100%; overflow-x: auto; }
.seg button { background: transparent; border: 0; color: var(--muted); padding: 6px 11px; border-radius: 6px; cursor: pointer; font: 600 0.82rem var(--f-body); white-space: nowrap; flex: 1; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--raise); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset; }
.seg-sm button { padding: 4px 9px; font-size: 0.78rem; }
.seg-side { display: flex; width: 100%; }
.seg-side button.on.buy { background: var(--green); color: #04150d; }
.seg-side button.on.sell { background: var(--red); color: #fff; }
.tg-row { display: flex; gap: 6px; flex-wrap: wrap; }
.tg { background: var(--bg2); border: 1px solid var(--line2); color: var(--muted); border-radius: 20px; padding: 4px 11px; font: 600 0.78rem var(--f-body); cursor: pointer; }
.tg:hover { color: var(--text); }
.tg.on { color: #fff; border-color: var(--accent); background: var(--accent-d); }
.tbl-wrap { overflow-x: auto; max-width: 100%; }
.tbl { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: rgba(255, 255, 255, 0.015); }
.mini-in { width: 86px; padding: 4px 6px; font-size: 0.8rem; }
.grade { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 6px; font: 700 0.8rem var(--f-display); background: var(--raise); }
.g-A { background: rgba(22, 199, 132, 0.2); color: var(--green); }
.g-B { background: rgba(77, 141, 255, 0.2); color: #8db6ff; }
.g-C { background: rgba(242, 184, 75, 0.18); color: var(--gold); }
.g-D, .g-F { background: rgba(240, 70, 90, 0.18); color: #ff8d9b; }
.empty { padding: 22px; text-align: center; color: var(--muted); }
.bul { padding-left: 18px; margin: 0.3em 0 0.8em; }
.bul li { margin: 4px 0; }
.sec-h { margin: 8px 0 -4px; font-size: 1rem; color: var(--muted); font-weight: 600; letter-spacing: 0.02em; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.page-head > div:first-child { flex: 1 1 420px; min-width: 0; max-width: 820px; }
.page-head p { margin: 0; }
.page-head.slim h2 { font-size: 1.3rem; margin-bottom: 2px; }
.ring { --p: 0; width: 84px; height: 84px; border-radius: 50%; background: conic-gradient(var(--green) calc(var(--p) * 1%), var(--raise) 0); display: grid; place-items: center; position: relative; flex: none; }
.ring::before { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: var(--bg); }
.ring b, .ring small { position: relative; grid-area: 1/1; }
.ring b { font: 700 1.2rem var(--f-display); margin-top: -10px; }
.ring small { color: var(--muted); font-size: 0.7rem; margin-top: 26px; }

/* ---------- toasts & modals ---------- */
#toasts { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(86px + env(safe-area-inset-bottom, 0px)); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; background: var(--panel2); border: 1px solid var(--line2); border-left: 3px solid var(--accent); border-radius: 9px; padding: 10px 12px; max-width: min(380px, calc(100vw - 32px)); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); display: flex; gap: 10px; align-items: center; transform: translateX(20px); opacity: 0; transition: transform 0.25s, opacity 0.25s; font-size: 0.88rem; }
.toast.show { transform: none; opacity: 1; }
.toast-good { border-left-color: var(--green); }
.toast-bad { border-left-color: var(--red); }
.toast-xp { border-left-color: var(--gold); }
.toast-ach { border-left-color: var(--purple); }
.ach-toast { font-size: 1.2rem; }
.modal-wrap { position: fixed; inset: 0; z-index: 200; background: rgba(4, 6, 10, 0.72); display: flex; align-items: center; justify-content: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); opacity: 0; transition: opacity 0.2s; }
.modal-wrap.show { opacity: 1; }
.modal { background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); transform: translateY(12px) scale(0.98); transition: transform 0.2s; }
.modal-wrap.show .modal { transform: none; }
.modal-wide { width: min(880px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); gap: 10px; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal-onb .modal-head { display: none; }
.modal-onb { width: min(640px, 100%); }
.onb-hero { text-align: center; }
.onb-hero h2 { font-size: 1.7rem; margin-top: 10px; }
.onb-hero h2 span { color: var(--green); letter-spacing: 0.04em; }
.onb-candles { display: flex; justify-content: center; gap: 7px; align-items: flex-end; height: 60px; }
.onb-candles i { width: 12px; border-radius: 2px; background: var(--green); animation: grow 1.4s ease-out both; position: relative; }
.onb-candles i::after { content: ''; position: absolute; left: 5px; width: 2px; top: -8px; bottom: -6px; background: inherit; }
.onb-candles i:nth-child(1) { height: 22px; background: var(--red); }
.onb-candles i:nth-child(2) { height: 30px; animation-delay: 0.1s; }
.onb-candles i:nth-child(3) { height: 24px; background: var(--red); animation-delay: 0.2s; }
.onb-candles i:nth-child(4) { height: 38px; animation-delay: 0.3s; }
.onb-candles i:nth-child(5) { height: 46px; animation-delay: 0.4s; }
.onb-candles i:nth-child(6) { height: 56px; animation-delay: 0.5s; }
@keyframes grow { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }
.onb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.onb-grid div { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 2px; font-size: 1.3rem; }
.onb-grid b { font-size: 0.95rem; }
.onb-grid span { font-size: 0.78rem; color: var(--muted); }
.rankup { text-align: center; }
.rankup-ic { font-size: 3.4rem; animation: pop 0.6s; }
.rankup-name { font: 800 1.6rem var(--f-display); color: var(--gold); margin-bottom: 6px; }
@keyframes pop { 0% { transform: scale(0.3); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* ---------- dashboard ---------- */
.hero { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; background: radial-gradient(120% 140% at 0% 0%, rgba(77, 141, 255, 0.10), transparent 55%), radial-gradient(90% 120% at 100% 100%, rgba(22, 199, 132, 0.08), transparent 60%), var(--panel); padding: 22px; }
.hero h2 { font-size: 1.6rem; }
.hero h2 span { color: var(--green); }
.rank-big { display: flex; gap: 14px; align-items: center; background: rgba(0, 0, 0, 0.2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.rb-ic { font-size: 2.4rem; }
.rank-big > div { flex: 1; min-width: 0; }
.rank-big b { font: 700 1.15rem var(--f-display); }
.ranks-mini { display: flex; justify-content: space-between; margin-top: 10px; gap: 4px; }
.ranks-mini span { filter: grayscale(1); opacity: 0.35; font-size: 1.15rem; }
.ranks-mini span.on { filter: none; opacity: 1; }
.goals { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 6px; }
.goals li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; background: var(--panel2); border-radius: 8px; font-size: 0.88rem; }
.goals li > span:nth-child(2) { flex: 1; }
.goals li.done { opacity: 0.65; }
.goals li.done > span:nth-child(2) { text-decoration: line-through; }
.gchk { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line2); display: grid; place-items: center; color: #04150d; font-weight: 800; font-size: 0.75rem; flex: none; }
.goals li.done .gchk { background: var(--green); border-color: var(--green); }
.spark { width: 100%; height: 70px; display: block; margin-top: 8px; }
.recs { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 6px; }
.recs a { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 8px; background: var(--panel2); color: var(--text); text-decoration: none !important; border: 1px solid transparent; }
.recs a:hover { border-color: var(--accent); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; color: var(--text); text-decoration: none !important; transition: border-color 0.15s, transform 0.15s; }
.tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.tile-ic { font-size: 1.4rem; }

/* ---------- academy ---------- */
.levels { display: flex; flex-direction: column; gap: 14px; }
.level.star { border-color: rgba(242, 184, 75, 0.45); box-shadow: 0 0 0 1px rgba(242, 184, 75, 0.12) inset; }
.level.locked .lessons { opacity: 0.45; }
.lv-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.lv-ic { font-size: 1.9rem; width: 46px; height: 46px; display: grid; place-items: center; background: var(--panel2); border-radius: 12px; flex: none; }
.lv-t { flex: 1 1 300px; min-width: 0; }
.lv-t h3 { margin: 0; font-size: 1.15rem; }
.lv-t p { margin: 2px 0 0; }
.lv-prog { flex: 0 1 220px; display: flex; flex-direction: column; gap: 4px; }
.lock-msg { background: var(--panel2); border-radius: 8px; padding: 8px 12px; font-size: 0.85rem; color: var(--muted); margin-bottom: 10px; }
.lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.lesson { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; color: var(--text); text-decoration: none !important; transition: border-color 0.15s; }
.lesson:hover { border-color: var(--line2); }
.lesson.next { border-color: var(--accent); background: var(--accent-d); }
.lesson.done .ls-s { color: var(--green); }
.lesson.test { border-style: dashed; }
.ls-n { font: 700 0.8rem var(--f-mono); color: var(--muted); width: 30px; flex: none; }
.ls-b { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ls-b b { font-weight: 600; font-size: 0.9rem; }
.ls-s { font-weight: 800; width: 18px; text-align: center; }
.lesson-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.lt-t { flex: 1; min-width: 0; }
.lt-t h2 { margin: 0; font-size: 1.35rem; }
.stepper { display: flex; gap: 6px; }
.stp { flex: 1; display: flex; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 0; color: var(--dim); font: 600 0.72rem var(--f-body); text-transform: uppercase; letter-spacing: 0.06em; text-align: left; min-width: 0; }
.stp i { height: 4px; border-radius: 4px; background: var(--raise); display: block; }
.stp.done i { background: var(--green); }
.stp.on i { background: var(--accent); }
.stp.on { color: var(--text); }
.stp:disabled { cursor: default; }
.lesson-body { padding: 22px; }
.lesson-body h3 { font-size: 1.25rem; }
.learn-text { max-width: 70ch; font-size: 0.98rem; }
.learn-visual { margin-top: 14px; }
.lesson-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; position: sticky; bottom: max(12px, env(safe-area-inset-bottom, 0px)); background: rgba(13, 17, 23, 0.92); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 12px; padding: 10px; z-index: 5; }
.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ls-done { text-align: center; padding: 10px; }
.ls-done-ic { font-size: 3rem; }
.ls-done-stats { display: flex; justify-content: center; gap: 12px; margin: 14px 0; flex-wrap: wrap; }
.ls-done-stats div { background: var(--panel2); border-radius: 10px; padding: 10px 18px; display: flex; flex-direction: column; min-width: 100px; }
.ls-done-stats b { font: 700 1.3rem var(--f-display); }
.ls-done-stats span { font-size: 0.75rem; color: var(--muted); }

/* ---------- widgets ---------- */
.w-chart { margin: 8px 0; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); }
.w-toggles { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 6px 0; }
.w-cap { font-size: 0.85rem; color: var(--muted); margin-top: 6px; }
.w-info { font-size: 0.88rem; background: var(--panel2); border-radius: 8px; padding: 10px 12px; margin-top: 8px; }
.w-prompt { font-size: 1rem; font-weight: 500; margin: 6px 0 10px; }
.w-given { background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; font-size: 0.95rem; }
.w-fb { display: none; margin-top: 10px; padding: 10px 13px; border-radius: 9px; font-size: 0.92rem; }
.w-fb.show { display: block; animation: fadeIn 0.25s; }
.fb-ok { background: var(--green-d); border: 1px solid rgba(22, 199, 132, 0.35); }
.fb-bad { background: var(--red-d); border: 1px solid rgba(240, 70, 90, 0.35); }
.fb-info { background: var(--accent-d); border: 1px solid rgba(77, 141, 255, 0.35); }
.w-num { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.w-num input { width: 160px; font-size: 1rem; }
.w-unit { color: var(--muted); font-weight: 600; }
.opts { display: flex; flex-direction: column; gap: 7px; }
.opt { display: flex; gap: 10px; align-items: center; text-align: left; background: var(--panel2); border: 1px solid var(--line2); color: var(--text); padding: 10px 12px; border-radius: 9px; cursor: pointer; font: 0.93rem var(--f-body); transition: border-color 0.15s, background 0.15s; }
.opt:hover:not(:disabled) { border-color: var(--accent); }
.opt.sel { border-color: var(--accent); background: var(--accent-d); }
.opt.right { border-color: var(--green); background: var(--green-d); }
.opt.wrong { border-color: var(--red); background: var(--red-d); }
.opt.okish { border-color: var(--gold); background: var(--gold-d); }
.opt:disabled { cursor: default; }
.opt-k { font: 700 0.75rem var(--f-mono); width: 22px; height: 22px; border-radius: 6px; background: var(--raise); display: grid; place-items: center; flex: none; }
.opt-score { margin-left: auto; font: 700 0.8rem var(--f-mono); color: var(--gold); }
.w-sort { display: flex; flex-direction: column; gap: 8px; }
.sort-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; }
.sort-row.ok { border-color: rgba(22, 199, 132, 0.5); }
.sort-row.wrong:not(.ok) { border-color: rgba(240, 70, 90, 0.5); }
.sort-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.sort-why { grid-column: 1 / -1; font-size: 0.82rem; color: var(--muted); }
.sort-why:empty { display: none; }
.shake { animation: shake 0.35s; }
@keyframes shake { 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.sd { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; }
.sd-ctrl { display: flex; flex-direction: column; gap: 12px; }
.sd-ctrl label { display: flex; flex-direction: column; gap: 4px; font-size: 0.88rem; }
.sd-book { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--raise); }
.sd-bar { height: 100%; transition: width 0.2s; }
.sd-price { font-size: 1.6rem; font-weight: 700; }
.sd-price small { font-size: 0.85rem; }
#sd-cv { width: 100%; height: 150px; display: block; }
.ob { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ob-book { background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 8px; font-family: var(--f-mono); font-size: 0.82rem; }
.ob-h, .ob-row { display: grid; grid-template-columns: 1fr 1fr 1fr; text-align: center; padding: 3px 0; }
.ob-h { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; }
.ob-row.ask span:nth-child(2) { color: var(--red); }
.ob-row.bid span:nth-child(2) { color: var(--green); }
.ob-row.ask { background: linear-gradient(90deg, transparent 60%, var(--red-d)); }
.ob-row.bid { background: linear-gradient(90deg, var(--green-d), transparent 40%); }
.ob-spread { text-align: center; padding: 6px 0 0; font-family: var(--f-body); }
.ob-ticket { display: flex; flex-direction: column; gap: 8px; }
.ob-task { background: var(--accent-d); border: 1px solid rgba(77, 141, 255, 0.35); border-radius: 8px; padding: 9px 11px; font-size: 0.9rem; }
.ob-orders .pill { margin: 2px; }
.cb { display: grid; grid-template-columns: 1fr 220px; gap: 16px; align-items: center; }
.cb-ctrl { display: flex; flex-direction: column; gap: 8px; }
.cb-ctrl label { display: flex; flex-direction: column; font-size: 0.86rem; gap: 2px; }
.cb-svg { width: 100%; max-width: 220px; height: auto; background: var(--bg2); border-radius: 10px; border: 1px solid var(--line); }
.st-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 8px; }
.st-row .fld { width: 130px; }
.st-rr { display: flex; flex-direction: column; font-family: var(--f-mono); padding-bottom: 6px; }
.st-rr b { font-size: 1.1rem; }
.al { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.al-sliders { display: flex; flex-direction: column; gap: 8px; }
.al-row { display: grid; grid-template-columns: 12px minmax(110px, 1fr) 1.3fr 48px; gap: 10px; align-items: center; }
.al-sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.al-side { display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }
.al-pie { width: 150px; height: 150px; border-radius: 50%; position: relative; }
.al-pie::after { content: ''; position: absolute; inset: 28%; border-radius: 50%; background: var(--panel); }
.al-pie.lg { width: 140px; height: 140px; flex: none; }
.alloc { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.alloc ul { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 160px; }
.alloc li { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 0.88rem; }
.alloc li b { margin-left: auto; }
.lv { display: flex; flex-direction: column; gap: 12px; }
.lv label { display: flex; flex-direction: column; gap: 4px; }
.lv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lv-grid div { background: var(--panel2); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; }
.lv-bar { position: relative; height: 30px; background: linear-gradient(90deg, var(--red-d), transparent); border-radius: 8px; border: 1px solid var(--line); overflow: hidden; }
.lv-drop { position: absolute; right: 0; top: 0; bottom: 0; background: rgba(242, 184, 75, 0.25); border-left: 2px dashed var(--gold); }
.lv-liqmark { position: absolute; top: 0; bottom: 0; width: 3px; background: var(--red); transform: translateX(50%); }
.lv-l { position: absolute; left: 6px; top: 6px; color: var(--muted); }
.lv-e { position: absolute; right: 6px; top: 6px; color: var(--muted); }
.ds .ds-sit, .ds-sit { background: var(--panel2); border-left: 3px solid var(--accent); padding: 12px 14px; border-radius: 8px; margin: 8px 0 12px; font-size: 1rem; }
.ds-end { font-size: 1rem; padding: 10px; background: var(--panel2); border-radius: 8px; }
.ds-next { margin-top: 10px; }
.plan { display: flex; flex-direction: column; gap: 10px; }
.plan-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.sc-intro { background: var(--panel2); border-radius: 9px; padding: 12px 14px; margin-bottom: 8px; }
.sc-panel { margin-top: 10px; }
.sc-note { font-size: 0.85rem; color: var(--gold); margin-bottom: 4px; }
.sc-next { margin-top: 10px; }
.sc-wait { padding: 12px; }
.sc-end { display: flex; gap: 16px; align-items: center; background: var(--panel2); border-radius: 10px; padding: 14px; }
.sc-score { font: 800 2.2rem var(--f-display); }
.sc-end p { margin: 4px 0 0; }
.diag { display: flex; align-items: center; gap: 10px; justify-content: center; flex-wrap: wrap; padding: 10px; }
.diag-box { background: var(--panel2); border: 1px solid var(--line2); border-radius: 10px; padding: 12px 16px; display: flex; flex-direction: column; align-items: center; text-align: center; font-size: 1.3rem; min-width: 140px; }
.diag-box b { font-size: 0.92rem; }
.diag-box small { font-size: 0.75rem; color: var(--muted); }
.up-bd { border-color: rgba(22, 199, 132, 0.5); }
.down-bd { border-color: rgba(240, 70, 90, 0.5); }
.diag-arrow { font-size: 1.4rem; color: var(--muted); }
.pie-mini { --p: 10; width: 80px; height: 80px; border-radius: 50%; background: conic-gradient(var(--green) calc(var(--p) * 1%), var(--raise) 0); position: relative; display: flex; align-items: flex-end; justify-content: center; }
.pie-mini span { position: absolute; bottom: -22px; white-space: nowrap; font-size: 0.72rem; color: var(--muted); }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cmp > div { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.cmp h4 { margin: 0 0 6px; }
.cmp ul { margin: 0; padding-left: 18px; font-size: 0.88rem; }
.bars-cmp { display: flex; gap: 14px; align-items: flex-end; height: 170px; padding: 10px; justify-content: center; }
.bars-cmp div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; width: 70px; gap: 3px; }
.bars-cmp span { width: 40px; background: linear-gradient(var(--accent), rgba(77, 141, 255, 0.3)); border-radius: 5px 5px 0 0; display: block; }
.bars-cmp b { font: 700 0.85rem var(--f-mono); }
.bars-cmp small { font-size: 0.72rem; color: var(--muted); }
.ladder { display: flex; flex-direction: column; gap: 4px; max-width: 300px; margin: 8px auto; font-family: var(--f-mono); }
.ld { padding: 10px; border-radius: 8px; text-align: center; font-weight: 700; }
.ld small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.ld.ask { background: var(--red-d); color: var(--red); }
.ld.bid { background: var(--green-d); color: var(--green); }
.ld.spread { color: var(--gold); font-size: 0.8rem; border: 1px dashed var(--line2); }
.anat { width: 100%; max-width: 420px; display: block; margin: 0 auto; background: var(--bg2); border-radius: 10px; }
.rrtab { max-width: 420px; }
.rrtab table { width: 100%; border-collapse: collapse; }
.rrtab th, .rrtab td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 0.9rem; }
.rrtab td:first-child { font-family: var(--f-mono); font-weight: 700; }
.formula { font: 700 1.05rem var(--f-mono); background: var(--panel2); border: 1px solid var(--accent); border-radius: 10px; padding: 14px; text-align: center; margin: 6px 0 10px; color: #cfe0ff; }
.cards4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.cards4 > div { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; }
.cards4 p { margin: 4px 0 0; font-size: 0.86rem; color: var(--muted); }
.daybar { display: flex; border-radius: 9px; overflow: hidden; font-size: 0.72rem; text-align: center; position: relative; border: 1px solid var(--line); }
.daybar span { padding: 6px 2px; line-height: 1.2; color: #dce3ee; min-width: 0; overflow: hidden; }
.daybar.big span { padding: 10px 4px; font-size: 0.8rem; }
.ph-open { background: rgba(240, 70, 90, 0.25); }
.ph-morning { background: rgba(77, 141, 255, 0.22); }
.ph-midday { background: rgba(120, 130, 150, 0.15); }
.ph-afternoon { background: rgba(77, 141, 255, 0.16); }
.ph-close { background: rgba(242, 184, 75, 0.25); }
.daybar-mark { position: absolute; top: 0; bottom: 0; width: 3px; background: #fff; box-shadow: 0 0 8px #fff; transform: translateX(-1px); transition: left 0.3s; }
.emo { display: flex; flex-wrap: wrap; gap: 6px; }
.emo span { background: var(--panel2); border-radius: 20px; padding: 4px 10px; font-size: 0.8rem; }
.emo .peak { background: var(--red-d); color: var(--red); }
.emo .low { background: var(--green-d); color: var(--green); }
.pair { display: flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--f-mono); font-size: 1.4rem; }
.pair div { display: flex; flex-direction: column; align-items: center; }
.pair small { font-size: 0.7rem; color: var(--muted); }
.pair .slash { font-size: 2rem; color: var(--muted); }
.pair .eq { color: var(--green); }
.qz-end { font-size: 1rem; background: var(--panel2); padding: 12px; border-radius: 9px; }

/* ---------- chart ---------- */
.tmchart { position: relative; width: 100%; user-select: none; -webkit-user-select: none; }
.tmchart canvas { display: block; touch-action: pan-y; }
.chart-btns { position: absolute; left: 8px; bottom: 26px; display: flex; gap: 4px; opacity: 0.75; }
.chart-btns button { width: 26px; height: 24px; border-radius: 6px; border: 1px solid var(--line2); background: rgba(22, 28, 38, 0.9); color: var(--text); cursor: pointer; font-size: 0.85rem; line-height: 1; }
.chart-btns button:hover { border-color: var(--accent); }

/* ---------- terminal ---------- */
.term { display: grid; grid-template-columns: 220px minmax(0, 1fr) 290px; gap: 12px; align-items: start; }
.term-watch, .term-ticket { position: sticky; top: calc(var(--top-h) + 12px); }
.term-watch { padding: 10px; }
.tw-h { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 8px; }
.tw-list { display: flex; flex-direction: column; gap: 3px; }
.tw-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 7px 8px; color: var(--text); cursor: pointer; text-align: left; font: inherit; width: 100%; }
.tw-row:hover { background: var(--panel2); }
.tw-row.on { background: var(--accent-d); border-color: rgba(77, 141, 255, 0.35); }
.tw-s { display: flex; flex-direction: column; min-width: 0; }
.tw-s small { font-size: 0.7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-p { display: flex; flex-direction: column; align-items: flex-end; font-size: 0.82rem; }
.tw-p small { font-size: 0.72rem; }
.term-center { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.term-head { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 12px 14px; }
.th-l { display: flex; flex-direction: column; gap: 2px; }
.th-px .big { font-size: 1.5rem; margin-right: 6px; }
.th-info { flex: 1 1 280px; max-width: 520px; }
.term-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.term-chart { padding: 0; overflow: hidden; }
.term-tabs { padding: 0; }
.tabs { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { background: none; border: 0; color: var(--muted); padding: 11px 16px; font: 600 0.86rem var(--f-body); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.cnt { background: var(--raise); border-radius: 10px; padding: 0 6px; font-size: 0.72rem; }
.cnt:empty { display: none; }
.tab-body { padding: 6px 8px 10px; }
.term-ticket { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.acct-mini { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 8px; }
.acct-mini div { display: flex; flex-direction: column; min-width: 0; }
.acct-mini b { font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-sum { background: var(--bg2); border-radius: 9px; padding: 6px 10px; border: 1px solid var(--line); }
.tk-sum .kv { font-size: 0.82rem; padding: 3px 0; }
.tk-warn { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--gold); }
.tk-warn:empty { display: none; }
.tk-warn .err { color: #ff8d9b; }
.cx-strip { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.cx-i { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; min-width: 140px; flex: 1 1 140px; }
.cx-storm { justify-content: center; }
.storm-on { color: var(--orange); font-weight: 700; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }
.speed-ctl { display: flex; align-items: center; gap: 8px; }
.real-chart { border-radius: 9px; overflow: hidden; border: 1px solid var(--line); }

/* ---------- day & swing sims ---------- */
.pick { text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 6px; color: var(--text); font: inherit; transition: border-color 0.15s, transform 0.15s; }
.pick:hover { border-color: var(--accent); transform: translateY(-2px); }
.pick-h { display: flex; justify-content: space-between; align-items: center; }
.pick-gap { font: 700 1.1rem var(--f-mono); }
.pick .btn { align-self: flex-start; margin-top: 4px; }
.ds-top, .sw-top { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 14px; }
.ds-id { min-width: 0; }
.ds-clock { display: flex; align-items: center; gap: 10px; }
.ds-ctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ds-grid, .sw-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; align-items: start; }
.sw-grid { grid-template-columns: 200px minmax(0, 1fr) 300px; }
.ds-main, .sw-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ds-main .card, .sw-main .card { padding: 10px; }
.ds-ind, .sw-main .tg-row { margin-bottom: 8px; }
.ds-side, .sw-side { display: flex; flex-direction: column; gap: 12px; }
.ds-ticket, .sw-ticket { display: flex; flex-direction: column; gap: 10px; }
.ds-calc { background: var(--bg2); border-radius: 8px; padding: 8px 10px; }
.pos-card { border: 1px solid var(--line2); border-radius: 9px; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.pos-card.long { border-left: 3px solid var(--green); }
.pos-card.short { border-left: 3px solid var(--red); }
.ds-feed ul, .sw-news ul { list-style: none; padding: 0; margin: 8px 0 0; max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; font-size: 0.83rem; }
.ds-feed li, .sw-news li { padding: 6px 8px; border-radius: 7px; background: var(--panel2); }
.fd-coach { border-left: 3px solid var(--accent); }
.fd-good { border-left: 3px solid var(--green); }
.fd-bad { border-left: 3px solid var(--red); }
.fd-warn { border-left: 3px solid var(--gold); }
.fd-event { border-left: 3px solid var(--purple); }
.fd-trade { border-left: 3px solid var(--accent); }
.fd-quiet { opacity: 0.7; }
.ds-identify .tg-row { margin-top: 8px; }
.eod-top { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.eod-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 12px 0; }
.eod-stats div { background: var(--panel2); border-radius: 9px; padding: 9px 12px; display: flex; flex-direction: column; }
.eod-stats span { font-size: 0.74rem; color: var(--muted); }
#eod-chart { border-radius: 9px; overflow: hidden; border: 1px solid var(--line); }
.sw-acct { display: flex; gap: 16px; }
.sw-acct div { display: flex; flex-direction: column; }
.sw-watch { padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.sw-cal { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; display: flex; flex-direction: column; gap: 2px; }
.sw-head { margin-bottom: 8px; }

/* ---------- review ---------- */
.review { display: flex; flex-direction: column; gap: 12px; }
.rv-top { display: flex; gap: 14px; align-items: center; }
.rv-grade { width: 66px; height: 66px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; font: 800 1.9rem var(--f-display); flex: none; background: var(--raise); }
.rv-grade small { font: 600 0.6rem var(--f-body); text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.8; }
.rv-sum { min-width: 0; }
.rv-out { font: 700 1.2rem var(--f-mono); margin: 2px 0; }
.rv-verdict { font-size: 0.92rem; color: var(--muted); }
.rv-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.rv-list li { display: flex; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--panel2); font-size: 0.89rem; align-items: flex-start; }
.rv-ic { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-weight: 800; font-size: 0.75rem; flex: none; margin-top: 1px; }
.rv-good .rv-ic { background: var(--green); color: #04150d; }
.rv-bad .rv-ic { background: var(--red); color: #fff; }
.rv-tip .rv-ic { background: var(--accent); color: #fff; }
.rv-lessons { font-size: 0.85rem; }
.jr-inline { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.jr-inline summary { cursor: pointer; font-weight: 600; }
.jr-form { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.jr-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.chip-t { background: var(--bg2); border: 1px solid var(--line2); color: var(--muted); border-radius: 20px; padding: 4px 10px; font: 500 0.78rem var(--f-body); cursor: pointer; }
.chip-t.on { background: var(--accent-d); border-color: var(--accent); color: #fff; }

/* ---------- journal / portfolio / misc ---------- */
.bars { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; }
.bars li { display: grid; grid-template-columns: minmax(0, 1.3fr) 1fr auto auto; gap: 8px; align-items: center; font-size: 0.85rem; }
.bars li > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars i { height: 8px; border-radius: 4px; background: var(--red); display: block; }
.bars i.ok { background: var(--green); }
.emo-list { list-style: none; padding: 0; margin: 0; }
.emo-list li { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 0.88rem; }
.emo-list li b { margin-left: auto; }
.plan-view div { padding: 2px 0; }
.jr-pend { display: flex; flex-direction: column; gap: 6px; }
.jr-p { display: flex; gap: 10px; align-items: center; background: var(--panel2); border-radius: 8px; padding: 7px 10px; flex-wrap: wrap; }
.jr-p > span:first-child { flex: 1; min-width: 140px; }
.jr-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.jr-h h3 { margin: 0; }
.jr-list { display: flex; flex-direction: column; gap: 10px; }
.jr-e { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--panel2); }
.jr-e header { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.jr-e header .mono { margin-left: auto; }
.jr-g { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 14px; }
.jr-g .wide { grid-column: span 2; }
.jr-g p { margin: 0; font-size: 0.88rem; }
.jr-learn { color: var(--gold); }
.jr-e footer { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.jr-e footer .btn:first-of-type { margin-left: auto; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat span { font-size: 0.74rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat b { font-size: 1.12rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat small { font-size: 0.72rem; }
.chart-lg { width: 100%; height: 220px; display: block; }
.chart-md { width: 100%; height: 150px; display: block; }
.pager { display: flex; gap: 6px; align-items: center; }
.scen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.scen { color: var(--text); text-decoration: none !important; display: flex; flex-direction: column; gap: 4px; transition: border-color 0.15s, transform 0.15s; }
.scen:hover { border-color: var(--accent); transform: translateY(-2px); }
.scen.done { border-color: rgba(22, 199, 132, 0.3); }
.scen-h { display: flex; align-items: center; gap: 8px; }
.scen-l { font: 800 1.1rem var(--f-display); width: 34px; height: 34px; border-radius: 9px; background: var(--accent-d); color: var(--accent); display: grid; place-items: center; }
.diff { margin-left: auto; color: var(--gold); letter-spacing: 2px; font-size: 0.8rem; }
.scen-f { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 8px; }
.scen-f .btn { margin-left: auto; }
.ch { display: flex; flex-direction: column; gap: 8px; }
.ch.ready { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(242, 184, 75, 0.2) inset, 0 0 24px rgba(242, 184, 75, 0.08); }
.ch.claimed { opacity: 0.75; }
.ch-h { display: flex; gap: 10px; align-items: center; }
.ch-h > div { flex: 1; }
.ch-ic { font-size: 1.6rem; }
.ch p { margin: 0; }
.tier-bronze { color: #d29a6b; }
.tier-silver { color: #c3ccd8; }
.tier-gold { color: var(--gold); }
.tier-platinum { color: #9fe6e0; }
.tier-diamond { color: #b9a7ff; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.ach { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 3px; opacity: 0.5; }
.ach.got { opacity: 1; border-color: rgba(167, 139, 250, 0.45); background: linear-gradient(160deg, rgba(167, 139, 250, 0.09), var(--panel) 60%); }
.ach-ic { font-size: 1.7rem; filter: grayscale(1); }
.ach.got .ach-ic { filter: none; }
.ladder-r { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.rk { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 9px; display: flex; flex-direction: column; gap: 2px; align-items: center; text-align: center; opacity: 0.55; min-width: 0; }
.rk b { font-size: 0.8rem; }
.rk.past { opacity: 0.85; }
.rk.cur { opacity: 1; border-color: var(--gold); background: var(--gold-d); }
.rk-ic { font-size: 1.4rem; }
.xplog { list-style: none; padding: 0; margin: 0; }
.xplog li { display: grid; grid-template-columns: 60px 1fr auto; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 0.86rem; }
.test-card { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.test-card.passed { border-color: rgba(22, 199, 132, 0.4); }
.test-card .lv-ic { width: 40px; height: 40px; font-size: 1.4rem; }
.test-card .btn { margin-top: auto; }
.qbar { height: 5px; background: var(--raise); border-radius: 5px; overflow: hidden; }
.qbar i { display: block; height: 100%; background: var(--accent); transition: width 0.3s; width: 0; }
.test-body { padding: 20px; }
.drill { min-height: 200px; }
.settings { display: flex; flex-direction: column; gap: 10px; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.sw { position: relative; width: 42px; height: 24px; flex: none; }
.sw input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.sw i { position: absolute; inset: 0; background: var(--raise); border-radius: 20px; border: 1px solid var(--line2); transition: background 0.2s; }
.sw i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform 0.2s, background 0.2s; }
.sw input:checked + i { background: var(--accent-d); border-color: var(--accent); }
.sw input:checked + i::after { transform: translateX(18px); background: var(--accent); }
.sw input:focus-visible + i { outline: 2px solid var(--accent); }
.danger-zone { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.danger-zone > div { border: 1px solid rgba(240, 70, 90, 0.3); border-radius: 10px; padding: 10px; }
.danger-zone p { margin: 2px 0 8px; }
.confirm-box { background: var(--red-d); border: 1px solid var(--red); border-radius: 10px; padding: 10px; }

/* ---------- coach ---------- */
.coach-fab { position: fixed; right: max(18px, env(safe-area-inset-right, 0px)); bottom: max(18px, env(safe-area-inset-bottom, 0px)); z-index: 150; display: flex; align-items: center; gap: 8px; background: linear-gradient(135deg, #2c63d8, #4d8dff); border: 0; color: #fff; border-radius: 30px; padding: 8px 16px 8px 8px; cursor: pointer; box-shadow: 0 10px 30px rgba(45, 99, 216, 0.4); font: 600 0.9rem var(--f-body); }
.coach-fab:hover { filter: brightness(1.1); }
.coach-av { width: 32px; height: 32px; border-radius: 50%; background: #0d1117; color: var(--green); display: grid; place-items: center; font: 800 1rem var(--f-display); flex: none; border: 2px solid rgba(255, 255, 255, 0.2); }
.coach-dot { position: absolute; top: 4px; left: 30px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); border: 2px solid #2c63d8; }
.coach-panel { position: fixed; right: max(18px, env(safe-area-inset-right, 0px)); bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 160; width: min(400px, calc(100vw - 32px)); height: min(560px, calc(100vh - 120px)); background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); display: flex; flex-direction: column; transform: translateY(16px) scale(0.97); opacity: 0; pointer-events: none; transition: transform 0.2s, opacity 0.2s; }
.coach-panel.open { transform: none; opacity: 1; pointer-events: auto; }
.coach-panel header { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.coach-panel header > div:nth-child(2) { flex: 1; min-width: 0; }
.coach-ctx { padding: 4px 14px 0; }
.coach-ctx:empty { display: none; }
.coach-log { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.cmsg { display: flex; }
.cmsg-me { justify-content: flex-end; }
.cbub { max-width: 88%; padding: 9px 12px; border-radius: 12px; font-size: 0.88rem; background: var(--panel2); border: 1px solid var(--line); }
.cmsg-me .cbub { background: var(--accent); border-color: var(--accent); color: #fff; }
.cbub .chip { margin: 4px 2px 0 0; }
.coach-ul { margin: 6px 0; padding-left: 18px; }
.typing i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); margin: 0 2px; animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 50% { opacity: 0.2; } }
.coach-chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 14px; border-top: 1px solid var(--line); }
.coach-chips button { background: var(--bg2); border: 1px solid var(--line2); color: var(--text); border-radius: 16px; padding: 4px 10px; font: 500 0.76rem var(--f-body); cursor: pointer; white-space: nowrap; }
.coach-chips button:hover { border-color: var(--accent); }
.coach-form { display: flex; gap: 8px; padding: 10px 14px 14px; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .term { grid-template-columns: 190px minmax(0, 1fr) 270px; }
  .sw-grid { grid-template-columns: minmax(0, 1fr) 290px; }
  .sw-watch { grid-column: 1 / -1; order: -1; }
  .sw-watch #sw-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .ladder-r { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .term { grid-template-columns: minmax(0, 1fr) 280px; }
  .term-watch { grid-column: 1 / -1; position: static; }
  .tw-list { flex-direction: row; overflow-x: auto; }
  .tw-row { min-width: 150px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  #side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; transform: translateX(-102%); transition: transform 0.25s; box-shadow: 20px 0 60px rgba(0, 0, 0, 0.5); }
  body.nav-open #side { transform: none; }
  body.nav-open #scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 45; }
  .burger { display: block; }
  .sim-badge { display: none; }
  .term, .ds-grid, .sw-grid { grid-template-columns: minmax(0, 1fr); }
  .term-ticket { position: static; }
  .sw-watch #sw-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jr-g { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .view { padding-top: 14px; gap: 12px; }
  .card { padding: 13px; }
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  h2 { font-size: 1.3rem; }
  .hero { padding: 16px; }
  .hero h2 { font-size: 1.3rem; }
  .rank-chip .rc-t, .rank-chip .xp { display: none; }
  .bal-chip .small { display: none; }
  #top h1 { font-size: 0.95rem; }
  .sd, .ob, .cb, .al, .cmp { grid-template-columns: minmax(0, 1fr); }
  .cb-svg { margin: 0 auto; }
  .lv-grid { grid-template-columns: repeat(2, 1fr); }
  .onb-grid { grid-template-columns: 1fr; }
  .danger-zone, .jr-row { grid-template-columns: 1fr; }
  .lesson-body, .test-body { padding: 14px; }
  .stepper span { font-size: 0.6rem; }
  .al-row { grid-template-columns: 12px minmax(0, 1fr) 1fr 40px; }
  .jr-g { grid-template-columns: minmax(0, 1fr); }
  .jr-g .wide { grid-column: auto; }
  .coach-fab-t { display: none; }
  .coach-fab { padding: 6px; }
  .ladder-r { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .eod-top { flex-direction: column-reverse; }
  .ds-top, .sw-top { flex-direction: column; align-items: stretch; }
  .sw-acct { justify-content: space-between; }
  .bars li { grid-template-columns: minmax(0, 1fr) 70px auto auto; }
  .xplog li { grid-template-columns: 50px 1fr; }
  .xplog li span:last-child { display: none; }
}
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* ---------- Pro / paywall ---------- */
.pro-tag { display: inline-flex; align-items: center; font: 700 0.6rem var(--f-mono); letter-spacing: 0.08em; color: #1a1405; background: linear-gradient(90deg, var(--gold), #ffd788); border-radius: 4px; padding: 1px 5px; vertical-align: middle; flex: none; }
.nav-pro { opacity: 0.85; }
.pro-wall { max-width: 640px; margin: 20px auto; width: 100%; }
.pro-panel { display: flex; flex-direction: column; gap: 14px; }
.pro-head { display: flex; gap: 14px; align-items: flex-start; }
.pro-head h3 { margin: 0 0 4px; font-size: 1.2rem; }
.pro-head p { margin: 0; }
.pro-badge { font: 800 0.9rem var(--f-display); letter-spacing: 0.1em; color: #1a1405; background: linear-gradient(135deg, var(--gold), #ffd788); border-radius: 10px; padding: 10px 12px; flex: none; }
.pro-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pro-list li { background: var(--panel2); border-radius: 8px; padding: 8px 12px; font-size: 0.9rem; }
.pro-buy { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--gold-d); border: 1px solid rgba(242, 184, 75, 0.35); border-radius: 12px; padding: 14px; }
.pro-buy > div { display: flex; flex-direction: column; }
.pro-price { font: 800 1.8rem var(--f-display); color: var(--gold); }
.pro-key { display: flex; gap: 8px; align-items: flex-end; }
.pro-key .fld { flex: 1; }
.pro-key input { font-family: var(--f-mono); font-size: 0.85rem; }
@media (max-width: 640px) { .pro-key { flex-direction: column; align-items: stretch; } }

/* ---------- beginner help layer ---------- */
.chart-help { position: absolute; top: 34px; right: 72px; display: flex; align-items: center; gap: 6px; background: rgba(77, 141, 255, 0.16); border: 1px solid rgba(77, 141, 255, 0.5); color: #cfe0ff; border-radius: 20px; padding: 3px 10px 3px 4px; font: 600 0.74rem var(--f-body); cursor: pointer; z-index: 3; transition: background 0.15s, transform 0.15s; }
.chart-help b { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 0.72rem; }
.chart-help:hover { background: rgba(77, 141, 255, 0.28); transform: translateY(-1px); }
@media (max-width: 520px) { .chart-help span { display: none; } .chart-help { padding: 3px; right: 60px; } }
.ch-help h4 { margin: 18px 0 8px; }
.chh-grid { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
.chh-svg { width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.chh-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; }
.chh-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.chh-list li { display: flex; gap: 10px; align-items: flex-start; background: var(--panel2); border-radius: 8px; padding: 8px 10px; font-size: 0.9rem; }
.sw-l { width: 22px; height: 4px; border-radius: 2px; flex: none; margin-top: 8px; }
.mk { width: 0; height: 0; flex: none; margin-top: 5px; border-left: 7px solid transparent; border-right: 7px solid transparent; }
.mk-up { border-bottom: 10px solid var(--green); }
.mk-dn { border-top: 10px solid var(--red); }
.mk-dot { width: 10px; height: 10px; border: 0; border-radius: 50%; background: var(--gold); }
.chh-ctl { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 0; list-style: none; margin: 0; font-size: 0.88rem; color: var(--muted); }
kbd { background: var(--raise); border: 1px solid var(--line2); border-radius: 5px; padding: 1px 6px; font: 600 0.78rem var(--f-mono); color: var(--text); }
@media (max-width: 700px) { .chh-grid { grid-template-columns: 1fr; } }
.tip { width: 17px; height: 17px; border-radius: 50%; border: 1px solid var(--line2); background: var(--raise); color: var(--muted); font: 700 0.66rem var(--f-body); cursor: pointer; display: inline-grid; place-items: center; vertical-align: middle; padding: 0; margin-left: 2px; transition: all 0.15s; }
.tip:hover, .tip:focus-visible { background: var(--accent); border-color: var(--accent); color: #fff; }
.gl { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: help; border-bottom: 1.5px dotted var(--accent); }
.gl:hover { color: #cfe0ff; background: var(--accent-d); }
.gl-demo { border-bottom: 1.5px dotted var(--accent); }
.tip-pop { position: fixed; z-index: 400; background: var(--panel2); border: 1px solid var(--line2); border-radius: 12px; padding: 12px 34px 12px 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55); font-size: 0.88rem; opacity: 0; transform: translateY(4px); transition: opacity 0.15s, transform 0.15s; }
.tip-pop.show { opacity: 1; transform: none; }
.tip-pop p { margin: 4px 0 6px; color: #c9d1dc; }
.tip-pop p:last-of-type { margin-bottom: 0; }
.tip-x { position: absolute; top: 6px; right: 6px; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 0.85rem; }
.fld-h { display: flex; align-items: center; gap: 4px; margin-bottom: -6px; }
.fld > span > span { display: inline-flex; align-items: center; gap: 4px; }
.fld label { cursor: pointer; }
.tk-guide { background: var(--accent-d); border: 1px solid rgba(77, 141, 255, 0.35); border-radius: 9px; padding: 8px 10px; font-size: 0.8rem; line-height: 1.45; }
.term:not(.beginner) .beg-only { display: none; }
.term.beginner .adv { display: none !important; }
.mode-sw { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 3px 4px 3px 10px; cursor: pointer; }
.mode-sw .sw { width: 36px; height: 20px; }
.mode-sw .sw i::after { width: 12px; height: 12px; }
.mode-sw .sw input:checked + i::after { transform: translateX(16px); }
.view-intro { max-width: 1500px; width: 100%; margin: 0 auto; padding: 16px max(18px, env(safe-area-inset-right, 0px)) 0 max(18px, env(safe-area-inset-left, 0px)); }
.intro-card { display: flex; gap: 14px; align-items: flex-start; background: linear-gradient(135deg, rgba(77, 141, 255, 0.12), rgba(22, 199, 132, 0.06)); border: 1px solid rgba(77, 141, 255, 0.35); border-radius: 14px; padding: 14px 16px; animation: fadeIn 0.35s ease; transition: opacity 0.25s, transform 0.25s; }
.intro-card.bye { opacity: 0; transform: translateY(-6px); }
.intro-ic { font-size: 1.5rem; }
.intro-b { flex: 1; min-width: 0; }
.intro-b ol { margin: 6px 0 0; padding-left: 20px; font-size: 0.9rem; display: flex; flex-direction: column; gap: 3px; color: #c9d1dc; }
.help-ol { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 640px) { .intro-card { flex-wrap: wrap; } .intro-card .intro-ok { width: 100%; } }
/* tour */
.w-chart { position: relative; }
.tour-layer { position: absolute; inset: 0; pointer-events: none; }
.tour-dot { position: absolute; transform: translate(-50%, -50%); width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; background: var(--accent); color: #fff; font: 800 0.8rem var(--f-display); cursor: pointer; pointer-events: auto; box-shadow: 0 0 0 0 rgba(77, 141, 255, 0.6); animation: ping 1.8s infinite; z-index: 4; }
.tour-dot.seen { background: var(--green); animation: none; }
.tour-dot.on { transform: translate(-50%, -50%) scale(1.18); box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.15); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(77, 141, 255, 0.55); } 70% { box-shadow: 0 0 0 12px rgba(77, 141, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(77, 141, 255, 0); } }
.tour-info { display: flex; gap: 12px; align-items: flex-start; background: var(--panel2); border: 1px solid var(--line2); border-radius: 10px; padding: 12px 14px; margin-top: 10px; min-height: 64px; }
.tour-info.pulse { animation: fadeIn 0.3s ease; }
.tour-n { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font: 800 0.85rem var(--f-display); flex: none; }
.tour-prog { margin-top: 6px; }
/* first trade trainer */
.mt { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.mt-chart { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.mt-px { display: flex; justify-content: space-between; align-items: baseline; }
.mt-px b { font-size: 1.6rem; }
#mt-cv { width: 100%; height: 190px; display: block; }
.mt-side { display: flex; flex-direction: column; gap: 4px; }
.mt-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; border-radius: 7px; font-size: 0.9rem; }
.mt-row span { color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.mt-row.hl { background: var(--panel2); }
.mt-step { background: var(--accent-d); border-radius: 8px; padding: 9px 11px; margin-top: 6px; }
@media (max-width: 700px) { .mt { grid-template-columns: 1fr; } }
/* simple diagrams */
.flow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.flow-c { background: var(--panel2); border: 1px solid var(--line2); border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; min-width: 110px; }
.flow-t { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.flow-a { color: var(--muted); font-size: 0.85rem; }
.flow-r { font-weight: 700; }
.cmp3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.cmp3 > div { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.cmp3 p { margin: 4px 0 0; font-size: 0.86rem; color: var(--muted); }
@media (max-width: 640px) { .cmp3 { grid-template-columns: 1fr; } }

/* ---------- login / accounts ---------- */
body.booting #app, body.booting #coach, body.logged-out #app, body.logged-out #coach { display: none; }
.auth { position: fixed; inset: 0; z-index: 500; display: grid; grid-template-columns: 1.1fr 1fr; background: radial-gradient(90% 120% at 0% 0%, rgba(77, 141, 255, 0.14), transparent 60%), radial-gradient(80% 100% at 100% 100%, rgba(22, 199, 132, 0.10), transparent 60%), var(--bg); overflow-y: auto; opacity: 0; transition: opacity 0.4s ease; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
.auth.show { opacity: 1; }
.auth.bye { opacity: 0; transform: scale(1.01); transition: opacity 0.35s, transform 0.35s; }
.auth-bg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.16; pointer-events: none; }
.auth-brand { position: relative; padding: 56px 56px; display: flex; flex-direction: column; justify-content: center; gap: 22px; max-width: 640px; justify-self: end; }
.auth-brand .logo { padding: 0; }
.auth-brand h1 { font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.08; letter-spacing: -0.02em; margin: 0; }
.auth-brand h1 em { font-style: normal; color: var(--green); }
.auth-points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.auth-points li { display: flex; gap: 14px; align-items: flex-start; }
.auth-points li > span { font-size: 1.3rem; width: 42px; height: 42px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); display: grid; place-items: center; flex: none; }
.auth-points b { display: block; font-size: 1rem; }
.auth-points small { color: var(--muted); font-size: 0.88rem; }
.auth-card { position: relative; align-self: center; justify-self: start; width: min(440px, calc(100vw - 32px)); margin: 40px 56px 40px 24px; background: rgba(17, 22, 30, 0.88); backdrop-filter: blur(16px); border: 1px solid var(--line2); border-radius: 20px; padding: 26px; box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5); animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.auth-tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: var(--bg2); border: 1px solid var(--line2); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.auth-tabs button { position: relative; z-index: 1; background: none; border: 0; color: var(--muted); font: 600 0.92rem var(--f-body); padding: 9px; cursor: pointer; transition: color 0.2s; }
.auth-tabs button.on { color: #fff; }
.auth-ind { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); background: var(--raise); border-radius: 9px; transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.auth-tabs[data-on='up'] .auth-ind { transform: translateX(100%); }
.auth-tabs[data-on='forgot'] .auth-ind { opacity: 0; }
.auth-form { display: flex; flex-direction: column; gap: 14px; animation: fadeIn 0.3s ease; }
.auth-form h2 { margin: 0; font-size: 1.4rem; }
.auth-form > p { margin: -8px 0 4px; }
.auth-form .fld { font-size: 0.84rem; color: #c3cbd7; }
.auth-form input { padding: 11px 12px; font-size: 0.95rem; border-radius: 10px; }
.pw { position: relative; display: block; }
.pw input { padding-right: 64px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: var(--raise); border: 0; color: var(--muted); border-radius: 7px; padding: 4px 9px; font: 600 0.75rem var(--f-body); cursor: pointer; }
.pw-meter { height: 4px; background: var(--raise); border-radius: 4px; overflow: hidden; margin-top: -6px; }
.pw-meter i { display: block; height: 100%; width: 0; background: var(--red); transition: width 0.3s, background 0.3s; }
.pw-meter i.ok { background: var(--gold); }
.pw-meter i.good { background: var(--green); }
.auth-forgot, .auth-back { align-self: center; font-size: 0.85rem; }
.auth-msg { display: none; margin-top: 14px; border-radius: 10px; padding: 10px 12px; font-size: 0.88rem; animation: fadeIn 0.25s; }
.auth-msg.show { display: block; }
.auth-msg.bad { background: var(--red-d); border: 1px solid rgba(240, 70, 90, 0.4); }
.auth-msg.good { background: var(--green-d); border: 1px solid rgba(22, 199, 132, 0.4); }
.auth-demo { margin: 16px 0 0; font-size: 0.78rem; color: var(--muted); background: var(--gold-d); border: 1px solid rgba(242, 184, 75, 0.3); border-radius: 10px; padding: 8px 10px; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; align-content: start; }
  .auth-brand { justify-self: stretch; padding: 28px 20px 0; gap: 14px; max-width: none; }
  .auth-brand h1 { font-size: 1.7rem; }
  .auth-points { display: none; }
  .auth-card { justify-self: center; margin: 20px 16px 40px; padding: 20px; }
}
/* account menu */
.acct { position: relative; }
.avatar { position: relative; width: 36px; height: 36px; border-radius: 50%; border: 0; background: linear-gradient(135deg, #2c63d8, #4d8dff); color: #fff; font: 700 0.95rem var(--f-display); cursor: pointer; display: grid; place-items: center; flex: none; transition: transform 0.15s, box-shadow 0.15s; }
.avatar:hover { transform: scale(1.05); box-shadow: 0 0 0 3px var(--accent-d); }
.avatar.lg { width: 44px; height: 44px; font-size: 1.1rem; cursor: default; }
.av-pro { position: absolute; bottom: -4px; right: -8px; font: 700 0.5rem var(--f-mono); background: linear-gradient(90deg, var(--gold), #ffd788); color: #1a1405; border-radius: 4px; padding: 1px 3px; font-style: normal; }
.acct-menu { position: absolute; right: 0; top: calc(100% + 10px); width: 270px; background: var(--panel2); border: 1px solid var(--line2); border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55); padding: 8px; display: flex; flex-direction: column; z-index: 60; animation: drop 0.18s ease; }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.am-h { display: flex; gap: 12px; align-items: center; padding: 8px; }
.am-h > div:last-child { display: flex; flex-direction: column; min-width: 0; }
.am-h span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-plan { display: flex; justify-content: space-between; align-items: center; padding: 8px; margin: 2px 0 6px; border-radius: 10px; background: var(--bg2); }
.acct-menu > button, .acct-menu > a { background: none; border: 0; text-align: left; color: var(--text); padding: 9px 10px; border-radius: 8px; font: 500 0.9rem var(--f-body); cursor: pointer; text-decoration: none !important; }
.acct-menu > button:hover, .acct-menu > a:hover { background: var(--raise); }
.am-out { color: #ff8d9b !important; border-top: 1px solid var(--line) !important; border-radius: 0 0 8px 8px !important; margin-top: 4px; }
.pro-acct { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--panel2); border-radius: 10px; padding: 10px 12px; }
/* welcome */
.onb-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0 10px; }
.onb-steps div { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.onb-steps span { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font: 800 0.8rem var(--f-display); margin-bottom: 4px; }
.onb-steps small { color: var(--muted); font-size: 0.8rem; }
@media (max-width: 640px) { .onb-steps { grid-template-columns: 1fr; } }

/* ---------- design & motion polish ---------- */
.nav-g { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); font-weight: 700; padding: 14px 10px 4px; }
.nav a { transition: background 0.15s, color 0.15s, padding 0.15s; }
.nav a:hover { padding-left: 13px; }
.side-up { display: flex; flex-direction: column; text-align: left; gap: 2px; background: linear-gradient(135deg, rgba(242, 184, 75, 0.18), rgba(242, 184, 75, 0.05)); border: 1px solid rgba(242, 184, 75, 0.4); border-radius: 12px; padding: 10px 12px; color: var(--text); cursor: pointer; transition: transform 0.15s, border-color 0.15s; }
.side-up:hover { transform: translateY(-1px); border-color: var(--gold); }
.side-up b { color: var(--gold); font-size: 0.9rem; }
.side-up span { font-size: 0.75rem; color: var(--muted); }
body.app-ready .view { animation: viewIn 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card { transition: border-color 0.2s, box-shadow 0.2s; }
.btn { transition: background 0.15s, border-color 0.15s, transform 0.08s, box-shadow 0.15s; }
.btn-primary:hover:not(:disabled) { box-shadow: 0 6px 20px rgba(77, 141, 255, 0.35); }
.btn-buy:hover:not(:disabled) { box-shadow: 0 6px 20px rgba(22, 199, 132, 0.3); }
.btn-sell:hover:not(:disabled) { box-shadow: 0 6px 20px rgba(240, 70, 90, 0.3); }
.opt { transition: border-color 0.15s, background 0.15s, transform 0.12s; }
.opt:hover:not(:disabled) { transform: translateX(3px); }
.modal-wrap { backdrop-filter: blur(4px); }
.tile { transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s; }
.tile:hover { box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35); }
html { scroll-behavior: smooth; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #232b38; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2f394a; }
/* dashboard path */
.path-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-top: 14px; }
.ps { flex: 1 0 96px; display: flex; flex-direction: column; gap: 5px; padding: 9px 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.22); border: 1px solid var(--line); color: var(--text); text-decoration: none !important; font-size: 0.78rem; transition: border-color 0.15s, transform 0.15s; }
.ps:hover { border-color: var(--accent); transform: translateY(-2px); }
.ps b { font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps .xpbar { height: 4px; }
.ps.cur { border-color: var(--accent); background: var(--accent-d); }
.ps.done .xpbar i { background: var(--green); }
.ps.lock { opacity: 0.5; }
.tile-g { display: flex; flex-direction: column; gap: 10px; }
.tile-g h4 { margin: 6px 0 0; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; }
.hero-l, .hero-r { min-width: 0; }
.tw-px { display: block; border-radius: 4px; padding: 0 3px; margin-right: -3px; }
.tick-up { animation: tickUp 0.7s ease; }
.tick-down { animation: tickDown 0.7s ease; }
@keyframes tickUp { 0% { background: rgba(22, 199, 132, 0.35); } 100% { background: transparent; } }
@keyframes tickDown { 0% { background: rgba(240, 70, 90, 0.35); } 100% { background: transparent; } }
.lesson, .scen, .test-card, .ch, .ach, .stat { transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s; }
.lesson:hover:not([aria-disabled]) { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3); }
.stp i { transition: background 0.3s; }
.xpbar i { transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); }
.toast { transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s; }
#top { transition: background 0.2s; }
#top-stats { overflow: hidden; }
@media (max-width: 520px) {
  .bal-chip { display: none; }
  #top { gap: 8px; }
  .daybar.big small { display: none; }
  .daybar span { font-size: 0.66rem; }
}
