/* AI 영문법 화면 스타일 — 게임식 학습 길·한 화면 한 문제·아래에서 올라오는 피드백 시트·오감 카드·3D 교구 무대 */
:root {
  --bg: #f4f6fb; --surface: #ffffff; --surface-2: #f7f8fc; --ink: #1d2b36; --muted: #667085; --line: #e3e7ef;
  --primary: #2bb673; --primary-d: #1d8f58; --primary-l: #dff6ea;
  --gold: #ffc83d; --gold-d: #d9a10e; --gold-l: #fff4cf;
  --blue: #3aa7f0; --blue-d: #1f86cc; --blue-l: #e1f1fd;
  --red: #ff5f5f; --red-d: #d83c3c; --red-l: #ffe3e3;
  --orange: #ff9f43; --orange-d: #e07c1c; --orange-l: #fff0dd;
  --purple: #8b6cf6; --purple-d: #6447d6; --purple-l: #efe9ff; --gray: #c7cdd8; --gray-d: #a4acba;
  --radius: 18px; --font: "Pretendard", "Noto Sans KR", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111827; --surface: #1c2433; --surface-2: #232d3f; --ink: #eef2f7; --muted: #9aa6b8; --line: #2f3a4f;
    --primary-l: #18392a; --gold-l: #3d3315; --blue-l: #17324a; --red-l: #4a2222; --orange-l: #43301a; --purple-l: #2c2650; --gray: #3a4558; --gray-d: #2c3546;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 1rem/1.6 var(--font); min-height: 100svh; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.h1[tabindex="-1"]:focus, .h1[tabindex="-1"]:focus-visible { outline: none; }
[hidden] { display: none !important; }

/* ── 단추: 두툼한 게임 단추 ── */
.btn { --c: var(--primary); --cd: var(--primary-d); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 22px; border-radius: 16px; background: var(--c); color: #fff; font-weight: 800; font-size: 1.0625rem; letter-spacing: .02em; box-shadow: 0 4px 0 var(--cd); transition: transform .06s, box-shadow .06s, filter .15s; text-decoration: none; }
.btn:active:not([disabled]) { transform: translateY(4px); box-shadow: 0 0 0 var(--cd); }
.btn:hover:not([disabled]) { filter: brightness(1.04); }
.btn[disabled] { --c: var(--gray); --cd: var(--gray-d); color: #fff; cursor: not-allowed; }
.btn--wide { width: 100%; }
.btn--gold { --c: var(--gold); --cd: var(--gold-d); color: #3b2a00; }
.btn--blue { --c: var(--blue); --cd: var(--blue-d); }
.btn--red { --c: var(--red); --cd: var(--red-d); }
.btn--orange { --c: var(--orange); --cd: var(--orange-d); }
.btn--purple { --c: var(--purple); --cd: var(--purple-d); }
.btn--ghost { --c: var(--surface); --cd: var(--line); color: var(--ink); border: 2px solid var(--line); }
.btn--sm { min-height: 44px; padding: 8px 14px; font-size: .9375rem; border-radius: 14px; }

/* ── 바깥 틀 ── */
.app { max-width: 640px; margin: 0 auto; min-height: 100svh; display: flex; flex-direction: column; }
.screen { flex: 1; padding: 16px 16px 112px; }
.loading { text-align: center; color: var(--muted); padding: 40px 16px; }

/* 상단 HUD */
.hud { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 6px; padding: 10px 16px; background: var(--bg); border-bottom: 2px solid var(--line); flex-wrap: wrap; }
.hud__course { display: flex; align-items: center; gap: 6px; padding: 6px 12px; min-height: 44px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); font-weight: 800; max-width: 100%; min-width: 0; }
.hud__course span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud__stat { display: flex; align-items: center; gap: 4px; font-weight: 900; padding: 4px 6px; white-space: nowrap; }
.hud__stat--fire { color: var(--orange); }
.hud__stat--xp { color: var(--gold-d); }
.hud__spacer { flex: 1; }
.ring { --p: 0; width: 42px; height: 42px; border-radius: 50%; background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--line) 0); display: grid; place-items: center; flex: none; }
.ring::after { content: attr(data-label); width: 32px; height: 32px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: .6875rem; font-weight: 900; }

/* 아래 탭 */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; background: var(--surface); border-top: 2px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
.tabbar__in { display: flex; width: 100%; max-width: 640px; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 56px; padding: 6px 4px; border-radius: 14px; font-size: .75rem; font-weight: 800; color: var(--muted); position: relative; }
.tab b { font-size: 1.5rem; line-height: 1; }
.tab.on { color: var(--blue-d); background: var(--blue-l); }
.tab .dot { position: absolute; top: 2px; right: calc(50% - 26px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: .6875rem; line-height: 18px; }

/* 코치 말풍선 */
.coach { display: flex; align-items: flex-end; gap: 10px; margin: 6px 0 16px; }
.coach img { width: 76px; height: 76px; object-fit: contain; flex: none; animation: bob 2.6s ease-in-out infinite; }
.bubble { position: relative; flex: 1; min-width: 0; background: var(--surface); border: 2px solid var(--line); border-radius: 18px; padding: 12px 14px; font-weight: 700; }
.bubble::before { content: ""; position: absolute; left: -9px; bottom: 18px; width: 14px; height: 14px; background: var(--surface); border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: rotate(45deg); }
.bubble small { display: block; color: var(--muted); font-weight: 600; margin-top: 4px; }
@keyframes bob { 50% { transform: translateY(-6px); } }

.card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.h1 { font-size: 1.5rem; line-height: 1.3; margin: 0 0 6px; font-weight: 900; }
.h2 { font-size: 1.1875rem; margin: 0 0 10px; font-weight: 900; }
.sub { color: var(--muted); margin: 0 0 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--blue-l); color: var(--blue-d); font-size: .8125rem; font-weight: 800; }
.chip--gold { background: var(--gold-l); color: #8a6400; }
.chip--green { background: var(--primary-l); color: var(--primary-d); }
.chip--red { background: var(--red-l); color: var(--red-d); }

/* ── 첫 화면 ── */
.hero { text-align: center; padding: 24px 8px 8px; }
.hero img { width: 150px; height: 150px; object-fit: contain; animation: bob 2.6s ease-in-out infinite; }
.hero .h1 { font-size: 1.875rem; }
.pick { display: grid; gap: 12px; }
.pick__btn { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; min-height: 76px; border-radius: 18px; background: var(--surface); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); text-align: left; font-weight: 800; font-size: 1.0625rem; transition: transform .06s; }
.pick__btn:active { transform: translateY(4px); box-shadow: none; }
.pick__btn b { font-size: 2rem; line-height: 1; flex: none; }
.pick__btn small { display: block; font-weight: 600; color: var(--muted); font-size: .8125rem; }
.steps-dots { display: flex; justify-content: center; gap: 6px; margin: 4px 0 14px; }
.steps-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.steps-dots i.on { width: 22px; border-radius: 4px; background: var(--primary); }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 6px 4px; font-weight: 800; color: var(--muted); }

/* ── 학습 길 ── */
.unit { margin: 18px 0 8px; padding: 14px 16px; border-radius: 18px; color: #fff; background: var(--uc, var(--primary)); box-shadow: 0 4px 0 var(--ucd, var(--primary-d)); }
.unit b { display: block; font-size: 1.0625rem; }
.unit small { opacity: .92; font-weight: 600; }
.path { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 18px 0 4px; }
.node-wrap { position: relative; display: flex; flex-direction: column; align-items: center; transform: translateX(var(--x, 0)); }
.node { position: relative; width: 74px; height: 70px; border-radius: 50%; display: grid; place-items: center; font-size: 1.75rem; background: var(--nc, var(--primary)); box-shadow: 0 7px 0 var(--ncd, var(--primary-d)); transition: transform .08s; }
.node:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--ncd, var(--primary-d)); }
.node[data-s="locked"] { --nc: var(--gray); --ncd: var(--gray-d); }
.node[data-s="mastered"] { --nc: var(--gold); --ncd: var(--gold-d); }
.node[data-s="due"] { --nc: var(--blue); --ncd: var(--blue-d); }
.node[data-s="test"] { --nc: var(--purple); --ncd: var(--purple-d); border-radius: 22px; }
.node__prog { position: absolute; inset: -8px; border-radius: 50%; background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--line) 0); -webkit-mask: radial-gradient(circle, transparent 42px, #000 43px); mask: radial-gradient(circle, transparent 42px, #000 43px); }
.node-wrap.now .node { animation: pulse 1.6s ease-in-out infinite; }
.node-wrap.now { margin-top: 26px; } /* "시작!" 말풍선이 윗 유닛 띠 글자를 덮지 않게 */
.node-tip { position: absolute; bottom: calc(100% + 12px); white-space: nowrap; background: var(--surface); color: var(--primary-d); border: 2px solid var(--line); border-radius: 12px; padding: 4px 12px; font-weight: 900; font-size: .875rem; animation: bob 1.8s ease-in-out infinite; }
.node-label { display: block; margin-top: 12px; max-width: 150px; text-align: center; font-size: .8125rem; font-weight: 700; color: var(--muted); line-height: 1.35; }
@keyframes pulse { 50% { transform: scale(1.07); } }

/* 아래에서 올라오는 시트(노드 정보·설정 등) */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet-panel { width: 100%; max-width: 640px; max-height: 88svh; overflow: auto; background: var(--surface); border-radius: 24px 24px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); animation: up .25s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.meter { height: 12px; border-radius: 6px; background: var(--line); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--primary); border-radius: 6px; transition: width .4s; }

/* ── 레슨 ── */
.lesson { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: flex; flex-direction: column; }
.lesson__top { display: flex; align-items: center; gap: 10px; padding: 12px 16px; max-width: 640px; width: 100%; margin: 0 auto; }
.lesson__x { width: 44px; height: 44px; border-radius: 12px; font-size: 1.375rem; color: var(--muted); flex: none; }
.bar { flex: 1; height: 16px; border-radius: 8px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--primary); border-radius: 8px; transition: width .35s ease; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .1); }
.combo { min-width: 54px; text-align: right; font-weight: 900; color: var(--orange); white-space: nowrap; }
.combo.pop { animation: popin .35s; }
.lesson__body { flex: 1; overflow: auto; padding: 8px 16px 24px; max-width: 640px; width: 100%; margin: 0 auto; }
.lesson__foot { padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 2px solid var(--line); background: var(--bg); }
.lesson__foot > div { max-width: 640px; margin: 0 auto; display: flex; gap: 10px; }
.lesson__foot .btn { flex: 1; }
.kind { font-size: .8125rem; font-weight: 900; color: var(--purple); letter-spacing: .04em; margin-bottom: 6px; }
.prompt { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.prompt img { width: 64px; height: 64px; object-fit: contain; flex: none; }
.prompt .bubble { font-size: 1.0625rem; }
.say-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--blue); color: #fff; box-shadow: 0 3px 0 var(--blue-d); font-size: 1.125rem; vertical-align: middle; flex: none; }
.say-btn--big { width: 88px; height: 88px; border-radius: 24px; font-size: 2.5rem; box-shadow: 0 6px 0 var(--blue-d); }
.center { text-align: center; }

.choices { display: grid; gap: 12px; }
.choice { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 4px 0 var(--line); text-align: left; font-size: 1.0625rem; font-weight: 700; transition: transform .06s; }
.choice:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.choice .key { flex: none; width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--line); display: grid; place-items: center; font-size: .8125rem; color: var(--muted); }
.choice.sel { border-color: var(--blue); background: var(--blue-l); box-shadow: 0 4px 0 var(--blue); }
.choice.sel .key { border-color: var(--blue); color: var(--blue-d); }
.choice.ok { border-color: var(--primary); background: var(--primary-l); box-shadow: 0 4px 0 var(--primary); }
.choice.no { border-color: var(--red); background: var(--red-l); box-shadow: 0 4px 0 var(--red); animation: shake .35s; }
.stem { font-size: 1.375rem; line-height: 1.9; font-weight: 700; margin: 6px 0 16px; }
.stem .hl { text-decoration: none; background: var(--blue-l); border-bottom: 4px solid var(--blue); padding: 0 1px; }
.blank { display: inline-block; min-width: 96px; border-bottom: 4px solid var(--blue); text-align: center; color: var(--blue-d); padding: 0 6px; }
.tokens { display: flex; flex-wrap: wrap; gap: 8px; font-size: 1.25rem; }
.tok { min-height: 52px; padding: 8px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); box-shadow: 0 4px 0 var(--line); font-weight: 700; }
.tok.sel { border-color: var(--blue); background: var(--blue-l); box-shadow: 0 4px 0 var(--blue); }
.tok.ok { border-color: var(--primary); background: var(--primary-l); }
.tok.no { border-color: var(--red); background: var(--red-l); }
.answer-line { min-height: 70px; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; padding: 10px 4px; border-bottom: 2px solid var(--line); margin-bottom: 16px; }
.answer-line:empty::before { content: "아래 낱말 카드를 눌러 문장을 만들어요"; color: var(--muted); font-size: .9375rem; align-self: center; }
.tile { min-height: 52px; padding: 8px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); box-shadow: 0 4px 0 var(--line); font-size: 1.125rem; font-weight: 800; animation: popin .2s; }
.tile.used { visibility: hidden; }
.text-in { width: 100%; min-height: 96px; padding: 14px; font: 600 1.125rem/1.5 var(--font); border: 2px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); }
.text-in:focus { border-color: var(--blue); outline: none; }
.given { font-size: 1.25rem; font-weight: 700; padding: 12px 14px; background: var(--red-l); border-radius: 14px; margin-bottom: 12px; }

/* 그림 고르기(유아) */
.pics { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr)); margin-top: 16px; }
.pic-opt { min-height: 140px; border-radius: 24px; border: 3px solid var(--line); background: var(--surface); box-shadow: 0 6px 0 var(--line); font-size: 4rem; }
.pic-opt.sel { border-color: var(--blue); box-shadow: 0 6px 0 var(--blue); background: var(--blue-l); }
.pic-opt.ok { border-color: var(--primary); background: var(--primary-l); animation: popin .35s; }
.pic-opt.no { opacity: .55; animation: shake .35s; }
.big-pic { font-size: 6rem; text-align: center; line-height: 1.2; animation: popin .4s; }

/* 개념 카드 */
.concept { background: var(--surface); border: 2px solid var(--line); border-radius: 22px; padding: 18px; }
.pattern { display: inline-block; font-size: 1.25rem; font-weight: 900; color: var(--purple); background: var(--purple-l); border-radius: 12px; padding: 6px 14px; margin: 6px 0 12px; }
.contrast { display: grid; gap: 8px; margin: 12px 0; }
.contrast div { padding: 12px 14px; border-radius: 14px; font-size: 1.125rem; font-weight: 700; }
.contrast .x { background: var(--red-l); text-decoration: line-through; text-decoration-color: var(--red); }
.contrast .o { background: var(--primary-l); }
.ex { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.ex li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); font-size: 1.0625rem; font-weight: 600; }
details.rule { margin-top: 12px; border-radius: 14px; background: var(--surface-2); padding: 4px 14px; }
details.rule summary { min-height: 44px; display: flex; align-items: center; font-weight: 800; cursor: pointer; }

/* 지문 */
.passage { font-size: 1.1875rem; line-height: 2.2; }
.blk { display: inline-flex; gap: 4px; margin: 0 2px; vertical-align: middle; flex-wrap: wrap; }
.blk button { min-height: 44px; padding: 0 10px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); font-size: 1rem; font-weight: 700; }
.blk button.sel { border-color: var(--blue); background: var(--blue-l); }
.blk button.ok { border-color: var(--primary); background: var(--primary-l); }
.blk button.no { border-color: var(--red); background: var(--red-l); text-decoration: line-through; }

/* 피드백 시트 */
.fb { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); animation: up .22s ease-out; }
.fb > div { max-width: 640px; margin: 0 auto; }
.fb--ok { background: var(--primary-l); }
.fb--hint { background: var(--orange-l); }
.fb--bad { background: var(--red-l); }
.fb h3 { margin: 0 0 6px; font-size: 1.375rem; font-weight: 900; display: flex; align-items: center; gap: 8px; }
.fb--ok h3 { color: var(--primary-d); }
.fb--hint h3 { color: var(--orange-d); }
.fb--bad h3 { color: var(--red-d); }
.fb p { margin: 4px 0 12px; font-weight: 600; }
.fb .ans { font-size: 1.125rem; font-weight: 800; }
.fb .btn { width: 100%; }
.xp-pop { position: fixed; z-index: 60; font-weight: 900; color: var(--gold-d); font-size: 1.5rem; pointer-events: none; animation: rise 1s ease-out forwards; }
@keyframes rise { to { transform: translateY(-60px); opacity: 0; } }
@keyframes popin { 0% { transform: scale(.7); } 70% { transform: scale(1.08); } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.toast { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 70; background: var(--orange); color: #fff; font-weight: 900; padding: 8px 18px; border-radius: 999px; white-space: nowrap; animation: popin .3s, fadeout .5s 1.3s forwards; }
@keyframes fadeout { to { opacity: 0; } }

/* 완료 화면 */
.done { text-align: center; padding-top: 18px; }
.done img { width: 170px; height: 170px; object-fit: contain; animation: popin .5s; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr)); gap: 10px; margin: 18px 0; }
.stat { border-radius: 16px; border: 2px solid var(--sc, var(--gold)); overflow: hidden; }
.stat b { display: block; background: var(--sc, var(--gold)); color: #fff; font-size: .8125rem; padding: 4px; }
.stat span { display: block; font-size: 1.5rem; font-weight: 900; padding: 8px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* 낱말카드(오감) */
.deck { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 96px), 1fr)); }
.mini { aspect-ratio: 3 / 4; border-radius: 18px; background: var(--c, var(--surface)); border: 2px solid rgba(0, 0, 0, .06); box-shadow: 0 4px 0 rgba(0, 0, 0, .08); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 900; color: #1d2b36; }
.mini i { font-style: normal; font-size: 2.75rem; line-height: 1; }
.wcard { perspective: 900px; width: min(100%, 300px); aspect-ratio: 3 / 4; margin: 0 auto 14px; }
.wcard__in { position: relative; width: 100%; height: 100%; transition: transform .5s; transform-style: preserve-3d; }
.wcard.flip .wcard__in { transform: rotateY(180deg); }
.wcard__face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 26px; border: 3px solid rgba(0, 0, 0, .08); box-shadow: 0 8px 0 rgba(0, 0, 0, .08); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 14px; background: var(--c, var(--surface)); color: #1d2b36; text-align: center; }
.wcard__face.back { transform: rotateY(180deg); justify-content: flex-start; overflow: auto; }
.wcard__pic { font-size: 6rem; line-height: 1; }
.wcard__word { font-size: 2rem; font-weight: 900; }
.wcard__ko { font-weight: 700; opacity: .75; }
.senses { display: grid; gap: 8px; width: 100%; }
.sense { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 10px; border-radius: 14px; background: rgba(255, 255, 255, .8); font-weight: 700; text-align: left; color: #1d2b36; }
.sense b { font-size: 1.5rem; }
.sense small { display: block; font-weight: 600; opacity: .7; }
.wiggle { animation: wiggle .6s; }
@keyframes wiggle { 20% { transform: rotate(-8deg); } 40% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } 80% { transform: rotate(5deg); } }

/* 문장 만들기(카드 조합) */
.frame { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; font-size: 1.5rem; font-weight: 900; padding: 18px 12px; border-radius: 22px; background: var(--purple-l); border: 3px dashed var(--purple); margin-bottom: 16px; min-height: 120px; }
.frame .slot { min-width: 84px; min-height: 76px; padding: 4px 8px; border-radius: 16px; background: var(--surface); border: 3px dashed var(--purple); display: grid; place-items: center; font-size: 2.25rem; }
.frame .slot.fill { border-style: solid; animation: popin .35s; }
.made { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.made li { padding: 8px 12px; border-radius: 12px; background: var(--primary-l); font-weight: 800; }

/* 미션·리듬·교구 무대 */
.mission { text-align: center; padding: 16px; border-radius: 24px; background: var(--surface); border: 2px solid var(--line); }
.mission .big-pic { font-size: 5.5rem; }
.mission .en { font-size: 1.75rem; font-weight: 900; margin: 6px 0; }
.mission .safe { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--orange-l); font-size: .875rem; font-weight: 700; text-align: left; }
.drum { display: grid; place-items: center; width: 170px; height: 170px; border-radius: 50%; margin: 18px auto; font-size: 4.5rem; background: radial-gradient(circle at 40% 35%, #ffd27a, #ff8f3c); box-shadow: 0 10px 0 #c8641c; transition: transform .06s; }
.drum.hit { transform: translateY(8px) scale(.97); box-shadow: 0 2px 0 #c8641c; }
.beats { display: flex; justify-content: center; gap: 10px; }
.beats i { width: 18px; height: 18px; border-radius: 50%; background: var(--line); transition: background .1s, transform .1s; }
.beats i.on { background: var(--orange); transform: scale(1.3); }
.stage { position: relative; width: 100%; height: min(54svh, 420px); border-radius: 24px; overflow: hidden; background: linear-gradient(#cfeeff, #f3fbff); border: 2px solid var(--line); touch-action: pan-y; }
.stage canvas { display: block; width: 100%; height: 100%; }
.stage__say { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); background: rgba(255, 255, 255, .92); color: #1d2b36; padding: 6px 16px; border-radius: 999px; font-weight: 900; font-size: 1.25rem; white-space: nowrap; pointer-events: none; }
.stage__hint { position: absolute; left: 12px; right: 12px; bottom: 12px; text-align: center; font-weight: 700; color: #1d2b36; background: rgba(255, 255, 255, .85); border-radius: 12px; padding: 6px; font-size: .875rem; pointer-events: none; }
.stage__fallback { display: flex; height: 100%; align-items: center; justify-content: center; gap: 18px; font-size: 4rem; flex-wrap: wrap; }
.stage__fallback button { font-size: 4rem; }
.stage__tap { position: absolute; left: 50%; top: 55%; font-size: 2.6rem; line-height: 1; transform: translate(-50%, 0); opacity: 0; pointer-events: none; transition: opacity .3s; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .25)); }
.stage__tap.on { opacity: 1; animation: stage-tap 1.1s ease-in-out infinite; }
@keyframes stage-tap { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 14px); } }
.board { display: grid; gap: 6px; margin: 0 auto 14px; max-width: 300px; }
.board i { aspect-ratio: 1; border-radius: 12px; background: var(--surface-2); border: 2px solid var(--line); display: grid; place-items: center; font-style: normal; font-size: 1.75rem; }
.arrows { display: grid; grid-template-columns: repeat(3, 72px); gap: 8px; justify-content: center; }
.arrows .btn { min-height: 60px; padding: 0; font-size: 1.75rem; }
.shapes { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.shape { width: 80px; height: 80px; display: grid; place-items: center; font-size: 2.75rem; border-radius: 18px; background: var(--surface); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); }
.shape.sel { border-color: var(--blue); background: var(--blue-l); }
.shape.hole { background: #3b4252; color: #9aa3b5; box-shadow: inset 0 6px 12px rgba(0, 0, 0, .45); border-color: #2a3040; }
.shape.hole.done { background: var(--primary-l); color: inherit; box-shadow: none; }
.shape.gone { visibility: hidden; }
.pattern-row { display: flex; justify-content: center; gap: 8px; margin: 12px 0 18px; flex-wrap: wrap; }
.pattern-row i { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; font-style: normal; font-size: 1.75rem; border: 2px solid var(--line); background: var(--surface); }
.shop { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 90px), 1fr)); gap: 10px; }
.basket { min-height: 64px; border-radius: 16px; border: 3px dashed var(--line); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; font-size: 2rem; padding: 8px; margin: 12px 0; }
.talk { display: grid; gap: 6px; margin-top: 10px; }
.talk p { margin: 0; padding: 8px 12px; border-radius: 14px; background: var(--surface-2); font-weight: 700; }
.talk p.me { background: var(--blue-l); justify-self: end; }

/* 보호자 카드 */
.care { display: flex; gap: 14px; align-items: center; }
.care .big-pic { font-size: 3.5rem; animation: none; }
.care__en { font-size: 1.5rem; font-weight: 900; margin: 0; }

/* 기록·설정 */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 96px), 1fr)); gap: 10px; }
.badge { text-align: center; padding: 12px 6px; border-radius: 18px; background: var(--surface-2); border: 2px solid var(--line); font-size: .8125rem; font-weight: 800; }
.badge b { display: block; font-size: 2.25rem; line-height: 1.2; }
.badge.off { opacity: .4; filter: grayscale(1); }
.ladder { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ladder li { display: grid; grid-template-columns: minmax(52px, auto) 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.ladder li.now { background: var(--blue-l); }
.ladder em { font-style: normal; font-weight: 900; text-align: center; background: var(--surface); border-radius: 10px; padding: 2px 6px; white-space: nowrap; font-size: .8125rem; }
.field { display: grid; gap: 6px; margin-bottom: 14px; font-weight: 800; }
.field { min-width: 0; }
.field select { width: 100%; max-width: 100%; min-width: 0; text-overflow: ellipsis; min-height: 48px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: 700 1rem var(--font); padding: 0 12px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; font-weight: 800; }
.range { display: grid; gap: 6px; }
.range label { display: flex; gap: 10px; align-items: center; min-height: 48px; padding: 6px 10px; border-radius: 12px; background: var(--surface-2); font-weight: 700; }
.range input { width: 22px; height: 22px; flex: none; }
.foot-note { text-align: center; font-size: .75rem; color: var(--muted); padding: 8px 16px 0; }
.foot-note a { display: inline-block; padding: 8px 4px; }

/* ── 사진풍 애니메이션: 승인된 실사 사진에 느린 줌·팬·둥실·날씨 겹 레이어. 승인 전에는 이모지에 같은 움직임 ── */
.pa { position: relative; overflow: hidden; width: min(100%, 300px); aspect-ratio: 4 / 3; margin: 0 auto 10px; border-radius: 22px; background: linear-gradient(160deg, var(--blue-l), var(--gold-l)); box-shadow: inset 0 0 0 3px rgba(255,255,255,.6); }
.pa img, .pa > span { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform-origin: 50% 60%; }
.pa > span { display: grid; place-items: center; font-size: 5.5rem; line-height: 1; }
.pa--zoom img, .pa--zoom > span, .pa--rain img, .pa--rain > span, .pa--snow img, .pa--snow > span, .pa--sun img, .pa--sun > span { animation: kb 9s ease-in-out infinite alternate; }
.pa--pan img, .pa--pan > span { animation: pan 10s ease-in-out infinite alternate; }
.pa--float img, .pa--float > span { animation: floaty 6s ease-in-out infinite; }
.pa.beat { animation: beatpop .22s ease-out; }
.pa__fx { position: absolute; inset: 0; pointer-events: none; }
.pa--rain .pa__fx { background-image: linear-gradient(transparent 0 70%, rgba(255,255,255,.75) 70% 100%); background-size: 3px 26px; opacity: .55; animation: rainfx 1.6s linear infinite; }
.pa--snow .pa__fx { background-image: radial-gradient(circle, #fff 0 2px, transparent 3px), radial-gradient(circle, #fff 0 1.5px, transparent 2.5px); background-size: 38px 38px, 24px 24px; background-position: 0 0, 12px 8px; animation: snowfx 7s linear infinite; }
.pa--sun .pa__fx { background: radial-gradient(circle at 78% 18%, rgba(255,236,150,.75), transparent 45%); animation: pulse 5s ease-in-out infinite; }
@keyframes kb { from { transform: scale(1); } to { transform: scale(1.08) translate(-1.5%, -1%); } }
@keyframes pan { from { transform: scale(1.1) translateX(-3%); } to { transform: scale(1.1) translateX(3%); } }
@keyframes floaty { 50% { transform: translateY(-6px); } }
@keyframes beatpop { 50% { transform: scale(1.03); } }
@keyframes rainfx { to { background-position: 0 26px; } }
@keyframes snowfx { to { background-position: 0 38px, 12px 32px; } }
.wcard__pic { width: 82%; }
.wcard__pic .pa { width: 100%; margin: 0; }
.wcard__pic .pa > span { font-size: 5rem; }
.pic-opt--photo { padding: 6px; }
.pic-opt--photo .pa { width: 100%; margin: 0; border-radius: 18px; }

/* ── 챈트: 4박 칸·메기고 받기·한 줄 챈트 띠 ── */
.beats4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 8px auto; max-width: 420px; }
.beats4 i { font-style: normal; display: grid; place-items: center; min-height: 52px; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 2px solid var(--line); font-weight: 900; font-size: 1.05rem; text-align: center; line-height: 1.2; overflow-wrap: break-word; transition: background .08s, transform .08s; }
.beats4 i.on { background: var(--orange); border-color: var(--orange-d); color: #fff; transform: scale(1.06); }
.chl { text-align: center; }
.ch-role { display: inline-block; margin: 4px 0 8px; padding: 4px 12px; border-radius: 999px; font-weight: 900; background: var(--blue-l); }
.ch-role--echo { background: var(--primary-l); }
.ch-role--all { background: var(--gold-l); }
.drum--sm { width: 120px; height: 120px; font-size: 3.2rem; margin: 10px auto; }
.ch-lines { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
.ch-lines li { padding: 6px 12px; border-radius: 12px; color: var(--muted); font-weight: 700; }
.ch-lines li.ch-echo { padding-left: 28px; }
.ch-lines li.on { background: var(--orange-l); color: var(--ink); }
.cstrip { display: flex; align-items: center; gap: 8px; max-width: 460px; margin: 10px auto 0; }
.cstrip .beats4 { flex: 1; margin: 0; }
.cstrip .beats4 i { min-height: 44px; padding: 2px; font-size: clamp(.72rem, 3.3vw, .95rem); }
.cstrip__go { flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--orange); color: #fff; font-size: 1.4rem; box-shadow: 0 4px 0 var(--orange-d); }

/* ── 문법 태깅·강조 채색: 성분 색(Okabe-Ito)·밑줄 모양·라벨을 함께 — 색만으로 구별하지 않음 ── */
:root { --sx-S: #0072b2; --sx-V: #d55e00; --sx-O: #008a63; --sx-I: #2f8fc9; --sx-D: #008a63; --sx-C: #b4508f; --sx-K: #b97a00; --sx-M: #6b7686; --sx-hit: #fff1a8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --sx-S: #56b4e9; --sx-V: #ff8a4c; --sx-O: #3fd0a4; --sx-I: #8fd3ff; --sx-D: #3fd0a4; --sx-C: #f08fc8; --sx-K: #f5c04a; --sx-M: #a4adbb; --sx-hit: #5a4b00; } }
.sx { line-height: 2.6; }
.sx--plain { line-height: inherit; }
.sx-ck { display: inline-flex; flex-direction: column; align-items: center; vertical-align: top; margin: 0 2px 4px; line-height: 1.35; }
.sx-ck > .sx-txt { padding: 0 2px 2px; border-bottom: 3px solid var(--c); font-weight: 800; color: var(--ink); }
.sx-ck > b { font-size: .6875rem; font-weight: 800; color: var(--c); letter-spacing: .01em; white-space: nowrap; margin-top: 2px; }
.sx-ck--S { --c: var(--sx-S); } .sx-ck--V { --c: var(--sx-V); } .sx-ck--O { --c: var(--sx-O); } .sx-ck--I { --c: var(--sx-I); } .sx-ck--D { --c: var(--sx-D); } .sx-ck--C { --c: var(--sx-C); } .sx-ck--K { --c: var(--sx-K); } .sx-ck--M { --c: var(--sx-M); }
.sx-ck--V > .sx-txt { border-bottom-style: double; border-bottom-width: 5px; }
.sx-ck--O > .sx-txt, .sx-ck--D > .sx-txt { border-bottom-style: dashed; }
.sx-ck--I > .sx-txt { border-bottom-style: dotted; border-bottom-width: 4px; }
.sx-ck--K > .sx-txt, .sx-ck--C > .sx-txt { border-bottom-style: solid; box-shadow: inset 0 -7px 0 color-mix(in srgb, var(--c) 18%, transparent); }
.sx-ck--M > .sx-txt { border-bottom-width: 1px; font-weight: 600; }
.sx-hit { background: var(--sx-hit); border-radius: 4px; padding: 0 2px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 25%, transparent); }
.sx-wrong { color: var(--red-d); text-decoration: underline wavy var(--red) 2px; text-underline-offset: 4px; font-weight: 900; }
.contrast .x .sx-wrong { text-decoration: underline wavy var(--red) 2px; }
.sx-pos { display: inline-flex; flex-direction: column; align-items: center; vertical-align: top; margin: 0 2px 4px; line-height: 1.35; }
.sx-pos > b { font-size: .6875rem; color: var(--muted); font-weight: 800; }
.sx-ko { display: inline-flex; flex-wrap: wrap; align-items: flex-start; gap: 2px 4px; line-height: 1.35; }
.sx-arrow { font-style: normal; color: var(--muted); align-self: center; }
.sx-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.sx-tag { font-size: .75rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--purple-l); color: var(--purple-d); }
.sx-tag--p { background: var(--blue-l); color: var(--blue-d); }
.sx-modes { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); margin: 8px 0 4px; }
.sx-mode { min-height: 40px; padding: 0 14px; border-radius: 9px; font-weight: 800; font-size: .875rem; color: var(--muted); }
.sx-mode.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.sx-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; }
.sx-legend .sx-ck { flex-direction: row; } .sx-legend .sx-ck > b { font-size: .75rem; border-bottom: 3px solid var(--c); }
.sx-list li { align-items: flex-start; }
.sx-list li > span { min-width: 0; }
.sx-more { margin: 4px 0 12px; } .sx-more summary { cursor: pointer; font-weight: 800; min-height: 44px; display: flex; align-items: center; }
.fb > div { max-height: 82svh; overflow-y: auto; }

/* ── 개념 페이지(책 원고): 장면 → 형태·규칙 → 우리말과 다른 점 → 표·타임라인 → 채색 예문 → 정리 → 펼쳐 보기 ── */
.book { text-align: left; }
.book .hook { margin: 6px 0 12px; padding: 14px 16px; border-radius: 16px; background: var(--gold-l); font-weight: 600; line-height: 1.7; }
.book .form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; font-size: 1.0625rem; }
.book .form b { font-weight: 900; color: var(--purple-d); }
.book .rules { margin: 8px 0 12px; padding-left: 22px; display: grid; gap: 6px; font-weight: 600; line-height: 1.65; }
.book .kovs { padding: 12px 14px; border-radius: 14px; background: var(--blue-l); line-height: 1.65; }
.book .kovs b { display: block; margin-bottom: 2px; }
.book .h3 { font-size: 1.0625rem; font-weight: 900; margin: 18px 0 4px; }
.vis { margin: 14px 0; padding: 12px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); }
.vis figcaption { font-weight: 900; margin-bottom: 8px; }
.vt-wrap { overflow-x: auto; }
.vt { border-collapse: collapse; width: 100%; font-size: .9375rem; }
.vt th, .vt td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }
.vt th { font-size: .8125rem; color: var(--muted); font-weight: 800; }
.vt td.en { font-weight: 800; }
.tl { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 3px solid var(--purple); display: grid; gap: 12px; }
.tl li { position: relative; display: grid; gap: 2px; }
.tl li::before { content: ''; position: absolute; left: -26px; top: 6px; width: 13px; height: 13px; border-radius: 50%; background: var(--purple); box-shadow: 0 0 0 3px var(--surface); }
.tl b { font-size: .8125rem; color: var(--purple-d); } .tl span { font-weight: 800; } .tl small { color: var(--muted); }
.book .summary { margin: 14px 0; padding: 12px 14px; border-left: 5px solid var(--primary); background: var(--primary-l); border-radius: 0 14px 14px 0; font-weight: 800; }
small.ko { display: block; color: var(--muted); font-weight: 600; font-size: .875rem; margin-top: 2px; line-height: 1.5; }
.book details.more { margin: 8px 0; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); }
.book details.more > summary { min-height: 48px; padding: 10px 14px; font-weight: 800; cursor: pointer; display: flex; align-items: center; }
.book details.more[open] > summary { border-bottom: 1px solid var(--line); }
.book details.more > :not(summary) { margin: 10px 14px 14px; }
.talk-lines { list-style: none; padding: 0; display: grid; gap: 8px; }
.talk-lines li { display: flex; gap: 8px; align-items: flex-start; }
.talk-lines li > b { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-l); color: var(--blue-d); font-size: .8125rem; }
.talk-lines li.who-B > b { background: var(--orange-l); color: var(--orange-d); }
.steps { padding-left: 20px; display: grid; gap: 10px; } .steps p { margin: 0; } .steps .en { font-weight: 800; margin-top: 2px; }
.drill { padding-left: 20px; display: grid; gap: 10px; } .drill li > span:first-child { display: block; font-weight: 700; }
.drill .ans { display: block; font-weight: 900; color: var(--primary-d); margin-top: 4px; } .drill .btn { margin-top: 6px; }
.traps { list-style: none; padding: 0; display: grid; gap: 12px; }
.traps .x, .traps .o { padding: 8px 12px; border-radius: 12px; font-weight: 700; }
.traps .x { background: var(--red-l); } .traps .o { background: var(--primary-l); margin-top: 4px; } .traps p { margin: 6px 2px 0; }
.sheet-panel--book { max-height: 92svh; overflow-y: auto; }

/* ── 한 화면 선택기: 위에 누가(4칸), 아래에 학년·반·시험 칩. 시작 확인은 아래에서 올라오는 시트 ── */
.hero--small { padding: 8px 8px 0; }
.hero--small img { width: 96px; height: 96px; }
.hero--small .h1 { font-size: 1.5rem; margin: 2px 0; }
.aud-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0 12px; }
.aud-tab { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 10px 4px; min-height: 84px; border-radius: 16px; background: var(--surface); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); text-align: center; line-height: 1.25; }
.aud-tab b { font-size: 1.6rem; line-height: 1.1; }
.aud-tab span { font-weight: 900; font-size: .875rem; }
.aud-tab small { font-size: .6875rem; font-weight: 700; color: var(--muted); }
.aud-tab.on { background: var(--primary-l); border-color: var(--primary); box-shadow: 0 4px 0 var(--primary-d); }
.aud-tab:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.aud-hint { margin: 0 0 10px; }
.grades { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 92px), 1fr)); margin-bottom: 14px; }
.chip-grade { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 64px; padding: 8px; border-radius: 16px; background: var(--surface); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); font-weight: 900; font-size: 1.0625rem; line-height: 1.2; }
.chip-grade small { font-size: .75rem; font-weight: 700; color: var(--muted); }
.chip-grade.on { background: var(--blue-l); border-color: var(--blue); box-shadow: 0 4px 0 var(--blue-d); }
.chip-grade:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.start-sheet { text-align: center; }
.start-sheet img { width: 84px; height: 84px; object-fit: contain; }
.start-sheet .h2 { margin: 4px 0; }
.pick--2 { grid-template-columns: 1fr 1fr; gap: 10px; }
.pick--2 .pick__btn { flex-direction: column; text-align: center; gap: 4px; padding: 12px 8px; min-height: 100px; }
.pick__btn.on { background: var(--primary-l); border-color: var(--primary); }
.now-course { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.now-course span { font-size: .8125rem; font-weight: 800; color: var(--muted); }
.now-course b { font-size: 1.0625rem; }

/* ── 데스크톱: 학습 탭은 학습 길 + 오른쪽 학습 현황 패널, 다른 탭은 640px 가운데 ── */
.side { display: none; }
.side-card { background: var(--surface); border: 2px solid var(--line); border-radius: 18px; padding: 14px 16px; }
.side-card h3 { margin: 0 0 8px; font-size: .9375rem; font-weight: 900; color: var(--muted); }
.side-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; text-align: center; }
.side-stats b { display: block; font-size: 1.25rem; font-weight: 900; } .side-stats small { color: var(--muted); font-weight: 700; }
.side-big { margin: 0 0 8px; font-size: 1.75rem; font-weight: 900; } .side-big small { font-size: .875rem; color: var(--muted); }
.side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.side-list button { width: 100%; min-height: 44px; text-align: left; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); font-weight: 700; }
.side-list button:hover { background: var(--blue-l); }
@media (min-width: 1000px) {
  .app { max-width: 1120px; }
  .screen { width: 100%; max-width: 640px; margin: 0 auto; }
  .screen.screen--learn { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
  .side { display: grid; gap: 14px; position: sticky; top: 88px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── 연간 과정: 홈의 "이달의 과정" 카드와 12개월 한눈에 보기 시트 ── */
.annual { padding: 14px 16px; }
.annual__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.annual__month { font-size: 1.0625rem; font-weight: 900; }
.annual__title { margin: 0 0 4px; font-weight: 800; color: var(--primary-d); }
.annual__goal { margin: 0 0 10px; }
.annual__weeks { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.annual__wk { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border-radius: 12px; background: var(--surface-2); border: 2px solid var(--line); }
.annual__wk.on { border-color: var(--primary); background: var(--primary-l); }
.annual__wk b { font-size: 1.25rem; line-height: 1.2; }
.annual__wk small { font-size: .75rem; color: var(--muted); font-weight: 700; }
.annual__week { margin: 0 0 8px; font-weight: 700; overflow-wrap: anywhere; }
.annual__say { display: inline-block; margin: 2px 2px 0 0; padding: 2px 8px; border-radius: 10px; background: var(--blue-l); font-weight: 800; }
.annual__areas { margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.annual__small { font-size: .875rem; margin: 4px 0; }
.annual__behind { margin: 6px 0; padding: 8px 10px; border-radius: 12px; background: var(--gold-l); font-size: .875rem; font-weight: 700; }
.annual__btn { margin-top: 8px; }
.annual__start { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-weight: 700; }
.annual__start select { min-height: 44px; padding: 6px 10px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; }
.annual-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.annual-row { display: flex; gap: 10px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); }
.annual-row--now { border-color: var(--primary); background: var(--primary-l); }
.annual-row--past { opacity: .85; }
.annual-row__n { flex: none; width: 56px; text-align: center; }
.annual-row__n b { display: block; font-size: .9375rem; }
.annual-row__n small { color: var(--muted); font-weight: 700; }
.annual-row__body { flex: 1; min-width: 0; }
.annual-row__t, .annual-row__g, .annual-row__e { margin: 0 0 2px; overflow-wrap: anywhere; }
.annual-row__g { font-size: .9375rem; }
.annual-row__e { font-size: .8125rem; color: var(--muted); }
.annual-row__rate { font-size: .8125rem; font-weight: 800; color: var(--primary-d); }

/* 이달의 과정 계절 띠 — 승인된 월별 그림(art/season-MM.webp). 그림을 못 받으면 연한 색 띠로 보인다 */
.annual__art { height: 76px; margin: -14px -16px 10px; border-radius: 18px 18px 0 0; background: linear-gradient(135deg, var(--blue-l), var(--gold-l)) center / cover no-repeat; }
.annual__art[data-m="1"] { background-image: url(/ai-grammer/art/season-01.webp); }
.annual__art[data-m="2"] { background-image: url(/ai-grammer/art/season-02.webp); }
.annual__art[data-m="3"] { background-image: url(/ai-grammer/art/season-03.webp); }
.annual__art[data-m="4"] { background-image: url(/ai-grammer/art/season-04.webp); }
.annual__art[data-m="5"] { background-image: url(/ai-grammer/art/season-05.webp); }
.annual__art[data-m="6"] { background-image: url(/ai-grammer/art/season-06.webp); }
.annual__art[data-m="7"] { background-image: url(/ai-grammer/art/season-07.webp); }
.annual__art[data-m="8"] { background-image: url(/ai-grammer/art/season-08.webp); }
.annual__art[data-m="9"] { background-image: url(/ai-grammer/art/season-09.webp); }
.annual__art[data-m="10"] { background-image: url(/ai-grammer/art/season-10.webp); }
.annual__art[data-m="11"] { background-image: url(/ai-grammer/art/season-11.webp); }
.annual__art[data-m="12"] { background-image: url(/ai-grammer/art/season-12.webp); }

/* ── 내신 수험서 단원(naesin-ui.js) — 학년별 루트 중1~고3. 전체 화면 오버레이, 390px 우선, 글자 200%에서도 줄바꿈으로 흘러 가로로 넘치지 않는다 ── */
.nrow { margin: 8px 0 4px; display: grid; gap: 8px; }
.nsn-entries { display: grid; gap: 8px; margin-top: 10px; }
.nsn-entry { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--purple); background: var(--purple-l); color: var(--purple-d); font-weight: 800; text-align: left; line-height: 1.4; }
.nsn-entry span { min-width: 0; overflow-wrap: anywhere; }
.nsn-entry em { flex: none; font-style: normal; font-size: .8125rem; font-weight: 900; padding: 2px 10px; border-radius: 999px; background: var(--surface); color: var(--purple-d); }
.nsn-entry:active { transform: translateY(2px); }
.nsn { position: fixed; inset: 0; z-index: 42; background: var(--bg); display: flex; flex-direction: column; overflow: hidden; }
.nsn__top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; max-width: 640px; width: 100%; margin: 0 auto; }
.nsn__x { width: 44px; height: 44px; flex: none; border-radius: 12px; font-size: 20px; line-height: 1; color: var(--muted); border: 2px solid var(--line); background: var(--surface); }
.nsn__ttl { min-width: 0; }
.nsn__ttl b { display: block; font-size: 1.0625rem; font-weight: 900; line-height: 1.3; overflow-wrap: anywhere; }
.nsn__ttl small { display: block; color: var(--muted); font-weight: 700; font-size: .8125rem; }
.nsn__tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px; padding: 0 14px 8px; max-width: 640px; width: 100%; margin: 0 auto; }
.nsn__tab { min-height: 44px; padding: 6px 8px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); font-weight: 800; font-size: .875rem; line-height: 1.25; color: var(--muted); }
.nsn__tab.on { border-color: var(--purple); background: var(--purple-l); color: var(--purple-d); }
.nsn__tab i { font-style: normal; display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: .6875rem; line-height: 18px; }
.nsn__body { flex: 1; overflow: auto; padding: 8px 14px 28px; max-width: 640px; width: 100%; margin: 0 auto; overflow-wrap: anywhere; }
.nsn__foot { padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 2px solid var(--line); background: var(--bg); max-height: 52svh; overflow: auto; }
.nsn__foot > * { max-width: 640px; margin-left: auto; margin-right: auto; }
.nsn__foot > .btn { width: 100%; display: flex; }
.nsn-sec { margin: 0 0 16px; }
.nsn-core { font-size: 1.125rem; font-weight: 800; line-height: 1.7; margin: 4px 0 10px; }
.nsn-form { margin: 0 0 14px; padding: 10px 12px; border-radius: 14px; background: var(--blue-l); }
.nsn-fig { margin: 0 0 16px; padding: 12px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); }
.nsn-fig figcaption { font-weight: 900; margin-bottom: 8px; }
.nsn-fig--cmp { border-color: var(--orange); background: var(--orange-l); }
.nsn-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.nsn-rows li { padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }
.nsn-fig--cmp .nsn-rows li { background: var(--surface); }
.nsn-r0 { display: block; font-weight: 900; margin-bottom: 4px; }
.nsn-rows dl { margin: 0; display: grid; gap: 4px; }
.nsn-rows dl div { display: grid; grid-template-columns: minmax(64px, 28%) 1fr; gap: 8px; }
.nsn-rows dt { color: var(--muted); font-size: .8125rem; font-weight: 800; }
.nsn-rows dd { margin: 0; font-weight: 600; }
.nsn-ana { margin: 0 0 14px; padding: 12px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); }
.nsn-ana__en { font-size: 1.0625rem; font-weight: 800; margin: 0 0 8px; }
.nsn-parts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.nsn-part { display: inline-flex; flex-direction: column; gap: 2px; padding: 6px 10px; border-radius: 10px; background: var(--primary-l); border-bottom: 3px solid var(--primary); max-width: 100%; }
.nsn-part b { font-weight: 800; }
.nsn-part small { color: var(--primary-d); font-weight: 700; font-size: .75rem; }
.nsn-point { margin: 0 0 14px; padding: 14px; border-radius: 16px; border: 2px solid var(--gold); background: var(--gold-l); }
.nsn-point h3 { margin: 0 0 8px; font-size: 1.0625rem; font-weight: 900; display: flex; gap: 8px; align-items: flex-start; }
.nsn-point__n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: #3b2a00; display: grid; place-items: center; font-size: .875rem; }
.nsn-point p { margin: 0 0 8px; font-weight: 600; }
.nsn-ex { padding: 8px 10px; border-radius: 12px; background: var(--surface); }
.nsn-ex small.ko { display: block; color: var(--muted); font-weight: 600; }
.nsn-trap { padding: 8px 10px; border-radius: 12px; background: var(--surface); }
.nsn-trap p { margin: 0 0 4px; }
.nsn-trap__x { color: var(--red-d); font-weight: 800; text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--red) 50%, transparent); }
.nsn-trap__o { color: var(--primary-d); font-weight: 800; }
.nsn-tier { margin: 0 0 16px; padding: 12px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); }
.nsn-tier h3 { margin: 0 0 4px; font-size: 1.0625rem; font-weight: 900; }
.nsn-tier h3 small { color: var(--muted); font-weight: 700; }
.nsn-tier--basic { border-color: var(--primary); }
.nsn-tier--advanced { border-color: var(--gold-d); }
.nsn-tier--challenge { border-color: var(--red); }
.nsn-nums { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.nsn-num { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface-2); font-weight: 900; }
.nsn-num.ok { border-color: var(--primary); background: var(--primary-l); color: var(--primary-d); }
.nsn-num.no { border-color: var(--red); background: var(--red-l); color: var(--red-d); }
.nsn-qhead { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.nsn-chip--basic { background: var(--primary-l); color: var(--primary-d); }
.nsn-chip--advanced { background: var(--gold-l); color: #8a6400; }
.nsn-chip--challenge { background: var(--red-l); color: var(--red-d); }
.nsn-prompt { font-weight: 800; font-size: 1.0625rem; margin: 0 0 10px; }
.nsn-stem { margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 2px solid var(--line); font-size: 1.125rem; line-height: 1.9; font-weight: 600; }
.nsn-stem p { margin: 0 0 4px; }
.nsn-stem p:last-child { margin-bottom: 0; }
.nsn-stem--passage { font-size: 1.0625rem; line-height: 2; font-weight: 500; text-align: left; }
.nsn-u { text-decoration-thickness: 2px; text-underline-offset: 4px; font-weight: 800; }
.nsn-n { color: var(--blue-d); font-weight: 900; }
.nsn-br { display: inline-block; padding: 0 6px; border-radius: 8px; background: var(--blue-l); color: var(--blue-d); font-weight: 800; }
.nsn-blank { display: inline-block; min-width: 72px; border-bottom: 4px solid var(--blue); vertical-align: baseline; }
.nsn-bogi { display: inline-block; margin-right: 6px; padding: 0 8px; border-radius: 8px; background: var(--purple-l); color: var(--purple-d); font-size: .8125rem; font-weight: 900; }
.nsn-choices .choice > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.nsn-fb { padding: 12px 14px; border-radius: 16px; }
.nsn-fb h3 { margin: 0 0 6px; font-size: 1.1875rem; font-weight: 900; }
.nsn-fb p { margin: 4px 0 10px; font-weight: 600; }
.nsn-fb .btn { width: 100%; }
.nsn-fb--ok { background: var(--primary-l); } .nsn-fb--ok h3 { color: var(--primary-d); }
.nsn-fb--hint { background: var(--orange-l); } .nsn-fb--hint h3 { color: var(--orange-d); }
.nsn-fb--bad { background: var(--red-l); } .nsn-fb--bad h3 { color: var(--red-d); }
.nsn-ans { font-weight: 900; color: var(--primary-d); }
.nsn-bad { font-weight: 900; color: var(--red-d); }
.nsn-eitem { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; margin: 0 0 8px; padding: 10px 12px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); text-align: left; }
.nsn-eitem__n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--purple-l); color: var(--purple-d); display: grid; place-items: center; font-weight: 900; }
.nsn-eitem__t { flex: 1; min-width: 0; font-weight: 700; }
.nsn-eitem__t small { display: block; color: var(--muted); font-weight: 600; overflow-wrap: anywhere; }
.nsn-eitem em { flex: none; font-style: normal; font-weight: 900; font-size: .8125rem; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); }
.nsn-eitem em.ok { background: var(--primary-l); color: var(--primary-d); }
.nsn-eitem em.part { background: var(--orange-l); color: var(--orange-d); }
.nsn-cond { margin: 0 0 10px; padding: 10px 12px 10px 28px; border-radius: 12px; background: var(--blue-l); font-weight: 700; }
.nsn-given { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 2px dashed var(--line); font-size: 1.0625rem; font-weight: 700; }
.nsn-words { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.nsn-words span { padding: 6px 12px; border-radius: 10px; background: var(--surface); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line); font-weight: 800; }
.nsn-auto { padding: 10px 12px; border-radius: 12px; margin: 12px 0; font-weight: 700; }
.nsn-auto--ok { background: var(--primary-l); color: var(--primary-d); }
.nsn-auto--diff { background: var(--orange-l); color: var(--orange-d); }
.nsn-model { padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 2px solid var(--primary); margin-bottom: 12px; }
.nsn-model__a { font-size: 1.125rem; margin: 0 0 6px; }
.nsn-alts { margin: 0; padding-left: 20px; font-weight: 600; }
.nsn-parts-score { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; counter-reset: ps; }
.nsn-parts-score li { padding: 10px 12px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); }
.nsn-parts-score p { margin: 0 0 6px; }
.nsn-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.nsn-pick button { min-height: 44px; padding: 6px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface-2); font-weight: 800; }
.nsn-pick button.on { border-color: var(--purple); background: var(--purple-l); color: var(--purple-d); }
.nsn-pick__full.on { border-color: var(--primary); background: var(--primary-l); color: var(--primary-d); }
.nsn-step { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; margin-bottom: 8px; border-radius: 12px; background: var(--surface); border: 2px solid var(--line); }
.nsn-step p { margin: 0; min-width: 0; flex: 1 1 180px; }
.nsn-stepper { display: inline-flex; align-items: center; gap: 4px; }
.nsn-stepper button { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface-2); font-size: 1.25rem; font-weight: 900; }
.nsn-stepper output { min-width: 32px; text-align: center; font-weight: 900; font-size: 1.125rem; }
.nsn-total { margin: 12px 0; padding: 10px 12px; border-radius: 14px; background: var(--gold-l); font-size: 1.25rem; font-weight: 800; text-align: center; }
.nsn-total b { font-size: 1.75rem; color: var(--gold-d); }
.nsn-best { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.nsn-best span { padding: 4px 12px; border-radius: 999px; background: var(--surface-2); font-weight: 800; font-size: .875rem; }
.nsn-master { display: inline-block; margin: 6px 0; padding: 6px 16px; border-radius: 999px; background: var(--gold); color: #3b2a00; font-weight: 900; }
.nsn-master small { font-weight: 800; }
.nsn-result { text-align: center; padding: 14px 0; }
.nsn-result__score { margin: 0; font-size: 3rem; line-height: 1.1; font-weight: 900; color: var(--purple-d); }
.nsn-result__score small { font-size: 1.25rem; color: var(--muted); }
.nsn-result__pct { margin: 0 0 6px; font-size: 1.25rem; font-weight: 900; }
.nsn-bars { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.nsn-bars li { display: grid; grid-template-columns: minmax(56px, 22%) 1fr auto; gap: 8px; align-items: center; font-weight: 800; }
.nsn-wlist { margin: 0 0 14px; padding-left: 22px; display: grid; gap: 14px; }
.nsn-wlist li p { margin: 0 0 4px; }
.nsn-wlist2 { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.nsn-w { border-radius: 14px; border: 2px solid var(--red); background: var(--surface); }
.nsn-w--done { border-color: var(--primary); opacity: .85; }
.nsn-w summary { display: grid; gap: 2px; padding: 10px 12px; cursor: pointer; min-height: 44px; list-style: none; }
.nsn-w summary::-webkit-details-marker { display: none; }
.nsn-w__t { font-weight: 900; font-size: .875rem; color: var(--muted); }
.nsn-w__q { font-weight: 700; overflow-wrap: anywhere; }
.nsn-w__ok { font-style: normal; font-weight: 800; color: var(--primary-d); font-size: .8125rem; }
.nsn-w details > :not(summary) { margin-left: 12px; margin-right: 12px; }
.nsn-w details > :last-child { margin-bottom: 12px; }
.nsn-w__d { margin-top: 0; margin-bottom: 8px; display: grid; gap: 4px; }
.nsn-w__d div { display: grid; grid-template-columns: minmax(64px, 26%) 1fr; gap: 8px; }
.nsn-w__d dt { color: var(--muted); font-weight: 800; font-size: .8125rem; }
.nsn-w__d dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.nsn-in { min-height: 48px; font-size: 1rem; }
.nsn-wcard summary { cursor: pointer; }
@media (prefers-reduced-motion: no-preference) {
  .nsn { animation: fade .18s; }
  .nsn-fb { animation: up .2s ease-out; }
}
.nsn-esum { margin: 0 0 10px; padding: 8px 12px; border-radius: 12px; background: var(--gold-l); font-weight: 700; }
.nsn-egrp { margin: 0 0 10px; }
.nsn-egrp > summary { min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 2px solid var(--line); font-weight: 900; cursor: pointer; margin-bottom: 8px; }
.nsn-egrp > summary small { color: var(--muted); font-weight: 700; }
