/* ───────── 발음 기초 과정 (시안: 목록 B · 표 B · 퀴즈 B · 획순 A · 따라 쓰기 A) ───────── */
.seg.tabs { margin: 0 0 14px; padding: 4px; border-radius: 12px; }
.seg.tabs button { padding: 10px 0; font-size: 15.5px; }
.btn.big { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 18px; font-size: 15.5px; border-radius: 12px; }
.btn.block { display: flex; width: 100%; margin-top: 12px; }
.btn:disabled { opacity: .4; }
.hint.center { text-align: center; margin: 4px 0 10px; }
.lesson-intro { margin: 2px 2px 8px; color: var(--ink2); font-size: 14.5px; line-height: 1.7; }

/* 진행 카드 + 단계 목록 */
.card.prog { padding: 14px 16px; font-size: 15px; }
.card.prog b { color: var(--accent-text); font-size: 18px; }
.bar { height: 6px; border-radius: 3px; background: var(--chip); overflow: hidden; margin-top: 10px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }
.steps { display: grid; gap: 10px; }
.step-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line);
}
.step-card .no { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 14px; font-weight: 700; background: var(--chip); color: var(--ink2); }
.step-card .st { flex: 1; min-width: 0; }
.step-card .st b { display: block; font-size: 16px; }
.step-card .st small { display: block; color: var(--ink3); font-size: 13px; }
.step-card .state { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 700; color: var(--ink3); white-space: nowrap; }
.step-card.done { border-color: color-mix(in srgb, #4CC383 45%, var(--line)); }
.step-card.done .no { background: rgba(76, 195, 131, .16); color: #4CC383; }
.step-card.done .state { color: #4CC383; }
.step-card.now { border-color: var(--accent); }
.step-card.now .no { background: var(--accent); color: #fff; }
.step-card.now .state { color: var(--accent-text); }
.step-card:active { transform: scale(.985); }

/* 글자표 */
.basics-chips { margin: 0 -16px 10px; }
.kana-table { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 8px; }
.kh { text-align: center; font-size: 13px; color: var(--ink3); }
.kc {
  aspect-ratio: 1 / 1.08; border-radius: 12px; background: var(--card); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.kc b { font-size: 26px; font-weight: 500; line-height: 1.15; }
.kc.wide b { font-size: 19px; }
.kc small { font-size: 12.5px; color: var(--accent-text); min-height: 1.2em; }
.kc small.masked-s { color: transparent; background: var(--chip); border-radius: 4px; width: 60%; }
.kc.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.kc.empty { background: transparent; border: 0; }
.table-bar { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }
.ex-card {
  display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px;
  border-radius: 14px; background: var(--card); border: 1px solid var(--line); cursor: pointer;
}
.ex-card .kbig { font-size: 34px; width: 44px; text-align: center; }
.ex-card .exb { flex: 1; min-width: 0; }
.ex-card .exb b { display: block; font-size: 18px; font-weight: 700; }
.ex-card .exb small { color: var(--ink2); font-size: 13.5px; }
.ex-list .ex-card { margin-top: 8px; background: var(--bg); }

/* 카드 연습 */
.flash-wrap { padding: 16px; }
.flash {
  width: 100%; min-height: 250px; margin: 14px 0 6px; border-radius: 16px;
  background: var(--bg); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.flash > b { font-size: 88px; font-weight: 500; line-height: 1.1; }
.flash .back { display: none; flex-direction: column; align-items: center; gap: 2px; }
.flash.open .back { display: flex; }
.flash .back .p { font-size: 26px; font-weight: 700; color: var(--accent-text); }
.flash .back small { color: var(--ink2); font-size: 14px; }
.flash .fc-done { font-size: 24px; font-weight: 700; }
.flash-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.quiz-top { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink2); }
.quiz-top .bar { flex: 1; margin: 0; }
.quiz-top .pct { color: var(--accent-text); font-weight: 700; }

/* 획순 보기 · 따라 쓰기 */
.board { position: relative; margin: 4px auto 0; width: 100%; max-width: 380px; aspect-ratio: 1; border-radius: 18px; background: var(--card); border: 1px solid var(--line); padding: 10px; }
.stroke-svg { width: 100%; height: 100%; display: block; touch-action: none; }
.stroke-svg .guide path { stroke: var(--line); stroke-width: .6; stroke-dasharray: 2 2; fill: none; }
.stroke-svg .guide .diag { stroke-width: .4; opacity: .7; }
.stroke-svg .ghost path { stroke: color-mix(in srgb, var(--ink) 12%, transparent); stroke-width: 5.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.stroke-svg .ink path { stroke: var(--ink); stroke-width: 5.2; fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.stroke-svg .ink path.now, .stroke-svg .ink path.drawn, .stroke-svg .ink path.hint { opacity: 1; }
.stroke-svg .ink path.now { stroke: var(--accent); }
.stroke-svg .nm { opacity: 0; transition: opacity .2s; }
.stroke-svg .nm.shown { opacity: 1; }
.stroke-svg .nm circle { fill: var(--bg); stroke: var(--star); stroke-width: .8; }
.stroke-svg .nm text { fill: var(--star); font-size: 5.6px; font-weight: 700; text-anchor: middle; font-family: "Noto Sans KR", sans-serif; }
.board.no-num .nm { display: none; }
.stroke-svg.trace .ink path.drawn { stroke: var(--accent); }
.stroke-svg.trace .ink path.hint { stroke: var(--star); opacity: .9; }
.stroke-svg .live { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.stroke-info { display: flex; align-items: center; gap: 12px; margin: 16px 4px 0; }
.stroke-info .rd { font-size: 28px; font-weight: 500; }
.stroke-info .rd small { font-size: 18px; color: var(--ink3); }
.stroke-info .cnt { margin-left: auto; font-size: 24px; font-weight: 500; }
.stroke-ctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 0; }
.stroke-ctl .pill { background: var(--card); }
.seg.mini { margin: 0; }
.seg.mini button { flex: none; padding: 6px 12px; }
.numtg { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: 14px; color: var(--star); font-weight: 700; }
.stroke-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.stroke-nav .navk { width: 52px; height: 52px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 24px; color: var(--ink2); }
.stroke-nav .navc { padding: 8px 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 20px; }
.write-status { text-align: center; margin: 4px 0 10px; color: var(--ink2); }
.write-status b { color: var(--accent-text); }
.write-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.write-btns .btn { padding: 10px 4px; background: var(--chip); color: var(--ink); border: 1px solid var(--line); }
.write-toast { margin: 14px auto 0; width: fit-content; padding: 8px 16px; border-radius: 10px; font-size: 14px; font-weight: 700; color: #fff; }
.write-toast.ok { background: #2E9D63; }
.write-toast.bad { background: #C9403A; }

/* 설명 단계 */
.lesson-card { padding: 14px 16px; }
.lesson-card p { margin: 0; line-height: 1.75; font-size: 15px; }
.quiz-go { margin-top: 22px; }

/* 듣기 퀴즈 */
.quiz-card { padding: 16px; }
.quiz-q { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 18px 0; padding: 22px 12px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); }
.qplay { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(45, 146, 249, .4); }
.qplay.speaking { animation: pulse 1s ease-in-out infinite; }
.quiz-q .qt { margin: 4px 0 0; font-size: 19px; font-weight: 700; }
.qslow { color: var(--accent-text); font-size: 14px; }
.qopts { display: grid; grid-template-columns: repeat(min(var(--n), 3), 1fr); gap: 10px; }
.qopt { position: relative; padding: 18px 8px 14px; border-radius: 14px; background: var(--bg); border: 1.5px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.qopt b { font-size: 21px; font-weight: 500; }
.qopt small { font-size: 12.5px; color: var(--ink3); text-align: center; }
.qopt .ok-tag { display: none; position: absolute; top: -11px; left: 50%; transform: translateX(-50%); padding: 1px 10px; border-radius: 999px; background: #2E9D63; color: #fff; font-size: 12px; font-weight: 700; }
.qopt.right { border-color: #4CC383; }
.qopt.right .ok-tag { display: block; }
.qopt.wrong { border-color: #EF6B63; opacity: .8; }
.qopt:disabled { cursor: default; color: inherit; }
.quiz-result { text-align: center; padding: 26px 0 10px; }
.quiz-result b { font-size: 40px; color: var(--accent-text); }
.quiz-result p { margin: 6px 0 0; color: var(--ink2); }
.ex-card .exb small.rdg { display: block; color: var(--ink3); font-size: 12.5px; }
.table-bar.top { margin: 0 0 12px; flex-wrap: wrap; }
.table-bar.top .btn.big { padding: 9px 14px; font-size: 14.5px; }

/* 따라 쓰기 아래: 목록 보기 + 다음 글자 */
.write-next { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; margin-top: 12px; }
/* 획순 보기 가운데: 지금 글자 + 목록 보기 */
.stroke-nav .navc { display: inline-flex; align-items: baseline; gap: 8px; }
.stroke-nav .navc small { font-size: 13px; color: var(--accent-text); font-weight: 700; }

/* 글자 고르기 판 (아래에서 올라옴) */
.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0); transition: background .2s; display: flex; align-items: flex-end; }
.sheet.open { background: rgba(0, 0, 0, .5); }
.sheet-in {
  width: 100%; max-width: 720px; margin: 0 auto; max-height: 78dvh; overflow-y: auto;
  background: var(--bg); border-top: 1px solid var(--line); border-radius: 20px 20px 0 0;
  padding: 0 16px calc(var(--bottom) + 18px);
  transform: translateY(100%); transition: transform .22s ease;
}
.sheet.open .sheet-in { transform: none; }
.sheet-hd { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 14px 2px 10px; background: var(--bg); }
.sheet-hd b { font-family: "Gowun Dodum", sans-serif; font-size: 19px; }
.sheet-x { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--ink2); background: var(--chip); }
.sheet-grid .kc b { font-size: 22px; }
