:root {
  --paper: #f6f3ec;
  --paper-strong: #fffdf8;
  --paper-muted: #ece6da;
  --ink: #221f1c;
  --ink-soft: #58524a;
  --ink-faint: #7a7267;
  --line: #d6cdbe;
  --line-strong: #b5a894;
  --accent: #7c4b8e;
  --accent-deep: #5b3269;
  --accent-soft: #ece0f2;
  --gold: #96742f;
  --green: #2f6350;
  --blue: #3d5c7a;
  --dark: #1c1e24;
  --dark-2: #262932;
  --dark-text: #f4efe6;
  --success: #2d6a4e;
  --warning: #92601e;
  --danger: #973630;
  --shadow: 0 18px 55px rgba(45, 38, 30, .10);
  --shadow-small: 0 9px 28px rgba(45, 38, 30, .09);
  --radius: 18px;
  --reading-size: 18px;
  --reading-width: 760px;
  --wide-width: 1140px;
  --header-height: 68px;
  --serif: Georgia, "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, "Batang", serif;
}

/* 버튼·입력창은 body 글꼴을 물려받지 않는다(브라우저 기본 글꼴을 쓴다).
   이것 때문에 목차·설정 버튼만 시스템 글꼴로 그려지고 있었다 — 실측으로 잡았다. */
button, input, select, textarea { font-family: inherit; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 22px); }
body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "맑은 고딕", sans-serif;
  font-size: var(--reading-size);
  line-height: 1.78;
  letter-spacing: -.012em;
  text-rendering: optimizeLegibility;
}
body[data-theme="dark"] {
  --paper: #16181b;
  --paper-strong: #1f2226;
  --paper-muted: #272b30;
  --ink: #f0ece3;
  --ink-soft: #c9c2b6;
  --ink-faint: #a79f94;
  --line: #3b4046;
  --line-strong: #5a6068;
  --accent: #c79ad8;
  --accent-deep: #ddb8ea;
  --accent-soft: #3a2c44;
  --gold: #d3ac60;
  --green: #8ec4ac;
  --blue: #92b3c9;
  --dark: #101215;
  --dark-2: #191c20;
  --dark-text: #f5efe6;
  --success: #8ac3a1;
  --warning: #ddaf69;
  --danger: #ec8f87;
  --shadow: 0 18px 55px rgba(0, 0, 0, .30);
  --shadow-small: 0 9px 28px rgba(0, 0, 0, .26);
  color-scheme: dark;
}
body.modal-open { overflow: hidden; }
body.focus-reading .site-header .brand,
body.focus-reading .site-header .menu-button,
body.focus-reading .site-nav,
body.focus-reading .nav-backdrop,
body.focus-reading .hero-visual,
body.focus-reading .author-strip,
body.focus-reading .site-footer { display: none !important; }
body.focus-reading .header-inner { justify-content: flex-end; }
body.focus-reading .reading-column,
body.focus-reading .wide-reading { max-width: var(--reading-width); }

img, svg { max-width: 100%; }
a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .16em; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 70%, white);
  outline-offset: 3px;
}
::selection { background: var(--accent-soft); color: var(--ink); }
h2 { margin: 0 0 18px; font-family: var(--serif); font-size: clamp(30px, 3.7vw, 44px); font-weight: 700; line-height: 1.22; letter-spacing: -.02em; word-break: keep-all; }
h3 { font-family: var(--serif); word-break: keep-all; }
p { margin: 0 0 16px; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.skip-link {
  position: fixed;
  left: 18px;
  top: -80px;
  z-index: 3000;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--paper-strong);
  border-radius: 8px;
}
.skip-link:focus { top: 12px; }

.reading-progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 2100; background: transparent; }
.reading-progress span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .08s linear; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 2000;
  min-height: var(--header-height);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  background: color-mix(in srgb, var(--paper) 89%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.header-inner { width: min(100% - 32px, 1380px); min-height: var(--header-height); margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--paper-strong);
  background: var(--accent);
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1;
}
.brand > span:last-child { display: grid; line-height: 1.22; }
.brand strong { font-size: 14px; letter-spacing: -.025em; }
.brand small { margin-top: 3px; color: var(--ink-faint); font-size: 14px; font-weight: 700; }
.reading-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.tool-button, .icon-button, .text-button { border: 0; background: transparent; }
.tool-button {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--paper-strong) 74%, transparent);
  font-size: 14px;
  font-weight: 800;
}
.tool-button:hover, .tool-button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-soft); }
.icon-button { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; }
.icon-button:hover { background: var(--paper-muted); }
/* .icon-button 은 파일 뒤쪽에서 inline-flex(가로)로 덮인다.
   방향을 못 박지 않으면 막대 3개가 가로로 눕고 42px 안에서 6px 로 찌그러진다. */
.menu-button { flex-direction: column; gap: 4px; }
.menu-button span { display: block; flex: none; width: 19px; height: 2px; border-radius: 2px; background: currentColor; }

.site-nav {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 2400;
  width: min(390px, 90vw);
  padding: 18px 20px 36px;
  overflow-y: auto;
  background: var(--paper-strong);
  border-right: 1px solid var(--line);
  box-shadow: 22px 0 65px rgba(0, 0, 0, .18);
  transform: translateX(-104%);
  visibility: hidden;
  transition: transform .25s ease, visibility 0s linear .25s;
}
.site-nav.is-open { transform: translateX(0); visibility: visible; transition-delay: 0s; }
.nav-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.nav-head strong { font-size: 21px; font-family: var(--serif); }
.site-nav ol { list-style: none; padding: 0; margin: 0; counter-reset: nav; }
.site-nav li { counter-increment: nav; border-bottom: 1px solid var(--line); }
.site-nav a {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: baseline;
  gap: 8px;
  padding: 14px 4px;
  color: var(--ink-soft);
  font-weight: 800;
  text-decoration: none;
}
.site-nav a::before { content: counter(nav, decimal-leading-zero); color: var(--accent); font-size: 14px; letter-spacing: .08em; }
.site-nav a:hover, .site-nav a[aria-current="true"] { color: var(--ink); }
.nav-backdrop { position: fixed; inset: 0; z-index: 2300; background: rgba(12, 13, 13, .45); }

.reading-column { width: min(calc(100% - 40px), var(--reading-width)); margin-inline: auto; }
.wide-reading { width: min(calc(100% - 40px), var(--wide-width)); max-width: var(--wide-width); margin-inline: auto; }
[hidden] { display: none !important; }
.section { position: relative; padding: 108px 0; border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.section-tint { background: var(--paper-muted); }
.section-dark { background: var(--dark); color: var(--dark-text); }
.section-dark .section-lead, .section-dark .section-number { color: color-mix(in srgb, var(--dark-text) 70%, transparent); }
.section-number {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  color: var(--ink-faint);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .14em;
}
.section-number::before { content: ""; width: 30px; height: 2px; background: var(--accent); }
.section-lead { max-width: 760px; margin-bottom: 40px; color: var(--ink-soft); font-size: 1.06em; line-height: 1.78; }
.section-lead.lead-spaced { margin-top: 36px; }

/* 히어로 */
.hero {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  align-items: center;
  gap: 46px;
  width: min(calc(100% - 40px), var(--wide-width));
  margin-inline: auto;
  min-height: calc(100vh - var(--header-height));
  padding: 60px 0 70px;
}
.hero .reading-column { width: auto; margin: 0; }
.eyebrow { margin: 0 0 20px; color: var(--accent-deep); font-size: 14px; font-weight: 900; letter-spacing: .12em; }
.hero h1 { margin: 0 0 26px; font-family: var(--serif); font-size: clamp(44px, 5.2vw, 74px); font-weight: 700; line-height: 1.1; letter-spacing: -.03em; word-break: keep-all; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero-question { max-width: 720px; margin: 0 0 18px; font-family: var(--serif); font-size: clamp(22px, 2.3vw, 32px); line-height: 1.46; }
.hero-lead { max-width: 720px; margin-bottom: 26px; color: var(--ink-soft); }
.hero-outcomes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; padding: 0; list-style: none; }
.hero-outcomes li { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-strong); font-size: 14px; font-weight: 800; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 50px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 850;
  text-decoration: none;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.button:hover { transform: translateY(-1px); box-shadow: var(--shadow-small); }
.button.primary { background: var(--accent); color: #fffaf5; }
.button.primary:hover { background: var(--accent-deep); }
.button.secondary { border-color: var(--line-strong); background: var(--paper-strong); color: var(--ink); }
.button.ghost { border-color: var(--line); background: transparent; color: var(--ink-soft); }
.text-link { padding: 10px; color: var(--accent-deep); font-weight: 850; font-size: 15px; }
.research-stamp { margin-top: 26px; color: var(--ink-faint); font-size: 14px; line-height: 1.6; }

.hero-visual { align-self: stretch; display: grid; place-items: center; min-height: 520px; }
.hero-visual svg { width: min(100%, 560px); overflow: visible; }
.hv-page { fill: var(--paper-strong); stroke: var(--line-strong); stroke-width: 1.5; }
.hv-line { stroke: var(--line-strong); stroke-width: 5; stroke-linecap: round; opacity: .5; }
.hv-quote { fill: var(--accent); font-family: Georgia, "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, Batang, serif; font-size: 150px; font-weight: 700; opacity: .92; }
.hv-thread { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 9; opacity: .55; }
.hv-dot { fill: var(--gold); }
.hv-card { fill: var(--dark); }
.hv-kicker { fill: #c9a9d8; font-size: 15px; font-weight: 800; letter-spacing: .1em; }
.hv-big { fill: #fbf5ec; font-family: Georgia, "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, Batang, serif; font-size: 40px; font-weight: 700; }
.hv-small { fill: rgba(244,239,230,.7); font-size: 15px; font-weight: 700; }
.hv-label { fill: var(--ink-soft); font-size: 15px; font-weight: 800; }

/* 한 문장 뽑기 */
.draw-stage { display: grid; gap: 20px; }
.draw-card {
  position: relative;
  padding: 44px 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-strong);
  box-shadow: 8px 8px 0 color-mix(in srgb, var(--accent) 13%, transparent), 16px 16px 0 color-mix(in srgb, var(--accent) 6%, transparent);
}
.draw-card .draw-mark { display: block; margin-bottom: 6px; color: var(--accent); font-family: Georgia, "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, Batang, serif; font-size: 54px; line-height: .6; }
.draw-card .draw-ko { margin: 0 0 20px; font-family: var(--serif); font-size: clamp(24px, 2.9vw, 38px); line-height: 1.5; letter-spacing: -.02em; }
.draw-card .draw-src { margin: 0 0 18px; color: var(--ink-soft); font-family: Georgia, "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, Batang, serif; font-size: 18px; font-style: italic; line-height: 1.6; }
.draw-card .draw-by { margin: 0; color: var(--ink-faint); font-size: 15px; font-weight: 800; }
.draw-card .draw-by strong { color: var(--ink); font-weight: 850; }
.draw-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0 0; }
.draw-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.draw-hint { margin: 0; color: var(--ink-faint); font-size: 14px; }
.draw-card.is-flipping { animation: drawIn .28s ease; }
@keyframes drawIn { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }

/* 등급 읽는 법 */
.grade-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); }
.grade-card { padding: 28px; background: var(--paper-strong); }
.grade-card .grade-kicker { display: block; color: var(--accent); font-size: 14px; font-weight: 900; letter-spacing: .12em; }
.grade-card h3 { margin: 12px 0 10px; font-size: 22px; }
.grade-card p { margin: 0 0 12px; color: var(--ink-soft); font-size: 15px; }
.grade-card p:last-child { margin-bottom: 0; }
.grade-scale { display: grid; gap: 7px; margin-top: 14px; padding: 0; list-style: none; }
.grade-scale li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: baseline; color: var(--ink-soft); font-size: 14px; }
.grade-scale b { display: grid; place-items: center; height: 26px; border: 1px solid var(--line-strong); border-radius: 7px; font-size: 14px; }
.method-details { margin-top: 28px; border-block: 1px solid var(--line); padding: 17px 0; }
.method-details summary { font-weight: 900; cursor: pointer; }
.method-details p { margin: 15px 0 0; color: var(--ink-soft); font-size: 15px; }
.method-details p:last-child { margin-bottom: 0; }

/* 탐색 */
.section-heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.count-stamp { display: grid; min-width: 92px; text-align: right; line-height: 1; }
.count-stamp strong { color: var(--accent); font-family: Georgia, "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, Batang, serif; font-size: 44px; }
.count-stamp span { margin-top: 7px; color: var(--ink-faint); font-size: 14px; font-weight: 850; }
.author-strip { display: flex; flex-wrap: wrap; gap: 7px; margin: 30px 0 26px; }
.author-strip button {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-strong);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 800;
}
.author-strip button:hover, .author-strip button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-soft); }
.author-strip button i { font-style: normal; color: var(--ink-faint); font-size: 14px; }

.atlas-controls {
  position: sticky;
  top: calc(var(--header-height) + 12px);
  z-index: 80;
  margin: 0 0 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  box-shadow: var(--shadow-small);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.search-box { position: relative; display: block; }
.search-box input { width: 100%; min-height: 50px; padding: 11px 46px 11px 15px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--paper-strong); font-size: 15px; }
.search-box .ui-icon { position: absolute; right: 15px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--ink-faint); pointer-events: none; }
.filter-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.filter-row label { color: var(--ink-faint); font-size: 14px; font-weight: 850; letter-spacing: .035em; }
.filter-row select { display: block; width: 100%; min-height: 43px; margin-top: 3px; padding: 7px 26px 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper-strong); color: var(--ink); font-size: 14px; font-weight: 700; }
.active-filter-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 11px; }
.active-filter-row button { border: 0; background: transparent; color: var(--accent-deep); font-size: 14px; font-weight: 850; text-decoration: underline; text-underline-offset: 3px; }
.active-filter-row p { margin: 0; color: var(--ink-faint); font-size: 14px; }

.quote-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 6px; }
.quote-card {
  display: grid;
  align-content: start;
  gap: 0;
  width: 100%;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-strong);
  text-align: left;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.quote-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-small); }
.quote-card .q-no { display: block; margin-bottom: 10px; color: var(--ink-faint); font-family: Georgia, "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, Batang, serif; font-size: 14px; font-weight: 800; letter-spacing: .06em; }
.quote-card .q-ko { margin: 0 0 12px; font-family: var(--serif); font-size: 20px; font-weight: 600; line-height: 1.55; letter-spacing: -.015em; word-break: keep-all; }
.quote-card .q-src { margin: 0 0 14px; color: var(--ink-soft); font-family: Georgia, "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, Batang, serif; font-size: 15px; font-style: italic; line-height: 1.55; }
.quote-card .q-by { margin: 0 0 12px; color: var(--ink-faint); font-size: 14px; font-weight: 800; }
.quote-card .q-by strong { color: var(--ink); font-weight: 850; }
.quote-card .q-by span { display: block; margin-top: 2px; font-weight: 700; }
.quote-card .q-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-faint);
  background: var(--paper);
  font-size: 14px;
  font-weight: 850;
}
.meta-chip.rank-A { border-color: color-mix(in srgb, var(--green) 62%, var(--line)); color: var(--green); }
.meta-chip.rank-B { border-color: color-mix(in srgb, var(--gold) 62%, var(--line)); color: var(--gold); }
.meta-chip.rank-C { color: var(--ink-faint); }
.meta-chip.caution-chip { border-color: color-mix(in srgb, var(--warning) 60%, var(--line)); color: var(--warning); background: color-mix(in srgb, var(--warning) 9%, var(--paper-strong)); }
.meta-chip .ui-icon { width: 14px; height: 14px; }
.empty-state { padding: 60px 20px; text-align: center; color: var(--ink-faint); }
.list-more { display: grid; justify-items: center; gap: 10px; margin-top: 30px; }
.list-more p { margin: 0; color: var(--ink-faint); font-size: 14px; }

/* 한계 */
.limit-callout {
  margin: 0 0 38px;
  padding: 26px 28px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  border-radius: 14px;
  background: var(--paper-strong);
  box-shadow: 5px 5px 0 color-mix(in srgb, var(--accent) 15%, transparent), 10px 10px 0 color-mix(in srgb, var(--accent) 7%, transparent);
}
.limit-callout p:last-child { margin-bottom: 0; }
.limit-callout strong { color: var(--accent-deep); }
.figure-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 40px; }
.figure-tile { padding: 22px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper-strong); }
.figure-tile strong { display: block; color: var(--accent); font-family: Georgia, "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, Batang, serif; font-size: 38px; line-height: 1.05; }
.figure-tile span { display: block; margin-top: 8px; color: var(--ink); font-size: 14px; font-weight: 850; }
.figure-tile small { display: block; margin-top: 5px; color: var(--ink-faint); font-size: 14px; line-height: 1.5; }
.dist-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 20px; }
.dist-tabs button { min-height: 40px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-strong); color: var(--ink-soft); font-size: 14px; font-weight: 850; }
.dist-tabs button:hover { border-color: var(--accent); color: var(--accent-deep); }
.dist-tabs button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: #fffaf5; }
.dist-chart { display: grid; gap: 9px; margin-bottom: 14px; }
.dist-row { display: grid; grid-template-columns: 168px 1fr 118px; align-items: center; gap: 12px; }
.dist-row .dist-name { color: var(--ink); font-size: 14px; font-weight: 800; overflow-wrap: anywhere; }
.dist-row .dist-track { height: 14px; overflow: hidden; border-radius: 999px; background: var(--paper-muted); }
.dist-row .dist-fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .3s ease; }
.dist-row.is-top .dist-fill { background: var(--accent-deep); }
.dist-row .dist-value { color: var(--ink-faint); font-size: 14px; font-weight: 800; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dist-note { margin: 0; color: var(--ink-faint); font-size: 14px; }
.limit-list { display: grid; gap: 0; margin: 40px 0 0; padding: 0; list-style: none; border-block: 1px solid var(--line); }
.limit-list li { display: grid; grid-template-columns: 52px 1fr; gap: 18px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.limit-list li:last-child { border-bottom: 0; }
.limit-list li > span { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--accent); border-radius: 50%; color: var(--accent); font-family: Georgia, "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, Batang, serif; font-weight: 800; }
.limit-list h3 { margin: 0 0 7px; font-size: 20px; }
.limit-list p { margin: 0; color: var(--ink-soft); font-size: 15px; }

.site-footer { display: flex; justify-content: space-between; gap: 30px; padding: 50px max(28px, calc((100vw - 1140px) / 2)); background: var(--dark); color: var(--dark-text); }
.site-footer strong { font-family: var(--serif); font-size: 22px; }
.site-footer p { margin: 8px 0 0; color: rgba(244,239,230,.62); font-size: 14px; }
.site-footer > div:last-child { text-align: right; }
.site-footer a { color: #d3b3e2; font-weight: 850; }

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1500;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper-strong);
  box-shadow: var(--shadow-small);
  color: var(--accent);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; transform: none; }
.back-to-top .ui-icon { width: 20px; height: 20px; }

dialog {
  width: min(820px, calc(100vw - 30px));
  max-height: calc(100vh - 30px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper-strong);
  color: var(--ink);
  box-shadow: 0 30px 100px rgba(0,0,0,.35);
}
dialog::backdrop { background: rgba(8, 9, 9, .66); backdrop-filter: blur(5px); }
.dialog-shell { position: relative; max-height: calc(100vh - 32px); padding: 34px 40px 42px; overflow-y: auto; overscroll-behavior: contain; }
.dialog-close { position: sticky; top: 0; float: right; z-index: 2; display: grid; place-items: center; width: 42px; height: 42px; margin: -18px -24px 0 0; border: 1px solid var(--line); border-radius: 50%; background: var(--paper-strong); }
.dialog-kicker { margin: 0 0 12px; color: var(--accent-deep); font-size: 14px; font-weight: 900; letter-spacing: .1em; }
.dialog-quote { margin: 0 0 22px; padding: 26px 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper-muted); }
.dialog-quote .d-ko { margin: 0 0 16px; font-family: var(--serif); font-size: clamp(23px, 3vw, 32px); font-weight: 650; line-height: 1.5; letter-spacing: -.02em; word-break: keep-all; }
.dialog-quote .d-src { margin: 0; color: var(--ink-soft); font-family: Georgia, "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, Batang, serif; font-size: 17px; font-style: italic; line-height: 1.6; }
.dialog-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; }
.detail-grid { display: grid; grid-template-columns: 138px 1fr; border-top: 1px solid var(--line); }
.detail-grid dt, .detail-grid dd { margin: 0; padding: 16px 0; border-bottom: 1px solid var(--line); }
.detail-grid dt { color: var(--ink-faint); font-size: 14px; font-weight: 900; }
.detail-grid dd { color: var(--ink-soft); font-size: 15px; overflow-wrap: anywhere; }
.caution-box { margin-top: 24px; padding: 18px; border: 1px solid color-mix(in srgb, var(--warning) 55%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--warning) 8%, var(--paper-strong)); }
.caution-box strong { display: block; margin-bottom: 4px; color: var(--warning); font-size: 15px; }
.caution-box p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-top: 26px; }
.dialog-actions .button { min-height: 46px; padding: 10px 18px; }
.dialog-status { margin: 0; color: var(--success); font-size: 14px; font-weight: 850; }
.dialog-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.dialog-nav button { min-height: 44px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink-soft); font-size: 14px; font-weight: 850; }
.dialog-nav button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-deep); }
.dialog-nav button:disabled { opacity: .4; cursor: default; }

@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr .84fr; }
  .filter-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .figure-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .quote-list { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  :root { --header-height: 62px; }
  .site-header .brand small { display: none; }
  .print-button { display: none; }
  .reading-tools { gap: 4px; }
  .tool-button { min-height: 38px; padding: 6px 8px; }
  .hero { grid-template-columns: 1fr; min-height: auto; padding: 60px 0 40px; }
  .hero-visual { min-height: 380px; order: 2; }
  .section { padding: 84px 0; }
  .grade-grid { grid-template-columns: 1fr; }
  .draw-card { padding: 32px 26px; }
  .dist-row { grid-template-columns: 118px 1fr 112px; }
}

@media (max-width: 620px) {
  :root { --reading-size: 17px; }
  html { scroll-padding-top: 78px; }
  .header-inner { width: calc(100% - 18px); gap: 5px; }
  .brand-mark { width: 31px; height: 31px; font-size: 19px; }
  .reading-tools .tool-button:nth-child(-n+2) { display: none; }
  .reading-column, .wide-reading { width: min(calc(100% - 26px), var(--reading-width)); }
  .hero { width: calc(100% - 26px); padding-top: 44px; }
  .hero h1 { font-size: clamp(36px, 11vw, 52px); }
  .hero-question { font-size: 21px; }
  .hero-lead { font-size: 16px; }
  .hero-actions { align-items: stretch; }
  .hero-actions .button { flex: 1 1 45%; }
  .hero-actions .text-link { flex-basis: 100%; }
  .hero-visual { min-height: 300px; }
  .section { padding: 68px 0; }
  .section-lead { margin-bottom: 28px; font-size: 16px; }
  .section-heading-row { align-items: flex-start; }
  .count-stamp strong { font-size: 34px; }
  .atlas-controls { top: calc(var(--header-height) + 6px); margin-inline: -4px; padding: 10px; border-radius: 12px; }
  .filter-row { display: flex; overflow-x: auto; padding-bottom: 5px; }
  .filter-row label { flex: 0 0 148px; }
  .active-filter-row { align-items: flex-start; }
  .quote-card { padding: 20px 18px; }
  .quote-card .q-ko { font-size: 19px; }
  .figure-row { grid-template-columns: 1fr; }
  .dist-row { grid-template-columns: 88px 1fr 104px; gap: 8px; }
  .limit-list li { grid-template-columns: 40px 1fr; gap: 12px; }
  .site-footer { flex-direction: column; padding: 38px 22px; }
  .site-footer > div:last-child { text-align: left; }
  .dialog-shell { padding: 24px 18px 34px; }
  .dialog-close { margin: -10px -6px 0 0; }
  .dialog-quote { padding: 20px 18px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid dt { padding-bottom: 0; border-bottom: 0; }
  .detail-grid dd { padding-top: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  :root { --paper: #fff; --paper-strong: #fff; --paper-muted: #f4f1eb; --ink: #111; --ink-soft: #333; --line: #bbb; }
  body { font-size: 11pt; }
  .site-header, .site-nav, .nav-backdrop, .hero-visual, .hero-actions, .atlas-controls, .author-strip, .draw-actions, .dist-tabs, .list-more, .back-to-top, .site-footer { display: none !important; }
  .hero { display: block; width: auto; min-height: auto; padding: 30px 0; }
  .section { padding: 26px 0; break-inside: avoid; }
  .reading-column, .wide-reading { width: 100%; max-width: none; }
  .quote-list { grid-template-columns: 1fr; }
  .quote-card { break-inside: avoid; box-shadow: none; }
  .section-dark { background: #fff; color: #111; }
  dialog { display: none; }
}

/* 아이콘은 인라인 SVG — 기호글자는 OS 마다 모양·기준선이 달라 정렬이 깨진다 */
.ui-icon { width: 16px; height: 16px; flex: 0 0 auto; display: block; }
.tool-button, .text-link, .icon-button, .dialog-close { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.hero-actions .text-link { gap: 7px; }
/* 스크롤바 — 폭을 항상 확보해 스크롤 유무로 레이아웃이 흔들리지 않게 */
html { scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: var(--line, rgba(0,0,0,.26)) transparent; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 999px; background: var(--line, rgba(0,0,0,.26)); background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--accent, #7c4b8e); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
.home-link { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; margin-right: 10px; text-decoration: none; color: var(--ink-faint); font-size: 14px; font-weight: 650; white-space: nowrap; }
.home-link:hover { color: var(--accent); }
@media (max-width: 760px) { .home-link span { display: none; } }
.home-link.book-link { margin-left: auto; margin-right: 4px; color: var(--accent); }
.home-link.book-link + .home-link { margin-left: 0; }
.nav-book-item a { display: inline-flex; align-items: center; gap: 7px; color: var(--accent); font-weight: 700; }
.nav-book-item a::before { content: none; }
