:root{
  --bg:#faf9f5; --surface-1:#f3f1ea; --surface-2:#ffffff;
  --text-primary:#1f1e1c; --text-secondary:#5f5e5a; --text-muted:#8a8881;
  --border:#e6e3da; --border-strong:#d3d0c6;
  --accent:#185FA5; --accent-bg:#E6F1FB; --accent-text:#0C447C; --accent-border:#85B7EB;
  --success-bg:#E1F5EE; --success-text:#0F6E56;
  --warning-bg:#FAEEDA; --warning-text:#854F0B;
  --danger-bg:#FCEBEB; --danger-text:#A32D2D;
  --c-lift:#1D9E75; --c-weight:#D85A30; --c-thrust:#378ADD; --c-drag:#BA7517;
  --radius:8px;
  --font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
}
[data-theme="dark"]{
  --bg:#1d1c1a; --surface-1:#27261f; --surface-2:#302f28;
  --text-primary:#ECEAE2; --text-secondary:#B4B2A9; --text-muted:#888780;
  --border:#3c3a32; --border-strong:#4c4a40;
  --accent:#5FA0E0; --accent-bg:#0C447C; --accent-text:#B5D4F4; --accent-border:#185FA5;
  --success-bg:#085041; --success-text:#9FE1CB;
  --warning-bg:#633806; --warning-text:#FAC775;
  --danger-bg:#791F1F; --danger-text:#F7C1C1;
}
[data-theme="sepia"]{
  --bg:#f4ecd8; --surface-1:#efe5cd; --surface-2:#fbf4e2;
  --text-primary:#41371d; --text-secondary:#6a5c3c; --text-muted:#8c7d54;
  --border:#e2d6b4; --border-strong:#cdbd91;
  --accent:#9a6a1c; --accent-bg:#efe0bd; --accent-text:#6a4810; --accent-border:#cbab68;
  --success-bg:#e3ecce; --success-text:#4c5a1f;
  --warning-bg:#f3e2bf; --warning-text:#7a5410;
  --danger-bg:#f2dccf; --danger-text:#8a3a1f;
}
[data-theme="contrast"]{
  --bg:#ffffff; --surface-1:#f4f4f4; --surface-2:#ffffff;
  --text-primary:#000000; --text-secondary:#161616; --text-muted:#3a3a3a;
  --border:#000000; --border-strong:#000000;
  --accent:#0a3d91; --accent-bg:#d9e6fb; --accent-text:#06245c; --accent-border:#0a3d91;
  --success-bg:#d6efe2; --success-text:#0b4a34;
  --warning-bg:#fbe7c2; --warning-text:#7a4f04;
  --danger-bg:#fbd9d9; --danger-text:#8a1313;
}
[data-theme="aero-blue"]{
  --bg:#F5FBFF; --surface-1:#EAF5FF; --surface-2:#FFFFFF;
  --text-primary:#12324A; --text-secondary:#4F6D82; --text-muted:#8198A8;
  --border:#D9EAF6; --border-strong:#B8D3E7;
  --accent:#0B6EBD; --accent-bg:#DDF0FF; --accent-text:#074B83; --accent-border:#7CBDEC;
  --success-bg:#DDF7F0; --success-text:#0A6D5B;
  --warning-bg:#FFF1D6; --warning-text:#8A5A05;
  --danger-bg:#FFE6E2; --danger-text:#A43A2C;
  --c-lift:#13A88A; --c-weight:#E06A3A; --c-thrust:#2495E8; --c-drag:#DDA12B;
}
[data-theme="fresh"]{
  --bg:#FFFDF7; --surface-1:#EEF8F3; --surface-2:#FFFFFF;
  --text-primary:#152B36; --text-secondary:#53676F; --text-muted:#829096;
  --border:#DDECE5; --border-strong:#BFD9CF;
  --accent:#0E8F9E; --accent-bg:#DFF7F5; --accent-text:#075B63; --accent-border:#7ED6D1;
  --success-bg:#E4F8DE; --success-text:#247A33;
  --warning-bg:#FFF0C7; --warning-text:#8A5E00;
  --danger-bg:#FFE3DE; --danger-text:#B23B32;
  --c-lift:#28B463; --c-weight:#FF6B5A; --c-thrust:#2D7DF6; --c-drag:#F7B731;
}
[data-font="serif"]{--font:Georgia,"Iowan Old Style","Times New Roman",serif}
[data-font="mono"]{--font:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
[data-width="wide"] main{max-width:1320px}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{background:var(--bg);color:var(--text-primary);font-family:var(--font);line-height:1.6;-webkit-font-smoothing:antialiased}
.skip-link{position:fixed;left:12px;top:12px;z-index:200;transform:translateY(-140%);background:var(--accent);color:#fff;text-decoration:none;border-radius:var(--radius);padding:9px 13px;font-weight:600;box-shadow:0 10px 28px rgba(0,0,0,.22)}
.skip-link:focus{transform:translateY(0);outline:3px solid var(--accent-bg);outline-offset:2px}
h1{font-size:24px;font-weight:600;margin:.4rem 0 .3rem;color:var(--text-primary)}
h2{font-size:18px;font-weight:600;margin:0;color:var(--text-primary)}
a{color:var(--accent)}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.app{display:flex;min-height:100vh}

.sidebar{width:288px;flex-shrink:0;border-right:1px solid var(--border);background:var(--surface-1);height:100vh;overflow-y:auto;position:sticky;top:0;padding:1rem .75rem 3rem}
.side-head{font-size:12px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.04em;padding:1rem .6rem .35rem}
.side-head:first-child{padding-top:.25rem}
.nav-item{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:var(--radius);cursor:pointer;color:var(--text-secondary);font-size:14px;text-decoration:none}
.nav-item:hover{background:var(--surface-2)}
.nav-item.active{background:var(--accent-bg);color:var(--accent-text);font-weight:500}
.nav-num{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;background:var(--surface-2);border:1px solid var(--border);font-size:12px;flex-shrink:0}
.nav-item.active .nav-num{background:var(--accent);color:#fff;border-color:var(--accent)}
.nav-item.done .nav-num{background:var(--c-lift);color:#fff;border-color:var(--c-lift)}
.nav-title{flex:1;line-height:1.3}
.nav-check{color:var(--c-lift);font-size:16px}
.side-foot{margin-top:1.6rem;padding-top:.8rem;border-top:1px solid var(--border)}
.side-credit{padding:6px 10px 2px}
.side-author{font-size:13px;font-weight:500;color:var(--text-primary)}
.side-lic{font-size:12px;color:var(--text-secondary);margin-top:4px;display:flex;align-items:center;gap:5px}
.side-lic i{font-size:15px}
.about-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px;margin:1.3rem 0}
.about-grid .card{margin:0}
.muted{color:var(--text-muted);font-size:14px;line-height:1.7}
.lic-badge{display:inline-flex;align-items:center;gap:5px;font-size:19px;color:var(--text-primary);background:var(--surface-1);border:1px solid var(--border);border-radius:var(--radius);padding:8px 14px;margin:.7rem 0}
.lic-badge span{font-size:14px;font-weight:500;margin-left:6px}
.about-list{margin:.3rem 0;padding-left:1.2rem;line-height:1.8;color:var(--text-secondary)}

.content{flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{position:sticky;top:0;z-index:5;display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.8rem 1.5rem;background:color-mix(in srgb,var(--bg) 88%,transparent);backdrop-filter:blur(8px);border-bottom:1px solid var(--border)}
.brand{display:flex;align-items:center;gap:11px}
.brand>i{font-size:24px;color:var(--accent)}
.brand-title{font-weight:600;font-size:15px}
.brand-sub{font-size:12px;color:var(--text-secondary)}
.top-right{display:flex;align-items:center;gap:14px}
.progress{display:flex;align-items:center;gap:9px}
.progress-bar{width:120px;height:7px;border-radius:99px;background:var(--surface-1);overflow:hidden;border:1px solid var(--border)}
.progress-bar span{display:block;height:100%;width:0;background:var(--c-lift);transition:width .3s}
.progress-label{font-size:12px;color:var(--text-secondary);min-width:30px}
.icon-btn{background:var(--surface-2);border:1px solid var(--border-strong);border-radius:var(--radius);width:36px;height:36px;cursor:pointer;color:var(--text-secondary);font-size:18px;display:inline-flex;align-items:center;justify-content:center}
.icon-btn:hover{background:var(--surface-1)}
.login-modal{position:fixed;inset:0;z-index:140;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(0,0,0,.42);backdrop-filter:blur(7px)}
.login-panel{position:relative;width:min(430px,100%);background:var(--surface-2);border:1px solid var(--border-strong);border-radius:18px;padding:1.45rem;box-shadow:0 26px 90px rgba(0,0,0,.3)}
.login-close{position:absolute;right:14px;top:14px}
.login-mark{width:54px;height:54px;border-radius:16px;background:var(--accent-bg);color:var(--accent-text);display:flex;align-items:center;justify-content:center;font-size:28px;margin-bottom:1rem}
.login-copy h2{font-size:1.45rem;margin:0 2.4rem .25rem 0}
.login-copy p{margin:0 0 1.1rem;color:var(--text-secondary);line-height:1.55}
.login-form{display:flex;flex-direction:column;gap:.85rem}
.login-form label{display:flex;flex-direction:column;gap:.35rem;font-size:13px;font-weight:600;color:var(--text-secondary)}
.login-form input{height:42px;border:1px solid var(--border-strong);border-radius:10px;background:var(--surface-1);color:var(--text-primary);padding:0 12px;font:inherit}
.login-form input:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-bg);outline:none}
.login-password{display:grid;grid-template-columns:minmax(0,1fr) 42px;gap:7px;align-items:center}
.login-password .icon-btn{width:42px;height:42px}
.login-captcha{border:1px solid var(--border);border-radius:12px;background:var(--surface-1);padding:.75rem}
.login-captcha[hidden]{display:none}
.login-captcha-title{display:flex;align-items:center;gap:7px;color:var(--text-secondary);font-size:13px;font-weight:600;margin-bottom:.6rem}
.login-captcha-title i{font-size:18px;color:var(--accent)}
.login-captcha-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.login-captcha-tile{height:62px;padding:5px;background:var(--surface-2);border:1px solid var(--border-strong);border-radius:12px;display:flex;align-items:center;justify-content:center}
.login-captcha-tile svg{width:100%;height:100%;display:block}
.login-captcha-tile:hover{border-color:var(--accent-border);background:var(--accent-bg)}
.login-captcha-tile.active{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-bg);background:var(--surface-2)}
.login-message{min-height:22px;color:var(--danger-text);font-size:13px;line-height:1.45}
.login-submit{border:0;justify-content:center;width:100%;cursor:pointer}
.login-submit[disabled]{opacity:.62;cursor:not-allowed;transform:none;filter:none}
.login-foot{display:flex;gap:8px;margin-top:1rem;padding-top:1rem;border-top:1px solid var(--border);color:var(--text-muted);font-size:12px;line-height:1.5}
.login-foot i{font-size:18px;color:var(--accent)}
.nav-toggle{display:none}
.zoom-ctl{display:flex;align-items:center;gap:3px}
.zoom-label{font-size:12px;color:var(--text-secondary);min-width:40px;text-align:center}
.appearance{position:relative}
.appr-panel{position:absolute;right:0;top:46px;width:250px;background:var(--surface-2);border:1px solid var(--border-strong);border-radius:12px;padding:14px;box-shadow:0 10px 34px rgba(0,0,0,.16);z-index:30}
.appr-panel[hidden]{display:none}
.appr-group{margin-bottom:14px}
.appr-group:last-child{margin-bottom:0}
.appr-label{font-size:11px;color:var(--text-muted);margin-bottom:8px;text-transform:uppercase;letter-spacing:.04em}
.appr-themes{display:flex;gap:10px;flex-wrap:wrap}
.theme-swatch{width:34px;height:34px;border-radius:50%;border:2px solid var(--border-strong);cursor:pointer;padding:0}
.theme-swatch.active{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-bg)}
.appr-row{display:flex;gap:6px}
.appr-opt{flex:1;padding:7px 4px;font-size:13px;border:1px solid var(--border-strong);border-radius:var(--radius);background:var(--surface-2);cursor:pointer;color:var(--text-primary)}
.appr-opt.active{background:var(--accent-bg);color:var(--accent-text);border-color:var(--accent-border);font-weight:500}
.theory-fig{margin:1.1rem 0 .4rem;background:var(--surface-1);border:1px solid var(--border);border-radius:12px;padding:1rem 1.1rem;cursor:zoom-in;position:relative}
.theory-fig svg{width:100%;height:auto;display:block}
.theory-fig figcaption{font-size:13px;color:var(--text-secondary);margin-top:.7rem;line-height:1.6}
.fig-zoom-hint{position:absolute;top:9px;right:11px;font-size:11px;color:var(--text-muted);display:inline-flex;align-items:center;gap:4px}
.fig-modal{position:fixed;inset:0;background:rgba(0,0,0,.62);display:flex;align-items:center;justify-content:center;z-index:60;padding:2rem}
.fig-modal[hidden]{display:none}
.fig-modal-inner{background:var(--surface-2);border-radius:14px;padding:1.6rem;max-width:1100px;width:100%;max-height:90vh;overflow:auto;position:relative}
.fig-modal-inner svg{width:100%;height:auto}
.fig-modal-close{position:absolute;top:12px;right:12px;z-index:1}

main{max-width:1120px;width:100%;margin:0;padding:1.6rem 1.5rem 3rem}
.foot{max-width:1120px;margin:0;width:100%;padding:1rem 1.5rem 2rem;color:var(--text-muted);font-size:12px;border-top:1px solid var(--border)}

.chips{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:12px;color:var(--text-secondary)}
.chip{padding:3px 10px;border-radius:var(--radius);background:var(--surface-1);border:1px solid var(--border)}
.chip-accent{background:var(--accent-bg);color:var(--accent-text);border-color:var(--accent-border);font-weight:500}
.lead{color:var(--text-secondary);line-height:1.7;margin:.2rem 0 0}
.lead.sm{margin:.2rem 0 1rem;font-size:15px}

.listen-card{margin:1.1rem 0 .2rem;background:linear-gradient(135deg,color-mix(in srgb,var(--accent-bg) 78%,var(--surface-2)),var(--surface-2));border:1px solid var(--accent-border);border-radius:12px;padding:.85rem;display:flex;align-items:center;justify-content:space-between;gap:1rem}
.listen-copy{display:flex;align-items:center;gap:.75rem;min-width:0}
.listen-icon{width:38px;height:38px;border-radius:10px;background:var(--surface-2);border:1px solid var(--border);color:var(--accent);display:inline-flex;align-items:center;justify-content:center;font-size:21px;flex-shrink:0}
.listen-title{font-weight:600;color:var(--text-primary);line-height:1.25}
.listen-status{font-size:13px;color:var(--text-secondary);line-height:1.35;margin-top:2px}
.listen-controls{display:flex;align-items:center;gap:7px;flex-wrap:wrap;justify-content:flex-end}
.listen-controls[hidden],.listen-audio[hidden]{display:none}
.listen-audio{display:flex;align-items:center;gap:10px;justify-content:flex-end;flex-wrap:wrap;min-width:min(520px,100%)}
.listen-audio audio{display:none}
.listen-ai-note{display:inline-flex;align-items:center;gap:4px;font-size:12px;color:var(--text-muted);white-space:nowrap}
.listen-meter{flex:1 1 240px;min-width:220px}
.listen-seek{width:100%;accent-color:var(--accent);cursor:pointer}
.listen-progress{height:8px;border-radius:999px;background:var(--surface-1);border:1px solid var(--border);overflow:hidden}
.listen-progress span{display:block;height:100%;width:0;background:var(--accent);transition:width .25s linear}
.listen-time{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:2px;font-size:12px;color:var(--text-secondary);font-variant-numeric:tabular-nums}
.listen-meter-tts{flex-basis:190px}
.listen-btn{height:36px;border:1px solid var(--border-strong);border-radius:var(--radius);background:var(--surface-2);color:var(--text-primary);display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 11px;font:inherit;font-size:14px;cursor:pointer}
.listen-btn:hover{background:var(--surface-1);border-color:var(--accent-border)}
.listen-btn.primary{background:var(--accent);border-color:var(--accent);color:#fff;font-weight:600}
.listen-btn[disabled]{opacity:.52;cursor:not-allowed;background:var(--surface-1);color:var(--text-muted)}
.listen-rate{height:36px;border:1px solid var(--border-strong);border-radius:var(--radius);background:var(--surface-2);color:var(--text-primary);padding:0 8px;font:inherit;font-size:13px}
.listen-voice{max-width:190px}

.card{background:var(--surface-2);border:1px solid var(--border);border-radius:12px;padding:1rem 1.25rem;margin:1rem 0}
.card-title{font-weight:500;margin-bottom:.5rem;display:flex;align-items:center;gap:8px}
.card ul{margin:0;padding-left:1.2rem;line-height:1.8;color:var(--text-secondary)}

.tabs{display:flex;gap:6px;flex-wrap:wrap;margin-top:1.5rem;padding-bottom:14px;border-bottom:1px solid var(--border)}
.tab{display:inline-flex;align-items:center;gap:7px;padding:8px 15px;font-size:14px;border:1px solid var(--border);border-radius:999px;background:var(--surface-2);color:var(--text-secondary);cursor:pointer;transition:background .12s,color .12s,border-color .12s}
.tab i{font-size:17px}
.tab:hover{background:var(--surface-1);color:var(--text-primary);border-color:var(--border-strong)}
.tab.active{background:var(--accent-bg);color:var(--accent-text);border-color:var(--accent-border);font-weight:500}
.tab.active i{color:var(--accent-text)}
.tab-panel{display:none}
.tab-panel.active{display:block;padding-top:1.6rem}
.seclabel{display:flex;align-items:center;gap:10px;margin:2.2rem 0 .8rem}
.secnum{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;background:var(--accent-bg);color:var(--accent-text);font-size:13px;font-weight:500;flex-shrink:0}

.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px}
.fcell{background:var(--surface-1);border-radius:var(--radius);padding:.7rem .85rem}
.fcell-t{font-weight:500}
.fcell-d{font-size:13px;color:var(--text-secondary);margin-top:3px}

.topic-flow{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px;margin:1.15rem 0 1.45rem}
.topic-step{position:relative;overflow:hidden;background:var(--surface-2);border:1px solid color-mix(in srgb,var(--step-color) 48%,var(--border));border-radius:12px;padding:.85rem .9rem .95rem;min-height:144px;box-shadow:inset 0 4px 0 var(--step-color)}
.topic-step::after{content:"";position:absolute;right:-28px;top:-32px;width:92px;height:92px;border-radius:50%;background:color-mix(in srgb,var(--step-color) 13%,transparent);pointer-events:none}
.topic-step-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:.65rem;position:relative;z-index:1}
.topic-step-num{width:25px;height:25px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:var(--step-color);color:#fff;font-size:12px;font-weight:700}
.topic-step i{font-size:24px;color:var(--step-color)}
.topic-step-title{font-weight:650;line-height:1.25;margin-bottom:.3rem;position:relative;z-index:1}
.topic-step-desc{font-size:13px;color:var(--text-secondary);line-height:1.45;position:relative;z-index:1}

.callout{border-radius:12px;padding:.8rem 1rem;margin:.7rem 0;font-size:14px;line-height:1.6;display:flex;gap:11px}
.callout i{font-size:19px;flex-shrink:0;margin-top:1px}
.callout b{font-weight:500}
.callout-accent{background:var(--accent-bg);color:var(--accent-text)}
.callout-warning{background:var(--warning-bg);color:var(--warning-text)}
.callout-info{background:var(--surface-1);color:var(--text-secondary)}
.callout-info b{color:var(--text-primary)}
.easa-ref-line{margin:.6rem 0 1.2rem;font-size:13px}
.easa-ref-card{margin:1rem 0 1.2rem}
.easa-ref-card ul{margin:.55rem 0 0}

.dd{margin-top:.9rem}
.dd-toggle{width:100%;justify-content:space-between;display:flex;align-items:center;gap:8px}
.dd-body{display:none;font-size:14px;color:var(--text-secondary);line-height:1.7;margin-top:.6rem;padding:0 .2rem}
.dd.open .dd-body{display:block}
.theory-sec{margin-top:1.55rem;padding-left:1rem;border-left:3px solid color-mix(in srgb,var(--accent) 38%,var(--border));scroll-margin-top:80px}
.theory-sec h3{font-size:17px;font-weight:650;margin:0 0 .45rem;color:var(--text-primary);line-height:1.35}
.theory-sec p{margin:0 0 .7rem;color:var(--text-secondary);line-height:1.75}
.gl-row{display:flex;gap:14px;padding:8px 0;border-top:1px solid var(--border);font-size:14px}
.gl-row:first-child{border-top:none;padding-top:0}
.gl-term{font-weight:500;min-width:160px;flex-shrink:0}
.gl-def{color:var(--text-secondary)}

button{font-family:inherit;font-size:14px;background:var(--surface-2);border:1px solid var(--border-strong);border-radius:var(--radius);padding:9px 14px;cursor:pointer;color:var(--text-primary);display:inline-flex;align-items:center;gap:7px}
button:hover{background:var(--surface-1)}
button:active{transform:scale(.985)}
.btn-accent{background:var(--accent);border-color:var(--accent);color:#fff}
.btn-accent:hover{background:var(--accent);filter:brightness(1.06)}

input[type=range]{-webkit-appearance:none;appearance:none;height:5px;border-radius:99px;background:var(--border-strong);outline:none}
input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:18px;height:18px;border-radius:50%;background:var(--accent);cursor:pointer;border:2px solid var(--surface-2)}
input[type=range]::-moz-range-thumb{width:18px;height:18px;border-radius:50%;background:var(--accent);cursor:pointer;border:2px solid var(--surface-2)}

.lab-host{margin-top:.4rem}
.lab-wrap{background:var(--surface-1);border-radius:12px;padding:.6rem .6rem 1rem}
.dot{width:10px;height:10px;border-radius:50%;display:inline-block;flex-shrink:0}
.ctl{display:flex;align-items:center;gap:10px;margin:9px 0}
.ctl .nm{font-size:13px;color:var(--text-secondary);width:104px;display:flex;align-items:center;gap:7px}
.ctl output{font-size:13px;font-weight:500;width:74px;text-align:right}
.metric{background:var(--surface-1);border-radius:var(--radius);padding:.7rem .85rem}
.metric .l{font-size:12px;color:var(--text-secondary)}
.metric .v{font-size:17px;font-weight:500;margin-top:3px}
.metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin-top:.7rem}
.eqb{display:inline-flex;align-items:center;gap:8px;padding:8px 14px;border-radius:var(--radius);font-size:14px;font-weight:500;margin-top:12px}
.eqb.ok{background:var(--success-bg);color:var(--success-text)}
.eqb.warn{background:var(--warning-bg);color:var(--warning-text)}
.axiscard{background:var(--surface-2);border:1px solid var(--border);border-radius:12px;padding:.8rem;cursor:pointer;transition:border-color .15s}
.axiscard.active{border-color:var(--accent)}

.placeholder{background:var(--surface-1);border:1px dashed var(--border-strong);border-radius:12px;padding:1.25rem;color:var(--text-secondary);font-size:14px;line-height:1.7}
.placeholder .pl-name{font-weight:500;color:var(--text-primary);display:flex;align-items:center;gap:8px;margin-bottom:.3rem}

.ss-list{margin:.2rem 0;padding-left:1.2rem;line-height:1.9;color:var(--text-secondary)}

.test-tabs{display:inline-flex;gap:6px;align-items:center;border:1px solid var(--border);background:var(--surface-1);border-radius:12px;padding:5px;margin-bottom:1.2rem}
.test-tab{border:1px solid transparent;background:transparent;color:var(--text-secondary);border-radius:9px;padding:8px 13px;font-size:14px;display:inline-flex;align-items:center;gap:8px;cursor:pointer}
.test-tab:hover{background:var(--surface-2);color:var(--text-primary)}
.test-tab.active{background:var(--accent-bg);border-color:var(--accent-border);color:var(--accent-text);font-weight:500}
.test-panel{display:none}
.test-panel.active{display:block}
.quiz-head{margin-bottom:1.4rem}
.quiz-head-top{display:flex;justify-content:space-between;align-items:center;gap:12px}
.quiz-head-title{font-size:16px;font-weight:500;display:inline-flex;align-items:center;gap:8px}
.quiz-score{font-size:13px;color:var(--text-secondary);font-weight:500;white-space:nowrap}
.quiz-pbar{height:8px;border-radius:99px;background:var(--surface-1);overflow:hidden;margin-top:11px;border:1px solid var(--border)}
.quiz-pbar span{display:block;height:100%;width:0;background:var(--c-lift);transition:width .35s}
.quiz-head-hint{font-size:13px;color:var(--text-secondary);margin:.75rem 0 0;line-height:1.6}
.quiz{margin-bottom:1rem;border-radius:14px}
.q-stem{display:flex;gap:12px;align-items:flex-start;margin-bottom:1rem;font-size:15px;font-weight:500;line-height:1.5}
.q-num{flex-shrink:0;width:28px;height:28px;border-radius:50%;background:var(--accent);color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:14px;font-weight:500}
.q-text{padding-top:3px}
.qopts{display:flex;flex-direction:column;gap:8px}
.qopt{display:flex;align-items:center;gap:11px;width:100%;text-align:left;padding:11px 13px;border:1px solid var(--border-strong);border-radius:12px;background:var(--surface-2);cursor:pointer;font-size:14px;color:var(--text-primary);transition:background .12s,border-color .12s,transform .07s}
.qopt:hover{background:var(--surface-1);border-color:var(--accent-border);transform:translateX(3px)}
.qopt-key{flex-shrink:0;width:26px;height:26px;border-radius:8px;border:1px solid var(--border-strong);background:var(--surface-1);display:inline-flex;align-items:center;justify-content:center;font-size:13px;font-weight:500;color:var(--text-secondary)}
.qopt-text{flex:1}
.qopt-mark{flex-shrink:0;font-size:19px;display:inline-flex;align-items:center;min-width:19px}
.qopt.correct{border-color:var(--c-lift);background:var(--success-bg);color:var(--success-text)}
.qopt.correct .qopt-key{background:var(--c-lift);border-color:var(--c-lift);color:#fff}
.qopt.correct .qopt-mark{color:var(--c-lift)}
.qopt.wrong{border-color:var(--c-weight);background:var(--danger-bg);color:var(--danger-text)}
.qopt.wrong .qopt-key{background:var(--c-weight);border-color:var(--c-weight);color:#fff}
.qopt.wrong .qopt-mark{color:var(--c-weight)}
.classical-q{margin-bottom:1rem;border-radius:14px}
.classical-source{font-size:12px;text-transform:uppercase;letter-spacing:.08em;color:var(--text-muted);font-weight:600;margin:-.4rem 0 .75rem 40px}
.classical-prompt{color:var(--text-secondary);line-height:1.7;margin:.2rem 0 1rem 40px}
.classical-parts{margin:.2rem 0 0 56px;padding-left:1.1rem;color:var(--text-secondary);line-height:1.75}
.classical-parts li{padding-left:.25rem;margin:.35rem 0}
.unit-cats{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:1rem}
.unit-cat{padding:6px 13px;font-size:13px;border:1px solid var(--border-strong);border-radius:99px;background:var(--surface-2);cursor:pointer;color:var(--text-secondary)}
.unit-cat:hover{background:var(--surface-1)}
.unit-cat.active{background:var(--accent-bg);color:var(--accent-text);border-color:var(--accent-border);font-weight:500}
.unit-input{display:flex;gap:10px;align-items:center;margin-bottom:1.1rem}
.unit-input input[type=number]{flex:1;min-width:0;height:42px;font-size:18px;padding:0 12px;font-family:inherit;background:var(--surface-2);color:var(--text-primary);border:1px solid var(--border-strong);border-radius:var(--radius)}
.unit-input select{height:42px}
.unit-results{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:8px}
.u-row{display:flex;justify-content:space-between;align-items:baseline;gap:10px;padding:10px 13px;border-radius:var(--radius);background:var(--surface-1);font-size:14px}
.u-row.active{background:var(--accent-bg);box-shadow:inset 0 0 0 1px var(--accent-border)}
.u-name{color:var(--text-secondary)}
.u-val{font-weight:500;font-size:17px;color:var(--text-primary)}
.u-row.active .u-val,.u-row.active .u-name{color:var(--accent-text)}
.u-ref-row{display:flex;justify-content:space-between;gap:14px;padding:8px 0;border-top:1px solid var(--border);font-size:14px}
.u-ref-row:first-child{border-top:none;padding-top:0}
.u-ref-k{color:var(--text-secondary)}
.u-ref-v{font-weight:500;text-align:right}
.exp{display:none;font-size:13px;color:var(--text-secondary);margin:8px 0 0;line-height:1.6}
.exp.show{display:block}
.qfeedback{display:none;font-size:13px;margin-top:10px;padding:10px 12px;border-radius:var(--radius);line-height:1.6}
.qfeedback.show{display:block}
.qfeedback.good{background:var(--success-bg);color:var(--success-text)}
.qfeedback.bad{background:var(--danger-bg);color:var(--danger-text)}
.lab-chips{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:1.3rem}
.lab-chip{padding:7px 15px;font-size:14px;border:1px solid var(--border-strong);border-radius:99px;background:var(--surface-2);cursor:pointer;color:var(--text-secondary)}
.lab-chip:hover{background:var(--surface-1)}
.lab-chip.active{background:var(--accent-bg);color:var(--accent-text);border-color:var(--accent-border);font-weight:500}
.lab-sub{display:none}
.lab-sub.active{display:block}
input[type=text],textarea{font-family:inherit;background:var(--surface-2);color:var(--text-primary);border:1px solid var(--border-strong);border-radius:var(--radius)}
input[type=text]{height:36px;padding:0 11px;font-size:14px}
input[type=text]:focus,textarea:focus{outline:none;border-color:var(--accent)}
.greeting{font-size:13px;color:var(--text-secondary);white-space:nowrap}
.reflect-name{display:flex;flex-direction:column;gap:4px;margin:1.1rem 0}
.reflect-name label{font-size:14px;display:flex;align-items:center;gap:8px;color:var(--text-secondary)}
.reflect-name input{max-width:260px}
.reflect-row{padding:13px 0;border-top:1px solid var(--border)}
.reflect-row:first-child{border-top:none;padding-top:2px}
.reflect-obj{font-size:14px;margin-bottom:9px;color:var(--text-primary);line-height:1.5}
.rate-group{display:flex;gap:6px;flex-wrap:wrap}
.rate-btn{padding:6px 13px;font-size:13px;border:1px solid var(--border-strong);border-radius:99px;background:var(--surface-2);cursor:pointer;color:var(--text-secondary)}
.rate-btn:hover{background:var(--surface-1)}
.rate-btn.active{background:var(--accent-bg);color:var(--accent-text);border-color:var(--accent-border);font-weight:500}
.reflect-note{margin-top:1.3rem}
.reflect-note label{display:block;font-size:14px;margin-bottom:7px;color:var(--text-secondary)}
.reflect-note textarea{width:100%;font-size:14px;padding:10px 11px;line-height:1.6;resize:vertical}

.bridge{border-top:1px solid var(--border);margin-top:.9rem;padding-top:.8rem;font-size:14px;color:var(--text-secondary)}
.complete-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:1.4rem}

/* ---------- Edit mode ---------- */
main.editor-main{max-width:1180px}
.editor-shell{width:100%}
.editor-head{display:flex;align-items:flex-end;justify-content:space-between;gap:1rem;margin-bottom:1rem}
.editor-head h1{font-size:28px;margin:.35rem 0 .2rem}
.editor-week{display:flex;align-items:center;gap:8px;background:var(--surface-1);border:1px solid var(--border);border-radius:var(--radius);padding:8px 10px;min-width:260px}
.editor-week label{font-size:12px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.04em}
select{font-family:inherit;background:var(--surface-2);color:var(--text-primary);border:1px solid var(--border-strong);border-radius:var(--radius);height:36px;padding:0 10px}
.editor-week select{flex:1;min-width:0}
.editor-ribbon{position:sticky;top:70px;z-index:4;display:flex;align-items:center;gap:7px;flex-wrap:wrap;background:color-mix(in srgb,var(--surface-2) 94%,transparent);backdrop-filter:blur(8px);border:1px solid var(--border);border-radius:var(--radius);padding:9px;margin:1rem 0;box-shadow:0 8px 26px rgba(0,0,0,.08)}
.ed-tool{width:36px;height:36px;padding:0;justify-content:center;border-radius:var(--radius)}
.ed-tool i{font-size:18px}
.ed-upload{display:inline-flex;align-items:center;justify-content:center;background:var(--surface-2);border:1px solid var(--border-strong);color:var(--text-primary);cursor:pointer}
.ed-upload input{display:none}
.ed-ribbon-sep{width:1px;height:28px;background:var(--border);margin:0 2px}
.editor-status{font-size:12px;color:var(--text-muted);margin-left:auto}
.editor-status.good{color:var(--success-text)}
.editor-status.bad{color:var(--danger-text);font-weight:600}
.ed-tabs{display:flex;gap:7px;flex-wrap:wrap;margin:.8rem 0 1rem}
.ed-tab{border-radius:999px;padding:8px 13px;color:var(--text-secondary)}
.ed-tab.active{background:var(--accent-bg);border-color:var(--accent-border);color:var(--accent-text);font-weight:600}
.editor-grid{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(360px,.95fr);gap:1rem;align-items:start}
.editor-panel{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius);padding:1rem}
.editor-work{min-width:0}
.editor-preview{position:sticky;top:148px;max-height:calc(100vh - 170px);overflow:auto}
.ed-preview-head{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:600;color:var(--text-secondary);padding-bottom:.7rem;margin-bottom:.9rem;border-bottom:1px solid var(--border)}
.ed-preview-head i{font-size:18px;color:var(--accent)}
.ed-pane{display:none}
.ed-pane.active{display:block}
.ed-pane-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:.8rem}
.ed-field{display:flex;flex-direction:column;gap:6px;margin-bottom:.9rem}
.ed-field span{font-size:12px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.04em}
.ed-field input,.ed-field textarea{width:100%;font-size:14px;padding:10px 11px;line-height:1.55}
.ed-field input{height:40px}
.ed-field textarea{resize:vertical;min-height:84px}
.ed-two{display:grid;grid-template-columns:1fr 1fr;gap:.8rem}
.ed-sections{display:flex;flex-direction:column;gap:.85rem}
.ed-section{background:var(--surface-1);border:1px solid var(--border);border-radius:var(--radius);padding:.9rem}
.ed-section-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:.75rem;font-size:13px;font-weight:700;color:var(--accent)}
.ed-remove-section{width:32px;height:32px}
.editor-canvas{min-height:620px;background:var(--surface-1);border:1px solid var(--border-strong);border-radius:var(--radius);padding:1.1rem 1.2rem;color:var(--text-primary);outline:none;line-height:1.75}
.editor-canvas:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-bg)}
.editor-canvas h2{font-size:24px;margin:.2rem 0 .7rem}
.editor-canvas h3{font-size:17px;margin:1.2rem 0 .35rem}
.editor-canvas p{margin:.45rem 0;color:var(--text-secondary)}
.editor-canvas blockquote{margin:1rem 0;padding:.7rem 1rem;border-left:4px solid var(--accent);background:var(--accent-bg);color:var(--accent-text);border-radius:0 var(--radius) var(--radius) 0}
.ed-canvas-fig,.ed-inserted-image{margin:1rem 0;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius);padding:.8rem}
.ed-canvas-fig svg{width:100%;height:auto;display:block}
.ed-inserted-image img{max-width:100%;height:auto;display:block;border-radius:6px}
.ed-canvas-fig figcaption,.ed-inserted-image figcaption{font-size:12px;color:var(--text-muted);margin-top:.55rem}
#ed-preview-body .topic-flow{grid-template-columns:repeat(auto-fit,minmax(145px,1fr))}
#ed-preview-body .topic-step{min-height:126px}
#ed-preview-body .theory-sec{padding-left:.8rem}

[data-edit="1"] .sidebar,[data-edit="1"] .topbar,[data-edit="1"] .foot{display:none}
[data-edit="1"] .content{width:100%}
main.editor-main{max-width:none;margin:0;padding:0}
.editor-object-shell{min-height:100vh;background:linear-gradient(180deg,var(--surface-1),var(--bg));width:100%}
.editor-fullbar{position:sticky;top:0;z-index:40;display:grid;grid-template-columns:auto minmax(230px,340px) 1fr auto auto;align-items:center;gap:10px;padding:10px 14px;background:color-mix(in srgb,var(--surface-2) 96%,transparent);backdrop-filter:blur(10px);border-bottom:1px solid var(--border);box-shadow:0 8px 30px rgba(0,0,0,.08)}
.editor-titlebar{display:flex;flex-direction:column;min-width:0}
.editor-titlebar strong{font-size:14px;line-height:1.2}
.editor-titlebar span{font-size:12px;color:var(--text-muted)}
.editor-version{font-style:normal;font-size:11px;color:var(--accent-text);background:var(--accent-bg);border:1px solid var(--accent-border);border-radius:999px;padding:1px 6px;margin-left:5px}
.editor-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap;justify-content:flex-end}
.editor-actions button{height:36px;padding:0 11px}
.editor-fullbar .editor-status{margin-left:0;min-width:130px}
.ed-exit{white-space:nowrap}
.ed-object-layout{display:grid;grid-template-columns:300px minmax(0,1fr);gap:18px;padding:18px;max-width:1440px;margin:0 auto}
.ed-map{position:sticky;top:72px;align-self:start;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius);padding:1rem;box-shadow:0 10px 32px rgba(0,0,0,.07)}
.ed-map-title{font-size:12px;color:var(--accent);font-weight:700;text-transform:uppercase;letter-spacing:.05em}
.ed-map h1{font-size:20px;line-height:1.25;margin:.45rem 0 .45rem}
.ed-map p{font-size:13px;color:var(--text-secondary);line-height:1.55;margin:0}
.ed-map-pills{display:flex;gap:6px;flex-wrap:wrap;margin-top:1rem}
.ed-map-pills span{font-size:12px;color:var(--text-secondary);background:var(--surface-1);border:1px solid var(--border);border-radius:999px;padding:4px 8px}
.ed-object-board{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius);padding:1rem;box-shadow:0 12px 36px rgba(0,0,0,.08)}
.ed-doc-title{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:10px}
.ed-doc-divider{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:1.3rem 0 .8rem;border-top:1px solid var(--border);padding-top:1rem}
.ed-doc-divider span{font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:var(--text-muted);font-weight:700}
.ed-doc-divider button,.ed-section-actions button,.ed-mini-btn{height:32px;padding:0 10px;font-size:13px}
.ed-doc-sections{display:flex;flex-direction:column;gap:12px}
.ed-doc-section{background:var(--surface-1);border:1px solid var(--border);border-radius:var(--radius);padding:.9rem}
.ed-doc-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:.75rem}
.ed-doc-section-head div:first-child{display:flex;flex-direction:column;gap:2px;min-width:0}
.ed-doc-section-head span{font-size:12px;color:var(--accent);font-weight:700;text-transform:uppercase;letter-spacing:.05em}
.ed-doc-section-head strong{font-size:15px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ed-section-actions{display:flex;align-items:center;gap:6px;flex-shrink:0}
.ed-object-stack{display:flex;flex-direction:column;gap:7px;margin:.6rem 0}
.ed-object-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px;align-items:stretch}
.ed-object{width:100%;display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;gap:12px;text-align:left;background:var(--surface-2);border:1px solid var(--border-strong);border-radius:var(--radius);padding:12px 13px;color:var(--text-primary);transition:border-color .14s,background .14s,transform .12s,box-shadow .14s}
.ed-object:hover{background:var(--surface-2);border-color:var(--accent-border);box-shadow:0 6px 18px rgba(0,0,0,.07);transform:translateY(-1px)}
.ed-object-icon{width:34px;height:34px;border-radius:var(--radius);display:inline-flex;align-items:center;justify-content:center;background:var(--accent-bg);color:var(--accent-text);font-size:19px}
.ed-object-copy{display:flex;flex-direction:column;gap:2px;min-width:0}
.ed-object-label{font-size:13px;font-weight:700;line-height:1.3}
.ed-object-body{font-size:13px;color:var(--text-secondary);line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ed-object-meta{font-size:11px;color:var(--text-muted);background:var(--surface-1);border:1px solid var(--border);border-radius:999px;padding:3px 8px;white-space:nowrap}
.ed-object-go{color:var(--text-muted);font-size:18px}
.ed-empty-state,.ed-empty-line{display:flex;align-items:center;gap:8px;color:var(--text-muted);background:var(--surface-1);border:1px dashed var(--border-strong);border-radius:var(--radius);padding:1rem;font-size:13px}
.editor-modal{position:fixed;inset:0;z-index:90;background:rgba(0,0,0,.48);display:flex;align-items:center;justify-content:center;padding:22px}
.editor-modal[hidden]{display:none}
.ed-modal-panel{width:min(960px,100%);min-width:min(680px,100%);max-height:92vh;overflow:auto;resize:both;background:var(--surface-2);border:1px solid var(--border-strong);border-radius:var(--radius);box-shadow:0 24px 80px rgba(0,0,0,.28)}
.ed-modal-head{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;background:var(--surface-2);border-bottom:1px solid var(--border)}
.ed-modal-head h2{font-size:18px}
.ed-modal-body{padding:16px}
.ed-modal-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid var(--border);background:var(--surface-1)}
.ed-preview-modal .ed-modal-panel{width:min(1080px,100%);padding:0}
.ed-preview-modal-body{padding:1.25rem 1.5rem 2rem;max-width:900px;margin:0 auto}
.preview-tabs{pointer-events:none}
.ed-image-tools{display:flex;gap:8px;flex-wrap:wrap;margin:.2rem 0 .9rem}
.ed-upload-wide{display:inline-flex;align-items:center;gap:7px;height:36px;padding:0 12px;background:var(--surface-2);border:1px solid var(--border-strong);border-radius:var(--radius);cursor:pointer;font-size:14px}
.ed-upload-wide input{display:none}
.ed-image-preview{display:flex;align-items:center;justify-content:center;min-height:160px;background:var(--surface-1);border:1px dashed var(--border-strong);border-radius:var(--radius);overflow:hidden;color:var(--text-muted);font-size:13px;margin-left:auto;margin-right:auto;transition:max-width .15s}
.ed-image-preview img,.ed-image-preview svg{max-width:100%;height:auto;display:block}
.ed-range-field>div{display:flex;align-items:center;gap:10px}
.ed-range-field input{flex:1}
.ed-range-field output{font-size:13px;color:var(--text-secondary);min-width:42px;text-align:right}
.ed-svg-text-editor{border:1px solid var(--border);border-radius:var(--radius);background:var(--surface-1);padding:.8rem;margin:.4rem 0 1rem}
.ed-svg-text-title{display:flex;align-items:center;gap:7px;font-size:12px;text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted);font-weight:700;margin-bottom:.55rem}
.ed-svg-text-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:8px}
.ed-svg-text-row{display:flex;flex-direction:column;gap:4px}
.ed-svg-text-row span{font-size:11px;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ed-svg-text-row input{height:34px;padding:0 9px}
.ed-svg-text-empty{display:flex;align-items:center;gap:7px;color:var(--text-muted);font-size:13px}
.ed-svg-source-editor{border:1px solid var(--border);border-radius:var(--radius);background:var(--surface-1);padding:.8rem;margin:.4rem 0 1rem}
.ed-svg-source-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:.55rem}
.ed-svg-source-head span{display:flex;align-items:center;gap:7px;font-size:12px;text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted);font-weight:700}
.ed-svg-source-head div{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.ed-svg-source-head button{height:30px;padding:0 9px;font-size:12px}
.ed-svg-source-input{width:100%;min-height:240px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;line-height:1.45;tab-size:2;white-space:pre;overflow:auto;resize:vertical}
.ed-svg-source-note{margin-top:.45rem;font-size:12px;color:var(--text-muted)}
.ed-svg-source-note.good{color:var(--success-text)}
.ed-svg-source-note.bad{color:var(--danger)}
.ed-lab-card{border-left:4px solid var(--c-lift)}
.ed-lab-meta{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin:.15rem 0 .6rem;font-size:12px;color:var(--text-muted)}
.ed-lab-meta span,.ed-lab-badge{display:inline-flex;align-items:center;min-height:24px;padding:2px 8px;border:1px solid var(--border);border-radius:999px;background:var(--surface-1)}
.ed-lab-badge.custom{color:var(--accent-text);border-color:var(--accent-border);background:var(--accent-bg)}
.ed-lab-badge.built{color:var(--success-text);border-color:color-mix(in srgb,var(--success-text) 35%,var(--border));background:var(--success-bg)}
.ed-lab-badge.missing{color:var(--danger);border-color:color-mix(in srgb,var(--danger) 35%,var(--border));background:var(--surface-1)}
.ed-lab-source-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.ed-lab-source-actions button{height:34px;padding:0 10px;font-size:12px}
.ed-lab-source-editor{border:1px solid var(--border);border-radius:var(--radius);background:var(--surface-1);padding:.8rem;margin:.7rem 0 1rem}
.ed-lab-source-input{width:100%;min-height:320px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;line-height:1.45;tab-size:2;white-space:pre;overflow:auto;resize:vertical}
.ed-lab-preview-wrap{border:1px solid var(--border);border-radius:var(--radius);background:var(--surface-1);padding:.8rem;margin:.7rem 0 0}
.ed-lab-preview-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:.55rem}
.ed-lab-preview-head span{display:flex;align-items:center;gap:7px;font-size:12px;text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted);font-weight:700}
.ed-lab-preview{min-height:220px;padding:.7rem;background:var(--surface-2);border:1px dashed var(--border-strong);border-radius:var(--radius);overflow:auto}
.ed-lab-preview .lab-wrap{margin:0}
.theory-img{max-width:100%;height:auto;display:block;border-radius:6px}
.rich-par{margin:0 0 .7rem;color:var(--text-secondary);line-height:1.75}
.rich-par p{margin:.2rem 0 .7rem}
.rich-par ul,.rich-par ol{margin:.35rem 0 .7rem;padding-left:1.35rem}
.rich-par li{margin:.2rem 0}
.math-inline,.math-block{font-family:Georgia,"Times New Roman",serif;font-style:normal;color:var(--accent-text);background:var(--accent-bg);border:1px solid var(--accent-border);border-radius:6px}
.math-inline{display:inline-flex;align-items:center;gap:2px;padding:1px 6px;margin:0 2px;vertical-align:baseline;white-space:nowrap}
.math-block{display:flex;justify-content:center;align-items:center;margin:.7rem 0;padding:.75rem 1rem;font-size:1.08em;overflow-x:auto}
.math-inline mjx-container{margin:0!important}
.math-block mjx-container{margin:0!important;max-width:100%}
.svg-math{background:transparent!important;border:0!important;border-radius:0!important;margin:0!important;padding:0!important;overflow:visible!important}
.svg-math mjx-container{max-width:100%!important}
.math-frac{display:inline-grid;grid-template-rows:auto auto;align-items:center;text-align:center;line-height:1.05;vertical-align:middle;margin:0 2px}
.math-frac span:first-child{border-bottom:1px solid currentColor;padding:0 3px}
.math-frac span:last-child{padding:0 3px}
.plot-block{display:block;margin:.85rem 0;padding:.65rem;background:var(--surface-1);border:1px solid var(--border);border-radius:var(--radius)}
.plot-block.ed-plot-selected{outline:2px solid var(--accent);outline-offset:3px}
.plot-svg{width:100%;height:auto;display:block}
.plot-bg{fill:var(--surface-2);stroke:var(--border)}
.plot-grid{stroke:var(--border);stroke-width:1}
.plot-axis{stroke:var(--text-secondary);stroke-width:1.5}
.plot-curve{fill:none;stroke:var(--plot-color);stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.plot-shape{fill:color-mix(in srgb,var(--plot-color) 15%,transparent);stroke:var(--plot-color);stroke-width:3}
.plot-label,.plot-title{fill:var(--text-secondary);font-size:13px;font-family:var(--font);font-style:normal}
.plot-title{font-weight:700;fill:var(--text-primary)}
.youtube-block{position:relative;display:block;margin:.9rem auto;padding:0;max-width:760px;aspect-ratio:16/9;background:#111;border:1px solid var(--border-strong);border-radius:var(--radius);overflow:hidden}
.youtube-block.ed-youtube-selected{outline:2px solid #c4302b;outline-offset:3px}
.youtube-block iframe{position:absolute;inset:0;width:100%;height:100%;border:0}
.float-box{display:inline-block;max-width:min(280px,90%);padding:.65rem .8rem;margin:.25rem .5rem .45rem;border:1px solid color-mix(in srgb,var(--accent) 35%,var(--border));color:var(--text-primary);line-height:1.45;font-size:.94em;box-shadow:0 8px 24px rgba(0,0,0,.08);vertical-align:middle}
.float-box.ed-float-selected{outline:2px solid var(--accent);outline-offset:3px}
.float-box-left{float:left;margin-left:0;margin-right:1rem}
.float-box-right{float:right;margin-left:1rem;margin-right:0}
.float-box-inline{float:none;margin:.15rem .35rem}
.float-box-full{display:block;float:none;max-width:none;margin:.7rem 0;clear:both}
.float-box-rounded{border-radius:var(--radius)}
.float-box-square{border-radius:0}
.float-box-pill{border-radius:22px;padding:.65rem 1rem}
.float-box-note{border-left:5px solid var(--accent)}
.float-box-example{border-left:5px solid var(--c-lift)}
.float-box-warning{border-left:5px solid var(--c-weight)}
.float-box-formula{border-left:5px solid var(--c-thrust);font-family:Georgia,"Times New Roman",serif}
.ed-rich-field{gap:0}
.ed-rich-toolbar{display:flex;flex-direction:column;gap:7px;padding:8px;background:var(--surface-1);border:1px solid var(--border-strong);border-bottom:none;border-radius:var(--radius) var(--radius) 0 0}
.ed-rich-toolbar>.ed-rich-row{width:100%;box-sizing:border-box}
.ed-rich-row{display:flex;align-items:center;gap:6px;flex-wrap:wrap;flex:0 0 100%}
.ed-rich-row+.ed-rich-row{padding-top:7px;border-top:1px solid var(--border)}
.ed-rich-row-primary{justify-content:flex-start}
.ed-rich-row-linkmath{justify-content:flex-start}
.ed-rich-row-tools{justify-content:flex-start}
.ed-rich-btn{width:34px;height:32px;padding:0;justify-content:center;border-radius:7px;background:var(--surface-2)}
.ed-rich-btn i{font-size:17px}
.ed-rich-select{height:32px;max-width:118px;font-size:12px;padding:0 7px}
.ed-rich-mini-input{height:32px;width:128px;font-size:12px;padding:0 8px}
.ed-rich-link-group{display:inline-flex;align-items:center;gap:0;flex:0 0 auto}
.ed-rich-link-group .ed-rich-link-input{width:336px;max-width:min(52vw,336px);border-radius:7px 0 0 7px;border-right:0}
.ed-rich-link-group .ed-rich-btn{border-radius:0;border-left:1px solid var(--border-strong)}
.ed-rich-link-group .ed-rich-btn:last-child{border-radius:0 7px 7px 0}
.ed-rich-math-input{width:150px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
.ed-rich-math-group{display:inline-flex;align-items:center;gap:0;flex:0 0 auto}
.ed-rich-math-group .ed-rich-math-input{width:252px;border-radius:7px 0 0 7px;border-right:0}
.ed-rich-math-group .ed-rich-btn{border-radius:0;border-left:1px solid var(--border-strong)}
.ed-rich-math-group .ed-rich-btn:last-child{border-radius:0 7px 7px 0}
.ed-rich-youtube-group{display:inline-flex;align-items:center;gap:0;flex:0 0 auto}
.ed-rich-youtube-group .ed-rich-youtube-input{width:210px;border-radius:7px 0 0 7px;border-right:0}
.ed-rich-youtube-group .ed-rich-youtube-size{max-width:76px;border-radius:0;border-left:1px solid var(--border-strong);border-right:0}
.ed-rich-youtube-group .ed-rich-btn{border-radius:0;border-left:1px solid var(--border-strong);color:#c4302b}
.ed-rich-youtube-group .ed-rich-btn:last-child{border-radius:0 7px 7px 0}
.ed-rich-box-width,.ed-rich-box-border-width,.ed-rich-box-shadow{max-width:104px}
.ed-rich-color{height:32px;min-width:42px;display:inline-flex;align-items:center;justify-content:center;gap:3px;border:1px solid var(--border-strong);border-radius:7px;background:var(--surface-2);color:var(--text-secondary);cursor:pointer}
.ed-rich-color input{width:18px;height:22px;border:0;background:transparent;padding:0;cursor:pointer}
.ed-emoji-pick{position:relative;display:inline-flex;align-items:center;gap:3px;padding:0 3px;border-left:1px solid var(--border)}
.ed-emoji-pick .ed-rich-btn{font-size:15px}
.ed-emoji-panel{position:fixed;z-index:120;width:360px;max-width:calc(100vw - 24px);max-height:420px;overflow:auto;background:var(--surface-2);border:1px solid var(--border-strong);border-radius:var(--radius);padding:9px;box-shadow:0 20px 55px rgba(0,0,0,.25)}
.ed-emoji-panel[hidden]{display:none}
.ed-emoji-search{width:100%;height:32px;margin-bottom:8px;padding:0 9px;font-size:12px}
.ed-emoji-groups{display:flex;flex-direction:column;gap:8px}
.ed-emoji-group-title{font-size:11px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:.06em;margin:2px 0 4px}
.ed-emoji-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(32px,1fr));gap:4px}
.ed-emoji-grid .ed-rich-btn{font-size:17px;background:var(--surface-1)}
.ed-html-toggle.active{background:var(--accent);color:#fff;border-color:var(--accent)}
.ed-rich-input{min-height:260px;max-height:54vh;overflow:auto;padding:14px 15px;background:var(--surface-2);border:1px solid var(--border-strong);border-radius:0 0 var(--radius) var(--radius);color:var(--text-primary);line-height:1.72;outline:none}
.ed-rich-input:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-bg)}
.ed-rich-input .youtube-block iframe{pointer-events:none}
.ed-rich-input p{margin:.3rem 0 .75rem}
.ed-rich-input ul,.ed-rich-input ol{padding-left:1.35rem}
.ed-rich-input li{margin:.25rem 0}
.ed-rich-html-input{width:100%;min-height:320px;max-height:58vh;overflow:auto;padding:14px 15px;background:var(--surface-2);border:1px solid var(--border-strong);border-radius:0 0 var(--radius) var(--radius);color:var(--text-primary);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;line-height:1.55;tab-size:2;resize:vertical;outline:none}
.ed-rich-html-input:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-bg)}
.ed-latex-panel{width:min(980px,94vw);resize:both;overflow:auto}
.ed-latex-body{display:grid;grid-template-columns:minmax(360px,1fr) minmax(280px,.8fr);gap:14px;align-items:stretch}
.ed-latex-input{min-height:190px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:15px;line-height:1.55}
.ed-latex-side{display:flex;flex-direction:column;gap:8px}
.ed-latex-label{font-size:12px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:.06em}
.ed-latex-preview{min-height:118px;display:flex;align-items:center;justify-content:center;padding:12px;background:var(--surface-2);border:1px solid var(--border-strong);border-radius:var(--radius);overflow:auto}
.ed-latex-examples{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.ed-latex-examples button{height:auto;min-height:34px;padding:7px 9px;justify-content:flex-start;text-align:left;font-size:12px;background:var(--surface-2)}
@media (max-width:760px){.ed-latex-body{grid-template-columns:1fr}.ed-rich-math-group .ed-rich-math-input{width:160px}}
.ed-flow-page{max-width:850px;margin:0 auto;padding:.35rem .2rem 1rem}
.ed-flow-object{position:relative;margin:.55rem 0;padding:.35rem .55rem;border:1px solid transparent;border-radius:var(--radius);transition:border-color .14s,background .14s,box-shadow .14s}
.ed-flow-object:hover{border-color:var(--accent-border);background:color-mix(in srgb,var(--accent-bg) 38%,transparent);box-shadow:0 8px 24px rgba(0,0,0,.05)}
.ed-flow-object h1{font-size:28px;line-height:1.16;margin:.55rem 0 .35rem}
.ed-flow-object h3{font-size:19px;line-height:1.35;margin:.25rem 0 .4rem}
.ed-flow-object p{color:var(--text-secondary);line-height:1.76;margin:.25rem 0}
.ed-flow-object .rich-par{margin:.25rem 0}
.ed-flow-object.is-inlineable .ed-flow-content{position:relative;border-radius:6px;cursor:text}
.ed-flow-object.is-inlineable .ed-flow-content:hover{box-shadow:inset 0 0 0 1px var(--c-lift);background:color-mix(in srgb,var(--success-bg) 42%,transparent)}
.ed-placeholder{display:flex;justify-content:flex-end;margin:.35rem 0 0}
.ed-handle{height:28px;padding:0 9px;border-radius:999px;font-size:12px;gap:5px;background:var(--surface-2);border:1px dashed var(--accent-border);color:var(--accent-text);box-shadow:none}
.ed-handle:hover{background:var(--accent-bg);border-style:solid}
.ed-handle i{font-size:14px}
.ed-handle-action{border-color:var(--border-strong);color:var(--text-secondary)}
.ed-inline-active{outline:2px solid var(--accent);outline-offset:4px;background:var(--surface-2);border-radius:6px;min-height:1.6em}
.ed-flow-content[contenteditable="true"],.ed-inline-active[contenteditable="true"]{cursor:text}
.ed-inline-actions{display:flex;justify-content:flex-end;margin:-.2rem .55rem .45rem}
.ed-section-flow-actions{display:flex;align-items:center;justify-content:flex-end;gap:7px;margin-bottom:.45rem}
.ed-section-flow-actions>span{margin-right:auto;font-size:12px;color:var(--accent);font-weight:700;text-transform:uppercase;letter-spacing:.05em}
.ed-flow-section{padding:.9rem 1rem;background:var(--surface-2);border-color:var(--border)}
.ed-flow-card{margin:.1rem 0}
.ed-flow-topic{margin:.5rem 0}
.ed-flow-topic .topic-step{min-height:122px}
.ed-flow-figure{margin:.35rem 0;background:var(--surface-1)}
.ed-flow-empty{display:flex;align-items:center;justify-content:center;gap:8px;min-height:96px;border:1px dashed var(--border-strong);border-radius:var(--radius);background:var(--surface-1);color:var(--text-muted);font-size:13px}
.ed-figure-empty{min-height:140px}
.ed-figure-empty-compact{min-height:34px;justify-content:flex-end;padding:.3rem .6rem;background:transparent;border-color:var(--accent-border);color:var(--accent-text)}
.ed-preview-actions{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:.75rem;flex-wrap:wrap}

@media(max-width:860px){
  .sidebar{position:fixed;left:0;top:0;z-index:20;transform:translateX(-100%);transition:transform .2s;box-shadow:0 0 40px rgba(0,0,0,.15)}
  .sidebar.open{transform:translateX(0)}
  .progress-bar{width:80px}
  .brand-sub{display:none}
  .progress,.zoom-ctl{display:none}
  .appr-panel{right:-8px;width:min(286px,calc(100vw - 24px))}
  .theme-swatch{width:32px;height:32px}
  .editor-ribbon{top:62px}
  .editor-head{align-items:stretch;flex-direction:column}
  .editor-week{width:100%;min-width:0}
  .editor-grid{grid-template-columns:1fr}
  .editor-preview{position:static;max-height:none}
  .ed-two{grid-template-columns:1fr}
  .editor-fullbar{position:static;grid-template-columns:1fr;align-items:stretch}
  .editor-actions{justify-content:flex-start}
  .ed-object-layout{grid-template-columns:1fr;padding:10px}
  .ed-map{position:static}
  .ed-object-board{padding:.75rem}
  .ed-doc-title{grid-template-columns:1fr}
  .ed-doc-section-head{align-items:flex-start;flex-direction:column}
  .ed-section-actions{width:100%;justify-content:flex-start}
  .ed-object{grid-template-columns:auto minmax(0,1fr) auto}
  .ed-object-meta{display:none}
  .ed-flow-page{max-width:none}
  .ed-flow-object{padding:.3rem}
  .ed-placeholder,.ed-inline-actions,.ed-section-flow-actions{justify-content:flex-start}
  .ed-modal-panel{min-width:0;resize:vertical}
  .listen-card{align-items:stretch;flex-direction:column}
  .listen-controls,.listen-audio{justify-content:flex-start;min-width:0}
  .listen-btn{flex:1 1 96px}
  .listen-meter{flex:1 1 100%;min-width:0;order:3}
  .listen-meter-tts{order:4}
  .listen-rate{flex:0 0 96px}
  .listen-voice{flex:1 1 180px;max-width:none}
}
@media(min-width:861px){
  .app.sidebar-collapsed .sidebar{display:none}
}
.topbar-left{display:flex;align-items:center;gap:10px;min-width:0}
[data-present] .sidebar,[data-present] .topbar,[data-present] .foot{display:none}
[data-present] main{max-width:1080px;margin:0 auto;padding-top:2.4rem}
.present-exit{position:fixed;top:14px;right:16px;z-index:80;display:none;align-items:center;gap:6px;font-size:13px;background:var(--surface-2);border:1px solid var(--border-strong);border-radius:99px;padding:8px 14px;cursor:pointer;color:var(--text-primary);box-shadow:0 4px 16px rgba(0,0,0,.15)}
[data-present] .present-exit{display:inline-flex}
.tab:focus-visible,.icon-btn:focus-visible,button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.tab:focus-visible{outline-offset:2px}
@media(prefers-reduced-motion: reduce){
  *{animation-duration:.001ms !important;animation-iteration-count:1 !important;transition-duration:.001ms !important}
}

/* ---------- Cover / landing page ---------- */
.brand{text-decoration:none;color:inherit}
.cover{max-width:1000px;margin:0 auto;padding-top:.4rem}
.cover-hero{display:grid;grid-template-columns:1.05fr .95fr;gap:2.2rem;align-items:center;margin:.4rem 0 2.6rem}
.cover-hero-art svg{width:100%;height:auto;display:block}
.cover-art-figure{margin:0 auto}
.cover-art-figure img{display:block;width:100%;height:auto;border-radius:18px;border:1px solid var(--border);background:var(--surface-1)}
.cover-art-figure figcaption{font-size:12px;color:var(--text-muted);text-align:center;margin-top:.5rem}
.ed-home-preview-hero{margin:0;gap:1.2rem}
.ed-about-preview .card{margin-top:1rem}
.cover-hello{font-size:13.5px;color:var(--accent);font-weight:600;margin-bottom:.55rem;display:flex;align-items:center;gap:6px}
.cover-title{font-size:2.7rem;line-height:1.04;letter-spacing:-.5px;margin:.45rem 0 .7rem}
.cover-sub{font-size:1.04rem;color:var(--text-secondary);line-height:1.6;max-width:31rem;margin:0}
.cover-cta{display:flex;gap:.7rem;flex-wrap:wrap;margin:1.4rem 0 1rem}
.btn-primary{display:inline-flex;align-items:center;gap:.5rem;background:var(--accent);color:#fff;padding:.72rem 1.25rem;border-radius:11px;font-weight:600;font-size:.95rem;text-decoration:none;border:1px solid var(--accent);transition:filter .15s,transform .15s}
.btn-primary:hover{filter:brightness(1.07);transform:translateY(-1px)}
.btn-primary:disabled,.btn-primary[disabled]{background:var(--accent);border-color:var(--accent);color:#fff;opacity:.62;cursor:not-allowed;filter:none;transform:none}
.btn-primary:disabled:hover,.btn-primary[disabled]:hover{background:var(--accent);color:#fff;filter:none;transform:none}
.btn-ghost{display:inline-flex;align-items:center;gap:.5rem;padding:.72rem 1.1rem;border-radius:11px;border:1px solid var(--border-strong);color:var(--text-primary);text-decoration:none;font-size:.95rem;font-weight:500;background:var(--surface-1)}
.btn-ghost:hover{background:var(--surface-2)}
.cover-progress{display:flex;align-items:center;gap:.7rem;margin:.2rem 0 1rem}
.cover-prog-bar{flex:0 1 200px;height:7px;border-radius:99px;background:var(--surface-2);overflow:hidden;border:1px solid var(--border)}
.cover-prog-bar span{display:block;height:100%;background:var(--accent)}
.cover-prog-lbl{font-size:12.5px;color:var(--text-muted)}
.cover-author{font-size:13px;color:var(--text-muted)}
.cover-h2{font-size:1.45rem;margin:.4rem 0 .15rem}
.cover-glance-sub{margin:0 0 1.3rem;font-size:.95rem}
.cover-mods{display:grid;grid-template-columns:repeat(auto-fit,minmax(225px,1fr));gap:1rem}
.cover-mod{background:var(--surface-1);border:1px solid var(--border);border-radius:14px;padding:1rem 1rem .7rem}
.cover-mod-h{font-size:11.5px;text-transform:uppercase;letter-spacing:.05em;color:var(--accent);font-weight:700;margin-bottom:.55rem}
.cover-wk{display:flex;align-items:center;gap:.6rem;padding:.42rem .35rem;border-radius:9px;text-decoration:none;color:var(--text-primary);font-size:13.5px;line-height:1.3}
.cover-wk:hover{background:var(--surface-2)}
.cover-wk-n{width:23px;height:23px;border-radius:50%;background:var(--surface-2);border:1px solid var(--border);display:inline-flex;align-items:center;justify-content:center;font-size:12px;color:var(--text-secondary);flex-shrink:0;font-weight:600}
.cover-wk.done .cover-wk-n{background:var(--c-lift);border-color:var(--c-lift);color:#fff}
.cover-wk-t{flex:1}
@media(max-width:760px){.cover-hero{grid-template-columns:1fr;gap:1.2rem}.cover-hero-art{order:-1;max-width:360px}.cover-title{font-size:2.2rem}}
.nav-home{margin-bottom:.4rem;border-bottom:1px solid var(--border);border-radius:0;padding-bottom:.7rem}
.nav-home .nav-num{background:var(--accent-bg);color:var(--accent-text)}
