* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-ko); font-size: var(--t-sm); line-height: 1.5; }
#app { max-width: 560px; margin: 0 auto; padding: 32px 20px 48px; min-height: 100vh; }
.en { font-family: var(--font-en); }

.home-head { margin: 8px 0 28px; }
.home-title { margin: 0; font-size: var(--t-lg); font-weight: 600; letter-spacing: -0.02em; color: var(--blue-dark); line-height: 1.25; }
.home-title .star { color: var(--terracotta); }
.home-sub { margin: 6px 0 0; color: var(--text-sub); font-size: var(--t-sm); }

.part-list { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }
.part-card { display: grid; grid-template-columns: 44px 1fr; gap: 4px 16px; align-items: center; min-height: var(--tap); padding: 18px 20px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); color: inherit; text-decoration: none; }
.part-card:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.part-num { grid-row: 1 / span 2; width: 44px; height: 44px; border-radius: 50%; background: var(--blue-light); color: var(--blue-dark); font-family: var(--font-en); font-weight: 500; font-size: var(--t-md); display: flex; align-items: center; justify-content: center; }
.part-name { font-size: var(--t-md); font-weight: 500; }
.bar { height: 8px; border-radius: var(--r-sm); background: var(--border); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--blue); border-radius: var(--r-sm); }
.bar.done > span { background: var(--mustard); }
.part-meta { color: var(--text-sub); font-size: var(--t-sm); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 0 24px; border-radius: var(--radius-btn); border: 0; background: var(--blue-dark); color: var(--white); font: inherit; font-weight: 500; text-decoration: none; }
.placeholder { text-align: center; padding: 64px 0; color: var(--text-sub); }
.placeholder h2 { color: var(--text); }
.part-prog { display: flex; flex-direction: column; gap: 4px; }
.part-meta { display: block; }
.bar { display: block; }

/* Part screens */
.part-head { margin: 0 0 12px; }
.back { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--blue-dark); text-decoration: none; font-weight: 500; }
.part-title { margin: 0; font-size: var(--t-md); color: var(--blue-dark); letter-spacing: -0.02em; }
.tabs { display: flex; gap: 4px; margin: 12px 0 16px; padding: 4px; background: var(--border); border-radius: var(--radius-btn); }
.tab { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; min-height: var(--tap); padding: 4px 6px; border-radius: var(--r-md); color: var(--text-sub); text-decoration: none; font-weight: 500; font-size: var(--t-sm); line-height: 1.25; word-break: keep-all; }
.tab.on { background: var(--card); color: var(--blue-dark); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.themes { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; scrollbar-width: none; }
.theme { flex: none; min-height: var(--tap); padding: 0 18px; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--card); color: var(--text); font: inherit; font-weight: 500; }
.theme.on { background: var(--blue-dark); border-color: var(--blue-dark); color: var(--white); }
.auto { display: grid; grid-template-columns: 28px 1fr; gap: 0 12px; align-items: center; min-height: var(--tap); margin: 4px 0 16px; padding: 8px 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-btn); }
.auto input { width: 24px; height: 24px; grid-row: 1 / span 2; accent-color: var(--blue-dark); }
.auto span { font-weight: 500; }
.auto small { color: var(--text-sub); font-size: var(--t-sm); }
.cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.card { position: relative; display: flex; flex-direction: column; align-items: center; width: 100%; padding: 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); font: inherit; color: inherit; cursor: pointer; }
.card img, .face img { width: 100%; max-width: 360px; height: auto; aspect-ratio: 1; border-radius: var(--r-md); background: var(--bg); }
.card-en { margin-top: 12px; font-size: var(--t-lg); font-weight: 500; color: var(--blue-dark); }
.card-en.big { font-size: var(--t-xl); }
.card-ko { font-size: var(--t-md); color: var(--text-sub); }
.pending { position: absolute; top: 12px; right: 12px; padding: 6px 12px; border-radius: var(--r-md); background: var(--blue-dark); color: var(--white); font-size: var(--t-sm); }
.pending[hidden] { display: none; }

.look-count { text-align: center; color: var(--text-sub); margin: 8px 0; }
.flip { display: block; width: 100%; padding: 0; border: 0; background: none; perspective: 1000px; font: inherit; color: inherit; cursor: pointer; }
.flip-in { position: relative; display: block; width: 100%; aspect-ratio: 1; transition: transform .5s; transform-style: preserve-3d; }
.flip.flipped .flip-in { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face.back { transform: rotateY(180deg); }
.face img { max-height: calc(100% - 32px); object-fit: contain; }
.hint { margin-top: 8px; color: var(--text-sub); }
.next { width: 100%; margin-top: 16px; }

.cu-intro { color: var(--text-sub); margin: 0 0 16px; }
.cu-menu { display: flex; flex-direction: column; gap: 12px; }
.menu-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 72px; padding: 14px 20px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); font: inherit; color: inherit; text-align: left; cursor: pointer; }
.menu-btn strong { font-size: var(--t-md); color: var(--blue-dark); }
.menu-btn span { color: var(--text-sub); }
.cu-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cu-count { color: var(--text-sub); white-space: nowrap; }
.cu-top .bar { flex: 1; }
.cu-img { padding: 12px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); }
.cu-img img { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: var(--r-md); }
.cu-prompt { font-size: var(--t-md); margin: 12px 0 0; }
.cu-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.cu-opt { min-height: var(--tap); padding: 8px 12px; background: var(--card); border: 2px solid var(--border); border-radius: var(--radius-btn); font-size: var(--t-md); color: var(--text); cursor: pointer; }
.cu-opt.right, .cu-input.right { border-color: var(--sage); background: var(--sage-light); }
.cu-opt.wrong, .cu-input.wrong { border-color: var(--terracotta); background: var(--terracotta-light); }
.cu-opt:disabled { color: var(--text); opacity: 1; cursor: default; }
.cu-write { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.cu-input { min-height: var(--tap); padding: 0 16px; border: 2px solid var(--border); border-radius: var(--radius-btn); background: var(--card); font-size: var(--t-md); color: var(--text); }
.cu-feedback { min-height: 28px; margin-top: 16px; font-size: var(--t-md); display: flex; flex-direction: column; gap: 2px; }
.cu-feedback.right { color: var(--sage-dark); font-weight: 500; }
.cu-feedback.wrong { color: var(--terracotta); }
.cu-feedback.wrong span { color: var(--text); }
.cu-feedback .mark { font-weight: 500; }
.cu-feedback.right { flex-direction: row; align-items: center; gap: 6px; }
.cu-next { width: 100%; margin-top: 12px; }
.cu-next[hidden] { display: none; }

.cu-result { text-align: center; padding: 24px 0; }
.stars { display: flex; justify-content: center; gap: 8px; font-size: var(--t-2xl); line-height: 1; }
.star { color: var(--border); }
.star.on { color: var(--mustard); }
.score { font-size: var(--t-2xl); font-weight: 600; color: var(--blue-dark); margin: 12px 0 4px; }
.cu-msg { color: var(--text-sub); margin: 0 0 24px; }
.cu-actions { display: flex; flex-direction: column; gap: 12px; }
.btn.ghost { background: var(--card); color: var(--blue-dark); border: 1px solid var(--border); }

.celebrate { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 10; }
.celebrate i { position: absolute; top: -20px; left: var(--x); width: 12px; height: 12px; border-radius: var(--r-sm); background: var(--c); animation: fall 1.4s var(--d) ease-in forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(360deg); opacity: .8; } }
@media (prefers-reduced-motion: reduce) {
  .flip-in { transition: none; }
  .celebrate { display: none; }
}

/* Part II fold */
.grp { display: flex; align-items: flex-start; gap: 10px; margin-top: 4px; }
.grp-tag { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--blue-light); color: var(--blue-dark); font-weight: 500; display: flex; align-items: center; justify-content: center; }
.grp-title { margin: 4px 0 0; font-size: var(--t-sm); line-height: 1.4; color: var(--text); }
.wcard { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 10px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); font: inherit; color: inherit; cursor: pointer; }
.wcard img { width: 100%; height: auto; aspect-ratio: 1; border-radius: var(--r-md); background: var(--bg); }
.wcard .card-en { font-size: var(--t-md); margin-top: 8px; overflow-wrap: anywhere; }
.wcard .card-ko { font-size: var(--t-sm); text-align: center; }
.wcard .pending { top: 6px; right: 6px; padding: 4px 8px; font-size: var(--t-sm); }
.grp-title { word-break: keep-all; }
.fold-actions { margin-top: 16px; }
.fold-btn { width: 100%; }
.fold-btn:disabled, .pager .btn:disabled { opacity: .5; }
.pager { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; margin-top: 12px; }

/* Part II write */
.wimgs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; gap: 10px; margin-top: 8px; }
.wimg { padding: 6px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); min-width: 0; }
.wimg img { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: var(--r-sm); }
.wform { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.wfield { display: flex; flex-direction: column; gap: 2px; }
.wlabel { color: var(--text-sub); font-size: var(--t-sm); }
.wform .cu-input { width: 100%; box-sizing: border-box; }

/* landscape phones: keep cards and the 접기 button on screen */
@media (orientation: landscape) and (max-height: 480px) {
  .part-head { display: flex; align-items: center; gap: 12px; margin: 0; }
  .part-title { font-size: var(--t-md); }
  .tabs { margin: 4px 0 6px; }
  .tab { min-height: var(--tap); }
  .look-count { display: none; }
  .grp { margin-top: 0; }
  .wcard { padding: 6px; }
  .wcard img { max-height: 15vh; width: auto; margin: 0 auto; }
  .wcard .card-en { font-size: var(--t-md); margin-top: 2px; }
  .fold-actions, .pager { display: inline-block; }
  .fold-actions { width: 38%; margin-top: 6px; vertical-align: top; }
  .pager { width: 60%; margin: 6px 0 0 1%; display: inline-grid; vertical-align: top; }
}

/* Part III roots */
.intro { margin: 0 0 12px; color: var(--text-sub); word-break: keep-all; }
.tree { display: grid; grid-template-columns: 1fr; justify-items: center; gap: 0; }
.root-node { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 132px; height: 132px; border-radius: 50%; border: 3px solid var(--blue); background: var(--blue-light); color: var(--blue-dark); font: inherit; cursor: pointer; }
.root-en { font-size: 32px; font-weight: 500; line-height: 1.1; }
.root-ko { font-size: 18px; }
.root-node .pending { top: -8px; right: -24px; }
.branches { position: relative; list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.branches::before { content: ""; position: absolute; left: 50%; top: -28px; width: 3px; height: 28px; margin-left: -1px; background: var(--blue); }
.branch { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; min-height: 72px; padding: 8px; background: var(--card); border: 2px solid var(--border); border-radius: var(--radius-btn); font: inherit; color: var(--text); cursor: pointer; }
.branch.on { border-color: var(--blue-dark); }
.b-word { font-size: var(--t-md); font-weight: 500; text-align: center; white-space: nowrap; }
.b-ko { font-size: var(--t-sm); color: var(--text-sub); }
.rt { color: var(--blue-dark); background: var(--blue-light); border-radius: var(--r-sm); padding: 0 3px; }
.ot { color: var(--text); }
.tree-hint { text-align: center; color: var(--text-sub); margin: 16px 0 0; }
.compound { margin-top: 16px; }
.cmp-card { width: 100%; flex-direction: row; align-items: center; gap: 16px; padding: 12px; text-align: left; }
.cmp-card img { width: 42%; flex: none; }
.cmp-text .card-ko { text-align: left; }
.cmp-text { align-items: flex-start; text-align: left; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cmp-en { font-size: var(--t-lg); font-weight: 500; overflow-wrap: anywhere; line-height: 1.2; }
.cmp-eq { color: var(--text-sub); font-size: var(--t-sm); }
.cmp-note { margin-top: 6px; padding: 6px 10px; background: var(--blue-light); border-radius: var(--r-sm); font-size: var(--t-sm); color: var(--blue-dark); }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.compound { animation: pop .25s ease-out; }

/* Part IV cards */
.info-card .card-note { margin-top: 4px; padding: 0 4px; text-align: center; color: var(--text); font-size: var(--t-sm); word-break: keep-all; }
@media (prefers-reduced-motion: reduce) { .compound { animation: none; } }

/* Part III / IV landscape phones */
@media (orientation: landscape) and (max-height: 480px) {
  .intro { display: none; }
  .tree { grid-template-columns: 120px 1fr; align-items: center; gap: 12px; }
  .root-node { width: 104px; height: 104px; }
  .root-en { font-size: 26px; }
  .branches { margin: 0; grid-template-columns: 1fr 1fr; gap: 8px; }
  .branches::before { display: none; }
  .branch { min-height: 56px; padding: 2px 4px; }
  .b-word { font-size: var(--t-md); }
  .compound { margin-top: 8px; }
  .cmp-card img { width: auto; max-height: 26vh; }
  .cmp-en { font-size: var(--t-md); }
  .cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .info-card { padding: 8px; }
  .info-card img { max-width: 120px; }
  .info-card .card-en { font-size: var(--t-md); margin-top: 4px; }
  .themes { margin-bottom: 4px; }
}

/* Part V dialogue */
.p5-top { display: block; }
.scene { margin: 4px 0 12px; padding: 8px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); }
.scene img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: var(--r-md); background: var(--bg); }
.listen { width: 100%; font-size: var(--t-md); }
.listen.playing { background: var(--blue-dark); color: var(--white); box-shadow: inset 0 0 0 3px var(--blue); }
.listen-note { margin: 8px 0 0; color: var(--text-sub); text-align: center; }
.listen-note[hidden] { display: none; }
.bubbles { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.bubble-row { display: flex; align-items: flex-end; gap: 8px; max-width: 100%; }
.bubble-row.right { flex-direction: row-reverse; }
.avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; font-family: var(--font-en); font-weight: 500; font-size: var(--t-md); color: var(--blue-dark); background: var(--blue-light); border: 2px solid var(--card); }
.av-sam { background: color-mix(in srgb, var(--terracotta-light) 80%, var(--card)); }
.av-emma { background: var(--sage-light); }
.av-brown { background: var(--blue-light); }
.bubble { min-width: 0; max-width: calc(100% - 52px); padding: 10px 14px; border-radius: var(--r-lg); border: 2px solid transparent; background: var(--card); display: flex; flex-direction: column; gap: 2px; }
.bubble-row.left .bubble { border-bottom-left-radius: 6px; }
.bubble-row.right .bubble { border-bottom-right-radius: 6px; }
.sp-sam { background: color-mix(in srgb, var(--terracotta-light) 55%, var(--card)); }
.sp-emma { background: var(--sage-light); }
.sp-brown { background: color-mix(in srgb, var(--blue-light) 55%, var(--card)); }
.bubble-row.on .bubble { border-color: var(--blue-dark); box-shadow: 0 2px 0 var(--blue-dark); }
.who { font-size: var(--t-sm); font-weight: 500; color: var(--text-sub); }
.b-en { font-size: var(--t-md); font-weight: 500; color: var(--blue-dark); overflow-wrap: anywhere; }
.b-ko { font-size: var(--t-sm); color: var(--text); word-break: keep-all; }
.p5-sub { margin: 24px 0 8px; font-size: var(--t-md); color: var(--blue-dark); }
.p5-hint { font-size: var(--t-sm); font-weight: 300; color: var(--text-sub); margin-left: 6px; }
.xps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.xp { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; }
.xp.open { border-color: var(--blue-dark); }
.xp-head { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: var(--tap); padding: 8px 14px; background: none; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.xp-head:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }
.xp-en { flex: 1; min-width: 0; font-size: var(--t-md); font-weight: 500; color: var(--blue-dark); overflow-wrap: anywhere; }
.xp-done { color: var(--sage); font-weight: 500; font-size: var(--t-md); }
.xp-done[hidden] { display: none; }
.xp-head .pending { top: 50%; right: 12px; transform: translateY(-50%); }
.xp-detail { padding: 0 16px 14px 16px; }
.xp-detail[hidden] { display: none; }
.xp-row { display: flex; gap: 12px; margin: 6px 0 0; align-items: baseline; }
.xp-tag { flex: none; min-width: 3.6em; color: var(--text-sub); font-size: var(--t-sm); }
.xp-val { min-width: 0; color: var(--text); word-break: keep-all; overflow-wrap: anywhere; }
.cu-prompt { font-weight: 500; color: var(--blue-dark); word-break: keep-all; }

@media (orientation: landscape) and (max-height: 480px) {
  .p5-top { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 12px; align-items: start; }
  .scene { margin: 0; padding: 6px; }
  .scene img { max-height: 36vh; width: 100%; object-fit: cover; }
  .p5-talk { min-width: 0; }
  .bubbles { margin-top: 8px; gap: 6px; }
  .bubble { padding: 6px 12px; }
  .avatar { width: 32px; height: 32px; font-size: var(--t-sm); }
  .xps { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: start; }
}

/* Part II fold: learn each word first, then fold */
.fold-steps { list-style: none; display: flex; justify-content: center; gap: 6px; padding: 0; margin: 10px 0 4px; }
.fold-steps li { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--border); color: var(--text-sub); font-size: var(--t-sm); }
.fold-steps .n { width: 22px; height: 22px; border-radius: 50%; background: var(--border); color: var(--text); font-size: var(--t-sm); font-weight: 500; display: inline-flex; align-items: center; justify-content: center; }
.fold-steps li.on { border-color: var(--blue); color: var(--blue-dark); font-weight: 500; }
.fold-steps li.on .n { background: var(--blue); color: var(--white); }
.fold-steps li.done .n { background: var(--sage-light); color: var(--sage-dark); }
.solo { display: flex; justify-content: center; margin-top: 8px; }
.solo-card { width: 100%; max-width: 340px; animation: grow .3s ease-out; }
.solo-card .card-en { font-size: var(--t-xl); }
.solo-hint { text-align: center; color: var(--text-sub); font-size: var(--t-sm); margin: 6px 0 0; }
@media (prefers-reduced-motion: reduce) { .solo-card { animation: none; } }
@media (orientation: landscape) and (max-height: 520px) {
  .fold-steps { margin: 4px 0; }
  .solo-card { max-width: 380px; flex-direction: row; gap: 16px; justify-content: center; flex-wrap: wrap; }
  .solo-card img { max-height: 40vh; width: auto; }
  .solo-hint { display: none; }
}

/* ===== 2026-11-26 design refresh: Paperlogy + Gowun Batang, book-style flow ===== */
body { font-weight: 400; letter-spacing: -0.01em; }
.card-ko, .pc-line, .home-sub, .solo-hint, .grp-title, .wcard .card-ko, .hint, .cu-intro, .intro { font-family: var(--font-serif); letter-spacing: 0; }
.card-en, .part-title, .home-title, .btn, .tab, .theme { font-family: var(--font-ko); }
.card-en { font-weight: 500; letter-spacing: -0.01em; }

/* Home */
.hero { position: relative; margin: -8px 0 8px; text-align: center; }
.hero-kicker, .pc-kicker, .part-kicker { margin: 0; font-size: var(--t-xs); font-weight: 500; letter-spacing: .14em; color: var(--blue); }
.home-title { margin: 6px 0 0; font-size: var(--t-2xl); font-weight: 600; line-height: 1.08; letter-spacing: -0.03em; color: var(--blue-dark); }
.home-title .star { color: var(--terracotta); font-size: .8em; vertical-align: .08em; margin: 0 .04em; }
.home-sub { margin: 12px 0 0; font-size: var(--t-sm); color: var(--text-sub); }
.hero-img { display: block; width: calc(100% + 40px); max-width: none; height: auto; margin: 4px -20px 0; }
.hero-cta { position: relative; margin-top: -8px; width: 100%; box-shadow: var(--shadow); }
.btn-big { min-height: 60px; border-radius: var(--r-lg); font-size: var(--t-md); font-weight: 500; }
.list-head { margin: 36px 0 14px; font-size: var(--t-sm); font-weight: 500; letter-spacing: .08em; color: var(--text-sub); }
.part-list { gap: 12px; }
.part-card { grid-template-columns: 92px 1fr; gap: 0 16px; padding: 14px 18px 14px 14px; border: 0; background: var(--card); box-shadow: var(--shadow); align-items: center; }
.pc-thumb { width: 92px; height: 92px; border-radius: var(--r-md); background: var(--bg); overflow: hidden; display: block; }
.pc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.part-name { font-size: var(--t-md); font-weight: 500; color: var(--text); }
.pc-line { font-size: var(--t-sm); color: var(--text-sub); line-height: 1.4; }
.part-card .part-prog { flex-direction: row; align-items: center; gap: 10px; margin-top: 6px; }
.part-card .bar { flex: 1; height: 6px; }
.part-card .bar > span { background: var(--sage); }
.part-card .part-meta { font-size: var(--t-xs); font-weight: 500; color: var(--text-sub); }

/* Part header + ordered steps (replaces tabs) */
.part-kicker { margin-top: 4px; }
.part-title { font-size: var(--t-lg); font-weight: 600; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 6px; margin: 14px 0 18px; padding: 0; counter-reset: s; }
.steps { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.step > a, .step > span { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 0 0; border-top: 4px solid var(--border); color: var(--text-sub); text-decoration: none; min-height: var(--tap); }
.step.done > a { border-color: var(--sage); color: var(--sage-dark); }
.step.on > span { border-color: var(--blue-dark); color: var(--blue-dark); }
.step-n { font-size: var(--t-xs); font-weight: 500; letter-spacing: .04em; }
.step-l { font-size: var(--t-sm); font-weight: 500; line-height: 1.2; word-break: keep-all; }

/* Cards: lighter frame so pictures lead */
.wcard, .card, .face { border: 0; box-shadow: var(--shadow); }
.fold-steps li { box-shadow: none; }
.hero-img { -webkit-mask-image: radial-gradient(ellipse 62% 60% at 50% 52%, var(--text) 70%, transparent 100%); mask-image: radial-gradient(ellipse 62% 60% at 50% 52%, var(--text) 70%, transparent 100%); }

/* Parts 1-3 in book order: theme badge, step guide, listen button */
.theme-badge { margin: 4px 0 4px; font-size: var(--t-sm); font-weight: 500; color: var(--blue-dark); }
.unit-guide { margin: 0 0 12px; font-family: var(--font-serif); color: var(--text-sub); word-break: keep-all; }
.cu-listen { margin-top: 12px; width: 100%; }
.cards + .pager { margin-top: 20px; }
.pager .next { min-height: 56px; font-size: var(--t-md); }
.wgrid, .cmp-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 12px; }
.wgrid { grid-template-columns: 1fr 1fr; }
.wgrid .wcard, .cmp-list .wcard { width: 100%; }
.cmp-list .cmp-card { width: 100%; }
.repeat-prompt { margin: 10px 0; padding: 10px 16px; border-radius: var(--radius-btn); background: var(--blue-light); color: var(--blue-dark); font-weight: 500; text-align: center; }
.repeat-prompt[hidden] { display: none; }

/* Part II as in the book (pp.18-20): left page of first words + a half-width flap hinged at the spine */
.sp { container-type: inline-size; --rh: 62px; --pic: 50px; --wc: 27fr; --zn: 36.5fr; position: relative; display: grid; grid-template-columns: var(--wc) var(--zn) var(--zn); perspective: 1600px; margin-top: 8px; max-width: 720px; margin-inline: auto; }
.sp-left { grid-column: 1 / 3; grid-row: 1; background: var(--card); border-radius: var(--radius-card) 0 0 var(--radius-card); box-shadow: var(--shadow); padding: 4px 0; }
.sp-row { display: grid; align-items: center; height: var(--rh); border-bottom: 1px dashed var(--border); box-sizing: border-box; transition: background .2s; }
.sp-row:last-child { border-bottom: 0; }
.sp.speaking .sp-row { opacity: .55; transition: opacity .2s; }
.sp.speaking .sp-row.lit { opacity: 1; }
.sp-lrow { grid-template-columns: var(--wc) var(--zn); }
.sp-zone { display: grid; grid-template-columns: minmax(0, 1fr) var(--pic); align-items: center; gap: 4px; padding-right: 6px; height: 100%; }
.sp-zone img, .sp-frow img, .sp-brow img { width: var(--pic); height: var(--pic); object-fit: contain; border-radius: 8px; justify-self: end; }
.sp-lw .sp-k, .sp-mirror .sp-lw .sp-w { opacity: var(--ko, 1); transition: opacity .2s; }
.sp-lw { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; text-align: right; padding: 0 0 0 4px; min-width: 0; }
.sp-tx { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; text-align: left; min-width: 0; padding: 0; }
.sp-w { font-size: clamp(15px, 4.4vw, 22px); font-weight: 500; color: var(--blue-dark); line-height: 24px; white-space: nowrap; letter-spacing: -0.01em; }
.sp-gap { margin-left: .3em; }
/* group B: the flap's back carries the whole compound and reaches over the left page's word column */
.sp-mirror .sp-brow .sp-tx { margin-left: -27cqw; padding-left: 10px; }
.sp-lw .sp-k, .sp-front .sp-k, .sp-back .sp-k { white-space: normal; line-height: 1.4; word-break: keep-all; }
.sp-k { font-family: var(--font-serif); font-size: 12px; color: var(--text-sub); line-height: 1.4; white-space: nowrap; }
.sp-cast { grid-column: 2; grid-row: 1; background: linear-gradient(270deg, var(--text) 0%, transparent 80%); opacity: 0; pointer-events: none; z-index: 1; }
.sp-flap { grid-column: 3; grid-row: 1; position: relative; transform-origin: 0 50%; transform-style: preserve-3d; z-index: 2; }
.sp-front, .sp-back { position: absolute; inset: 0; box-sizing: border-box; padding: 4px 6px 4px 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--card); }
.sp-front { border-radius: 0 var(--radius-card) var(--radius-card) 0; box-shadow: var(--shadow); padding-left: 8px; }
.sp-back { transform: rotateY(180deg); }
.sp-front .sp-row, .sp-back .sp-row { grid-template-columns: minmax(0, 1fr) var(--pic); gap: 4px; }
.sp-flap { min-height: calc(var(--rh) * var(--n) + 8px); }
.sp-shade { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, var(--text) 0%, transparent 70%); opacity: 0; pointer-events: none; }
.sp-ctl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.sp-ctl .btn:disabled { opacity: .5; }
.pager.one { grid-template-columns: 1fr; }
@media (min-width: 900px) { #app:has(.sp), #app:has(.wr-list) { max-width: 1040px; } .sp { --rh: 84px; --pic: 70px; } .sp-w { font-size: var(--t-lg); } .sp-k { font-size: var(--t-sm); } }
@media (max-width: 360px) { .sp { --pic: 44px; } }

/* Group B (book pp.22-24): die-cut windows. Left page = second words; flap = first words + window onto the compound picture.
   Shared geometry: the flap's hole and the left page's second-word box are the same box (--hole-*), mirrored about the spine. */
.spb { --pic: 40px; --hole-top: 6px; --hole-bot: 17px; --hole-ix: 3px; --hole-h: calc(var(--rh) - var(--hole-top) - var(--hole-bot)); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.spb .sp-left { grid-column: 1; padding: 0; border-radius: var(--radius-card) 0 0 var(--radius-card); }
.spb .sp-cast { grid-column: 1; background: linear-gradient(270deg, var(--text) 0%, transparent 80%); }
.spb .sp-flap { grid-column: 2; min-height: calc(var(--rh) * var(--n)); }
.spb-under { grid-column: 2; grid-row: 1; background: var(--card); border-radius: 0 var(--radius-card) var(--radius-card) 0; z-index: 0; }
.spb .spb-lrow, .spb .spb-brow { grid-template-columns: minmax(0, 40fr) minmax(0, 34fr) minmax(0, 26fr); }
.spb .spb-frow, .spb .spb-urow { grid-template-columns: minmax(0, 26fr) minmax(0, 34fr) minmax(0, 40fr); }
.spb .sp-w { font-size: clamp(16px, 4.4vw, 22px); line-height: 1.1; white-space: nowrap; letter-spacing: -0.02em; }
.spb .sp-k { font-size: 12px; line-height: 1.4; }
.spb .sp-row { overflow: visible; align-items: start; gap: 0; border-bottom: 0; position: relative; }
.spb .sp-row::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; border-bottom: 1px dashed var(--border); pointer-events: none; z-index: 1; }
.spb .sp-row:last-child::after { display: none; }
.spb-lrow, .spb-brow { position: relative; }
.spb-lw { margin: var(--hole-top) var(--hole-ix) 0; height: var(--hole-h); display: flex; align-items: center; justify-content: center; box-sizing: border-box; min-width: 0; }
.spb-lko { position: absolute; left: calc(40% + var(--hole-ix)); top: calc(var(--rh) - var(--hole-bot)); white-space: nowrap; }
.spb-pic { display: grid; place-items: center; height: 100%; }
.spb-pic img { width: var(--pic); height: var(--pic); object-fit: contain; border-radius: 8px; }
.spb-under .spb-pic { padding-top: var(--hole-top); height: calc(var(--rh) - var(--hole-bot)); box-sizing: border-box; }
.spb-under .spb-pic img { transition: opacity .3s; }
.spb[data-turned="1"] .spb-under .spb-pic img { opacity: 0; }
.spb .sp-front, .spb .sp-back { padding: 0; background: transparent; }
.spb .sp-front { border-radius: 0 var(--radius-card) var(--radius-card) 0; }
.spb-cell { background: var(--card); height: 100%; box-sizing: border-box; min-width: 0; }
.spb-tx { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding-left: 3px; }
.spb-btx { display: flex; align-items: center; justify-content: flex-end; padding: var(--hole-top) 4px calc(var(--rh) - var(--hole-top) - var(--hole-h)) 0; }
.spb-bko { position: absolute; left: 0; width: calc(74% - var(--hole-ix)); top: calc(var(--rh) - var(--hole-bot)); height: var(--hole-bot); box-sizing: border-box; text-align: right; background: var(--card); font-family: var(--font-serif); font-size: 12px; line-height: 17px; color: var(--text-sub); white-space: nowrap; overflow: hidden; padding-right: 4px; }
/* the die-cut: paper with a rectangular hole (mask), plus an inset edge; hole box = inset (hole-top, hole-ix, hole-bot) */
.win { position: relative; display: block; height: 100%; }
.win-paper { position: absolute; inset: 0; background: var(--card); padding: var(--hole-top) var(--hole-ix) var(--hole-bot); -webkit-mask: linear-gradient(var(--text) 0 0) content-box, linear-gradient(var(--text) 0 0); -webkit-mask-composite: xor; mask: linear-gradient(var(--text) 0 0) content-box exclude, linear-gradient(var(--text) 0 0); }
.win-edge { position: absolute; inset: var(--hole-top) var(--hole-ix) var(--hole-bot); border-radius: 6px; box-shadow: inset 0 3px 6px var(--border), inset 0 0 0 1px var(--border); pointer-events: none; }
.win.over .win-edge { box-shadow: inset 0 0 0 3px var(--blue); }
.win.right .win-edge { box-shadow: inset 0 0 0 2px var(--sage); }
.spwrap { min-width: 0; }
@media (min-width: 900px) { .spb { --pic: 52px; } .spb .sp-w { font-size: var(--t-md); } .spb .sp-k, .spb-bko { font-size: var(--t-xs); } }

/* 빈칸 채우기: result rows with empty picture slots */
.wlayout { margin-top: 8px; }
.fl-page { --pic: 56px; background: var(--card); border-radius: var(--radius-card); box-shadow: var(--shadow); padding: 4px 14px; }
.fl-row { display: grid; grid-template-columns: minmax(0, 1fr) var(--pic); align-items: center; gap: 12px; height: 70px; border-bottom: 1px dashed var(--border); }
.fl-row:last-child { border-bottom: 0; }
.fl-row .sp-w { font-size: clamp(18px, 5.4vw, 26px); }
.fl-slot { position: relative; width: var(--pic); height: var(--pic); border-radius: 12px; background: var(--bg); box-shadow: inset 0 2px 5px var(--border); display: grid; place-items: center; overflow: hidden; }
.fl-slot.over { outline: 3px dashed var(--blue); outline-offset: 2px; }
.fl-slot img { width: 100%; height: 100%; object-fit: contain; }
.fl-slot.right { box-shadow: inset 0 0 0 3px var(--sage); }
.hq { font-size: 24px; font-weight: 500; color: var(--border); }
.hcheck { position: absolute; top: 1px; right: 4px; color: var(--sage-dark); font-weight: 500; font-size: 18px; }
@media (min-width: 900px) { .fl-page { --pic: 72px; } .fl-row { height: 88px; } }
/* picture tray: bottom bar on phones, sticky right column on PC */
.tray { display: flex; gap: 8px; overflow-x: auto; position: sticky; bottom: 0; z-index: 5; margin: 14px -20px 0; padding: 10px 20px calc(10px + env(safe-area-inset-bottom)); background: var(--bg); box-shadow: 0 -6px 14px var(--border); scrollbar-width: none; }
.tray::-webkit-scrollbar { display: none; }
.chip { position: relative; flex: none; width: 84px; aspect-ratio: 1; border: 0; padding: 6px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); overflow: hidden; touch-action: pan-x; cursor: grab; }
.chip img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.chip.picked { outline: 3px solid var(--blue); }
.chip.used { display: none; }
.chip.dragging { position: fixed; z-index: 10; width: 84px; pointer-events: none; transform: rotate(-4deg); box-shadow: 0 12px 30px var(--border); }
.chip.bounce { animation: chip-shake .4s; }
@keyframes chip-shake { 0%, 100% { transform: none; } 30% { transform: translateX(-8px) rotate(-3deg); } 60% { transform: translateX(8px) rotate(3deg); } }
.wdone { margin: 12px 0 0; min-height: 28px; font-weight: 500; color: var(--sage-dark); }
@media (min-width: 900px) {
  #app:has(.wlayout) { max-width: 1040px; }
  .wlayout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
  .tray { position: sticky; top: 16px; bottom: auto; margin: 0; padding: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; border-radius: var(--radius-card); box-shadow: var(--shadow); background: var(--card); }
  .chip { width: auto; }
}
@media (prefers-reduced-motion: reduce) { .chip.bounce { animation: none; } }
.grp-line { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 2px; }
.grp-line .look-count { margin: 0; }
/* phones: compact part header and step bar */
@media (max-width: 600px) {
  #app { padding: 10px 16px 24px; }
  .part-head { display: flex; align-items: baseline; gap: 12px; margin: 0; }
  .part-head .part-kicker { display: none; }
  .back { min-height: 32px; font-size: var(--t-sm); }
  .part-title { font-size: var(--t-md); }
  .steps { margin: 6px 0 8px; gap: 4px; }
  .step > a, .step > span { padding-top: 4px; gap: 0; min-height: 0; }
  .step-n { font-size: var(--t-xs); }
  .step-l { font-size: var(--t-xs); }
  .pager { margin-top: 8px; }
  .tray { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
}

/* now speaking: the word gets a highlighter band + gentle scale, its picture a thin ring; the other rows dim */
.sp-w[data-say] { cursor: pointer; }
.sp-w { position: relative; isolation: isolate; transition: transform .2s, color .2s; }
.sp-w.speak { color: var(--blue-dark); transform: scale(1.06); }
.sp-w.speak::before { content: ""; position: absolute; inset: -2px -6px; background: var(--blue-light); border-radius: 8px; z-index: -1; }
img.speak-pic { box-shadow: 0 0 0 2px var(--blue); }
.sp-bubble { position: absolute; right: 4px; z-index: 6; padding: 2px 10px; border-radius: 999px; background: var(--blue-dark); color: var(--white); font-size: 12px; font-weight: 500; line-height: 18px; pointer-events: none; white-space: nowrap; }
.sp-bubble[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .sp-w.speak { transform: none; } }

.sp-stage { overflow-x: clip; overflow-y: visible; }

/* 써 봅시다: six rows in book order, each [first picture] [second picture] [compound picture] with a blank under each */
.wr-list { display: flex; flex-direction: column; margin-top: 8px; background: var(--card); border-radius: var(--radius-card); box-shadow: var(--shadow); padding: 4px 12px 12px; }
.wr-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr); gap: 8px; padding: 10px 0; border-bottom: 1px dashed var(--border); transition: opacity .2s; }
.wr-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; border-radius: 10px; transition: transform .2s; }
.wr-cell img { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; background: var(--bg); }
.wr-cell .cu-input { width: 100%; box-sizing: border-box; min-height: 40px; padding: 4px 6px; font-size: 16px; text-align: center; }
.wr-ans { grid-column: 1 / -1; margin: 0; font-size: 14px; color: var(--text-sub); }
.wr-ans[hidden] { display: none; }
.wr-check { margin-top: 12px; }
.wr-list.speaking .wr-row { opacity: .55; }
.wr-list.speaking .wr-row.lit { opacity: 1; }
.wr-cell.speak { transform: scale(1.06); }
.wr-cell.speak img { box-shadow: 0 0 0 2px var(--blue); }
.wr-cell.speak .cu-input { background: var(--blue-light); color: var(--blue-dark); }
.wr-row .sp-bubble { right: 4px; top: 0; }
@media (prefers-reduced-motion: reduce) { .wr-cell.speak { transform: none; } }
@media (min-width: 900px) { .wr-cell img { width: 64px; height: 64px; } }

.sp-k { white-space: normal; overflow-wrap: anywhere; }
.spb-lko, .spb-bko { white-space: nowrap; }
/* underline inputs: each picture has its own underline directly beneath it */
.wr-cell .cu-input { border: 0; border-bottom: 2px solid var(--border); border-radius: 0; background: transparent; box-shadow: none; font-family: var(--font-ko); font-size: 16px; font-weight: 500; color: var(--blue-dark); }
.wr-cell .cu-input:focus { outline: 0; border-bottom-color: var(--blue); }
.wr-cell .cu-input.right { border-bottom-color: var(--sage); background: transparent; }
.wr-cell .cu-input.wrong { border-bottom-color: var(--terracotta); background: transparent; }
.wr-cell.speak .cu-input { background: var(--blue-light); }
@media (max-width: 340px) {
  .spb .spb-lrow, .spb .spb-brow { grid-template-columns: minmax(0, 43fr) minmax(0, 32fr) minmax(0, 25fr); }
  .spb .spb-frow, .spb .spb-urow { grid-template-columns: minmax(0, 25fr) minmax(0, 32fr) minmax(0, 43fr); }
  .spb-lko { left: calc(43% + var(--hole-ix)); }
  .spb-bko { width: calc(75% - var(--hole-ix)); }
  .spb { --pic: 34px; }
}

/* 보고 쓰기: the model words are printed above the blanks, in the same type as the spread */
.wr-model { font-family: var(--font-ko); font-weight: 500; font-size: clamp(15px, 4vw, 18px); line-height: 1.2; color: var(--blue-dark); white-space: nowrap; letter-spacing: -0.01em; }
.wr-ko { font-family: var(--font-serif); font-size: 12px; line-height: 1.5; color: var(--text-sub); min-height: 18px; white-space: nowrap; }
.wr-list.hide-model .wr-model, .wr-list.hide-model .wr-ko { visibility: hidden; }
.wr-hide { margin-top: 8px; min-height: 40px; }

/* ===== design pass 2026-11-26: printed picture book, not a glossy app ===== */
body { word-break: keep-all; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .27 0 0 0 0 .18 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.07'/%3E%3C/svg%3E"); }
h1, h2, .part-title, .home-title, .part-name { text-wrap: balance; }
.part-kicker, .hero-kicker, .pc-kicker { color: var(--blue-dark); }
/* cards: no beige outline, one warm lift; pictures sit directly on the card (no frame inside a frame) */
.card, .part-card, .cu-img, .cu-opt, .wcard, .info-card { border: 0; box-shadow: var(--lift); }
.card img, .face img, .cu-img img, .pc-thumb, .wcard img { background: none; }
.cu-img { padding: var(--s-3); }
.cu-img img { border-radius: var(--r-sm); }
/* buttons: heavier, with a 2px pressed edge like a book spine; disabled has its own look (no see-through) */
.btn { font-weight: 500; transition: transform var(--dur-1) var(--ease), background var(--dur-1) var(--ease); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.ghost { color: var(--blue-dark); }
.btn:disabled, .btn[disabled], .fold-btn:disabled, .pager .btn:disabled, .sp-ctl .btn:disabled, .replay:disabled { opacity: 1; background: var(--border); color: var(--text-sub); border-color: var(--border); cursor: default; box-shadow: none; }
.cu-opt { font-weight: 500; font-size: var(--t-md); }
/* step bar: two colours (done + current = navy, ahead = beige), the current one carries a dot, every step numbered */
.step.done > a { border-color: var(--blue-dark); color: var(--blue-dark); }
.step.on > span { border-color: var(--blue-dark); color: var(--blue-dark); }
.step.ahead > span { border-color: var(--border); }
.step.on .step-n::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--blue-dark); vertical-align: middle; }
/* English words large and confident, Korean meanings quieter */
.card-en { font-size: clamp(30px, 8vw, var(--t-xl)); }
.card-ko { font-size: var(--t-sm); }
/* book spread: gutter shadow on both sides of the fold */
.sp-left { box-shadow: var(--lift), inset -14px 0 14px -14px var(--border); }
.sp-front { box-shadow: var(--lift), inset 14px 0 14px -14px var(--border); }
@media (max-width: 600px) { .hero-img { width: calc(100% + 32px); margin-left: -16px; margin-right: -16px; } }

.pager .btn.ghost:disabled { visibility: hidden; }
/* Part 3: the root word is a card with its own picture, not an empty circle */
.root-node.root-card { width: min(100%, 300px); height: auto; border-radius: var(--r-lg); border: 0; background: var(--card); box-shadow: var(--lift); padding: var(--s-4); color: var(--blue-dark); }
.root-card img { width: min(100%, 200px); height: auto; aspect-ratio: 1; object-fit: contain; }
.root-card .root-en { font-size: var(--t-xl); margin-top: var(--s-2); }
.root-card .root-ko { font-size: var(--t-sm); color: var(--text-sub); }
/* Part 2 pages share one width so the header never jumps between steps (content stays narrow and centred) */
@media (min-width: 900px) { .part-body:has(.wr-list) { max-width: 720px; margin-inline: auto; } }

/* Part tags: fixed left rail on PC, sticky chip strip on phones */
#partnav ul { list-style: none; margin: 0; padding: 0; display: flex; }
.pn { display: flex; align-items: center; gap: var(--s-2); text-decoration: none; color: var(--blue-dark); font-family: var(--font-ko); transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease); }
.pn img { width: 32px; height: 32px; object-fit: contain; flex: none; }
.pn-home { width: 32px; height: 32px; padding: 4px; box-sizing: border-box; flex: none; }
.pn-full { display: flex; flex-direction: column; min-width: 0; }
.pn-full b { font-size: var(--t-xs); font-weight: 500; letter-spacing: .04em; }
.pn-t { font-size: var(--t-sm); font-weight: 500; line-height: 1.4; word-break: keep-all; }
.pn-short { display: none; font-weight: 500; }
.pn:hover { background: var(--blue-light); }
.pn[aria-current="page"] { background: var(--blue-dark); color: var(--card); }
.pn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
@media (min-width: 900px) {
  :root { --rail-w: 168px; }
  body { padding-left: var(--rail-w); }
  #partnav { position: fixed; left: 0; top: 0; bottom: 0; width: var(--rail-w); box-sizing: border-box; padding: var(--s-6) var(--s-3); background: var(--card); box-shadow: var(--lift); overflow-y: auto; z-index: 30; }
  #partnav ul { flex-direction: column; gap: var(--s-2); }
  .pn { padding: var(--s-2) var(--s-3); border-radius: var(--r-md); }
  .pn-short { display: none; }
}
@media (max-width: 899px) {
  :root { --nav-h: 44px; }
  #partnav { position: sticky; top: 0; z-index: 30; height: var(--nav-h); box-sizing: border-box; padding: var(--s-1) var(--s-4); background: var(--bg); box-shadow: 0 1px 0 var(--border); overflow-x: auto; scrollbar-width: none; }
  #partnav::-webkit-scrollbar { display: none; }
  #partnav ul { gap: var(--s-2); width: max-content; }
  .pn { min-height: 36px; padding: 0 var(--s-3); border-radius: 999px; background: var(--card); }
  .pn img, .pn-home, .pn-full { display: none; }
  .pn-short { display: inline; font-size: var(--t-sm); }
  #app { min-height: calc(100vh - var(--nav-h)); }
}

/* compound highlight: colour + one band built from two halves that meet at the join (no scale, no gap, nothing clipped) */
.sp-w.speak.join-l, .sp-w.speak.join-r { transform: none; }
.sp-w.speak.join-l::before { inset: -2px 0 -2px -6px; border-radius: var(--r-sm) 0 0 var(--r-sm); }
.sp-w.speak.join-r::before { inset: -2px -6px -2px 0; border-radius: 0 var(--r-sm) var(--r-sm) 0; }
/* the Korean keeps real air under the English word (descenders g/p/y) and never moves when a row lights up */
.sp-w { line-height: 1.2; }
.sp-lw .sp-k, .sp-tx .sp-k { margin-top: 6px; }
.spb .sp-w { line-height: 1.1; }
.spb-tx .sp-k { margin-top: 6px; }

/* Korean is never cropped: full line-height, no clip; rows are sized for a two-line meaning */
.sp { --rh: 72px; }
.spb { --rh: 82px; --hole-bot: 36px; }
@media (min-width: 900px) { .sp { --rh: 84px; } .spb { --rh: 96px; } }
.spb-lko { white-space: normal; width: 50%; line-height: 1.4; word-break: keep-all; }
.spb-bko { white-space: normal; overflow: visible; display: flex; align-items: flex-start; justify-content: flex-end; line-height: 1.4; word-break: keep-all; }
.sp-stage { padding-inline: 10px; margin-inline: -10px; }
/* speaking picture: enlarges (transform only, no layout shift), lifted above its neighbours, ring kept */
.sp-zone img, .sp-frow img, .sp-brow img, .spb-pic img, .card img, .cmp-card img, .wr-cell img { position: relative; transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease); }
img.speak-pic { transform: scale(1.35); z-index: 4; box-shadow: var(--lift), 0 0 0 2px var(--blue); }
.wr-cell.speak { transform: none; }
.wr-cell.speak img { transform: scale(1.35); z-index: 4; box-shadow: var(--lift), 0 0 0 2px var(--blue); }
@media (prefers-reduced-motion: reduce) { img.speak-pic, .wr-cell.speak img { transform: none; } }

.sp-w.speak { transform: none; }
.step-l { line-height: 1.4; }

.home-title { line-height: 1.2; }
.wr-ko { white-space: normal; word-break: keep-all; }

/* books 2-4: book cards, rail book tag, set situation box */
.book-card { display: grid; grid-template-columns: 76px 1fr 44px; align-items: center; gap: var(--s-3); padding: var(--s-4); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--lift); text-decoration: none; color: inherit; }
.bk-n { display: grid; place-items: center; width: 76px; height: 76px; border-radius: var(--r-md); background: var(--blue-light); color: var(--blue-dark); font-size: var(--t-xl); font-weight: 600; line-height: 1; }
.bk-n small { font-size: var(--t-xs); font-weight: 500; }
.bk-text { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; }
.p5-situation { margin: var(--s-2) 0 var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--card); box-shadow: var(--lift); color: var(--text-sub); font-family: var(--font-serif); line-height: 1.6; }
.pn-book { margin-bottom: var(--s-2); }
.pn[hidden] { display: none; }
.card-note { margin-top: var(--s-1); font-size: var(--t-xs); color: var(--text-sub); font-family: var(--font-serif); line-height: 1.5; }
/* group B with a long word: column widths come from the data (--c1/--c2/--c3); hole and word box stay one geometry */
.spb.spb-wide { --pic: 34px; }
.spb.spb-wide .spb-lrow, .spb.spb-wide .spb-brow { grid-template-columns: minmax(0, var(--c1)) minmax(0, var(--c2)) minmax(0, var(--c3)); }
.spb.spb-wide .spb-frow, .spb.spb-wide .spb-urow { grid-template-columns: minmax(0, var(--c3)) minmax(0, var(--c2)) minmax(0, var(--c1)); }
.spb.spb-wide .spb-lko { left: calc(var(--p1) + var(--hole-ix)); }
.spb.spb-wide .spb-bko { width: calc(var(--p12) - var(--hole-ix)); }
@media (min-width: 900px) { .spb.spb-wide { --pic: 52px; } }
.pn-book .pn-home { display: none; }

/* group A: the English word of each half sits at a fixed height, so a two-line Korean meaning never lifts one half */
.sp-lrow, .sp-frow, .sp-brow { align-items: start; }
.sp-lw, .sp-tx { justify-content: flex-start; padding-top: 10px; }
.sp-zone .sp-tx { padding-top: 0; }
.sp-zone, .sp-frow > img, .sp-brow > img { align-self: center; }
.sp { --rh: 80px; }
.sp-lw, .sp-tx { padding-top: 8px; }
@media (min-width: 900px) { .sp { --rh: 88px; } }
@media (max-width: 340px) { .sp:not(.spb) { --rh: 96px; } }

/* Group B, one pair per screen: same geometry (shared --hole-* vars), columns follow the pair's words, sizes follow the
   spread's own width (container units) so the die-cut hole stays square and nothing gets huge on PC */
.sp.sp-one.spb { --hole-top: 10px; --hole-bot: 46px; --hole-ix: 4px; max-width: 520px;
  --hole-h: calc(var(--c2n) * 0.5cqw); --rh: calc(var(--hole-top) + var(--hole-bot) + var(--hole-h)); --pic: calc(var(--c3n) * 0.5cqw - 6px); }
.sp-one.spb .sp-w { font-size: clamp(20px, 6.2vw, 28px); }
.sp-one.spb .sp-k, .sp-one.spb .spb-bko { font-size: clamp(13px, 3.8vw, 16px); }
@media (min-width: 900px) { .sp-one.spb .sp-w { font-size: 30px; } }
.pair-nav { display: flex; gap: 12px; }
.pair-nav .btn { flex: 1; }
.pair-nav .btn[hidden] { display: none; }
.pair-nav .next-pair { margin-left: auto; }
.sp-one .sp-row::after { display: none; }
.sp-one.spb .spb-btx { padding-left: 8px; }

/* No settling: the spread never slides. A plain page stays under the flap so the right side is a page, not a gap. */
.sp:not(.spb)::before { content: ""; grid-column: 3; grid-row: 1; background: var(--card); border-radius: 0 var(--radius-card) var(--radius-card) 0; box-shadow: var(--shadow); }

/* One big picture from the start (same size before and after the turn): the picture of the word being spoken */
.big-pic { width: min(60vw, 320px); aspect-ratio: 1; margin: 10px auto 6px; background: var(--card); border-radius: var(--radius-card); box-shadow: var(--shadow); display: grid; place-items: center; overflow: hidden; }
.big-pic img { width: 92%; height: 92%; object-fit: contain; }
.big-pic.sticky { position: sticky; top: calc(var(--nav-h, 48px) + 6px); z-index: 5; width: min(44vw, 200px); margin: 6px auto 8px; }
@media (min-width: 900px) { .big-pic.sticky { top: 8px; width: 220px; } }

/* Weights: 300 helper lines, 400 body, 500 English words / buttons / labels, 600 large titles. Nothing heavier. */
h1, h2, h3, h4, h5, h6, th { font-weight: 600; }
b, strong { font-weight: 500; }
.unit-guide, .look-count, .p5-hint { font-weight: 300; }


/* ===== Part 2: one pair per screen. Corners: panels --radius-panel, small things --radius-sm, buttons --radius-btn. ===== */
.pp { display: flex; justify-content: center; align-items: flex-start; gap: 12px; margin: 10px 0 14px; --ps: min(42vw, 260px); }
.pp-slot { display: flex; flex-direction: column; align-items: center; gap: 6px; width: var(--ps); transition: opacity .25s var(--ease), transform .25s var(--ease); }
.pp-img { position: relative; display: block; box-sizing: border-box; width: 100%; aspect-ratio: 1; border: 2px solid transparent; border-radius: var(--radius-panel); overflow: hidden; background: var(--card); box-shadow: var(--shadow); transition: box-shadow .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease); }
.pp-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-cmp { position: absolute; inset: 0; opacity: 0; transform: scale(.96); z-index: 3; }
.pp-cap { position: relative; display: block; width: 100%; height: 1.5em; text-align: center; font-size: var(--t-sm); font-weight: 500; color: var(--blue-dark); }
.cap-a, .cap-b { position: absolute; inset: 0; }
.cap-b { opacity: 0; }
.pp-two { perspective: 1600px; }
.pp-l { position: relative; z-index: 1; }
.pp-r { position: relative; z-index: 2; }
.pp[data-turned="1"] .pp-l { z-index: 3; }
.pp-flip { transform-origin: calc(var(--pgap, 12px) / -2) 50%; transform-style: preserve-3d; overflow: visible; background: transparent; box-shadow: none; }
.pp-fr, .pp-bk { position: absolute; inset: 0; overflow: hidden; border-radius: var(--radius-panel); background: var(--card); box-shadow: var(--shadow); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.pp-bk { transform: rotateY(180deg); }
.pp-flip img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pp[data-gone="1"] .pp-r { visibility: hidden; }
.pp.lit .pp-slot:not(.on) { opacity: .45; }
.pp-slot.on { transform: translateY(-4px); }
.pp-slot.on .pp-img { box-shadow: 0 18px 32px -14px rgba(42, 52, 71, .4); animation: pp-pulse .3s var(--ease); }
@keyframes pp-pulse { 50% { transform: scale(1.04); } }
.pp-three { --ps: min(27vw, 150px); gap: 10px; }
.pp-three .pp-slot.dim { opacity: .45; }
.pp-one { --ps: min(56vw, 300px); }
.pp-fill .pp-img { background: transparent; box-shadow: none; border: 2px dashed var(--blue-light); display: grid; place-items: center; }
.pp-fill .hq { font-size: 64px; font-weight: 500; color: var(--blue-light); }
.pp-fill.right .pp-img { border-style: solid; border-color: var(--sage); background: var(--card); }
.pp-fill .pp-img.over { border-color: var(--blue); }

/* the word panel: one card, four round corners; the flap is hinged at the spine and its back carries the compound */
.pw { --pgap: 12px; position: relative; display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--pgap); max-width: 640px; margin: 6px auto 0; perspective: 1600px; min-height: 150px; }
.pw-lp { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 18px 10px; box-sizing: border-box; min-width: 0; background: var(--card); border-radius: var(--radius-panel); box-shadow: var(--shadow); }
.pw-flap { grid-column: 2; grid-row: 1; position: relative; transform-origin: calc(var(--pgap) / -2) 50%; transform-style: preserve-3d; z-index: 2; }
.pw-front, .pw-back { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 18px 10px; box-sizing: border-box; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--card); border-radius: var(--radius-panel); box-shadow: var(--shadow); min-width: 0; }
.pw-back { transform: rotateY(180deg); }
.pw .sp-w { font-size: clamp(26px, 9vw, 40px); line-height: 1.2; }
.pw .sp-k { font-size: var(--t-sm); margin: 0; text-align: center; }
.pw .sp-w.speak { transform: none; animation: w-pulse .3s var(--ease); }
.pw .sp-w.speak.cmp { animation: none; }
@keyframes w-pulse { 50% { transform: scale(1.12); } }
.pw-solo { display: block; min-height: 0; background: var(--card); border-radius: var(--radius-panel); box-shadow: var(--shadow); }
.pw-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 10px; }
@media (min-width: 900px) { .pw .sp-w { font-size: 44px; } }
@media (prefers-reduced-motion: reduce) { .pw .sp-w.speak, .pp-slot.on .pp-img { animation: none; } .pp-slot.on { transform: none; }  }
.tray { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 10px; max-width: 520px; margin: 14px auto 0; }
.tray .chip { border-radius: var(--radius-sm); padding: 4px; }
.tray .chip img { width: 100%; height: auto; aspect-ratio: 1; border-radius: var(--radius-sm); object-fit: cover; display: block; }
.wr-list { display: grid; gap: 10px; max-width: 520px; margin: 8px auto 0; }
.wr-cell { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--card); box-shadow: var(--shadow); }
.wr-cell.speak { background: var(--blue-light); }
.wr-tag { font-size: var(--t-xs); color: var(--text-sub); }
.wr-model { font-size: var(--t-md); font-weight: 500; color: var(--blue-dark); }
.hide-model .wr-model { visibility: hidden; }
.wr-cell .cu-input { width: 100%; box-sizing: border-box; font-size: var(--t-md); }
.wr-ans { margin: 0; color: var(--terracotta); }
.wr-hide { align-self: center; margin: 4px auto; display: flex; }
.tray { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 10px; overflow: visible; max-width: 520px; margin: 14px auto 0; background: transparent; padding: 0; box-shadow: none; border: 0; border-radius: 0; }
.wr-list { background: none; box-shadow: none; padding: 0; border-radius: var(--radius-panel); }
