/* 연습실 추가 스타일: 처음 화면 · 일시 정지 · 결과 · 오답 노트 인쇄 · 그림 */
[hidden] { display: none !important; }
:root { --gray-screen: #8a8d91; --gray-ink: #ffffff; --chart-ink: #333; --chart-bar: #b9bec6; --chart-bar2: #59616c; --chart-line: #111; }

/* 로그인 */
.gate { display: grid; gap: 14px; }
.gate .msg { color: var(--warn); font-weight: 500; min-height: 1.4em; }

/* 처음 화면 */
.home .intro h1 { font-size: 28px; font-weight: 900; }
.sech { font-size: 18px; margin: 26px 0 10px; }
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mode { display: grid; gap: 6px; align-content: start; text-align: left; background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; padding: 16px; text-decoration: none; font: inherit; cursor: pointer; }
.mode:hover { border-color: var(--accent); }
.mode b { font-size: 16.5px; }
.mode span { color: var(--muted); font-size: 13.5px; }
.mode em { font-style: normal; font-size: 12.5px; color: var(--accent); font-weight: 500; }
.banner { border: 1px solid var(--flag); background: color-mix(in srgb, var(--flag) 10%, var(--surface)); border-radius: 8px; padding: 12px; display: grid; gap: 8px; font-size: 14px; }
.resume { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }

/* 시험 화면 추가 */
.pbtn { background: transparent; color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent-ink) 55%, transparent); padding: 6px 12px; font-size: 13.5px; }
.qhead .tt.sub { border-style: dashed; }
.qbody .qtext { margin-top: 4px; }
.qbody .setp { font-weight: 600; margin-bottom: 10px; }
.qbody .setp .prem, .qbody .setp .cap, .qbody .setp table { font-weight: 400; }
.qtime { font-size: 12.5px; }
.qtime .over { color: var(--warn); }
.board button.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.board button.no { background: var(--warn); border-color: var(--warn); color: #fff; }
.opt.right { border-color: #1e7d4f; background: #e3f4ea; box-shadow: inset 0 0 0 1px #1e7d4f; }
.opt.wrong { border-color: #c0392b; background: #fbe6e3; }
.opt[disabled] { cursor: default; opacity: 1; }
.fb { margin-top: 14px; border-radius: 6px; padding: 10px 14px; font-size: 14.5px; line-height: 1.6; color: #111; }
.fb.good { background: #e3f4ea; border: 1px solid #9fd3b5; }
.fb.bad { background: #fbe6e3; border: 1px solid #e7a59c; }
.fb .muted { color: #555; }
.fb .pill { margin-left: 4px; }
.qbody .fr span:first-child { border-bottom-color: #111; }
.qbody .prem b { display: block; margin-top: 4px; }

/* 일시 정지: 화면 전체를 회색으로 덮는다 */
.pause { position: fixed; inset: 0; z-index: 60; background: var(--gray-screen); color: var(--gray-ink); display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); overflow-y: auto; }
body.paused { overflow: hidden; }
.pin { max-width: 520px; width: 100%; display: grid; gap: 14px; text-align: center; justify-items: center; }
.pin h2 { font-size: 34px; font-weight: 900; letter-spacing: .04em; }
.pin p { margin: 0; }
.pin .prow { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.pin .btn { border-color: #fff; }
.pin .btn.primary { background: #fff; color: #222; }
.pin .btn:not(.primary) { background: transparent; color: #fff; }
.pin .btn.ghost { border-color: transparent; text-decoration: underline; font-size: 13.5px; }
.code6 { font-size: 52px; font-weight: 500; letter-spacing: .12em; background: #fff; color: #111; border-radius: 10px; padding: 6px 22px; }
.cnote { font-size: 14px; line-height: 1.6; max-width: 460px; }
.cnote.warn { background: rgba(0, 0, 0, .18); border-radius: 6px; padding: 8px 12px; }
.pmsg { min-height: 1.2em; font-size: 14px; }

/* 결과 · 기록 */
.revh { font-size: 16px; margin: 14px 0 4px; }
.revbody .paper.mini { min-height: 0; padding: 14px 16px; margin: 8px 0; }
.revbody .opts .opt { cursor: default; }
details.qrev .exp { font-size: 14px; color: var(--fg); line-height: 1.6; }
td.slow { color: var(--warn); font-weight: 700; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; color: var(--muted); padding: 10px 14px; font-weight: 700; border-bottom: 3px solid transparent; }
.tabs button.on { color: var(--fg); border-bottom-color: var(--accent); }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.tbtn { display: grid; gap: 2px; text-align: left; background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.tbtn:hover { border-color: var(--accent); }
.tbtn span { font-size: 12.5px; color: var(--muted); }
.tips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tip { display: grid; gap: 8px; align-content: start; }
.tip h2 { font-size: 17px; }
.tip .tsub { margin: 0; font-weight: 500; }
.texample { background: var(--bg); border-radius: 6px; padding: 6px 10px; font-size: 13.5px; }

/* 그림 (문제지는 항상 흰 종이) */
.chart-svg { width: 100%; max-width: 460px; height: auto; font-family: var(--f-ui); }
.chart.pies { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chart.pies .chart-svg { max-width: 300px; }
.chart-svg .grid { stroke: #ddd; stroke-width: .6; }
.chart-svg .ax { font-size: 8.5px; fill: var(--chart-ink); }
.chart-svg .cbar { fill: var(--chart-bar); stroke: #777; stroke-width: .5; }
.chart-svg .cbar2 { fill: var(--chart-bar2); }
.chart-svg .bv { font-size: 7.5px; fill: #222; }
.chart-svg .ln { fill: none; stroke: var(--chart-line); stroke-width: 1.4; }
.chart-svg .dot { fill: var(--chart-line); }
.chart-svg .lv { font-size: 8px; font-weight: 700; fill: #111; }
.chart-svg .pz { stroke: #555; stroke-width: .6; }
.chart-svg .p0 { fill: #333; } .chart-svg .p1 { fill: #777; } .chart-svg .p2 { fill: #aaa; } .chart-svg .p3 { fill: #d4d4d4; } .chart-svg .p4 { fill: #fff; }
.chart-svg .pv { font-size: 8px; font-weight: 700; fill: #111; }
.chart-svg .p0t, .chart-svg .p1t { fill: #fff; }
.fig .shp { fill: #f2f2f2; stroke: #111; stroke-width: 1.4; }
.fig .mk-f { fill: #111; } .fig .mk-o { fill: #fff; stroke: #111; stroke-width: 1.2; } .fig .mk-t { fill: #fff; stroke: #111; stroke-width: 1.2; stroke-linejoin: round; }
.qbody .figq .fig { width: 150px; height: 150px; }
.opts.fig .opt .fig { width: 112px; height: 112px; max-width: 100%; }
.blk { width: 100%; max-width: 230px; height: auto; }
.blk .flr { fill: #eee; stroke: #ccc; stroke-width: .4; }
.blk .cb-t { fill: #fafafa; stroke: #333; stroke-width: .7; stroke-linejoin: round; }
.blk .cb-l { fill: #cfcfcf; stroke: #333; stroke-width: .7; stroke-linejoin: round; }
.blk .cb-r { fill: #a9a9a9; stroke: #333; stroke-width: .7; stroke-linejoin: round; }

/* 오답 노트 (화면 · 인쇄) */
.notebar { display: grid; gap: 12px; }
.nopts { display: flex; gap: 18px; flex-wrap: wrap; }
.nopts fieldset { border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; display: flex; gap: 12px; flex-wrap: wrap; margin: 0; }
.nopts legend { font-size: 12.5px; color: var(--muted); padding: 0 4px; }
.nopts label { display: flex; gap: 5px; align-items: center; font-size: 14px; }
.note-wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 18px 40px; }
.note { background: #fff; color: #111; max-width: 820px; margin: 0 auto; padding: 28px 32px; border: 1px solid var(--line); border-radius: 4px; font-size: 14.5px; line-height: 1.55; }
.nhead { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-bottom: 2px solid #111; padding-bottom: 6px; margin-bottom: 14px; font-size: 13px; }
.nhead b { font-size: 16px; }
.nbody.two { column-count: 2; column-gap: 26px; column-rule: 1px solid #ccc; }
.nq { break-inside: avoid; page-break-inside: avoid; border-bottom: 1px dashed #bbb; padding: 10px 0 12px; }
.nqh { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: #444; margin-bottom: 6px; }
.nno { font-family: var(--f-num); font-size: 18px; color: #111; min-width: 26px; }
.ntag { border: 1px solid #999; border-radius: 99px; padding: 0 8px; font-size: 11.5px; }
.ntag.x { border-color: #c0392b; color: #c0392b; } .ntag.b { color: #555; }
.nmat-ref { font-size: 12.5px; color: #555; }
.note .qins { font-size: 12.5px; color: #555; margin-bottom: 4px; }
.note .expr { border: 1px solid #888; text-align: center; padding: 6px; margin: 6px 0; font-size: 17px; letter-spacing: .5px; }
.note .prem { border: 1px solid #999; padding: 6px 10px; margin: 6px 0; }
.note .prem b { display: block; }
.note .cond { display: inline-grid; grid-template-columns: auto 1fr; column-gap: 10px; border: 1px solid #888; padding: 6px 12px; margin: 6px 0; font-size: 17px; align-items: center; }
.note .cond .ct, .note .bogi .ct { font-size: 11px; border: 1px solid #555; padding: 0 4px; margin-right: 6px; }
.note .cond .ct { grid-row: span 3; }
.note .cq { font-size: 18px; margin: 4px 0; }
.note .bogi { font-size: 24px; letter-spacing: 5px; margin: 6px 0; }
.note .target { font-size: 28px; border: 1px solid #999; width: 64px; text-align: center; margin: 4px 0; }
.note table.data { border-collapse: collapse; margin: 6px auto; font-size: 13px; }
.note table.data th, .note table.data td { border: 1px solid #555; padding: 2px 10px; text-align: center; }
.note table.data th { background: #eee; }
.note .cap { text-align: center; font-size: 12px; color: #333; }
.note .chart { text-align: center; }
.note .figq { text-align: center; }
.note .figq .fig { width: 120px; height: 120px; }
.note .blk { max-width: 190px; }
.nopt { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 3px 16px; }
.nopt.list { grid-template-columns: 1fr; }
.nopt.tf, .nopt.pos { grid-template-columns: repeat(4, max-content); gap: 3px 22px; }
.nopt.fig { grid-template-columns: repeat(4, minmax(0, 1fr)); text-align: center; }
.nopt.fig .fig { width: 92px; height: 92px; display: block; margin: 0 auto; }
.nopt .m { font-weight: 500; }
.nspace { height: 70px; }
.nexp { margin-top: 8px; background: #f3f5f8; border-left: 3px solid #1f4e8c; padding: 6px 10px; font-size: 13px; line-height: 1.6; }
.nback { break-before: page; page-break-before: always; margin-top: 30px; }
.nback h2 { font-size: 18px; border-bottom: 2px solid #111; padding-bottom: 4px; margin-bottom: 8px; }
.nb { font-size: 13px; line-height: 1.6; padding: 5px 0; border-bottom: 1px dotted #ccc; break-inside: avoid; }
.nb .muted { color: #666; }

@media (max-width: 860px) {
  .modes, .tips { grid-template-columns: minmax(0, 1fr); }
  .note { padding: 16px; }
  .nbody.two { column-count: 1; }
  .code6 { font-size: 40px; }
}
@page { size: A4; margin: 13mm 12mm; }
@media print {
  html, body { background: #fff !important; }
  body::before, .no-print, .bar, #pause { display: none !important; }
  .note-wrap { padding: 0; }
  .note { border: 0; padding: 0; max-width: none; font-size: 12.5px; }
  .nbody.two { column-count: 2; }
  .nexp { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .chart-svg, .fig, .blk { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* 이름으로 이어하기 */
.saved:empty { display: none; }
.saved { display: grid; gap: 8px; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 8px; padding: 12px; }
.savedh { font-size: 14px; }
.srow { display: flex; gap: 10px; justify-content: space-between; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.srow > div { min-width: 0; }
details.resume summary { cursor: pointer; font-weight: 500; font-size: 14px; color: var(--muted); }
.owner { font-size: 30px; font-weight: 900; letter-spacing: .02em; }
.chk { display: flex; gap: 8px; align-items: flex-start; font-size: 14.5px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 10px; cursor: pointer; }
.chk input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.warnbox { margin: 0; border: 1px solid var(--warn); color: var(--warn); border-radius: 6px; padding: 8px 10px; font-size: 14px; }
.cnote.big { font-size: 17px; }
.modal { z-index: 80; }            /* 일시 정지 회색 화면 위에도 보이게 */
.srow .btn { flex: none; white-space: nowrap; }

.pwrow { display: flex; gap: 8px; }
.pwrow input { flex: 1; min-width: 0; }
/* ===== v4: 처음 화면 · 일시 정지 · 모임 비교 · 도형 · 오답 노트 2단 ===== */
.home { display: grid; gap: 16px; }
.home .top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.home .top h1 { font-size: 28px; font-weight: 900; }
.who { display: flex; align-items: center; gap: 8px; }
.who label { font-weight: 700; }
.who input { width: 150px; }
input.t.need { border-color: var(--warn); box-shadow: 0 0 0 2px color-mix(in srgb, var(--warn) 30%, transparent); }
.namemsg { margin: 0; background: color-mix(in srgb, var(--warn) 12%, var(--surface)); border: 1px solid var(--warn); color: var(--fg); border-radius: 8px; padding: 10px 14px; font-weight: 500; }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .shake { animation: none; } }
.home .banner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.qk { display: grid; gap: 4px; text-align: left; border: 1px solid var(--line); border-radius: 10px; padding: 16px; background: var(--surface); color: var(--fg); }
.qk b { font-size: 17px; }
.qk span { font-size: 13px; color: var(--muted); }
.qk.daily, .qk.rec { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.qk.daily span, .qk.rec span { color: var(--accent-ink); opacity: .85; }
.qk:hover { border-color: var(--accent); filter: brightness(1.05); }
.rounds-card h2 { font-size: 18px; }
.rounds { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 12px; }
.rd { display: grid; gap: 1px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 8px; padding: 8px 6px; text-align: center; }
.rd b { font-size: 16px; }
.rd span { font-family: var(--f-num); font-size: 12.5px; color: var(--muted); }
.rd em { font-style: normal; font-size: 11.5px; color: var(--accent); }
.rd.done { background: var(--accent-soft); border-color: var(--accent); }
.rd.done span { color: var(--fg); font-weight: 700; }
.rd:hover { border-color: var(--accent); }
.extra { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ext, .mini { display: grid; gap: 2px; align-content: start; text-align: left; border-radius: 8px; padding: 12px 14px; text-decoration: none; font: inherit; }
.ext { background: #fff4e0; color: #7a4a00; border: 1px dashed #d99a2b; }
.ext span { font-size: 12.5px; color: #9a6a1c; }
.mini { background: var(--surface); color: var(--fg); border: 1px solid var(--line); }
.mini span { font-size: 12.5px; color: var(--muted); }
.codebox summary { list-style: none; cursor: pointer; display: grid; gap: 2px; }
.codebox summary::-webkit-details-marker { display: none; }
.rulebox summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.rulebox .rules { margin-top: 8px; font-size: 14px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ext { background: #3a2a10; color: #ffd28a; border-color: #a8742a; } :root:not([data-theme="light"]) .ext span { color: #e0b46a; } }
:root[data-theme="dark"] .ext { background: #3a2a10; color: #ffd28a; border-color: #a8742a; }
:root[data-theme="dark"] .ext span { color: #e0b46a; }
@media (max-width: 860px) { .quick, .extra { grid-template-columns: repeat(2, minmax(0, 1fr)); } .who input { width: 120px; } }

/* 일시 정지: 회색 바탕 위 흰 카드 (글씨는 어둡게) */
.pause .pin.card { background: #fff; color: #18202b; border: 0; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); padding: 28px 24px; max-width: 460px; }
.pause .pin h2 { font-size: 28px; }
.pause .pin .muted { color: #5d6876; }
.pause .pin .btn { border-color: #c9cfd8; }
.pause .pin .btn.primary { background: #1f4e8c; color: #fff; border-color: #1f4e8c; }
.pause .pin .btn:not(.primary) { background: #fff; color: #18202b; }
.pause .pin .btn.ghost { border-color: transparent; text-decoration: underline; color: #5d6876; }
.howto { background: #eef3fa; border-radius: 8px; padding: 10px 12px; font-size: 15px; }
.codeline { display: flex; gap: 10px; align-items: center; justify-content: center; }
.pause .code6 { font-size: 34px; background: #f3f5f8; border: 1px solid #d5dbe3; padding: 2px 16px; }
.pause .cnote { color: #b03a2e; font-size: 13.5px; margin: 0; }
.pause .pmsg { color: #18202b; }

/* 모임 비교 표 */
table.cmp td, table.cmp th { text-align: center; white-space: nowrap; }
table.cmp td.ty { text-align: left; font-size: 13px; color: var(--muted); }
table.cmp tr[data-s] { cursor: pointer; }
table.cmp tr[data-s]:hover { background: var(--accent-soft); }
td.co { color: var(--ok); font-weight: 700; }
td.cx { color: #fff; background: var(--warn); font-weight: 700; }
td.cb { color: var(--muted); }
table.cmp tr.sech th { text-align: left; background: var(--bg); }
th.me, tr.me td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
tr.cmpq td { white-space: normal; text-align: left; }

/* 무늬·격자·조각 도형 */
.fig .pf0 { fill: #fff; stroke: #111; stroke-width: .8; }
.fig .pf1 { fill: #a9b0b8; stroke: #111; stroke-width: .8; }
.fig .pf2 { fill: #2b2f36; stroke: #111; stroke-width: .8; }
.fig .pdot { fill: #fff; stroke: #111; stroke-width: 1.2; }
.fig .pout { fill: none; stroke: #111; stroke-width: 1.6; }
.fig .pc { fill: #e9ecef; stroke: #111; stroke-width: 1.3; stroke-linejoin: round; }
.fig .cut { stroke: #111; stroke-width: 1; }
.fig .hl { fill: #f6d77a; }
.fig .hlt { font-size: 9px; font-weight: 700; fill: #111; }
.qbody .figq .fig.big, .note .figq .fig.big { width: 180px; height: 180px; }
.exp .figq { text-align: center; }
.exp .fig.big { width: 160px; height: 160px; }

/* 오답 노트 v2: 2단 기본, 문제는 쪽·단 사이에서 잘리지 않음 */
.note .cond { display: grid; width: fit-content; max-width: 100%; grid-template-columns: auto auto; column-gap: 12px; margin: 8px 0; }
.note .cond .ct { grid-row: 1 / span 3; align-self: center; }
.note .nqq { margin-top: 2px; }
.note .nsrc { color: #444; }
.note .nmat { font-size: .95em; }
.note table.data { max-width: 100%; }
.nbody.two .nq { font-size: 13px; }
.nbody.two .expr { font-size: 15px; }
.nbody.two .nopt.fig .fig { width: 66px; height: 66px; }
.nbody.two .figq .fig { width: 104px; height: 104px; }
.nbody.two .figq .fig.big { width: 140px; height: 140px; }
.nbody.two .blk { max-width: 150px; }
.nbody.two .chart-svg { max-width: 100%; }
.nbody.two .chart.pies .chart-svg { max-width: 48%; }
.nbody.two table.data { font-size: 11.5px; }
.nbody.two table.data th, .nbody.two table.data td { padding: 1px 6px; }
.nq, .ecard, .nexp { break-inside: avoid; page-break-inside: avoid; -webkit-column-break-inside: avoid; }
.nq { display: block; }
.ex-main { margin-top: 3px; }
.ex-main .arr { color: #1f4e8c; font-weight: 700; }
.ex-tip { margin-top: 4px; font-size: .92em; color: #7a4a00; background: #fff6e3; border-radius: 4px; padding: 3px 7px; }
.nback h2 { font-size: 18px; }
.akey { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); border-top: 1px solid #bbb; border-left: 1px solid #bbb; margin-bottom: 14px; }
.akey span { display: flex; justify-content: space-between; padding: 3px 7px; font-size: 12.5px; border-right: 1px solid #bbb; border-bottom: 1px solid #bbb; }
.akey span b { color: #666; font-weight: 500; font-family: var(--f-num); }
.ecards { column-count: 2; column-gap: 18px; }
.ecard { border: 1px solid #d6dbe2; border-radius: 6px; padding: 8px 10px; margin: 0 0 10px; font-size: 12.5px; line-height: 1.6; display: inline-block; width: 100%; }
.eh { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid #e6e9ee; padding-bottom: 4px; }
.eh .nno { font-size: 15px; }
.eh .ans { font-weight: 900; color: #1f4e8c; }
.eh .nsrc { font-size: 11.5px; }
@media (max-width: 860px) { .ecards { column-count: 1; } .akey { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media print {
  html, body { height: auto !important; overflow: visible !important; }
  .nbody.two .nq { font-size: 11.5px; }
  .ex-tip, .akey, .ecard, .hl { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ecards { column-count: 2 !important; }
  .akey { grid-template-columns: repeat(10, minmax(0, 1fr)) !important; }
  .note { padding: 0 !important; }
}

/* 기록 탭 · 코드 팝업 · 시험 규칙 */
.rgroup { display: grid; gap: 10px; scroll-margin-top: 16px; }
.rghead { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.rghead h2 { font-size: 19px; font-weight: 900; }
.rghead .sp { flex: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--fg); border-radius: 99px; padding: 4px 12px; font-size: 13.5px; text-decoration: none; }
.chip:hover { border-color: var(--accent); }
#recBody { display: grid; gap: 14px; }
td.acts { white-space: nowrap; }
td.acts .btn + .btn { margin-left: 4px; }
.code-in { font-size: 26px; letter-spacing: .3em; text-align: center; width: 100%; }
.home .rulebox { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 18px; }
.home .rulebox h2 { font-size: 15px; margin-bottom: 6px; }
.home .rulebox .rules { margin: 0; font-size: 14px; }

.whoname { font-size: 16px; }
.name-in { font-size: 20px; padding: 12px 14px; width: 100%; }
.namebox .card { max-width: 420px; }

.home .extra { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.howto .bigname { font-size: 18px; }
@media (max-width: 860px) { .home .extra { grid-template-columns: minmax(0, 1fr); } }

/* 일시 정지 안내 줄바꿈 · 설치 버튼 · 업데이트 알림 */
.howto { display: grid; gap: 4px; text-align: center; }
.howto .saved-ok { font-size: 17px; color: #1e7d4f; }
.btn.install { background: var(--accent-soft); border-color: var(--accent); color: var(--fg); font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: #18202b; color: #fff; padding: 10px 18px; border-radius: 99px; z-index: 90; font-size: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }

/* 검수 수정: 휴대폰에서 표·탭·이동 버튼이 깨지지 않게 */
table.res th, table.res td { white-space: nowrap; }
table.res tr.cmpq td { white-space: normal; }
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs button { white-space: nowrap; flex: none; }
@media (max-width: 860px) {
  .nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .nav #prev { order: 1; } .nav #next { order: 2; }
  .nav > .row { order: 3; grid-column: 1 / -1; justify-content: center; }
}

/* ===== 오답 분석 (선생님 오답 노트 형식) ===== */
.note.report { max-width: 900px; font-size: 13.5px; }
.rpage { display: grid; gap: 10px; }
.rsub { font-size: 12.5px; color: #555; }
.rtitle { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; flex-wrap: wrap; border-bottom: 2px solid #1f4e8c; padding-bottom: 6px; }
.rtitle h1 { font-size: 26px; font-weight: 900; color: #111; }
.rtitle span { font-size: 12.5px; color: #555; }
table.rt { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.rt th { background: #dfe6ef; color: #1b2a3d; font-weight: 700; border: 1px solid #b8c3d1; padding: 4px 6px; }
table.rt td { border: 1px solid #c9d1dc; padding: 3px 6px; text-align: center; }
table.rt td.l { text-align: left; }
table.rt tr.sum td { background: #eef2f7; font-weight: 700; }
table.rt tr.lowr td { background: #fff3f1; }
.rnote { margin: 0; font-size: 12.5px; color: #333; }
.rh { font-size: 16px; color: #1f4e8c; font-weight: 900; margin-top: 6px; }
.feats { display: grid; gap: 6px; }
.feat { border-left: 4px solid #1f4e8c; background: #f2f5f9; padding: 6px 10px; break-inside: avoid; }
.feat b { color: #1f4e8c; font-size: 13px; }
.feat p { margin: 2px 0 0; font-size: 12.5px; line-height: 1.6; color: #222; }
.todo { margin: 0; padding-left: 20px; display: grid; gap: 3px; font-size: 12.8px; }
.rpart { break-before: page; page-break-before: always; margin-top: 24px; }
.rband { background: #1f4e8c; color: #fff; font-size: 16px; padding: 7px 12px; border-radius: 3px; margin-bottom: 10px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.cards.two { column-count: 2; column-gap: 14px; }
.acard { border: 1px solid #c9d1dc; border-radius: 6px; padding: 10px 12px; margin: 0 0 12px; display: inline-block; width: 100%; break-inside: avoid; page-break-inside: avoid; }
.ah { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.ah b { font-size: 15px; }
.ah .sp { flex: 1; }
.ah .aa { font-size: 12px; font-weight: 700; }
.chip2 { border: 1px solid #999; border-radius: 99px; padding: 0 8px; font-size: 11px; color: #444; }
.tag { border-radius: 99px; padding: 0 8px; font-size: 11px; font-weight: 700; color: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.tag.x { background: #c0392b; } .tag.b { background: #7a8594; }
.cos { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 6px; }
.cos.list { grid-template-columns: 1fr; }
.cos.tf { grid-template-columns: repeat(3, 1fr); }
.cos.pos { grid-template-columns: repeat(4, 1fr); }
.cos.fig { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.co { display: flex; align-items: center; gap: 6px; border: 1px solid #ccd3dc; border-radius: 4px; padding: 4px 8px; min-width: 0; font-size: 12.5px; }
.co .ot { flex: 1; min-width: 0; }
.co em { font-style: normal; font-size: 11px; font-weight: 700; white-space: nowrap; }
.co.r { border: 2px solid #1e7d4f; background: #eef8f2; } .co.r em { color: #1e7d4f; }
.co.m { border: 2px solid #c0392b; background: #fdf0ee; } .co.m em { color: #c0392b; }
.cos.fig .co { flex-direction: column; padding: 3px; }
.cos.fig .co .fig { width: 64px; height: 64px; }
.co, .nexp, .feat, table.rt th, table.rt tr.sum td, table.rt tr.lowr td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.acard .nexp { margin-top: 8px; background: #f3f5f8; border-left: 0; border-radius: 4px; padding: 6px 9px; font-size: 12px; }
.acard .nexp > b { color: #1f4e8c; margin-right: 4px; }
.acard .expr { border: 1px solid #888; text-align: center; padding: 4px; margin: 5px 0; font-size: 15px; }
.acard .prem { border: 1px solid #999; padding: 5px 9px; margin: 5px 0; }
.acard .figq .fig { width: 110px; height: 110px; } .acard .figq .fig.big { width: 140px; height: 140px; }
.acard .chart-svg { max-width: 100%; } .acard .blk { max-width: 150px; }
.acard table.data { font-size: 11.5px; border-collapse: collapse; margin: 5px auto; } .acard table.data th, .acard table.data td { border: 1px solid #555; padding: 1px 7px; text-align: center; }
.acard .cond { display: grid; width: fit-content; grid-template-columns: auto auto; column-gap: 10px; border: 1px solid #888; padding: 5px 10px; margin: 5px 0; font-size: 15px; }
.acard .cond .ct { grid-row: 1 / span 3; align-self: center; font-size: 11px; border: 1px solid #555; padding: 0 4px; }
.acard .bogi { font-size: 22px; letter-spacing: 4px; } .acard .bogi .ct { font-size: 11px; border: 1px solid #555; padding: 0 4px; letter-spacing: 0; }
.acard .target { font-size: 26px; border: 1px solid #999; width: 56px; text-align: center; }
@media (max-width: 860px) { .cards.two { column-count: 1; } }
@media print { .cards.two { column-count: 2 !important; } .note.report { font-size: 12px; } }
