/* EnglishApp design system and shell styles. Tokens first, then base, components, screens. */
@font-face { font-family: "Andika"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/andika-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Andika"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/andika-latin-700-normal.woff2") format("woff2"); }

:root {
  --bg: #F5F7FB; --surface: #FFFFFF; --surface-2: #EEF2F9; --ink: #14213D; --ink-2: #51607A; --ink-3: #8190A8; --line: #E2E8F2;
  --brand: #2D6BFF; --brand-2: #1F56E0; --brand-ink: #FFFFFF; --brand-soft: #E8EFFF;
  --ok: #1FA971; --ok-soft: #E3F6EE; --bad: #E5484D; --bad-soft: #FDECEC; --warn: #F5A524; --warn-soft: #FEF3DC; --gold: #F7B500;
  --r-s: 8px; --r-m: 12px; --r-l: 16px;
  --sh-1: 0 1px 2px rgba(20, 33, 61, .06), 0 4px 14px rgba(20, 33, 61, .05);
  --sh-2: 0 2px 4px rgba(20, 33, 61, .06), 0 14px 32px rgba(20, 33, 61, .14);
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  --fs-s: 14px; --fs-m: 16px; --fs-l: 19px; --fs-xl: 25px; --fs-xxl: 32px;
  --tap: 44px;
  --font-ui: -apple-system, "SF Pro Text", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --font-learn: var(--font-ui);
  --nav-w: 96px;
}
body[data-band="K2"] {
  --bg: #FFF8EE; --surface-2: #FFF0DC; --line: #F2E5CF; --brand-soft: #E6EDFF;
  --r-s: 14px; --r-m: 20px; --r-l: 28px;
  --fs-s: 16px; --fs-m: 19.5px; --fs-l: 24px; --fs-xl: 32px; --fs-xxl: 42px; --tap: 56px;
  --font-learn: "Andika", var(--font-ui);
}
body[data-band="35"] {
  --bg: #F1F7FF; --r-s: 10px; --r-m: 14px; --r-l: 20px;
  --fs-s: 15px; --fs-m: 17px; --fs-l: 21px; --fs-xl: 28px; --fs-xxl: 36px; --tap: 48px;
}
body[data-band="912"] {
  --bg: #F4F6F9; --surface-2: #ECEFF4; --brand: #2457D6; --brand-2: #1B45B0; --brand-soft: #E5ECFB;
  --r-s: 4px; --r-m: 6px; --r-l: 10px;
  --sh-1: 0 1px 2px rgba(20, 33, 61, .08); --sh-2: 0 2px 4px rgba(20, 33, 61, .08), 0 8px 20px rgba(20, 33, 61, .1);
  --fs-s: 13.5px; --fs-m: 15px; --fs-l: 18px; --fs-xl: 23px; --fs-xxl: 29px; --tap: 44px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: #F5F7FB; }
body {
  margin: 0; font-family: var(--font-ui); font-size: var(--fs-m); line-height: 1.5; color: var(--ink); background: var(--bg);
  overscroll-behavior: none; -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1, h2, h3, p, ul { margin: 0; }
h1 { font-size: var(--fs-xl); line-height: 1.2; letter-spacing: -.02em; font-weight: 800; }
h2 { font-size: var(--fs-l); line-height: 1.25; font-weight: 750; }
ul { padding-left: 20px; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-appearance: none; appearance: none; touch-action: manipulation; }
:focus-visible { outline: 3px solid rgba(45, 107, 255, .5); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.zh { display: block; font-size: .86em; color: var(--ink-3); margin-top: 2px; font-weight: 500; }
.muted { color: var(--ink-2); } .small { font-size: var(--fs-s); } .center { text-align: center; } .lead { font-size: var(--fs-m); color: var(--ink-2); }
.ok-t { color: var(--ok); font-weight: 700; }

/* layout */
#app { min-height: 100vh; min-height: 100dvh; position: relative; }
.view { max-width: 1080px; margin: 0 auto; padding: var(--sp-4) max(var(--sp-4), env(safe-area-inset-right)) var(--sp-6) max(var(--sp-4), env(safe-area-inset-left)); }
#app.has-nav .view { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
.page { display: flex; flex-direction: column; gap: var(--sp-4); animation: rise .3s ease both; }
.page > * { min-width: 0; }
.narrow { max-width: 640px; margin: 0 auto; width: 100%; }
.page-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: var(--tap); }
.brand { font-weight: 800; font-size: var(--fs-l); color: var(--brand); letter-spacing: -.02em; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: var(--sp-4); }
.grid-2 > * { min-width: 0; }
.sec { margin-top: var(--sp-2); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.18); } 100% { transform: scale(1); opacity: 1; } }
@keyframes shake { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* navigation */
#nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding: 4px max(8px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); box-shadow: 0 -6px 20px rgba(20, 33, 61, .06); }
.nav-b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px; border: 0; background: none; color: var(--ink-3); font-size: 12px; font-weight: 650; border-radius: var(--r-m); cursor: pointer; transition: color .15s, background .15s; }
.nav-b.on { color: var(--brand); background: var(--brand-soft); }
body[data-band="K2"] .nav-b { font-size: 14px; min-height: 66px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 var(--sp-5); border-radius: var(--r-m); border: 1.5px solid transparent; background: var(--surface-2); color: var(--ink); font-weight: 650; line-height: 1.2; cursor: pointer; text-decoration: none; transition: transform .15s, background .15s, box-shadow .15s, opacity .15s; }
.btn:active { transform: scale(.97); }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 6px 14px rgba(45, 107, 255, .28); }
body[data-band="912"] .btn-primary { box-shadow: none; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ok { background: var(--ok); color: #fff; box-shadow: 0 6px 14px rgba(31, 169, 113, .28); }
.btn-bad { background: var(--bad-soft); color: var(--bad); border-color: rgba(229, 72, 77, .35); }
.btn-lg { min-height: calc(var(--tap) + 10px); font-size: var(--fs-l); padding: 0 var(--sp-6); }
.btn-sm { padding: 0 var(--sp-4); font-size: var(--fs-s); }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.done-card .btn-row { justify-content: center; }
@media (hover: hover) { .btn-primary:hover { background: var(--brand-2); } .btn-ghost:hover { background: var(--surface-2); } }

/* surfaces */
.card { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--sh-1); border: 1px solid var(--line); padding: var(--sp-5); }
.card.notice { background: var(--warn-soft); border-color: #F8DDA5; display: flex; flex-direction: column; gap: var(--sp-2); align-items: flex-start; }
.card.notice.small { flex-direction: row; align-items: center; }
.card-h { font-size: var(--fs-m); font-weight: 750; margin-bottom: var(--sp-2); }
.card-h.sub { margin-top: var(--sp-5); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: var(--fs-s); font-weight: 700; }
.chip.big { min-height: 38px; padding: 6px 16px; font-size: var(--fs-m); }
.chip-flame { background: #FFEEDB; color: #CC5200; } .chip-xp { background: var(--brand-soft); color: var(--brand); }
.chip-ok { background: var(--ok-soft); color: #0F7A52; } .chip-bad { background: var(--bad-soft); color: var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.pill { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; padding: 3px 12px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: var(--fs-s); font-weight: 700; }
.pill-brand { background: var(--brand-soft); color: var(--brand); } .pill-light { background: rgba(255, 255, 255, .22); color: #fff; } .pill-ok { background: var(--ok-soft); color: #0F7A52; }
.pill-score { background: var(--brand-soft); color: var(--brand); font-size: var(--fs-m); } .pill-score.ok { background: var(--ok-soft); color: #0F7A52; } .pill-score.warn { background: var(--warn-soft); color: #9A6200; }
.progress { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress .bar { height: 100%; background: var(--brand); border-radius: 999px; transition: width .5s ease; }
.progress.ok .bar { background: var(--ok); } .progress.warn .bar { background: var(--warn); } .progress.none .bar { width: 0 !important; }
.stars { display: inline-flex; align-items: center; gap: 2px; }
.stars .on { color: var(--gold); } .stars .off { color: #D6DDEA; }
.chip-row, .chip-grid { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip-b { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: var(--tap); min-width: var(--tap); padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 650; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.chip-b.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.chip-b.locked { color: var(--ink-3); } .chip-b[disabled] { opacity: .38; cursor: default; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: var(--r-m); max-width: 100%; }
.seg-b { min-height: 44px; padding: 0 14px; border: 0; background: none; border-radius: calc(var(--r-m) - 3px); font-weight: 650; color: var(--ink-2); cursor: pointer; transition: background .15s, color .15s; }
.seg-b.on { background: var(--surface); color: var(--brand); box-shadow: var(--sh-1); }

/* forms */
.input { width: 100%; min-height: var(--tap); padding: 0 14px; border: 1.5px solid var(--line); border-radius: var(--r-m); background: var(--surface); color: var(--ink); font-size: 16px; }
textarea.input { padding: 10px 14px; line-height: 1.4; resize: vertical; }
.input:focus { border-color: var(--brand); outline: 3px solid var(--brand-soft); }
.input-s { width: 96px; }
.field { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.label { font-weight: 700; color: var(--ink-2); font-size: var(--fs-s); }
.form-err { min-height: 1.5em; color: var(--bad); font-weight: 650; margin-bottom: var(--sp-2); }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: var(--sp-2); }
.av-b { padding: 2px; border: 3px solid transparent; border-radius: 50%; background: none; cursor: pointer; display: grid; place-items: center; min-height: 68px; transition: transform .15s, border-color .15s; }
.av-b.on { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); transform: scale(1.04); }
.avatar-svg { border-radius: 50%; display: block; }

/* top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.who { display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 0; background: none; border: 0; text-align: left; cursor: pointer; min-width: 0; }
.who-av { flex: none; line-height: 0; }
.who-av .avatar-svg { box-shadow: 0 0 0 2px #fff, var(--sh-1); }
.who-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.who-t b { font-size: var(--fs-m); } .who-t small { color: var(--ink-2); font-size: var(--fs-s); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-chips { display: flex; gap: var(--sp-2); flex: none; }

/* profiles and levels */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-4); }
.profile-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: var(--sp-5) var(--sp-3); text-align: center; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.profile-card:active { transform: scale(.97); }
.profile-name { font-size: var(--fs-l); }
.profile-add { border-style: dashed; border-width: 2px; background: transparent; box-shadow: none; color: var(--brand); justify-content: center; }
.profile-plus { width: 84px; height: 84px; border-radius: 50%; background: var(--brand-soft); display: grid; place-items: center; }
.form .btn-block { margin-top: var(--sp-2); }
.level-hero { display: flex; flex-direction: column; gap: var(--sp-3); align-items: flex-start; }
.level-big { font-size: var(--fs-xxl); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.level-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-3); }
.level-card { display: flex; flex-direction: column; gap: 2px; text-align: left; cursor: pointer; padding: var(--sp-4); }
.level-card:active { transform: scale(.98); }

/* home */
.hero { display: flex; align-items: center; gap: var(--sp-5); position: relative; overflow: hidden; border: 0; padding: var(--sp-6); color: #fff; background: linear-gradient(135deg, #2D6BFF 0%, #5B8DFF 100%); box-shadow: 0 14px 30px rgba(45, 107, 255, .28); }
.hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255, 255, 255, .1); pointer-events: none; }
.hero-body { display: flex; flex-direction: column; gap: var(--sp-3); align-items: flex-start; position: relative; z-index: 1; min-width: 0; }
.hero h1 { color: #fff; font-size: var(--fs-xxl); } .hero p { color: rgba(255, 255, 255, .92); }
.hero-meta { font-weight: 650; }
.btn-hero { background: #fff; color: var(--brand); box-shadow: 0 8px 18px rgba(20, 33, 61, .2); }
body[data-band="912"] .hero { background: var(--brand); box-shadow: var(--sh-1); }
body[data-band="912"] .hero::after { display: none; }
.mascot { display: none; flex: none; position: relative; z-index: 1; animation: float 3s ease-in-out infinite; }
body[data-band="K2"] .mascot { display: block; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.cont-row { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; }
.cont-ic { width: 54px; height: 54px; border-radius: var(--r-m); background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.cont-t { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; margin-top: var(--sp-2); }
.cal-wd { font-size: var(--fs-s); color: var(--ink-3); font-weight: 700; }
.cal-d { min-height: 34px; display: grid; place-items: center; border-radius: 10px; font-size: var(--fs-s); color: var(--ink-2); background: var(--surface-2); }
.cal-d.empty { background: none; } .cal-d.on { background: var(--ok-soft); color: var(--ok); } .cal-d.today { box-shadow: inset 0 0 0 2px var(--brand); } .cal-d.future { opacity: .45; }
.cal-title { font-weight: 700; margin-top: var(--sp-3); color: var(--ink-2); }
.skills { display: flex; flex-direction: column; }
.skill-row { display: grid; grid-template-columns: minmax(70px, 100px) 1fr 44px; align-items: center; gap: 10px; margin: 7px 0; }
.skill-n { font-size: var(--fs-s); color: var(--ink-2); font-weight: 650; } .skill-v { text-align: right; font-weight: 750; font-size: var(--fs-s); }

/* map */
.level-bar { display: flex; }
.level-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-3); }
.unit-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-4); align-items: start; }
.unit { padding: 0; overflow: hidden; }
.unit-head { display: flex; align-items: center; gap: 14px; width: 100%; padding: var(--sp-4) var(--sp-5); background: none; border: 0; text-align: left; cursor: pointer; min-height: var(--tap); }
.unit-num { width: 46px; height: 46px; border-radius: var(--r-m); background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: var(--fs-l); display: grid; place-items: center; flex: none; }
.unit.passed .unit-num { background: var(--ok-soft); color: var(--ok); } .unit.is-locked .unit-num { background: var(--surface-2); color: var(--ink-3); }
.unit-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.unit-t small { color: var(--ink-3); font-weight: 650; }
.unit-chev { color: var(--ink-3); transition: transform .2s; flex: none; } .unit.open .unit-chev { transform: rotate(90deg); }
.unit-body { display: none; border-top: 1px solid var(--line); padding: var(--sp-2) var(--sp-3) var(--sp-3); }
.unit.open .unit-body { display: block; }
.lesson { display: flex; align-items: center; gap: 12px; width: 100%; min-height: calc(var(--tap) + 8px); padding: 6px 12px; border: 0; background: none; border-radius: var(--r-m); text-align: left; cursor: pointer; transition: background .15s; }
.lesson:active { background: var(--surface-2); }
.lesson-ic { width: 38px; height: 38px; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; flex: none; }
.lesson.done .lesson-ic { background: var(--ok-soft); color: var(--ok); } .lesson.challenge .lesson-ic { background: var(--warn-soft); color: #B7791F; }
.lesson.is-next { background: var(--brand-soft); } .lesson.is-next .lesson-ic { background: var(--brand); color: #fff; }
.lesson.locked { opacity: .55; }
.lesson-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; } .lesson-t small { color: var(--ink-3); }
.lesson .go, .lesson > .icon-lock { color: var(--ink-3); }

/* lesson host and done screen */
.player-host { position: fixed; inset: 0; z-index: 60; background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); }
.player-host > * { flex: 1 1 auto; min-height: 0; }
.done-card { display: flex; flex-direction: column; align-items: center; gap: var(--sp-4); text-align: center; padding: var(--sp-6) var(--sp-5); }
.done-stars .stars { gap: 8px; } .done-stars .stars svg { animation: pop .6s ease both; } .done-stars .stars svg:nth-child(2) { animation-delay: .15s; } .done-stars .stars svg:nth-child(3) { animation-delay: .3s; }
.done-stats { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: center; }
.unlock-box { background: var(--ok-soft); border-radius: var(--r-m); padding: var(--sp-4); text-align: left; width: 100%; }
.unlock-box h2 { font-size: var(--fs-m); margin-bottom: var(--sp-2); } .unlock-box ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.unlock-box li { display: flex; align-items: center; gap: 8px; font-weight: 650; color: #0F7A52; }
body[data-band="912"] .done-stars .stars svg { animation: none; }

/* parent area */
.gate { padding-top: var(--sp-5); align-items: center; }
.gate-ic { width: 76px; height: 76px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.pin { display: flex; flex-direction: column; align-items: center; }
.pin-dots { display: flex; gap: 16px; justify-content: center; margin: var(--sp-4) 0 var(--sp-2); }
.pin-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink-3); transition: background .15s, border-color .15s; } .pin-dot.on { background: var(--brand); border-color: var(--brand); }
.pin-dots.shake { animation: shake .4s; }
.pin-msg { min-height: 1.6em; color: var(--bad); font-weight: 650; text-align: center; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 80px); gap: 12px; justify-content: center; margin: var(--sp-2) auto var(--sp-4); }
.pin-k { height: 66px; border-radius: var(--r-l); border: 1.5px solid var(--line); background: var(--surface); box-shadow: var(--sh-1); font-size: 26px; font-weight: 600; cursor: pointer; display: grid; place-items: center; transition: transform .1s, background .1s; }
.pin-k:active { transform: scale(.94); background: var(--brand-soft); } .pin-del { color: var(--ink-2); }
.kid-pick { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.kid-b { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 16px 0 8px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 650; cursor: pointer; }
.kid-b.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); } .kid-av { line-height: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: var(--r-l); }
.tab { flex: 1 1 auto; min-height: 44px; padding: 0 14px; border: 0; background: none; border-radius: calc(var(--r-l) - 4px); font-weight: 650; color: var(--ink-2); cursor: pointer; transition: background .15s, color .15s; }
.tab.on { background: var(--surface); color: var(--brand); box-shadow: var(--sh-1); }
.tab-body { display: flex; flex-direction: column; gap: var(--sp-4); }
.tab-body > * { min-width: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
.stat { display: flex; flex-direction: column; padding: var(--sp-3) var(--sp-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--sh-1); min-width: 0; }
.stat-l { color: var(--ink-2); font-size: var(--fs-s); font-weight: 650; } .stat-v { font-size: var(--fs-xl); line-height: 1.2; overflow-wrap: anywhere; } .stat-s { color: var(--ink-3); font-size: var(--fs-s); }
.spark { display: flex; align-items: flex-end; gap: 5px; height: 140px; margin-top: var(--sp-3); }
.spark-c { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.spark-bar { width: 100%; max-width: 28px; max-height: calc(100% - 22px); background: var(--line); border-radius: 6px 6px 2px 2px; transition: height .4s; } .spark-bar.on { background: var(--brand); }
.spark-c small { font-size: 11px; color: var(--ink-3); }
.lvl-d summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: var(--tap); cursor: pointer; list-style: none; }
.lvl-d summary::-webkit-details-marker { display: none; }
.prog-unit { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3) 0; border-top: 1px solid var(--line); }
.prog-head { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.pcells { display: flex; flex-wrap: wrap; gap: 6px; }
.pcell { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 8px; border-radius: 10px; background: var(--surface-2); color: var(--ink-3); } .pcell.done { color: var(--brand); background: var(--brand-soft); }
.work-list { display: flex; flex-direction: column; gap: var(--sp-4); }
.work { display: flex; flex-direction: column; gap: var(--sp-3); }
.work-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-3); } .work-head small { display: block; }
.wtext { background: var(--surface-2); border-radius: var(--r-m); padding: var(--sp-3) var(--sp-4); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; font-size: var(--fs-m); }
.wtext.target { font-family: var(--font-learn); font-size: calc(var(--fs-m) + 2px); }
.hl { display: inline; padding: 0 2px; border: 0; border-bottom: 3px solid var(--warn); background: var(--warn-soft); border-radius: 3px; line-height: inherit; cursor: pointer; }
.hl-spelling { border-color: var(--bad); background: var(--bad-soft); } .hl-capital, .hl-punct { border-color: var(--brand); background: var(--brand-soft); } .hl-word { border-color: #8B5CF6; background: #F1EAFE; } .hl-style { border-color: var(--ink-3); background: var(--surface-2); }
.issue-info { display: none; background: var(--warn-soft); border-radius: var(--r-m); padding: var(--sp-3) var(--sp-4); } .issue-info.on { display: block; }
.fixline { display: block; font-weight: 700; color: #0F7A52; }
.issues ul { padding-left: 18px; margin-top: var(--sp-2); } .issues li { margin: 6px 0; } .issues summary { cursor: pointer; font-weight: 700; min-height: 36px; }
.feed ul { margin-top: 4px; } .feed-praise b { color: var(--ok); } .feed-next b { color: var(--brand); }
.w { display: inline-block; padding: 1px 8px; border-radius: 8px; font-weight: 700; margin: 2px 0; }
.w-ok { background: var(--ok-soft); color: #0F7A52; } .w-near { background: var(--warn-soft); color: #9A6200; } .w-miss { background: var(--bad-soft); color: #B4282D; }
.notice-s { background: var(--warn-soft); border-radius: var(--r-m); padding: var(--sp-2) var(--sp-3); font-weight: 600; }
.hw-wrap { background: #fff; border-radius: var(--r-m); } .hw-img { width: 100%; max-width: 680px; display: block; border: 1px solid var(--line); border-radius: var(--r-m); background: #fff; }
.marks { display: flex; flex-direction: column; gap: var(--sp-2); border-top: 1px solid var(--line); padding-top: var(--sp-3); align-items: flex-start; }
.marks .note { width: 100%; } .mark-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.mark-b { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 650; color: var(--ink-2); cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.mark-good.on { background: var(--ok-soft); border-color: var(--ok); color: #0F7A52; } .mark-again.on { background: var(--warn-soft); border-color: var(--warn); color: #9A6200; }
.review .rv-q { font-weight: 700; font-size: var(--fs-l); overflow-wrap: anywhere; }
.set { display: flex; flex-direction: column; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4); padding: var(--sp-3) 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.set-row:last-child { border-bottom: 0; } .set-l { flex: 1 1 200px; display: flex; flex-direction: column; } .set-c { flex: 0 1 auto; max-width: 100%; }
.set-actions { padding: var(--sp-3) 0; border-bottom: 1px solid var(--line); } .set.danger { border-color: rgba(229, 72, 77, .3); align-items: flex-start; }
select.input { padding-right: 32px; }

/* banners, toasts, modal, boot */
.wx-banner { display: flex; align-items: flex-start; gap: var(--sp-3); position: sticky; top: 0; z-index: 150; background: #FFF4D6; color: #5C4300; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid #F0DCA0; }
.wx-banner > svg { flex: none; margin-top: 3px; } .wx-t { flex: 1; display: flex; flex-direction: column; font-size: var(--fs-s); }
#toasts { position: fixed; left: 0; right: 0; bottom: calc(84px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); pointer-events: none; z-index: 400; padding: 0 var(--sp-4); }
.toast { background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; box-shadow: var(--sh-2); font-weight: 600; font-size: var(--fs-s); max-width: 100%; text-align: center; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.toast.on { opacity: 1; transform: none; }
.modal-bg { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: var(--sp-4); background: rgba(20, 33, 61, .5); opacity: 0; transition: opacity .2s; }
.modal-bg.on { opacity: 1; }
.modal { width: 100%; max-width: 440px; background: var(--surface); border-radius: var(--r-l); box-shadow: var(--sh-2); padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-4); transform: scale(.96); transition: transform .2s; max-height: 90vh; overflow-y: auto; }
.modal-bg.on .modal { transform: none; } .modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-2); }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--ink-2); font-weight: 650; padding: var(--sp-5); text-align: center; }
.boot.err { color: var(--bad); }

/* wider screens */
@media (min-width: 640px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  #nav { top: 0; right: auto; bottom: 0; width: var(--nav-w); flex-direction: column; justify-content: flex-start; gap: 6px; padding: var(--sp-5) 10px; border-top: 0; border-right: 1px solid var(--line); box-shadow: 2px 0 14px rgba(20, 33, 61, .04); }
  .nav-b { flex: none; min-height: 68px; }
  #app.has-nav { padding-left: var(--nav-w); }
  #app.has-nav .view { padding-bottom: var(--sp-6); padding-top: var(--sp-5); }
  #toasts { bottom: var(--sp-5); }
  .unit-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .hero { padding: var(--sp-5); flex-direction: column; align-items: flex-start; }
  .topbar-chips .chip { padding: 4px 10px; }
  .pin-pad { grid-template-columns: repeat(3, 72px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
