/* Palette. Cool, clear and flat — white surfaces on a light neutral ground, one blue
   for interactive things, and a distinct accent per subject supplied by the catalogue.
   The previous sage-and-beige "paper" scheme is gone, along with its grid texture. */
:root{
  --bg:#f6f8fb;--surface:#ffffff;--surface-soft:#eef2f7;--surface-warm:#fdf6ec;
  --ink:#15202f;--muted:#5a6878;--faint:#68727e;--line:#e1e7ef;
  --brand:#2d6ae2;--brand-2:#5b8ff5;--brand-soft:#e9f0fe;--danger:#c33f55;
  --warning:#a05e15;--success:#137e5c;
  --shadow:0 10px 28px rgba(21,32,47,.07);--shadow-sm:0 2px 8px rgba(21,32,47,.05);
  --sidebar:214px;--content:1160px
}
*{scrollbar-color:#c3ccd8 transparent}body{background-color:var(--bg);color:var(--ink)}
h1,h2,h3{letter-spacing:-.035em}.button{border-radius:9px;background:var(--brand);box-shadow:none}.button.secondary{border-color:var(--line);background:transparent;color:var(--ink)}.eyebrow{color:var(--brand);letter-spacing:.14em}.public-nav{height:74px;border-color:var(--line);background:rgba(255,255,255,.92);box-shadow:none}.public-brand{color:var(--ink)}.public-links a{color:var(--muted)}.public-actions .button{border-radius:8px}
.calm-landing{overflow:hidden}.calm-hero{position:relative;width:min(1240px,calc(100% - 40px));min-height:650px;margin:24px auto 0;padding:clamp(42px,7vw,88px);display:grid;grid-template-columns:1.05fr .8fr;align-items:center;gap:70px;border:1px solid var(--line);border-radius:24px;background:var(--surface);box-shadow:0 25px 70px rgba(21,32,47,.07);overflow:hidden}.calm-hero:before{content:"";position:absolute;inset:0;background:none}.calm-hero>*{position:relative}.calm-hero-copy h1{max-width:700px;margin:13px 0 22px;font-size:clamp(52px,7vw,88px);line-height:.96;color:var(--ink)}.calm-hero-copy h1 em{color:var(--brand);font-style:normal;font-weight:500}.calm-hero-copy>p{max-width:610px;color:var(--muted);font-size:16px;line-height:1.75}.calm-proof{margin-top:33px;display:flex;flex-wrap:wrap;gap:12px 24px;color:var(--muted);font-size:10px}.calm-proof span{display:flex;align-items:center;gap:7px}.calm-proof svg{width:15px;color:var(--brand)}.anatomy-hero{position:relative;min-height:480px;padding:45px 25px 28px;display:grid;place-items:center;border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:var(--shadow-sm)}.anatomy-hero img{width:min(410px,100%);filter:none}.anatomy-note{position:absolute;top:15px;left:-14px;padding:8px 13px;background:var(--brand-soft);color:var(--ink);font-size:9px;letter-spacing:.15em;transform:none}.anatomy-hero small{color:var(--faint);font-size:8px}.ecg-line{position:absolute;right:-80px;bottom:75px;width:180px;height:48px;background:linear-gradient(transparent 23px,var(--danger) 24px,var(--danger) 25px,transparent 26px);opacity:.65}.ecg-line:after{content:"";position:absolute;left:65px;top:8px;width:42px;height:32px;border-left:2px solid var(--danger);border-top:2px solid var(--danger);transform:skew(-35deg) rotate(45deg)}
.calm-journey,.calm-subjects,.anatomy-section,.calm-final{width:min(1120px,calc(100% - 40px));margin:120px auto}.calm-journey{display:grid;grid-template-columns:.8fr 1.2fr;gap:100px;align-items:start}.calm-journey h2,.calm-subjects h2,.anatomy-section h2,.calm-final h2{margin:10px 0 17px;font-size:clamp(38px,5vw,60px);line-height:1.03}.calm-journey>div>p:last-child,.anatomy-section>div>p{color:var(--muted);line-height:1.8}.journey-list{border-top:1px solid var(--line)}.journey-list article{padding:22px 0;display:grid;grid-template-columns:45px 1fr;gap:18px;border-bottom:1px solid var(--line)}.journey-list article>span{width:39px;height:39px;display:grid;place-items:center;border:1px solid #c8c2b6;border-radius:50%;color:var(--brand);font-size:9px}.journey-list h3{font-size:20px}.journey-list p{margin:5px 0 0;color:var(--muted)}.section-copy{max-width:700px}.subject-strip{margin-top:38px;display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.subject-strip article{position:relative;min-height:190px;padding:27px 22px;border:1px solid var(--line);border-radius:10px;background:var(--surface);box-shadow:var(--shadow-sm)}.subject-strip h3{margin-top:22px;font-size:19px}.subject-strip p{color:var(--muted);font-size:11px;line-height:1.6}.paper-pin{position:absolute;top:-5px;left:50%;width:46px;height:15px;background:#d9d2b7cc;transform:translateX(-50%) rotate(-2deg)}.anatomy-section{padding:60px;display:grid;grid-template-columns:.65fr 1fr;gap:90px;align-items:center;border:1px solid var(--line);border-radius:20px;background:var(--surface-soft)}.skeleton-plate{height:520px;display:grid;place-items:center;border:1px solid var(--line);border-radius:10px;background:#fff}.skeleton-plate img{max-height:470px;max-width:100%;mix-blend-mode:multiply}.skeleton-plate span{color:#88837a;font-size:8px}.anatomy-section ul{margin:24px 0 30px;padding:0;display:grid;gap:10px;list-style:none}.anatomy-section li:before{content:"✓";margin-right:10px;color:var(--brand)}.calm-final{padding:80px 30px;text-align:center;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.calm-final h2{max-width:700px;margin:10px auto 28px}.public-footer{border-color:var(--line);background:var(--surface-soft)}
.owner-login-page{min-height:100vh;padding:30px;display:grid;place-items:center;background:var(--surface-soft)}.owner-login-page main{width:min(430px,100%);padding:42px;border:1px solid var(--line);border-radius:16px;background:var(--surface);box-shadow:var(--shadow);text-align:left}.owner-login-mark{width:48px;height:48px;margin-bottom:25px;display:grid;place-items:center;border-radius:12px;color:#fff;background:#2f504b}.owner-login-mark svg{width:23px}.owner-login-page h1{margin:8px 0 10px;font-size:34px}.owner-login-page>main>p:not(.eyebrow){margin-bottom:27px;color:var(--muted)}.owner-login-page>main>a{display:block;margin-top:20px;color:var(--muted);font-size:11px}
.app-shell{background:transparent}.sidebar{padding:24px 14px;border-color:var(--line);background:var(--surface-soft)}.student-brand{padding:0 9px 25px}.student-brand>span:last-child{display:flex;flex-direction:column}.student-brand small{margin-top:2px;color:#7c857f;font-size:7px;letter-spacing:.12em;text-transform:uppercase}.simple-nav{margin-top:18px;display:grid;gap:5px}.simple-nav .nav-link{padding:12px;border-radius:9px;color:#586661}.simple-nav .nav-link.active{color:#294f49;background:#dce5e0;box-shadow:none}.simple-nav .nav-link svg{width:17px}.sidebar-footer{padding:16px 10px;display:grid;gap:9px;border-top:1px solid #d6d0c4}.sidebar-footer a{color:#737e79;font-size:9px}.topbar{height:70px;border-color:var(--line);background:rgba(255,255,255,.88);box-shadow:none}.topbar-context{display:flex;flex-direction:column}.topbar-context span{color:var(--faint);font-size:8px;text-transform:uppercase;letter-spacing:.12em}.topbar-context strong{font-size:12px}.quiet-search{width:38px;height:38px;display:grid;place-items:center;border:1px solid var(--line);border-radius:9px}.quiet-search svg{width:17px}.profile-chip{border-color:var(--line);background:transparent}.profile-chip .avatar{background:#dce6e1;color:#325c55}.bottom-nav{background:var(--surface)}
.calm-student-home{padding-top:30px}.student-welcome{min-height:330px;padding:48px 55px;display:grid;grid-template-columns:1fr 260px;align-items:center;gap:35px;border:1px solid #d7d0c3;border-radius:20px;background:var(--surface);overflow:hidden}.student-welcome h1{max-width:680px;margin:10px 0 14px;font-size:clamp(39px,5vw,62px);line-height:1}.student-welcome>div>p:not(.eyebrow){color:var(--muted)}.student-heart{position:relative;display:grid;place-items:center}.student-heart img{width:250px;mix-blend-mode:multiply;filter:sepia(.1);opacity:.78}.student-heart>span{position:absolute;right:0;bottom:10px;width:85px;height:85px;display:grid;place-items:center;align-content:center;border:1px solid var(--line);border-radius:50%;background:var(--surface);font-size:22px}.student-heart small{display:block;color:var(--faint);font-size:7px;text-transform:uppercase}.simple-next{margin:18px 0 45px;display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.simple-next>a{padding:18px;display:grid;grid-template-columns:36px 1fr 18px;align-items:center;gap:12px;border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:var(--shadow-sm)}.simple-next>a>svg:first-child{width:20px;color:var(--brand)}.simple-next>a>svg:last-child{width:14px;color:var(--faint)}.simple-next small,.simple-next strong,.simple-next span{display:block}.simple-next small{color:var(--faint);font-size:7px;letter-spacing:.12em}.simple-next strong{margin:3px 0;font-size:13px}.simple-next span{color:var(--muted);font-size:9px}.simple-section-head{margin-bottom:15px;display:flex;justify-content:space-between;align-items:end}.simple-section-head h2{margin-top:5px;font-size:27px}.simple-section-head a{color:var(--brand);font-size:10px}.calm-subject-list{display:grid;grid-template-columns:1fr 1fr;gap:12px}.calm-subject-card{padding:18px;display:grid;grid-template-columns:45px 1fr 18px;align-items:center;gap:14px;border:1px solid var(--line);border-radius:13px;background:var(--surface)}.calm-subject-card .subject-icon{width:44px;height:44px;border-radius:11px}.calm-subject-card h3{font-size:14px}.calm-subject-card p{margin:4px 0 9px;color:var(--muted);font-size:9px}.calm-subject-card>svg{width:14px;color:var(--faint)}.quiet-note{margin-top:18px;padding:18px;display:grid;grid-template-columns:32px 1fr;gap:12px;border:1px solid var(--line);border-radius:12px;background:var(--surface-soft)}.quiet-note>svg{width:19px;color:var(--brand)}.quiet-note p{margin:4px 0 0;color:var(--muted);font-size:9px}.source-question-notice{display:flex;gap:14px;align-items:flex-start;margin:0 0 22px;padding:16px 18px;border:1px solid #d4c79f;border-radius:14px;background:#fff9e9;color:var(--ink)}.source-question-notice>svg{width:20px;flex:0 0 20px;color:#806a2e}.source-question-notice strong{display:block;margin-bottom:4px}.source-question-notice p{margin:0;color:var(--muted);font-size:10px;line-height:1.55}.owner-admin{max-width:1500px}.owner-admin .admin-head{border-bottom:1px solid var(--line)}
.simple-account{max-width:900px}.account-shortcuts{display:grid;gap:10px}.account-shortcuts>a{padding:18px;display:grid;grid-template-columns:35px 1fr 18px;align-items:center;gap:12px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}.account-shortcuts>a>svg:first-child{width:20px;color:var(--brand)}.account-shortcuts>a>svg:last-child{width:14px;color:var(--faint)}.account-shortcuts strong,.account-shortcuts span{display:block}.account-shortcuts span{margin-top:3px;color:var(--muted);font-size:9px}.account-advanced{margin-top:25px;padding:18px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}.account-advanced summary{cursor:pointer;color:var(--muted);font-size:11px}.account-advanced .settings-list{margin-top:18px}
.auth-page{background:var(--bg)}.auth-art{background:linear-gradient(145deg,#334f4a,#476a63)}.auth-form input{border-radius:8px}.auth-form h2{letter-spacing:-.04em}
@media(max-width:900px){.calm-hero{grid-template-columns:1fr}.anatomy-hero{max-width:500px;margin:auto}.calm-journey,.anatomy-section{grid-template-columns:1fr;gap:45px}.subject-strip{grid-template-columns:1fr 1fr}.simple-next{grid-template-columns:1fr}.student-welcome{grid-template-columns:1fr}.student-heart{display:none}}
@media(max-width:620px){.calm-hero{width:calc(100% - 18px);padding:42px 22px;border-radius:15px}.calm-hero-copy h1{font-size:49px}.anatomy-hero{min-height:390px}.calm-journey,.calm-subjects,.anatomy-section,.calm-final{width:calc(100% - 24px);margin:75px auto}.subject-strip,.calm-subject-list{grid-template-columns:1fr}.anatomy-section{padding:25px}.student-welcome{padding:32px 22px}.topbar-context{display:none}.owner-login-page{padding:14px}.owner-login-page main{padding:30px 22px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation:none!important;transition:none!important}}

/* ---------------------------------------------------------------------------
   Dark theme.

   calm.css redefines every design token on :root and is the last stylesheet
   loaded, so the [data-theme="dark"] block in styles.css lost on source order
   (equal specificity) and dark mode had no visible effect. The dark palette
   therefore lives here, after the :root it has to beat.

   Only the student shell is themed. The landing, auth, legal and owner-console
   pages are deliberately single-surface light designs and pin data-theme="light".
   --------------------------------------------------------------------------- */

html[data-theme="dark"] {
  color-scheme: dark;
  --bg:#0f151d;--surface:#161e29;--surface-soft:#1e2836;--surface-warm:#241f16;
  --ink:#e8eef6;--muted:#9fadbe;--faint:#7e8c9d;--line:#2a3542;
  --brand:#6f9dfa;--brand-2:#93b8ff;--brand-soft:#1c2c45;--danger:#f08290;
  --warning:#e0a15a;--success:#4cc39a;
  --shadow:0 12px 32px rgba(0,0,0,.5);--shadow-sm:0 2px 10px rgba(0,0,0,.4);
}

/* The paper grid reads as texture on light and as grime on dark; lift it instead. */
html[data-theme="dark"] body { background-image: none; }

/* Chrome and panels that carry a hardcoded paper colour in the light design. */
html[data-theme="dark"] .sidebar { border-color: var(--line); background: #131b25; }
html[data-theme="dark"] .topbar { border-color: var(--line); background: rgba(15,21,29,.9); }
html[data-theme="dark"] .bottom-nav { border-color: var(--line); background: #131b25; }
html[data-theme="dark"] .student-welcome { border-color: var(--line); background: var(--surface); }
html[data-theme="dark"] .student-heart > span { border-color: var(--line); background: var(--surface-soft); }
html[data-theme="dark"] .quiet-note { border-color: var(--line); background: var(--surface-soft); }
html[data-theme="dark"] .practice-answer { background: var(--surface-soft); }

/* Advisory notices keep their amber meaning, restated for a dark ground. */
html[data-theme="dark"] .source-question-notice,
html[data-theme="dark"] .review-standard,
html[data-theme="dark"] .draft-warning {
  border-color: #6a5424; background: #291f10; color: var(--ink);
}

/* Practice answer feedback: same red/green semantics, dark-appropriate values. */
html[data-theme="dark"] .practice-bank-options button.correct { border-color:#3f9c78; background:#16302a; }
html[data-theme="dark"] .practice-bank-options button.incorrect { border-color:#c76a72; background:#33201f; }

/* The hero is a fixed dark gradient in both themes; only its shadow needs easing. */
html[data-theme="dark"] .school-hero { box-shadow: 0 28px 80px rgba(0,0,0,.5); }
