/* 이편한자막 학습(/app) — app.js · lesson.js · parts.js가 그리는 화면.
   색의 뜻: 파랑(--easy) = 낱말·글, 노랑(--sign) = 수어 영상·손으로 하는 것, 초록/빨강 = 맞음/틀림, 주황 불꽃 = 연속 학습.
   흰 바탕 + 옅은 면(--bg-2), 칩·배지는 면을 채운 색. 공통 토큰(ui.css)은 그대로 쓰고, 학습에만 필요한 것은 여기 .learn에 둔다.
   함정: core.js가 상태로 쓰는 클래스(.show · .in · .scrolled …)를 여기서 단독 레이아웃 클래스로 쓰지 않는다(알림이 흰 기둥으로 뜬 적이 있다). */

.learn {
  --l-rail: 232px;
  --l-main: 720px;
  --sign-soft: color-mix(in srgb, var(--sign) 24%, var(--card));
  --sign-deep: #7a6000;
  --good-soft: color-mix(in srgb, var(--good) 12%, var(--card));
  --bad-soft: color-mix(in srgb, var(--bad) 10%, var(--card));
  --flame: #f76b15;
  --flame-soft: color-mix(in srgb, #f76b15 14%, var(--card));
  --ring: 0 0 0 1px var(--line), 0 1px 2px rgba(15, 23, 41, .04), 0 10px 30px -18px rgba(15, 23, 41, .22);
  --k: 1; /* 글자 크게(설정)면 1.18 */
  background: var(--bg);
}
body.learn-big { --k: 1.18; }
.learn .view p { white-space: pre-line; }
.learn .grow { flex: 1; }
.learn .num { font-variant-numeric: tabular-nums; }
.glyph { display: inline-grid; place-items: center; flex-shrink: 0; }
.glyph svg { width: 20px; height: 20px; }
.btn .glyph svg { width: 19px; height: 19px; }
.note { font-size: 14px; color: var(--ink-3); line-height: 1.6; }
.empty-note { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 48px 16px; color: var(--ink-2); }
.empty-note h2 { font-size: 20px; color: var(--ink); }
.sk-list { display: grid; gap: 14px; max-width: var(--l-main); margin: 0 auto; }
.learn .btn-lg { height: 56px; font-size: calc(16.5px * var(--k)); border-radius: 16px; }
.learn .btn-quiet { color: var(--ink-3); }

/* ───────── 껍데기 ───────── */

.learn .view { max-width: none; margin: 0; padding: 20px 16px calc(104px + env(safe-area-inset-bottom)); min-height: 60vh; }
.learn .view:focus { outline: none; }
/* 휴대폰의 얇은 머리(core.js mountTop("app") — 로고와 계정만) */
.learn .top, .learn .top-bar { height: 56px; }
.learn .top.scrolled .top-bar { max-width: none; height: 56px; margin-top: 0; padding: 0 12px 0 16px; border-radius: 0; background: var(--bg); box-shadow: 0 1px 0 var(--line); }
.learn .top-bar { padding: 0 12px 0 16px; }

.rail { display: none; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--bg); box-shadow: 0 -1px 0 var(--line); }
.tab { display: grid; justify-items: center; gap: 2px; min-height: 52px; padding: 6px 0 4px; border-radius: 14px; font-size: 14px; font-weight: 650; color: var(--ink-3); }
.tab .glyph svg { width: 23px; height: 23px; }
.tab[aria-current="page"] { color: var(--ink); }
.tab[aria-current="page"] .glyph { background: var(--bg-2); border-radius: 999px; padding: 2px 16px; }
.learn .toast { bottom: calc(88px + env(safe-area-inset-bottom)); }

@media (min-width: 900px) {
  .learn .top { display: none; }
  .tabbar { display: none; }
  .learn .toast { bottom: 28px; }
  .rail { position: fixed; z-index: 45; top: 0; bottom: 0; left: 0; width: var(--l-rail); display: flex; flex-direction: column; gap: 6px; padding: 22px 14px 18px; background: var(--bg); box-shadow: 1px 0 0 var(--line); }
  .learn .view { margin-left: var(--l-rail); padding: 44px clamp(24px, 4vw, 56px) 80px; }
  .rail-logo { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 10px; margin-bottom: 18px; font-weight: 800; font-size: 16px; letter-spacing: -0.03em; }
  .rail-logo img { width: 26px; height: 24px; object-fit: contain; }
  .rail-links { display: grid; gap: 4px; }
  .rail-link { display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 14px; border-radius: 14px; font-size: 16px; font-weight: 650; color: var(--ink-2); transition: background .15s, color .15s; }
  .rail-link .glyph svg { width: 22px; height: 22px; }
  .rail-link:hover { background: var(--bg-2); color: var(--ink); }
  .rail-link[aria-current="page"] { background: var(--ink); color: var(--bg); }
  .rail-streak { display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border-radius: 14px; background: var(--flame-soft); color: var(--ink); font-size: 14.5px; }
  .rail-streak .glyph { color: var(--flame); }
  .rail-streak span { color: var(--ink-2); font-weight: 600; }
  .rail-me { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; }
  .rail-me:hover { background: var(--bg-2); }
  .rail-me-tx { display: grid; min-width: 0; }
  .rail-me-tx b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rail-me-tx small { font-size: 14px; color: var(--ink-3); }
}
@media (min-width: 900px) and (max-width: 1099px) { .learn { --l-rail: 204px; } }

/* 집중 화면(레슨 · 수업 모드 · 처음 설정): 메뉴를 모두 숨긴다 */
body.is-focus .rail, body.is-focus .tabbar, body.is-focus .top { display: none; }
body.is-focus .view { margin-left: 0; padding: 0; }

/* ───────── 공통 부품 ───────── */

.card { background: var(--card); border-radius: 22px; padding: 22px; box-shadow: var(--ring); }
.card-k { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ink-3); }
.card-h { font-size: 18px; font-weight: 750; letter-spacing: -0.03em; }
.card-more { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; min-height: 36px; padding: 0 4px 0 10px; border-radius: 10px; font-size: 14px; font-weight: 650; color: var(--ink-3); }
.card-more:hover { color: var(--ink); background: var(--bg-2); }
.card-more svg { width: 16px; height: 16px; transform: rotate(180deg); }
.page-head { max-width: var(--l-main); margin: 0 auto 20px; }
.page-head h1 { font-size: calc(clamp(28px, 3.4vw, 34px) * var(--k)); font-weight: 780; letter-spacing: -0.045em; line-height: 1.2; }
.page-head > .muted { margin-top: 6px; font-size: 15.5px; }
.go-arrow { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--bg-2); color: var(--ink); flex-shrink: 0; transition: transform .25s var(--ease), background .2s; }

/* 채운 칩: 파랑 = 낱말·글, 노랑 = 수어 */
.tag-new, .tag-review, .tag-sign, .tag-try, .tag-miss { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 11px; border-radius: 999px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.tag-new, .tag-try { background: var(--easy-soft); color: var(--easy); }
.tag-review { background: var(--bg-2); color: var(--ink-2); }
.tag-sign { background: var(--sign-soft); color: var(--sign-deep); }
.tag-sign .glyph svg { width: 16px; height: 16px; }
.tag-miss { background: var(--bad-soft); color: var(--bad); }
.lv-chip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 14px; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.lv-fresh { background: var(--bg-2); color: var(--ink-2); }
.lv-learning { background: var(--easy-soft); color: var(--easy); }
.lv-mastered { background: var(--good-soft); color: var(--good); }
.lv-due { background: var(--easy); color: #fff; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.word-chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 15px; border-radius: 999px; font-size: calc(15px * var(--k)); font-weight: 700; transition: transform .2s var(--ease); }
a.word-chip:hover { transform: translateY(-2px); }
.chip-easy { background: var(--easy-soft); color: var(--easy); }
.chip-sign { background: var(--sign-soft); color: var(--sign-deep); }
.chip-miss { background: var(--bad-soft); color: var(--bad); }

/* 수어 그림 칸(사전 영상의 첫 장면) — 영상이 없으면 회색 손 */
.thumb { position: relative; display: grid; place-items: center; aspect-ratio: 3 / 2; border-radius: 12px; overflow: hidden; background: var(--sign-soft); color: var(--sign-deep); }
.thumb img { width: 100%; height: 100%; object-fit: fill; }
.thumb.no-video { background: var(--bg-2); color: var(--ink-3); }
.thumb.no-video .glyph svg { width: 26px; height: 26px; }
.thumb-sm { width: 66px; flex-shrink: 0; border-radius: 10px; }
.thumb-sm .glyph svg { width: 20px; height: 20px; }

/* 단원 그림 칸 */
.unit-ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: var(--easy-soft); color: var(--easy); flex-shrink: 0; }
.unit-ic .glyph svg { width: 25px; height: 25px; }
.unit-ic.ic-mine { background: var(--sign-soft); color: var(--sign-deep); }
.unit-ic.ic-board { background: var(--bg-2); color: var(--ink); }

/* 오늘 목표 링 */
.ring { position: relative; display: grid; place-items: center; flex-shrink: 0; }
.ring-svg { position: absolute; inset: 0; }
.ring-svg svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.ring-bg, .ring-fg { fill: none; stroke-width: 11; }
.ring-bg { stroke: var(--bg-2); }
.ring-fg { stroke: var(--easy); stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: calc(326.7 * (1 - var(--p, 0))); transition: stroke-dashoffset 1s var(--ease); }
.ring-lg { width: 104px; height: 104px; }
.ring-in { position: relative; display: flex; align-items: baseline; }
.ring-in b { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; }
.ring-in small { font-size: 15px; font-weight: 700; color: var(--ink-3); }
.ring-in > span svg { width: 36px; height: 36px; color: var(--easy); stroke-width: 3; }

/* 불꽃(연속 학습) */
.flame { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; background: var(--bg-2); color: var(--ink-3); flex-shrink: 0; }
.flame .glyph svg { width: 28px; height: 28px; }
.flame.lit { background: var(--flame-soft); color: var(--flame); }

/* ───────── 오늘(#/) ───────── */

.today { display: grid; gap: 20px; max-width: var(--l-main); margin: 0 auto; }
.today-main, .today-side { display: grid; gap: 16px; align-content: start; min-width: 0; }
@media (min-width: 640px) and (max-width: 1239px) { .today-side { grid-template-columns: 1fr 1fr; align-items: start; } }
@media (min-width: 1240px) {
  .today { max-width: 1060px; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; }
  .today-side { position: sticky; top: 44px; }
}
.today-head .muted { font-size: 14.5px; font-weight: 600; }
.today-head h1 { font-size: calc(clamp(30px, 3.4vw, 36px) * var(--k)); font-weight: 800; letter-spacing: -0.05em; line-height: 1.2; }

.play { display: grid; gap: 20px; padding: 24px; }
.play-top { display: flex; align-items: center; gap: 20px; }
.play-tx { display: grid; gap: 6px; min-width: 0; }
.play-h { font-size: calc(clamp(24px, 3vw, 30px) * var(--k)); font-weight: 800; letter-spacing: -0.045em; line-height: 1.25; }
.play-min { color: var(--ink-3); font-weight: 700; }
.play-mix { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.play-go { width: 100%; }
.play-go .glyph svg { width: 18px; height: 18px; }
.play-more { display: flex; flex-wrap: wrap; gap: 8px; }
.play-more .btn { flex: 1 1 200px; }
.thumbs { list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.thumbs li { display: grid; gap: 6px; min-width: 0; font-size: calc(14px * var(--k)); font-weight: 700; text-align: center; }
.thumbs li > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumbs-more .thumb { background: var(--bg-2); color: var(--ink-2); }
.thumbs-more .thumb b { font-size: 17px; }
@media (max-width: 560px) { .thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; } .thumbs li:nth-child(n+5) { display: none; } }

.cont { display: grid; gap: 12px; padding: 18px 20px; }
.cont-go { display: flex; align-items: center; gap: 14px; padding: 6px; margin: -6px; border-radius: 16px; }
.cont-go:hover .go-arrow, .mine-hint:hover .go-arrow { transform: translateX(3px); background: var(--ink); color: var(--bg); }
.cont-tx { flex: 1; display: grid; gap: 2px; min-width: 0; }
.cont-tx b { font-size: calc(17px * var(--k)); font-weight: 750; letter-spacing: -0.02em; }
.cont-tx small { font-size: calc(14px * var(--k)); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.teach-row { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }

.streak-card { display: grid; gap: 16px; padding: 20px; }
.streak-top { display: flex; align-items: center; gap: 14px; }
.streak-top > div { display: grid; }
.streak-n { font-size: 26px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.2; }
.streak-top small { font-size: 14px; color: var(--ink-3); }
.week { list-style: none; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.week li { display: grid; justify-items: center; gap: 4px; font-size: 14px; font-weight: 700; color: var(--ink-3); }
.week i { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); }
.week i .glyph svg { width: 17px; height: 17px; }
.week li[data-state="on"] i { background: var(--flame-soft); color: var(--flame); }
.week li[data-state="today"] i { box-shadow: inset 0 0 0 2px var(--flame); background: var(--card); }
.week li[data-state="today"] > span, .week li[data-state="on"] > span { color: var(--ink); }
.week li[data-state="future"] i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-2); }

.sotd { display: grid; gap: 12px; padding: 18px; }
.sotd-link { display: grid; gap: 4px; border-radius: 16px; }
.sotd-video { display: block; padding: 8px; border-radius: 18px; background: var(--sign-soft); margin-bottom: 8px; transition: transform .3s var(--ease); }
.sotd-link:hover .sotd-video { transform: translateY(-3px) rotate(-.6deg); }
.sotd-video video { width: 100%; aspect-ratio: 3 / 2; object-fit: fill; border-radius: 12px; background: var(--card); }
.sotd-word { font-size: calc(22px * var(--k)); font-weight: 800; letter-spacing: -0.04em; }
.sotd-mean { font-size: calc(14.5px * var(--k)); color: var(--ink-2); line-height: 1.55; }

/* 처음 온 사람: 두 갈래 */
.first { display: grid; gap: 16px; padding: 24px; }
.first-h { font-size: calc(clamp(24px, 3vw, 30px) * var(--k)); font-weight: 800; letter-spacing: -0.045em; }
.fork { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .fork { grid-template-columns: 1fr; } }
.fork-card { display: grid; gap: 4px; justify-items: start; text-align: left; padding: 14px 14px 18px; border-radius: 20px; background: var(--bg-2); transition: transform .3s var(--ease), box-shadow .2s, background .2s; }
.fork-card:hover { transform: translateY(-3px) rotate(-.5deg); background: var(--card); box-shadow: var(--ring); }
.fork-card b { margin-top: 10px; font-size: calc(18px * var(--k)); font-weight: 780; letter-spacing: -0.03em; }
.fork-card small { font-size: calc(14px * var(--k)); color: var(--ink-3); }
.fork-pic { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; background: var(--card); }
@media (max-width: 560px) { .fork-pic { aspect-ratio: 16 / 7; } }
.pic-sets { display: flex; justify-content: center; align-items: center; gap: 0; }
.pic-sets .unit-ic { width: 58px; height: 58px; border-radius: 18px; box-shadow: 0 0 0 4px var(--card); }
.pic-sets .unit-ic:nth-child(1) { transform: rotate(-8deg) translateX(8px); }
.pic-sets .unit-ic:nth-child(2) { transform: translateY(-6px); z-index: 1; background: var(--sign-soft); color: var(--sign-deep); }
.pic-sets .unit-ic:nth-child(3) { transform: rotate(8deg) translateX(-8px); }
.pic-yt { background: var(--frame); }
.yt-frame { position: relative; width: 78%; max-height: 82%; aspect-ratio: 16 / 9; border-radius: 10px; background: var(--card); box-shadow: 0 10px 24px -14px rgba(15, 23, 41, .35), inset 0 -4px 0 var(--bg-3); display: grid; align-items: end; justify-items: center; padding: 8px; }
.yt-cap { padding: 3px 8px; border-radius: 6px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.yt-cap u { text-decoration: underline dashed var(--sign); text-underline-offset: 3px; color: var(--sign); }
.yt-mark { position: absolute; right: -10px; top: -10px; width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: var(--sign); color: #111; box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .4); }
.yt-mark .glyph svg { width: 18px; height: 18px; }
.first-more { display: inline-flex; align-items: center; gap: 6px; justify-self: start; min-height: 44px; padding: 0 12px; margin-left: -12px; border-radius: 12px; font-size: 15px; font-weight: 650; color: var(--ink-2); }
.first-more:hover { background: var(--bg-2); color: var(--ink); }

/* ───────── 처음 설정(#/start) ───────── */

.start { max-width: 760px; margin: 0 auto; min-height: 100svh; display: flex; flex-direction: column; padding: 14px 16px 32px; }
.start-top { display: flex; align-items: center; gap: 12px; height: 56px; }
.start-back { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--ink-2); }
.start-back:hover { background: var(--bg-2); }
.start-back svg { width: 22px; height: 22px; }
.start-back[hidden] { display: grid !important; visibility: hidden; }
.start-dots { list-style: none; flex: 1; display: flex; justify-content: center; gap: 6px; }
.start-dots li { width: 36px; height: 6px; border-radius: 3px; background: var(--bg-3); transition: background .3s; }
.start-dots li[data-state="done"], .start-dots li[data-state="now"] { background: var(--easy); }
.start-skip { min-height: 44px; padding: 0 12px; border-radius: 12px; font-size: 14.5px; font-weight: 650; color: var(--ink-3); }
.start-skip:hover { color: var(--ink); background: var(--bg-2); }
.start-body { flex: 1; display: grid; align-content: center; gap: 28px; padding: 24px 0 48px; animation: rise .45s var(--ease) both; }
.start-h { font-size: calc(clamp(28px, 4vw, 40px) * var(--k)); font-weight: 800; letter-spacing: -0.05em; text-align: center; line-height: 1.25; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.pick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 620px) { .pick-grid { grid-template-columns: 1fr; } .start .pick-card { grid-template-columns: auto 1fr; justify-items: start; text-align: left; column-gap: 16px; } .start .pick-card > :first-child { grid-row: span 2; } }
.pick-card { display: grid; justify-items: center; align-content: start; gap: 4px; padding: 18px 14px; border-radius: 22px; background: var(--card); box-shadow: 0 0 0 1.5px var(--line-2); text-align: center; transition: transform .3s var(--ease), box-shadow .2s; }
.pick-card:hover { transform: translateY(-3px) rotate(-.6deg); box-shadow: 0 0 0 1.5px var(--ink-3), 0 14px 30px -18px rgba(15, 23, 41, .35); }
.pick-card[aria-checked="true"] { box-shadow: 0 0 0 2.5px var(--easy); background: color-mix(in srgb, var(--easy) 5%, var(--card)); }
.pick-card b { font-size: calc(18px * var(--k)); font-weight: 780; letter-spacing: -0.03em; margin-top: 8px; }
.pick-card small { font-size: calc(14px * var(--k)); color: var(--ink-3); line-height: 1.45; }
.start .pick-card b { margin-top: 0; }
.dir-pic { display: flex; align-items: center; gap: 6px; }
.dp-tile { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; }
.dp-tile .glyph svg { width: 28px; height: 28px; }
.dp-hand { background: var(--sign); color: #111; }
.dp-text { background: var(--easy); color: #fff; }
.dp-text b { font-size: 26px; font-weight: 800; }
.dp-arrow { color: var(--ink-3); }
.dp-arrow .glyph svg { width: 18px; height: 18px; }
.dp-board { width: 138px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--ink); color: var(--bg); }
.dp-board .glyph svg { width: 28px; height: 28px; }
.goal-pic { display: flex; gap: 5px; width: 76px; height: 54px; align-items: center; justify-content: center; }
.goal-pic i { width: 14px; height: 36px; border-radius: 7px; background: var(--easy); }
.goal-pic i:nth-child(2) { height: 44px; }
.goal-pic i:nth-child(3) { height: 50px; }
.goal-pic i:nth-child(4) { height: 54px; }

/* ───────── 길(#/path) ───────── */

.path { max-width: var(--l-main); margin: 0 auto; display: grid; gap: 18px; }
.path .page-head { margin: 0; }
.mine-hint { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--sign-soft); box-shadow: none; }
.mine-hint .go-arrow, .mine-hint .unit-ic { background: var(--card); }
.mine-hint .cont-tx small { white-space: normal; }
.unit { padding: 22px 20px 26px; border-radius: 24px; background: var(--card); box-shadow: var(--ring); scroll-margin-top: 24px; }
.unit[data-flash] { animation: flash 1.6s var(--ease); }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--easy), var(--ring); } }
.unit-head { display: flex; align-items: center; gap: 14px; }
.unit-tx { flex: 1; min-width: 0; display: grid; gap: 2px; }
.unit-no { font-size: 14px; font-weight: 700; color: var(--ink-3); }
.unit-tx h2 { font-size: calc(21px * var(--k)); font-weight: 800; letter-spacing: -0.04em; line-height: 1.3; }
.unit-meter { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.meter-track { position: relative; flex: 1; max-width: 220px; height: 8px; border-radius: 4px; background: var(--bg-2); overflow: hidden; display: flex; }
.meter-track i { display: block; height: 100%; }
.m-master { background: var(--good); }
.m-learn { background: var(--easy); }
.unit-meter small { font-size: 14px; font-weight: 650; color: var(--ink-3); }
/* 레슨 점: 세로 길 위에 좌우로 흔들리며 놓인다 */
.nodes { list-style: none; position: relative; display: grid; gap: 14px; justify-items: center; margin-top: 22px; padding: 4px 0; }
.nodes::before { content: ""; position: absolute; top: 20px; bottom: 30px; left: 50%; width: 4px; margin-left: -2px; border-radius: 2px; background: repeating-linear-gradient(var(--line-2) 0 8px, transparent 8px 16px); }
.node { position: relative; display: grid; justify-items: center; gap: 6px; width: 180px; }
.node:nth-child(4n+2) { transform: translateX(52px); }
.node:nth-child(4n+4) { transform: translateX(-52px); }
.node-btn { position: relative; width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; background: var(--card); color: var(--ink-3); box-shadow: inset 0 0 0 2px var(--line-2), 0 5px 0 var(--bg-3); font-size: 22px; font-weight: 800; transition: transform .25s var(--ease), box-shadow .2s; }
.node-btn:hover { transform: translateY(-3px) rotate(-3deg); }
.node-btn:active { transform: translateY(2px); }
.node-btn svg { width: 30px; height: 30px; stroke-width: 3; }
.node[data-state="done"] .node-btn { background: var(--ink); color: var(--bg); box-shadow: 0 5px 0 color-mix(in srgb, var(--ink) 70%, var(--bg)); }
.node[data-state="now"] .node-btn { background: var(--easy); color: #fff; box-shadow: 0 5px 0 color-mix(in srgb, var(--easy) 65%, #000); }
.node[data-now] .node-btn { width: 80px; height: 80px; font-size: 26px; }
.node[data-now] .node-btn::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 3px solid color-mix(in srgb, var(--easy) 35%, transparent); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.08); opacity: .5; } }
.node-flag { position: absolute; top: -34px; padding: 4px 12px; border-radius: 10px; background: var(--easy); color: #fff; font-size: 14px; font-weight: 750; white-space: nowrap; }
.node-flag::after { content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: var(--easy); }
.node[data-now] { margin-top: 28px; }
.node-l { max-width: 100%; padding: 2px 8px; border-radius: 8px; background: var(--card); font-size: calc(13.5px * var(--k)); font-weight: 650; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) { .node:nth-child(4n+2) { transform: translateX(36px); } .node:nth-child(4n+4) { transform: translateX(-36px); } }

/* 레슨 시트의 낱말 목록 */
.lesson-words { list-style: none; display: grid; gap: 4px; }
.lesson-words li { display: flex; align-items: center; gap: 12px; padding: 8px 4px; }
.lesson-words li + li { box-shadow: inset 0 1px 0 var(--line); }
.lw-tx { flex: 1; display: grid; min-width: 0; }
.lw-tx b { font-size: calc(17px * var(--k)); font-weight: 750; letter-spacing: -0.02em; }
.lw-tx small { font-size: calc(14px * var(--k)); color: var(--ink-3); line-height: 1.45; }

/* ───────── 시트 ───────── */

html.sheet-lock { overflow: hidden; }
.sheet-back { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; justify-content: center; background: rgba(15, 23, 41, .36); animation: fade .2s both; }
.sheet { position: relative; width: min(620px, 100%); max-height: min(90svh, 920px); overflow: auto; overscroll-behavior: contain; background: var(--card); border-radius: 26px 26px 0 0; padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); animation: sheet-up .38s var(--ease) both; }
.sheet:focus { outline: none; }
.sheet-back[data-leaving] { animation: fade .2s reverse both; }
.sheet-back[data-leaving] .sheet { animation: sheet-up .22s reverse both; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
@keyframes drawer-in { from { transform: translateX(48px); opacity: 0; } }
.sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0 auto 10px; }
.sheet-x { position: absolute; top: 12px; right: 12px; z-index: 2; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--bg-2); color: var(--ink-2); }
.sheet-x:hover { background: var(--bg-3); color: var(--ink); }
.sheet-x svg { width: 20px; height: 20px; }
.sheet-body { display: grid; gap: 16px; }
.sheet-head { display: flex; align-items: center; gap: 14px; padding-right: 48px; flex-wrap: wrap; }
.sheet-head > div { display: grid; gap: 2px; }
.sheet-head h2 { font-size: calc(22px * var(--k)); font-weight: 800; letter-spacing: -0.04em; line-height: 1.3; }
.sheet-head > .muted, .sheet-head p.muted { flex-basis: 100%; font-size: 15px; }
.sheet-k { font-size: 14px; font-weight: 700; color: var(--ink-3); }
.sheet-act { display: flex; flex-wrap: wrap; gap: 8px; }
.sheet-act .btn { flex: 1 1 200px; }
@media (min-width: 900px) {
  .sheet-back { align-items: center; padding: 24px; }
  .sheet { border-radius: 26px; padding: 22px 26px 26px; }
  .sheet-grip { display: none; }
  .sheet-back-drawer { justify-content: flex-end; align-items: stretch; padding: 12px; }
  .sheet-drawer { width: min(480px, 100%); max-height: none; animation-name: drawer-in; }
  .sheet-back-drawer[data-leaving] .sheet { animation: drawer-in .22s reverse both; }
}
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.set-tile { display: grid; justify-items: start; gap: 2px; padding: 14px; border-radius: 18px; background: var(--bg-2); text-align: left; transition: transform .25s var(--ease), background .2s, box-shadow .2s; }
.set-tile:hover { transform: translateY(-2px) rotate(-.6deg); background: var(--card); box-shadow: var(--ring); }
.set-tile .unit-ic { margin-bottom: 8px; background: var(--card); }
.set-tile b { font-size: calc(16px * var(--k)); font-weight: 750; }
.set-tile small { font-size: 14px; color: var(--ink-3); }
.howto { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .howto { grid-template-columns: 1fr; } }
.howto li { display: grid; gap: 10px; align-content: start; }
.howto li > b { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; line-height: 1.45; }
.step-no { width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-size: 14px; }
.mock { height: 96px; border-radius: 14px; background: var(--frame); display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; }
.mk-bar { align-items: flex-end; }
.mk-play { width: 0; height: 0; border: 7px solid transparent; border-left: 11px solid var(--ink-2); border-right: 0; }
.mk-line { flex: 1; height: 4px; border-radius: 2px; background: var(--ink-3); margin-bottom: 5px; }
.mk-switch { width: 34px; height: 20px; border-radius: 10px; background: var(--easy); display: flex; justify-content: flex-end; padding: 2px; box-shadow: 0 0 0 3px var(--sign); }
.mk-switch i { width: 16px; height: 16px; border-radius: 50%; background: #fff; }
.mk-cap span { padding: 4px 10px; border-radius: 6px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 13px; font-weight: 600; }
.mk-cap u { text-decoration: underline dashed var(--sign); text-underline-offset: 3px; color: var(--sign); }
.mk-panel { gap: 16px; }
.mk-panel b { padding: 6px 14px; border-radius: 10px; background: var(--card); font-size: 16px; }
.mk-book { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--sign); color: #111; }

/* ───────── 내 낱말(#/words) ───────── */

.words { max-width: 1040px; margin: 0 auto; display: grid; gap: 14px; }
.words .page-head { max-width: none; margin: 0 0 4px; }
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.head-n { color: var(--easy); }
.head-act { display: flex; gap: 8px; flex-wrap: wrap; }
.head-act .btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
@media (max-width: 560px) { .head-act { width: 100%; } .head-act .btn { flex: 1; padding: 0 12px; } .head-act .btn:last-child span { display: none; } .head-act .btn:last-child { flex: 0 0 48px; } }
.search { position: relative; display: block; }
.search > span:first-child { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search > span:first-child svg { width: 18px; height: 18px; }
.search .input { padding-left: 44px; height: 50px; font-size: calc(15.5px * var(--k)); }
.filter-row { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 -2px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; min-height: 44px; padding: 0 14px; border-radius: 999px; background: var(--bg-2); font-size: calc(14.5px * var(--k)); font-weight: 700; color: var(--ink-2); white-space: nowrap; transition: background .15s, color .15s; }
.filter-chip:hover:not(:disabled) { background: var(--bg-3); color: var(--ink); }
.filter-chip .num { font-size: 14px; opacity: .7; }
.filter-chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.filter-chip:disabled { opacity: .45; cursor: default; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
@media (max-width: 560px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.tile { position: relative; display: grid; grid-template-rows: auto 1fr auto; gap: 8px; padding: 8px 8px 12px; border-radius: 20px; background: var(--card); box-shadow: var(--ring); text-align: left; transition: transform .3s var(--ease), box-shadow .2s; }
.tile:hover { transform: translateY(-3px) rotate(-.5deg); box-shadow: 0 0 0 1px var(--line-2), 0 16px 34px -18px rgba(15, 23, 41, .35); }
.tile-pic { position: relative; display: block; }
.tile-pic .thumb { border-radius: 14px; }
.tile-sign { position: absolute; right: 6px; bottom: 6px; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--sign); color: #111; }
.tile-sign .glyph svg { width: 16px; height: 16px; }
.tile-tx { display: grid; gap: 2px; padding: 0 6px; min-width: 0; align-content: start; }
.tile-tx b { font-size: calc(18px * var(--k)); font-weight: 780; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.tile-tx small { font-size: calc(14px * var(--k)); color: var(--ink-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-tx small.muted { color: var(--ink-3); }
.tile .lv-chip { justify-self: start; margin-left: 6px; }
.tile-tick { justify-self: start; margin-left: 6px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: transparent; box-shadow: inset 0 0 0 2px var(--line-2); }
.tile-tick svg { width: 16px; height: 16px; stroke-width: 3; }
.tile[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--easy); }
.tile[aria-pressed="true"] .tile-tick { background: var(--easy); color: #fff; box-shadow: none; }
.more-row { grid-column: 1 / -1; display: flex; justify-content: center; margin-top: 8px; }
.words-foot { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; color: var(--ink-3); padding: 4px 2px; }
.words-foot a { color: var(--easy); font-weight: 650; }
.empty-card { display: grid; justify-items: center; gap: 14px; text-align: center; padding: 40px 24px; max-width: var(--l-main); }
.empty-card h2 { font-size: 20px; }
.selbar { position: fixed; left: 0; right: 0; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 50; display: flex; justify-content: center; padding: 0 12px; pointer-events: none; }
@media (min-width: 900px) { .selbar { bottom: 24px; left: var(--l-rail); } }
.selbar-in { pointer-events: auto; display: flex; align-items: center; gap: 8px; width: min(560px, 100%); padding: 10px 10px 10px 18px; border-radius: 20px; background: var(--card); box-shadow: 0 0 0 1px var(--line), var(--shadow-lg); animation: sheet-up .3s var(--ease) both; }

/* 낱말 담기 시트 */
.add-form { display: flex; gap: 8px; }
.add-form .search { flex: 1; }
.add-form .btn { flex-shrink: 0; }
.found { display: grid; gap: 12px; }
.found-ok { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; color: var(--good); }
.found-ok svg { width: 18px; height: 18px; }
.found-card { display: grid; gap: 6px; padding: 14px; border-radius: 18px; background: var(--bg-2); }
.found-word { font-size: 24px; font-weight: 800; letter-spacing: -0.04em; }
.found-err { color: var(--bad); font-size: 15px; font-weight: 600; }
.add-more { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
@media (max-width: 480px) { .add-more { grid-template-columns: 1fr; } }
.add-link { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--bg-2); text-align: left; transition: background .2s; }
.add-link:hover { background: var(--bg-3); }
.add-link > span:last-child { display: grid; }
.add-link b { font-size: 15.5px; }
.add-link small { font-size: 14px; color: var(--ink-3); }

/* 낱말 카드(시트) */
.card-sheet .sheet-body { gap: 14px; }
.wc-nav { display: flex; align-items: center; gap: 6px; padding-right: 52px; min-height: 44px; }
.wc-nav .icon-btn { width: 44px; height: 44px; }
.wc-nav .flip svg { transform: rotate(180deg); }
.wc-head { display: flex; align-items: center; gap: 8px; }
.wc-word { font-size: calc(clamp(32px, 5vw, 40px) * var(--k)); font-weight: 820; letter-spacing: -0.05em; line-height: 1.15; }
.wc-state { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wc-state small { font-size: 14px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--bg-3); }
.dots i[data-on] { background: var(--easy); }
.wc-mean { font-size: calc(18px * var(--k)); line-height: 1.6; color: var(--ink); }
.wc-block { display: grid; gap: 6px; padding: 14px 16px; border-radius: 16px; background: var(--bg-2); }
.wc-block h3 { font-size: 14px; font-weight: 700; color: var(--ink-3); }
.wc-block p { font-size: calc(15.5px * var(--k)); line-height: 1.6; }
.wc-quote { font-size: calc(16.5px * var(--k)); }
mark.hl-word { background: linear-gradient(transparent 55%, color-mix(in srgb, var(--easy) 28%, transparent) 55%); color: inherit; font-weight: 700; }
.wc-link { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; font-size: 14.5px; font-weight: 700; color: var(--easy); }
.wc-link svg { width: 16px; height: 16px; }
.wc-link .glyph svg { width: 20px; height: 20px; }
.wc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.wc-stats div { padding: 10px 12px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.wc-stats dt { font-size: 14px; color: var(--ink-3); font-weight: 600; }
.wc-stats dd { font-size: 16px; font-weight: 750; }
.wc-act { display: flex; flex-wrap: wrap; gap: 8px; }
.wc-act .wc-drop { margin-left: auto; }
.say-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--bg-2); color: var(--ink-2); flex-shrink: 0; }
.say-btn:hover { background: var(--bg-3); color: var(--ink); }
.say-btn svg { width: 20px; height: 20px; }

/* ───────── 수어 영상(노란 판) ───────── */

.sp { display: grid; gap: 10px; }
.sp-stage { position: relative; aspect-ratio: 3 / 2; border-radius: 18px; overflow: hidden; background: var(--sign-soft); display: grid; place-items: center; box-shadow: 0 0 0 6px var(--sign-soft); margin: 6px; }
.sp-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; cursor: pointer; background: var(--card); }
.sp-empty { aspect-ratio: auto; min-height: 170px; background: var(--bg-2); box-shadow: 0 0 0 6px var(--bg-2); }
.sp-msg { position: relative; display: grid; justify-items: center; gap: 10px; padding: 16px; text-align: center; font-size: 14.5px; font-weight: 650; color: var(--ink-2); }
.sp-msg .glyph svg { width: 30px; height: 30px; color: var(--ink-3); }
.sp-play { position: absolute; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .92); color: var(--ink); box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .35); }
.sp-play .glyph svg { width: 28px; height: 28px; margin-left: 3px; }
.sp-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sp-label { font-size: 14px; font-weight: 700; color: var(--ink-3); }
.sp-btn { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 0 12px; border-radius: 999px; background: var(--bg-2); font-size: 14px; font-weight: 700; color: var(--ink-2); }
.sp-btn:hover { background: var(--bg-3); color: var(--ink); }
.sp-btn svg { width: 16px; height: 16px; }
.sp-btn[aria-pressed="true"] { background: var(--sign); color: #111; }
.sp-note { font-size: 14px; color: var(--ink-3); line-height: 1.6; }
.sp-note a { color: var(--easy); font-weight: 650; }
.sp-alts { display: flex; flex-wrap: wrap; gap: 6px; }
.formula { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.formula > b { font-size: 17px; letter-spacing: -0.03em; }
.eq { color: var(--ink-3); font-weight: 700; }
.part { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 13px; border-radius: 10px; background: var(--sign); color: #111; font-size: 14.5px; font-weight: 700; }
.part[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.part-none { background: var(--bg-2); color: var(--ink-3); }
.part small { font-size: 14px; font-weight: 700; }
.sp-bare .sp-bar { display: none; }
@media (pointer: coarse) { .sp-btn, .part { min-height: 44px; } }

/* ───────── 레슨(집중 화면) ───────── */

.lesson { height: 100svh; max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; padding: 10px 16px 0; }
.ls-top { flex: none; display: flex; align-items: center; gap: 12px; min-height: 56px; }
.ls-close { width: 44px; height: 44px; margin-left: -6px; display: grid; place-items: center; border-radius: 12px; color: var(--ink-3); flex-shrink: 0; }
.ls-close:hover { background: var(--bg-2); color: var(--ink); }
.ls-close svg { width: 24px; height: 24px; }
.ls-bar { flex: 1; display: flex; gap: 4px; height: 12px; align-items: center; }
.ls-bar i { flex: 1; height: 10px; border-radius: 5px; background: var(--bg-3); transition: background .3s, transform .3s var(--ease); }
.ls-bar i[data-state="done"] { background: var(--easy); }
.ls-bar i[data-state="done"][data-kind="meet"] { background: var(--sign); }
.ls-bar i[data-state="now"] { background: color-mix(in srgb, var(--easy) 40%, var(--bg-3)); transform: scaleY(1.25); }
.ls-bar-flat { position: relative; height: 10px; border-radius: 5px; background: var(--bg-3); overflow: hidden; }
.ls-bar-flat i { position: absolute; left: 0; top: 0; bottom: 0; height: auto; border-radius: 5px; background: var(--easy); flex: none; transition: width .4s var(--ease); }
.ls-title { display: none; font-size: 14px; font-weight: 650; color: var(--ink-3); white-space: nowrap; }
@media (min-width: 900px) { .ls-title { display: block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; } }
.ls-stage { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; padding: 8px 2px 12px; }
.ls-stage > * { flex: 1; min-height: 0; }
.ls-wait { flex: 1; display: grid; place-items: center; align-content: center; gap: 10px; color: var(--ink-3); font-size: 15px; font-weight: 600; }
.ls-kicker { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 650; color: var(--ink-3); }
.ls-meet, .ls-ask { display: flex; flex-direction: column; gap: 14px; animation: rise .35s var(--ease) both; }
.ls-meet > *, .ls-ask > * { flex: none; }
.ls-q { font-size: calc(clamp(21px, 2.6vw, 25px) * var(--k)); font-weight: 780; letter-spacing: -0.04em; line-height: 1.35; }
/* 수어 영상 칸: 남은 높이에 맞춰 3:2로 */
.ls-stage .ls-sign { flex: 1 1 0; min-height: 150px; container-type: size; display: grid; place-items: center; }
.ls-stage .ls-sign { max-height: calc(min(100vw - 36px, 684px) / 1.5 + 24px); }
.ls-meet { justify-content: center; }
.ls-sign .sp { position: relative; width: min(100%, calc((100cqh - 12px) * 1.5)); }
.ls-sign .sp-bar { position: absolute; top: 14px; right: 14px; pointer-events: none; }
.ls-sign .sp-bar > * { pointer-events: auto; }
.ls-sign .sp-btn { background: rgba(255, 255, 255, .94); color: #111; box-shadow: 0 2px 8px -4px rgba(0, 0, 0, .3); }
.ls-sign .sp-btn[aria-pressed="true"] { background: var(--sign); }
.ls-sign .sp-label:empty { display: none; }
.ls-sign .sp-label { padding: 2px 8px; border-radius: 6px; background: rgba(255, 255, 255, .9); }
.ls-wordcard { display: grid; gap: 6px; justify-items: center; text-align: center; padding: 4px 8px; }
.ls-word { display: flex; align-items: center; gap: 8px; }
.ls-word b { font-size: calc(clamp(34px, 6vw, 46px) * var(--k)); font-weight: 820; letter-spacing: -0.05em; line-height: 1.15; color: var(--ink); }
.ls-mean { font-size: calc(17.5px * var(--k)); color: var(--ink-2); line-height: 1.55; max-width: 480px; }
.ls-formula { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--sign-soft); color: var(--sign-deep); font-size: calc(14.5px * var(--k)); font-weight: 700; }
.ls-formula .glyph svg { width: 16px; height: 16px; }
.ls-note { font-size: 14px; color: var(--ink-3); }
.ls-quote { max-width: 500px; padding: 10px 16px; border-radius: 14px; background: var(--bg-2); font-size: calc(15.5px * var(--k)); line-height: 1.6; color: var(--ink-2); }
.ls-prompt { display: grid; place-items: center; padding: 22px 20px; border-radius: 22px; text-align: center; }
.ls-prompt-text { background: var(--easy-soft); min-height: 120px; }
.ls-prompt-word { background: var(--easy-soft); padding: 18px; }
.ls-text { font-size: calc(clamp(19px, 2.4vw, 23px) * var(--k)); font-weight: 650; line-height: 1.6; letter-spacing: -0.02em; }
.ls-big { font-size: calc(clamp(34px, 6vw, 46px) * var(--k)); font-weight: 820; letter-spacing: -0.05em; }
.blank { display: inline-block; width: 4.2em; height: 1.1em; margin: 0 .2em; vertical-align: -0.2em; border-radius: 6px; border-bottom: 3px solid var(--easy); background: var(--card); }
/* 보기 */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .choices:not(.choices-video) { grid-template-columns: 1fr; gap: 8px; } }
.choice { position: relative; display: flex; align-items: center; gap: 12px; min-height: calc(60px * var(--k)); padding: 0 16px 0 12px; border-radius: 18px; background: var(--card); box-shadow: 0 0 0 1.5px var(--line-2), 0 4px 0 var(--bg-3); font-size: calc(18px * var(--k)); font-weight: 700; letter-spacing: -0.02em; text-align: left; transition: transform .2s var(--ease), box-shadow .2s, background .2s, opacity .2s; }
.choice:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 0 0 1.5px var(--ink-3), 0 6px 0 var(--bg-3); }
.choice:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 0 0 1.5px var(--ink-3), 0 1px 0 var(--bg-3); }
.choice:disabled { cursor: default; }
.choice-no { width: 28px; height: 28px; flex-shrink: 0; border-radius: 9px; display: grid; place-items: center; background: var(--bg-2); color: var(--ink-3); font-size: 14px; font-weight: 750; }
.choice-w { flex: 1; }
.choice-mark { display: grid; place-items: center; }
.choice-mark svg { width: 22px; height: 22px; stroke-width: 3; }
.choice[data-state="right"] { background: var(--good-soft); color: var(--good); box-shadow: 0 0 0 2.5px var(--good), 0 4px 0 color-mix(in srgb, var(--good) 40%, var(--bg-3)); }
.choice[data-state="right"] .choice-no { background: var(--good); color: #fff; }
.choice[data-state="wrong"] { background: var(--bad-soft); color: var(--bad); box-shadow: 0 0 0 2.5px var(--bad), 0 4px 0 color-mix(in srgb, var(--bad) 40%, var(--bg-3)); animation: shake .4s; }
.choice[data-state="wrong"] .choice-no { background: var(--bad); color: #fff; }
.choice[data-state="dim"] { opacity: .45; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
/* 수어 보기 넷(2×2): 감싸는 칸 크기에 맞춰 줄인다 */
.ls-stage .choices-wrap { flex: 1 1 0; min-height: 190px; container-type: size; display: grid; place-items: start center; }
.choices-video { --cw: min(calc(50cqw - 6px), calc((50cqh - 14px) * 1.5 + 12px)); grid-template-columns: repeat(2, var(--cw)); gap: 10px; }
.choice-video { display: block; padding: 6px; min-height: 0; background: var(--sign-soft); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--sign) 60%, var(--line-2)), 0 4px 0 var(--bg-3); }
.choice-video video { width: 100%; aspect-ratio: 3 / 2; object-fit: fill; border-radius: 12px; background: var(--card); display: block; }
.choice-video .choice-no { position: absolute; left: 12px; top: 12px; background: rgba(255, 255, 255, .92); color: var(--ink); }
.choice-video .choice-mark { position: absolute; right: 12px; top: 12px; width: 30px; height: 30px; border-radius: 50%; }
.choice-video[data-state="right"] .choice-mark { background: var(--good); color: #fff; }
.choice-video[data-state="wrong"] .choice-mark { background: var(--bad); color: #fff; }
.ls-ask-word2sign .ls-prompt-word { padding: 12px 18px; }
.ls-ask-word2sign .ls-big { font-size: calc(clamp(30px, 5vw, 40px) * var(--k)); }
.ls-two { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 아래 줄: 평소엔 "알겠어요"·"계속", 답하면 판정(맞음 초록 · 틀림 빨강)이 아래에서 올라온다 */
.ls-foot { flex: none; display: flex; align-items: center; gap: 16px; min-height: 92px; margin: 0 -16px; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); }
.ls-go { flex: 1; }
.ls-verdict { border-radius: 24px 24px 0 0; animation: sheet-up .35s var(--ease) both; }
.ls-verdict.is-right { background: var(--good-soft); }
.ls-verdict.is-wrong { background: var(--bad-soft); }
.ls-verdict .ls-go { flex: 0 0 auto; min-width: 180px; }
.ls-verdict.is-right .ls-go { background: var(--good); color: #fff; }
.ls-verdict.is-wrong .ls-go { background: var(--bad); color: #fff; }
.vd-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.vd-head { display: flex; align-items: center; gap: 10px; font-size: calc(21px * var(--k)); font-weight: 800; letter-spacing: -0.03em; }
.is-right .vd-head { color: var(--good); }
.is-wrong .vd-head { color: var(--bad); }
.vd-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.is-right .vd-ic { background: var(--good); }
.is-wrong .vd-ic { background: var(--bad); }
.vd-ic svg { width: 20px; height: 20px; stroke-width: 3; }
.vd-line { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: calc(16px * var(--k)); color: var(--ink); }
.vd-text { font-size: calc(16px * var(--k)); line-height: 1.5; }
.vd-pick s { color: var(--bad); font-weight: 700; }
.vd-ans b { font-weight: 800; }
.vd-mean { font-size: calc(15px * var(--k)); color: var(--ink-2); line-height: 1.5; }
.vd-sign { width: 150px; flex-shrink: 0; }
.vd-sign .sp-stage { margin: 0; box-shadow: none; border-radius: 12px; }
@media (max-width: 640px) {
  .ls-foot { flex-wrap: wrap; gap: 10px; min-height: 88px; }
  .ls-verdict .ls-go { flex: 1 1 100%; min-width: 0; }
  .vd-sign { width: 110px; }
}

/* 완료 화면 */
.lesson-done { justify-content: center; overflow: auto; }
.done-wait { flex: 1; display: grid; place-items: center; color: var(--ink-3); }
.done { display: grid; justify-items: center; gap: 22px; text-align: center; padding: 32px 0 40px; animation: rise .5s var(--ease) both; }
.done-ring { position: relative; width: 132px; height: 132px; display: grid; place-items: center; }

.done-ring .ring-fg { stroke: var(--good); }
.done-ring[data-grow] .ring-fg { animation: ring-grow 1.1s var(--ease) .15s both; }
@keyframes ring-grow { from { stroke-dashoffset: 326.7; } }
.done-ring-in { position: relative; }
.done-ring-in svg { width: 52px; height: 52px; color: var(--good); stroke-width: 3; }
.done-ring-in b { font-size: 28px; font-weight: 800; }
.done-ring[data-grow] .done-ring-in { animation: pop-in .5s var(--ease) 1s both; }
@keyframes pop-in { from { transform: scale(.4); opacity: 0; } }
.done-h { font-size: calc(clamp(28px, 4vw, 36px) * var(--k)); font-weight: 820; letter-spacing: -0.05em; }
.done-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 520px; }
.done-stat { display: grid; gap: 2px; padding: 14px 8px; border-radius: 18px; background: var(--bg-2); }
.done-stat-v { position: relative; font-size: calc(26px * var(--k)); font-weight: 820; letter-spacing: -0.04em; }
.done-stat-l { font-size: calc(13.5px * var(--k)); font-weight: 650; color: var(--ink-3); }
.done-streak { background: var(--flame-soft); }
.done-streak .done-stat-v { color: var(--flame); }
.plus-one { position: absolute; white-space: nowrap; top: -14px; margin-left: 4px; padding: 2px 8px; border-radius: 999px; background: var(--flame); color: #fff; font-size: 14px; font-weight: 800; animation: bump .8s var(--ease) 1.2s both; }
@keyframes bump { 0% { transform: translateY(10px) scale(.5); opacity: 0; } 60% { transform: translateY(-4px) scale(1.15); opacity: 1; } }
.done-sec { display: grid; gap: 10px; justify-items: center; width: 100%; max-width: 560px; }
.done-sec .chip-row { justify-content: center; }
.done-k { display: flex; align-items: center; gap: 8px; }
.done-k small { font-size: 14px; color: var(--ink-3); }
.done-act { display: grid; gap: 8px; width: 100%; max-width: 420px; margin-top: 6px; }

/* ───────── 나(#/me) ───────── */

.me { max-width: var(--l-main); margin: 0 auto; display: grid; gap: 16px; }
.me-head { display: flex; align-items: center; gap: 16px; margin-bottom: 4px; }
.me-head .avatar { font-size: 22px; }
.me-head h1 { font-size: calc(28px * var(--k)); font-weight: 800; letter-spacing: -0.045em; line-height: 1.2; }
.me-head .muted { font-size: 14.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rec { display: grid; gap: 18px; }
.rec-top { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rec-big { display: grid; justify-items: start; gap: 2px; padding: 14px; border-radius: 18px; background: var(--bg-2); }
.rec-big .flame, .rec-ic { width: 40px; height: 40px; border-radius: 13px; margin-bottom: 6px; }
.rec-ic { display: grid; place-items: center; background: var(--easy-soft); color: var(--easy); }
.rec-ic.ic-done { background: var(--good-soft); color: var(--good); }
.rec-ic svg { width: 22px; height: 22px; }
.rec-big b { font-size: calc(24px * var(--k)); font-weight: 820; letter-spacing: -0.04em; }
.rec-big small { font-size: 14px; color: var(--ink-3); font-weight: 650; }
@media (max-width: 420px) { .rec-big { padding: 12px 10px; } .rec-big b { font-size: 20px; } }
.heat { display: flex; gap: 8px; overflow-x: auto; }
.heat-days { display: grid; grid-template-rows: repeat(7, 16px); gap: 4px; font-size: 12px; color: var(--ink-3); }
.heat-days span { line-height: 16px; }
.heat-days span:nth-child(1) { grid-row: 1; } .heat-days span:nth-child(2) { grid-row: 3; } .heat-days span:nth-child(3) { grid-row: 5; } .heat-days span:nth-child(4) { grid-row: 7; }
.heat-grid { display: grid; grid-template-columns: repeat(var(--w), 16px); gap: 4px; }
.heat-col { display: grid; grid-template-rows: repeat(7, 16px); gap: 4px; }
.heat i, .heat-legend i { width: 16px; height: 16px; border-radius: 4px; background: var(--bg-2); }
.heat i[data-lv="-1"] { background: transparent; }
.heat i[data-lv="1"], .heat-legend i[data-lv="1"] { background: color-mix(in srgb, var(--flame) 30%, var(--card)); }
.heat i[data-lv="2"], .heat-legend i[data-lv="2"] { background: color-mix(in srgb, var(--flame) 62%, var(--card)); }
.heat i[data-lv="3"], .heat-legend i[data-lv="3"] { background: var(--flame); }
.heat-legend { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.heat-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.miles { display: grid; gap: 14px; }
.mile-row { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.mile-row li { display: grid; justify-items: center; gap: 2px; padding: 12px 4px; border-radius: 16px; background: var(--bg-2); color: var(--ink-3); text-align: center; }
.mile-row li[data-on] { background: var(--easy-soft); color: var(--easy); }
.mile-badge { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--card); margin-bottom: 4px; }
.mile-row li[data-on] .mile-badge { background: var(--easy); color: #fff; }
.mile-row b { font-size: 17px; font-weight: 800; color: var(--ink); }
.mile-row li:not([data-on]) b { color: var(--ink-3); }
.mile-row small { font-size: 14px; font-weight: 650; }
.settings { display: grid; gap: 12px; scroll-margin-top: 24px; }
.set-k { margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--ink-3); }
.pick-grid-sm { gap: 8px; }
.pick-sm { padding: 14px 10px; border-radius: 18px; }
.pick-sm .dp-tile { width: 42px; height: 42px; border-radius: 13px; }
.pick-sm .dp-tile .glyph svg { width: 22px; height: 22px; }
.pick-sm .dp-text b { font-size: 20px; }
.pick-sm .dp-board { width: 108px; height: 42px; border-radius: 13px; }
.pick-sm b { font-size: calc(16px * var(--k)); }
.pick-sm small { font-size: 14px; }
@media (max-width: 620px) { .pick-grid-sm { grid-template-columns: 1fr; } .pick-sm { grid-template-columns: auto 1fr; justify-items: start; text-align: left; column-gap: 14px; } .pick-sm > :first-child { grid-row: span 2; } .pick-sm b { margin-top: 0; } }
.seg-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.seg-btn { display: grid; gap: 2px; padding: 12px 8px; border-radius: 16px; background: var(--bg-2); text-align: center; transition: background .2s, box-shadow .2s; }
.seg-btn:hover { background: var(--bg-3); }
.seg-btn b { font-size: calc(18px * var(--k)); font-weight: 800; }
.seg-btn small { font-size: 14px; color: var(--ink-3); }
.seg-btn[aria-checked="true"] { background: var(--card); box-shadow: 0 0 0 2.5px var(--easy); }
.srows { display: grid; }
.srow { display: flex; align-items: center; gap: 16px; padding: 12px 0; }
.srow + .srow { box-shadow: inset 0 1px 0 var(--line); }
.srow-tx { flex: 1; display: grid; }
.srow-tx b { font-size: calc(16px * var(--k)); font-weight: 700; }
.srow-tx small { font-size: calc(14px * var(--k)); color: var(--ink-3); }
.switch { position: relative; width: 56px; height: 34px; flex-shrink: 0; border-radius: 17px; background: var(--bg-3); transition: background .2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .25s var(--ease); }
.switch[aria-checked="true"] { background: var(--easy); }
.switch[aria-checked="true"] i { transform: translateX(22px); }
.links { display: grid; padding: 8px; }
.link-row { display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 0 12px; border-radius: 14px; font-size: calc(16px * var(--k)); font-weight: 650; text-align: left; }
.link-row:hover { background: var(--bg-2); }
.link-row > span:nth-child(2) { flex: 1; }
.link-row > .glyph:last-child { color: var(--ink-3); }
.link-row > .glyph:last-child svg { width: 18px; height: 18px; }

/* 로그인 안내 */
.gate { min-height: 100svh; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; padding: 24px; }
.gate-mark { width: 64px; height: 64px; object-fit: contain; }
.gate h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.04em; }
.gate .btn { margin-top: 10px; min-width: 200px; }

/* ───────── 수업 모드(#/show) ───────── */

.cls { height: 100svh; display: grid; grid-template-rows: auto 1fr auto; gap: 12px; padding: 12px clamp(16px, 2.5vw, 40px) 16px; background: var(--bg); }
.cls-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cls-x { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; color: var(--ink-2); }
.cls-x:hover { background: var(--bg-2); }
.cls-x svg { width: 24px; height: 24px; }
.cls-title { font-size: 18px; font-weight: 750; }
.cls-count { padding: 4px 12px; border-radius: 999px; background: var(--bg-2); font-size: 15px; font-weight: 700; color: var(--ink-2); }
.cls-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--bg-2); font-size: 15px; font-weight: 700; color: var(--ink-2); }
.cls-btn:hover { background: var(--bg-3); color: var(--ink); }
.cls-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.cls-stage { min-height: 0; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 56px); align-items: center; }
.cls-sign { height: 100%; min-height: 0; container-type: size; display: grid; place-items: center; }
.cls-sign .sp { width: min(100%, calc((100cqh - 60px) * 1.5)); }
.cls-sign .sp-stage { border-radius: 24px; }
.cls-word { display: grid; gap: 14px; align-content: center; }
.cls-head { font-size: clamp(56px, 7.2vw, 144px); font-weight: 850; letter-spacing: -0.06em; line-height: 1.05; overflow-wrap: anywhere; }
.cls-mean { font-size: clamp(20px, 2vw, 38px); color: var(--ink-2); line-height: 1.5; }
.cls-formula { display: inline-flex; align-items: center; gap: 8px; justify-self: start; padding: 6px 16px; border-radius: 999px; background: var(--sign-soft); color: var(--sign-deep); font-size: clamp(16px, 1.4vw, 24px); font-weight: 700; }
.cls-cover { display: grid; gap: 10px; place-content: center; justify-items: center; min-height: 50%; padding: 32px; border-radius: 28px; background: var(--easy-soft); color: var(--easy); text-align: center; transition: transform .3s var(--ease); }
.cls-cover:hover { transform: translateY(-3px) rotate(-.5deg); }
.cls-cover b { font-size: clamp(30px, 3.2vw, 60px); font-weight: 820; letter-spacing: -0.04em; }
.cls-cover span { font-size: clamp(15px, 1.2vw, 20px); font-weight: 650; }
.cls-foot { display: flex; align-items: center; gap: 12px; }
.cls-foot .btn { min-width: 140px; }
.cls-keys { flex: 1; text-align: center; font-size: 14px; color: var(--ink-3); }
.cls-keys kbd { display: inline-block; min-width: 26px; padding: 1px 7px; margin: 0 2px; border-radius: 7px; background: var(--bg-2); box-shadow: inset 0 -2px 0 var(--line-2); font: inherit; font-weight: 700; color: var(--ink-2); }
.cls:fullscreen { padding: 24px 48px; }
@media (max-width: 760px) {
  .cls { height: auto; min-height: 100svh; }
  .cls-stage { grid-template-columns: 1fr; align-content: start; }
  .cls-sign { height: auto; container-type: normal; }
  .cls-sign .sp { width: 100%; }
  .cls-keys { display: none; }
  .cls-foot .btn { flex: 1; min-width: 0; }
  .cls-btn > span:not(.glyph) { display: none; }
  .cls-btn { width: 44px; padding: 0; justify-content: center; }
}

/* ───────── 움직임 줄이기 ───────── */
@media (prefers-reduced-motion: reduce) {
  .node[data-now] .node-btn::after { animation: none; }
  .tile:hover, .fork-card:hover, .pick-card:hover, .node-btn:hover, .cls-cover:hover, .set-tile:hover, .sotd-link:hover .sotd-video { transform: none; }
}
