/* Jack Lee 영어책 웹앱 — 색·글꼴·배치는 PDF 원본에서 그대로 땄다(scripts/draw.py, dump.py).
   책마다 [data-book] 아래 토큰만 바꾼다. */

:root {
  --orange: #ff5936;
  --orange-t: #ff5a36;
  --f-en: "Inter", system-ui, sans-serif;
  --f-it: "Caladea", Georgia, serif;
  --f-ko: "Noto Sans KR", system-ui, sans-serif;
  --f-serif: "Noto Serif KR", serif;

  /* Sound local (기본) */
  --bg: #07181c;          /* 본문 쪽 바탕 */
  --band: #08333b;        /* 머리띠·섹션 머리·표지 */
  --card: #0c2328;        /* 카드 */
  --box: #11363f;         /* 예문 상자·명언 */
  --line: #1d4852;        /* 테두리·구분선 */
  --circle1: #0f464f;
  --circle2: #0a3b44;
  --t-head: #f4fafa;
  --t-body: #e4efef;
  --t-en: #e6f5f5;
  --t-sub: #9db5b8;
  --t-mute: #7fa0a5;
  --t-accent: #8fc7c7;
  --t-desc: #d3ecec;
  --t-cover: #c6e2e2;
  --dot: #8ec6c6;
  --stamp: #c96a52;
  --pos: #2dd4a7;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--t-body);
  font-family: var(--f-ko); font-size: 15px; line-height: 1.6;
  word-break: keep-all; overflow-wrap: anywhere;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
i { font-style: normal; font-family: var(--f-en); font-weight: 500; }
b { font-weight: 700; color: var(--t-head); }
.en { font-family: var(--f-en); }

.wrap { max-width: 680px; margin: 0 auto; padding: 0 16px; }

/* ---------- 머리띠(책 상단 띠) ---------- */
.band {
  position: sticky; top: 0; z-index: 10; height: 44px;
  background: var(--band); display: flex; align-items: center;
  padding-top: env(safe-area-inset-top);
  box-sizing: content-box;
}
.band::before { content: ""; width: 22px; align-self: stretch; background: var(--orange); flex: none; }
.band .in { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 14px; max-width: 680px; margin: 0 auto; }
.band .bt { font-family: var(--f-it); font-style: italic; font-weight: 700; color: #fff; font-size: 16px; white-space: nowrap; }
.band .bs { color: var(--t-accent); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.band .br { margin-left: auto; color: #fff; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.band .tool { flex: none; color: var(--t-accent); font-size: 12px; padding: 6px 4px; }
.band .tool[aria-pressed="true"] { color: var(--orange); }

/* ---------- 꼬리말(저자·쪽 표시 대신 섹션 이동) ---------- */
.foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 14px 0 calc(28px + env(safe-area-inset-bottom)); }
.foot .row { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; }
.foot .who { font-size: 11px; font-weight: 700; color: var(--t-body); }
.foot .cr { font-size: 9.5px; color: var(--t-sub); }
.dots { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; justify-content: flex-end; max-width: 100%; }
.dots a { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.dots a.on { width: 13px; height: 13px; margin: -2.5px; background: var(--dot); display: grid; place-items: center; }
.dots a.on::after { content: ""; width: 5.5px; height: 5.5px; border-radius: 50%; background: var(--orange); }
.dots a.done { background: var(--t-mute); }
.pager { display: flex; gap: 10px; margin: 28px 0 0; }
.pager a { flex: 1; border: 1px solid var(--line); background: var(--card); padding: 12px 14px; font-size: 13px; color: var(--t-sub); }
.pager a b { display: block; font-size: 14px; }
.pager a.next { text-align: right; }

/* ---------- 표지 ---------- */
.cover { position: relative; overflow: hidden; background: var(--band); min-height: 100vh; min-height: 100dvh; padding: calc(60px + env(safe-area-inset-top)) 0 calc(36px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.cover::before, .cover::after { content: ""; position: absolute; border-radius: 50%; }
.cover::before { width: 120vw; max-width: 560px; aspect-ratio: 1; right: -38vw; top: -12vw; background: var(--circle1); }
.cover::after { width: 90vw; max-width: 440px; aspect-ratio: 1; left: -30vw; bottom: -30vw; background: var(--circle2); }
.cover .wrap { position: relative; z-index: 1; width: 100%; flex: 1; display: flex; flex-direction: column; }
.cover .kick { font-family: var(--f-en); font-weight: 600; font-size: 12px; color: var(--t-accent); letter-spacing: .02em; white-space: pre; margin-top: 18vh; }
.cover .bar { width: 62px; height: 6px; background: var(--orange); margin: 14px 0 22px; }
.cover .t1 { font-family: var(--f-en); font-weight: 700; color: #fff; font-size: clamp(56px, 17vw, 86px); line-height: 1; letter-spacing: -.01em; }
.cover .t2 { font-family: var(--f-it); font-style: italic; font-weight: 700; color: var(--orange-t); font-size: clamp(76px, 24vw, 122px); line-height: 1.05; }
.cover .ask { font-family: var(--f-it); font-style: italic; font-size: 17px; color: var(--t-accent); margin: 18px 0 30px; }
.cover .ask .y { color: #ffb84d; font-weight: 700; }
.cover .ask .o { color: var(--orange-t); font-weight: 700; }
.cover .sub { font-family: var(--f-serif); font-weight: 700; color: #fff; font-size: clamp(20px, 5.6vw, 26px); line-height: 1.45; }
.cover .sub .n { font-family: var(--f-en); color: var(--orange-t); font-size: 1.1em; margin-left: 8px; }
.cover .fields { color: var(--t-cover); font-size: 13.5px; margin-top: 12px; }
.cover .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.cover .actions a { border: 1px solid var(--t-accent); color: #fff; padding: 11px 16px; font-size: 14px; }
.cover .actions a.pri { background: var(--orange); border-color: var(--orange); font-weight: 700; }
.cover .legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: auto; padding-top: 40px; font-size: 12px; color: var(--t-cover); }
.cover .legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: 0; }
.cover .tail { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.cover .tag { font-family: var(--f-it); font-style: italic; color: var(--t-accent); font-size: 15px; }
.cover .au { font-family: var(--f-serif); font-weight: 700; color: #fff; font-size: 18px; border-bottom: 4px solid var(--orange); padding-bottom: 2px; }

/* ---------- 일반 쪽(읽는 법·목차·부록) ---------- */
.page { padding-top: 34px; }
.h1 { font-family: var(--f-serif); font-weight: 700; color: var(--t-head); font-size: 28px; margin: 0 0 10px; line-height: 1.3; }
.h1 + .rule, .rule { height: 3px; background: var(--orange); margin: 0 0 16px; }
.lead { font-size: 14.5px; color: var(--t-body); margin: 0 0 18px; }
.callout { background: var(--box); border-left: 4px solid var(--orange); padding: 12px 14px; font-size: 14px; margin: 0 0 16px; }
.callout .lb { color: var(--orange-t); font-weight: 700; margin-right: 8px; }
.small { font-size: 13px; color: var(--t-sub); margin: 0 0 18px; }
.small b { margin-right: 6px; }
.deftab { width: 100%; border-collapse: collapse; margin: 14px 0 26px; font-size: 13px; }
.deftab td { padding: 8px 6px; vertical-align: top; border-bottom: 1px solid var(--line); color: var(--t-sub); }
.deftab td:first-child { width: 34%; color: var(--t-head); font-weight: 700; font-size: 13.5px; }
.deftab .dot { color: var(--c); margin-right: 6px; }
.deftab .lab { color: var(--c); }
.h2 { font-weight: 700; color: var(--t-head); font-size: 18px; margin: 26px 0 8px; }
.copy { background: var(--box); border-left: 4px solid var(--orange); padding: 14px 16px; margin: 14px 0; font-size: 14px; }
.copy .lb { font-family: var(--f-en); font-weight: 700; font-size: 11px; color: var(--orange-t); letter-spacing: .04em; }

/* 목차 */
.toc .part { display: flex; align-items: baseline; gap: 10px; margin: 26px 0 8px; }
.toc .part .pn { font-family: var(--f-en); font-weight: 700; color: var(--orange-t); font-size: 14px; }
.toc .part .pt { font-weight: 700; color: #fff; font-size: 14.5px; }
.toc .part .pc { color: var(--t-accent); font-size: 12px; }
.toc a.row { display: grid; grid-template-columns: 34px 1fr auto; gap: 4px 8px; align-items: baseline; padding: 9px 0 9px 6px; border-bottom: 1px solid var(--line); }
.toc .row .no { font-family: var(--f-en); font-weight: 700; color: var(--orange-t); font-size: 13.5px; }
.toc .row .ti { color: var(--t-body); font-size: 14.5px; }
.toc .row .rg { color: var(--t-mute); font-size: 11.5px; text-align: right; }
.toc .row .mk { grid-column: 2 / 4; display: flex; gap: 6px; }
.toc .row .mk span { font-family: var(--f-en); font-size: 10px; font-weight: 700; padding: 1px 6px; border: 1px dashed var(--stamp); color: var(--stamp); border-radius: 9px; }
.toc .row .mk span.off { border-color: var(--line); color: var(--t-mute); }

/* ---------- PART 표지 ---------- */
.partcover { position: relative; overflow: hidden; background: var(--band); margin: 0 -16px; padding: 70px 16px 60px; }
.partcover::after { content: ""; position: absolute; width: 70vw; max-width: 380px; aspect-ratio: 1; border-radius: 50%; right: -18vw; bottom: -22vw; background: var(--circle2); }
.partcover > * { position: relative; z-index: 1; }
.partcover .pn { font-family: var(--f-en); font-weight: 700; color: var(--orange-t); font-size: clamp(110px, 36vw, 190px); line-height: .9; letter-spacing: -.03em; }
.partcover .ul { width: 62px; height: 5px; background: var(--orange); margin: 14px 0 34px; }
.partcover .pt { font-family: var(--f-serif); font-weight: 700; color: #fff; font-size: clamp(28px, 8vw, 38px); line-height: 1.3; }
.partcover .ps { color: var(--t-accent); font-size: 16px; margin-top: 6px; }
.partcover .pd { color: var(--t-cover); font-size: 14px; margin-top: 18px; }
.partcover .pr { font-family: var(--f-en); font-weight: 700; color: var(--orange-t); font-size: 12.5px; margin-top: 40px; letter-spacing: .02em; }

/* ---------- 섹션 머리·명언 ---------- */
.sechead { display: grid; grid-template-columns: auto 1fr; gap: 0 14px; background: var(--band); border-bottom: 3px solid var(--orange); padding: 14px 14px 14px; margin-top: 18px; }
.sechead .sn { font-family: var(--f-en); font-weight: 700; color: var(--orange-t); font-size: 44px; line-height: 1; }
.sechead .sm { color: var(--t-accent); font-size: 11.5px; }
.sechead .st { font-family: var(--f-serif); font-weight: 700; color: #fff; font-size: 21px; line-height: 1.35; margin: 2px 0 2px; }
.sechead .sd { color: var(--t-desc); font-size: 13px; margin-top: 4px; }
.motiv { background: var(--box); border-left: 4px solid var(--orange); padding: 12px 14px; margin: 8px 0 10px; }
.motiv .lb { font-family: var(--f-en); font-weight: 700; color: var(--orange-t); font-size: 10.5px; letter-spacing: .04em; }
.motiv .q { font-family: var(--f-it); font-style: italic; font-weight: 700; color: var(--t-head); font-size: 19px; line-height: 1.4; margin: 4px 0 6px; }
.motiv .k { color: var(--t-sub); font-size: 13px; }
.motiv .by { font-family: var(--f-en); font-weight: 600; color: var(--orange-t); font-size: 11.5px; text-align: right; margin-top: 4px; }

/* ---------- 표현 카드 ---------- */
.card { position: relative; background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--era, var(--pos)); padding: 10px 12px 12px 12px; margin: 8px 0; scroll-margin-top: 60px; }
.card .top { display: flex; align-items: flex-start; gap: 10px; }
.card .no { flex: none; background: var(--orange); color: #fff; font-family: var(--f-en); font-weight: 700; font-size: 11.5px; min-width: 40px; height: 31px; display: grid; place-items: center; margin-top: -2px; }
.card .ex-t { flex: 1; min-width: 0; font-family: var(--f-en); font-weight: 700; color: var(--t-head); font-size: 19px; line-height: 1.3; padding-top: 2px; }
.card .era { flex: none; max-width: 42%; text-align: right; font-size: 11.5px; color: var(--t-mute); padding-top: 5px; line-height: 1.4; }
.card .era b { color: var(--era); }
.card .era b::before { content: "● "; font-weight: 400; }
.card .fld { margin-top: 6px; display: flex; gap: 8px; align-items: baseline; }
.card .fld .lb { flex: none; color: var(--orange-t); font-weight: 700; font-size: 11px; }
.card .mean { font-weight: 700; color: var(--t-body); font-size: 15px; }
.card .pron { font-weight: 700; color: var(--t-head); font-size: 13.5px; }
.card .exs { background: var(--box); border-left: 2px solid var(--orange); padding: 8px 10px; margin: 8px 0 0; }
.card .exs .l { display: grid; grid-template-columns: 14px 1fr; column-gap: 4px; }
.card .exs .l + .l { margin-top: 6px; }
.card .exs .l.norole { grid-template-columns: 1fr; }
.card .exs .r { font-family: var(--f-en); font-weight: 700; color: var(--orange-t); font-size: 14px; }
.card .exs .e { font-family: var(--f-en); font-weight: 500; color: var(--t-en); font-size: 14.5px; line-height: 1.45; }
.card .exs .k { grid-column: -2; color: var(--t-sub); font-size: 13px; }
.card .xtra { margin-top: 8px; font-size: 12.5px; color: var(--t-sub); }
.card .xtra b { font-size: 12.5px; margin-right: 4px; }
.card .note { margin-top: 6px; font-size: 13px; color: var(--t-body); }
.card .note .lb { color: var(--era); font-weight: 700; font-size: 11px; margin-right: 6px; }
.card .note i { color: var(--t-body); }
/* 가리기: 영어(표현·예문·발음·NOTE 속 영어)를 가리고 눌러서 하나씩 확인 */
.hide .card .ex-t, .hide .card .pron, .hide .card .exs .e, .hide .card .note i { filter: blur(7px); cursor: pointer; transition: filter .15s; user-select: none; }
.hide .card .ex-t.show, .hide .card .pron.show, .hide .card .exs .e.show, .hide .card .note i.show { filter: none; user-select: auto; }
/* 전체 화면 */
.band .fs { flex: none; color: var(--t-accent); font-size: 12px; padding: 6px 4px; }

/* ---------- CHECK POINT ---------- */
.cp { background: var(--card); border: 1px solid var(--line); margin: 22px 0 8px; }
.cp .hd { background: var(--orange); color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 14px; flex-wrap: wrap; }
.cp .hd .t { font-family: var(--f-en); font-weight: 700; font-size: 12.5px; white-space: pre-wrap; }
.cp .hd .g { font-family: var(--f-it); font-style: italic; font-size: 13px; }
.cp .checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chk { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; color: var(--t-body); cursor: pointer; line-height: 1.4; }
.chk input { appearance: none; -webkit-appearance: none; flex: none; width: 15px; height: 15px; margin: 2px 0 0; background: var(--bg); border: 1px solid var(--dot); display: grid; place-items: center; cursor: pointer; }
.chk input:checked { background: var(--orange); border-color: var(--orange); }
.chk input:checked::after { content: ""; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.cp .body { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 12px 14px 14px; align-items: center; }
.cp .step { display: grid; grid-template-columns: 34px 1fr; gap: 0 10px; align-items: start; }
.cp .step > div { min-width: 0; }
.cp .step + .step { margin-top: 12px; }
.cp .step .n { width: 34px; height: 34px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-family: var(--f-it); font-style: italic; font-weight: 700; color: var(--orange-t); font-size: 22px; }
.cp .step .lb { font-family: var(--f-en); font-weight: 700; color: var(--t-accent); font-size: 11.5px; }
.cp .step .ds { font-size: 13px; color: var(--t-body); }
.cp .says { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 4px; }
.cp .says .chk { font-family: var(--f-en); font-weight: 500; font-size: 11.5px; color: var(--t-sub); }
.cp .wl { width: 100%; background: transparent; border: 0; border-bottom: 1px dashed var(--line); color: var(--t-en); font-family: var(--f-en); font-size: 14px; padding: 6px 0 4px; margin-top: 2px; outline: none; border-radius: 0; }
.cp .wl:focus { border-bottom-color: var(--dot); }
.cp .wl::placeholder { color: var(--t-mute); font-family: var(--f-ko); font-size: 12px; }
.stamp { width: 74px; height: 74px; border-radius: 50%; border: 1.5px dashed var(--stamp); color: var(--stamp); display: grid; place-content: center; text-align: center; line-height: 1.15; align-self: center; transform: rotate(-8deg); }
.stamp .s1 { font-family: var(--f-en); font-weight: 700; font-size: 11px; letter-spacing: .06em; }
.stamp .s2 { font-family: var(--f-it); font-style: italic; font-size: 12px; }
.stamp[aria-pressed="true"] { background: var(--stamp); color: #fff; border-style: solid; }

/* ---------- 부록 ---------- */
.cmp { background: var(--card); border: 1px solid var(--line); padding: 12px 14px; margin: 10px 0; }
.cmp .t { font-family: var(--f-en); font-weight: 700; color: var(--t-head); font-size: 15.5px; }
.cmp .b { font-size: 13.5px; color: var(--t-body); margin-top: 6px; }
.cmp .x { background: var(--box); border-left: 2px solid var(--orange); padding: 7px 10px; margin-top: 8px; }
.cmp .x .e { font-family: var(--f-en); font-weight: 500; color: var(--t-en); font-size: 14px; }
.cmp .x .k { color: var(--t-sub); font-size: 13px; }
.abbr { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 10px; }
.abbr th { background: var(--band); color: #fff; text-align: left; padding: 8px; font-size: 12.5px; }
.abbr td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.abbr td:first-child { font-family: var(--f-en); font-weight: 700; color: var(--t-head); white-space: nowrap; }
.search { width: 100%; background: var(--card); border: 1px solid var(--line); color: var(--t-head); padding: 11px 12px; font-size: 15px; outline: none; border-radius: 0; margin: 4px 0 12px; }
.search:focus { border-color: var(--dot); }
.idx a { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.idx .e { font-family: var(--f-en); font-weight: 600; color: var(--t-head); font-size: 14.5px; }
.idx .m { display: block; font-family: var(--f-ko); font-weight: 400; color: var(--t-sub); font-size: 12.5px; }
.idx .n { font-family: var(--f-en); font-weight: 700; color: var(--orange-t); font-size: 12.5px; }
.idx .letter { font-family: var(--f-en); font-weight: 700; color: var(--orange-t); font-size: 15px; margin: 16px 0 2px; }

/* ---------- 서재·로그인 ---------- */
.lib { min-height: 100vh; background: #07181c; padding: calc(40px + env(safe-area-inset-top)) 0 40px; }
.lib .hello { display: flex; justify-content: space-between; align-items: baseline; color: var(--t-sub); font-size: 13px; margin-bottom: 18px; }
.lib .hello b { color: #fff; font-size: 22px; font-family: var(--f-serif); }
.lib .hello button { color: var(--t-accent); font-size: 12.5px; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.book { position: relative; overflow: hidden; aspect-ratio: 595 / 842; background: var(--c); padding: 18px 14px; display: flex; flex-direction: column; color: #fff; }
.book::before { content: ""; position: absolute; width: 80%; aspect-ratio: 1; border-radius: 50%; right: -30%; top: -12%; background: var(--c2); }
.book > * { position: relative; }
.book .b1 { font-family: var(--f-en); font-weight: 700; font-size: 22px; line-height: 1; margin-top: auto; }
.book .b2 { font-family: var(--f-it); font-style: italic; font-weight: 700; color: var(--orange-t); font-size: 26px; line-height: 1.05; }
.book .b3 { font-size: 11.5px; color: rgba(255,255,255,.75); margin-top: 8px; }
.book .bar { width: 30px; height: 3px; background: var(--orange); margin-top: 10px; }
.book .soon { position: absolute; left: 14px; top: 14px; font-size: 11px; color: rgba(255,255,255,.7); border: 1px solid rgba(255,255,255,.35); padding: 1px 7px; }
.book.dis { opacity: .55; pointer-events: none; }
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: #07181c; }
.gate .box { width: 100%; max-width: 340px; }
.gate h1 { font-family: var(--f-serif); color: #fff; font-size: 24px; margin: 0 0 4px; }
.gate p { color: var(--t-sub); font-size: 13.5px; margin: 0 0 18px; }
.gate input { width: 100%; background: var(--card); border: 1px solid var(--line); color: #fff; padding: 13px 12px; font-size: 16px; border-radius: 0; outline: none; }
.gate .go { width: 100%; margin-top: 10px; background: var(--orange); color: #fff; font-weight: 700; padding: 13px; }
.gate .err { color: #ff8a70; font-size: 13px; min-height: 20px; margin-top: 8px; }
.who-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.who-btns button { border: 1px solid var(--line); background: var(--card); color: #fff; padding: 18px 0; font-weight: 700; font-size: 16px; }
.loading { color: var(--t-sub); text-align: center; padding: 80px 0; font-size: 13px; }

@media (max-width: 480px) {
  .band .bs { display: none; }
  .band .br { max-width: none; flex: 1; text-align: right; }
}
@media (min-width: 720px) {
  body { font-size: 16px; }
  .card { padding: 12px 16px 14px; }
  .card .ex-t { font-size: 21px; }
}

/* ---------- 쪽 넘기기(reader) ---------- */
.reader { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); overflow: hidden; }
.reader .band { position: relative; flex: none; }
.vp { flex: 1; min-height: 0; position: relative; overflow: hidden; touch-action: pan-y; }
.flow { margin-top: 16px; transition: transform .34s cubic-bezier(.2, .7, .2, 1); will-change: transform; }
.flow.nt { transition: none; }
.flow main.wrap { max-width: none; margin: 0; padding: 0; }
.flow .page { padding-top: 6px; }
.flow .endmark { display: block; height: 1px; }
/* 펼침: 가운데 책등 */
.vp.spread::after { content: ""; position: absolute; top: 16px; bottom: 14px; left: 50%; width: 1px; background: var(--line); pointer-events: none; }
/* 쪽 안에서 끊기지 않게 */
.card, .cp, .motiv, .sechead, .cmp, .callout, .copy, .deftab tr, .abbr tr, .idx a, .toc a.row, .step, .exs, .search { break-inside: avoid; }
.toc .part, .h2, .idx .letter, .h1, .rule { break-after: avoid; }
.flow .partcover { margin: 0; height: var(--ph); break-after: column; display: flex; flex-direction: column; justify-content: center; padding: 24px 20px; }
.flow .sechead { margin-top: 0; }
/* 꼬리말: 저자 · 쪽 번호 동그라미 · 섹션 점 (책 꼬리말 배치) */
.pfoot { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; border-top: 1px solid var(--line); margin: 0 16px; padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); }
.pfoot .who { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.pfoot .who b { font-size: 10.5px; color: var(--t-body); }
.pfoot .who span { font-size: 8.5px; color: var(--t-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pfoot .pn { display: flex; align-items: center; gap: 2px; }
.pfoot .pn button { width: 30px; height: 30px; color: var(--t-accent); font-size: 20px; line-height: 1; }
.pfoot .num { min-width: 28px; height: 28px; padding: 0 6px; border-radius: 14px; background: var(--orange); color: #fff; display: flex; align-items: center; justify-content: center; gap: 3px; font-family: var(--f-en); }
.pfoot .num b { color: #fff; font-size: 12px; }
.pfoot .num small { font-size: 9.5px; opacity: .85; }
.pfoot .dots { gap: 4px; margin: 0; }
.pfoot .dots a { width: 6px; height: 6px; }
.pfoot .dots a.on { width: 10px; height: 10px; margin: -2px; }
.pfoot .dots a.on::after { width: 4px; height: 4px; }
@media (max-width: 380px) { .pfoot .who span { display: none; } }

/* 표지를 쪽 틀 안에(1쪽) */
.flow .cover { min-height: 0; height: var(--ph); padding: 24px 22px 20px; break-after: column; container-type: inline-size; }
.flow .cover::before { width: 95%; max-width: none; right: -38%; top: -14%; }
.flow .cover::after { width: 72%; max-width: none; left: -26%; bottom: -22%; }
.flow .cover .wrap { padding: 0; max-width: none; height: 100%; }
.flow .cover .kick { margin-top: auto; font-size: 11px; }
.flow .cover .bar { margin: 10px 0 16px; }
.flow .cover .t1 { font-size: clamp(40px, 16cqw, 76px); }
.flow .cover .t2 { font-size: clamp(56px, 23cqw, 108px); }
.flow .cover .ask { font-size: 15px; margin: 12px 0 20px; }
.flow .cover .sub { font-size: clamp(18px, 6.2cqw, 24px); }
.flow .cover .fields { font-size: 12.5px; margin-top: 8px; }
.flow .cover .actions { margin-top: 20px; }
.flow .cover .trial { font-size: 11.5px; margin-top: 10px; }
.flow .cover .legend { padding-top: 18px; font-size: 11px; }
.flow .cover .au { font-size: 16px; }
.flow .cover .tag { font-size: 13.5px; }

/* ================= Words that work (보라) ================= */
body[data-book="words-that-work"] {
  --bg: #110a1d; --band: #2a1657; --card: #1a112f; --box: #231a42; --line: #3b2b66;
  --circle1: #3a2175; --circle2: #311c66;
  --t-head: #faf7ff; --t-body: #ede8f7; --t-en: #ede8f7; --t-sub: #b1a6cc; --t-mute: #8f82b3;
  --t-accent: #c9b5ff; --t-desc: #e2d8f7; --t-cover: #dccff7; --dot: #c8b5ff;
}
.cover .lvl { font-family: var(--f-serif); font-weight: 700; color: var(--t-cover); font-size: 17px; margin-top: 8px; }
.cover .lvl .n { font-family: var(--f-en); color: var(--orange-t); font-size: 1.5em; margin-left: 8px; }
/* 단어 카드: 단어 | 뜻 | 외움 */
.wcard { container-type: inline-size; background: var(--card); border-left: 3px solid var(--tag); border-bottom: 1px solid var(--line); padding-bottom: 9px; margin: 6px 0; break-inside: avoid; scroll-margin-top: 60px; }
.wtop { display: grid; grid-template-columns: 28% 1fr auto; }
.wtop > div { padding: 8px 10px 4px; min-width: 0; }
.wword, .wmean { border-right: 1px solid var(--line); }
.wd { font-family: var(--f-en); font-weight: 700; color: var(--t-head); font-size: 18px; line-height: 1.25; }
.wcard .pos { font-family: var(--f-en); font-weight: 500; color: var(--t-sub); font-size: 10.5px; }
.wpron { color: var(--t-accent); font-size: 12px; margin-top: 2px; }
.wmean .mean { font-weight: 700; color: var(--t-body); font-size: 14.5px; }
.wmean .reg { display: block; color: var(--t-sub); font-size: 11px; margin-top: 2px; }
.wside { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.wside .tags { display: flex; flex-wrap: wrap; gap: 2px 8px; justify-content: flex-end; }
.tg { font-size: 10.5px; color: var(--t-sub); white-space: nowrap; }
.tg b { color: var(--c); }
.tg b::before { content: "● "; font-weight: 400; }
.rate { display: flex; gap: 8px; }
.rate button { display: flex; align-items: center; gap: 3px; font-size: 10.5px; color: var(--rc); padding: 2px 0; }
.rate button::before { content: ""; width: 13px; height: 13px; border-radius: 50%; border: 1.3px solid var(--rc); box-sizing: border-box; }
.rate button[aria-pressed="true"]::before { background: var(--rc); }
.rate .r1 { --rc: #ff7a59; } .rate .r2 { --rc: #ffc857; } .rate .r3 { --rc: #2dd4a7; }
.wex { font-family: var(--f-it); font-style: italic; color: var(--t-body); font-size: 15px; padding: 4px 12px 0; line-height: 1.45; }
.wln { padding: 3px 12px 0; font-size: 12.5px; color: var(--t-body); }
.wln b { color: var(--c); font-size: 11px; margin-right: 6px; }
@container (max-width: 430px) {
  .wtop { grid-template-columns: 42% 1fr; }
  .wmean { border-right: 0; }
  .wside { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; border-top: 1px dashed var(--line); padding: 6px 10px 2px; }
  .wside .tags { justify-content: flex-start; }
}
.hide .wd, .hide .wpron, .hide .wex, .hide .wln .lt { filter: blur(7px); cursor: pointer; transition: filter .15s; user-select: none; }
.hide .wd.show, .hide .wpron.show, .hide .wex.show, .hide .wln .lt.show { filter: none; user-select: auto; }
/* 체크포인트: 오늘의 한 줄 + MEMO */
.oneline { border-top: 1px solid var(--line); padding: 12px 14px 14px; }
.ol-h { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.ol-h b { color: var(--orange-t); font-size: 13.5px; }
.ol-h span { color: var(--t-accent); font-size: 11.5px; }
.ol-h i { margin-left: auto; font-family: var(--f-it); font-style: italic; font-weight: 400; color: var(--t-accent); font-size: 13px; }
.memo-l { font-family: var(--f-en); font-weight: 700; color: var(--t-accent); font-size: 11px; margin-top: 14px; }
.cp textarea.memo { border: 1px solid var(--line); padding: 8px; resize: vertical; font-family: var(--f-ko); font-size: 13.5px; margin-top: 4px; }
.idx .dot { font-style: normal; font-size: 10px; }

/* ================= Speak first, polish later (흰 종이 · 남색) ================= */
body[data-book="speak-first"] {
  --bg: #ffffff; --band: #0e1a3d; --card: #f6f8fd; --box: #f4f6fb; --line: #dadfed;
  --circle1: #162659; --circle2: #13214d;
  --t-head: #0e1b3d; --t-body: #1b2133; --t-en: #2f42c4; --t-sub: #6b7280; --t-mute: #8a93a6;
  --t-accent: #9fb0e8; --t-desc: #c9d3f5; --t-cover: #c9d3f5; --dot: #0e1b3d; --stamp: #f5b3a3;
  color-scheme: light;
}
body[data-book="speak-first"] .band .br { color: #fff; }
body[data-book="speak-first"] .h1 { color: var(--t-head); }
body[data-book="speak-first"] .toc .row .ti { color: var(--t-body); }
body[data-book="speak-first"] .pfoot .num { color: #fff; }
.sf { color: var(--t-body); font-size: 15px; }
.sf .sp { margin: 0 0 8px; line-height: 1.6; }
.sf .sh { font-family: var(--f-serif); font-weight: 700; color: var(--t-head); font-size: 20px; background: #edeffb; padding: 6px 10px; margin: 18px 0 10px; break-after: avoid; }
.sf .sh2 { font-family: var(--f-serif); font-weight: 700; color: var(--t-head); font-size: 24px; margin: 6px 0 12px; }
.sf .sh span, .sf .sh2 span { color: inherit; }
.sf .sg { display: grid; gap: 4px 10px; margin: 0 0 8px; font-size: 14px; align-items: start; break-inside: avoid; }
.sf .sg > div { min-width: 0; }
.sf .st { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13.5px; margin: 6px 0 14px; }
.sf .st th { background: var(--hf); color: #fff; text-align: left; padding: 6px 8px; font-weight: 700; font-size: 13px; }
.sf .st td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; line-height: 1.5; }
.sf .st tr { break-inside: avoid; }
.sf .sbx { padding: 10px 12px 4px; margin: 8px 0 12px; break-inside: avoid; }
.sf .sbx .sp:last-child, .sf .sbx .sg:last-child { margin-bottom: 6px; }
.sf .sbr { display: flex; align-items: center; gap: 8px; margin: 8px 0 12px; break-inside: avoid; }
.sf .sbr > .sbx { flex: 1; margin: 0; }
.sf .sbr .sep { color: var(--orange-t); font-weight: 700; font-size: 20px; }
.sf .b { font-weight: 700; color: var(--t-body); }
.sf .en { font-family: var(--f-ko); font-weight: 700; color: #2f42c4; }
.sf .ok { font-weight: 700; color: #15803d; }
.sf .ng { color: #b91c1c; }
.sf .ex { font-weight: 700; color: #9d1fb0; }
.sf .or { font-weight: 700; color: #ff5a36; }
.sf .mu { color: #6b7280; }
.sf .wh { font-weight: 700; color: #fff; }
.sf .it { font-family: var(--f-it); font-style: italic; font-weight: 700; color: var(--t-head); }
.hide .sf .en, .hide .sf .ok, .hide .sf .ng { filter: blur(6px); cursor: pointer; user-select: none; transition: filter .15s; }
.hide .sf .en.show, .hide .sf .ok.show, .hide .sf .ng.show { filter: none; user-select: auto; }
.unithead { display: grid; grid-template-columns: auto 1fr; gap: 0 16px; align-items: start; border-bottom: 2px solid var(--orange); padding: 6px 0 12px; margin-bottom: 12px; break-inside: avoid; }
.unithead .uh-n { display: flex; flex-direction: column; line-height: 1; }
.unithead .uh-n span { font-family: var(--f-en); font-weight: 700; color: var(--orange-t); font-size: 12px; }
.unithead .uh-n b { font-family: var(--f-it); font-style: italic; color: var(--orange-t); font-size: 58px; }
.unithead h2 { font-family: var(--f-serif); font-weight: 700; color: var(--t-head); font-size: 23px; line-height: 1.35; margin: 4px 0 4px; text-wrap: balance; }
.unithead p { color: var(--t-sub); font-size: 14px; margin: 0; }
.sf-toc .sfp { background: var(--band); padding: 6px 10px; margin: 20px 0 4px; }
.sf-toc .sfp .pt { color: #fff; }
.sf-toc .row .ti small { display: block; color: var(--t-sub); font-size: 12px; }
.sf-copy { margin-top: 24px; break-before: column; }
/* 표지(남색) */
.cover.sfc { background: #0e1a3d; }
.cover.sfc .t1 { font-size: clamp(36px, 12cqw, 60px); margin-top: auto; }
.cover.sfc .t2 { font-size: clamp(44px, 14.5cqw, 72px); }
.cover.sfc .sub { font-family: var(--f-serif); font-weight: 400; color: #c9d3f5; font-size: clamp(15px, 4.6cqw, 19px); margin-top: 16px; }
.cover.sfc .sfc-foot { margin-top: auto; padding-top: 30px; }
.cover.sfc .sfc-foot .bar { width: 62px; height: 3.5px; margin: 0 0 12px; }
.cover.sfc .sfc-foot p { color: #9fb0e8; font-size: 11px; margin: 0 0 14px; }
.cover.sfc .au { font-size: 17px; border: 0; }
