:root{
  --navy:#0f2742; --navy-2:#173a5e; --ink:#1b2430; --muted:#5b6777; --line:#e2e7ee; --bg:#f6f8fb; --card:#fff;
  --gold:#c99a2e; --gold-2:#f3e6c4; --green:#1f8a5b; --green-bg:#e6f4ed; --red:#c0392b; --red-bg:#fbeaea;
  --blue:#2463eb; --blue-bg:#eaf1ff; --radius:14px; --shadow:0 1px 2px rgba(15,39,66,.06),0 6px 24px rgba(15,39,66,.07);
  --serif:"Source Serif 4",Georgia,serif; --sans:"Inter",system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:var(--sans);color:var(--ink);background:var(--bg);line-height:1.55;font-size:16px;-webkit-font-smoothing:antialiased}
a{color:var(--blue);text-decoration:none} a:hover{text-decoration:underline}
h1,h2,h3{font-family:var(--serif);color:var(--navy);line-height:1.2;margin:0 0 .5em}
h1{font-size:clamp(2rem,5vw,3.2rem)} h2{font-size:clamp(1.5rem,3.4vw,2.1rem)} h3{font-size:1.2rem}
p{margin:0 0 1em}
.wrap{max-width:1120px;margin:0 auto;padding:0 20px}
.btn{display:inline-flex;align-items:center;gap:.5em;justify-content:center;border:0;border-radius:10px;padding:.8em 1.3em;font:600 1rem var(--sans);cursor:pointer;transition:.15s;text-decoration:none!important}
.btn-primary{background:var(--navy);color:#fff} .btn-primary:hover{background:var(--navy-2)}
.btn-gold{background:var(--gold);color:#fff} .btn-gold:hover{filter:brightness(1.05)}
.btn-ghost{background:#fff;color:var(--navy);border:1px solid var(--line)} .btn-ghost:hover{border-color:var(--navy)}
.btn-sm{padding:.5em .9em;font-size:.9rem}
.btn[disabled]{opacity:.5;cursor:not-allowed}
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:22px}
.muted{color:var(--muted)} .small{font-size:.88rem} .center{text-align:center}
.grid{display:grid;gap:18px} .g2{grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr))} .g3{grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr))}
.steps4{grid-template-columns:repeat(auto-fit,minmax(min(100%,440px),1fr))} .feat{grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr))}
.pill{display:inline-block;padding:.2em .7em;border-radius:999px;font-size:.78rem;font-weight:600;background:var(--blue-bg);color:var(--blue)}
.pill.green{background:var(--green-bg);color:var(--green)} .pill.red{background:var(--red-bg);color:var(--red)} .pill.gold{background:var(--gold-2);color:#7a5a12} .pill.gray{background:#eef1f5;color:var(--muted)}
input,select,textarea{font:inherit;padding:.65em .8em;border:1px solid var(--line);border-radius:10px;width:100%;background:#fff;color:var(--ink)}
input:focus,select:focus,textarea:focus{outline:2px solid var(--blue-bg);border-color:var(--blue)}
label{font-weight:600;font-size:.92rem;display:block;margin:.8em 0 .3em}
.row{display:flex;gap:12px;flex-wrap:wrap;align-items:center}
.row > *{flex:1;min-width:120px}
.row > .btn,.page-title .btn{flex:0 0 auto;min-width:0;white-space:nowrap}
.row > span:empty{flex:1;min-width:0}

/* ---------- Landing ---------- */
.topbar{background:#fff;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:20}
.topbar .wrap{display:flex;align-items:center;justify-content:space-between;height:64px}
.brand{display:flex;align-items:center;gap:10px;font-family:var(--serif);font-weight:700;font-size:1.25rem;color:var(--navy)}
.brand .mark{width:34px;height:34px;border-radius:9px;background:var(--navy);display:grid;place-items:center}
.nav a{margin-left:18px;color:var(--ink);font-weight:500}
.hero{background:linear-gradient(160deg,var(--navy) 0%,#123659 60%,#1c4c7a 100%);color:#fff;padding:72px 0 84px;position:relative;overflow:hidden}
.hero h1{color:#fff;max-width:760px}
.hero p.lead{font-size:1.2rem;color:#d9e3f0;max-width:640px}
.hero .eyebrow{color:var(--gold);font-weight:700;letter-spacing:.08em;text-transform:uppercase;font-size:.8rem}
.hero .ctas{display:flex;gap:12px;flex-wrap:wrap;margin-top:26px}
.hero .btn-ghost{background:transparent;color:#fff;border-color:rgba(255,255,255,.4)}
.hero-art{position:absolute;right:-60px;top:40px;width:520px;opacity:.18;pointer-events:none}
.trust{display:flex;gap:28px;flex-wrap:wrap;margin-top:34px;color:#c9d6e6;font-size:.92rem}
.trust b{color:#fff;font-size:1.3rem;display:block;font-family:var(--serif)}
section.block{padding:72px 0}
section.alt{background:#fff;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.kicker{color:var(--gold);font-weight:700;text-transform:uppercase;letter-spacing:.08em;font-size:.78rem}
.step{display:flex;gap:14px}
.step .n{flex:0 0 38px;height:38px;border-radius:50%;background:var(--navy);color:#fff;display:grid;place-items:center;font-weight:700}
.feature h3{margin-top:.4em}
.feature .ico{width:44px;height:44px;border-radius:12px;background:var(--gold-2);display:grid;place-items:center;font-size:1.3rem}
footer{background:var(--navy);color:#c9d6e6;padding:36px 0;font-size:.88rem}
footer a{color:#fff}
.disclaimer{opacity:.85;margin-top:10px}

/* ---------- Questions ---------- */
.stem{font-size:1.08rem;margin:.4em 0 1em}
.stem u{text-decoration-thickness:2px;text-underline-offset:3px;background:#fff7e0}
.choices{display:grid;gap:10px}
.choice{display:flex;gap:12px;align-items:flex-start;text-align:left;border:1.5px solid var(--line);background:#fff;border-radius:12px;padding:12px 14px;font:inherit;cursor:pointer;color:var(--ink);transition:.12s}
.choice:hover:not([disabled]){border-color:var(--navy)}
.choice .letter{flex:0 0 28px;height:28px;border-radius:50%;border:1.5px solid var(--line);display:grid;place-items:center;font-weight:700;font-size:.85rem}
.choice.chosen{border-color:var(--blue);background:var(--blue-bg)} .choice.chosen .letter{background:var(--blue);border-color:var(--blue);color:#fff}
.choice.correct{border-color:var(--green);background:var(--green-bg)} .choice.correct .letter{background:var(--green);border-color:var(--green);color:#fff}
.choice.wrong{border-color:var(--red);background:var(--red-bg)} .choice.wrong .letter{background:var(--red);border-color:var(--red);color:#fff}
.choice[disabled]{cursor:default}
.why{margin:-4px 0 4px 40px;padding:10px 12px;border-radius:10px;font-size:.93rem}
.why.ok{background:var(--green-bg);color:#14583b} .why.no{background:var(--red-bg);color:#7d2219}
.qhead{display:flex;justify-content:space-between;color:var(--muted);font-size:.85rem;font-weight:600}
.flag-on{color:#b7791f}
details.passage{border:1px solid var(--line);border-radius:12px;background:#fbfcfe;margin-bottom:14px}
details.passage summary{padding:10px 14px;font-weight:700;cursor:pointer;color:var(--navy)}
.passage-body{padding:0 16px 8px;max-height:46vh;overflow:auto;font-family:var(--serif);font-size:1.02rem}
.progress{height:8px;background:#e9eef4;border-radius:99px;overflow:hidden}
.progress > i{display:block;height:100%;background:linear-gradient(90deg,var(--navy),#2f6aa3);border-radius:99px;transition:width .3s}

/* ---------- Range bar ---------- */
.rangebar{position:relative;height:42px;margin:6px 0 2px}
.rangebar .track{position:absolute;top:16px;left:0;right:0;height:8px;background:#e9eef4;border-radius:99px}
.rangebar .band{position:absolute;top:13px;height:14px;background:rgba(36,99,235,.25);border:1.5px solid var(--blue);border-radius:99px}
.rangebar .mid{position:absolute;top:9px;width:4px;height:22px;margin-left:-2px;background:var(--navy);border-radius:2px}
.rangebar .goal{position:absolute;top:2px;height:36px;border-left:2px dashed var(--gold)}
.rangebar .goal span{position:absolute;top:-2px;left:4px;font-size:.72rem;font-weight:700;color:#7a5a12;white-space:nowrap}

/* ---------- App shell ---------- */
.app{display:grid;grid-template-columns:240px 1fr;min-height:100vh}
.side{background:var(--navy);color:#cfdbea;padding:18px 12px;position:sticky;top:0;height:100vh;display:flex;flex-direction:column}
.side .brand{color:#fff;padding:4px 8px 18px}
.side .brand .mark{background:var(--gold)}
.side a.navi{display:flex;gap:10px;align-items:center;padding:10px 12px;border-radius:10px;color:#cfdbea;font-weight:500;text-decoration:none}
.side a.navi:hover{background:rgba(255,255,255,.07)}
.side a.navi.on{background:rgba(255,255,255,.13);color:#fff}
.side .who{margin-top:auto;padding:10px;border-top:1px solid rgba(255,255,255,.12);font-size:.85rem}
.main{padding:28px clamp(16px,3vw,40px) 120px;max-width:1100px;width:100%}
.mobilebar{display:none}
.page-title{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:18px}
.page-title h1{font-size:1.8rem;margin:0}
.plan-step{display:flex;gap:14px;align-items:center;padding:14px;border:1px solid var(--line);border-radius:12px;background:#fff;margin-bottom:10px}
.plan-step .ico{flex:0 0 42px;height:42px;border-radius:12px;display:grid;place-items:center;background:var(--blue-bg);font-size:1.2rem}
.plan-step.done{opacity:.6} .plan-step.done .ico{background:var(--green-bg)}
.plan-step .grow{flex:1}
.stat{font-family:var(--serif);font-size:2rem;color:var(--navy);font-weight:700;line-height:1}
.skillchip{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#fff;cursor:pointer}
.skillchip:hover{border-color:var(--navy)}
.week{border-left:3px solid var(--line);padding:4px 0 14px 16px;position:relative}
.week:before{content:"";position:absolute;left:-7px;top:8px;width:11px;height:11px;border-radius:50%;background:#fff;border:2px solid var(--navy)}
.week.now:before{background:var(--gold);border-color:var(--gold)}
.timer{font-variant-numeric:tabular-nums;font-weight:700;font-size:1.1rem;color:var(--navy)}
.qgrid{display:flex;flex-wrap:wrap;gap:6px}
.qgrid button{width:34px;height:34px;border-radius:8px;border:1px solid var(--line);background:#fff;cursor:pointer;font-weight:600;font-size:.8rem}
.qgrid button.ans{background:var(--blue-bg);border-color:var(--blue)} .qgrid button.cur{outline:2px solid var(--navy)} .qgrid button.fl{border-color:#b7791f;color:#b7791f}
.lesson ul{padding-left:1.2em} .lesson li{margin-bottom:.5em}
.ex{border:1px solid var(--line);border-radius:12px;padding:12px 14px;margin:10px 0;background:#fbfcfe}
.ex .w{color:var(--red)} .ex .r{color:var(--green)}
.callout{border-radius:12px;padding:12px 14px;margin:12px 0}
.callout.trap{background:var(--red-bg);color:#7d2219} .callout.tip{background:var(--gold-2);color:#5c430c} .callout.info{background:var(--blue-bg);color:#1a3f8f}
.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);background:var(--navy);color:#fff;padding:12px 18px;border-radius:12px;box-shadow:var(--shadow);z-index:100;font-weight:500}
table.t{width:100%;border-collapse:collapse;font-size:.93rem} table.t th,table.t td{text-align:left;padding:8px 10px;border-bottom:1px solid var(--line)} table.t th{color:var(--muted);font-weight:600}

/* ---------- Tutor ---------- */
.tutor-fab{position:fixed;right:22px;bottom:22px;z-index:60;border-radius:999px;padding:14px 18px;box-shadow:0 8px 26px rgba(15,39,66,.3)}
.tutor-panel{position:fixed;right:22px;bottom:22px;width:min(400px,calc(100vw - 24px));height:min(600px,calc(100vh - 40px));background:#fff;border-radius:18px;box-shadow:0 18px 60px rgba(15,39,66,.3);display:flex;flex-direction:column;z-index:70;overflow:hidden;border:1px solid var(--line)}
.tutor-panel header{background:var(--navy);color:#fff;padding:12px 16px;display:flex;justify-content:space-between;align-items:center}
.tutor-panel .msgs{flex:1;overflow:auto;padding:14px;display:flex;flex-direction:column;gap:10px;background:#f7f9fc}
.msg{max-width:88%;padding:10px 12px;border-radius:14px;white-space:pre-wrap;font-size:.95rem}
.msg.user{align-self:flex-end;background:var(--navy);color:#fff;border-bottom-right-radius:4px}
.msg.assistant{align-self:flex-start;background:#fff;border:1px solid var(--line);border-bottom-left-radius:4px}
.msg .speak{border:0;background:none;cursor:pointer;font-size:.85rem;color:var(--muted);padding:4px 0 0}
.tutor-panel form{display:flex;gap:6px;padding:10px;border-top:1px solid var(--line)}
.tutor-panel form input{flex:1}
.iconbtn{border:1px solid var(--line);background:#fff;border-radius:10px;width:42px;cursor:pointer;font-size:1.1rem}
.iconbtn.rec{background:var(--red);color:#fff;border-color:var(--red)}
.chips{display:flex;gap:6px;flex-wrap:wrap;padding:0 10px 8px}
.chips button{border:1px solid var(--line);background:#fff;border-radius:999px;padding:5px 10px;font-size:.8rem;cursor:pointer}

/* ---------- Diagnostic modal ---------- */
.overlay{position:fixed;inset:0;background:rgba(10,24,42,.6);z-index:90;display:flex;align-items:flex-start;justify-content:center;padding:24px 12px;overflow:auto}
.modal{background:#fff;border-radius:18px;max-width:760px;width:100%;padding:26px;box-shadow:0 30px 80px rgba(0,0,0,.35)}
.modal .close{float:right;border:0;background:none;font-size:1.5rem;cursor:pointer;color:var(--muted)}

@media (max-width:860px){
  .app{grid-template-columns:1fr}
  .side{display:none}
  .mobilebar{display:flex;position:sticky;top:0;z-index:30;background:var(--navy);color:#fff;align-items:center;justify-content:space-between;padding:10px 14px}
  .mobilebar .brand{color:#fff;font-size:1.05rem}
  .mobilenav{position:fixed;bottom:0;left:0;right:0;background:#fff;border-top:1px solid var(--line);display:flex;justify-content:space-around;z-index:40;padding:6px 0 calc(6px + env(safe-area-inset-bottom))}
  .mobilenav a{display:flex;flex-direction:column;align-items:center;font-size:.7rem;color:var(--muted);text-decoration:none;gap:2px}
  .mobilenav a.on{color:var(--navy);font-weight:700}
  .tutor-fab{bottom:76px}
  .nav a.hide-m{display:none}
  .hero-art{display:none}
}
@media (min-width:861px){ .mobilenav{display:none} }
