/* 와이어프레임 스타일: 흑백 + 강조 노랑 하나, 손그림 느낌의 굵은 테두리 */
:root {
  --ink: #1b1b19;
  --paper: #fdfdfb;
  --panel: #ffffff;
  --muted: #6b6b64;
  --line: #1b1b19;
  --soft: #e9e9e3;
  --hl: #ffd84a;
  --radius: 6px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.6 "IBM Plex Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
}
h1, h2, .display { font-family: Gaegu, "IBM Plex Sans KR", cursive; font-weight: 700; margin: 0; }
h1 { font-size: 30px; }
h2 { font-size: 22px; }
button { font: inherit; color: inherit; }
a { color: inherit; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px 64px; }
.topbar {
  border-bottom: 2px solid var(--line); background: var(--panel);
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
}
.topbar .wrap { display: flex; align-items: center; gap: 20px; padding-block: 12px; flex-wrap: wrap; }
.brand { font-family: Gaegu, cursive; font-weight: 700; font-size: 24px; }
.nav { display: flex; gap: 14px; }
.nav a { padding: 4px 2px; text-decoration: none; }
.nav a.on { border-bottom: 3px solid var(--line); font-weight: 600; }
.spacer { flex: 1 1 auto; }
.meter { font-size: 13px; color: var(--muted); }

.box { border: 2px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.pad { padding: 20px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 20px; }
.cols { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 760px) { .cols { grid-template-columns: minmax(0, 1fr); } }

.btn {
  border: 2px solid var(--line); border-radius: var(--radius); background: var(--panel);
  padding: 10px 16px; min-height: 44px; cursor: pointer; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: #000; }
.btn.hl { background: var(--hl); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.wide { width: 100%; }

.ph { /* 이미지·영상 자리 */
  background: repeating-linear-gradient(45deg, #e6e6e0 0 10px, #f1f1ec 10px 20px);
  border: 2px solid var(--line); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px;
}
.tag { border: 2px solid var(--line); border-radius: 20px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.tag.pending { border-style: dashed; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.note { font-family: Gaegu, cursive; font-weight: 700; color: #1f4fd1; font-size: 16px; }
mark { background: var(--hl); padding: 0 .12em; }
.link { text-decoration: underline; background: none; border: 0; padding: 0; cursor: pointer; }

/* 복습 */
.review { max-width: 560px; margin: 0 auto; }
.progress { height: 10px; border: 2px solid var(--line); border-radius: 6px; overflow: hidden; }
.progress > div { height: 100%; background: var(--ink); }
.sentence { font-size: 22px; font-weight: 600; }
.prosody { font-size: 20px; line-height: 1.8; }
.prosody .stress { background: var(--hl); font-weight: 700; padding: 0 .1em; }
.prosody .link-sound { text-decoration: underline; text-underline-offset: 4px; }
.sec { border-top: 2px solid var(--line); padding-top: 12px; display: grid; gap: 6px; }
.sec .label { font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.chunk { display: grid; gap: 7px; }
.chunk-cognition { padding-top: 7px; border-top: 1px dashed #b5b5ae; line-height: 1.7; }
.examples { margin: 0; padding-left: 1.5em; display: grid; gap: 14px; }
.examples li { padding-left: 4px; }
.answers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.answers .btn { flex-direction: column; gap: 2px; padding: 8px 4px; }
.answers .btn span { font-size: 11px; font-weight: 400; color: var(--muted); }
.answers .btn.primary span { color: #cfcfc8; }

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px dashed #b5b5ae; vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 2px solid var(--line); }
.scroll { overflow-x: auto; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 20;
  background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: var(--radius); font-size: 14px;
}

.data-source { padding: 10px 12px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; overflow-wrap: anywhere; }
.field { width: 100%; min-width: 0; min-height: 44px; padding: 10px; border: 2px solid var(--line); border-radius: var(--radius); font: inherit; background: var(--panel); }
.card-row { display: flex; align-items: start; gap: 16px; }
.card-summary { flex: 1; min-width: 0; }
.stack, .grid > *, .row > * { min-width: 0; }
.sentence, .prosody, .card-summary, .sec, p { overflow-wrap: anywhere; }
.card-scene, .ph { max-width: 100%; }
audio { display: block; width: 100%; min-width: 0; max-width: 100%; }
.btn { text-decoration: none; text-align: center; overflow-wrap: anywhere; }
.toast { max-width: calc(100vw - 24px); width: max-content; }
:focus-visible { outline: 3px solid #1f4fd1; outline-offset: 3px; }
@media (max-width: 480px) {
  .wrap { padding-inline: 12px; }
  .topbar .wrap { gap: 10px; }
  .meter { flex-basis: 100%; overflow-wrap: anywhere; }
  .pad { padding: 14px; }
  .answers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .answers .btn { min-height: 56px; }
  .card-row { flex-direction: column; gap: 10px; }
  .sentence { font-size: 20px; }
  .row .btn { max-width: 100%; }
}
