/* Layout: iOS-style inset grouped list — translucent sticky bar with large title and segmented tabs, white rounded groups on a grey ground; Chinese characters sit in 田字格 practice cells */
:root{
  --bg:#F2F2F7; --surface:#FFFFFF; --ink:#000000; --muted:#6C6C70; --line:#E5E5EA; --fill:#EEEEF3;
  --bar:rgba(242,242,247,.84); --seg-on:#FFFFFF; --sw-off:#E5E5EA; --sw-on:#34C759; --on-accent:#FFFFFF;
  --jade:#007AFF; --jade-soft:#E6F0FF; --ok:#248A3D; --seal:#D70015; --seal-soft:#FFEBEC;
  --grid:#EFB3AE; --cell:#FFFFFF;
  /* tone colours: 1 red · 2 orange · 3 green · 4 blue · neutral grey */
  --t1:#D70015; --t2:#C93400; --t3:#248A3D; --t4:#0040DD; --t0:#8A8A8E;
  --f-han:"WenKai","Kaiti SC","STKaiti","KaiTi","Noto Serif SC",serif;
  --f-body:-apple-system,BlinkMacSystemFont,"SF Pro Text","Be Vietnam Pro",system-ui,"Segoe UI",sans-serif;
  --f-pin:-apple-system,BlinkMacSystemFont,"SF Pro Text","Noto Sans","Segoe UI",sans-serif;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --bg:#000000; --surface:#1C1C1E; --ink:#FFFFFF; --muted:#98989F; --line:#38383A; --fill:#2C2C2E;
  --bar:rgba(0,0,0,.74); --seg-on:#636366; --sw-off:#39393D; --sw-on:#30D158;
  --jade:#0A84FF; --jade-soft:#0B2A4C; --ok:#30D158; --seal:#FF453A; --seal-soft:#3A1614;
  --grid:#5E3633; --cell:#1C1C1E;
  --t1:#FF453A; --t2:#FF9F0A; --t3:#30D158; --t4:#4FA3FF; --t0:#8E8E93; color-scheme:dark }}
:root[data-theme="dark"]{
  --bg:#000000; --surface:#1C1C1E; --ink:#FFFFFF; --muted:#98989F; --line:#38383A; --fill:#2C2C2E;
  --bar:rgba(0,0,0,.74); --seg-on:#636366; --sw-off:#39393D; --sw-on:#30D158;
  --jade:#0A84FF; --jade-soft:#0B2A4C; --ok:#30D158; --seal:#FF453A; --seal-soft:#3A1614;
  --grid:#5E3633; --cell:#1C1C1E;
  --t1:#FF453A; --t2:#FF9F0A; --t3:#30D158; --t4:#4FA3FF; --t0:#8E8E93; color-scheme:dark }

*{box-sizing:border-box}
body{background:var(--bg);color:var(--ink);font-family:var(--f-body);font-size:16px;line-height:1.45;-webkit-font-smoothing:antialiased;
  padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px));padding-block:0 48px}
body::before{content:"";position:fixed;inset:0 0 auto;height:env(safe-area-inset-top,0px);z-index:10;background:var(--bg)}
.wrap{max-width:560px;margin:0 auto;display:flex;flex-direction:column;gap:16px}
button{font-family:inherit;-webkit-tap-highlight-color:transparent}
button:focus-visible,.row:focus-visible,.card:focus-visible,input:focus-visible{outline:2px solid var(--jade);outline-offset:2px}

/* nav bar */
header{position:sticky;top:env(safe-area-inset-top,0px);z-index:5;background:var(--bar);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);
  padding-block:14px 10px;display:flex;flex-direction:column;gap:10px}
.top{display:flex;align-items:flex-end;justify-content:space-between;gap:12px}
h1{font-size:30px;line-height:1.1;font-weight:700;margin:0;letter-spacing:-.02em;text-wrap:balance}
h1 span{font-family:var(--f-han);font-weight:400;color:var(--jade);margin-left:6px;font-size:26px}
.count{font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap;padding-bottom:3px}
.count b{color:var(--ink);font-size:17px;font-weight:600}
.bar{height:4px;border-radius:2px;background:var(--fill);overflow:hidden}
.bar i{display:block;height:100%;width:0;background:var(--jade);transition:width .3s}
.tabs,.seg{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;background:var(--fill);border-radius:9px;padding:2px}
.tabs button,.seg button{border:0;background:transparent;color:var(--ink);font-size:13px;font-weight:500;padding:6px 4px;border-radius:7px;cursor:pointer}
.tabs button[aria-selected="true"],.seg button[aria-pressed="true"]{background:var(--seg-on);font-weight:600;box-shadow:0 3px 8px rgba(0,0,0,.12),0 1px 1px rgba(0,0,0,.04)}
.seg{min-width:190px}
.chips{display:flex;gap:6px;overflow-x:auto;padding-bottom:2px;scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.chip{flex:none;border:0;background:var(--surface);color:var(--ink);font-size:14px;padding:6px 13px;border-radius:999px;cursor:pointer}
.chip[aria-pressed="true"]{background:var(--jade);color:var(--on-accent)}
.hrow{display:flex;justify-content:space-between;align-items:center;gap:10px}
.sync{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:6px;min-width:0}
.sync::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--muted);flex:none}
.sync.ok::before{background:var(--ok)}
.sync.off::before{background:var(--seal)}

/* iOS switch */
input[type=checkbox]{appearance:none;-webkit-appearance:none;width:44px;height:27px;border-radius:14px;background:var(--sw-off);position:relative;flex:none;cursor:pointer;margin:0;transition:background .2s}
input[type=checkbox]::before{content:"";position:absolute;top:2px;left:2px;width:23px;height:23px;border-radius:50%;background:#FFFFFF;box-shadow:0 2px 4px rgba(0,0,0,.2);transition:transform .2s}
input[type=checkbox]:checked{background:var(--sw-on)}
input[type=checkbox]:checked::before{transform:translateX(17px)}
.tgl{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted);cursor:pointer;white-space:nowrap}
.tgl input{transform:scale(.8);transform-origin:right center;margin-left:-6px}
.legend{display:flex;gap:2px;font-family:var(--f-pin);font-size:13px;font-weight:600}
.legend span{width:14px;text-align:center}
body.mono .legend{display:none}

/* grouped cells */
.view{display:flex;flex-direction:column;gap:14px}
.group{background:var(--surface);border-radius:12px;overflow:hidden}
.cell{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:46px;padding:8px 16px;position:relative;font-size:16px;cursor:pointer;width:100%;border:0;background:transparent;color:var(--ink);text-align:left}
.cell + .cell::before{content:"";position:absolute;left:16px;right:0;top:0;height:1px;background:var(--line);transform:scaleY(.6);transform-origin:top}
.cell.link{color:var(--jade)}
.sh{font-size:13px;color:var(--muted);text-transform:uppercase;letter-spacing:.02em;padding:0 16px 6px}
.sf{font-size:13px;color:var(--muted);padding:6px 16px 0;margin:0}

.panel{background:var(--surface);border-radius:14px;padding:16px;display:flex;flex-direction:column;gap:12px}
.panel h2{font-size:13px;letter-spacing:.02em;text-transform:uppercase;color:var(--muted);margin:0;font-weight:500}
.ghost{border:0;background:transparent;color:var(--jade);font-size:16px;padding:8px 4px;cursor:pointer}
.abtn{display:flex;align-items:center;justify-content:center;gap:8px;border:0;background:var(--jade-soft);color:var(--jade);font-size:16px;font-weight:600;padding:13px;border-radius:12px;cursor:pointer;width:100%}
.abtn svg{width:18px;height:18px;flex:none}
.abtn.on{background:var(--jade);color:var(--on-accent)}
.audio{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.shadow .row1{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.shadow b{font-size:17px;font-weight:600}
.st{font-size:14px;color:var(--muted)}
.warn{font-size:13px;color:var(--seal);background:var(--seal-soft);border-radius:10px;padding:10px 12px}

/* flashcard */
.card{background:var(--surface);border-radius:20px;min-height:320px;display:flex;flex-direction:column;cursor:pointer;box-shadow:0 1px 2px rgba(0,0,0,.04),0 8px 24px rgba(0,0,0,.05)}
.card .meta{display:flex;justify-content:space-between;align-items:center;padding:14px 16px 0;font-size:13px;color:var(--muted)}
.tag{font-weight:500}
.known-dot{color:var(--ok);font-weight:600}
.front{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:22px 16px;text-align:center}
.han{font-family:var(--f-han);font-size:clamp(56px,18vw,88px);line-height:1.1}
.vi-big{font-size:28px;font-weight:600;letter-spacing:-.01em;text-wrap:balance}
.hint{font-size:13px;color:var(--muted)}
.back{border-top:1px solid var(--line);padding:16px;display:flex;flex-direction:column;gap:12px;cursor:default}
.pin{font-family:var(--f-pin);font-size:24px;font-weight:500;text-align:center;color:var(--jade)}
.mean{text-align:center;font-size:18px;font-weight:600}
.ex{background:var(--bg);border-radius:12px;padding:12px 14px;display:flex;flex-direction:column;gap:3px}
.ex .z{font-family:var(--f-han);font-size:22px;line-height:1.35}
.ex .p{font-family:var(--f-pin);font-size:14px;color:var(--muted)}
.ex .v{font-size:15px}
.actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.actions button{border:0;font-size:17px;font-weight:600;padding:14px;border-radius:14px;cursor:pointer}
.no{background:var(--surface);color:var(--seal)}
.yes{background:var(--jade);color:var(--on-accent)}
.nav{display:flex;justify-content:space-between;align-items:center;font-size:14px;color:var(--muted);font-variant-numeric:tabular-nums}
.empty{background:var(--surface);border-radius:20px;padding:36px 20px;text-align:center;display:flex;flex-direction:column;gap:10px;align-items:center}
.empty .han{font-size:56px}

/* 田字格 practice cells */
.tz-row{display:flex;gap:6px;justify-content:center;flex-wrap:nowrap}
.tzg{position:relative;display:inline-grid;place-items:center;width:var(--s,120px);height:var(--s,120px);background:var(--cell);border:1.5px solid var(--grid);border-radius:4px;flex:none}
.tzg>svg{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.tzg line{stroke:var(--grid);stroke-width:1;stroke-dasharray:3 3;vector-effect:non-scaling-stroke}
.tzg .c{position:relative;font-family:var(--f-han);font-size:calc(var(--s,120px)*.8);line-height:1;color:var(--ink)}
.tzg .wt{position:absolute;inset:0}
body:not(.mono) .tc1{color:var(--t1)} body:not(.mono) .tc2{color:var(--t2)} body:not(.mono) .tc3{color:var(--t3)}
body:not(.mono) .tc4{color:var(--t4)} body:not(.mono) .tc0{color:var(--t0)}
.writer{display:flex;flex-direction:column;align-items:center;gap:12px;border-top:1px solid var(--line);padding-top:14px}
.writer .wt-title{font-size:15px;font-weight:600}
.wchars{display:flex;gap:8px}
.wchars button{font-family:var(--f-han);font-size:24px;width:46px;height:46px;border:0;background:var(--fill);color:var(--ink);border-radius:10px;cursor:pointer}
.wchars button[aria-pressed="true"]{background:var(--jade-soft);box-shadow:inset 0 0 0 2px var(--jade)}
.wctl{display:grid;grid-template-columns:1fr 1fr;gap:10px;width:100%}
.wmsg{font-size:14px;color:var(--muted);text-align:center;min-height:20px}

/* word list */
.lists{display:flex;flex-direction:column;gap:20px}
.lopts{padding:0}
.row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:12px;align-items:center;padding:10px 16px;position:relative;cursor:pointer}
.row + .row::before{content:"";position:absolute;left:16px;right:0;top:0;height:1px;background:var(--line);transform:scaleY(.6);transform-origin:top}
.row .tz-row{justify-content:flex-start;gap:3px}
.row .d{min-width:0;display:flex;flex-direction:column;gap:1px}
.row .d .p{font-family:var(--f-pin);font-size:15px;font-weight:500}
.row .d .v{font-size:15px}
.row .d .e{font-size:15px;color:var(--muted);font-family:var(--f-han);overflow-wrap:anywhere}
.tick{width:28px;height:28px;border-radius:50%;border:1.5px solid var(--line);background:transparent;color:transparent;display:grid;place-items:center;cursor:pointer;font-size:14px;font-weight:700}
.tick[aria-pressed="true"]{background:var(--ok);border-color:var(--ok);color:#FFFFFF}
.tick:disabled{cursor:default}
#list.cover .row:not(.open) .hide{color:transparent!important;background:var(--fill);border-radius:6px;width:fit-content;min-width:6em}
#list.cover .row:not(.open) .hide *{color:transparent!important}

/* progress */
.hero{display:grid;grid-template-columns:auto 1fr;gap:18px;align-items:center}
.ring{width:100px;height:100px}
.ring text{font-family:var(--f-body);font-weight:700;fill:var(--ink)}
.stats{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.stat{display:flex;flex-direction:column}
.stat b{font-size:24px;font-weight:700;font-variant-numeric:tabular-nums;line-height:1.2;letter-spacing:-.01em}
.stat span{font-size:12px;color:var(--muted)}
.catrow{display:grid;grid-template-columns:minmax(0,9.5em) 1fr 3em;gap:10px;align-items:center;font-size:14px}
.catrow .t{height:8px;border-radius:4px;background:var(--fill);overflow:hidden}
.catrow .t i{display:block;height:100%;background:var(--jade);border-radius:4px}
.catrow .n{text-align:right;font-variant-numeric:tabular-nums;color:var(--muted)}
.chart{overflow-x:auto}
.chart svg{display:block;width:100%;min-width:320px;height:auto}
.chart text{font-family:var(--f-body);font-size:10px;fill:var(--muted)}
.note{font-size:13px;color:var(--muted);text-align:center;margin:0}

/* pinyin lessons */
.lead{font-size:15px;margin:0}
.lseg{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}
.lseg button{border:0;background:var(--surface);color:var(--ink);font-size:11px;padding:9px 2px;border-radius:12px;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:2px;line-height:1.25}
.lseg button b{font-size:17px;font-weight:600}
.lseg button[aria-pressed="true"]{background:var(--jade);color:var(--on-accent)}
.lseg button.done b::after{content:" ✓";color:var(--ok)}
.lseg button.done[aria-pressed="true"] b::after{color:var(--on-accent)}
.gtitle{font-weight:600;font-size:17px}
.gnote{font-size:14px;color:var(--muted);margin:0}
.pin-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(92px,1fr));gap:8px}
.syl{border:0;background:var(--bg);border-radius:12px;padding:10px 6px;display:flex;flex-direction:column;align-items:center;gap:2px;cursor:pointer;color:var(--ink);min-width:0}
.syl .k{font-family:var(--f-pin);font-size:15px;font-weight:600;color:var(--muted);overflow-wrap:anywhere;text-align:center;line-height:1.25}
.syl .hz{font-family:var(--f-han);font-size:32px;line-height:1.15}
.syl .py{font-family:var(--f-pin);font-size:15px;font-weight:500}
.syl.wide .k{font-size:13px;font-weight:500}
.tone{display:grid;grid-template-columns:56px 1fr auto;gap:12px;align-items:center;padding-top:12px;border-top:1px solid var(--line)}
.tone svg{width:56px;height:40px;display:block}
.tone .tn{font-weight:600;font-size:15px}
.tone .tn .hz{font-family:var(--f-han);font-size:22px;font-weight:400}
.tone .th{font-size:14px;color:var(--muted)}
.tone button{width:40px;height:40px;border-radius:50%;border:0;background:var(--jade-soft);color:var(--jade);display:grid;place-items:center;cursor:pointer}
.tone button svg{width:18px;height:18px}
.setrow{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center}
.setrow .pin-grid{grid-template-columns:repeat(4,1fr)}
.qbox{display:flex;flex-direction:column;gap:14px;align-items:center;text-align:center}
.qplay{width:88px;height:88px;border-radius:50%;border:0;background:var(--jade);color:var(--on-accent);display:grid;place-items:center;cursor:pointer;box-shadow:0 6px 16px rgba(0,122,255,.3)}
.qplay svg{width:34px;height:34px}
.qopts{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;width:100%}
.qopts button{border:0;background:var(--bg);color:var(--ink);font-size:14px;font-weight:600;padding:12px 4px;border-radius:12px;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:4px}
.qopts button span{font-family:var(--f-pin);font-size:22px;line-height:1}
.qopts button.right{background:var(--ok);color:#FFFFFF}
.qopts button.wrong{background:var(--seal-soft);color:var(--seal)}
.qopts button:disabled{cursor:default}
.qres{min-height:56px;display:flex;flex-direction:column;align-items:center;gap:2px}
.qres .py{font-family:var(--f-pin);font-size:18px;font-weight:500}
.meter{width:100%;display:flex;flex-direction:column;gap:6px}
.meter .t{height:8px;border-radius:4px;background:var(--fill);overflow:hidden;position:relative}
.meter .t i{display:block;height:100%;background:var(--jade);border-radius:4px}
.meter .t s{position:absolute;top:0;bottom:0;left:85%;width:2px;background:var(--ink);opacity:.35}
.meter .l{display:flex;justify-content:space-between;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
@media (prefers-reduced-motion: reduce){*{transition:none!important}}

/* ---------- v4 additions ---------- */
.roleline{font-size:12px;color:var(--jade);font-weight:600;min-height:0}
.roleline:empty{display:none}
.abtn.big{padding:15px;font-size:17px;border-radius:14px}
.abtn:disabled{opacity:.45;cursor:default}
.tzcol{display:inline-flex;flex-direction:column;align-items:center;gap:4px}
.hvl{font-size:13px;color:var(--muted);font-weight:500;letter-spacing:.01em}
.hvline{text-align:center;font-size:15px;color:var(--muted)}
.hvline b{color:var(--ink);font-weight:600}
.hvs{color:var(--muted);font-size:13px}
.ex{position:relative;padding-right:52px}
.exsay{position:absolute;right:10px;top:50%;transform:translateY(-50%);width:36px;height:36px;border-radius:50%;border:0;background:var(--jade-soft);color:var(--jade);display:grid;place-items:center;cursor:pointer}
.exsay svg{width:16px;height:16px}
.cnote{background:var(--jade-soft);border-radius:12px;padding:10px 14px;font-size:15px}
.cnote span{display:block;font-size:12px;font-weight:600;color:var(--jade);margin-bottom:2px}
.focus-dot{color:var(--t2);font-weight:600}
.sesbar{display:flex;justify-content:space-between;align-items:center;font-size:14px;color:var(--muted);font-variant-numeric:tabular-nums}
.sesbar .ghost{padding-left:0}
.grades{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.grades button{border:0;border-radius:14px;padding:10px 4px;display:flex;flex-direction:column;align-items:center;gap:2px;cursor:pointer;background:var(--surface);color:var(--ink)}
.grades button b{font-size:16px;font-weight:600}
.grades button span{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.grades .g-no b{color:var(--seal)} .grades .g-hard b{color:var(--t2)} .grades .g-good b{color:var(--ok)} .grades .g-easy b{color:var(--jade)}
.msgs{display:flex;flex-direction:column;gap:8px}
.msg{background:var(--bg);border-radius:12px;padding:10px 14px;font-size:15px}
.msg.unread{background:var(--jade-soft)}
.mh{font-size:12px;color:var(--muted);font-weight:500;margin-bottom:2px}
.hero-today{gap:14px}
.ht-top{display:flex;justify-content:space-between;align-items:center;gap:12px}
.ht-k{font-size:13px;color:var(--muted);font-weight:500;text-transform:uppercase;letter-spacing:.02em}
.ht-v{font-size:24px;font-weight:700;letter-spacing:-.01em}
.ht-ring .ring{width:76px;height:76px}
.plan{display:flex;flex-direction:column}
.prow{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 0;border-top:1px solid var(--line)}
.pk{font-size:16px;font-weight:500}
.ps{font-size:13px;color:var(--muted)}
.pn{font-size:22px;font-variant-numeric:tabular-nums}
.pn.zero{color:var(--muted);font-weight:500}
.warnline{font-size:14px;color:var(--t2)}
select,input[type=date]{font:inherit;font-size:16px;color:var(--jade);background:transparent;border:0;text-align:right;max-width:55%}
textarea,.search{font:inherit;font-size:16px;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:10px 12px;width:100%;resize:vertical}
.panel textarea{background:var(--bg);border:0}
.search{border:0;-webkit-appearance:none;appearance:none}
.chip .cn{color:var(--muted);font-variant-numeric:tabular-nums;margin-left:2px}
.chip[aria-pressed="true"] .cn{color:var(--on-accent);opacity:.8}
.chip.sm{font-size:13px;padding:5px 11px}
.row{grid-template-columns:auto minmax(0,1fr) auto}
.badges{display:flex;flex-direction:column;align-items:flex-end;gap:4px}
.pill{font-size:11px;font-weight:600;padding:3px 8px;border-radius:999px;background:var(--fill);color:var(--muted);white-space:nowrap}
.pill.st-learning{background:var(--jade-soft);color:var(--jade)}
.pill.st-mature,.pill.st-solid{background:color-mix(in srgb,var(--ok) 16%,transparent);color:var(--ok)}
.pill.st-weak{background:var(--seal-soft);color:var(--seal)}
.pill.focus{background:color-mix(in srgb,var(--t2) 16%,transparent);color:var(--t2)}
.hists{display:flex;flex-direction:column;gap:8px}
.hist{display:grid;grid-template-columns:6.5em 1fr;gap:4px 10px;align-items:center;font-size:14px}
.hist .hm{grid-column:2;font-size:12px;color:var(--muted)}
.dots{display:flex;gap:3px;flex-wrap:wrap}
.hd{width:10px;height:10px;border-radius:50%;display:inline-block}
.hd.g1{background:var(--seal)} .hd.g2{background:var(--t2)} .hd.g3{background:var(--ok)} .hd.g4{background:var(--jade)}
#sheet{position:fixed;inset:0;z-index:20;background:rgba(0,0,0,.35);display:flex;align-items:flex-end;justify-content:center;padding-top:env(safe-area-inset-top,0px)}
#sheet[hidden]{display:none}
.sheet-card{background:var(--surface);width:100%;max-width:600px;max-height:92vh;overflow-y:auto;border-radius:20px 20px 0 0;padding:14px max(16px,env(safe-area-inset-left,0px)) calc(24px + env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-right,0px));display:flex;flex-direction:column;gap:12px;box-shadow:0 -8px 30px rgba(0,0,0,.15)}
.sheet-top{display:flex;justify-content:space-between;align-items:center}
.sheet-card .ex{background:var(--bg)}
body.noscroll{overflow:hidden}
.status{flex-direction:row;align-items:center;gap:14px}
.sdot{width:14px;height:14px;border-radius:50%;flex:none;background:var(--muted)}
.status.good .sdot{background:var(--ok)} .status.mid .sdot{background:var(--t2)} .status.bad .sdot{background:var(--seal)}
.stl{font-size:17px;font-weight:600}
.sts{font-size:13px;color:var(--muted)}
.fc{font-size:15px;border-radius:12px;padding:12px 14px;background:var(--bg)}
.fc.good b{color:var(--ok)} .fc.bad b{color:var(--seal)}
.lee{display:flex;flex-direction:column}
.leew{display:grid;grid-template-columns:auto auto 1fr auto;gap:10px;align-items:baseline;border:0;background:transparent;color:var(--ink);padding:9px 0;border-top:1px solid var(--line);text-align:left;cursor:pointer;font-family:inherit}
.leew:first-child{border-top:0}
.leew .h{font-family:var(--f-han);font-size:22px}
.leew .p{font-family:var(--f-pin);font-size:14px}
.leew .v{font-size:14px;color:var(--muted);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.leew .lp{font-size:12px;color:var(--seal);font-weight:600}
.cm{border-collapse:collapse;width:100%;font-size:13px;font-variant-numeric:tabular-nums}
.cm th,.cm td{padding:6px;text-align:center;border-bottom:1px solid var(--line)}
.cm th:first-child{text-align:left;font-weight:500;color:var(--muted)}
.cm td{background:color-mix(in srgb,var(--seal) calc(var(--a,0)*35%),transparent)}
.chk{font-size:14px;padding:8px 0;border-top:1px solid var(--line)}
.chk:first-of-type{border-top:0}
.catrow .t{position:relative}
.catrow .t i{position:absolute;left:0;top:0;bottom:0}
.catrow .t i.t2{background:var(--jade);opacity:.3}
#toast{position:fixed;left:50%;bottom:calc(24px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);background:var(--ink);color:var(--bg);font-size:15px;font-weight:500;padding:10px 18px;border-radius:999px;z-index:30}
#toast[hidden]{display:none}
.guide h3{font-size:17px;margin:4px 0 0}
.guide p,.guide li{font-size:15px;margin:0}
.guide ul,.guide ol{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:6px}
.guide .src{font-size:12px;color:var(--muted)}
.guide .src a{color:var(--jade)}
.lseg{grid-template-columns:repeat(6,1fr)}
@media (max-width:440px){ .lseg{grid-template-columns:repeat(3,1fr)} }
.lvb{font-size:11px;font-weight:600;color:var(--muted);background:var(--fill);border-radius:6px;padding:2px 6px;vertical-align:middle}
.hvline.warnhv{color:var(--seal)}
.note2{font-size:14px;background:color-mix(in srgb,var(--t2) 12%,transparent);border-radius:12px;padding:9px 13px}
.note2.ff{background:var(--seal-soft);color:var(--seal)}
.anats{display:flex;flex-direction:column;gap:8px;border-top:1px solid var(--line);padding-top:12px}
.sh2{font-size:13px;color:var(--muted);font-weight:500;text-transform:uppercase;letter-spacing:.02em}
.anat{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px}
.anat .az{font-family:var(--f-han);font-size:30px;line-height:1}
.anat .ahv{font-size:14px;font-weight:600}
.anat .eq,.anat .plus{color:var(--muted);font-size:15px}
.anat .parts{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.cp{display:inline-flex;align-items:center;gap:6px;background:var(--bg);border-radius:10px;padding:4px 10px 4px 6px}
.cz{font-family:var(--f-han);font-size:22px;line-height:1}
.cm2{font-size:13px}
.mnemo{display:flex;flex-direction:column;gap:6px}
.mnemo textarea{background:var(--bg);border:0;font-size:15px}
.cnote.mine{background:var(--fill)}
.cnote.mine span{color:var(--muted)}
.mc{display:grid;grid-template-columns:1fr 1fr;gap:8px;width:100%}
.mco{border:0;background:var(--bg);color:var(--ink);font-size:15px;font-weight:500;padding:14px 10px;border-radius:12px;cursor:pointer;min-height:56px}
.mco.right{background:var(--ok);color:#FFFFFF}
.mco.wrong{background:var(--seal-soft);color:var(--seal)}
.mco:disabled{cursor:default}
.pyform{display:flex;gap:8px;width:100%;max-width:360px}
.pyform input{flex:1;min-width:0;font-family:var(--f-pin);font-size:20px;text-align:center;border:0;background:var(--bg);color:var(--ink);border-radius:12px;padding:12px}
.pyform .abtn{width:auto;padding:12px 16px}
.pyres{font-size:15px;font-weight:600}
.pyres.good{color:var(--ok)} .pyres.mid{color:var(--t2)} .pyres.bad{color:var(--seal)}
.grades.g1{grid-template-columns:1fr} .grades.g2{grid-template-columns:1fr 1fr}
.qopts.tp{grid-template-columns:1fr 1fr}
.qopts.tp button{font-size:13px}
.abtn:disabled[id^="spk"]{opacity:.35}
.banner{background:color-mix(in srgb,var(--t2) 14%,transparent);border-radius:14px;padding:12px 14px;font-size:14px;display:flex;flex-direction:column;gap:8px}
.banner b{font-size:15px}
.banner .row2{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.planline{font-size:15px;background:var(--bg);border-radius:12px;padding:10px 12px}
.planline span{color:var(--muted);font-size:12px;display:block}
.planin{display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:16px}
.planin input{flex:1;min-width:10em;font:inherit;border:0;background:var(--bg);color:var(--ink);border-radius:10px;padding:9px 11px}
#planLine{cursor:pointer}


/* ---------- v5: sprint mission, grammar, exam practice ---------- */
.row1{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.row1 b{font-size:17px;font-weight:600}
.mission{gap:14px}
.comeback{font-size:14px;background:var(--jade-soft);color:var(--ink);border-radius:12px;padding:10px 12px}
.steps{display:flex;flex-direction:column;gap:8px}
.step{display:grid;grid-template-columns:28px 40px minmax(0,1fr) auto;gap:10px;align-items:center;border:0;background:var(--bg);color:var(--ink);border-radius:14px;padding:10px 12px;text-align:left;cursor:pointer;width:100%}
.step .sn{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;font-size:13px;font-weight:700;background:var(--surface);color:var(--muted);font-variant-numeric:tabular-nums}
.step .sic{font-family:var(--f-han);font-size:28px;line-height:1;text-align:center;color:var(--muted)}
.step .sb{display:flex;flex-direction:column;min-width:0}
.step .pk{font-weight:600}
.step .ps{font-size:13px;color:var(--muted);overflow:hidden;text-overflow:ellipsis}
.step .chev{color:var(--muted);font-size:22px}
.step.next{background:var(--jade-soft);box-shadow:inset 0 0 0 2px var(--jade)}
.step.next .sn{background:var(--jade);color:var(--on-accent)}
.step.next .sic{color:var(--jade)}
.step.done{opacity:.62}
.step.done .sn{background:var(--ok);color:#fff}
.step.done .pk{text-decoration:line-through;text-decoration-thickness:1px}
.donebox{display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;font-size:15px}
.donebox .han{font-size:52px;color:var(--ok)}
.pbar{position:relative;height:10px;border-radius:5px;background:var(--fill);display:flex;overflow:visible}
.pbar i{display:block;height:100%}
.pbar .pa{background:color-mix(in srgb,var(--jade) 35%,transparent);border-radius:5px 0 0 5px}
.pbar .pb{background:color-mix(in srgb,var(--t2) 45%,transparent);border-radius:0 5px 5px 0}
.pbar s{position:absolute;top:-4px;bottom:-4px;width:3px;border-radius:2px;background:var(--ink);transform:translateX(-50%)}
.plab{display:flex;justify-content:space-between;font-size:12px;color:var(--muted);margin-top:6px;gap:8px}
.st b{color:var(--ink)}
details.more{display:flex;flex-direction:column;gap:14px}
details.more>summary{list-style:none;cursor:pointer;color:var(--jade);font-size:15px;padding:4px 2px}
details.more>summary::-webkit-details-marker{display:none}
details.more>summary::before{content:"＋ "}
details.more[open]>summary::before{content:"－ "}
details.more[open]>*:not(summary){margin-top:12px}
.two{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.two>*:only-child{grid-column:1/-1}

/* exam runner */
.exq{cursor:default;min-height:0}
.exf{gap:14px;justify-content:flex-start;padding:20px 16px}
.qplay.sm{width:72px;height:72px}
.qplay.sm:disabled{opacity:.4;box-shadow:none}
.hz2{font-family:var(--f-han);font-size:20px;line-height:1.45}
.hzbig{font-family:var(--f-han);font-size:34px;line-height:1.1}
.qsent{font-size:22px;line-height:1.55;background:var(--bg);border-radius:12px;padding:12px 14px;width:100%;text-align:left}
.pyb{font-family:var(--f-pin);font-size:16px;color:var(--jade);font-weight:600;white-space:nowrap}
.py{font-family:var(--f-pin);font-size:14px;color:var(--muted);display:block}
.mopts{display:flex;flex-direction:column;gap:8px;width:100%}
.mopts.grid3{display:grid;grid-template-columns:repeat(3,1fr)}
.mopts.grid4{display:grid;grid-template-columns:repeat(4,1fr)}
.mo{display:flex;align-items:center;gap:10px;border:0;background:var(--bg);color:var(--ink);border-radius:12px;padding:10px 12px;text-align:left;cursor:pointer;min-height:48px}
.mopts.grid3 .mo,.mopts.grid4 .mo{flex-direction:column;gap:2px;padding:8px 4px;text-align:center;justify-content:center}
.mo b{font-size:13px;color:var(--muted);width:20px;flex:none;text-align:center}
.mopts.grid3 .mo b,.mopts.grid4 .mo b{width:auto}
.mo.right{background:var(--ok);color:#fff}.mo.right b{color:#fff}
.mo.wrong{background:var(--seal-soft);color:var(--seal)}
.mo:disabled{cursor:default}
.pics{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;width:100%}
.pic{border:0;background:var(--bg);color:var(--ink);border-radius:14px;padding:10px 4px 8px;display:flex;flex-direction:column;align-items:center;gap:2px;cursor:pointer;position:relative}
.pic b{position:absolute;top:6px;left:8px;font-size:12px;color:var(--muted)}
.pic .pe{font-size:38px;line-height:1.15}
.pic .pl{font-size:12px;color:var(--muted);line-height:1.2;text-align:center}
.pic.right{background:var(--ok)}.pic.right .pl,.pic.right b{color:#fff}
.pic.wrong{background:var(--seal-soft)}
.wword{display:flex;flex-direction:column;align-items:center;gap:2px}
.wword .hz2{font-size:40px}
.wword .v{font-size:15px}
.oline{min-height:56px;width:100%;border-bottom:2px dashed var(--line);display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding:6px 0}
.opool{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;min-height:48px}
.tokb{font-family:var(--f-han);font-size:21px;border:0;background:var(--bg);color:var(--ink);border-radius:10px;padding:7px 12px;cursor:pointer;box-shadow:0 1px 0 var(--line)}
.tokb.on{background:var(--jade-soft);color:var(--ink)}
.scene{font-size:64px;line-height:1.1}
.cdown{font-size:15px;font-weight:600;color:var(--jade);font-variant-numeric:tabular-nums;min-height:20px}
.cdown.over{color:var(--seal)}
.frames{display:flex;flex-wrap:wrap;gap:6px;justify-content:center}
.frames span{background:var(--bg);border-radius:8px;padding:2px 10px;font-size:17px}
.mic{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:10px;width:100%}
.mic:empty{display:none}
.mic .abtn{font-size:15px;padding:11px}
audio{width:100%}
.models{display:flex;flex-direction:column;gap:8px;width:100%;text-align:left}
.exf textarea{background:var(--bg);border:0}
.exf .actions{width:100%}
.verdict{font-weight:700;font-size:17px}
.verdict.good{color:var(--ok)}.verdict.bad{color:var(--seal)}.verdict.mid{color:var(--t2)}
.dlg{display:flex;flex-direction:column;gap:8px}
.dl{display:grid;grid-template-columns:26px 1fr;gap:8px;align-items:start}
.dl .sp{width:26px;height:26px;border-radius:50%;background:var(--fill);display:grid;place-items:center;font-family:var(--f-han);font-size:14px;margin-top:4px}
.dl.q .sp{background:var(--jade-soft);color:var(--jade)}
.vi{font-size:15px;background:var(--bg);border-radius:10px;padding:8px 12px}
.why{font-size:14px;color:var(--ink);border-left:3px solid var(--jade);padding:2px 0 2px 10px}
.pair{display:flex;flex-direction:column;gap:4px}
.wline{font-size:15px}
.aibox{font-size:15px;text-align:left;background:var(--jade-soft);border-radius:12px;padding:10px 12px;color:var(--ink);line-height:1.5}
.bigscore{font-size:52px;font-weight:800;letter-spacing:-.02em;line-height:1}
.bigscore span{font-size:20px;color:var(--muted);font-weight:600}
.parts{width:100%;display:flex;flex-direction:column;gap:8px;text-align:left}
.rv{gap:8px}
.tips{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:6px;font-size:15px}
.mocks{display:flex;flex-direction:column}
.cell.prt>span:first-child,.cell.grow .gtx{display:flex;flex-direction:column;min-width:0}
.cell .pk{font-size:16px}
.cell .ps{font-size:13px;color:var(--muted)}
.cell:disabled{opacity:.45}
.cell.grow{display:grid;grid-template-columns:52px minmax(0,1fr) auto;gap:10px}
.cell.grow .gz{font-family:var(--f-han);font-size:22px;color:var(--jade);text-align:center;line-height:1.1}
.cell.grow .ps{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gpt{gap:14px}
.gzbig{font-family:var(--f-han);font-size:46px;text-align:center;color:var(--jade);line-height:1.1}
.formula{font-family:var(--f-pin);font-size:16px;font-weight:600;background:var(--jade-soft);color:var(--ink);border-radius:12px;padding:12px 14px;text-align:center}
.gx{margin:0;font-size:16px;line-height:1.55}
.trap{display:flex;flex-direction:column;gap:6px;background:var(--bg);border-radius:12px;padding:12px 14px}
.trap .tb,.trap .tg{display:grid;grid-template-columns:22px 1fr;align-items:baseline}
.trap .tb>span:first-child{color:var(--seal);font-weight:700}
.trap .tb .hz2{text-decoration:line-through;text-decoration-color:var(--seal);color:var(--muted)}
.trap .tg>span:first-child{color:var(--ok);font-weight:700}
.mini-steps{display:flex;flex-wrap:wrap;gap:6px 14px;font-size:14px;color:var(--muted)}
.mini-steps .d{color:var(--ok);font-weight:600}
.sesn{min-width:4em;text-align:right}

.ghost svg{width:18px;height:18px;vertical-align:-3px}
.exf>.two,.exf>.mic,.exf>textarea,.exf>.qsent,.exf>.models,.exf>.ex{width:100%}
.qq{font-size:18px;font-weight:600;width:100%;text-align:left}
