/* 가나 탭 전용 스타일 */
/* 문자 선택 */
.scriptbar { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-block: 14px 10px; padding: 4px; background: var(--surface2); border-radius: 14px; }
.scriptbar button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 500; }
.scriptbar button .kana { font-size: 22px; }
.scriptbar button[aria-selected="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgb(0 0 0 / .12); }
.scriptbar button[aria-selected="true"] .kana { color: var(--accent); }
/* 오늘의 학습 */
.today { display: grid; gap: 14px; }
.today .nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.num { padding: 10px 12px; border-radius: 10px; background: var(--surface2); }
.num b { display: block; font-family: var(--f-mono); font-size: 26px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.num span { font-size: 12px; color: var(--muted); }
.roadmap { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.rowcard { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; }
.rowcard .rs { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 10px; background: var(--surface2); font-size: 24px; }
.rowcard .rs.two { font-size: 17px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; }
.rowcard .rl { display: grid; gap: 3px; min-width: 0; flex: 1; }
.rowcard .rl b { font-size: 14px; display: flex; gap: 6px; align-items: center; }
.rowcard .rl em { font-style: normal; font-size: 12px; color: var(--muted); }
.rowcard.rec { border-color: var(--accent); }
.tag { padding: 0 7px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 500; line-height: 18px; }
details.tips { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 12px 16px; }
details.tips summary { cursor: pointer; font-weight: 500; }
details.tips ol { margin: 10px 0 2px; padding-left: 20px; display: grid; gap: 6px; }

/* 문자표 */
.tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.chart { display: grid; grid-template-columns: 3rem repeat(var(--cols), minmax(0, 1fr)); gap: 6px; }
.chart .colh, .chart .rlab { display: flex; align-items: center; justify-content: center; font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-height: 66px; padding: 4px 2px; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--accent) calc(var(--lv, 0) * 8%), var(--surface)); }
.cell .k { font-family: var(--f-kana); font-weight: 600; font-size: 26px; line-height: 1.25; }
.cell .r { font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.chart.hr .cell .r { visibility: hidden; }
.chart .gap { min-height: 0; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); margin-top: 12px; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line); vertical-align: -2px; margin-right: 4px; background: color-mix(in srgb, var(--accent) calc(var(--lv, 0) * 8%), var(--surface)); }

/* 진도 */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.stackbar { display: flex; height: 16px; border-radius: 8px; overflow: hidden; background: var(--surface2); }
.stackbar span { display: block; height: 100%; background: color-mix(in srgb, var(--accent) calc(var(--lv) * 14%), var(--surface2)); }
.leg { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 4px 12px; margin-top: 10px; font-size: 13px; }
.leg i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: color-mix(in srgb, var(--accent) calc(var(--lv) * 14%), var(--surface2)); border: 1px solid var(--line); }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 120px; }
.days .d { display: grid; grid-template-rows: 1fr auto auto; justify-items: center; gap: 2px; height: 100%; font-size: 11px; color: var(--muted); }
.days .bar { align-self: end; width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; background: color-mix(in srgb, var(--accent) 35%, var(--surface2)); min-height: 3px; }
.days .d.today .bar { background: var(--accent); }
.days .d b { font-family: var(--f-mono); font-weight: 500; color: var(--fg); font-size: 12px; }
.weak { display: flex; flex-wrap: wrap; gap: 8px; }
.weak button { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.weak .kana { font-size: 22px; }
.weak small { font-family: var(--f-mono); color: var(--muted); }

/* 퀴즈 화면 */
.quiz { position: fixed; inset: 0; z-index: 50; background: var(--bg); overflow: auto; }
.qin { max-width: 560px; margin: 0 auto; min-height: 100%; padding: 14px 16px; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 14px; }
.qtop { display: flex; align-items: center; gap: 12px; }
.qtop .meter { flex: 1; height: 8px; }
.qtop .cnt { font-family: var(--f-mono); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.qtitle { font-size: 13px; color: var(--muted); }
.qprompt { display: grid; place-items: center; gap: 4px; padding: 22px 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.qprompt .pk { font-family: var(--f-kana); font-weight: 600; font-size: clamp(88px, 26vw, 132px); line-height: 1.1; color: var(--accent); }
.qprompt .pr { font-family: var(--f-mono); font-size: 44px; font-weight: 500; line-height: 1.2; }
.qprompt .ps { font-size: 14px; color: var(--muted); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 70px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.choice b { font-family: var(--f-mono); font-size: 22px; font-weight: 500; }
.choice small { color: var(--muted); font-size: 12px; }
.choice .kana { font-size: 38px; line-height: 1.2; }
.choice.ok { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 16%, var(--surface)); }
.choice.bad { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 16%, var(--surface)); }
.choice.dim { opacity: .55; }
.typebox { display: flex; gap: 8px; }
.typebox input { flex: 1; min-width: 0; min-height: 52px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--fg); font-family: var(--f-mono); font-size: 22px; }
.fb { padding: 12px 14px; border-radius: 12px; font-size: 14px; display: grid; gap: 4px; }
.fb.ok { background: color-mix(in srgb, var(--ok) 16%, var(--surface)); }
.fb.bad { background: color-mix(in srgb, var(--bad) 16%, var(--surface)); }
.fb strong { font-size: 15px; }
.result { display: grid; gap: 14px; text-align: center; }
.result .score { font-family: var(--f-mono); font-size: 56px; line-height: 1.1; color: var(--accent); }
.result .chips { justify-content: center; }
.qkey { font-size: 12px; color: var(--muted); text-align: center; }

/* 가나 탭 안의 4개 메뉴 */
.k-tabs { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.k-tabs button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 4px; margin-bottom: -1px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; }
.k-tabs button b { font-family: var(--f-kana); font-size: 18px; font-weight: 600; }
.k-tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
