*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body {
  font-family: var(--sans); font-size: var(--t-body); line-height: 1.7;
  color: var(--ink); -webkit-font-smoothing: antialiased;
  overflow-x: hidden; word-break: keep-all;
}
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:disabled { cursor: not-allowed; opacity: .45; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.tnum { font-variant-numeric: tabular-nums; }
.serif { font-family: var(--serif); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 760px) { .wrap { padding: 0 28px; } }

/* 머리 ------------------------------------------------------------------ */
/* 마스트헤드 — 열자마자 양식이 나오지 않게. 바탕은 종이빛 그대로 두고
   타이포·괘선·조명으로 격을 만든다(어둡게 못 가는 톤에서 쓰는 방법). */
.mast { position: relative; isolation: isolate; overflow: hidden; border-radius: 14px;
  margin: 14px 0 20px; padding: clamp(28px,3.6vw,46px) clamp(20px,2.6vw,36px) clamp(24px,3vw,36px);
  background: linear-gradient(160deg, var(--surface) 0%, var(--sunken) 100%); }
.mast::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
   radial-gradient(48% 42% at 14% -8%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
   radial-gradient(38% 34% at 96% 108%, color-mix(in srgb, var(--mark) 10%, transparent), transparent 72%),
   url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='150' height='150'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/><feColorMatrix type='saturate' values='0'/></filter><rect width='150' height='150' filter='url(%23n)' opacity='.1'/></svg>"); }
.mast .eb { font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--accent); margin: 0; }
.mast h1 { font-size: clamp(27px,4.1vw,48px); line-height: 1.17; letter-spacing: -.042em;
  font-weight: 900; color: var(--ink); margin: 12px 0 0; max-width: 17em; }
.mast .cl { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 15px; margin-top: 26px; }
.mast .cl div { font-size: 13.5px; line-height: 1.65; color: var(--muted);
  padding-top: 12px; border-top: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); }
.mast .cl div:nth-child(2) { border-top-color: color-mix(in srgb, var(--mark) 55%, transparent); }
.mast .cl b { display: block; color: var(--ink); font-size: 14.5px; font-weight: 800;
  letter-spacing: -.02em; margin-bottom: 3px; }
@media (max-width: 720px) { .mast .cl { grid-template-columns: 1fr; gap: 11px; } }
/* 등장은 투명도만 건드린다 */
@keyframes mastIn { from { opacity: 0 } to { opacity: 1 } }
@media (prefers-reduced-motion: no-preference) {
  .mast .eb { animation: mastIn .95s .05s both }
  .mast h1  { animation: mastIn .95s .2s both }
  .mast .cl { animation: mastIn .95s .4s both }
}

.top { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 93%, transparent); backdrop-filter: blur(6px); }
.top-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 0 4px; }
.brand { font-weight: 800; letter-spacing: -.02em; font-size: var(--t-small); }
.brand em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent); }
.notice { font-size: var(--t-micro); color: var(--faint); }
.top-act { margin-left: auto; display: flex; gap: 6px; }
.ghost { border-radius: var(--r-md); background: var(--sunken); color: var(--muted); font-size: var(--t-micro); font-weight: 700; padding: 6px 10px; }
.ghost:hover { color: var(--ink); }

.steps { display: flex; gap: 4px; overflow-x: auto; padding: 4px 0 10px; }
.step { display: flex; align-items: center; gap: 8px; white-space: nowrap; border-radius: var(--r-md); padding: 8px 12px; font-size: var(--t-small); font-weight: 700; color: var(--muted); }
.step:hover { background: var(--sunken); color: var(--ink); }
.step[aria-current='page'] { background: var(--accent); color: var(--on-accent); }
.step i { font-style: normal; font-family: var(--serif); font-size: var(--t-micro); opacity: .75; }

main { padding-bottom: 72px; }
.scr { display: none; }
.scr.on { display: block; }

/* 구역 제목 — 가로선을 쓰지 않는다. 세로 괘선과 여백으로만 나눈다 */
.vr { position: relative; padding-left: 15px; }
.vr::before { content: ''; position: absolute; left: 0; top: .2em; bottom: .2em; width: 2px; border-radius: 2px;
  background: linear-gradient(to bottom, var(--accent), color-mix(in srgb, var(--accent) 16%, transparent)); }
.eyebrow { font-family: var(--serif); font-style: italic; font-size: var(--t-small); letter-spacing: .05em; color: var(--accent); }
.h1 { font-size: var(--t-h2); font-weight: 800; letter-spacing: -.035em; }
.h2 { font-size: var(--t-h3); font-weight: 800; letter-spacing: -.025em; }
.h3 { font-size: var(--t-lead); font-weight: 700; }
.lead { color: var(--muted); max-width: 64ch; }
.small { font-size: var(--t-small); }
.micro { font-size: var(--t-micro); }
.mut { color: var(--muted); }
.fnt { color: var(--faint); }

/* 공통 부품 ------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px;
  padding: 8px 16px; border-radius: var(--r-md); font-weight: 700; font-size: var(--t-body); transition: background .16s, color .16s; }
.btn.sm { min-height: 34px; padding: 5px 11px; font-size: var(--t-small); }
.btn.pri { background: var(--accent); color: var(--on-accent); }
.btn.pri:hover:not(:disabled) { background: var(--accent-hover); }
.btn.sec { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.sec:hover:not(:disabled) { background: var(--sunken); }
.btn.qui { color: var(--muted); }
.btn.qui:hover:not(:disabled) { background: var(--sunken); color: var(--ink); }
.btn.mark { background: var(--mark-soft); color: var(--mark); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mark) 30%, transparent); }
.btn.mark:hover:not(:disabled) { background: var(--mark); color: var(--on-mark); }

.bdg { display: inline-flex; align-items: center; gap: 4px; border-radius: var(--r-sm); padding: 2px 7px;
  font-size: var(--t-micro); font-weight: 700; white-space: nowrap; }
.bdg.q { background: var(--sunken); color: var(--muted); }
.bdg.a { background: var(--accent-soft); color: var(--accent-soft-ink); }
.bdg.ok { background: var(--ok-soft); color: var(--ok); }
.bdg.warn { background: var(--warn-soft); color: var(--warn); }
.bdg.bad { background: var(--mark-soft); color: var(--mark); }
.bdg.ink { background: var(--ink-strong); color: var(--on-ink-strong); }

.fld { display: flex; flex-direction: column; gap: 4px; }
.fld > span { font-size: var(--t-small); font-weight: 700; }
.fld input, .fld select, .fld textarea {
  min-height: 42px; border-radius: var(--r-md); background: var(--surface); padding: 8px 11px;
  box-shadow: inset 0 0 0 1px var(--line); border: 0; font-size: var(--t-body); }
.fld textarea { min-height: 200px; line-height: 1.8; resize: vertical; font-family: var(--serif); }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: 0; box-shadow: inset 0 0 0 2px var(--accent); }
.num { width: 68px; text-align: right; }

.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line); }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 44px 20px; text-align: center; }
.empty b { font-size: var(--t-lead); }
.empty p { color: var(--muted); font-size: var(--t-small); max-width: 42ch; }

.tabs { display: inline-flex; gap: 4px; max-width: 100%; overflow-x: auto; background: var(--sunken); border-radius: var(--r-lg); padding: 4px; }
.tabs button { border-radius: var(--r-md); padding: 8px 14px; font-size: var(--t-small); font-weight: 700; color: var(--muted); white-space: nowrap; }
.tabs button[aria-selected='true'] { background: var(--surface); color: var(--ink); }

/* ===== 화면 1 — T07 문서에 주석 ==========================================
   지면이 무대. 주석은 우측 한 열에만 정렬한다(좌우 번갈아 금지).
   문서는 기울이지 않는다. 말풍선은 본문을 덮지 않는다. */
.doc-grid { display: grid; gap: 20px; align-items: start; }
@media (min-width: 1040px) { .doc-grid { grid-template-columns: minmax(0, 66fr) minmax(0, 34fr); gap: 28px; } }

.sheet { background: var(--surface); border-radius: var(--r-md); box-shadow: var(--sh-sheet); padding: 26px 24px; }
.sheet .body { font-family: var(--serif); font-size: var(--t-lead); line-height: 1.95; }
.ocr-block { padding: 10px 0; }
.ocr-role { display: inline-block; font-size: var(--t-micro); font-weight: 800; letter-spacing: .04em;
  color: var(--accent-soft-ink); background: var(--accent-soft); border-radius: var(--r-sm); padding: 2px 7px; margin-bottom: 4px; }
.ocr-role[data-r='그림'] { background: var(--sunken); color: var(--muted); }
.ocr-text { font-family: var(--serif); font-size: var(--t-body); line-height: 1.95; white-space: pre-line; }
/* 형광 하이라이트 — 좌→우로 칠해진다. 한 화면에 4개를 넘기지 않는다 */
.hl { position: relative; background-image: linear-gradient(var(--mark-soft), var(--mark-soft));
  background-repeat: no-repeat; background-size: 0 62%; background-position: 0 72%;
  animation: paint .45s ease-out forwards; }
@keyframes paint { to { background-size: 100% 62%; } }
.err { color: var(--mark); font-weight: 700; text-decoration: underline wavy var(--mark) 1px; text-underline-offset: 4px; }
.err:hover { background: var(--mark-soft); }
.fixed { color: var(--ok); font-weight: 700; }

.notes { display: flex; flex-direction: column; gap: 10px; }
.note { background: var(--surface); border-radius: var(--r-md); box-shadow: var(--sh-note); padding: 11px 13px; }
.note b { display: block; font-size: var(--t-small); }
.note p { font-size: var(--t-small); color: var(--muted); }

.drop { display: grid; place-items: center; gap: 10px; min-height: 260px; border-radius: var(--r-lg);
  background: var(--surface); box-shadow: inset 0 0 0 2px var(--line); text-align: center; padding: 24px; }
.drop.hot { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.kbd { font-family: var(--mono); font-size: var(--t-micro); background: var(--sunken); border-radius: var(--r-sm); padding: 2px 6px; }

.pcards { display: grid; gap: 14px; }
@media (min-width: 880px) { .pcards { grid-template-columns: 1fr 1fr; } }
.pcard { background: var(--surface); border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.pcard .ex { font-family: var(--serif); font-size: var(--t-small); color: var(--muted); line-height: 1.8;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }

/* ===== 화면 2 — T05 데이터가 주인공 =======================================
   풀블리드 데이터 평면 + 떠 있는 패널 하나. 데이터 마크에는 그림자를 넣지 않는다.
   간격은 데이터가 정한다(균등 배치 금지). 축과 라벨 없는 차트를 그리지 않는다. */
.stage { position: relative; background: var(--sunken); border-radius: var(--r-xl); padding: 18px; }
.plane { display: grid; gap: 16px; }
@media (min-width: 1100px) { .plane { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); align-items: start; } }

.dist { display: flex; align-items: flex-end; gap: 10px; height: 118px; padding-left: 26px; position: relative; }
.dist .axis { position: absolute; left: 0; top: 0; bottom: 18px; width: 24px; display: flex; flex-direction: column; justify-content: space-between; }
.dist .axis span { font-size: var(--t-micro); color: var(--faint); text-align: right; }
.dist .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; height: 100%; }
.dist .bar { width: 100%; border-radius: 2px 2px 0 0; background: var(--accent);
  transform-origin: 50% 100%; animation: grow .8s cubic-bezier(.22,1,.36,1) both; }
.dist .bar[data-zero='1'] { background: var(--line-strong); }
.dist .lab { font-size: var(--t-micro); color: var(--muted); }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* 판정 점 — 3회가 각각 무엇을 골랐는지. 일치는 채우고 어긋남은 테두리만 */
.dots { display: flex; gap: 5px; }
.dot { width: 13px; height: 13px; border-radius: 50%; display: grid; place-items: center;
  font-size: 9px; font-weight: 800; }
.dot.hit { background: var(--ok); color: var(--surface); }
.dot.miss { box-shadow: inset 0 0 0 2px var(--mark); color: var(--mark); }

.qlist { display: flex; flex-direction: column; gap: 12px; }
.q { background: var(--surface); border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.q.risk { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mark) 45%, var(--line)); }
.q-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; padding: 14px 16px; }
.q-no { font-family: var(--serif); font-size: var(--t-h3); line-height: 1; color: var(--accent); min-width: 28px; }
.q-stem { flex: 1 1 240px; font-family: var(--serif); font-size: var(--t-lead); line-height: 1.6; }
.q-ch { padding: 0 16px 14px 16px; display: flex; flex-direction: column; gap: 3px; }
.q-ch li { font-family: var(--serif); font-size: var(--t-small); color: var(--muted); line-height: 1.8; }
.q-ch li.ans { color: var(--ink); font-weight: 700; }
.safety { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--r-md); padding: 5px 9px; font-size: var(--t-micro); font-weight: 800; }
.safety.ok { background: var(--ok-soft); color: var(--ok); }
.safety.warn { background: var(--warn-soft); color: var(--warn); }
.safety.bad { background: var(--mark-soft); color: var(--mark); }

/* 떠 있는 패널 하나 — T05 의 패널 그림자 값 그대로 */
.panel { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-panel); padding: 14px 16px; margin: 0 16px 16px; }
.panel .grid3 { display: grid; gap: 10px; }
@media (min-width: 620px) { .panel .grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.vote { background: var(--sunken); border-radius: var(--r-md); padding: 9px 11px; }
.vote b { display: block; font-size: var(--t-h3); font-family: var(--serif); line-height: 1.2; }
.vote.hit b { color: var(--ok); }
.vote.miss b { color: var(--mark); }
.reasons { display: flex; flex-wrap: wrap; gap: 6px; }

/* ===== 화면 3 — T16 종이 물성 ============================================
   여백이 주인공(60%). 측광 그림자 하나, 확산광 금지. 리듬 없이 정적으로. */
.pick-grid { display: grid; gap: 24px; align-items: start; }
@media (min-width: 1040px) { .pick-grid { grid-template-columns: minmax(0, 38fr) minmax(0, 62fr); gap: 40px; } }
.pick { display: flex; flex-direction: column; gap: 8px; }
.pick li { display: flex; gap: 11px; align-items: flex-start; background: var(--surface);
  border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--line); padding: 11px 13px; }
.pick li.off { opacity: .5; }
.pick input[type='checkbox'] { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.pick .nm { font-family: var(--serif); font-size: var(--t-h3); line-height: 1; color: var(--accent); min-width: 26px; }
.pick li.off .nm { color: var(--faint); }

.paper-stack { display: flex; flex-direction: column; gap: 28px; padding: 8px 0 8px 8px; }
.paper { background: var(--surface); box-shadow: var(--sh-paper); aspect-ratio: 210 / 297; padding: 7% 7.5%;
  display: flex; flex-direction: column; gap: 10px; font-family: var(--serif);
  animation: seep 1.1s ease-in-out both; }
@keyframes seep { from { opacity: 0; clip-path: inset(100% 0 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
.paper .ph { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 9px; color: var(--muted); }
.paper .pt { font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.paper .pq { font-size: 9.5px; line-height: 1.75; }
.paper .pq b { font-weight: 700; }
.paper .pbody { font-size: 9px; line-height: 1.8; color: var(--muted); }
.paper .pf { margin-top: auto; display: flex; justify-content: space-between; font-size: 8px; color: var(--faint); }
.paper .box { background: var(--sunken); padding: 7px 9px; border-radius: 2px; font-size: 9px; line-height: 1.7; }

/* ===== 화면 4 — T20 수치 띠 ==============================================
   1겹. 그림자 없음. 세로 디바이더 1px. 지표 3~4개. 수치와 라벨의 크기 차를 크게. */
.band { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
@media (min-width: 760px) { .band { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.band .cell { padding: 14px 18px; position: relative; }
.band .cell + .cell::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 1px;
  background: var(--line); transform-origin: 50% 0; animation: drop .5s ease-out both; }
@keyframes drop { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.band .fig { font-size: var(--t-fig); font-weight: 800; letter-spacing: -.045em; line-height: 1; }
.band .unit { font-size: var(--t-micro); font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.band .src { font-size: var(--t-micro); color: var(--faint); }

.tbl-wrap { position: relative; width: 100%; min-width: 0; overflow-x: auto; border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line); }
table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: var(--t-small); }
caption { display: none; }
th { background: var(--sunken); text-align: left; font-weight: 800; padding: 10px 12px; white-space: nowrap; }
th.r, td.r { text-align: right; }
td { padding: 9px 12px; vertical-align: top; background: var(--surface); }
tr.alt td { background: color-mix(in srgb, var(--sunken) 48%, var(--surface)); }
tr.sel td { background: var(--accent-soft); }

.filters { display: grid; gap: 10px; }
@media (min-width: 680px) { .filters { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.tray { position: sticky; bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  background: var(--ink-strong); color: var(--on-ink-strong); border-radius: var(--r-lg); padding: 11px 15px; }
.tray .btn.pri { background: var(--surface); color: var(--ink); }

/* 등장 ------------------------------------------------------------------ */
.su { animation: up .9s cubic-bezier(.19,.84,.3,1) both; }
.su2 { animation-delay: .14s; }
.su3 { animation-delay: .28s; }
@keyframes up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.fade { animation: fade .9s ease-out both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .hl { background-size: 100% 62%; }
}
.panel.flat { box-shadow: none; background: var(--sunken); }
