/* 학생 화면(폰 세로 먼저) -- 로그인 · 홈 · 문제 풀기 · 결과 · 오답 노트 · 매일 연산 · 혼자 연습 · 진단 · 기록
   주인공은 학원 색(--brand) 하나. 바탕은 옅은 따뜻한 회색, 면은 흰색 + 가는 선, 그림자는 거의 없이.
   글자 13 · 15 · 17 · 20 · 24 · 32 · 44 / 여백 4 의 배수. 맞음 · 틀림 색은 app.css 의 차분한 초록 · 빨강. */
:root {
  --brand-2: color-mix(in srgb, var(--brand) 9%, #fff); --brand-3: color-mix(in srgb, var(--brand) 22%, #fff); --brand-d: color-mix(in srgb, var(--brand) 78%, #000);
  --s-bg: #f5f4f1; --s-line: #e6e4df; --s-line2: #d6d4ce; --s-soft: #f1f0ec;
  --kb-bg: #e3e4e8; --kb-key: #fff; --kb-fn: #cdd0d7; --kb-down: #c3c6ce;
  --dock-h: 300px;
}
body.s { background: var(--s-bg); font-size: 17px; -webkit-tap-highlight-color: transparent; }
body.s button { touch-action: manipulation; }
.s-wrap { max-width: 560px; margin: 0 auto; padding: 0 16px 32px; }
.tnum, .stat-n, .sc-n, .timer, .score { font-variant-numeric: tabular-nums; }

/* 윗줄 */
.s-top { position: sticky; top: 0; z-index: 6; background: var(--s-bg); }
.s-top .in { max-width: 560px; margin: 0 auto; padding: 8px 12px; display: flex; align-items: center; gap: 4px; min-height: 56px; }
.s-top .ac { font-weight: 700; color: var(--ink); font-size: 17px; display: flex; align-items: center; gap: 10px; min-width: 0; padding-left: 4px; }
.s-top .ac .dot { width: 32px; height: 32px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 800; flex: none; }
.s-top .ac span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-top .ttl { margin: 0; line-height: 1.55; font-weight: 700; font-size: 17px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -0.01em; }
.iconbtn { width: 44px; height: 44px; border-radius: 10px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink); flex: none; }
.iconbtn:active { background: rgba(20,26,38,.07); }
.sp { flex: 1; }

/* 인사 */
.hello { padding: 8px 4px 4px; }
.hello + .sec-t, .hello ~ .banner + .sec-t { margin-top: 20px; }
.hello h1 { font-size: 24px; margin: 0; letter-spacing: -0.02em; font-weight: 800; }
.hello p { margin: 4px 0 0; color: var(--ink2); font-size: 17px; }

/* 면 · 제목 */
.sc { background: #fff; border-radius: 16px; padding: 16px; margin-bottom: 12px; border: 1px solid var(--s-line); }
.panel { background: #fff; border: 1px solid var(--s-line); border-radius: 16px; overflow: hidden; margin-bottom: 12px; }
.sec-t { display: flex; align-items: baseline; gap: 8px; margin: 28px 4px 12px; line-height: 1.55; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.sec-t small { font-weight: 600; color: var(--ink3); font-size: 13px; }
.sec-t .more { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--ink3); background: none; border: 0; padding: 4px; cursor: pointer; }

/* 상태 표시(작은 네모 꼬리표) -- 알약 모양은 쓰지 않음 */
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--brand-2); color: var(--brand-d); line-height: 1.5; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: #17673f; } .pill.bad { background: var(--bad-soft); color: #a3362e; } .pill.sun { background: var(--warn-soft); color: #7a5410; } .pill.gray { background: var(--s-soft); color: var(--ink2); }

/* 숙제(할 것) */
.hw { display: block; position: relative; width: 100%; text-align: left; padding: 16px 16px 16px; }
.hw h3 { font-size: 20px; margin: 0; font-weight: 700; letter-spacing: -0.02em; line-height: 1.4; word-break: keep-all; }
.hw .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--ink2); font-size: 15px; margin: 8px 0 16px; align-items: center; }
.hw .meta .dot2::before { content: ''; display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--ink3); vertical-align: middle; margin-right: 12px; }
.hw .go { display: flex; gap: 8px; }
.hw .go .btn { flex: 1; min-height: 52px; border-radius: 12px; font-size: 17px; }
.hw.late { border-color: color-mix(in srgb, var(--bad) 35%, var(--s-line)); }
.hw .due { font-weight: 700; color: var(--ink); }
.hw.late .due { color: var(--bad); }
.hwbar { height: 4px; border-radius: 4px; background: var(--s-soft); overflow: hidden; margin: -4px 0 16px; }
.hwbar i { display: block; height: 100%; background: var(--brand); }
.score-big { font-weight: 800; font-size: 17px; }

/* 끝낸 숙제 · 기록: 한 면 안에 줄로 */
.rows > * + * { border-top: 1px solid var(--s-line); }
.row-i { display: flex; align-items: center; gap: 12px; padding: 14px 16px; width: 100%; border: 0; background: #fff; text-align: left; cursor: pointer; min-height: 60px; color: var(--ink); }
.row-i:active { background: var(--s-soft); }
.row-i .grow b { display: block; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-i .grow small { display: block; color: var(--ink3); font-size: 13px; margin-top: 2px; }
.row-i .sc-n { font-weight: 800; font-size: 17px; min-width: 52px; text-align: right; }
.row-i .sc-n.ok { color: var(--ok); } .row-i .sc-n.mid { color: var(--warn); } .row-i .sc-n.low { color: var(--bad); }
.rows .btn.more-b { width: 100%; border: 0; border-radius: 0; min-height: 48px; color: var(--ink2); font-size: 15px; background: #fff; }

/* 오늘의 생각 문제: 학원 색을 아주 옅게 깐 공책 한 칸 -- 난이도 막대 셋 · 7칸 연속 표시
   남은 숙제가 있으면(.calm) 흰 면 · 보조 단추로 한 단계 물러남(홈에서 가장 강한 것은 «오늘 할 숙제» 하나) */
.daily { background: var(--brand-2); border-color: var(--brand-3); padding: 16px 16px 16px; }
.daily.done, .daily.calm { background: #fff; border-color: var(--s-line); }
.daily.calm .dq-eye { color: var(--ink2); }
.daily.calm .dq-ticks i { background: var(--s-soft); }
.dq-top { display: flex; align-items: center; gap: 8px; }
.dq-eye { font-size: 13px; font-weight: 700; color: var(--brand-d); letter-spacing: -0.01em; }
.daily.done .dq-eye { color: var(--ink2); }
.dq-lv { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.dq-lv i { width: 5px; height: 12px; border-radius: 2px; background: color-mix(in srgb, var(--brand) 18%, #fff); }
.dq-lv i:nth-child(2) { height: 14px; } .dq-lv i:nth-child(3) { height: 16px; }
.dq-lv i.on { background: var(--brand); }
.dq-lv span { margin-left: 4px; }
.daily h3 { font-size: 17px; margin: 8px 0 0; font-weight: 700; letter-spacing: -0.01em; line-height: 1.45; word-break: keep-all; }
.dq-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 6px 0 16px; font-size: 15px; color: var(--ink2); line-height: 1.5; }
.dq-foot { display: flex; align-items: center; gap: 12px; }
.dq-foot .btn { margin-left: auto; min-height: 48px; border-radius: 12px; font-size: 17px; padding: 0 20px; flex: none; }
.dq-streak { min-width: 0; font-size: 13px; color: var(--ink2); line-height: 1.4; }
.dq-streak b { color: var(--ink); font-weight: 700; font-size: 15px; }
.dq-streak small { font-size: 13px; color: var(--ink3); }
.dq-ticks { display: flex; gap: 3px; margin-bottom: 6px; }
.dq-ticks i { width: 12px; height: 6px; border-radius: 2px; background: color-mix(in srgb, var(--brand) 16%, #fff); }
.daily.done .dq-ticks i { background: var(--s-soft); }
.dq-ticks i.on, .daily.done .dq-ticks i.on, .daily.calm .dq-ticks i.on { background: var(--brand); }
.hero.daily { padding-top: 28px; }
.dq-mark { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; }
.dq-mark.ok { background: var(--ok-soft); color: var(--ok); }
.dq-mark.bad { background: var(--brand-2); color: var(--brand-d); }
@media (max-width: 359px) { .dq-foot { flex-wrap: wrap; } .dq-foot .btn { width: 100%; } }

/* 이어서 풀기: 학원 색 한 면 */
.cont { display: flex; align-items: center; gap: 12px; background: var(--brand); color: #fff; border: 0; width: 100%; text-align: left; cursor: pointer; padding: 16px; border-radius: 16px; margin-bottom: 8px; }
.cont .grow b { display: block; font-size: 17px; font-weight: 700; } .cont .grow span { opacity: .86; font-size: 15px; display: block; margin-top: 2px; }
.cont .play { width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; flex: none; }
.cont.sub { background: #fff; color: var(--ink); border: 1px solid var(--s-line); padding: 12px 16px; }
.cont.sub .grow span { opacity: 1; color: var(--ink3); font-size: 13px; }
.cont.sub .play { background: var(--brand-2); color: var(--brand); width: 36px; height: 36px; }
/* 수업 퀴즈 들어가기: 수업 중에만 쓰는 길이라 면 없이 선 한 줄 */
.cont.sub.live-in { background: transparent; border-color: var(--s-line2); min-height: 56px; }
.cont.sub.live-in .play { background: transparent; color: var(--ink2); }
/* 남은 숙제가 있으면 «이어서 풀기» 도 흰 면으로(학원 색 채움은 숙제 단추 하나만) */
.s-wrap:has(.sc.hw) .cont:not(.sub) { background: #fff; color: var(--ink); border: 1px solid var(--brand-3); }
.s-wrap:has(.sc.hw) .cont:not(.sub) .grow span { opacity: 1; color: var(--ink2); }
.s-wrap:has(.sc.hw) .cont:not(.sub) .play { background: var(--brand-2); color: var(--brand); }
.cont:active, .hw:active, .tile:active, .badge-i:active { transform: scale(.99); }

/* 연속 학습 · 칭찬 점수: 한 면을 선으로 둘로 */
.stats { display: grid; grid-template-columns: 1.4fr 1fr; background: #fff; border: 1px solid var(--s-line); border-radius: 16px; margin-bottom: 12px; }
.stats > div { padding: 16px; min-width: 0; }
.stats > div + div { border-left: 1px solid var(--s-line); }
.stat-l { font-size: 13px; color: var(--ink2); font-weight: 600; }
.stat-n { font-size: 32px; font-weight: 800; line-height: 1.15; letter-spacing: -0.03em; margin-top: 2px; }
.stat-n small { font-size: 15px; font-weight: 600; color: var(--ink2); margin-left: 2px; letter-spacing: 0; }
.stat-m { font-size: 13px; color: var(--ink2); margin-top: 4px; line-height: 1.45; }
.stat-m b { color: var(--brand-d); font-weight: 700; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 12px; max-width: 220px; }
.cal .wd { font-size: 11px; color: var(--ink3); text-align: center; font-weight: 600; line-height: 1; padding-bottom: 2px; }
.cal i { aspect-ratio: 1; border-radius: 4px; background: var(--s-soft); display: block; }
.cal i.on { background: var(--brand); }
.cal i.today { box-shadow: inset 0 0 0 2px var(--brand); background: #fff; }
.cal i.on.today { background: var(--brand); box-shadow: inset 0 0 0 2px var(--brand-d); }
.cal i.fut { background: transparent; box-shadow: inset 0 0 0 1px var(--s-line); }
.ptsrule { font-size: 13px; color: var(--ink3); margin-top: 8px; line-height: 1.5; }

/* 배지 */
.bdg { flex: none; display: block; }
.bdg .rim { fill: var(--brand-2); stroke: var(--brand); }
.bdg .gl { stroke: var(--brand-d); fill: none; }
.bdg .gt { fill: var(--brand-d); }
.bdg.off .rim { fill: #fff; stroke: var(--s-line2); stroke-dasharray: 3 3; }
.bdg.off .gl { stroke: #b9b8b2; } .bdg.off .gt { fill: #b9b8b2; }
.badges { display: flex; gap: 4px; overflow-x: auto; padding: 12px 8px 4px; scrollbar-width: none; scroll-snap-type: x proximity; }
.badges::-webkit-scrollbar { display: none; }
.badge-i { flex: none; width: 72px; border: 0; background: none; padding: 4px 0; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; scroll-snap-align: start; border-radius: 12px; }
.badge-i span { font-size: 12px; font-weight: 600; color: var(--ink2); text-align: center; line-height: 1.3; word-break: keep-all; }
.badge-i.off span { color: var(--ink3); font-weight: 500; }
.nextgoal { display: flex; align-items: center; gap: 12px; padding: 12px 16px 16px; border-top: 1px solid var(--s-line); margin-top: 8px; }
.nextgoal .grow b { font-size: 15px; font-weight: 700; } .nextgoal .grow small { color: var(--ink3); font-size: 13px; margin-left: 6px; }
.pbar { height: 6px; border-radius: 6px; background: var(--s-soft); overflow: hidden; margin-top: 8px; }
.pbar i { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.nextgoal .n { font-size: 13px; color: var(--ink2); font-weight: 700; white-space: nowrap; }
.newbadge { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px; background: #fff; border: 1px solid var(--brand-3); margin-bottom: 12px; animation: nb .5s cubic-bezier(.2,.9,.3,1.2) both; animation-delay: .5s; }
.newbadge .grow b { display: block; font-size: 15px; } .newbadge .grow span { font-size: 13px; color: var(--ink2); }
.newbadge .lab { font-size: 12px; font-weight: 700; color: var(--brand-d); }
@keyframes nb { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.bsheet { text-align: center; padding-top: 8px; }
.bsheet .bdg { margin: 0 auto 12px; }
.bsheet .when { color: var(--ink3); font-size: 13px; margin-top: 8px; }

/* 반 순위 */
.rank .seg { display: flex; gap: 4px; padding: 4px; margin: 12px 16px 4px; background: var(--s-soft); border-radius: 10px; }
.rank .seg button { flex: 1; min-height: 40px; border: 0; border-radius: 8px; background: transparent; font-size: 15px; font-weight: 600; color: var(--ink2); cursor: pointer; }
.rank .seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(20,26,38,.08); }
.rank ol { list-style: none; margin: 0; padding: 4px 0 8px; }
.rank li { display: flex; align-items: center; gap: 12px; padding: 8px 16px; font-size: 15px; }
.rank li .r { width: 24px; font-weight: 800; color: var(--ink3); text-align: center; font-variant-numeric: tabular-nums; }
.rank li .v { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.rank li.me { background: var(--brand-2); font-weight: 700; }
.rank li.me .r { color: var(--brand-d); }
.rank .cap { padding: 12px 16px 0; font-size: 13px; color: var(--ink3); }

/* 더 공부하기: 줄 목록(아이콘은 한 벌 · 학원 색) */
.tiles { background: #fff; border: 1px solid var(--s-line); border-radius: 16px; overflow: hidden; }
.tile { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: #fff; text-align: left; cursor: pointer; padding: 12px 16px; min-height: 64px; color: var(--ink); }
.tile + .tile { border-top: 1px solid var(--s-line); }
.tile:active { background: var(--s-soft); transform: none; }
.tile .ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--s-soft); color: var(--ink2); }   /* 일곱 줄이 모두 학원 색이면 시끄러움 -- 아이콘은 중립, 색은 꼬리표(오늘 할 것 · 남은 수)에만 */
.tile .ic svg { width: 22px; height: 22px; }
.tile .grow b { display: block; font-size: 16px; font-weight: 600; }
.tile .grow span { display: block; font-size: 13px; color: var(--ink3); margin-top: 1px; }
.tile .flag { flex: none; }
.foot { display: flex; justify-content: center; gap: 4px; margin-top: 32px; }
.foot .btn { min-height: 44px; font-size: 15px; color: var(--ink2); }
.who { text-align: center; color: var(--ink3); font-size: 13px; margin: 4px 0 0; }
.made { text-align: center; margin: 16px 0 0; font-size: 12px; color: var(--ink3); letter-spacing: -0.01em; }
.made b { font-weight: 700; color: var(--ink2); }

/* 칩 고르기: 네모난 고르기 단추 */
.pick { margin: 8px 0 20px; }
.pick > .lbl { font-size: 13px; font-weight: 700; color: var(--ink2); margin: 0 4px 8px; display: flex; align-items: center; gap: 8px; }
.pick > .lbl .btn { margin-left: auto; min-height: 32px; padding: 0 8px; font-size: 13px; }
.pick .chips { gap: 8px; }
.pick .chip { min-height: 44px; padding: 8px 16px; font-size: 16px; border-radius: 10px; background: #fff; border: 1px solid var(--s-line2); font-weight: 500; }
.pick .chip:active { background: var(--s-soft); }
.pick .chip.on { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.ulist { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--s-line); border-radius: 16px; overflow: hidden; }
.uitem { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #fff; border: 0; cursor: pointer; text-align: left; width: 100%; min-height: 60px; color: var(--ink); position: relative; }
.uitem + .uitem { border-top: 1px solid var(--s-line); }
.uitem:active { background: var(--s-soft); }
.uitem.on { background: var(--brand-2); }
.uitem.on::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); }
.uitem .no { width: 32px; height: 32px; border-radius: 8px; background: var(--s-soft); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--ink2); flex: none; font-variant-numeric: tabular-nums; }
.uitem.on .no { background: var(--brand); color: #fff; }
.uitem .grow b { display: block; font-size: 16px; font-weight: 600; } .uitem .grow small { color: var(--ink3); font-size: 13px; }
.startbar { position: sticky; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(color-mix(in srgb, var(--s-bg) 0%, transparent), var(--s-bg) 28%); }
.startbar .btn { min-height: 56px; border-radius: 14px; font-size: 17px; }
.intro-b { display: flex; gap: 12px; align-items: flex-start; padding: 4px 4px 20px; }
.intro-b .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--brand-2); color: var(--brand); }
.intro-b b { display: block; font-size: 20px; letter-spacing: -0.02em; }
.intro-b p { margin: 4px 0 0; color: var(--ink2); font-size: 15px; line-height: 1.55; }

/* ── 문제 풀기 ───────────────────────────────────────────────── */
body.solving { background: #fff; }
body.solving .s-top { background: #fff; }
.sv-head .in { gap: 4px; }
.sv-head .btn { white-space: nowrap; }
.sv-head .btn.ghost { color: var(--brand); font-weight: 700; }
.timer { font-weight: 700; color: var(--ink3); font-size: 15px; padding: 4px 8px; min-width: 52px; text-align: center; }
.timer.big { font-size: 17px; color: var(--ink); background: var(--s-soft); border-radius: 8px; }
.prog { max-width: 560px; margin: 0 auto; padding: 0 16px 4px; }
.bar { height: 3px; border-radius: 3px; background: var(--s-soft); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); transition: width .25s; }
.dots { display: flex; gap: 6px; overflow-x: auto; padding: 12px 0 4px; scrollbar-width: none; }
.dots::-webkit-scrollbar { display: none; }
.dots button { flex: none; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--s-line2); background: #fff; font-weight: 700; font-size: 15px; color: var(--ink2); cursor: pointer; padding: 0; font-variant-numeric: tabular-nums; position: relative; }
.dots button.ans { background: var(--brand-2); border-color: transparent; color: var(--brand-d); }
.dots button.cur { border: 2px solid var(--ink); color: var(--ink); }
.dots button.ans.cur { border-color: var(--brand); }
.dots button.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.dots button.bad { background: #fff; border: 2px solid var(--bad); color: var(--bad); }
.dots button.bad.cur { background: var(--bad); color: #fff; }
.sv-body { max-width: 560px; margin: 0 auto; padding: 8px 20px calc(var(--dock-h) + 24px); }
.qcard { padding: 4px 0; }
.qno { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.qno b { font-size: 20px; font-weight: 800; color: var(--brand); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.qno .of { font-size: 13px; color: var(--ink3); font-weight: 600; }
.qno .mark { align-self: center; }
.qno .tag { font-size: 13px; color: var(--ink3); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-left: auto; }
.qtext { font-size: 20px; line-height: 1.75; word-break: keep-all; overflow-wrap: anywhere; color: var(--ink); letter-spacing: -0.005em; }
.qtext .big { font-size: 1.1em; margin: 12px 0 0; }
.qtext .fig { margin: 16px 0 4px; display: flex; justify-content: center; }
.qtext .fig svg { max-width: 100%; height: auto; }
.qcard .qtext .fig svg { min-width: min(100%, 300px); }
.qtext.hide-ch .ch { display: none; }
.qtext .ch { margin-top: 8px; }
.ansbox { margin-top: 24px; }
.ansbox .lab { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink2); margin-bottom: 8px; }
.ansbox .hint { font-size: 13px; color: var(--ink3); margin-top: 8px; line-height: 1.5; }
.mark { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-weight: 800; font-size: 13px; flex: none; }
.mark.ok { background: var(--ok-soft); color: var(--ok); box-shadow: inset 0 0 0 1.5px var(--ok); } .mark.bad { background: var(--bad-soft); color: var(--bad); box-shadow: inset 0 0 0 1.5px var(--bad); }
.retry-note { background: var(--bad-soft); color: #8f2c24; border-radius: 12px; padding: 12px 16px; font-size: 15px; margin: 0 0 16px; font-weight: 500; line-height: 1.5; }
.retry-note.okk { background: var(--ok-soft); color: #145c3a; }
.retry-note .btn { color: inherit; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; font-size: 15px; }
.kbtoggle { border: 0; background: none; color: var(--ink2); font-weight: 600; font-size: 13px; padding: 12px 0; cursor: pointer; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--s-line2); }

/* 아래 고정: 이동 단추 + 키패드(기기 키보드처럼) */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; background: var(--kb-bg); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.dock .in { max-width: 560px; margin: 0 auto; }
.navrow { display: flex; gap: 6px; margin-bottom: 8px; padding: 0 2px; }
.navrow .btn { min-height: 48px; border-radius: 10px; font-size: 17px; font-weight: 700; }
.navrow .prev { flex: 0 0 64px; background: var(--kb-key); border: 0; box-shadow: 0 1px 0 rgba(20,26,38,.22); color: var(--ink); }
.navrow .prev:disabled { opacity: .45; }
.navrow .next { flex: 1; box-shadow: 0 1px 0 rgba(20,26,38,.22); border: 0; }
.navrow .btn.submit { background: var(--ink); color: #fff; }
.kp { display: flex; flex-direction: column; gap: 8px; padding: 0 2px; }
.kp-row { display: grid; gap: 6px; }
.kp-k { min-height: 46px; border: 0; border-radius: 8px; background: var(--kb-fn); font-size: 19px; font-weight: 500; box-shadow: 0 1px 0 rgba(20,26,38,.22); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; color: var(--ink); padding: 0 2px; user-select: none; -webkit-user-select: none; transition: transform .06s ease-out, background-color .06s; }
.kp-k.d { background: var(--kb-key); font-size: 24px; font-weight: 400; }
.kp-k small { font-size: 11px; font-weight: 600; color: var(--ink2); margin-top: 3px; letter-spacing: -0.01em; }
.kp-k.op { background: var(--kb-key); color: var(--brand-d); font-weight: 700; }
.kp-k.bs { background: var(--kb-fn); }
.kp-k.down { background: var(--kb-down); transform: translateY(1px) scale(.97); box-shadow: none; }
.kp-k.d.down, .kp-k.op.down { background: var(--kb-fn); }
.kp-k .k-var { font-family: 'Times New Roman', serif; font-style: italic; font-size: 1.15em; }
.kp-k sup { font-size: .6em; }
.k-frac { display: inline-flex; flex-direction: column; align-items: center; font-size: .62em; line-height: 1; }
.k-frac span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 2px 1px; }
.k-frac span:last-child { padding-top: 1px; }
.k-mixed { display: inline-flex; align-items: center; gap: 1px; font-size: .9em; }
.dock.folded .kp { display: none; }
.foldbtn { display: block; margin: -2px auto 4px; width: 64px; height: 16px; border: 0; background: none; cursor: pointer; padding: 0; }
.foldbtn::before { content: ''; display: block; margin: 0 auto; width: 36px; height: 4px; border-radius: 4px; background: rgba(20,26,38,.22); }

/* 답 칸 */
.mi-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 64px; padding: 8px 12px; border-radius: 14px; border: 1.5px solid var(--s-line2); background: #fff; font-size: 24px; cursor: text; transition: border-color .12s, box-shadow .12s; }
.mi-line.active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-2); }
.mi-line.locked { border-color: color-mix(in srgb, var(--ok) 45%, #fff); background: var(--ok-soft); }
.mi-num { display: inline-flex; align-items: center; gap: 4px; }
.mi-sign { font-weight: 700; font-size: 1.05em; }
.mi-box { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; padding: 0 8px; border-radius: 8px; border: 1.5px dashed #c9c8c2; font-variant-numeric: tabular-nums; font-weight: 600; position: relative; letter-spacing: .02em; }
.mi-box:not(.ph) { border-style: solid; border-color: transparent; background: var(--s-soft); }
.mi-box.on { border: 1.5px solid var(--brand); background: #fff; }
.mi-frac { display: inline-flex; flex-direction: column; align-items: stretch; gap: 3px; margin: 0 2px; }
.mi-frac .mi-box { min-height: 34px; min-width: 40px; font-size: .9em; }
.mi-bar { height: 2px; background: var(--ink); border-radius: 2px; }
.mi-lab { font-weight: 700; font-size: .7em; color: var(--ink2); margin: 0 6px 0 2px; }
.mi-paren { font-size: 1.4em; font-weight: 300; color: var(--ink2); }
.mi-comma { font-weight: 800; margin: 0 2px; }
.mi-x { font-family: 'Times New Roman', serif; font-style: italic; font-size: 1.15em; margin-right: 4px; }
.mi-ineq { display: inline-flex; gap: 4px; margin-right: 6px; }
.mi-opbtn { min-width: 44px; min-height: 44px; border-radius: 8px; border: 1.5px solid var(--s-line2); background: #fff; font-size: .8em; font-weight: 700; cursor: pointer; color: var(--ink2); }
.mi-opbtn.on { border-color: var(--brand); background: var(--brand); color: #fff; }
.mi-text { min-height: 40px; display: inline-flex; align-items: center; flex-wrap: wrap; min-width: 60px; font-size: 1em; }
.mi-text.ph:not(.on)::before { content: '답'; color: #707480; }
.mi-op { margin: 0 .18em; } .mi-op.sl { margin: 0 .05em; }
.mi-ph { color: #707480; }
.mi-text .rt { border-top: 1.5px solid currentColor; }
.mi-caret { display: inline-block; width: 2px; height: 1.1em; background: var(--brand); margin-left: 2px; border-radius: 2px; animation: blink 1s steps(2, start) infinite; vertical-align: middle; }
@keyframes blink { to { visibility: hidden; } }
.mi-native { width: 100%; min-height: 60px; padding: 10px 14px; font-size: 22px; border-radius: 14px; border: 1.5px solid var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-2); }
.mi-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; }
.mi-choices.long { grid-template-columns: 1fr; }
.mi-choices.many:not(.long) { grid-template-columns: repeat(3, 1fr); }
.mi-choices.many.long { grid-template-columns: 1fr 1fr; }
.mi-opt { min-height: 56px; border-radius: 12px; border: 1.5px solid var(--s-line2); background: #fff; font-size: 20px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 10px 16px; text-align: left; color: var(--ink); justify-content: center; transition: transform .06s, background-color .1s; }
.mi-opt:not(:disabled):active { transform: scale(.98); background: var(--s-soft); }
.mi-choices.long .mi-opt { justify-content: flex-start; font-size: 17px; }
.mi-choices.many.long .mi-opt { font-size: 15px; padding: 8px 12px; min-height: 52px; }
.mi-opt .mi-optk { font-size: 1.1em; flex: none; }
.mi-opt .mi-optt { font-weight: 500; line-height: 1.5; }
.mi-opt.on { border-color: var(--brand); background: var(--brand-2); color: var(--brand-d); box-shadow: inset 0 0 0 1px var(--brand); }
.mi-opt:disabled { opacity: 1; cursor: default; }
.mi-opt:disabled:not(.on) { opacity: .5; }

/* 종이 숙제: 번호마다 한 줄 */
.plist { display: flex; flex-direction: column; gap: 8px; }
.prow { border-radius: 14px; background: #fff; border: 1.5px solid var(--s-line); padding: 12px; }
.prow.cur { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-2); }
.prow .ph { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.prow .ph b { font-size: 17px; font-weight: 800; color: var(--brand); min-width: 32px; font-variant-numeric: tabular-nums; }
.prow .ph .btn { min-height: 36px; padding: 0 10px; font-size: 13px; border-radius: 8px; margin-left: auto; }
.prow .mi-line { min-height: 54px; font-size: 20px; }
.prow .qtext { font-size: 17px; margin: 4px 0 12px; padding: 12px; background: var(--s-soft); border-radius: 10px; }
.prow .mi-choices { grid-template-columns: repeat(auto-fit, minmax(56px, 1fr)); }
.prow .mi-opt { min-height: 48px; }

/* 아래에서 올라오는 창 */
.sheet-bg { position: fixed; inset: 0; background: rgba(20,26,38,.42); z-index: 30; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { background: #fff; width: 100%; max-width: 560px; border-radius: 20px 20px 0 0; padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); animation: up .22s cubic-bezier(.2,.8,.3,1); max-height: 88vh; display: flex; flex-direction: column; }
.sheet::before { content: ''; display: block; width: 36px; height: 4px; border-radius: 4px; background: var(--s-line2); margin: 0 auto 16px; flex: none; }
.sheet h3 { font-size: 20px; margin-bottom: 8px; } .sheet p { color: var(--ink2); margin: 0 0 20px; font-size: 16px; }
.sheet .btns { display: flex; flex-direction: column; gap: 8px; flex: none; }
.sheet .btns .btn { min-height: 52px; border-radius: 12px; font-size: 17px; }
.sheet .btns .btn:not(.primary) { border-color: transparent; background: var(--s-soft); }
@keyframes fade { from { opacity: 0; } } @keyframes up { from { transform: translateY(32px); opacity: .6; } }

/* 개념 보기(시트 안) */
.cpt { overflow-y: auto; margin: 0 -20px; padding: 0 20px 8px; -webkit-overflow-scrolling: touch; }
.cpt .eyebrow { font-size: 13px; font-weight: 700; color: var(--brand-d); margin: 0 0 2px; }
.cpt h3 { margin-bottom: 16px; }
.cpt h4 { font-size: 13px; font-weight: 700; color: var(--ink2); margin: 20px 0 8px; letter-spacing: 0; }
.cpt ul { margin: 0; padding: 0; list-style: none; }
.cpt li { position: relative; padding: 0 0 0 16px; margin: 0 0 8px; font-size: 16px; line-height: 1.7; }
.cpt li::before { content: ''; position: absolute; left: 2px; top: .75em; width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }
.cpt .fm { background: var(--brand-2); border-radius: 12px; padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; font-size: 17px; line-height: 1.7; }
.cpt .ex { border: 1px solid var(--s-line); border-radius: 12px; padding: 12px 16px; font-size: 16px; line-height: 1.75; }
.cpt .ex ol { margin: 8px 0 0; padding-left: 20px; color: var(--ink2); }
.cpt .ex ol li { padding: 0; margin: 0 0 4px; } .cpt .ex ol li::before { display: none; }
.cpt .ex .a { margin-top: 8px; font-weight: 700; }
.cpt .mis li::before { background: var(--bad); }
.cpt-b { border: 0; background: none; color: var(--brand); font-weight: 600; font-size: 15px; padding: 8px 0; cursor: pointer; min-height: 40px; display: inline-flex; align-items: center; gap: 6px; }
.cpt-b svg { width: 18px; height: 18px; }

/* ── 결과 ───────────────────────────────────────────────────── */
.hero { text-align: center; padding: 24px 16px 20px; background: #fff; border: 1px solid var(--s-line); border-radius: 20px; margin: 4px 0 12px; position: relative; }
.ring { width: 148px; height: 148px; margin: 0 auto 12px; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .trk { stroke: var(--s-soft); } .ring .val { stroke: var(--brand); }
.hero.perfect .ring .val { stroke: var(--ok); }
.ring .num { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 44px; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.ring .num small { display: block; font-size: 13px; font-weight: 600; color: var(--ink3); margin-top: 6px; text-align: center; letter-spacing: 0; }
.hero h2 { font-size: 24px; margin: 4px 0 2px; font-weight: 800; }
.hero p { margin: 0; color: var(--ink2); font-size: 15px; }
.hero .chips2 { display: flex; justify-content: center; gap: 4px 16px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--s-line); flex-wrap: wrap; font-size: 15px; color: var(--ink2); }
.hero .chips2 b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.hero .chips2 .plus b { color: var(--brand-d); }
.hero.perfect .ring { animation: pop .5s cubic-bezier(.2,.9,.3,1.3) .9s both; }
@keyframes pop { 50% { transform: scale(1.04); } }
.notebox { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--s-line); border-radius: 16px; padding: 12px 12px 12px 16px; margin-bottom: 12px; color: var(--ink2); font-size: 15px; }
.notebox > span:first-child { color: var(--bad); display: grid; } .notebox > span:first-child svg { width: 22px; height: 22px; }
.notebox .btn { margin-left: auto; min-height: 40px; flex: none; font-size: 15px; }
.items { background: #fff; border: 1px solid var(--s-line); border-radius: 16px; overflow: hidden; }
.item { padding: 16px; }
.item + .item { border-top: 1px solid var(--s-line); }
.item .ih { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.item .ih b { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.item .ih .tiny { font-size: 13px; }
.item .qtext { font-size: 17px; }
.ansgrid { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; align-items: baseline; margin-top: 12px; padding: 12px 16px; background: var(--s-soft); border-radius: 12px; font-size: 17px; }
.ansgrid dt { font-size: 13px; font-weight: 700; color: var(--ink2); }
.ansgrid dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.ansgrid dd.wrong { color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.ansgrid dd.right { color: var(--ok); }
.item .acts { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: center; margin-top: 4px; }
details.sol { margin-top: 4px; }
details.sol summary { cursor: pointer; font-weight: 600; color: var(--brand); font-size: 15px; padding: 8px 0; list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
details.sol summary::-webkit-details-marker { display: none; }
details.sol summary::after { content: ''; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
details.sol[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
details.sol .mq { line-height: 1.8; padding: 8px 0 4px; border-top: 1px dashed var(--s-line2); margin-top: 4px; font-size: 16px; }
.item .acts details.sol[open] { flex-basis: 100%; }
.item .acts .cpt-b { margin-left: auto; }
.item .acts details.sol[open] + .cpt-b { margin-left: 0; }
.tbl-u { width: 100%; border-collapse: collapse; }
.tbl-u td { padding: 10px 4px; border-bottom: 1px solid var(--s-line); font-size: 15px; }
.tbl-u tr:last-child td { border-bottom: 0; }
.tbl-u td:last-child { text-align: right; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mini { display: inline-block; width: 64px; height: 6px; background: var(--s-soft); border-radius: 6px; vertical-align: middle; margin-right: 8px; overflow: hidden; }
.mini i { display: block; height: 100%; background: var(--ok); }
.mini.mid i { background: #c8962e; } .mini.low i { background: var(--bad); }
.btnrow { display: flex; gap: 8px; margin: 20px 0 8px; }
.btnrow .btn { flex: 1; min-height: 52px; border-radius: 12px; font-size: 17px; }
.res-tabs { display: flex; gap: 4px; margin: 24px 0 12px; padding: 4px; background: var(--s-soft); border-radius: 10px; }
.res-tabs .chip { flex: 1; border: 0; background: transparent; border-radius: 8px; min-height: 40px; font-size: 15px; font-weight: 600; color: var(--ink2); }
.res-tabs .chip.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(20,26,38,.08); }
.cmp-n { font-size: 20px; font-weight: 800; margin: 4px 0 4px; letter-spacing: -0.02em; }

/* 오답 노트 */
.nsum { display: flex; background: #fff; border: 1px solid var(--s-line); border-radius: 16px; margin: 4px 0 8px; }
.nsum > div { flex: 1; padding: 12px 16px; }
.nsum > div + div { border-left: 1px solid var(--s-line); }
.nsum .stat-n { font-size: 24px; }
.note .nh { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; color: var(--ink3); font-weight: 600; }
.streak { display: inline-flex; gap: 4px; align-items: center; }
.streak i { width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1.5px var(--s-line2); display: block; }
.streak i.on { background: var(--ok); box-shadow: none; }
.note .qtext { font-size: 17px; }
.note .nbtns { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
/* 같은 단추가 카드마다 되풀이되므로 채움 대신 학원 색 글자 + 선(목록이 파랗게 줄무늬 지지 않게) */
.note .nbtns .btn.retry-go { flex: 1; min-height: 48px; border-radius: 12px; color: var(--brand-d); border-color: var(--brand-3); }
.note .nbtns .btn.retry-go:active { background: var(--brand-2); }
/* 한 문제뿐인 학습지(오늘의 생각 문제 · 오답 노트 비슷한 문제): 번호 단추 한 개 · «/ 1» 은 숨김 */
.dots:has(> button:only-child) { display: none; }
body.solving:has(.dots > button:only-child) .qno .of { display: none; }
.grad { text-align: center; padding: 20px 16px; }
.grad .bdg { margin: 0 auto 8px; }

/* 기록 */
.day-t { font-size: 13px; font-weight: 700; color: var(--ink3); margin: 20px 4px 8px; }
.hist .mini { flex: none; }

/* 로그인 */
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; max-width: 440px; margin: 0 auto; padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); }
.login .logo { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 20px; color: var(--ink); margin: 8px 0 32px; letter-spacing: -0.02em; min-height: 40px; }
.login .logo .mk { width: 40px; height: 40px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 17px; font-weight: 800; flex: none; }
.login h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -0.02em; font-weight: 800; }
.login .sub { color: var(--ink2); margin: 0 0 24px; font-size: 16px; }
.lf { display: block; margin-bottom: 16px; }
.lf > span { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 700; color: var(--ink2); margin: 0 4px 6px; }
.lf > span .tiny { font-weight: 500; }
.lf input { width: 100%; min-height: 56px; border-radius: 12px; border: 1.5px solid var(--s-line2); background: #fff; font-size: 20px; padding: 0 16px; font-weight: 600; letter-spacing: .02em; transition: border-color .12s, box-shadow .12s; }
.lf input::placeholder { color: #707480; font-weight: 400; }
.lf input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-2); }
.lf .acfix { display: flex; align-items: center; gap: 8px; min-height: 56px; border-radius: 12px; background: #fff; border: 1.5px solid var(--s-line); padding: 0 4px 0 16px; font-weight: 700; font-size: 17px; color: var(--ink); }
.lf .acfix .btn { margin-left: auto; min-height: 44px; font-size: 15px; }
.pinrow { display: flex; gap: 16px; justify-content: center; margin: 16px 0 8px; }
.pinrow i { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--s-line2); display: block; transition: background-color .1s, transform .1s; }
.pinrow i.on { box-shadow: inset 0 0 0 2px var(--brand); }
.pinrow i.fill { background: var(--brand); box-shadow: none; transform: scale(1.05); }
.pinrow.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: auto -20px calc(-16px - env(safe-area-inset-bottom)); padding: 8px 8px calc(16px + env(safe-area-inset-bottom)); background: var(--kb-bg); border-radius: 16px 16px 0 0; }
.pinpad button { min-height: 56px; border: 0; border-radius: 8px; background: var(--kb-key); font-size: 24px; font-weight: 400; box-shadow: 0 1px 0 rgba(20,26,38,.22); cursor: pointer; color: var(--ink); transition: transform .06s, background-color .06s; font-variant-numeric: tabular-nums; }
.pinpad button:active { background: var(--kb-fn); transform: translateY(1px) scale(.97); box-shadow: none; }
.pinpad button.fn { background: transparent; box-shadow: none; font-size: 15px; color: var(--ink2); font-weight: 600; }
.pinpad button.fn:active { background: rgba(20,26,38,.08); }
.err { color: var(--bad); font-weight: 600; font-size: 15px; text-align: center; min-height: 1.5em; margin: 8px 0; }
.lstep { display: flex; flex-direction: column; flex: 1; }
.login .made { margin-top: 16px; }

/* 다 맞았을 때: 점수 둘레에서 짧게 한 번 퍼지는 조각(1초 안) */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.confetti i { position: absolute; width: 6px; height: 10px; border-radius: 2px; opacity: 0; animation: burst .9s cubic-bezier(.15,.7,.3,1) forwards; }
@keyframes burst { 0% { opacity: 1; transform: translate(0,0) rotate(0); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--r)); } }
@media (prefers-reduced-motion: reduce) { .confetti i, .newbadge, .hero.perfect .ring { animation: none; } .confetti { display: none; } .mi-caret { animation: none; }
  .pinrow.shake, .sheet, .sheet-bg { animation: none; } .ring .val { transition: none !important; } }

/* 불러오는 동안: 자리 모양 */
.loading { max-width: 560px; margin: 0 auto; padding: 72px 16px 0; display: flex; flex-direction: column; gap: 12px; }
.loading .skel.h { height: 28px; width: 55%; }
.loading .skel.b { height: 96px; border-radius: 16px; }
.loading .skel.s { height: 56px; border-radius: 16px; }
.emptybox { text-align: left; padding: 20px 16px; color: var(--ink2); font-size: 15px; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.emptybox b { display: block; color: var(--ink); font-size: 16px; font-weight: 600; }
.emptybox .btn { margin-top: 12px; }
@media (min-width: 700px) { .s-wrap { padding-top: 8px; } }

body.solving #toasts { bottom: calc(var(--dock-h) + 14px) !important; }
#toasts .toast { text-align: center; }

/* 그림으로 답하기(위젯) -- 좌표평면 · 수직선 · 시계 · 색칠 · 각도기 */
.mi-hasw .mi-wline { display: none; }                 /* 글자 칸은 숨김(그림이 답 칸) */
.ansbox.wbox { margin-top: 16px; }
.mi-w { user-select: none; -webkit-user-select: none; }
.mi-w .w-fig { background: #fff; border: 1.5px solid var(--s-line2); border-radius: 14px; padding: 6px; display: flex; justify-content: center; }
.mi-w.locked .w-fig { border-color: color-mix(in srgb, var(--ok) 45%, #fff); background: var(--ok-soft); }
.mi-w svg.w-live { width: 100%; height: auto; max-height: 52vh; touch-action: none; cursor: pointer; display: block; }
.mi-w-numline svg.w-live, .mi-w-fracbar svg.w-live { max-height: none; }
.mi-w-clock svg.w-live, .mi-w-fraccircle svg.w-live { max-width: 330px; }
.w-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.w-grp { display: inline-flex; gap: 6px; }
.w-grp.end { margin-left: auto; }
.w-btn { min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--s-line2); background: #fff; font-size: 15px; font-weight: 600; color: var(--ink2); cursor: pointer; }
.w-btn.on { border-color: var(--brand); background: var(--brand); color: #fff; }
.w-btn:disabled { opacity: .4; cursor: default; }
.w-btn:not(:disabled):active { transform: translateY(1px); background: var(--brand-2); }
/* 그림 위의 표시: mine(학원 색) · right(초록) · wrong(빨강) */
.w-m { --wc: var(--brand); }
.w-m.right { --wc: var(--ok); } .w-m.wrong { --wc: var(--bad); }
.w-m .w-dot { fill: var(--wc); stroke: #fff; stroke-width: 1.4; }
.w-m .w-halo { fill: var(--wc); opacity: .16; }
.w-m .w-guide { stroke: var(--wc); stroke-width: 1; stroke-dasharray: 3 2.5; opacity: .75; }
.w-m .w-fill { fill: var(--wc); opacity: .55; }
.w-m .w-hand { stroke: var(--wc); stroke-linecap: round; }
.w-m .w-hand.h { stroke-width: 7; } .w-m .w-hand.m { stroke-width: 4; }
.w-m .w-knob { fill: #fff; stroke: var(--wc); stroke-width: 2.5; }
.w-m.ghost { opacity: .32; }
.w-m .w-ray { stroke: var(--wc); stroke-width: 2.6; stroke-linecap: round; }
.w-m .w-arc { fill: none; stroke: var(--wc); stroke-width: 2; }
.w-m .w-lab { fill: var(--wc); font-size: 12px; font-weight: 800; }
/* 결과 화면: 내 답 · 정답을 그림에 */
.w-res .w-res1 svg { width: 100%; height: auto; max-height: 300px; display: block; }
.w-res2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.w-cap { text-align: center; font-size: 13px; font-weight: 700; color: var(--ink2); margin-top: 2px; }
.w-legend { display: flex; gap: 14px; font-size: 13px; font-weight: 700; margin-top: 4px; }
.w-legend .right { color: var(--ok); } .w-legend .wrong { color: var(--bad); }
.wkp { margin-top: 24px; padding-top: 16px; border-top: 1px dashed var(--s-line2); }
.wkp .lab { font-size: 13px; font-weight: 700; color: var(--ink3); margin-bottom: 8px; }
.wkp .kp { background: var(--kb-bg); padding: 6px; border-radius: 12px; }
.dock.wmode .foldbtn { display: none; }
.dock.wmode .navrow { margin-bottom: 0; }
.ring .num small.pre { margin: 0 0 6px; }
.items { margin-top: 24px; }
.res-tabs:not(.hide) + .items { margin-top: 0; }

/* 혼자 연습: 한 단원 · 여러 단원 섞기(시험 대비) */
.mode-seg { display: flex; gap: 4px; padding: 4px; margin: 4px 0 20px; background: #e9e8e3; border-radius: 12px; }
.mode-seg button { flex: 1; min-height: 44px; border: 0; border-radius: 9px; background: transparent; font-size: 16px; font-weight: 600; color: var(--ink2); cursor: pointer; }
.mode-seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(20,26,38,.1); }
.mode-seg button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.pick > .lbl .cnt { margin-left: auto; color: var(--ink3); font-weight: 600; }
.uitem.multi .ck { width: 22px; height: 22px; border-radius: 6px; border: 1.75px solid var(--s-line2); flex: none; position: relative; background: #fff; }
.uitem.multi.on .ck { background: var(--brand); border-color: var(--brand); }
.uitem.multi.on .ck::after { content: ''; position: absolute; left: 6.5px; top: 2.5px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2.25px 2.25px 0; transform: rotate(45deg); }
.uitem:disabled { color: var(--ink3); cursor: default; }
.uitem:disabled .no { opacity: .5; }
/* 진단 결과: 약한 단원 바로 연습 */
.diag-u td.go-u { width: 1%; padding-left: 8px; text-align: right; }
.diag-u .sm-u { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
.weakgo { width: 100%; margin-top: 16px; min-height: 60px; border-radius: 12px; display: flex; align-items: center; gap: 12px; text-align: left; padding: 8px 16px; }
.weakgo .grow { display: flex; flex-direction: column; min-width: 0; }
.weakgo small { font-size: 13px; font-weight: 600; opacity: .85; }
.weakgo b { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diag-u td:nth-child(2) { text-align: right; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* 글자를 크게 키운 폰(200% ≈ 너비 300px 아래): 옆으로 나란한 것을 아래로 내려 글자가 한 줄에 한두 자로 쪼개지지 않게(AUDIT.md) */
@media (max-width: 299px) {
  .stats { grid-template-columns: 1fr; }
  .stats > div + div { border-left: 0; border-top: 1px solid var(--s-line); }
  .tile { flex-wrap: wrap; }
  .tile .grow { flex: 1 1 calc(100% - 52px); min-width: 0; }
  .tile .flag { margin-left: 52px; }
  .notebox { flex-wrap: wrap; }
  .notebox > span:nth-child(2) { flex: 1 1 calc(100% - 34px); }
  .notebox .btn { margin-left: 34px; }
}

/* 읽어 주기(speak.mjs) -- 초1 · 초2 는 큰 단추, 그 밖은 작은 그림 단추. 읽는 동안 문제 글에 옅은 학원 색 바탕 */
.spk, .spk-set { border: 0; background: transparent; color: var(--ink2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; flex: none; -webkit-tap-highlight-color: transparent; }
.spk[hidden], .spk-set[hidden] { display: none; }
.spk.icon, .spk-set { width: 44px; height: 44px; border-radius: 10px; }
.spk-set { color: var(--ink3); }
.spk.icon:active, .spk-set:active { background: rgba(20,26,38,.07); }
.spk.icon.on { color: var(--brand-d); background: var(--brand-2); }
.spk.big { height: 48px; padding: 0 16px 0 12px; border-radius: 12px; background: var(--brand-2); color: var(--brand-d); border: 1.5px solid var(--brand-3); font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.spk.big:active { background: var(--brand-3); }
.spk.big.on { background: var(--brand-d); border-color: var(--brand-d); color: #fff; }
.spk.text { min-height: 40px; padding: 0 2px; color: var(--brand-d); font-size: 15px; font-weight: 600; }
.spk.text svg { width: 20px; height: 20px; }
.qno .spk-g { margin-left: auto; display: inline-flex; align-items: center; gap: 0; align-self: center; margin-top: -8px; margin-bottom: -8px; }
.qno .tag + .spk-g { margin-left: 0; margin-right: -10px; }
.qno.low { margin-bottom: 16px; }
.qno.low .spk-g { gap: 4px; margin-right: -6px; }
.qtext, details.sol .mq { transition: background-color .25s ease, box-shadow .25s ease; border-radius: 6px; }
.qtext.reading, details.sol .mq.reading { background: color-mix(in srgb, var(--brand) 7%, #fff); box-shadow: 0 0 0 8px color-mix(in srgb, var(--brand) 7%, #fff); }
.prow .qtext.reading { box-shadow: none; }
.prow .ph .spk.icon { margin-left: auto; width: 40px; height: 36px; }
.prow .ph .spk.icon + .btn { margin-left: 0; }
details.sol .spk.text { margin: 4px 0 0; }
.spk-sheet h3 { margin: 4px 0 16px; }
.spk-opt { margin-bottom: 16px; }
.spk-opt .lab { font-size: 15px; font-weight: 600; color: var(--ink2); margin-bottom: 8px; }
.spk-seg { display: flex; gap: 4px; padding: 4px; background: var(--s-soft); border-radius: 12px; }
.spk-seg .chip { flex: 1; border: 0; background: transparent; border-radius: 9px; min-height: 44px; font-size: 16px; font-weight: 600; color: var(--ink2); }
.spk-seg .chip.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(20,26,38,.1); }
.spk-sheet .cap { margin: 0 0 16px; font-size: 13px; color: var(--ink3); }
@media (prefers-reduced-motion: reduce) { .qtext, details.sol .mq { transition: none; } }
