/* 영원국어 수업 웹 — DESIGN.md: 학생은 단정한 목록(A), 콘솔은 조밀한 표(D), 해설은 교재 지면(C). 값은 아래 변수만 씁니다. */
:root {
  --bg: #F2F2F4; --canvas: #FFFFFF; --surface: #FFFFFF; --surface-2: #F7F7F8; --fill: #EEEEF0; --side: #F8F8F9;
  --ink: #1C1C1E; --ink-2: #3A3A3C; --muted: #6E6E73; --faint: #A1A1A6;
  --line: #E3E3E6; --line-2: #D1D1D6;
  --accent: #7B2D3A; --accent-fill: #7B2D3A; --accent-press: #66232F; --accent-soft: #F4E9EB;
  --ok: #1F7A4D; --ok-soft: #E7F3EC; --warn: #9A5B00; --warn-soft: #FBF1DE; --bad: #C8341F; --bad-soft: #FBE9E5;
  --paper-rule: #16181D; --paper-hair: #DCD6CB;
  --float: 0 0 0 .5px rgba(0, 0, 0, .08), 0 12px 32px rgba(0, 0, 0, .12);
  --r-sm: 8px; --r: 12px; --r-lg: 16px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --serif: "Noto Serif KR", "Nanum Myeongjo", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --canvas: #000000; --surface: #1C1C1E; --surface-2: #2C2C2E; --fill: #2C2C2E; --side: #111113;
    --ink: #F5F5F7; --ink-2: #D1D1D6; --muted: #98989F; --faint: #636366;
    --line: #38383A; --line-2: #48484A;
    --accent: #E59AA5; --accent-fill: #9E3A4B; --accent-press: #8A3241; --accent-soft: #3A2328;
    --ok: #5BC28E; --ok-soft: #17291F; --warn: #E6B35A; --warn-soft: #2E2615; --bad: #F27A62; --bad-soft: #351D18;
    --paper-rule: #ECE9E4; --paper-hair: #3A3B40;
    --float: 0 0 0 .5px rgba(255, 255, 255, .1), 0 12px 32px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.6;
  word-break: keep-all; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
.i { flex: none; display: inline-block; vertical-align: middle; }
h1 { font-size: 28px; line-height: 36px; margin: 6px 0 16px; letter-spacing: -.02em; font-weight: 700; }
h1 small { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 6px; }
h2 { font-size: 13px; line-height: 18px; margin: 26px 4px 8px; color: var(--muted); font-weight: 500; display: flex; align-items: baseline; gap: 8px; }
h2 small { font-weight: 400; }
h3 { font-size: 16px; margin: 16px 0 6px; font-weight: 600; }
small, .muted { color: var(--muted); }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .86em; background: var(--fill); padding: 1px 6px; border-radius: 6px; }
.wrap { max-width: 600px; margin: 0 auto; padding: 4px 16px 108px; }
.lede { margin: -10px 0 4px; color: var(--muted); font-size: 15px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 0; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.facts b { font-weight: 600; color: var(--ink); }
.facts span { display: inline-flex; align-items: center; gap: 5px; }
.facts .i { color: var(--muted); }

/* ── 학생 상단·하단 ── */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; padding: 10px 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: -.015em; font-size: 16px; }
.mark { width: 26px; height: 26px; border-radius: var(--r-sm); background: var(--accent-fill); color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; }
.top .who { font-size: 14px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; color: var(--ink-2); }
.top .who em { font-style: normal; color: var(--muted); font-weight: 400; }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex; justify-content: center;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid var(--line-2); }
.tabbar a { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 500; color: var(--muted); padding: 4px 0; }
.tabbar a.on { color: var(--accent); }
.foot { text-align: center; padding: 28px 0 0; font-size: 12px; }
.foot a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

/* ── 목록·카드 ── */
.card { background: var(--surface); border-radius: var(--r); padding: 16px; margin-bottom: 12px; }
.card.tight { padding: 12px 16px; }
.list { background: var(--surface); border-radius: var(--r); overflow: hidden; margin-bottom: 12px; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; position: relative; min-height: 52px; }
.li + .li::before { content: ""; position: absolute; top: 0; right: 0; left: 52px; border-top: 1px solid var(--line); }
a.li:hover { background: var(--surface-2); color: inherit; }
a.li:active { background: var(--fill); }
.li .tt { font-weight: 600; font-size: 16px; line-height: 22px; letter-spacing: -.01em; }
.li .ss { font-size: 13px; color: var(--muted); margin-top: 1px; }
.li .chev { color: var(--faint); }
.tile { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--muted); }
.tile.accent { color: var(--accent); }
.tile.ok { color: var(--ok); }
.tile.bad { color: var(--bad); }
.tile.warn { color: var(--warn); }
.kind-재시험, .kind-클리닉 { color: var(--bad); }
.tile.seq { font-weight: 600; font-size: 16px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: var(--fill); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.avatar.staff { background: var(--accent-soft); color: var(--accent); }
.avatar.lg { width: 40px; height: 40px; font-size: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.flash { background: var(--ink); color: var(--canvas); border-radius: var(--r); padding: 12px 16px; margin: 8px 0 14px; font-weight: 500; font-size: 15px; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; font-size: 15px; }
.empty .i { color: var(--faint); }
.back { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-size: 15px; margin: 6px 0 2px; }
.back:hover { opacity: .8; }

/* ── 버튼·폼 ── */
.btn, button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: var(--r-sm);
  background: var(--accent-fill); color: #fff; font: inherit; font-weight: 600; font-size: 15px; padding: 10px 16px; cursor: pointer;
  transition: transform .12s, background-color .12s; }
.btn:hover, button:hover { color: #fff; background: var(--accent-press); }
.btn:active, button:active { transform: scale(.97); }
.btn.accent, button.accent { background: var(--accent-fill); }
.btn.ghost, button.ghost { background: var(--fill); color: var(--ink); }
.btn.ghost:hover, button.ghost:hover { color: var(--ink); background: var(--line); }
.btn.sm, button.sm { padding: 6px 12px; font-size: 13px; }
.btn.block, button.block { width: 100%; min-height: 50px; font-size: 16px; border-radius: var(--r); }
button:disabled { opacity: .4; cursor: not-allowed; }
input, select, textarea { font: inherit; font-size: 16px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 10px 12px; width: 100%; transition: border-color .12s; }
body.teacher input, body.teacher select, body.teacher textarea { font-size: 14px; padding: 8px 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; border-color: var(--accent); background: var(--surface); }
input[type=file] { padding: 8px; font-size: 14px; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--accent-fill); }
textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 5px; color: var(--ink-2); }
label small { font-weight: 400; }
label.inline { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; margin: 5px 14px 5px 0; }
label.inline input { width: auto; }
form.inline { display: inline; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 12px; }
.form-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; }
.form-title .i { color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; line-height: 1.55; }

/* ── 칩·진행 막대 ── */
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; line-height: 18px; padding: 2px 8px; border-radius: var(--r-sm);
  background: var(--fill); color: var(--ink-2); white-space: nowrap; }
.chip.ok, .chip.warn, .chip.bad { background: none; padding-left: 0; padding-right: 2px; }
.chip.ok::before, .chip.warn::before, .chip.bad::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 2px; }
.chip.ok { color: var(--ok); } .chip.warn { color: var(--warn); } .chip.bad { color: var(--bad); }
.chip:has(.i)::before { display: none; }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.dark { background: var(--ink); color: var(--canvas); }
.bar { height: 4px; background: var(--fill); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent-fill); border-radius: 99px; }
.bar.ok > i { background: var(--ok); }
.dday { display: inline-flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; margin-right: 12px; }
.dday b { font-size: 20px; line-height: 1.1; font-weight: 700; }
.dday span { font-size: 13px; color: var(--muted); }
.stat .k { font-size: 13px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 15px; font-weight: 400; }
.score { font-size: 34px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; font-variant-numeric: tabular-nums; }

/* ── 표 ── */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th { font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; background: var(--surface); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tablewrap { overflow-x: auto; background: var(--surface); border-radius: var(--r); }
.tablewrap table th:first-child, .tablewrap table td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
table tr:hover td { background: var(--surface-2); }
table tr:hover td:first-child { background: var(--surface-2); }

/* ── OMR 입력(학생) ── */
.omr-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.omr-item + .omr-item { border-top: 1px solid var(--line); }
.omr-item .no { width: 30px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.omr-item .src { font-size: 11px; color: var(--muted); display: block; line-height: 1.3; }
.bubbles { display: flex; gap: 6px; flex: none; }
.bubbles label { margin: 0; }
.bubbles input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bubbles span { display: inline-flex; width: 40px; height: 40px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-2);
  align-items: center; justify-content: center; font-weight: 600; color: var(--muted); cursor: pointer; user-select: none; transition: background-color .12s, transform .12s; }
.bubbles input:checked + span { background: var(--accent-fill); box-shadow: none; color: #fff; }
.bubbles input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.sticky-submit { position: sticky; bottom: 78px; padding-top: 12px; }

/* ── 결과 ── */
.res { padding: 12px 0; }
.res + .res { border-top: 1px solid var(--line); }
.res .mark { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none;
  font-size: 13px; align-self: flex-start; background: none; }
.res .mark.o { color: var(--ok); box-shadow: inset 0 0 0 1.5px var(--ok); }
.res .mark.x { color: var(--bad); box-shadow: inset 0 0 0 1.5px var(--bad); }
.trap { font-size: 13px; color: var(--bad); font-weight: 500; margin-top: 3px; display: flex; gap: 5px; align-items: center; }

/* ── 교재 지면: 해설·지문 읽기(C) ── */
details.hs summary { cursor: pointer; font-size: 14px; color: var(--accent); font-weight: 600; margin-top: 6px; list-style: none; }
details.hs summary::-webkit-details-marker { display: none; }
details.hs summary::before { content: "＋ "; }
details.hs[open] summary::before { content: "－ "; }
details.hs div, .reading { white-space: pre-wrap; font-family: var(--serif); font-size: 15.5px; line-height: 1.8; color: var(--ink);
  border-top: 1.5px solid var(--paper-rule); border-bottom: 1px solid var(--paper-hair); padding: 12px 2px 14px; margin-top: 10px; }

/* ── 영상 ── */
.player { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--r-lg); overflow: hidden; }
.player iframe, .player video, .player > div:not(.wm) { position: absolute; inset: 0; width: 100%; height: 100%; }
.wm { position: absolute; pointer-events: none; color: rgba(255, 255, 255, .3); font-weight: 600; font-size: 13px; transition: top 1.2s, left 1.2s; z-index: 5; white-space: nowrap; }
.strip { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 1px; }
.strip i { flex: 1; background: var(--fill); }
.strip i.on { background: var(--accent-fill); }

/* ── 첨부 ── */
.files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.files a.thumb { width: 84px; height: 84px; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); display: block; }
.files a.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.files a.doc { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--fill); font-size: 13px; font-weight: 500; max-width: 100%; }
.files a.doc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.drop { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r); background: var(--surface-2); border: 1.5px dashed var(--line-2); cursor: pointer; margin: 0; font-weight: 500; color: var(--ink-2); }
.drop input { display: none; }
.picked { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.answer { background: var(--surface-2); border-radius: var(--r); padding: 12px 14px; margin-top: 10px; white-space: pre-wrap; font-size: 15px; border-left: 3px solid var(--accent-fill); }

/* ── 선생님 콘솔(D) ── */
body.teacher { background: var(--canvas); font-size: 14px; line-height: 1.55; }
body.teacher .card, body.teacher .list, body.teacher .tablewrap { border: 1px solid var(--line); }
body.teacher .li + .li::before { left: 0; }
body.teacher .li { min-height: 44px; padding: 10px 14px; }
body.teacher .li .tt { font-size: 14px; }
body.teacher h1 { font-size: 22px; line-height: 30px; font-weight: 600; letter-spacing: -.015em; }
body.teacher h1 small { font-size: 14px; }
body.teacher h2 { font-size: 15px; line-height: 22px; color: var(--ink); font-weight: 600; margin: 28px 0 10px; }
body.teacher h2 small { color: var(--muted); font-size: 13px; }
body.teacher table { font-size: 13px; }
body.teacher th, body.teacher td { padding: 9px 10px; }
body.teacher .btn, body.teacher button { font-size: 14px; padding: 8px 14px; }
body.teacher .btn.sm, body.teacher button.sm { font-size: 13px; padding: 5px 10px; }
body.teacher .score { font-size: 28px; }
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 16px 10px; background: var(--side); border-right: 1px solid var(--line); }
.side .brand { padding: 4px 8px; }
.side .brand small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; margin-top: 1px; }
.side .brand > span:last-child { line-height: 1.15; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a, .side .out { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm); font-weight: 500; font-size: 14px; color: var(--ink-2); }
.side nav a .i, .side .out .i { color: var(--muted); }
.side nav a:hover, .side .out:hover { background: var(--fill); color: var(--ink); }
.side nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side nav a.on .i { color: var(--accent); }
.side .out { font-size: 13px; }
.console { padding: 24px 28px 64px; max-width: 1280px; width: 100%; min-width: 0; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; z-index: 30; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 8px 12px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .brand small { display: none; }
  .side nav { flex-direction: row; }
  .side nav a span, .side .out span { display: none; }
  .side .out { margin: 0 0 0 auto; }
  .console { padding: 16px 16px 48px; }
}
.matrix td { min-width: 104px; font-size: 12.5px; vertical-align: top; }
.matrix th a { color: var(--ink); }
.cell { display: flex; flex-direction: column; gap: 4px; }
.cell .v { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.cell .v .bar { flex: 1; height: 3px; }
.tp { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; padding: 0; color: var(--ok); align-self: flex-start; font-variant-numeric: tabular-nums; }
.tp.bad { color: var(--bad); }
.tp.none { color: var(--warn); }
.dist { display: flex; height: 10px; border-radius: 3px; overflow: hidden; min-width: 130px; gap: 1px; }
.dist i { display: block; height: 100%; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 4px 0 10px; vertical-align: -1px; }
.hist { display: flex; align-items: flex-end; gap: 5px; height: 96px; }
.hist div { flex: 1; background: var(--accent-fill); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; opacity: .85; }
.hist div span { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); font-weight: 500; }
.hist-x { display: flex; gap: 5px; font-size: 11px; color: var(--faint); margin-top: 4px; }
.hist-x span { flex: 1; text-align: center; }
.low { color: var(--bad); font-weight: 600; }
.att { display: inline-flex; gap: 2px; background: var(--fill); border-radius: 99px; padding: 2px; }
.att button { padding: 4px 11px; font-size: 12.5px; border-radius: 99px; background: transparent; color: var(--muted); font-weight: 500; }
.att button:hover { background: transparent; color: var(--ink); }
.att button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 .5px var(--line-2); }
pre.report { white-space: pre-wrap; font-family: inherit; background: var(--surface-2); padding: 14px; border-radius: var(--r); margin: 0; font-size: 14px; line-height: 1.7; outline: none; }
.slot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; }
.slot + .slot { border-top: 1px solid var(--line); }
.tabs { display: flex; gap: 2px; margin-bottom: 14px; background: var(--fill); padding: 2px; border-radius: 99px; }
.tabs button, .tabs a { flex: 1; background: transparent; color: var(--muted); padding: 7px 10px; border-radius: 99px; font-weight: 500; text-align: center; font-size: 14px; }
.tabs button:hover, .tabs a:hover { background: transparent; color: var(--ink); }
.tabs .on, .tabs .on:hover { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 .5px var(--line-2), 0 1px 2px rgba(0, 0, 0, .06); }
details.card > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font-weight: 600; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary .i { color: var(--muted); }
details.card[open] > summary { margin-bottom: 8px; }

/* ── 로그인 ── */
body.login-page { background: var(--bg); }
.login { max-width: 380px; margin: 10vh auto 0; padding: 0 4px; }
.login .logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 24px; }
.login .logo .logo-icon { width: 56px; height: 56px; border-radius: var(--r); box-shadow: 0 0 0 1px var(--line); }
.login .logo b { font-size: 24px; letter-spacing: -.02em; }
.login .logo span { color: var(--muted); font-size: 14px; margin-top: -6px; }

/* ── 처리방침 ── */
.policy h3 { margin-top: 1.6rem; }
.policy p, .policy li { font-size: 15px; line-height: 1.75; color: var(--ink-2); }
.policy table { font-size: 14px; }

/* ── OMR 스캔 확인 ── */
.omr-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }          /* 가로형 답안지라 그림을 위에 넓게, 답은 아래 */
.sheet { position: relative; border-radius: var(--r-sm); overflow: hidden; background: #fff; box-shadow: inset 0 0 0 1px var(--line-2); }
.sheet[data-rect="1"] { cursor: crosshair; }
.sheet img { display: block; width: 100%; height: auto; }
.sheet i { position: absolute; transform: translate(-50%, -50%); border-radius: 30% / 22%; pointer-events: none;
  box-shadow: 0 0 0 2px #1F6FEB; background: rgba(31, 111, 235, .14); }
.sheet b.flag { position: absolute; border: 2px solid #E8890C; border-radius: 6px; background: rgba(232, 137, 12, .10); pointer-events: none; }
.ans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 6px 8px; }
.ans-grid label { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin: 0; font-size: 12px; color: var(--muted); }
.ans-grid input { width: 34px; padding: 5px 0; text-align: center; font-weight: 700; font-size: 14px; }
.ans-grid .flagged input { box-shadow: 0 0 0 2px var(--warn); background: var(--warn-soft); }
.ans-grid .edited input { box-shadow: 0 0 0 2px #1F6FEB; }

/* ── 문항 분석 ── */
.review-box { border-left: 3px solid var(--warn) !important; }
.review-list { margin: 8px 0 0; padding: 0; list-style: none; font-size: 13.5px; }
.review-list li { padding: 6px 0; border-top: 1px solid var(--line); }
.review-list li:first-child { border-top: 0; }
.choice-table td small { color: var(--muted); font-weight: 400; }
.choice-table td.is-key { background: var(--ok-soft); color: var(--ok); }
.choice-table td.is-trap { background: var(--warn-soft); }

/* ── 누적 순위표 ── */
.filters .fields { grid-template-columns: repeat(auto-fit, minmax(150px, 220px)); }
.board table { font-variant-numeric: tabular-nums; }
.board th.t { white-space: nowrap; line-height: 1.2; }
.board th.t span { display: block; }
.board th.t small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); }
.board th.sorted { color: var(--accent); }
.board td.rank { font-weight: 700; font-size: 15px; }
.board tr.podium td.rank { color: var(--accent); }
.board td.strong { font-weight: 600; }
.board td.sc { color: var(--ink-2); }
.board td.delta { font-size: 11.5px; font-weight: 600; width: 34px; }
.board .delta .up { color: var(--ok); }
.board .delta .down { color: var(--bad); }
.board tr.unranked td { color: var(--muted); }
.board tr.avg td { font-weight: 600; background: var(--surface-2); white-space: nowrap; }

/* ── 학생 성적표: 반 누적 순위 ── */
.toplist { list-style: none; margin: 10px 0 0; padding: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.toplist li { display: flex; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.toplist li span { width: 20px; color: var(--muted); font-weight: 600; }
.toplist li em { margin-left: auto; font-style: normal; color: var(--ink-2); }
.toplist li.me { font-weight: 600; color: var(--accent); }
.reports textarea { min-height: 64px; }

/* ── 인쇄(선생님 화면 공통) ── */
@page board { size: A4 landscape; margin: 10mm; }
@media print {
  .side, .noprint, .back, .flash, .tabbar, header.top, .foot { display: none !important; }
  .shell { display: block; }
  body, main { background: #fff !important; color: #000; }
  .tablewrap { overflow: visible !important; }
  .board { page: board; }
  .board table { font-size: 9pt; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .btn:active, button:active { transform: none; }
}

/* ── 콘솔 빠른 찾기(Ctrl+K) ── */
.palette { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .28); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 0; }
.palette[hidden] { display: none; }
.palette-panel { width: 100%; max-width: 560px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--float); overflow: hidden; }
.palette-panel input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: var(--surface); font-size: 16px !important; padding: 14px 16px !important; outline: none; }
.palette-panel input:focus { outline: none; box-shadow: none; }
.palette-list { list-style: none; margin: 0; padding: 6px; max-height: 52vh; overflow-y: auto; }
.palette-list li { display: grid; grid-template-columns: 52px auto 1fr; align-items: baseline; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; }
.palette-list li.on { background: var(--accent-soft); }
.palette-list li .k { font-size: 12px; color: var(--muted); }
.palette-list li b { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-list li small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-list li.none { display: block; color: var(--muted); text-align: center; padding: 18px; cursor: default; }
.palette-foot { margin: 0; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.side .find { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 2px; padding: 7px 10px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 13px; cursor: pointer; }
.side .find:hover { color: var(--ink); }
.side .find kbd { font-family: inherit; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; background: var(--surface-2); }
@media (max-width: 860px) { .side .find span, .side .find kbd { display: none; } .side .find { margin: 0; padding: 6px 8px; } }

/* ── 정답률 농도(히트맵) ── */
td.heat { background: color-mix(in srgb, var(--accent-fill) var(--h, 0%), transparent); }
.heatgrid table { font-size: 12.5px; }
.heatgrid th, .heatgrid td { padding: 6px 7px; min-width: 30px; }
.heatgrid td.ok-c { color: var(--faint); }
.heatgrid td.blank-c { color: var(--faint); }
.heatgrid td.x-c { color: var(--bad); font-weight: 600; background: var(--bad-soft); }
.heatgrid tr.foot-r td { font-weight: 600; border-top: 1px solid var(--line-2); }

/* 작업 순서와 작은 화면: 2026-10-08 */
.home-notices { margin-top: 16px; }
.home-notices summary { display: flex; align-items: center; gap: 8px; cursor: pointer; min-height: 44px; }
.notice-entry { padding: 12px 0; border-top: 1px solid var(--line); }
.notice-entry p { white-space: pre-wrap; margin: 8px 0 0; font-size: 14px; }
.notice-entry .ss { color: var(--muted); font-size: 13px; }
.work-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 12px; }
.work-filters a { padding: 10px 12px; min-height: 44px; border-radius: var(--r-sm); background: var(--fill); font-size: 14px; }
.work-filters a.on { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.work-kind { flex: 0 0 76px; font-size: 13px; color: var(--muted); }
.work-list .tt { font-size: 15px; }
.work-pager { justify-content: center; margin: 12px 0; }
.report-mobile { display: none; }
.report-test-head { display: flex; align-items: flex-start; gap: 8px; }
.report-test-head > .chip { flex-shrink: 0; }
.report-test .ss { font-size: 13px; color: var(--muted); }
.report-test-title { display: block; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.report-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 16px 0 0; }
.report-metrics dt { font-size: 12px; color: var(--muted); }
.report-metrics dd { margin: 2px 0 0; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.answer-tools { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 12px 0; }
.answer-tools > span { font-size: 13px; color: var(--muted); flex: 1; min-width: 140px; }
.answer-tools button, .clear-answer { min-height: 44px; }
#omr .omr-item { display: block; scroll-margin-top: 72px; }
.answer-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
#omr .bubbles { justify-content: space-between; }
#omr .bubbles span { width: 44px; height: 44px; }
#omr .omr-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
@media (max-width: 600px) {
  .report-desktop { display: none; }
  .report-mobile { display: block; }
  .work-list .li { flex-wrap: wrap; gap: 4px 8px; }
  .work-kind { flex-basis: 100%; }
}
@media (max-width: 860px) {
  .side { flex-wrap: wrap; gap: 4px; overflow: visible; }
  .side .brand { flex: 1; min-width: 0; }
  .side .find { min-height: 44px; padding: 8px; display: flex; align-items: center; }
  .side .find span { display: inline; }
  .side .find kbd { display: none; }
  .side .out { margin: 0 !important; width: 44px; min-height: 44px; justify-content: center; padding: 8px; }
  .side nav { order: 5; width: 100%; justify-content: space-between; gap: 4px; }
  .side nav a { flex: 1; min-height: 48px; flex-direction: column; justify-content: center; gap: 2px; padding: 4px; font-size: 12px; }
  .side nav a span { display: inline; }
}
@media print { .report-desktop { display: block; } .report-mobile, .work-filters { display: none; } }

/* 수강 후기: 문구 고르기(네이버 리뷰 키워드 방식) · 많이 고른 문구 · 후기 카드 — 2026-10-10 */
.rv-label { display: block; font-size: 16px; font-weight: 600; color: var(--ink); margin: 12px 0 6px; }
.pick-group { border: 0; padding: 0; margin: 12px 0 0; min-width: 0; }
.pick-cat { font-size: 13px; font-weight: 500; color: var(--muted); padding: 0; margin: 0 0 6px; }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick label { display: inline-flex; margin: 0; position: relative; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.pick input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.pick span { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--fill); cursor: pointer;
  transition: background-color .12s, color .12s; }
.pick input:checked + span { background: var(--accent-soft); color: var(--accent); font-weight: 600; box-shadow: inset 0 0 0 1px var(--accent); }
.pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.pick input:disabled + span { opacity: .4; cursor: not-allowed; }
.tagstat { padding: 14px 16px; }
.tagstat b { font-weight: 600; }
.ts-row { position: relative; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 12px; margin-top: 6px; border-radius: var(--r-sm);
  background: var(--surface-2); overflow: hidden; color: var(--ink); font-size: 14px; }
.ts-row:hover { color: var(--ink); }
.ts-row .ts-bar { position: absolute; top: 0; bottom: 0; left: 0; background: var(--accent-soft); }
.ts-row > :not(.ts-bar) { position: relative; }
.ts-row .ts-label { flex: 1; min-width: 0; }
.ts-row b { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.ts-row.on { box-shadow: inset 0 0 0 1px var(--accent); }
.ts-more { cursor: pointer; font-size: 13px; color: var(--accent); font-weight: 600; margin-top: 8px; }
.reviews { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.reviews > .card { margin: 0; }
.review { padding: 16px; }
.rv-title { margin: 0; font-size: 17px; line-height: 24px; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.rv-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rv-q { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 12px; }
.rv-a { margin: 6px 0 0; white-space: pre-wrap; font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.rv-meta { font-size: 13px; color: var(--muted); margin-top: 10px; }
.rv-reply { margin-top: 10px; white-space: normal; }
.rv-reply b { font-size: 13px; }
.rv-reply div { margin-top: 4px; white-space: pre-wrap; }
.rv-flags { flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.rv-actions { flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rv-replybox summary { cursor: pointer; font-size: 13px; color: var(--accent); font-weight: 600; margin-top: 10px; }
.public-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; margin: 18px 0 4px; }
body.teacher .review { padding: 14px 16px; }
body.teacher .rv-title { font-size: 15px; line-height: 22px; font-weight: 600; }
body.teacher .rv-a { font-size: 14px; }

/* 상담 신청 — 2026-10-10 */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.consent { margin-top: 16px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 13px; color: var(--ink-2); }
.consent ul { margin: 6px 0 4px; padding-left: 18px; line-height: 1.6; }
.consent label.inline { font-size: 14px; color: var(--ink); }
.pick input[type=radio] { position: absolute; opacity: 0; width: 1px; height: 1px; }

/* 학생 이력 한눈에 — 2026-10-10 */
.work-filters button { padding: 10px 12px; min-height: 44px; border-radius: var(--r-sm); background: var(--fill); color: var(--ink); font-size: 14px; font-weight: 500; }
.work-filters button:hover { background: var(--line); color: var(--ink); }
.work-filters button.on { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.timeline .li { align-items: flex-start; }
.tl-date { flex: 0 0 64px; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink-2); padding-top: 1px; }
.tl-date small { display: block; color: var(--muted); font-size: 12px; }
.timeline .work-kind { flex-basis: 48px; padding-top: 1px; }
.timeline .ss { white-space: pre-wrap; }
@media print { .timeline .li { break-inside: avoid; } }

/* Home-screen installation: shared brand, browser-specific guidance. */
[hidden] { display: none !important; }
.install-page { max-width: 720px; margin: 24px auto; }
.install-brand { display:flex; align-items:center; gap:20px; margin-bottom:28px; }
.install-brand img { border-radius:20px; flex-shrink:0; }
.install-brand h1 { font-size:26px; margin:0 0 6px; }
.install-brand p,.install-note,.install-guides p { color:var(--muted); }
.install-brand p { margin:0; }
.install-action { width:100%; min-height:52px; }
.install-guides { margin:24px 0; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); overflow:hidden; }
.install-guides section { padding:24px; border-bottom:1px solid var(--line); }
.install-guides section:last-child { border-bottom:0; }
.install-guides h2 { font-size:17px; margin:0 0 8px; }
.install-guides p { margin:0 0 12px; }
.install-recommended { box-shadow:inset 3px 0 var(--accent); }
.install-copy-label { display:block; margin-top:16px; font-size:13px; color:var(--muted); }
#install-address { width:100%; margin:6px 0; }
.install-note { font-size:13px; line-height:1.8; }
@media(max-width:480px) { .install-brand { gap:14px; } .install-brand h1 { font-size:22px; } .install-brand img { width:64px; height:64px; border-radius:16px; } .install-guides section { padding:20px; } }

.brand-icon { display:block; border-radius:8px; flex-shrink:0; }
