/* Mission design (version B): deep space navy, lime accent, violet stations,
   Inter. Loaded last, so it restyles every screen without touching feature CSS. */
html[data-theme]{
 color-scheme:dark;
 --bg:#090a12;--white:rgba(18,20,42,.82);--ink:#f5f5f7;--muted:#8e93b0;--soft:#8e93b0;--line:rgba(255,255,255,.08);
 --navy:#1a1d38;--lime:#c9f26b;--green:#c9f26b;--lavender:#1a1d38;--surface-raised:#1a1d38;--surface-deep:#0c0d17;
 --positive-bg:rgba(201,242,107,.12);--positive-text:#d6f78f;--radius:20px;--font:'Inter',-apple-system,BlinkMacSystemFont,sans-serif;
 --m-bg:#090a12;--m-side:#0c0d17;--m-s1:#12142a;--m-s2:#1a1d38;--m-card:rgba(18,20,42,.82);--m-line:rgba(255,255,255,.07);--m-line-2:rgba(255,255,255,.12);
 --m-text:#f5f5f7;--m-muted:#8e93b0;--m-muted-2:#6a6f92;--m-accent:#c9f26b;--m-ink:#0a0b0d;--m-violet:#9d8cff;--m-sky:#7aa7ff;--m-coral:#ff8a7a;--m-amber:#ffb36b;
 --m-ease:cubic-bezier(.16,1,.3,1)
}
html[data-theme] body{background:radial-gradient(1000px 600px at 75% -10%,#1c1a48 0%,transparent 60%),var(--m-bg);background-attachment:fixed;color:var(--m-text);font-family:var(--font);font-feature-settings:"cv11","ss01";letter-spacing:-.011em;font-size:14px}
html[data-theme] .sky{display:none}
#stars{position:fixed;inset:0;z-index:0;pointer-events:none}
html[data-theme] #app,html[data-theme] .layout{position:relative;z-index:1}
html[data-theme] :focus-visible{outline:2px solid var(--m-accent);outline-offset:3px}
html[data-theme] ::selection{background:rgba(201,242,107,.3)}
html[data-theme] .theme-toggle{display:none}
html[data-theme] .skip-link{background:var(--m-accent);color:var(--m-ink);border-radius:10px;font-weight:600}

/* ---------- Typography ---------- */
html[data-theme] :is(h1,h2,h3,h4){letter-spacing:-.025em;color:var(--m-text)}
html[data-theme] :is(.eyebrow,.mission-label,.tip-label,.study-kicker,.nav-caption){color:var(--m-accent);font-size:12px;font-weight:600;letter-spacing:.04em}
html[data-theme] :is(p,small,.deck-meta,.deck-footer,.deck-description,.goal-caption,.storage-note,.field small,.footer-note){color:var(--m-muted)}
html[data-theme] .page-heading{align-items:flex-end;margin-bottom:24px}
html[data-theme] .page-heading h1{font-size:34px;font-weight:600;letter-spacing:-.035em;line-height:1.15}
html[data-theme] .page-heading p{font-size:15px;color:var(--m-muted);margin-top:6px}
html[data-theme] .page-heading .eyebrow{margin-bottom:6px}
html[data-theme] .heading-star{display:none}

/* ---------- Buttons & controls ---------- */
html[data-theme] .button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:40px;padding:0 18px;border-radius:99px;font-size:14px;font-weight:600;letter-spacing:-.01em;border:0;box-shadow:inset 0 0 0 1px var(--m-line-2);background:var(--m-s2);color:var(--m-text);transition:filter .15s,background .15s,transform .15s var(--m-ease);white-space:nowrap}
html[data-theme] .button:hover{background:#23274a}
html[data-theme] .button:active{transform:scale(.98)}
html[data-theme] .button.primary{background:var(--m-accent);color:var(--m-ink);box-shadow:none}
html[data-theme] .button.primary:hover{filter:brightness(1.07);background:var(--m-accent)}
html[data-theme] .button.primary .icon{color:var(--m-ink)}
html[data-theme] .button.ghost{background:transparent;box-shadow:none;color:var(--m-muted)}
html[data-theme] .button.ghost:hover{background:rgba(255,255,255,.05);color:var(--m-text)}
html[data-theme] .button.danger{background:rgba(255,138,122,.12);color:var(--m-coral);box-shadow:inset 0 0 0 1px rgba(255,138,122,.3)}
html[data-theme] .button:disabled{opacity:.4}
html[data-theme] :is(.text-link,.rail-title button,.reminder-link){color:var(--m-accent);font-weight:500;font-size:14px}
html[data-theme] .icon-button{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;color:var(--m-muted);background:rgba(255,255,255,.05);box-shadow:inset 0 0 0 1px var(--m-line)}
html[data-theme] .icon-button:hover{color:var(--m-text);background:rgba(255,255,255,.09)}
html[data-theme] :is(input,textarea,select){background:var(--m-s1)!important;color:var(--m-text)!important;border:1px solid var(--m-line-2)!important;border-radius:12px;font-family:var(--font)}
html[data-theme] :is(input,textarea,select)::placeholder{color:var(--m-muted-2)}
html[data-theme] :is(input,textarea,select):focus{outline:2px solid rgba(201,242,107,.45);border-color:var(--m-accent)!important}
html[data-theme] :is(input[type=checkbox],input[type=radio]){accent-color:var(--m-accent)}
html[data-theme] .field label,html[data-theme] .field>span{color:var(--m-text);font-weight:500}
html[data-theme] .tabs{gap:6px}
html[data-theme] .tab{min-height:34px;padding:0 14px;border-radius:99px;font-size:13px;font-weight:500;color:var(--m-muted);background:transparent;box-shadow:inset 0 0 0 1px var(--m-line)}
html[data-theme] .tab:hover{color:var(--m-text)}
html[data-theme] .tab.active{background:var(--m-text);color:var(--m-ink);box-shadow:none}
html[data-theme] .view-toggle{background:var(--m-s1);box-shadow:inset 0 0 0 1px var(--m-line);border:0;border-radius:12px}
html[data-theme] .view-toggle button{color:var(--m-muted);border-radius:9px}
html[data-theme] .view-toggle button.active{background:var(--m-s2);color:var(--m-text)}
html[data-theme] .search-input{background:var(--m-s1);border:0;box-shadow:inset 0 0 0 1px var(--m-line-2);border-radius:14px;color:var(--m-muted)}
html[data-theme] .search-input input{background:transparent!important;border:0!important;outline:0}
html[data-theme] .progress-track,html[data-theme] .deck-card .progress-track{background:rgba(255,255,255,.08);height:6px;border-radius:99px}
html[data-theme] .progress-track>span{background:var(--m-accent);border-radius:inherit}

/* ---------- Surfaces ---------- */
html[data-theme] :is(.deck-card,.rail-card,.stat-card,.chart-card,.mastery-card,.weekly-card,.galaxy-card,.badges-card,.review-panel,.explore-hero,.context-banner,.empty-state,.detail-card,.memory-progress,.skill-progress,.learning-tools,.add-deck-card,.save-notice,.m-card){background:var(--m-card);border:0;box-shadow:inset 0 0 0 1px var(--m-line);border-radius:20px;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);color:var(--m-text)}
html[data-theme] :is(.stat-card,.chart-card,.mastery-card,.weekly-card,.galaxy-card,.review-panel,.explore-hero,.context-banner){padding:24px}
html[data-theme] .explore-hero{background:radial-gradient(600px 260px at 85% 0%,rgba(157,140,255,.22),transparent 70%),var(--m-card)}
html[data-theme] .explore-hero h2{font-size:28px;font-weight:600;letter-spacing:-.035em}

/* ---------- Shell: sidebar & topbar ---------- */
html[data-theme] .sidebar{width:240px;background:rgba(12,13,23,.85);border-right:1px solid var(--m-line);padding:20px 14px;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
html[data-theme] .app-area{margin-left:240px}
html[data-theme] .brand{gap:10px;font-weight:600;font-size:15px;letter-spacing:-.02em;padding:4px 10px 26px;color:var(--m-text)}
html[data-theme] .brand .brand-mark{width:22px;height:22px;background:none;color:var(--m-accent);border-radius:0}
html[data-theme] .brand .brand-mark svg{width:22px;height:22px}
html[data-theme] .brand-dot{display:none}
html[data-theme] .nav-caption{display:none}
html[data-theme] .nav-items{gap:2px}
html[data-theme] .nav-link{padding:9px 10px;border-radius:10px;font-size:14px;font-weight:500;color:var(--m-muted);gap:12px}
html[data-theme] .nav-link .icon{width:18px;height:18px;stroke-width:1.6}
html[data-theme] .nav-link:hover{color:var(--m-text);background:rgba(255,255,255,.04)}
html[data-theme] .nav-link.active{color:var(--m-text);background:rgba(255,255,255,.07)}
html[data-theme] .nav-link .nav-dot{display:none}
html[data-theme] .nav-link .small-badge{background:rgba(255,255,255,.07);color:var(--m-muted);border-radius:99px;font-size:11px;padding:1px 8px}
html[data-theme] .sidebar-bottom{padding-top:24px}
html[data-theme] .side-astro{width:72px;margin:0 auto 6px}
html[data-theme] .level-card{padding:14px;border-radius:14px;background:var(--m-s1);border:0;box-shadow:inset 0 0 0 1px var(--m-line);font-size:13px}
html[data-theme] .level-card .level-top{display:flex;justify-content:space-between;align-items:baseline;gap:8px}
html[data-theme] .level-card .level-top strong{font-size:13px;color:var(--m-text)}
html[data-theme] .level-card .level-top span{font-size:13px;color:var(--m-muted)}
html[data-theme] .level-card .progress-track{height:4px;margin-top:10px}
html[data-theme] .level-card .level-meta{font-size:12px;color:var(--m-muted);margin-top:8px;display:block}
html[data-theme] .help-link{color:var(--m-muted);font-size:13px;border-radius:10px;padding:8px 10px}
html[data-theme] .help-link:hover{color:var(--m-text);background:rgba(255,255,255,.04)}
html[data-theme] .topbar{height:60px;padding:0 32px;background:rgba(9,10,18,.72);backdrop-filter:saturate(180%) blur(18px);-webkit-backdrop-filter:saturate(180%) blur(18px);border-bottom:1px solid var(--m-line)}
html[data-theme] .breadcrumb{color:var(--m-text);font-size:14px}
html[data-theme] .breadcrumb>.icon,html[data-theme] .breadcrumb>span{display:none}
html[data-theme] .breadcrumb strong{font-size:14px;font-weight:600;color:var(--m-text)}
html[data-theme] .mobile-menu{color:var(--m-text)}
html[data-theme] .top-stat{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 12px;border-radius:99px;font-size:13px;font-weight:500;background:var(--m-s1);box-shadow:inset 0 0 0 1px var(--m-line);color:var(--m-text)!important}
html[data-theme] .top-stat .icon{width:15px;height:15px}
html[data-theme] .top-stat.flame .icon{color:var(--m-amber)}
html[data-theme] .top-stat.xp .icon{color:var(--m-accent)}
html[data-theme] .separator{display:none}
html[data-theme] .avatar{width:32px;height:32px;border-radius:50%;border:0;background:linear-gradient(135deg,var(--m-violet),var(--m-sky));color:#fff;font-size:13px;font-weight:600;margin-left:6px}
html[data-theme] .content{max-width:1160px;margin:0 auto;padding:36px 32px 80px}
html[data-theme] .content>p:has(> [data-action="learning-lab"]){margin:0 0 18px}
html[data-theme] .footer-note{border-top:1px solid var(--m-line);color:var(--m-muted-2);font-size:12px}
html[data-theme] .footer-note .icon{color:var(--m-accent)}

/* ---------- Dashboard (mission map) ---------- */
.content .m-greet{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:24px}
.content .m-greet h1{font-size:34px;font-weight:600;letter-spacing:-.035em;line-height:1.15;margin:0}
.content .m-greet p{font-size:15px;color:var(--m-muted);margin:6px 0 0}
.content .m-greet .actions{display:flex;gap:10px;flex-wrap:wrap}
.content .m-orbit{position:relative;overflow:hidden;padding:30px 36px 6px}
.content .m-orbit .kick{font-size:12px;font-weight:600;color:var(--m-accent);letter-spacing:.04em;text-transform:uppercase}
.content .m-orbit h2{font-size:30px;font-weight:600;letter-spacing:-.035em;margin:6px 0 0;max-width:calc(100% - 220px)}
.content .m-orbit .sub{font-size:15px;color:var(--m-muted);margin:6px 0 0;max-width:calc(100% - 220px)}
.content .m-orbit .go{position:absolute;right:36px;top:32px;display:flex;flex-direction:column;align-items:center;gap:10px;z-index:3}
.content .m-orbit .go .button{min-height:50px;padding:0 28px;font-size:16px}
.content .m-orbit .go small{font-size:13px;color:var(--m-muted)}
.content .orbit-wrap{position:relative;height:250px;margin:14px -36px 0}
.content .orbit-wrap .traj{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
.content .orbit-wrap .done-path{stroke:var(--m-accent);stroke-width:2.5;fill:none;stroke-linecap:round}
.content .orbit-wrap .todo-path{stroke:rgba(255,255,255,.18);stroke-width:2;fill:none;stroke-dasharray:2 8;stroke-linecap:round}
.content .orbit-wrap .station{position:absolute;transform:translate(-50%,-50%);display:flex;flex-direction:column;align-items:center;padding:0;background:none;border:0;color:inherit;font:inherit;z-index:2}
.content .orbit-wrap button.station{cursor:pointer;border-radius:99px}
.content .orbit-wrap .station .dot{width:18px;height:18px;border-radius:50%;box-shadow:inset 0 0 0 2px rgba(255,255,255,.22);background:var(--m-bg);display:grid;place-items:center;transition:transform .2s var(--m-ease)}
.content .orbit-wrap button.station:hover .dot{transform:scale(1.2)}
.content .orbit-wrap .station.done .dot{background:var(--m-accent);box-shadow:none}
.content .orbit-wrap .station.done .dot svg{width:11px;height:11px;fill:none;stroke:var(--m-ink);stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.content .orbit-wrap .station.current .dot{width:26px;height:26px;background:var(--m-violet);box-shadow:0 0 0 6px rgba(157,140,255,.18),0 0 30px rgba(157,140,255,.6)}
.content .orbit-wrap .station.current .dot::after{content:"";position:absolute;width:26px;height:26px;border-radius:50%;border:2px solid rgba(157,140,255,.6);animation:m-halo 2.4s ease-out infinite}
@keyframes m-halo{from{transform:scale(1);opacity:1}to{transform:scale(2.4);opacity:0}}
.content .orbit-wrap .station .nm{position:absolute;top:calc(100% + 10px);font-size:12px;color:var(--m-muted-2);white-space:nowrap;font-weight:500;max-width:150px;overflow:hidden;text-overflow:ellipsis}
.content .orbit-wrap .station.done .nm{color:var(--m-muted)}
.content .orbit-wrap .station.current .nm{color:var(--m-text);font-weight:600}
.content .orbit-wrap .rider{position:absolute;width:92px;transform:translate(-50%,-112%);pointer-events:none;z-index:1}
.content .m-planet{position:absolute;right:7%;top:46%;width:64px;height:64px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#ffe1a8,#f2a65e 55%,#9c4f2f);box-shadow:0 0 40px rgba(242,166,94,.25);opacity:.85;pointer-events:none}
.content .m-planet::after{content:"";position:absolute;left:-35%;right:-35%;top:42%;height:18%;border-radius:50%;box-shadow:0 0 0 2px rgba(255,255,255,.35);transform:rotate(-16deg)}
.content .m-sat{position:absolute;left:10%;top:28%;width:54px;opacity:.8;animation:m-sat 18s linear infinite;pointer-events:none}
@keyframes m-sat{0%,100%{transform:translate(0,0) rotate(-10deg)}50%{transform:translate(40px,18px) rotate(10deg)}}
.content .m-empty-orbit{padding:40px 0 30px;color:var(--m-muted)}
.content .m-tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-top:16px}
.content .m-tile{padding:22px 24px;min-height:200px;display:flex;flex-direction:column;position:relative;overflow:hidden}
.content .m-tile .head{display:flex;justify-content:space-between;align-items:center;gap:10px}
.content .m-tile .lbl{font-size:12px;font-weight:600;color:var(--m-muted);letter-spacing:.04em;text-transform:uppercase}
.content .m-tile .head .icon{width:18px;height:18px}
.content .m-tile .head button{color:var(--m-accent);font-size:13px;font-weight:500;min-height:32px}
.content .m-tile .big{font-size:32px;font-weight:600;letter-spacing:-.035em;margin-top:14px;line-height:1.1}
.content .m-tile .big small{font-size:15px;color:var(--m-muted);font-weight:500;margin-left:4px;letter-spacing:-.01em}
.content .m-tile .note{font-size:13px;color:var(--m-muted);margin:auto 0 0;padding-top:14px;line-height:1.45;position:relative;z-index:1}
.content .m-tile .note button{color:var(--m-accent);font-weight:500}
.content .m-goalbar{height:8px;border-radius:99px;background:rgba(255,255,255,.07);margin-top:16px;overflow:hidden;max-width:calc(100% - 70px)}
.content .m-goalbar b{display:block;height:100%;background:var(--m-accent);border-radius:inherit;transition:width .9s var(--m-ease)}
.content .m-tile .peek{position:absolute;right:-6px;bottom:-18px;width:86px}
.content .m-days{display:grid;grid-template-columns:repeat(7,1fr);gap:6px;margin-top:14px}
.content .m-days div{text-align:center;font-size:11px;color:var(--m-muted-2)}
.content .m-days i{display:block;height:28px;border-radius:8px;background:rgba(255,255,255,.05);margin-bottom:6px;display:grid;place-items:center}
.content .m-days .done i{background:var(--m-accent)}
.content .m-days .frozen i{background:rgba(122,167,255,.3)}
.content .m-days .today{color:var(--m-text)}
.content .m-days .today:not(.done) i{box-shadow:inset 0 0 0 1.5px rgba(201,242,107,.6)}
.content .m-bars{display:flex;align-items:flex-end;gap:6px;height:64px;margin-top:14px}
.content .m-bars div{flex:1;display:flex;flex-direction:column;align-items:center;gap:6px;height:100%;justify-content:flex-end;font-size:11px;color:var(--m-muted-2)}
.content .m-bars i{width:100%;border-radius:5px;background:rgba(157,140,255,.35);min-height:3px}
.content .m-bars .tm i{background:var(--m-violet)}
.content .m-sec-head{display:flex;align-items:baseline;justify-content:space-between;margin:44px 0 16px;gap:12px}
.content .m-sec-head h2{font-size:20px;font-weight:600;letter-spacing:-.02em;margin:0}
.content .m-sec-head h2 small{font-size:14px;color:var(--m-muted-2);font-weight:500;margin-left:6px}

/* Astronaut */
.astro{overflow:visible;display:block;width:100%}
.astro .bodyg{animation:m-bob 4s ease-in-out infinite;transform-origin:80px 92px}
.astro .arm-r{transform-origin:108px 98px;animation:m-wave 3.4s ease-in-out infinite}
.astro .arm-l{transform-origin:52px 98px;transition:transform .25s}
.astro .eyes{transform-origin:80px 53px;animation:m-blink 5s infinite;transition:opacity .15s}
.astro .look{animation:m-look 9s ease-in-out infinite}
.astro .led{filter:drop-shadow(0 0 2.5px rgba(122,167,255,.95))}
.astro .eyes-happy,.astro .brows{opacity:0;transition:opacity .15s}
.astro .mouth{transform-origin:80px 65px;transition:transform .2s}
.astro .shine{animation:m-shine 6.5s ease-in-out infinite}
.astro .beacon{animation:m-beacon 1.6s ease-in-out infinite}
.astro .jet{opacity:0;transform-origin:80px 161px;transition:opacity .2s}
.astro.calm .arm-r{animation:none}
.astro.float .bodyg{animation:m-floaty 7s ease-in-out infinite}
.astro.happy .eyes{opacity:0}
.astro.happy .eyes-happy{opacity:1}
.astro.happy .mouth{transform:scale(1.3)}
.astro.happy .look,.astro.sad .look{animation:none}
.astro.happy .bodyg{animation:m-hop .7s cubic-bezier(.3,1.5,.5,1)}
.astro.happy .arm-l{transform:rotate(42deg)}
.astro.happy .arm-r{animation:none;transform:rotate(-42deg)}
.astro.sad .eyes{animation:none;transform:translateY(2.5px) scaleY(.55)}
.astro.sad .brows{opacity:1}
.astro.sad .mouth{transform:scaleY(-1)}
.astro.sad .arm-r{animation:none}
.astro.sad .bodyg{animation:m-tilt .6s ease-in-out}
.astro.boost .jet{opacity:1;animation:m-jet .12s linear infinite alternate}
@keyframes m-look{0%,36%,100%{transform:translateX(0)}40%,50%{transform:translateX(-3.5px)}56%,66%{transform:translateX(3.5px)}70%{transform:translateX(0)}}
@keyframes m-shine{0%,78%{transform:translateX(0);opacity:0}80%{opacity:1}92%{transform:translateX(95px);opacity:1}94%,100%{transform:translateX(95px);opacity:0}}
@keyframes m-tilt{0%,100%{transform:rotate(0)}25%{transform:rotate(-6deg)}55%{transform:rotate(5deg)}80%{transform:rotate(-2deg)}}
@keyframes m-jet{from{transform:scaleY(1)}to{transform:scaleY(.7)}}
@keyframes m-bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-6px)}}
@keyframes m-floaty{0%,100%{transform:translate(0,0) rotate(-6deg)}50%{transform:translate(4px,-8px) rotate(6deg)}}
@keyframes m-wave{0%,60%,100%{transform:rotate(0)}70%{transform:rotate(-34deg)}80%{transform:rotate(-10deg)}90%{transform:rotate(-34deg)}}
@keyframes m-blink{0%,95%,100%{transform:scaleY(1)}97.5%{transform:scaleY(.1)}}
@keyframes m-beacon{0%,100%{opacity:1}50%{opacity:.3}}
@keyframes m-hop{0%,100%{transform:translateY(0)}45%{transform:translateY(-16px)}}

/* ---------- Decks ---------- */
html[data-theme] .deck-card{overflow:hidden;text-align:left;transition:transform .2s var(--m-ease),box-shadow .2s}
html[data-theme] .deck-card:hover{transform:translateY(-3px);box-shadow:inset 0 0 0 1px var(--m-line-2),0 20px 40px -24px rgba(157,140,255,.45)}
html[data-theme] .deck-card .deck-art{background:radial-gradient(260px 120px at 70% 0%,rgba(157,140,255,.25),transparent 70%),var(--m-s1);border-bottom:1px solid var(--m-line)}
html[data-theme] .deck-card h3{font-size:16px;font-weight:600;color:var(--m-text)}
html[data-theme] .deck-lang{background:rgba(9,10,18,.7);color:var(--m-text);border:0;box-shadow:inset 0 0 0 1px var(--m-line-2);border-radius:99px;font-weight:600}
html[data-theme] .deck-footer{border-top:1px solid var(--m-line);color:var(--m-muted)}
html[data-theme] .deck-footer .icon{color:var(--m-accent)}
html[data-theme] .add-deck-card{border:1.5px dashed var(--m-line-2);box-shadow:none;background:transparent;color:var(--m-muted)}
html[data-theme] .add-deck-card:hover{border-color:var(--m-accent);color:var(--m-text)}
html[data-theme] .add-deck-card span{background:var(--m-s2);color:var(--m-accent)}
html[data-theme] .section-heading h2{font-size:20px;font-weight:600}
html[data-theme] .section-heading h2 small{color:var(--m-muted-2)}
html[data-theme] .empty-state .icon{color:var(--m-violet)}

/* ---------- Stats ---------- */
html[data-theme] .stat-card strong{font-size:30px;font-weight:600;letter-spacing:-.035em;color:var(--m-text)}
html[data-theme] .stat-card .icon{color:var(--m-accent);background:rgba(201,242,107,.1);border-radius:10px}
html[data-theme] .chart-bar{background:rgba(157,140,255,.4);border-radius:6px 6px 3px 3px}
html[data-theme] .chart-col.today .chart-bar{background:var(--m-violet)}
html[data-theme] .chart-col span,html[data-theme] .chart-col strong{color:var(--m-muted)}
html[data-theme] .weekly-metric{background:var(--m-s1);border:0;box-shadow:inset 0 0 0 1px var(--m-line);border-radius:14px}
html[data-theme] .weekly-metric strong{color:var(--m-text)}
html[data-theme] .weekly-change{background:rgba(255,255,255,.06);color:var(--m-muted);border-radius:99px}
html[data-theme] .weekly-change.up{background:rgba(201,242,107,.12);color:var(--m-accent)}
html[data-theme] .weekly-change.down{background:rgba(255,138,122,.12);color:var(--m-coral)}
html[data-theme] .galaxy-count{background:rgba(201,242,107,.1);color:var(--m-accent);border-radius:99px}
html[data-theme] .galaxy-route line{stroke:rgba(255,255,255,.18);stroke-dasharray:2 8}
html[data-theme] .planet-progress{stroke:var(--m-accent)}
html[data-theme] .mastery-item{border-color:var(--m-line)}

/* ---------- Review panel (used outside dashboard too) ---------- */
html[data-theme] .review-count strong{color:var(--m-accent)}
html[data-theme] .review-today,html[data-theme] .review-new{color:var(--m-muted)}

/* ---------- Modals ---------- */
html[data-theme] .modal-backdrop{background:rgba(5,6,12,.72);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}
html[data-theme] .modal{background:#0f1022;border:0;box-shadow:inset 0 0 0 1px var(--m-line-2),0 40px 120px -30px rgba(0,0,0,.9);border-radius:24px;color:var(--m-text)}
html[data-theme] .modal-header{border-bottom:1px solid var(--m-line);background:transparent}
html[data-theme] .modal-header h2{font-size:20px;font-weight:600;letter-spacing:-.025em}
html[data-theme] .modal-header p{color:var(--m-muted)}
html[data-theme] .modal-footer{background:transparent;border-top:1px solid var(--m-line)}
html[data-theme] .modal-body{color:var(--m-text)}
html[data-theme] .detail-hero{background:radial-gradient(600px 220px at 80% 0%,rgba(157,140,255,.22),transparent 70%),var(--m-s1);border:0;box-shadow:inset 0 0 0 1px var(--m-line);border-radius:18px}
html[data-theme] :is(.goal-option,.color-choice,.card-editor,.card-preview,.help-content details,.confirm-body){background:var(--m-s1);border-color:var(--m-line-2);color:var(--m-text)}
html[data-theme] .goal-option.selected,html[data-theme] .goal-option:has(input:checked){box-shadow:inset 0 0 0 1.5px var(--m-accent);border-color:var(--m-accent)}

/* ---------- Study session (full screen, as in version B) ---------- */
html[data-theme] .modal-backdrop:has(> .m-session){padding:0;background:var(--m-bg);backdrop-filter:none}
html[data-theme] .modal.study-modal.m-session{position:fixed;inset:0;width:100%;max-width:none;height:100dvh;max-height:none;margin:0;border-radius:0;box-shadow:none;display:grid;grid-template-rows:auto 1fr;overflow:hidden;background:radial-gradient(1000px 600px at 75% -10%,#1c1a48 0%,transparent 60%),var(--m-bg)}
.m-session .m-s-top{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:20px;padding:16px 28px;border:0;background:transparent}
.m-session .m-s-where .flight-eyebrow{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:500;color:var(--m-muted);letter-spacing:0}
.m-session .m-s-where h2{font-size:14px;font-weight:600;margin:2px 0 0;letter-spacing:-.01em}
.m-session .m-s-segs{display:flex;gap:4px;width:min(420px,46vw)}
.m-session .m-s-segs i{flex:1;height:4px;border-radius:4px;background:rgba(255,255,255,.08);transition:background .3s}
.m-session .m-s-segs i.ok{background:var(--m-accent)}
.m-session .m-s-segs i.bad{background:var(--m-coral)}
.m-session .m-s-segs i.cur{background:rgba(255,255,255,.35)}
.m-session .m-s-end{justify-self:end;display:flex;align-items:center;gap:8px}
.m-session .flight-session-xp{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 12px;border-radius:99px;background:var(--m-s1);box-shadow:inset 0 0 0 1px var(--m-line);font-size:13px;font-weight:500;color:var(--m-text)}
.m-session .flight-session-xp .icon{width:15px;height:15px;color:var(--m-accent)}
.m-session .icon-button{background:transparent;box-shadow:none;width:36px;height:36px}
.m-session .m-s-form{display:flex;flex-direction:column;min-height:0;height:100%;overflow:hidden}
html[data-theme] .m-session .m-stage{flex:1 1 auto;min-height:0;height:auto;overflow:auto;padding:28px 28px 40px;display:grid;justify-items:center;align-content:start;background:none!important}
.m-session .m-q{width:min(860px,100%);display:grid;grid-template-columns:150px 1fr;gap:28px;align-items:start;margin-top:4vh}
.m-session .m-buddy{padding-top:10px;position:sticky;top:0}
.m-session .m-q-main{min-width:0}
html[data-theme] .m-session .study-polish{padding:0;margin:0;background:none!important;border:0;box-shadow:none}
.m-session .study-polish h3{display:none}
.m-session .study-polish>p{font-size:17px;font-weight:400;color:var(--m-muted);letter-spacing:-.01em;line-height:1.5}
.m-session .study-polish.missing>p{font-size:15px;color:var(--m-amber)}
.m-session .study-polish-missing>span{font-size:13px;color:var(--m-muted)}
.m-session .study-polish .text-link{font-size:14px}
html[data-theme] .m-session .m-en{position:relative;display:block;min-height:0;background:none!important;border:0;box-shadow:none;padding:0;margin-top:14px;text-align:left}
html[data-theme] .m-session .m-en::before,html[data-theme] .m-session .m-en::after{display:none}
.m-session .m-en>div{font-size:clamp(28px,3.8vw,42px);font-weight:600;letter-spacing:-.035em;line-height:1.3;color:var(--m-text);overflow-wrap:anywhere}
.m-session .m-en .blank{display:inline-block;min-width:3.4em;padding:0 .2em;margin:0 .08em;background:none;border:0;border-bottom:3px solid var(--m-line-2);border-radius:0;color:var(--m-muted-2);text-align:center;letter-spacing:-.035em;font-size:inherit;transition:color .2s,border-color .2s}
.m-session .m-en .blank.draft{color:var(--m-text);border-color:var(--m-text)}
.m-session .m-en .blank.correct{color:var(--m-accent);border-color:var(--m-accent)}
.m-session .m-en .blank:is(.incorrect,.revealed){color:var(--m-coral);border-color:var(--m-coral)}
.m-session .speak-controls{position:static;display:flex;gap:6px;margin-bottom:12px}
.m-session .speak-button{background:var(--m-s1);border:0;box-shadow:inset 0 0 0 1px var(--m-line-2);color:var(--m-text);font-size:13px;font-weight:500;padding:8px 14px}
.m-session .speak-button:hover{background:var(--m-s2)}
.m-session .study-gap-instruction{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--m-muted-2);margin:18px 0 0}
.m-session .study-gap-instruction .icon{width:15px;height:15px}
.m-session .speech-status{font-size:13px;color:var(--m-muted);margin:12px 0 0}
.m-session .flight-answer{margin-top:26px}
.m-session .flight-answer-label{display:flex;justify-content:space-between;gap:12px;font-size:13px;color:var(--m-muted);margin-bottom:10px}
.m-session .flight-answer-label label,.m-session .flight-answer-label>span:first-child{color:var(--m-text);font-weight:500}
.m-session .flight-input-wrap{display:flex;align-items:center;gap:12px;padding:0 16px;border-radius:14px;background:var(--m-s1);box-shadow:inset 0 0 0 1px var(--m-line-2);color:var(--m-muted)}
.m-session .flight-input-wrap:focus-within{box-shadow:inset 0 0 0 1.5px var(--m-text)}
.m-session .flight-input-wrap input{flex:1;min-width:0;height:58px;background:transparent!important;border:0!important;outline:0!important;font-size:19px!important;font-weight:500}
.m-session .flight-input-wrap kbd{font:500 11px var(--font);padding:4px 7px;border-radius:6px;background:rgba(255,255,255,.06);box-shadow:inset 0 0 0 1px var(--m-line-2);color:var(--m-muted);display:inline-flex;align-items:center;gap:4px}
.m-session .flight-input-wrap kbd .icon{width:12px;height:12px}
.m-session .flight-input-help{font-size:13px;color:var(--m-muted-2);margin:8px 0 0}
.m-session .flight-input-help.input-error{color:var(--m-coral)}
.m-session .choice-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.m-session .choice-option{display:flex;align-items:center;gap:14px;min-height:56px;padding:15px 18px;border:0;border-radius:14px;background:var(--m-s1);box-shadow:inset 0 0 0 1px var(--m-line);color:var(--m-text);font-size:17px;font-weight:500;transform:none}
.m-session .choice-option:hover{background:var(--m-s2);transform:none}
.m-session .choice-option:focus-visible{box-shadow:inset 0 0 0 1.5px var(--m-text);outline:0}
.m-session .choice-option kbd{width:26px;height:26px;border:0;border-radius:7px;box-shadow:inset 0 0 0 1px var(--m-line-2);font-size:12px;color:var(--m-muted);font-family:var(--font)}
.m-session .study-hints{margin-top:16px}
.m-session .study-hints p{font-size:15px;color:var(--m-text)}
.m-session .study-feedback{display:flex;align-items:flex-start;gap:12px;margin-top:22px;padding:12px 16px 12px 12px;border-radius:14px;background:var(--m-s1);border:0;box-shadow:inset 0 0 0 1px var(--m-line);color:var(--m-text);animation:m-rise .35s var(--m-ease)}
@keyframes m-rise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.m-session .study-feedback .feedback-icon{width:30px;height:30px;flex:none;border-radius:50%;display:grid;place-items:center;background:var(--m-coral);color:#1a0b08}
.m-session .study-feedback .feedback-icon .icon{width:16px;height:16px}
.m-session .study-feedback.correct .feedback-icon{background:var(--m-accent);color:var(--m-ink)}
.m-session .study-feedback.revealed .feedback-icon{background:var(--m-violet);color:var(--m-ink)}
.m-session .feedback-copy{flex:1;min-width:0}
.m-session .feedback-copy strong{display:block;font-size:15px;font-weight:600;line-height:1.5}
.m-session .feedback-copy p{font-size:14px;color:var(--m-muted);margin:4px 0 0;line-height:1.5}
.m-session .feedback-correction{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.m-session .feedback-correction b{color:var(--m-text);font-weight:600}
.m-session .feedback-explanation{font-size:13px!important}
.m-session .feedback-reward{align-self:center;font-size:13px;font-weight:600;color:var(--m-accent);white-space:nowrap}
.m-session :is(.learning-tools,.pronunciation-practice,.explain-section,.review-feedback,.association-card,.study-association){margin-top:16px;padding:16px 18px;border-radius:14px;background:var(--m-s1);border:0;box-shadow:inset 0 0 0 1px var(--m-line);color:var(--m-text)}
.m-session :is(.pronunciation-practice,.explain-section) h3{font-size:15px;font-weight:600}
html[data-theme] .m-session .m-s-bar{flex:none;border-radius:0;box-shadow:none;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 28px;border-top:1px solid var(--m-line);background:rgba(9,10,18,.8)!important;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
.m-session .m-s-left{display:flex;align-items:center;gap:18px;min-width:0}
.m-session .flight-keyboard-note{font-size:13px;color:var(--m-muted)}
.m-session .m-s-bar .button.primary{min-height:50px;padding:0 28px;font-size:16px}
.m-session .m-s-bar .button.primary kbd{font:500 11px var(--font);padding:3px 6px;border-radius:5px;background:rgba(0,0,0,.14)}
/* Session summary */
html[data-theme] .modal:has(.m-done){max-width:620px;text-align:center}
.m-done{position:relative;padding:36px 28px 28px}
.m-done-astro{width:150px;margin:0 auto}
.m-done h2{font-size:34px;font-weight:600;letter-spacing:-.04em;margin:18px 0 0}
.m-done>p{font-size:16px;color:var(--m-muted);margin:8px 0 0}
.m-sparks{position:absolute;left:50%;top:110px;width:0;height:0}
.m-sparks i{position:absolute;width:6px;height:6px;border-radius:50%;background:currentColor;box-shadow:0 0 10px currentColor;opacity:0;animation:m-spark 1.4s ease-out forwards}
@keyframes m-spark{0%{opacity:1;transform:translate(0,0) scale(1)}100%{opacity:0;transform:translate(var(--dx),var(--dy)) scale(.4)}}
.m-done .summary-stats{display:flex;justify-content:center;gap:40px;margin:28px 0 8px;background:none;border:0}
.m-done .summary-stats>div{background:none;border:0;box-shadow:none;padding:0}
.m-done .summary-stats strong{display:block;font-size:28px;font-weight:600;letter-spacing:-.03em;color:var(--m-text)}
.m-done .summary-stats small{font-size:13px;color:var(--m-muted)}
.m-done .summary-review{display:flex;gap:12px;align-items:flex-start;text-align:left;margin-top:20px;padding:14px 16px;border-radius:14px;background:var(--m-s1);box-shadow:inset 0 0 0 1px var(--m-line);border:0}
.m-done .summary-review .icon{color:var(--m-accent)}
.m-done .summary-actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;margin-top:22px}
@media (max-width:860px){
 .m-session .m-s-top{grid-template-columns:1fr auto;padding:12px 16px}
 .m-session .m-s-where{display:none}
 .m-session .m-s-segs{width:100%}
 .m-session .flight-session-xp{height:28px;padding:0 10px;font-size:12px}
 .m-session .m-stage{padding:18px 16px 28px}
 .m-session .m-q{grid-template-columns:1fr;gap:6px;text-align:center;margin-top:0}
 .m-session .m-buddy{width:90px;margin:0 auto;padding:0;position:static}
 .m-session .m-q-main{text-align:left}
 .m-session .choice-grid{grid-template-columns:1fr}
 .m-session .m-s-bar{padding:12px 16px;flex-wrap:wrap}
 .m-session .m-s-bar .button.primary{flex:1 0 100%}
 .m-session .flight-keyboard-note,.m-session kbd{display:none}
}

/* ---------- Toast & notices ---------- */
html[data-theme] #toast{background:var(--m-s2);color:var(--m-text);box-shadow:inset 0 0 0 1px var(--m-line-2),0 20px 40px -20px rgba(0,0,0,.8);border-radius:14px}
html[data-theme] .save-notice{padding:12px 16px;color:var(--m-amber)}

/* ---------- Auth ---------- */
html[data-theme] .auth-page{background:transparent}
html[data-theme] .auth-story{background:radial-gradient(800px 500px at 30% 0%,#1c1a48 0%,transparent 70%),rgba(12,13,23,.7);border-right:1px solid var(--m-line)}
html[data-theme] .auth-story .brand-mark{background:none;color:var(--m-accent)}
html[data-theme] :is(.auth-tabs,.auth-switch){background:var(--m-s1);box-shadow:inset 0 0 0 1px var(--m-line);border:0;border-radius:99px}
html[data-theme] :is(.auth-tabs,.auth-switch) button{border-radius:99px;color:var(--m-muted)}
html[data-theme] :is(.auth-tabs,.auth-switch) button:is(.active,[aria-pressed="true"],[aria-selected="true"]){background:var(--m-text);color:var(--m-ink)}

/* ---------- Responsive ---------- */
@media (max-width:1100px){
 .content .m-tiles{grid-template-columns:repeat(2,1fr)}
}
@media (max-width:900px){
 html[data-theme] .app-area{margin-left:0}
 html[data-theme] .content{padding:24px 18px 80px}
 html[data-theme] .topbar{padding:0 16px}
 .content .m-orbit{padding:24px 22px 6px}
 .content .m-orbit h2,.content .m-orbit .sub{max-width:none}
 .content .m-orbit .go{position:static;flex-direction:row;align-items:center;margin-top:16px;justify-content:space-between}
 .content .orbit-wrap{margin:0 -22px;height:220px}
 .content .orbit-wrap .rider{width:70px}
 .content .orbit-wrap .station .nm{display:none}
 .content .orbit-wrap .station.current .nm{display:block}
 .content .m-greet{flex-direction:column;align-items:flex-start}
}
@media (max-width:640px){
 .content .m-tiles{grid-template-columns:1fr}
 .content .content .m-greet h1,html[data-theme] .page-heading h1{font-size:28px}
 .content .m-orbit h2{font-size:24px}
 .content .m-sat{display:none}
 html[data-theme] .top-stat{padding:0 10px}
}
@media (prefers-reduced-motion:reduce){
 .astro *,.m-sat,.content .orbit-wrap .station.current .dot::after{animation:none!important}
}
/* Session fine-tuning over legacy study rules */
html[data-theme] .m-session .m-q-main,html[data-theme] .m-session .study-polish>p{text-align:left}
html[data-theme] .m-session .m-en .blank{background:none!important;box-shadow:none!important;border-radius:0!important}
html[data-theme] .m-session .study-hints{text-align:left}
html[data-theme] .m-session .study-hints .button{padding:0;min-height:32px;background:none;box-shadow:none;color:var(--m-muted);font-weight:500}
html[data-theme] .m-session .study-hints .button:hover{color:var(--m-text)}
html[data-theme] .m-session .flight-keyboard-note{color:var(--m-muted)!important;font-weight:400}
html[data-theme] .m-session .flight-answer-label>span:last-child{color:var(--m-muted-2);font-weight:400}
html[data-theme] .review-next{background:var(--m-s1)!important;border:0!important;box-shadow:inset 0 0 0 1px var(--m-line);border-radius:14px;color:var(--m-muted)}
html[data-theme] .review-next strong{color:var(--m-text);font-size:13px}
html[data-theme] .review-next>.icon{color:var(--m-accent)}
/* Auth illustration */
html[data-theme] .auth-story .brand{color:var(--m-text)}
.m-auth-art{position:relative;width:min(340px,80%);height:240px;margin:24px 0}
.m-auth-art .m-planet{position:absolute;right:0;bottom:10px;width:110px;height:110px;opacity:.9}
.m-auth-art .m-auth-astro{position:absolute;left:10%;top:0;width:150px}
html[data-theme] .auth-story :is(h1,h2) span{color:var(--m-accent)}
.m-auth-art .m-planet{border-radius:50%;background:radial-gradient(circle at 35% 30%,#ffe1a8,#f2a65e 55%,#9c4f2f);box-shadow:0 0 40px rgba(242,166,94,.25)}
.m-auth-art .m-planet::after{content:"";position:absolute;left:-35%;right:-35%;top:42%;height:18%;border-radius:50%;box-shadow:0 0 0 2px rgba(255,255,255,.35);transform:rotate(-16deg)}
.content .orbit-wrap .station.edge-l .nm{left:-6px}
.content .orbit-wrap .station.edge-r .nm{right:-6px}

/* XP crystals flying into the session counter */
.xp-fly{position:fixed;z-index:1300;pointer-events:none;font-size:16px;font-weight:700;color:var(--m-accent);text-shadow:0 0 14px rgba(201,242,107,.7);white-space:nowrap;transform:translate(-50%,0);transition:transform .8s cubic-bezier(.55,0,.8,.2),opacity .8s ease-in}
.xp-crystal{position:fixed;z-index:1300;width:8px;height:8px;margin:-4px 0 0 -4px;border-radius:2px;background:var(--m-accent);box-shadow:0 0 10px var(--m-accent);pointer-events:none;transform:rotate(45deg);transition:transform .7s cubic-bezier(.6,0,.4,1),opacity .7s}
.flight-session-xp.xp-bump{animation:m-xp-bump .4s cubic-bezier(.3,1.6,.5,1)}
@keyframes m-xp-bump{50%{transform:scale(1.2)}}
