/* 만단어 — 조용하고 깔끔하게. 언어마다 색 하나만 다르다 */
:root {
  --bg: #f7f6f3; --card: #ffffff; --ink: #1b1b1d; --sub: #66666b; --faint: #75757a; --line: #e7e5e0;
  --soft: #efeee9; --good: #2e8b57; --bad: #c8553d; --mark: rgba(255, 200, 0, .28);
  --acc: #1b1b1d; --acc-ink: #ffffff; --acc-soft: rgba(27, 27, 29, .06);
  --en: #3657a8; --ja: #cf4a2b; --zh: #138470;
  --r: 18px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 24px rgba(0,0,0,.05);
  --font: -apple-system, BlinkMacSystemFont, "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) [data-lang], :root:not([data-theme="light"]) body[data-lang] { --acc-ink: #121214; }
  :root:not([data-theme="light"]) {
    --bg: #121214; --card: #1c1c1f; --ink: #f1f1f2; --sub: #a8a8ae; --faint: #8e8e94; --line: #2c2c31;
    --soft: #242428; --mark: rgba(255, 200, 0, .22); --acc: #f1f1f2; --acc-ink: #121214; --acc-soft: rgba(255,255,255,.06);
    --en: #7b9bef; --ja: #f07a5a; --zh: #3cc3a2; --shadow: none; color-scheme: dark; --good: #4cc38a; --bad: #f0806a;
  }
}
:root[data-theme="dark"] [data-lang], :root[data-theme="dark"] body[data-lang] { --acc-ink: #121214; }
:root[data-theme="dark"] {
  --bg: #121214; --card: #1c1c1f; --ink: #f1f1f2; --sub: #a8a8ae; --faint: #8e8e94; --line: #2c2c31;
  --soft: #242428; --mark: rgba(255, 200, 0, .22); --acc: #f1f1f2; --acc-ink: #121214; --acc-soft: rgba(255,255,255,.06);
  --en: #7b9bef; --ja: #f07a5a; --zh: #3cc3a2; --shadow: none; color-scheme: dark; --good: #4cc38a; --bad: #f0806a;
}
[data-lang="en"] { --acc: var(--en); --acc-ink: #fff; --acc-soft: color-mix(in srgb, var(--en) 9%, transparent); }
[data-lang="ja"] { --acc: var(--ja); --acc-ink: #fff; --acc-soft: color-mix(in srgb, var(--ja) 9%, transparent); }
[data-lang="zh"] { --acc: var(--zh); --acc-ink: #fff; --acc-soft: color-mix(in srgb, var(--zh) 9%, transparent); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
body { min-height: 100dvh; overscroll-behavior-y: none; }
body[data-lang]:not([data-lang=""]) { background: linear-gradient(var(--acc-soft), transparent 260px) no-repeat, var(--bg); }
:lang(ja) { font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", "Meiryo", var(--font); }
:lang(zh-CN) { font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", var(--font); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
small, .small { font-size: 13px; }
.muted { color: var(--sub); }
mark { background: var(--mark); color: inherit; border-radius: 4px; padding: 0 2px; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

.page { max-width: 560px; margin: 0 auto; padding: 0 16px calc(32px + env(safe-area-inset-bottom)); }
.top { display: flex; align-items: center; gap: 8px; min-height: calc(56px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); margin: 0 -16px 8px; padding-left: 8px; padding-right: 8px; }
.top-t { flex: 1; font-weight: 650; font-size: 17px; text-align: center; margin: 0; }
.top-r { min-width: 44px; display: flex; justify-content: flex-end; }
.iconbtn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--ink); }
.iconbtn:active { background: var(--soft); }
.iconbtn[disabled] { opacity: .3; }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: 15px; transition: transform .08s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--acc); color: var(--acc-ink); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--sub); }
.btn.danger { color: var(--bad); }
.btn.big { min-height: 56px; font-size: 17px; width: 100%; border-radius: 16px; }
.btn.wide { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn .ic { width: 18px; height: 18px; }
.col { display: grid; gap: 10px; margin: 16px 0; }
.empty { text-align: center; color: var(--sub); padding: 64px 16px 24px; }
.lead { color: var(--sub); font-size: 15px; margin: 4px 0 16px; }
.note { color: var(--sub); font-size: 13px; text-align: center; margin: 20px 0 8px; }

/* 홈 */
.home-h { display: flex; justify-content: space-between; align-items: flex-start; padding: calc(28px + env(safe-area-inset-top)) 0 20px; }
.home-h h1 { margin: 0; font-size: 30px; letter-spacing: -0.02em; font-weight: 750; }
.home-h .sub { margin: 2px 0 0; color: var(--sub); font-size: 14px; }
.home-icons { display: flex; gap: 2px; margin-right: -8px; }
.rooms { display: grid; gap: 12px; }
.room { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; background: var(--card); border-radius: var(--r); padding: 18px 18px 16px; box-shadow: var(--shadow); border: 1px solid var(--line); position: relative; overflow: hidden; }
.room::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--acc); }
.room:active { transform: scale(.995); }
.room-name { display: flex; align-items: baseline; gap: 8px; }
.room-name .native { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; color: var(--acc); }
.room-name .ko { font-size: 14px; color: var(--sub); }
.room-todo { grid-row: span 2; text-align: right; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; }
.room-todo b { font-size: 30px; line-height: 1; font-weight: 750; font-variant-numeric: tabular-nums; }
.room-todo span { font-size: 12px; color: var(--sub); margin-top: 4px; }
.room-todo .done { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--good); font-weight: 600; margin: 0; }
.room-todo .done .ic { width: 18px; height: 18px; }
.room-detail { font-size: 14px; color: var(--sub); }
.meter { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: var(--soft); position: relative; overflow: hidden; margin-top: 10px; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; }
.meter .m2 { background: color-mix(in srgb, var(--acc) 30%, transparent); }
.meter .m1 { background: var(--acc); }
.room-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }

/* 언어 방 */
.hero { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 18px 16px; box-shadow: var(--shadow); text-align: center; margin-bottom: 12px; }
.hero-nums { display: flex; justify-content: center; gap: 40px; margin-bottom: 18px; }
.hero-nums div { display: flex; flex-direction: column; }
.hero-nums b { font-size: 40px; line-height: 1.05; font-weight: 750; color: var(--acc); font-variant-numeric: tabular-nums; }
.hero-nums span { font-size: 13px; color: var(--sub); }
.hero-sub { color: var(--sub); font-size: 13px; margin: 12px 0 0; }
.hero-done { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--good); font-weight: 650; padding: 8px 0 14px; }
.hero h2 { margin: 6px 0 0; font-size: 22px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.tile { display: flex; flex-direction: column; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 12px; min-height: 96px; }
.tile .ic { color: var(--acc); margin-bottom: 6px; }
.tile b { font-size: 15px; }
.tile span { font-size: 12px; color: var(--sub); line-height: 1.35; }
.tile.wide { flex-direction: column; min-height: 0; padding: 16px; }
.tile:active { background: var(--soft); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; margin-bottom: 12px; }
.panel h2 { margin: 0 0 12px; font-size: 15px; font-weight: 650; }
.panel p { margin: 6px 0 0; }
.stack { display: flex; height: 10px; border-radius: 10px; overflow: hidden; background: var(--soft); gap: 2px; }
.stack i { min-width: 0; }
.s-m { background: var(--acc); }
.s-l { background: color-mix(in srgb, var(--acc) 35%, var(--card)); }
.s-n { background: var(--soft); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--sub); margin-top: 10px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.fc-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 110px; align-items: end; }
.fc-bars.sm { height: 80px; margin-top: 14px; }
.fcb { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: 11px; color: var(--sub); }
.fcb i { width: 100%; max-width: 28px; min-height: 2px; background: color-mix(in srgb, var(--acc) 55%, var(--card)); border-radius: 6px 6px 2px 2px; }
.fcb b { font-size: 11px; font-weight: 600; color: var(--ink); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* 학습 */
.study { display: flex; flex-direction: column; height: 100dvh; max-width: 560px; margin: 0 auto; }
.sbar { display: flex; align-items: center; gap: 8px; padding: calc(6px + env(safe-area-inset-top)) 8px 6px; }
.sprog { flex: 1; height: 6px; background: var(--soft); border-radius: 6px; overflow: hidden; }
.sprog i { display: block; height: 100%; background: var(--acc); border-radius: 6px; transition: width .25s; }
.scount { font-size: 13px; color: var(--sub); min-width: 28px; text-align: right; font-variant-numeric: tabular-nums; }
.sstage { flex: 1; display: flex; padding: 8px 22px; min-height: 0; }
.fc { position: relative; flex: 1; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); overflow-y: auto; transition: transform .2s, box-shadow .2s; touch-action: pan-y; }
.fc[data-swipe="yes"] { box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 45%, transparent); }
.fc[data-swipe="no"] { box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 45%, transparent); }
.kind { position: absolute; top: 14px; left: 16px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 20px; background: var(--soft); color: var(--sub); z-index: 1; }
.k-new { background: var(--acc-soft); color: color-mix(in srgb, var(--acc) 85%, var(--ink)); font-weight: 700; }
.k-learn { display: inline-flex; align-items: center; gap: 4px; background: var(--soft); color: var(--ink); }
.kind .ic { width: 13px; height: 13px; stroke-width: 2.2; }
.fc-front { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 20px 32px; text-align: center; gap: 10px; }
.f-word { font-weight: 650; letter-spacing: -0.01em; line-height: 1.15; word-break: keep-all; overflow-wrap: anywhere; }
.f-word.xl { font-size: 64px; } .f-word.lg { font-size: 48px; } .f-word.md { font-size: 36px; } .f-word.sm { font-size: 28px; }
.fc-front .rd { font-size: 18px; }
.spk { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--acc); background: var(--acc-soft); flex: none; }
.spk.ghost { margin-top: 10px; }
.spk.sm { width: 34px; height: 34px; }
.spk.sm .ic { width: 18px; height: 18px; }
.spk:active { transform: scale(.94); }
.fc-back { padding: 48px 22px 24px; }
.b-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.b-word { font-size: 34px; font-weight: 650; line-height: 1.2; word-break: keep-all; overflow-wrap: anywhere; }
.rd { color: var(--sub); font-size: 17px; margin-top: 2px; }
.hg { color: var(--acc); font-size: 18px; font-weight: 550; margin-top: 2px; }
.hg-hidden { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; color: var(--sub); padding: 4px 10px; border-radius: 20px; background: var(--soft); }
.hg-hidden .ic { width: 16px; height: 16px; }
.meaning { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.meaning .pos { display: block; font-size: 12px; color: var(--sub); margin-bottom: 2px; }
.meaning .m { font-size: 22px; font-weight: 650; line-height: 1.35; word-break: keep-all; }
.ex { margin-top: 18px; background: var(--soft); border-radius: 14px; padding: 12px 14px; }
.xs { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; font-size: 17px; line-height: 1.5; }
.xr { font-size: 14px; color: var(--sub); margin-top: 4px; }
.xh { font-size: 15px; color: color-mix(in srgb, var(--acc) 78%, var(--ink)); margin-top: 2px; }
.xm { font-size: 15px; margin-top: 8px; }
.memo { margin-top: 14px; font-size: 13px; color: var(--sub); padding-left: 10px; border-left: 3px solid var(--line); }
.sact { display: flex; gap: 10px; padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); }
.sact .btn { flex: 1; min-height: 58px; font-size: 17px; border-radius: 16px; }
.sact .no { color: var(--ink); }
.sact .yes { background: var(--acc); color: var(--acc-ink); border-color: transparent; }
.end-big { width: 64px; height: 64px; border-radius: 50%; background: var(--acc-soft); color: var(--acc); display: grid; place-items: center; margin: 4px auto 8px; }
.end-big .ic { width: 32px; height: 32px; stroke-width: 2.4; }
.end-score { font-size: 64px; font-weight: 750; color: var(--acc); line-height: 1; }
.end-score small { font-size: 24px; color: var(--sub); font-weight: 600; }

/* 상황별 */
.taglist { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tagrow { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; }
.tagrow b { font-size: 16px; }
.tagrow span { font-size: 13px; color: var(--sub); }
.tagrow em { font-style: normal; font-size: 12px; color: var(--acc); min-height: 18px; }

/* 단어장 */
.wfilter { position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 4; background: var(--bg); padding: 4px 0 8px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.search:focus-within { outline: 2px solid var(--acc); outline-offset: 1px; }
.search { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0 12px; height: 46px; }
.search .ic { color: var(--sub); width: 18px; height: 18px; }
.search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; min-width: 0; }
.selects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
select { appearance: none; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 14px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 26px 8px 10px; font-size: 13px; min-width: 0; }
.wcount { margin: 4px 2px 6px; }
.wlist { list-style: none; margin: 0; padding: 0; }
.wrow { width: 100%; display: grid; grid-template-columns: 10px minmax(72px, auto) 1fr; grid-template-rows: auto auto; gap: 0 12px; align-items: center; text-align: left; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.wrow:active { background: var(--soft); }
.dot { width: 8px; height: 8px; border-radius: 50%; grid-row: span 2; background: var(--line); }
.d-learning { background: color-mix(in srgb, var(--acc) 45%, var(--card)); }
.d-mature { background: var(--acc); }
.ww { font-size: 18px; font-weight: 600; grid-row: span 2; word-break: keep-all; }
.wr { font-size: 13px; color: var(--sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wmore { padding: 16px 0; text-align: center; }
.end .wlist { margin-top: 4px; }

/* 시트 */
.sheet-wrap { position: fixed; inset: 0; background: rgba(0,0,0,0); display: flex; align-items: flex-end; justify-content: center; z-index: 20; transition: background .2s; }
.sheet-wrap.on { background: rgba(0,0,0,.35); }
.sheet { width: 100%; max-width: 560px; max-height: 88dvh; overflow-y: auto; background: var(--card); border-radius: 24px 24px 0 0; padding: 8px 20px calc(16px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .22s ease-out; }
.sheet-wrap.on .sheet { transform: none; }
.sheet-grip { width: 40px; height: 5px; border-radius: 5px; background: var(--line); margin: 4px auto 14px; }
.sheet-meta { margin-top: 14px; }
.sheet-act { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

/* 퀴즈 */
.q-prompt { min-height: 130px; display: grid; place-items: center; text-align: center; padding: 16px 8px; }
.q-word { font-weight: 650; }
.q-word.xl { font-size: 60px; } .q-word.lg { font-size: 46px; } .q-word.md { font-size: 34px; } .q-word.sm { font-size: 26px; }
.q-mean { font-size: 24px; font-weight: 650; word-break: keep-all; }
.q-listen { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--acc); }
.q-listen .ic { width: 72px; height: 72px; padding: 18px; border-radius: 50%; background: var(--acc-soft); stroke-width: 1.6; }
.q-listen span { font-size: 13px; color: var(--sub); }
.q-opts { display: grid; gap: 10px; }
.q-opt { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; text-align: left; font-size: 16px; min-height: 56px; word-break: keep-all; }
.q-opt:active { background: var(--soft); }
.q-opt.right { border-color: var(--good); background: color-mix(in srgb, var(--good) 12%, var(--card)); }
.q-opt.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, var(--card)); }
.q-opt[disabled] { cursor: default; }
.q-after { margin-top: 14px; display: grid; gap: 12px; }
.q-reveal { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.q-reveal .b-word { font-size: 26px; }
.q-reveal .meaning { margin-top: 10px; padding-top: 10px; }

/* 기록 */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.kpis div { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 12px; display: flex; flex-direction: column; }
.kpis b { font-size: 26px; font-weight: 750; font-variant-numeric: tabular-nums; }
.kpis span { font-size: 12px; color: var(--sub); }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.heat i { aspect-ratio: 1; border-radius: 3px; background: var(--soft); }
.heat i.h-x { background: transparent; }
.h-1 { background: color-mix(in srgb, var(--good) 25%, var(--card)) !important; }
.h-2 { background: color-mix(in srgb, var(--good) 50%, var(--card)) !important; }
.h-3 { background: color-mix(in srgb, var(--good) 75%, var(--card)) !important; }
.h-4 { background: var(--good) !important; }
.heat-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 8px; }
.heat-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.stats .panel[data-lang] h2 span { color: var(--acc); }

/* 설정 */
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.row + .row { border-top: 1px solid var(--line); }
.col-row { flex-wrap: wrap; padding: 6px 0; }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--soft); border-radius: 12px; padding: 3px; }
.stepper button { width: 36px; height: 34px; border-radius: 9px; font-size: 18px; }
.stepper button:active { background: var(--card); }
.stepper b { min-width: 32px; text-align: center; font-variant-numeric: tabular-nums; }
.seg { display: flex; background: var(--soft); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { padding: 7px 11px; border-radius: 9px; font-size: 13px; color: var(--sub); }
.seg button.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.switch { width: 50px; height: 30px; border-radius: 30px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.switch.on { background: var(--good); }
.switch.on i { transform: translateX(20px); }
input[type="range"] { flex: 1; accent-color: var(--ink); }
.rate { min-width: 34px; text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; }
.voice { display: block; font-size: 12px; }
.settings label.btn { cursor: pointer; }
.credits { margin: 0; padding-left: 18px; font-size: 13px; color: var(--sub); }
.credits li { margin: 4px 0; }
.about p { font-size: 14px; }

#toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 30; max-width: calc(100% - 32px); }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 720px) {
  .page { padding-top: 12px; }
  .study { padding: 12px 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- 검수 후 추가 ---- */
.tiles.four { grid-template-columns: repeat(2, 1fr); }
.tile.off { opacity: .55; }
.notice { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--sub); background: var(--card); border: 1px dashed var(--line); border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; }
.notice .ic { width: 18px; height: 18px; color: var(--acc); }
.f-hint { font-size: 18px; color: var(--sub); }
.f-hint.hg { color: var(--acc); opacity: .85; }
.q-opts.two { grid-template-columns: 1fr 1fr; }
.q-opt.center { text-align: center; font-size: 20px; font-weight: 600; }
.q-opt .q-ow { display: block; font-size: 20px; font-weight: 600; }
.q-opt small { display: block; color: var(--sub); font-size: 13px; }
#toast { display: flex; align-items: center; gap: 12px; pointer-events: none; width: max-content; }
#toast.on { pointer-events: auto; }
#toast button { color: var(--bg); font-weight: 700; text-decoration: underline; }
.seg.full { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 8px; }
.seg.full a { text-align: center; padding: 9px; border-radius: 9px; font-size: 14px; color: var(--sub); }
.seg.full a.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.panel h2 small { font-weight: 400; font-size: 12px; margin-left: 4px; }
.kana-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.kana-grid.three { grid-template-columns: repeat(3, 1fr); }
.kana { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 58px; border-radius: 12px; background: var(--soft); padding: 4px; }
.kana b { font-size: 22px; font-weight: 600; line-height: 1.2; }
.kana span { font-size: 12px; color: var(--acc); }
.kana.empty { background: transparent; }
.kana:active { transform: scale(.96); }
.tips { margin: 0; padding-left: 18px; font-size: 14px; }
.tips li { margin: 4px 0; }
.tones { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tone { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 0 10px; align-items: center; text-align: left; background: var(--soft); border-radius: 14px; padding: 10px 12px; }
.tone b { font-size: 13px; color: var(--sub); }
.tone .tm { font-size: 22px; font-weight: 650; color: var(--acc); grid-row: span 2; order: -1; }
.tone .tc { display: none; }
.tone small { font-size: 12px; color: var(--sub); }
.pytab { width: 100%; border-collapse: collapse; font-size: 14px; }
.pytab th { text-align: left; font-weight: 650; padding: 7px 6px 7px 0; width: 30%; }
.pytab td { padding: 7px 4px; border-top: 1px solid var(--line); }
.pytab tr:first-child td, .pytab tr:first-child th { border-top: 0; }
.pytab th { border-top: 1px solid var(--line); }
.pyex { color: var(--acc); text-align: left; }
.empty .btn { margin-top: 12px; }
.legend .s-n { box-shadow: inset 0 0 0 1px var(--faint); }
.say-in { color: var(--acc); border-bottom: 1px dotted currentColor; padding: 0 1px; font-size: inherit; }
.q-prompt .f-hint { margin-top: 6px; }
.q-prompt .spk.ghost { margin: 10px auto 0; }
.known-link { display: block; margin: 0 auto -4px; padding: 6px 12px; font-size: 13px; color: var(--sub); text-decoration: underline; text-underline-offset: 3px; }
