/* 색상은 이곳에서 한 번에 수정할 수 있습니다. */
:root {
  color-scheme: light;
  --background: #faf9f6;
  --ink: #20243a;
  --muted: #636678;
  --purple: #6554c0;
  --purple-dark: #473698;
  --purple-light: #f0ebff;
  --border: #dedde6;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; -webkit-text-size-adjust: 100%; }
button { font: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
button:focus-visible { outline: 3px solid var(--purple-dark); outline-offset: 5px; }
h1:focus { outline: none; }
p, h1 { margin: 0; }
.site-header { max-width: 720px; margin: auto; padding: 30px 32px 24px; display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 800; }
.brand-mark { color: var(--purple); font-size: 27px; }
.brand-caption { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--muted); }
.screen { width: min(100%, 720px); min-height: calc(100svh - 90px); margin: auto; padding: 24px 32px max(28px, env(safe-area-inset-bottom)); }
.question-screen { display: flex; flex-direction: column; }
.question-progress { display: flex; align-items: center; gap: 18px; margin: 0 0 44px; }
.progress-track { display: flex; gap: 7px; flex: 1; }
.progress-step { height: 12px; flex: 1; border-radius: 8px; background: #e8e5ed; }
.progress-step.is-filled { background: var(--purple); box-shadow: inset 0 3px 0 #ffffff25; }
.progress-count { color: var(--muted); font-size: 15px; font-weight: 800; white-space: nowrap; }
.eyebrow { color: var(--purple); font-size: 13px; font-weight: 800; letter-spacing: .09em; }
.question-title { margin-top: 16px; font-size: clamp(27px, 4vw, 34px); line-height: 1.45; letter-spacing: -.045em; word-break: keep-all; overflow-wrap: anywhere; }
.question-hint { margin-top: 12px; color: var(--muted); font-size: 16px; line-height: 1.6; }
.choice-list { display: grid; gap: 14px; margin: 28px 0 32px; }
.choice-button { display: flex; width: 100%; min-height: 91px; align-items: center; gap: 16px; text-align: left; padding: 19px 20px; border: 2px solid var(--border); border-radius: 18px; background: #fff; color: var(--ink); box-shadow: 0 3px 0 var(--border); transition: background .15s, border-color .15s, transform .1s; }
.choice-letter { width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center; border: 2px solid var(--border); border-radius: 10px; color: var(--muted); font-size: 15px; font-weight: 800; }
.choice-text { flex: 1; font-size: 19px; line-height: 1.6; font-weight: 600; word-break: keep-all; overflow-wrap: anywhere; }
.choice-check { width: 22px; flex-shrink: 0; color: var(--purple); font-size: 23px; font-weight: 900; visibility: hidden; }
.choice-button[aria-pressed="true"] { border-color: var(--purple); background: var(--purple-light); box-shadow: 0 3px 0 var(--purple); }
.choice-button[aria-pressed="true"] .choice-letter { background: var(--purple); border-color: var(--purple); color: white; }
.choice-button[aria-pressed="true"] .choice-check { visibility: visible; }
.choice-button:active { transform: translateY(2px); }
.question-footer { margin-top: auto; padding-top: 8px; text-align: center; }
.navigation { display: grid; grid-template-columns: 1fr 1.5fr; gap: 16px; }
.button { min-height: 60px; padding: 16px 24px; border-radius: 16px; font-size: 18px; line-height: 1.5; font-weight: 800; border: 2px solid transparent; transition: transform .1s, box-shadow .1s; }
.primary-button { color: white; background: var(--purple); box-shadow: 0 5px 0 var(--purple-dark); }
.secondary-button { color: var(--muted); background: white; border-color: var(--border); box-shadow: 0 4px 0 var(--border); }
.button:active:not(:disabled) { transform: translateY(4px); box-shadow: none; }
.primary-button:disabled { background: #e6e3ec; color: #777382; box-shadow: 0 5px 0 #d6d2df; }
.secondary-button:disabled { color: #9995a3; background: #f2f0f5; box-shadow: none; }
.reset-button { min-height: 44px; margin-top: 24px; padding: 8px 16px; border: 0; background: transparent; color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
.small-note { color: var(--muted); font-size: 12px; line-height: 1.7; }
.welcome-screen { display: flex; flex-direction: column; text-align: center; }
.welcome-content { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 36px 0 50px; }
.illustration { width: 174px; height: 174px; display: grid; place-items: center; margin: 32px 0; background: #f0ebff; border: 2px solid #e2daf8; border-radius: 50px; transform: rotate(-6deg); box-shadow: 0 7px 0 #e4ddf4; color: var(--purple); }
.illustration svg { width: 118px; height: 118px; transform: rotate(6deg); }
.welcome-title { font-size: clamp(34px, 5.5vw, 46px); line-height: 1.4; letter-spacing: -.05em; white-space: pre-line; word-break: keep-all; }
.intro { margin-top: 22px; white-space: pre-line; font-size: 18px; line-height: 1.85; word-break: keep-all; }
.pill { margin-top: 28px; padding: 9px 18px; border: 1px solid #e2daf8; border-radius: 24px; background: var(--purple-light); color: var(--purple-dark); font-size: 14px; font-weight: 700; }
.welcome-footer .primary-button { width: 100%; }
.welcome-footer .small-note { margin-top: 24px; }
@media (hover: hover) { .choice-button:hover { border-color: var(--purple); } .primary-button:hover:not(:disabled) { background: #5947b2; } }
@media (max-width: 540px) {
  .site-header { padding: 20px 22px 18px; }
  .brand-caption { font-size: 11px; }
  .screen { padding: 20px 22px 28px; min-height: calc(100svh - 74px); }
  .question-progress { margin-bottom: 28px; }
  .choice-button { padding: 16px 13px; gap: 10px; }
  .choice-text { font-size: 16px; }
  .choice-list { gap: 12px; }
  .button { font-size: 16px; padding: 14px 12px; }
  .navigation { gap: 12px; }
  .intro { font-size: 16px; }
}
@media (max-height: 850px) and (min-width: 541px) {
  .question-progress { margin-bottom: 24px; }
  .choice-list { margin-top: 20px; gap: 12px; }
  .choice-button { min-height: 80px; padding: 14px 18px; }
  .welcome-content { padding-top: 12px; padding-bottom: 32px; }
  .illustration { width: 140px; height: 140px; margin: 22px 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }

/* 추천 결과: 긴 작품명도 잘리지 않도록 높이를 자동으로 둡니다. */
.result-screen { display: flex; flex-direction: column; padding-top: 40px; }
.recommendation-list { display: grid; gap: 22px; margin: 32px 0; }
.recommendation-card { padding: 26px; border: 2px solid var(--border); border-radius: 22px; background: white; box-shadow: 0 5px 0 var(--border); }
.book-title { margin: 14px 0 18px; font-size: 27px; line-height: 1.5; letter-spacing: -.035em; word-break: keep-all; overflow-wrap: anywhere; }
.match-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.match-tag { padding: 6px 11px; border-radius: 10px; background: var(--purple-light); color: var(--purple-dark); font-size: 13px; font-weight: 700; }
.match-details { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 12px; color: var(--muted); font-size: 15px; line-height: 1.8; }
.match-details summary { min-height: 44px; padding: 8px 0; cursor: pointer; }
.match-details summary:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }
.match-details ul { margin: 8px 0 0; padding-left: 22px; }
.match-details li + li { margin-top: 8px; }
.result-footer { margin-top: auto; padding-top: 8px; text-align: center; }
.result-footer .small-note { margin-top: 24px; }
@media (max-width: 540px) {
  .result-screen { padding-top: 24px; }
  .recommendation-card { padding: 21px; }
  .book-title { font-size: 23px; }
}

/* 큐레이션과 작품 소개 */
a { color: inherit; }
a:focus-visible { outline: 3px solid var(--purple); outline-offset: 5px; }
a.button { display: flex; align-items: center; justify-content: center; text-decoration: none; text-align: center; }
.header-link { font-size: 13px; color: var(--purple); text-underline-offset: 4px; min-height: 44px; display: inline-flex; align-items: center; margin-left: 10px; }
.book-open-link { display: block; text-decoration: none; }
.book-open-link .book-title { margin-bottom: 10px; }
.open-label { display: block; color: var(--purple); font-size: 14px; font-weight: 700; margin-bottom: 20px; }
.curation-screen { width: min(100%, 1000px); padding-top: 36px; }
.category-filters { display: flex; flex-wrap: wrap; gap: 10px; padding: 28px 0 22px; }
.category-button { min-height: 44px; padding: 10px 16px; border: 1px solid var(--border); border-radius: 10px; background: white; color: var(--ink); font-size: 14px; font-weight: 700; }
.category-button[aria-pressed="true"] { background: var(--purple); color: white; border-color: var(--purple); }
.catalogue-count { color: var(--muted); font-size: 13px; padding-bottom: 22px; }
.catalogue-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 32px; row-gap: 38px; padding: 28px; background: #f1eef5; border: 1px solid #ddd6e8; border-radius: 4px; }
.catalogue-item { display: block; text-decoration: none; min-width: 0; }
.book-cover { position: relative; aspect-ratio: 3/4; background: #e7dff6; border: 8px solid #fffdf8; outline: 1px solid #dbd4e4; box-shadow: 4px 6px 0 #d1cbd7, 5px 12px 14px #3020421a; padding: 20px; color: #443569; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.cover-label { font-size: 10px; letter-spacing: .16em; }
.cover-title { font-size: clamp(18px,3vw,28px); line-height: 1.5; font-weight: 800; word-break: keep-all; overflow-wrap: anywhere; }
.cover-caption { font-size: 11px; color: #695c7d; }
.book-cover.has-image { background: transparent; padding: 0; }
.book-cover img { display: block; width: 100%; height: 100%; object-fit: contain; background: #fffdf8; }
.catalogue-title { margin: 20px 0 7px; font-size: 19px; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
.catalogue-author { border-top: 1px solid #d8d1e1; padding-top: 7px; font-size: 14px; color: var(--muted); line-height: 1.7; }
.catalogue-curator { margin-top: 4px; font-size: 12px; color: var(--purple-dark); }
.curation-footer { display: flex; flex-direction: column; align-items: center; gap: 28px; padding: 42px 0 12px; }
.curation-footer .button { width: 100%; }
.editor-entry { font-size: 13px; color: var(--muted); padding: 12px; }
.back-link { display: inline-block; min-height: 44px; padding: 12px 0; font-size: 14px; color: var(--purple); text-underline-offset: 4px; }
.book-hero { display: grid; grid-template-columns: 180px minmax(0,1fr); gap: 30px; margin: 26px 0 36px; align-items: start; }
.book-hero .book-cover { min-height: 240px; }
.book-hero .cover-title { font-size: 20px; }
.book-info .question-title { margin-top: 10px; font-size: 30px; }
.book-metadata { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 10px 16px; margin: 24px 0 0; font-size: 14px; line-height: 1.7; }
.book-metadata dt { color: var(--muted); }
.book-metadata dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.reading-section { padding: 28px 0; border-top: 1px solid var(--border); }
.section-title { margin: 0 0 18px; font-size: 18px; }
.quote-section { background: #f0ebff; padding: 28px; border: 0; border-radius: 18px; margin-bottom: 28px; }
.book-quote { margin: 0; white-space: pre-wrap; font-size: 21px; line-height: 1.9; overflow-wrap: anywhere; }
.quote-source { font-size: 12px; color: var(--muted); margin-top: 20px; white-space: pre-wrap; }
.reading-copy { font-size: 18px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty-copy { margin: 0; font-size: 16px; color: var(--muted); line-height: 1.8; }
.book-footer { display: grid; grid-template-columns: 1fr; gap: 18px; padding-top: 24px; text-align: center; }
.load-notice { padding: 16px; margin: 20px 0; background: #fff1d6; color: #6a4b14; font-size: 14px; line-height: 1.7; border-radius: 12px; }
.load-notice .reset-button { margin-top: 0; color: inherit; }
/* 공용 원고 편집 */
.editor-panel { margin-top: 26px; }
.field-label { display: block; font-size: 15px; font-weight: 700; margin: 20px 0 9px; }
.editor-screen input, .editor-screen textarea, .editor-screen select { width: 100%; padding: 14px; border: 1px solid #bdb6cb; border-radius: 10px; background: white; color: var(--ink); font: inherit; font-size: 16px; line-height: 1.7; }
.editor-screen textarea { resize: vertical; }
.editor-screen input:focus, .editor-screen textarea:focus, .editor-screen select:focus { outline: 3px solid #d6ccff; border-color: var(--purple); }
.editor-panel form > .primary-button { width: 100%; margin-top: 24px; }
.editor-actions { display: grid; gap: 18px; margin-top: 28px; }
.editor-form .small-note { margin-top: 22px; }
.form-message { margin-top: 20px; color: var(--purple-dark); font-size: 15px; line-height: 1.8; }
@media (max-width: 540px) {
  .brand-caption { display: none; }
  .header-link { margin-left: auto; }
  .catalogue-grid { padding: 16px; column-gap: 20px; }
  .book-cover { border-width: 5px; padding: 13px; }
  .cover-title { font-size: 15px; }
  .catalogue-title { font-size: 16px; }
  .book-hero { grid-template-columns: 1fr; gap: 28px; }
  .book-hero > .book-cover { width: 180px; margin: auto; }
  .book-info .question-title { font-size: 28px; }
}
.cover-upload { margin-top: 30px; padding-top: 8px; border-top: 1px solid var(--border); }
.cover-specs { color: var(--muted); font-size: 14px; line-height: 1.8; margin: 12px 0 18px; }
.cover-specs p + p { margin-top: 8px; }
.cover-upload-preview { margin-top: 18px; }
.cover-upload-preview img { display: block; max-width: 180px; max-height: 240px; object-fit: contain; border: 1px solid var(--border); }
.editor-screen input[type="file"] { font-size: 14px; padding: 12px; }
.editor-screen input[type="file"]::file-selector-button { min-height: 44px; padding: 10px 16px; margin-right: 12px; border: 0; border-radius: 8px; background: var(--purple-light); color: var(--purple-dark); font: inherit; font-weight: 700; cursor: pointer; }
