/* ============================================================
   글로 쓰는 초상화 — 모르는 사람에게서 온 편지
   크림 종이 · 먹 · 바랜 빨강 · 손으로 그린 선
   mobile-first (390px 기준)
   ============================================================ */

:root {
  --paper: #efe3d0;
  --paper-deep: #e7d8c1;
  --sheet: #fbf6ea;
  --card: #fcf7ec;
  --card-edge: #e3d4bb;
  --ink: #2c2621;          /* 먹 */
  --ink-soft: #564c42;
  --muted: #6b5d4c;
  --faint: #94846c;
  --seal: #b23b2c;         /* 도장 */
  --seal-dark: #8f2c20;
  --red-faded: #a5503f;    /* 바랜 빨강 */
  --line: rgba(44, 38, 33, .16);
  --line-soft: rgba(44, 38, 33, .08);
  --rule: rgba(44, 38, 33, .17);

  --serif: "Nanum Myeongjo", "Noto Serif KR", "Apple SD Gothic Neo", serif;
  --hand: "Nanum Pen Script", "Nanum Myeongjo", cursive;
  --sans: "Apple SD Gothic Neo", "Malgun Gothic", system-ui, -apple-system, sans-serif;

  --pad: 18px;
  --radius: 3px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* display를 준 버튼도 hidden이면 확실히 숨깁니다 */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--paper);
  /* 아주 옅은 모눈 — 편지지 밑에 깔린 받침 같은 결 */
  background-image:
    linear-gradient(rgba(44, 38, 33, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(44, 38, 33, .035) 1px, transparent 1px),
    radial-gradient(120% 80% at 50% -10%, #f6eddd 0%, var(--paper) 50%, var(--paper-deep) 100%);
  background-size: 26px 26px, 26px 26px, 100% 100%;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.7;
  letter-spacing: -0.01em;
  overflow-x: hidden;
}

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* 종이 결 */
.paper-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  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='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.16'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* ── 종이 위 낙서 ── */
.doodles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  color: var(--ink);
  opacity: .32;
}

.dd { position: absolute; display: block; overflow: visible; }
.dd-1  { width: 14px; height: 14px; top: 9%;  left: 6%; }
.dd-2  { width: 16px; height: 16px; top: 22%; right: 5%; color: var(--red-faded); }
.dd-3  { width: 20px; height: 20px; top: 46%; left: 3%; }
.dd-4  { width: 36px; height: 20px; top: 63%; right: 3%; }
.dd-5  { width: 16px; height: 11px; top: 80%; left: 7%; }
.dd-6  { width: 12px; height: 12px; top: 92%; right: 12%; }
.dd-7  { width: 14px; height: 14px; top: 35%; left: 46%; display: none; }
.dd-8  { width: 40px; height: 22px; top: 12%; left: 30%; display: none; }
.dd-9  { width: 20px; height: 20px; top: 74%; left: 40%; display: none; }
.dd-10 { width: 12px; height: 12px; top: 54%; right: 30%; display: none; }

#app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 var(--pad) calc(44px + env(safe-area-inset-bottom));
}

/* ── 상단 ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 4px;
  min-height: 48px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand-seal {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 2px;
  background: var(--seal);
  color: #fbeee6;
  font-size: 12px;
  font-weight: 800;
  transform: rotate(-5deg);
  opacity: .92;
}

/* ── 화면 전환 ── */
.screen { display: none; }
.screen.is-active {
  display: block;
  animation: fadeUp .5s cubic-bezier(.2, .7, .3, 1) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ── 손그림 공통 ── */
.env-flap  { fill: #e9dcc5; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
.env-body  { fill: #f3e9d6; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
.env-fold  { fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linejoin: round; stroke-linecap: round; }
.env-fold-soft { opacity: .35; }
.letter    { fill: #fffcf4; stroke: var(--ink); stroke-width: 1.4; }
.letter-hand { font-family: var(--hand); font-size: 22px; fill: var(--ink); }
.letter-line { fill: none; stroke: var(--ink-soft); stroke-width: 1.2; stroke-linecap: round; opacity: .55; }
.letter-seal { fill: var(--seal); opacity: .9; }
.letter-seal-t { font-family: var(--serif); font-weight: 800; font-size: 13px; fill: #fbeee6; text-anchor: middle; }

.stamp       { fill: #f8efdf; }
.stamp-perf  { fill: none; stroke: var(--perf, #f3e9d6); stroke-width: 5; stroke-dasharray: 0 6; stroke-linecap: round; }
.stamp-frame { fill: none; stroke: var(--red-faded); stroke-width: 1.1; opacity: .8; }
.stamp-nib   { fill: none; stroke: var(--red-faded); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.stamp-dot   { fill: var(--red-faded); }
.stamp-t     { font-family: var(--serif); font-size: 7px; font-weight: 700; fill: var(--red-faded); text-anchor: middle; letter-spacing: .05em; }

/* ── 인트로 ── */
.intro-hero {
  margin: 6px -6px 6px;
  color: var(--ink);
}

.hero-art {
  display: block;
  width: 100%;
  max-width: 360px;
  height: auto;
  margin: 0 auto;
  overflow: visible;
}

.hero-shadow { fill: var(--ink); opacity: .07; }
.hero-doodle { color: var(--ink); opacity: .5; }
.hero-plane { color: var(--red-faded); }
.hero-art .stamp-perf { --perf: var(--paper); }

.hero-float { animation: drift 7s ease-in-out infinite; transform-origin: 160px 140px; }

@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(0); }
  50%      { transform: translateY(-4px) rotate(.4deg); }
}

.intro-title {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(40px, 12vw, 56px);
  line-height: 1.16;
  letter-spacing: -0.05em;
  margin: 0 0 8px;
  color: var(--ink);
}

.intro-sub {
  font-family: var(--hand);
  line-height: 1.35;
  font-size: 23px;
  line-height: 1.3;
  color: var(--red-faded);
  margin: 0 0 26px;
  transform: rotate(-1deg);
  transform-origin: left center;
}

.intro-copy p {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.9;
  color: var(--ink-soft);
  margin: 0 0 12px;
}

.intro-copy strong {
  color: var(--ink);
  font-weight: 700;
  background: linear-gradient(transparent 62%, rgba(178, 59, 44, .14) 62%, rgba(178, 59, 44, .14) 92%, transparent 92%);
}

.intro-copy .muted { color: var(--muted); font-size: 16px; }

.intro-actions {
  margin-top: 30px;
  display: grid;
  gap: 12px;
}

.intro-foot {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 2;
  color: var(--muted);
}

.intro-foot strong { color: var(--ink-soft); font-weight: 700; }

/* 첫 화면 아래, 검색·AI가 읽을 수 있는 짧은 질문. 기존 구분선·손글씨 제목과 같은 결 */
.site-faq {
  margin: 30px 0 0;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

.site-faq .choices-head {
  margin-bottom: 2px;
  font-weight: 400;
}

.faq-list { margin: 0; }

.faq-item {
  margin: 0;
  padding: 14px 0 13px;
  border-bottom: 1px solid var(--line-soft);
}

.faq-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.faq-item h3 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.faq-item p {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink-soft);
}

/* ── 버튼 ── */
.btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 100%;
  min-height: 56px;
  padding: 13px 18px 12px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .2s ease;
}

.btn-sub {
  font-family: var(--hand);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0;
  opacity: .78;
}

/* 먹으로 찍은 듯: 아래로 살짝 밀린 그림자 선 */
.btn-primary {
  background: var(--ink);
  color: #f8f1e4;
  box-shadow: 3px 3px 0 0 rgba(178, 59, 44, .55);
}

.btn-outline {
  background: rgba(251, 246, 234, .7);
  color: var(--ink);
  box-shadow: 3px 3px 0 0 rgba(44, 38, 33, .14);
}

.btn-warm {
  background: var(--seal);
  border-color: var(--seal-dark);
  color: #fdf3ea;
  box-shadow: 3px 3px 0 0 rgba(44, 38, 33, .3);
}

.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 0 rgba(44, 38, 33, .2); }

.btn:disabled {
  opacity: .36;
  cursor: default;
  box-shadow: none;
  transform: none;
}

.btn:focus-visible,
.ghost-btn:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 3px;
}

.ghost-btn {
  background: none;
  border: none;
  padding: 10px 4px;
  min-height: 44px;
  font-family: var(--serif);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: wavy;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(143, 130, 115, .55);
}

.ghost-btn:active,
.ghost-btn:hover { color: var(--ink); }

/* ── 입력: 편지지 줄 위에 쓰기 ── */
.field {
  display: block;
  margin: 26px 0 0;
}

.field-label {
  display: block;
  font-family: var(--serif);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.field-label .opt { font-weight: 400; color: var(--muted); }

.field-hint {
  display: block;
  margin-top: 6px;
  font-family: var(--serif);
  font-size: 15.5px;
  color: var(--muted);
  line-height: 1.8;
}

input[type="text"],
input[type="email"],
textarea {
  --lh: 34px;
  display: block;
  width: 100%;
  padding: 0 2px;
  background-color: transparent;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--lh) - 1px),
    var(--rule) calc(var(--lh) - 1px),
    var(--rule) var(--lh)
  );
  background-attachment: local;
  border: none;
  border-radius: 0;
  font-family: var(--serif);
  font-size: 18px;              /* iOS 자동 확대 방지 */
  line-height: var(--lh);
  color: var(--ink);
  resize: none;
  transition: background-image .2s ease;
}

input[type="text"] {
  height: var(--lh);
  border-bottom: 1px solid var(--rule);
  background-image: none;
}

input[type="text"]:focus,
textarea:focus {
  outline: none;
  --rule: rgba(178, 59, 44, .45);
}

input[type="text"]:focus { border-bottom-color: rgba(178, 59, 44, .55); }

::placeholder { color: var(--faint); font-family: var(--serif); }

/* ── 질문: 편지지 한 장 ── */
.sheet {
  position: relative;
  margin-top: 12px;
  padding: 22px 20px 24px;
  background: var(--sheet);
  border: 1px solid var(--card-edge);
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 14px 30px -24px rgba(60, 48, 34, .7);
}

/* 편지지 왼쪽 여백선 */
.sheet::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 11px;
  width: 1px;
  background: rgba(178, 59, 44, .22);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dots {
  display: flex;
  gap: 5px;
  margin: 0;
}

.dot {
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: rgba(44, 38, 33, .16);
  transform: rotate(-8deg);
  transition: background .3s ease, transform .3s ease;
}

.dot:nth-child(even) { transform: rotate(6deg); }
.dot.is-done { background: rgba(44, 38, 33, .62); }
.dot.is-now { background: var(--seal); transform: rotate(-8deg) scaleX(1.25); }

.quiz-count {
  font-family: var(--hand);
  font-size: 24px;
  line-height: 1.2;
  color: var(--red-faded);
  margin: 0;
}

#screen-commission > .quiz-count { margin: 14px 0 8px; }

.quiz-ask {
  font-family: var(--serif);
  font-size: clamp(24px, 6.8vw, 29px);
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: -0.035em;
  margin: 0 0 8px;
  color: var(--ink);
}

.quiz-hint {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.9;
  color: var(--muted);
  margin: 0 0 16px;
}

.answer-block { margin-bottom: 4px; }

.why-block {
  margin-top: 20px;
  animation: fadeUp .35s ease both;
}

.why-ask {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.5;
  margin: 0 0 4px;
  color: var(--ink-soft);
}

.why-ask::before {
  content: "— ";
  color: var(--red-faded);
}

.quiz-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
}

.quiz-actions .btn { flex: 1; }

/* ── 생성 중 ── */
#screen-loading {
  text-align: center;
  padding: 20vh 0 0;
}

.loading-art {
  display: block;
  width: 132px;
  height: auto;
  margin: 0 auto 14px;
  overflow: visible;
  color: var(--red-faded);
}

.loading-plane { animation: fly 2.4s ease-in-out infinite; }

@keyframes fly {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(4px, -4px); }
}

.typing-machine {
  display: inline-flex;
  gap: 7px;
  margin-bottom: 18px;
}

.typing-machine span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
  opacity: .3;
  animation: tap 1.1s infinite ease-in-out;
}

.typing-machine span:nth-child(2) { animation-delay: .16s; }
.typing-machine span:nth-child(3) { animation-delay: .32s; background: var(--seal); }

@keyframes tap {
  0%, 70%, 100% { opacity: .22; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-5px); }
}

.loading-text {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 4px;
}

.loading-sub {
  font-family: var(--hand);
  font-size: 21px;
  color: var(--red-faded);
  margin: 0;
}

/* ── 결과 ── */
.result-lead {
  font-family: var(--hand);
  font-size: 23px;
  line-height: 1.3;
  color: var(--red-faded);
  margin: 12px 0 14px;
  transform: rotate(-1deg);
  transform-origin: left center;
}

.postcard {
  position: relative;
  background: linear-gradient(178deg, #fffdf7 0%, var(--card) 42%, #f7f0e2 100%);
  border: 1px solid var(--card-edge);
  border-radius: 2px;
  padding: 16px 18px 16px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .8) inset,
    0 20px 40px -26px rgba(60, 48, 34, .8),
    0 2px 8px -4px rgba(60, 48, 34, .25);
  overflow: hidden;
}

.postcard::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23p)' opacity='0.13'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.postcard-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 18px;
  border-bottom: 1px dashed var(--line);
}

.pc-head-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 4px;
  min-width: 0;
}

.pc-label {
  font-family: var(--serif);
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--ink-soft);
}

.pc-from {
  font-family: var(--hand);
  font-size: 20px;
  line-height: 1.2;
  color: var(--red-faded);
}

.pc-post {
  position: relative;
  flex: none;
  width: 124px;
  height: 74px;
  transform-origin: top right;
}

.pc-stamp {
  position: absolute;
  right: 0;
  top: 0;
  width: 54px;
  height: 65px;
  transform: rotate(4deg);
  filter: drop-shadow(0 1px 1px rgba(60, 48, 34, .18));
  --perf: var(--card);
}

.pc-postmark {
  position: absolute;
  left: 0;
  top: 10px;
  width: 78px;
  height: 60px;
  color: var(--red-faded);
  opacity: .78;
  mix-blend-mode: multiply;
  transform: rotate(-10deg);
}

.pm-wave {
  position: absolute;
  left: -6px;
  top: 18px;
  width: 30px;
  height: 22px;
}

.pm-wave path { fill: none; stroke: currentColor; stroke-width: 1.3; }

.pm-ring {
  position: absolute;
  right: 0;
  top: 0;
  width: 58px;
  height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 1.4px solid currentColor;
  border-radius: 50%;
  box-shadow: 0 0 0 2.5px rgba(252, 247, 236, .6), 0 0 0 3.6px currentColor;
  background: var(--card);
}

.pm-top {
  font-family: var(--serif);
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
}

.pc-date {
  font-family: var(--serif);
  font-size: 7.5px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: currentColor;
}

.pc-body {
  font-family: var(--serif);
  font-size: clamp(16px, 4.3vw, 18px);
  line-height: 2;
  letter-spacing: 0.005em;
  color: #362e27;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  min-height: 12em;
}

.pc-body .ln { display: block; min-height: 2em; }
.pc-body .ln.is-blank { min-height: .7em; }

.pc-body .ln-name {
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: .45em;
}

.pc-body .caret {
  display: inline-block;
  width: .55em;
  height: 1em;
  margin-left: .08em;
  vertical-align: -0.12em;
  background: currentColor;
  opacity: .55;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink { 0%, 55% { opacity: .55; } 56%, 100% { opacity: 0; } }

.postcard-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.pc-sign { display: flex; flex-direction: column; gap: 0; }

.pc-sign-main {
  font-family: var(--serif);
  font-size: 15.5px;
  font-weight: 800;
  color: var(--ink-soft);
}

.pc-sign-sub {
  font-family: var(--hand);
  font-size: 18px;
  line-height: 1.2;
  color: var(--muted);
}

.pc-seal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 2px;
  background: linear-gradient(150deg, var(--seal) 0%, var(--seal-dark) 100%);
  color: #fbeee6;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: 0;
  transform: rotate(-4deg);
  box-shadow: 0 2px 6px -3px rgba(143, 44, 32, .8), 0 0 0 1px rgba(255, 255, 255, .25) inset;
  opacity: .93;
}

.pc-seal span { display: block; }

.pc-shadow { display: none; }

.skip-btn {
  display: block;
  margin: 10px auto 0;
}

.keyword-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 18px 0 0;
}

.kw-chip {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink-soft);
  padding: 0 1px 1px;
  border-bottom: 1px solid rgba(178, 59, 44, .35);
}

.kw-chip b {
  font-family: var(--hand);
  font-size: 18px;
  font-weight: 400;
  color: var(--red-faded);
  margin-right: 5px;
}

.result-actions {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.result-note {
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.9;
  color: var(--muted);
  margin: 12px 0 0;
}

.result-secondary {
  display: flex;
  gap: 18px;
  justify-content: center;
  margin-top: 10px;
}

/* 추신처럼 덧붙이는 의뢰 안내 */
.commission-cta {
  position: relative;
  margin-top: 34px;
  padding: 22px 0 0;
  border-top: 1.5px solid var(--ink);
}

.cta-eyebrow {
  font-family: var(--hand);
  font-size: 21px;
  line-height: 1.2;
  color: var(--seal);
  margin: 0 0 6px;
}

.cta-copy {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 2;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

.cta-copy strong { color: var(--ink); }

.cta-paid {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.95;
  color: var(--muted);
  margin: 0 0 18px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.cta-paid strong { color: var(--seal); font-weight: 700; }

.cta-paid a {
  color: var(--ink-soft);
  text-underline-offset: 2px;
}

.btn-warm .btn-sub { opacity: .85; }

/* ── 유료 안내 (의뢰·접수 화면) ── */
.paid-banner {
  margin: 16px 0 0;
  padding: 10px 14px;
  background: rgba(178, 59, 44, .05);
  border-left: 2px solid rgba(178, 59, 44, .4);
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.95;
  color: var(--ink-soft);
}

.paid-banner strong { color: var(--seal); font-weight: 700; }

.paid-banner a {
  color: var(--ink-soft);
  text-underline-offset: 2px;
}

/* ── 다음 이야기 예고 ── */
.teaser {
  margin-top: 30px;
  padding: 18px 0 0;
  border-top: 1px dashed var(--line);
}

.teaser-eyebrow {
  font-family: var(--hand);
  font-size: 20px;
  line-height: 1.2;
  color: var(--muted);
  margin: 0 0 6px;
}

.teaser-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.teaser-copy {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 2;
  color: var(--muted);
  margin: 0;
}

.teaser-actions {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
}

.teaser-actions .btn { text-align: left; }

.teaser-foot { margin: 12px 0 0; }

.teaser-foot a {
  font-family: var(--serif);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--red-faded);
  text-decoration: underline;
  text-decoration-style: wavy;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}

.teaser-foot a:hover { color: var(--ink); }

/* ── 의뢰 ── */
.summary-box {
  margin: 20px 0 4px;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
}

.summary-box summary {
  padding: 12px 2px;
  min-height: 44px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
}

.summary-body {
  padding: 0 2px 14px;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.95;
  color: var(--ink-soft);
}

.summary-item { padding: 8px 0; border-top: 1px dashed var(--line-soft); }
.summary-item .q { color: var(--red-faded); font-size: 17px; font-family: var(--hand); }
.summary-item .a { display: block; margin-top: 2px; font-weight: 700; }
.summary-item .w { display: block; margin-top: 2px; color: var(--muted); }

/* ── 완료 ── */
#screen-done { padding-top: 8px; }

.done-mark {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 2px solid var(--seal);
  border-radius: 50%;
  color: var(--seal);
  font-size: 24px;
  font-weight: 800;
  margin: 18px 0 16px;
  transform: rotate(-10deg);
  opacity: .85;
}

.receipt {
  margin-top: 20px;
  padding: 16px;
  background: var(--sheet);
  border: 1px solid var(--card-edge);
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.95;
  color: var(--ink-soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ── 토스트 ── */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(26px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(8px);
  background: var(--ink);
  color: #f8f1e4;
  font-family: var(--serif);
  font-size: 16px;
  padding: 11px 18px;
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 0 rgba(178, 59, 44, .5);
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 120;
  max-width: calc(100vw - 40px);
  text-align: center;
}

.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── 넓은 화면 ── */
@media (min-width: 620px) {
  #app { padding-left: 0; padding-right: 0; }
  .postcard { padding: 26px 30px 24px; }
  .postcard-head { min-height: 104px; }
  .pc-post { transform: scale(1.3); }
  .pc-label { font-size: 16px; }
  .pc-from { font-size: 23px; }
  .sheet { padding: 30px 32px 30px; }
  .sheet::before { left: 16px; }
  .result-actions { grid-template-columns: 1fr 1fr; }
  #btn-png { grid-column: 1 / -1; }
  .doodles { opacity: .4; }
  .dd-7, .dd-8, .dd-9, .dd-10 { display: block; }
  .dd-1 { width: 18px; height: 18px; left: 12%; }
  .dd-3 { width: 26px; height: 26px; left: 14%; }
  .dd-2 { width: 22px; height: 22px; right: 14%; }
  .dd-4 { width: 50px; height: 28px; right: 12%; }
  .dd-7 { left: auto; right: 22%; top: 84%; }
  .dd-8 { left: 6%; top: 28%; }
  .dd-9 { left: 20%; }
  .dd-10 { right: 8%; top: 42%; }
}

@media (min-width: 1000px) {
  #app { max-width: 600px; }
}

/* ── 움직임 최소화 ── */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .screen.is-active { animation: none; }
}

/* ── 2단계: 책 선택·소개 ── */
.book-choices {
  margin: 30px 0 0;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

.choices-head {
  font-family: var(--hand);
  font-size: 21px;
  color: var(--red-faded);
  margin: 0 0 10px;
}

.choice-grid {
  display: grid;
  gap: 10px;
}

.book-choice {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "no title"
    "copy copy"
    "go go";
  gap: 2px 10px;
  width: 100%;
  padding: 15px 17px 14px;
  text-align: left;
  font-family: var(--serif);
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 8px 20px -18px rgba(60, 48, 34, .8);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.book-choice:hover,
.book-choice:focus-visible {
  border-color: rgba(178, 59, 44, .5);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 10px 24px -18px rgba(60, 48, 34, .9);
  transform: translateY(-1px);
}

.choice-no {
  grid-area: no;
  font-family: var(--serif);
  align-self: center;
  font-size: 18px;
  color: var(--seal);
}

.choice-title {
  grid-area: title;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.choice-copy {
  grid-area: copy;
  margin-top: 4px;
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink-soft);
}

.choice-go {
  grid-area: go;
  margin-top: 8px;
  font-family: var(--hand);
  font-size: 20px;
  color: var(--red-faded);
}

.book-intro-title {
  font-family: var(--serif);
  font-size: clamp(28px, 7.6vw, 36px);
  font-weight: 800;
  line-height: 1.32;
  letter-spacing: -0.04em;
  margin: 6px 0 10px;
  color: var(--ink);
}

.book-lead {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.85;
  color: var(--ink-soft);
  margin: 0 0 12px;
}

.book-copy p {
  font-size: 17px;
  line-height: 1.9;
  color: var(--ink-soft);
  margin: 0 0 8px;
}

.book-back { display: block; margin: 14px auto 0; }

.voice-guide {
  margin: 26px 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink-soft);
}

.voice-guide strong { color: var(--seal); }

/* ── 말로 입력 ── */
.voice-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.voice-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 8px 16px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  background: rgba(252, 247, 236, .9);
  border: 1.5px dashed rgba(44, 38, 33, .35);
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.voice-btn:hover { border-color: var(--seal); color: var(--seal); }

.voice-btn.is-recording {
  color: #fff8ef;
  background: var(--seal);
  border-style: solid;
  border-color: var(--seal-dark);
  animation: micPulse 1.4s ease-in-out infinite;
}

.voice-btn.is-unsupported { border-style: dotted; }

@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(178, 59, 44, .35); }
  50% { box-shadow: 0 0 0 7px rgba(178, 59, 44, 0); }
}

.voice-tip {
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--muted);
}

.voice-note {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.8;
  color: var(--seal-dark);
}

/* ── 2단계: 책 한 장 ── */
.book-page {
  position: relative;
  background: linear-gradient(178deg, #fffdf7 0%, var(--card) 46%, #f7f0e2 100%);
  border: 1px solid var(--card-edge);
  border-radius: 2px;
  padding: 30px 22px 24px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .8) inset,
    0 20px 40px -26px rgba(60, 48, 34, .8),
    0 2px 8px -4px rgba(60, 48, 34, .25);
  overflow: hidden;
}

.book-page::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 14px;
  width: 1px;
  background: rgba(178, 59, 44, .2);
}

.book-page-head {
  padding-bottom: 16px;
  margin-bottom: 22px;
  border-bottom: 1px dashed var(--line);
  text-align: center;
}

.book-page-kicker {
  font-family: var(--hand);
  font-size: 18px;
  color: var(--red-faded);
  margin: 0 0 10px;
}

.book-page-title {
  font-family: var(--serif);
  font-size: clamp(26px, 7vw, 34px);
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0 0 8px;
}

.book-page-sub {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0;
}

.book-chapters .chapter { margin: 0 0 26px; }

.chapter-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(178, 59, 44, .22);
}

.chapter-no {
  flex: none;
  min-width: 1.1em;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  color: var(--seal);
  transform: translateY(-1px);
}

.book-chapters p {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 2.05;
  color: #332b24;
  margin: 0 0 12px;
  text-align: justify;
  text-justify: inter-ideograph;
}

.book-chapters p:last-child { margin-bottom: 0; }

.book-page-foot {
  margin-top: 26px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-family: var(--serif);
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--muted);
  text-align: center;
}

.book-cta-title {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.55;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 10px;
}

.book-cta .btn-warm { display: block; text-align: center; text-decoration: none; }
.book-cta .btn-warm:hover { color: #fff8ef; }

/* ── 인쇄 / PDF ── */
/* 인쇄는 화면 상태에 그대로 기대어 동작합니다(자바스크립트 타이밍에 기대지 않습니다). */
@media print {
  @page { margin: 16mm 14mm; }

  html, body { background: #fff !important; }

  .paper-grain, .doodles, .topbar, #toast, .defs, .site-foot, .login { display: none !important; }

  #app { max-width: none; padding: 0; }

  /* 책 결과 화면에서 인쇄하면 책 한 장만 나갑니다. */
  #screen-book-result.is-active > *:not(.book-page) { display: none !important; }
  #screen-book-result.is-active .book-page {
    border: none;
    box-shadow: none;
    background: #fff;
    padding: 0;
  }

  #screen-book-result.is-active .book-page::before { display: none; }
  #screen-book-result.is-active .chapter { break-inside: avoid; page-break-inside: avoid; }
  #screen-book-result.is-active .book-page-title { font-size: 24pt; }
  #screen-book-result.is-active .book-chapters p { font-size: 11.5pt; line-height: 1.9; }
  #screen-book-result.is-active .chapter-head { font-size: 13pt; }
  #screen-book-result.is-active .book-page-kicker,
  #screen-book-result.is-active .book-page-sub,
  #screen-book-result.is-active .book-page-foot { color: #444; }
}

/* ── 로그인 · 보관함 · 개인정보 처리방침 ── */

a.brand { color: inherit; text-decoration: none; }

.topbar { flex-wrap: wrap; row-gap: 2px; }
.topbar-menu { flex-wrap: wrap; justify-content: flex-end; }

.site-foot {
  margin-top: 36px;
  padding: 16px 0 8px;
  border-top: 1px dashed var(--line);
  text-align: center;
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--muted);
}

.site-foot a { color: var(--ink-soft); }

.account-who {
  margin: 0 0 8px;
  font-size: 15.5px;
  color: var(--muted);
  word-break: break-all;
}

#btn-save-portrait,
#btn-save-book { grid-column: 1 / -1; }

body.login-open { overflow: hidden; }

.login {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.login-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(32, 26, 21, .58);
}

.login-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  max-height: min(92dvh, 760px);
  overflow: auto;
  padding: 22px 18px 16px;
  background: var(--sheet);
  border: 1px solid var(--card-edge);
  border-radius: 2px;
  box-shadow: 0 24px 60px -28px rgba(30, 22, 14, .8);
}

.login-panel h2,
.library-reader h2,
.withdraw h2,
.policy h2 {
  margin: 28px 0 8px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.4;
  color: var(--ink);
}

.login-panel h2 { margin-top: 0; }

.login-lead,
.policy-lead {
  margin: 0 0 12px;
  font-size: 16.5px;
  line-height: 1.85;
  color: var(--ink-soft);
}

.login-status {
  min-height: 1.6em;
  margin: 12px 0 0;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 16px 0 18px;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.consent input {
  width: 20px;
  height: 20px;
  margin-top: 4px;
  flex: none;
  accent-color: var(--seal);
}

.login-soon {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.is-soon { opacity: .55; }

.draft-banner {
  margin: 12px 0 16px;
  padding: 12px 14px;
  border: 1.5px solid var(--seal);
  background: rgba(178, 59, 44, .08);
  color: var(--seal-dark);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 800;
}

.policy-title {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: clamp(32px, 8vw, 42px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.25;
}

.policy-facts {
  margin: 8px 0 0;
}

.policy-facts div {
  display: grid;
  grid-template-columns: 5.5em 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 16px;
}

.policy-facts dt { color: var(--muted); font-weight: 700; }
.policy-facts dd { margin: 0; color: var(--ink); }

.policy h2 { margin-top: 32px; }

.policy p,
.policy li,
.withdraw p {
  font-size: 16.5px;
  line-height: 1.85;
  color: var(--ink-soft);
}

.policy ul { margin: 0; padding-left: 1.15em; }
.policy li + li { margin-top: 8px; }
.policy a,
.withdraw a,
.consent a { color: var(--seal-dark); }

.library-booting {
  margin: 28px 0;
  font-size: 16.5px;
  color: var(--muted);
}

.library-count {
  margin: 0 0 8px;
  font-family: var(--hand);
  font-size: 22px;
  color: var(--red-faded);
}

.library-list { display: grid; gap: 12px; }

.library-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  align-items: start;
  padding: 12px 12px 8px;
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-left: 3px solid var(--seal);
}

.library-open {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 0;
  text-align: left;
  color: inherit;
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.library-kind {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--seal-dark);
}

.library-card-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.45;
}

.library-excerpt,
.library-date {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--muted);
}

.library-delete { justify-self: end; }

.library-reader h2 {
  margin: 8px 0;
  font-size: 26px;
}

.saved-qa,
.saved-chapter {
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}

.saved-qa h3,
.saved-chapter h3 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.5;
}

.saved-q { color: var(--muted); }
.saved-a,
.saved-why { margin: 4px 0; }

.saved-lines {
  margin-top: 8px;
  padding: 16px 14px;
  background: var(--card);
  border: 1px solid var(--card-edge);
  font-size: 16.5px;
  line-height: 1.9;
}

.saved-lines .ln { display: block; min-height: 1.7em; }
.saved-lines .ln.is-blank { min-height: .7em; }
.saved-lines .ln-name { font-weight: 800; margin-bottom: .35em; }

.withdraw {
  margin-top: 36px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

/* ── 자료실: 책 · 실제 글초상화 ─────────────────────────────── */

.topbar-menu { display: flex; align-items: center; gap: 2px; }

.topbar-archive {
  font-family: var(--sans);
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 10px 8px;
}

/* 첫 화면의 자료실 입구 */
.archive-entry {
  margin: 30px 0 0;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

.archive-entry-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "seal title"
    "copy copy"
    "go go";
  gap: 3px 10px;
  width: 100%;
  padding: 15px 17px 14px;
  text-align: left;
  font-family: var(--serif);
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-left: 3px solid var(--seal);
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 8px 20px -18px rgba(60, 48, 34, .8);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.archive-entry-card:hover,
.archive-entry-card:focus-visible {
  border-color: rgba(178, 59, 44, .5);
  border-left-color: var(--seal-dark);
  transform: translateY(-1px);
}

.archive-entry-seal {
  grid-area: seal;
  align-self: center;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 2px;
  background: var(--seal);
  color: #fbeee6;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 800;
  transform: rotate(-4deg);
}

.archive-entry-title {
  grid-area: title;
  align-self: center;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.archive-entry-copy {
  grid-area: copy;
  margin-top: 6px;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.archive-entry-go {
  grid-area: go;
  margin-top: 8px;
  font-family: var(--hand);
  font-size: 19px;
  color: var(--seal);
}

/* 모달 */
.archive {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.archive-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(32, 26, 21, .58);
  backdrop-filter: blur(2px);
}

.archive-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(44, 38, 33, .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(44, 38, 33, .03) 1px, transparent 1px),
    radial-gradient(120% 80% at 50% -10%, #f6eddd 0%, var(--paper) 56%, var(--paper-deep) 100%);
  background-size: 26px 26px, 26px 26px, 100% 100%;
  box-shadow: 0 24px 60px -28px rgba(30, 22, 14, .8);
  animation: archive-in .22s ease-out;
}

@keyframes archive-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

body.archive-open { overflow: hidden; }

.archive-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: linear-gradient(rgba(239, 227, 208, .97), rgba(239, 227, 208, .9));
  border-bottom: 1px solid var(--line);
}

.archive-bar-label {
  margin: 0;
  font-family: var(--sans);
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--muted);
}

.archive-close {
  min-height: 44px;
  padding: 10px 6px;
  background: none;
  border: none;
  font-family: var(--sans);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.archive-close:focus-visible,
.archive-foot-close:focus-visible,
.archive-entry-card:focus-visible { outline: 2px solid var(--seal); outline-offset: 3px; }

.archive-body {
  outline: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 18px calc(40px + env(safe-area-inset-bottom));
}

.archive-kicker {
  margin: 0;
  font-family: var(--sans);
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--seal);
}

.archive-title {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.42;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.archive-lead {
  margin: 12px 0 0;
  font-size: 16.5px;
  line-height: 1.82;
  color: var(--ink-soft);
}

/* 책 소개 */
.archive-book {
  margin: 22px 0 0;
  padding: 18px 16px;
  background: var(--sheet);
  border: 1px solid var(--card-edge);
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset;
}

.archive-cover { margin: 0; }
.archive-cover img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1px;
  filter: drop-shadow(0 8px 16px rgba(60, 48, 34, .22));
}
.archive-cover figcaption {
  margin-top: 8px;
  font-size: 15.5px;
  color: var(--muted);
  text-align: center;
}

.archive-book-title {
  margin: 16px 0 0;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.archive-book-sub {
  margin: 4px 0 0;
  font-family: var(--hand);
  font-size: 20px;
  color: var(--red-faded);
}

.archive-book-copy {
  margin: 12px 0 0;
  font-size: 16.5px;
  line-height: 1.85;
  color: var(--ink-soft);
}

.archive-facts {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 15.5px;
}
.archive-facts > div {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px;
  padding: 3px 0;
}
.archive-facts dt {
  color: var(--faint);
  font-weight: 700;
}
.archive-facts dd {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* 사진 */
.archive-section-title {
  margin: 30px 0 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.archive-note {
  margin: 10px 0 0;
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--muted);
}

.archive-figure { margin: 18px 0 0; }
.archive-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--card-edge);
  border-radius: 1px;
  box-shadow: 0 10px 22px -18px rgba(60, 48, 34, .85);
}
.archive-figure figcaption {
  margin-top: 8px;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--muted);
}

/* 책 속 글 */
.archive-piece {
  margin: 22px 0 0;
  padding: 20px 17px 16px;
  background: var(--sheet);
  border: 1px solid var(--card-edge);
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 10px 24px -22px rgba(60, 48, 34, .8);
}

.piece-quote {
  margin: 0 0 12px;
  padding: 0 0 12px 0;
  border-bottom: 1px dashed var(--line);
  font-family: var(--hand);
  font-size: 21px;
  line-height: 1.55;
  color: var(--red-faded);
}

.piece-title {
  margin: 0;
  font-size: 21px;
  line-height: 1.45;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.piece-body { margin: 12px 0 0; }
.piece-body p {
  margin: 0 0 10px;
  font-size: 17px;
  line-height: 1.92;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.piece-body p:last-child { margin-bottom: 0; }

.piece-source {
  margin: 14px 0 0;
  font-size: 15.5px;
  color: var(--faint);
  text-align: right;
}

.archive-foot {
  margin: 30px 0 0;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 12px;
}
.archive-foot .archive-note { margin: 0; }
.archive-foot .btn { width: 100%; }
.archive-foot-close { justify-self: center; }

@media (min-width: 620px) {
  .archive { align-items: center; padding: 24px; }
  .archive-panel {
    max-height: min(94dvh, 1000px);
    border-radius: 3px;
    border: 1px solid rgba(44, 38, 33, .18);
  }
  .archive-body { padding: 24px 30px 40px; }
  .archive-cover { max-width: 460px; margin: 0 auto; }
  .archive-book-title, .archive-book-sub, .archive-book-copy { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .archive-panel { animation: none; }
}

/* 자료실은 인쇄 대상이 아닙니다 */
@media print {
  .archive { display: none !important; }
}
