/* 熟記本 — notebook paper + highlighter. Ink blue for actions, marker yellow for what you're learning.
   Layout: phone = bottom tab bar; ≥900px = left rail + content column. */
:root{
  --bg:#EEF1F5; --surface:#FFFFFF; --surface2:#F5F7FA; --sunken:#E6EAF0;
  --ink:#152238; --muted:#5B677A; --faint:#8A95A6; --line:#D9DFE7;
  --accent:#2448A8; --accent-ink:#FFFFFF; --accent-soft:#E4EAF8; --accent-2:#3A62D0;
  --mark:#FFE45C; --mark-soft:#FFF5C2;
  --good:#1C8556; --good-soft:#DFF2E8; --bad:#C23E2C; --bad-soft:#FBE6E2; --warn:#A66A12; --warn-soft:#FBEFD9;
  --b0:#C9D1DC; --b1:#F2C14E; --b2:#E9A23B; --b3:#7FB685; --b4:#3E9B6A; --b5:#1C8556;
  --f-display:"Bricolage Grotesque","Noto Sans TC",system-ui,sans-serif;
  --f-body:"Noto Sans TC",system-ui,-apple-system,"PingFang TC",sans-serif;
  --f-mono:"JetBrains Mono",ui-monospace,Menlo,monospace;
  --r:14px; --r-sm:10px;
  --shadow:0 1px 2px rgba(21,34,56,.05),0 6px 20px rgba(21,34,56,.06);
  --shadow-lg:0 10px 40px rgba(21,34,56,.14);
  --tabbar:64px;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bg:#0D131B; --surface:#151E2A; --surface2:#1A2532; --sunken:#0F1720;
  --ink:#E5EBF3; --muted:#97A3B5; --faint:#6E7A8C; --line:#263244;
  --accent:#8AA8FF; --accent-ink:#0D1626; --accent-soft:#1D2A45; --accent-2:#A9BFFF;
  --mark:#7A6A12; --mark-soft:#3A3410;
  --good:#4CC28A; --good-soft:#14302A; --bad:#FF8270; --bad-soft:#3A1E1B; --warn:#E3A84A; --warn-soft:#352816;
  --b0:#334155; --b1:#B8932F; --b2:#C47E2A; --b3:#5E9B66; --b4:#3FA371; --b5:#4CC28A;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 6px 20px rgba(0,0,0,.25); --shadow-lg:0 10px 40px rgba(0,0,0,.5); color-scheme:dark }}
:root[data-theme="dark"]{
  --bg:#0D131B; --surface:#151E2A; --surface2:#1A2532; --sunken:#0F1720;
  --ink:#E5EBF3; --muted:#97A3B5; --faint:#6E7A8C; --line:#263244;
  --accent:#8AA8FF; --accent-ink:#0D1626; --accent-soft:#1D2A45; --accent-2:#A9BFFF;
  --mark:#7A6A12; --mark-soft:#3A3410;
  --good:#4CC28A; --good-soft:#14302A; --bad:#FF8270; --bad-soft:#3A1E1B; --warn:#E3A84A; --warn-soft:#352816;
  --b0:#334155; --b1:#B8932F; --b2:#C47E2A; --b3:#5E9B66; --b4:#3FA371; --b5:#4CC28A;
  --shadow:0 1px 2px rgba(0,0,0,.3),0 6px 20px rgba(0,0,0,.25); --shadow-lg:0 10px 40px rgba(0,0,0,.5); color-scheme:dark }

*{box-sizing:border-box}
html,body{margin:0}
body{background:var(--bg);color:var(--ink);font-family:var(--f-body);font-size:15px;line-height:1.6;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}
button,input,select,textarea{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
h1,h2,h3{font-family:var(--f-display);line-height:1.25;margin:0;text-wrap:balance;letter-spacing:-.01em}
h1{font-size:1.65rem} h2{font-size:1.22rem} h3{font-size:1rem}
p{margin:0}
[hidden]{display:none!important}
.mono{font-family:var(--f-mono);font-variant-numeric:tabular-nums}
.muted{color:var(--muted)} .faint{color:var(--faint)} .small{font-size:.86rem} .tiny{font-size:.76rem}
.mk{background:linear-gradient(transparent 58%,var(--mark) 58%);padding:0 .1em;border-radius:2px}
svg.i{width:20px;height:20px;flex:none;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
svg.i.sm{width:16px;height:16px}

/* ── shell ───────────────────────────── */
.shell{min-height:100vh;display:flex}
.rail{display:none}
.main{flex:1;min-width:0;padding-top:env(safe-area-inset-top,0px);padding-bottom:calc(var(--tabbar) + env(safe-area-inset-bottom,0px) + 24px)}
.page{max-width:880px;margin:0 auto;padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px));padding-block:18px 8px;display:flex;flex-direction:column;gap:22px}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:12px}
.topbar .who{display:flex;flex-direction:column;gap:2px;min-width:0}
.topbar .date{font-size:.8rem;color:var(--muted)}
.brandmark{display:flex;align-items:center;gap:9px;font-family:var(--f-display);font-weight:700;font-size:1.15rem}
.logo{width:30px;height:30px;border-radius:9px;background:var(--accent);display:grid;place-items:center;color:var(--accent-ink);flex:none;position:relative;overflow:hidden}

.logo span{position:relative;z-index:1;font-family:var(--f-body);font-weight:700;font-size:.95rem;color:var(--mark)}

.tabbar{position:fixed;left:0;right:0;bottom:0;z-index:40;background:color-mix(in srgb,var(--surface) 92%,transparent);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border-top:1px solid var(--line);display:grid;grid-template-columns:repeat(5,1fr);padding:6px max(8px,env(safe-area-inset-right,0px)) calc(6px + env(safe-area-inset-bottom,0px)) max(8px,env(safe-area-inset-left,0px))}
.tab{border:0;background:none;display:flex;flex-direction:column;align-items:center;gap:2px;padding:6px 0;color:var(--faint);font-size:.7rem;font-weight:500;cursor:pointer;position:relative;border-radius:10px}
.tab svg.i{width:22px;height:22px}
.tab[aria-current="page"]{color:var(--accent)}
.tab .dot{position:absolute;top:2px;left:calc(50% + 6px);min-width:17px;height:17px;padding:0 5px;border-radius:99px;background:var(--bad);color:#fff;font-size:.66rem;font-family:var(--f-mono);display:grid;place-items:center;line-height:1}
.tab.add-tab .plus{width:42px;height:42px;border-radius:14px;background:var(--accent);color:var(--accent-ink);display:grid;place-items:center;margin-top:-14px;box-shadow:0 6px 16px color-mix(in srgb,var(--accent) 40%,transparent)}
.tab.add-tab .plus svg.i{width:22px;height:22px}

@media (min-width:900px){
  .rail{display:flex;flex-direction:column;gap:6px;width:228px;flex:none;position:sticky;top:0;height:100vh;padding:22px 14px;border-right:1px solid var(--line);background:var(--surface)}
  .rail .brandmark{padding:4px 10px 18px}
  .rail .tab{flex-direction:row;justify-content:flex-start;gap:12px;font-size:.95rem;padding:10px 12px;color:var(--muted)}
  .rail .tab:hover{background:var(--surface2);color:var(--ink)}
  .rail .tab[aria-current="page"]{background:var(--accent-soft);color:var(--accent)}
  .rail .tab .dot{position:static;margin-left:auto}
  .rail .plan{margin-top:auto}
  .tabbar{display:none}
  .topbar .brandmark{display:none}
  .main{padding-bottom:40px}
  .page{padding-block:30px 20px}
}

/* ── generic ─────────────────────────── */
.sec{display:flex;flex-direction:column;gap:12px}
.sec-h{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:18px}
.card.flat{box-shadow:none}
.card.raised{box-shadow:var(--shadow);border-color:transparent}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:16px}
@media (max-width:720px){.grid2{grid-template-columns:1fr}}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid var(--line);background:var(--surface);padding:10px 16px;border-radius:12px;cursor:pointer;font-weight:500;line-height:1.3;transition:transform .08s ease,background .15s}
.btn:active{transform:scale(.98)}
.btn:hover{border-color:var(--faint)}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.btn.primary:hover{background:var(--accent-2);border-color:var(--accent-2)}
.btn.mark{background:var(--mark);border-color:var(--mark);color:#2A2400}
.btn.danger{color:var(--bad);border-color:var(--bad-soft);background:var(--bad-soft)}
.btn.ghost{border-color:transparent;background:none;color:var(--muted)}
.btn.ghost:hover{color:var(--ink);background:var(--surface2)}
.btn.sm{padding:6px 11px;font-size:.85rem;border-radius:9px}
.btn.lg{padding:13px 22px;font-size:1.02rem;border-radius:14px}
.btn.block{width:100%}
.btn:disabled{opacity:.45;cursor:not-allowed;transform:none}
.btns{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.iconbtn{border:0;background:none;padding:7px;border-radius:9px;cursor:pointer;color:var(--muted);display:inline-flex;align-items:center;justify-content:center}
.iconbtn:hover{background:var(--surface2);color:var(--accent)}
label.f{display:flex;flex-direction:column;gap:6px;font-size:.86rem;font-weight:500;min-width:0;color:var(--muted)}
input[type=text],input[type=search],input[type=email],select,textarea{background:var(--surface);border:1px solid var(--line);border-radius:11px;padding:10px 12px;width:100%;min-width:0;color:var(--ink)}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
textarea{resize:vertical;line-height:1.6}
.frow{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px}
.chips{display:flex;gap:8px;overflow-x:auto;padding-bottom:2px;scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.chips.wrap{flex-wrap:wrap;overflow:visible}
.chip{border:1px solid var(--line);background:var(--surface);border-radius:99px;padding:5px 13px;font-size:.86rem;cursor:pointer;display:inline-flex;gap:6px;align-items:center;white-space:nowrap;flex:none}
.chip .n{font-family:var(--f-mono);font-size:.74rem;color:var(--faint)}
.chip[aria-pressed="true"]{background:var(--ink);color:var(--surface);border-color:var(--ink)}
.chip[aria-pressed="true"] .n{color:inherit;opacity:.7}
.pill{display:inline-flex;align-items:center;gap:4px;font-size:.72rem;font-weight:500;padding:2px 8px;border-radius:99px;white-space:nowrap;line-height:1.5}
.p-new{background:var(--accent-soft);color:var(--accent)}
.p-learn{background:var(--warn-soft);color:var(--warn)}
.p-master{background:var(--good-soft);color:var(--good)}
.p-due{background:var(--bad-soft);color:var(--bad)}
.p-plain{background:var(--surface2);color:var(--muted);border:1px solid var(--line)}
.p-pro{background:var(--mark);color:#2A2400;font-weight:700}
.dots{display:inline-flex;gap:3px;align-items:center}
.dots i{width:7px;height:7px;border-radius:50%;background:var(--line)}
.dots i.on{background:var(--good)}
.list{display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);overflow:hidden}
.row{display:flex;gap:12px;align-items:center;padding:13px 16px;border-bottom:1px solid var(--line);min-width:0}
.row:last-child{border-bottom:0}
.row.click{cursor:pointer}
.row.click:hover{background:var(--surface2)}
.row .grow{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.row .t{font-weight:700;overflow-wrap:anywhere}
.row .s{font-size:.86rem;color:var(--muted);overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.row .end{display:flex;flex-direction:column;align-items:flex-end;gap:6px;flex:none}
.empty{display:flex;flex-direction:column;gap:12px;align-items:flex-start;padding:24px;border:1.5px dashed var(--line);border-radius:var(--r);background:var(--surface)}
.status{display:flex;gap:10px;align-items:center;color:var(--muted);font-size:.9rem}
.spin{width:16px;height:16px;border:2px solid var(--line);border-top-color:var(--accent);border-radius:50%;animation:sp .8s linear infinite;flex:none}
@keyframes sp{to{transform:rotate(360deg)}}
.prog{height:8px;border-radius:99px;background:var(--sunken);overflow:hidden;display:flex;width:100%}
.prog i{display:block;height:100%}
.legend{display:flex;gap:12px;font-size:.76rem;color:var(--muted);flex-wrap:wrap}
.legend span{display:inline-flex;align-items:center;gap:5px}
.legend i{display:inline-block;width:9px;height:9px;border-radius:3px}
.note{font-size:.8rem;padding:2px 9px;border-radius:7px;background:var(--warn-soft);color:var(--warn);align-self:flex-start}
.divider{height:1px;background:var(--line);border:0;margin:0}

/* ── dashboard ───────────────────────── */
.hero{display:grid;grid-template-columns:auto 1fr;gap:20px;align-items:center;background:var(--surface);border-radius:20px;padding:20px;box-shadow:var(--shadow);position:relative;overflow:hidden}
.hero::before{content:"";position:absolute;right:-40px;top:-50px;width:200px;height:200px;border-radius:50%;background:var(--mark-soft);opacity:.7}
.hero > *{position:relative}
.ring{width:118px;height:118px;position:relative;flex:none}
.ring svg{width:100%;height:100%;transform:rotate(-90deg)}
.ring .c{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1.1}
.ring .c b{font-family:var(--f-display);font-size:1.9rem}
.ring .c span{font-size:.72rem;color:var(--muted)}
.hero .msg{display:flex;flex-direction:column;gap:10px;min-width:0}
.hero .msg h2{font-size:1.3rem}
@media (max-width:420px){.hero{grid-template-columns:1fr;justify-items:start}.ring{width:104px;height:104px}}
.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.kpi{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:12px 14px;display:flex;flex-direction:column;gap:2px}
.kpi b{font-family:var(--f-display);font-size:1.5rem;font-variant-numeric:tabular-nums;line-height:1.2}
.kpi span{font-size:.76rem;color:var(--muted)}
@media (max-width:560px){.kpis{grid-template-columns:repeat(2,1fr)}}
.ladder{display:flex;height:14px;border-radius:99px;overflow:hidden;background:var(--sunken)}
.ladder i{display:block;height:100%}
.bars{display:grid;grid-template-columns:repeat(14,1fr);gap:5px;align-items:end;height:96px}
.bars .b{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:4px;height:100%;min-width:0}
.bars .b i{display:block;width:100%;max-width:22px;border-radius:5px 5px 2px 2px;background:var(--accent);min-height:3px}
.bars .b i.z{background:var(--sunken)}
.bars .b.today i{background:var(--mark)}
.bars .b span{font-size:.62rem;color:var(--faint);font-family:var(--f-mono)}
.spot{display:flex;flex-direction:column;gap:10px}
.spot .w{font-family:var(--f-display);font-size:1.8rem;font-weight:700;line-height:1.2;display:flex;align-items:center;gap:8px;flex-wrap:wrap;overflow-wrap:anywhere}
.spot .reveal{border:1.5px dashed var(--line);border-radius:12px;padding:12px;cursor:pointer;color:var(--muted);text-align:left;background:var(--surface2)}
.tgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}
.topic{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:14px 16px;display:flex;flex-direction:column;gap:10px;cursor:pointer;text-align:left;transition:border-color .15s}
.topic:hover{border-color:var(--accent)}
.topic .tt{display:flex;justify-content:space-between;gap:8px;align-items:baseline}
.topic .tt b{overflow-wrap:anywhere}
.planbar{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:var(--r);background:var(--accent-soft);color:var(--ink)}
.planbar .grow{flex:1;min-width:0}

/* ── add ─────────────────────────────── */
.compose{background:var(--surface);border-radius:20px;box-shadow:var(--shadow);padding:18px;display:flex;flex-direction:column;gap:14px}
.compose textarea.big{border:0;padding:4px 2px;font-size:1.05rem;min-height:150px;background:transparent;box-shadow:none}
.compose textarea.big:focus{box-shadow:none}
.toolrow{display:flex;gap:8px;flex-wrap:wrap;align-items:center;border-top:1px solid var(--line);padding-top:12px}
.tool{border:1px solid var(--line);background:var(--surface2);border-radius:10px;padding:7px 12px;display:inline-flex;align-items:center;gap:7px;cursor:pointer;font-size:.88rem}
.tool[aria-pressed="true"]{border-color:var(--accent);background:var(--accent-soft);color:var(--accent)}
.thumb{display:flex;align-items:center;gap:10px;background:var(--surface2);border-radius:12px;padding:8px;border:1px solid var(--line)}
.thumb img{height:64px;border-radius:8px}
.examples{display:flex;flex-direction:column;gap:8px}
.ex-card{display:flex;gap:12px;align-items:flex-start;padding:12px 14px;border-radius:12px;background:var(--surface);border:1px solid var(--line);cursor:pointer;text-align:left;width:100%}
.ex-card:hover{border-color:var(--accent)}
.pv{display:flex;gap:12px;padding:14px 16px;border-bottom:1px solid var(--line);align-items:flex-start}
.pv:last-child{border-bottom:0}
.pv input[type=checkbox]{margin-top:5px;width:18px;height:18px;flex:none;accent-color:var(--accent)}
.pv .body{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px}
.pv .head{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.pv .term{font-size:1.08rem;font-weight:700}
.pv.off .body{opacity:.5}
.lock{display:flex;gap:12px;align-items:flex-start;padding:14px;border-radius:14px;background:var(--mark-soft);border:1px solid color-mix(in srgb,var(--mark) 60%,transparent)}

/* ── review ──────────────────────────── */
.qwrap{display:flex;flex-direction:column;gap:16px;max-width:640px;width:100%;margin:0 auto}
.qtop{display:flex;align-items:center;gap:12px}
.qtop .prog{height:7px}
.qcard{background:var(--surface);border-radius:20px;padding:22px;display:flex;flex-direction:column;gap:18px;box-shadow:var(--shadow)}
.qlabel{font-size:.78rem;color:var(--muted);letter-spacing:.03em;display:flex;gap:8px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.qprompt{font-family:var(--f-display);font-size:2rem;font-weight:700;line-height:1.25;overflow-wrap:anywhere;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.qprompt.text{font-family:var(--f-body);font-size:1.15rem;font-weight:500;line-height:1.65}
.qsub{color:var(--muted);font-size:.92rem}
.opts{display:flex;flex-direction:column;gap:10px}
.opt{display:flex;gap:12px;align-items:center;text-align:left;border:1.5px solid var(--line);background:var(--surface);border-radius:13px;padding:13px 14px;cursor:pointer;width:100%;transition:border-color .12s,background .12s}
.opt .k{font-family:var(--f-mono);font-size:.8rem;width:26px;height:26px;border-radius:8px;background:var(--surface2);display:grid;place-items:center;flex:none;color:var(--muted)}
.opt:hover:not(:disabled){border-color:var(--faint)}
.opt.sel{border-color:var(--accent);background:var(--accent-soft)}
.opt.sel .k{background:var(--accent);color:var(--accent-ink)}
.opt.right{border-color:var(--good);background:var(--good-soft)}
.opt.right .k{background:var(--good);color:#fff}
.opt.wrong{border-color:var(--bad);background:var(--bad-soft)}
.opt.wrong .k{background:var(--bad);color:#fff}
.opt:disabled{cursor:default}
.answer-in{font-size:1.2rem;padding:13px 14px;border-radius:13px}
.answer-in.right{border-color:var(--good);background:var(--good-soft)}
.answer-in.wrong{border-color:var(--bad);background:var(--bad-soft)}
.bank,.line{display:flex;flex-wrap:wrap;gap:8px;min-height:50px;padding:9px;border-radius:13px}
.line{border:1.5px dashed var(--line);background:var(--surface2)}
.tok{border:1px solid var(--line);background:var(--surface);border-radius:9px;padding:7px 12px;cursor:pointer;font-size:1rem}
.tok:hover{border-color:var(--accent)}
.fb{border-radius:16px;padding:16px 18px;display:flex;flex-direction:column;gap:10px}
.fb.ok{background:var(--good-soft)} .fb.no{background:var(--bad-soft)} .fb.neutral{background:var(--surface2)}
.fb .verdict{font-weight:700;display:flex;gap:8px;align-items:center}
.fb.ok .verdict{color:var(--good)} .fb.no .verdict{color:var(--bad)}
.info{display:flex;flex-direction:column;gap:9px}
.info .term{font-family:var(--f-display);font-size:1.35rem;font-weight:700;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.info .reading{font-family:var(--f-mono);font-size:.85rem;color:var(--muted);font-weight:400}
.info .ex{border-left:3px solid var(--mark);padding-left:12px;display:flex;flex-direction:column;gap:2px}
.info .tip{font-size:.9rem;display:flex;gap:7px;align-items:flex-start}
.info .lbl{font-size:.72rem;color:var(--muted);letter-spacing:.04em}
.qact{display:flex;gap:10px;justify-content:space-between;align-items:center;flex-wrap:wrap}
.kbd{font-family:var(--f-mono);font-size:.72rem;color:var(--faint)}
@media (max-width:560px){.kbd{display:none}}
.mode{display:flex;gap:12px;align-items:center;padding:14px 16px;border-bottom:1px solid var(--line);cursor:pointer}
.mode:last-child{border-bottom:0}
.mode input{accent-color:var(--accent);width:18px;height:18px;flex:none}
.mode .grow{flex:1;min-width:0;display:flex;flex-direction:column}
.sumhero{display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center;padding:12px 0}
.sumhero .big{font-family:var(--f-display);font-size:3rem;font-weight:700;line-height:1}

/* ── me ──────────────────────────────── */
.profile{display:flex;gap:14px;align-items:center}
.avatar{width:52px;height:52px;border-radius:16px;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center;font-weight:700;font-size:1.2rem;flex:none;overflow:hidden}
.avatar img{width:100%;height:100%;object-fit:cover}
.login-btns{display:flex;flex-direction:column;gap:10px}
.login-btns .btn{justify-content:center}
.quota{display:flex;flex-direction:column;gap:6px}
.quota .prog{height:6px}

/* ── modal / sheet ───────────────────── */
.ov{position:fixed;inset:0;background:rgba(9,14,22,.5);z-index:60;display:flex;align-items:flex-end;justify-content:center;overflow-y:auto;padding-top:max(40px,env(safe-area-inset-top,0px))}
.modal{background:var(--surface);border-radius:22px 22px 0 0;width:100%;max-width:640px;display:flex;flex-direction:column;box-shadow:var(--shadow-lg);max-height:calc(100% - 20px);animation:up .22s ease}
@keyframes up{from{transform:translateY(24px);opacity:.6}to{transform:none;opacity:1}}
@media (prefers-reduced-motion:reduce){.modal{animation:none}.spin{animation-duration:3s}}
@media (min-width:700px){.ov{align-items:center;padding:24px}.modal{border-radius:20px;max-height:calc(100vh - 48px)}}
.modal .mh{display:flex;align-items:center;gap:10px;padding:14px 18px;border-bottom:1px solid var(--line);flex:none}
.modal .mb{padding:18px;display:flex;flex-direction:column;gap:16px;overflow-y:auto}
.modal .mf{padding:14px 18px calc(14px + env(safe-area-inset-bottom,0px));border-top:1px solid var(--line);display:flex;gap:10px;flex-wrap:wrap;justify-content:space-between;flex:none}
.modal.sm{max-width:420px}
.tutor-out{white-space:pre-wrap;background:var(--surface2);border-radius:12px;padding:12px;font-size:.92rem}
.toast{position:fixed;left:50%;bottom:calc(var(--tabbar) + 18px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);background:var(--ink);color:var(--surface);padding:10px 16px;border-radius:12px;z-index:70;font-size:.9rem;max-width:calc(100% - 32px);box-shadow:var(--shadow-lg)}
@media (min-width:900px){.toast{bottom:28px}}
.plan-opt{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 16px;border:1.5px solid var(--line);border-radius:14px}
.plan-opt.best{border-color:var(--accent);background:var(--accent-soft)}
.plan-opt b{font-family:var(--f-display);font-size:1.3rem}
.feat{display:flex;flex-direction:column;gap:8px}
.feat div{display:flex;gap:9px;align-items:flex-start;font-size:.92rem}
.feat svg.i{color:var(--good)}
details summary{cursor:pointer;font-size:.88rem;font-weight:500;color:var(--muted)}
details[open] summary{margin-bottom:8px}
