/* 우리집 번역기 — 외부 폰트·CDN 없이 시스템 서체만 사용합니다. */

:root {
  --bg: #FAF6EE;          /* 따뜻한 아이보리 */
  --surface: #FFFDF8;
  --line: #DDD5C6;
  --text: #26231F;
  --muted: #59534A;
  --sage: #4D6A54;        /* 주요: 세이지 그린 (흰 글자 대비 약 5.9:1) */
  --sage-deep: #3C5642;
  --sage-soft: #E5ECE3;
  --coral: #E08A73;       /* 보조 강조: 부드러운 코랄 */
  --coral-soft: #FBE9E2;
  --coral-ink: #9C4732;
  --focus: #1F4E8C;
  /* 대화 게임 반응 색: 사람의 좋고 나쁨이 아니라 '들렸을 때의 느낌'을 구분합니다. */
  --ease: #5E8466;        /* 편하게 들림 — 세이지 그린 */
  --ease-soft: #E5ECE3;
  --burden: #E09A5A;      /* 부담스럽게 들림 — 부드러운 주황 */
  --burden-soft: #FBEBDC;
  --unknown: #9A9285;     /* 아직 모르겠음·미선택 — 중립 회색 */
  --unknown-soft: #EFEBE4;
  --pick: #3A352E;        /* 선택 표시(정답처럼 보이지 않도록 초록 대신 진한 중립색) */
  --radius: 14px;
  --radius-sm: 10px;
  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 16px;
  scroll-padding-bottom: 96px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR",
    "Malgun Gothic", "맑은 고딕", "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

button,
input,
textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px; top: -100px;
  background: var(--surface);
  padding: 10px 14px;
  border: 2px solid var(--focus);
  border-radius: var(--radius-sm);
  z-index: 10;
}
.skip-link:focus { top: 12px; }

/* ── 레이아웃 ── */
.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px calc(32px + env(safe-area-inset-bottom));
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

.app-header { margin-bottom: 16px; }
.book-name {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
}
.app-header h1 {
  margin: 2px 0 2px;
  font-size: 1.5rem;
  line-height: 1.3;
  color: var(--sage-deep);
  letter-spacing: -0.01em;
}
.app-header h1:focus { outline: none; }
.app-desc { margin: 0; color: var(--muted); }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

.block { margin-bottom: 22px; }

.block-title {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  font-size: 1.0625rem;
  font-weight: 700;
}
.optional {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 2px;
}
.block-hint {
  margin: -4px 0 10px;
  font-size: 0.875rem;
  color: var(--muted);
}
.sub-title {
  margin: 14px 0 8px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--muted);
}

/* ── 선택 요소 (라디오) ── */
.choice { display: block; position: relative; }
.choice input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
  margin: 0;
}
.choice-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
}
.choice input:checked + .choice-box {
  border: 2px solid var(--sage);
  background: var(--sage-soft);
  padding: 9.5px 13.5px;
}
.choice input:focus-visible + .choice-box {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
/* 선택 상태를 색 외에 모양(체크 표시)으로도 보여줍니다. */
.choice-mark {
  flex: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid #8C8476;
  background: var(--surface);
  position: relative;
}
.choice input:checked + .choice-box .choice-mark {
  border-color: var(--sage);
  background: var(--sage);
}
.choice input:checked + .choice-box .choice-mark::after {
  content: "";
  position: absolute;
  left: 5px; top: 1px;
  width: 6px; height: 11px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.mode-list { display: grid; gap: 10px; }
.mode-choice .choice-box { align-items: flex-start; padding-top: 14px; padding-bottom: 14px; }
.mode-choice input:checked + .choice-box { padding-top: 13.5px; padding-bottom: 13.5px; }
.mode-choice .choice-mark { margin-top: 2px; }
.choice-text { display: flex; flex-direction: column; }
.choice-title { font-weight: 700; font-size: 1.0625rem; }
.choice-sub { color: var(--muted); font-size: 0.9375rem; }

.trial-note {
  margin: 10px 0 0;
  font-size: 0.875rem;
  color: var(--coral-ink);
  display: flex;
  gap: 6px;
  align-items: baseline;
}
.trial-note::before {
  content: "";
  flex: none;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--coral);
  transform: translateY(-1px);
}

.pill-row { display: flex; gap: 8px; }
.pill-row > * { flex: 1 1 0; min-width: 0; }
.pill-row.wrap { flex-wrap: wrap; }
.pill-row.wrap > * { flex: 0 1 auto; }
.pill-choice .choice-box { justify-content: center; font-weight: 600; }

/* ── 토글 버튼 (상황·마음) ── */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-size: 0.9375rem;
  text-align: left;
}
.toggle::before {
  content: "";
  flex: none;
  width: 0; height: 0;
}
.toggle[aria-pressed="true"] {
  border: 2px solid var(--sage);
  background: var(--sage-soft);
  font-weight: 700;
  padding: 7.5px 13.5px;
}
.toggle[aria-pressed="true"]::before {
  width: 6px; height: 11px;
  margin: 0 3px 3px 1px;
  border: solid var(--sage-deep);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

/* ── 입력 ── */
.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.label-row .block-title { margin: 0; }

textarea {
  display: block;
  width: 100%;
  min-height: 104px;
  padding: 12px 14px;
  font-size: 1.0625rem; /* 17px — iOS 자동 확대 방지(16px 이상) */
  line-height: 1.55;
  background: var(--surface);
  border: 1.5px solid #B9B0A0;
  border-radius: var(--radius);
  resize: vertical;
}
textarea::placeholder { color: #7A7266; }
textarea[aria-invalid="true"] { border: 2px solid var(--coral-ink); }

.field-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  min-height: 1.5em;
}
.field-error {
  margin: 0;
  color: var(--coral-ink);
  font-weight: 600;
  font-size: 0.9375rem;
}
.counter {
  margin: 0 0 0 auto;
  flex: none;
  font-size: 0.875rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.counter.is-full { color: var(--coral-ink); font-weight: 700; }

.text-button {
  min-height: 44px;
  min-width: 44px;
  padding: 0 10px;
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--sage-deep);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-button:disabled { color: #9A9285; text-decoration: none; cursor: default; }

.chip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  min-height: 44px;
  padding: 8px 14px;
  background: var(--coral-soft);
  border: 1.5px solid #EFC8BA;
  border-radius: 999px;
  font-size: 0.9375rem;
  text-align: left;
}

/* ── 버튼 ── */
.primary-button {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  background: var(--sage);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  font-size: 1.0625rem;
  font-weight: 700;
}
.primary-button:active { background: var(--sage-deep); }

.secondary-button {
  min-height: 48px;
  padding: 10px 18px;
  background: var(--surface);
  color: var(--sage-deep);
  border: 1.5px solid var(--sage);
  border-radius: var(--radius);
  font-weight: 700;
}

.reset-row { margin-top: 24px; display: flex; justify-content: center; }

/* ── 결과 ── */
.result {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1.5px solid var(--line);
}
.result h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;
  color: var(--sage-deep);
}
.result h2:focus { outline: none; }
.result h2:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.stale-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--coral-soft);
  color: var(--coral-ink);
  font-weight: 600;
  font-size: 0.9375rem;
}

.badge {
  display: inline-block;
  margin: 4px 0 14px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--sage-deep);
  font-size: 0.8125rem;
  font-weight: 600;
}

.result-note {
  margin: -6px 0 14px;
  font-size: 0.875rem;
  color: var(--muted);
}

.card {
  margin: 0 0 12px;
  padding: 16px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
}
.card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: var(--muted);
}
.card p { margin: 0; }
.card ul { margin: 0; padding-left: 1.2em; }
.card li + li { margin-top: 6px; }

.card.main {
  border: 2px solid var(--sage);
  background: #F3F6F0;
}
.card.main h3 { color: var(--sage-deep); }
.reply-text {
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.55;
  user-select: text;
  -webkit-user-select: text;
}
.variant-label {
  margin: 0 0 4px !important;
  font-size: 0.8125rem;
  color: var(--sage-deep);
  font-weight: 600;
}

.reply-actions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.copy-button {
  min-height: 44px;
  padding: 8px 16px;
  background: var(--sage);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  font-weight: 700;
}
.copy-feedback { margin: 8px 0 0 !important; font-size: 0.9375rem; color: var(--sage-deep); font-weight: 600; }
.copy-feedback.is-error { color: var(--coral-ink); }

.adjust-title { margin: 16px 0 8px !important; font-size: 0.875rem; font-weight: 700; color: var(--muted); }
.adjust-list { display: flex; flex-wrap: wrap; gap: 8px; }
.adjust-list .toggle { font-size: 0.875rem; }
.restore-button { font-size: 0.875rem; }

.disclaimer {
  margin: 4px 0 16px;
  padding: 10px 12px;
  border-left: 4px solid var(--coral);
  background: var(--surface);
  font-size: 0.9375rem;
  color: var(--text);
}

.notice {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--coral-soft);
  border: 1.5px solid #EFC8BA;
  margin-bottom: 12px;
}
.notice p { margin: 0 0 4px; font-weight: 700; color: var(--coral-ink); }
.notice .notice-sub { font-weight: 400; color: var(--text); font-size: 0.9375rem; }

details.book {
  margin: 16px 0;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
}
details.book summary {
  min-height: 48px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  list-style-position: inside;
}
details.book .book-body { padding: 0 16px 16px; }
details.book .book-body p { margin: 0 0 6px; }
details.book dl { margin: 8px 0 0; }
details.book dt { font-size: 0.8125rem; color: var(--muted); }
details.book dd { margin: 0 0 6px; }

.rating { margin: 20px 0 0; }
.rating .rating-q { margin: 0 0 8px; font-weight: 700; }
.rating .pill-row .toggle { justify-content: center; }
.rating .rating-thanks { margin: 8px 0 0; color: var(--sage-deep); font-weight: 600; min-height: 1.6em; }
.rating .rating-note { margin: 4px 0 0; font-size: 0.8125rem; color: var(--muted); }

.app-footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--muted);
}
.app-footer p { margin: 0 0 4px; }

/* ───────────── 화면 전환·첫 화면 ───────────── */
.view:focus { outline: none; }
main:focus { outline: none; }

.home-header { margin: 8px 0 20px; }
.home-header h1 { font-size: 1.75rem; }
.home-header .app-desc { font-size: 1.0625rem; color: var(--text); }

.entry-list { display: grid; gap: 14px; }
.entry-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 4px 14px;
  align-items: start;
  padding: 18px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 18px;
}
.entry-icon { width: 48px; height: 48px; grid-row: 1; }
.entry-text h2 { margin: 0; font-size: 1.1875rem; color: var(--sage-deep); }
.entry-text p { margin: 2px 0 0; color: var(--muted); }
.entry-card > button { grid-column: 1 / -1; margin-top: 12px; width: 100%; }
.home-note { margin: 18px 0 0; font-size: 0.875rem; color: var(--muted); }

.top-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -6px 0 12px;
  min-height: 44px;
}
.back-home {
  min-height: 44px;
  min-width: 44px;
  padding: 6px 12px 6px 8px;
  background: none;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  color: var(--sage-deep);
  font-weight: 700;
}
.top-bar-title { margin: 0; font-weight: 700; color: var(--muted); }

/* ───────────── 대화 게임 ───────────── */
.step { display: flex; flex-direction: column; gap: 14px; }
.step > * { margin-top: 0; margin-bottom: 0; }
.step-title {
  margin: 4px 0 0;
  font-size: 1.3125rem;
  line-height: 1.45;
  color: var(--text);
}
.step-title:focus { outline: none; }
.step-title:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.lead { font-size: 1.0625rem; margin: 0; }
.hint { margin: 0; font-size: 0.9375rem; color: var(--muted); }
.privacy-note { margin: 0; font-size: 0.875rem; color: var(--muted); }
.rule-list { margin: 0; padding-left: 1.2em; color: var(--text); }
.rule-list li + li { margin-top: 4px; }
.game-error:empty { display: none; }
.lbl {
  display: inline-block;
  margin-right: 8px;
  padding: 0 7px;
  border-radius: 6px;
  background: var(--unknown-soft);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
}

.round-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.round-count { margin: 0; font-weight: 700; color: var(--text); }
.round-dots { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--unknown); background: transparent; }
.dot.is-current { border-color: var(--pick); background: var(--pick); transform: scale(1.15); }
.dot.is-done { border-color: var(--pick); background: #CFC6B6; }
.dot.is-skipped { border-style: dashed; }
.role-chip { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.role { font-size: 0.8125rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; }
.role-speak { background: #F1ECE2; color: var(--text); border: 1.5px solid #CFC6B6; }
.role-listen { background: transparent; color: var(--muted); border: 1.5px dashed #CFC6B6; }

.talk-card {
  padding: 18px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 20px;
}
.talk-card.is-compact { padding: 12px 14px; }
.card-tag {
  display: inline-block;
  margin: 0 0 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--unknown-soft);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
}
.card-scene { margin: 0 0 12px; color: var(--muted); }
.talk-card.is-compact .card-scene { margin-bottom: 8px; font-size: 0.9375rem; }

.bubble {
  position: relative;
  padding: 14px 16px;
  background: #F4F0E8;
  border: 1.5px solid #D8CFC0;
  border-radius: 18px 18px 18px 6px;
}
.bubble-who { display: block; font-size: 0.8125rem; font-weight: 700; color: var(--muted); }
.bubble-text { margin: 2px 0 0; font-size: 1.375rem; font-weight: 700; line-height: 1.45; }
.talk-card.is-compact .bubble-text { font-size: 1.125rem; }
.bubble.big .bubble-text { font-size: 1.3125rem; }

/* 게임 선택지: 정답처럼 보이지 않도록 선택 표시는 진한 중립색 */
.option-group { display: grid; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.option-group.two-col { grid-template-columns: 1fr 1fr; }
.option .choice-box { min-height: 52px; align-items: center; }
.option input:checked + .choice-box { border: 2px solid var(--pick); background: #F3EFE7; }
.option input:checked + .choice-box .choice-mark { border-color: var(--pick); background: var(--pick); }
.opt-emoji { flex: none; font-size: 1.375rem; line-height: 1; width: 1.6em; text-align: center; }
.opt-text { display: flex; flex-direction: column; min-width: 0; }
.opt-label { font-weight: 600; }
.opt-sub { font-size: 0.875rem; color: var(--muted); }
.option.tone-ease .choice-box { border-left: 6px solid var(--ease); }
.option.tone-burden .choice-box { border-left: 6px solid var(--burden); }
.option.tone-unknown .choice-box { border-left: 6px dashed var(--unknown); }
.option[class*="tone-"] input:checked + .choice-box { border-left-width: 6px; }
.option.tone-ease input:checked + .choice-box { border-left-color: var(--ease); }
.option.tone-burden input:checked + .choice-box { border-left-color: var(--burden); }
.option.tone-unknown input:checked + .choice-box { border-left-color: var(--unknown); }

.free-field { display: flex; flex-direction: column; gap: 6px; }
.free-field[hidden] { display: none; }
.free-label { font-weight: 700; }
.free-field textarea { min-height: 72px; }
.free-field .counter { align-self: flex-end; }

.sub-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.step > .primary-button { margin-top: 4px; }
/* 주요 버튼은 브랜드 색(세이지 그린)을 그대로 씁니다. 긍정·부정 색을 고정하지 않는 대상은 역할 표시와 대사입니다. */
.handoff-icon { color: var(--text) !important; }

.secret-chip {
  align-self: flex-start;
  margin: -6px 0 0;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1.5px dashed #8C8476;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--muted);
}
.secret-chip::before { content: "🔒 "; }

details.more, details.origin-mini {
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
details.more > summary, details.origin-mini > summary {
  min-height: 44px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
}
details.more[open] { padding: 0 12px 12px; }
details.more[open] > summary { padding-left: 2px; }
details.origin-mini { font-size: 0.9375rem; }
details.origin-mini p { margin: 0; padding: 0 14px 12px; }
.secondary-button:disabled { color: #9A9285; border-color: var(--line); cursor: default; }

.answer-box {
  padding: 16px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
}
.answer-title { margin: 0 0 4px; font-size: 0.875rem; font-weight: 700; color: var(--muted); }
.answer-text { margin: 0; display: flex; gap: 8px; align-items: baseline; font-size: 1.125rem; font-weight: 700; }
.answer-sub { margin: 8px 0 0; color: var(--text); }

.step-handoff { text-align: center; align-items: stretch; padding-top: 24px; }
.handoff-icon {
  display: flex; justify-content: center; align-items: center; gap: 12px;
  font-weight: 700; color: var(--sage-deep);
}
.handoff-icon span:not(.arrow) {
  padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line);
}
.handoff-icon .arrow { font-size: 1.5rem; color: var(--muted); }

.reveal-stage { container-type: inline-size; }
.reveal-pair { display: grid; grid-template-columns: 1fr; gap: 10px; align-items: stretch; }
.reveal-link {
  margin: 0; justify-self: center; align-self: center;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--pick); color: #fff; font-weight: 800;
  transform: rotate(90deg);
}
@container (min-width: 21em) {
  .reveal-pair { grid-template-columns: 1fr auto 1fr; gap: 8px; }
  .reveal-link { transform: none; }
}
.reveal-card {
  padding: 16px 14px;
  border-radius: 20px;
  background: var(--surface);
  border: 2px solid #CFC6B6;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 0;
}
.reveal-card.speaker { background: #FFF6DE; border-color: #E2CF99; }
.reveal-card p { margin: 0; }
.reveal-card .reveal-who { font-size: 0.8125rem; }
.reveal-emoji { font-size: 2rem; line-height: 1.2; }
.reveal-card .reveal-text { margin: 0; font-size: 1.125rem; line-height: 1.45; }
.reveal-card .reveal-comfort {
  margin-top: 6px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 14px; border-radius: 14px;
}
.reveal-card .rc-emoji { font-size: 1.25rem; line-height: 1.2; }
.reveal-card.animate { animation: reveal-in 320ms ease-out both; }
.reveal-card.animate.delay { animation-delay: 160ms; }

.reveal-bubble {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1.5px solid var(--line);
  background: var(--surface);
}
.reveal-bubble.speaker { border-radius: 18px 18px 18px 6px; background: #FFF6DE; border-color: #EBD9A6; }
.reveal-bubble.listener { border-radius: 18px 18px 6px 18px; margin-left: 12px; }
.reveal-who { margin: 0; font-size: 0.875rem; font-weight: 700; color: var(--muted); }
.reveal-text { margin: 4px 0 0; font-size: 1.1875rem; font-weight: 700; }
.reveal-note { margin: 2px 0 0; font-size: 0.8125rem; color: var(--muted); }
.reveal-comfort { margin: 8px 0 0; display: inline-block; padding: 2px 10px; border-radius: 999px; font-weight: 600; }
.reveal-comfort.tone-ease { background: var(--ease-soft); }
.reveal-comfort.tone-burden { background: var(--burden-soft); }
.reveal-comfort.tone-unknown { background: var(--unknown-soft); }
.reveal-bubble.animate { animation: reveal-in 260ms ease-out both; }
.reveal-bubble.animate.delay { animation-delay: 140ms; }
@keyframes reveal-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.talk-box {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: #F1ECE2;
}
.talk-box p { margin: 0; }
.talk-box .talk-q { font-weight: 700; color: var(--text); margin-bottom: 4px; }

.origin-line { margin: 0; }

.bars { display: flex; flex-direction: column; gap: 14px; padding: 16px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: baseline; }
.bar-title { margin: 0; font-size: 0.875rem; font-weight: 700; color: var(--muted); }
.bar-value { margin: 0; font-weight: 700; text-align: right; }
.scale-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: baseline; }
.bar-value.is-unknown { color: var(--muted); }
.scale { grid-column: 1 / -1; position: relative; height: 36px; }
.scale-line { position: absolute; left: 14px; right: 14px; top: 50%; height: 2px; background: #CFC6B6; transform: translateY(-50%); }
.scale.is-unknown .scale-line { background: none; border-top: 2px dashed var(--unknown); }
.scale-inner { position: absolute; left: 14px; right: 14px; top: 0; bottom: 0; }
.scale-tick, .scale-marker {
  position: absolute; top: 50%;
  left: calc(var(--i) * 100% / 3);
  transform: translate(-50%, -50%);
}
.scale-tick { width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid #B9B0A0; }
.scale-marker {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.125rem; line-height: 1;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 2px var(--pick);
}
.scale-marker.tone-ease { background: var(--ease-soft); box-shadow: 0 0 0 2px var(--ease); }
.scale-marker.tone-burden { background: var(--burden-soft); box-shadow: 0 0 0 2px var(--burden); }
.bar-scale { margin: -6px 0 0; display: flex; justify-content: space-between; font-size: 0.8125rem; color: var(--muted); }
.compare-msg { margin: 0; font-size: 1.0625rem; font-weight: 700; }

.end-count { margin: 0; font-weight: 700; color: var(--text); }
.end-sub { margin: 6px 0 0; font-size: 1rem; }
.kept-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.kept-item { padding: 14px 16px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); box-shadow: 2px 3px 0 rgba(60, 45, 30, 0.10); }
.kept-meta { margin: 0; font-size: 0.8125rem; color: var(--muted); font-weight: 600; }
.kept-text { margin: 4px 0 10px; font-size: 1.125rem; font-weight: 700; user-select: text; -webkit-user-select: text; }


/* ───────────── v4 삽화 장면(종이 오리기) ───────────── */
.hero-slot { margin: 0 0 16px; }
.hero-scene { position: relative; }
.hero-svg { display: block; width: 100%; height: auto; max-height: 150px; }
.hero-bubble {
  position: absolute; top: 4%;
  padding: 2px 12px;
  background: #FFFDF7; border: 1.5px solid #D8CFC0; border-radius: 14px;
  box-shadow: 2px 3px 0 rgba(60, 45, 30, 0.10);
  font-weight: 800; color: var(--muted); line-height: 1.5;
}
.hero-bubble-a { left: 15%; }
.hero-bubble-b { right: 15%; }
.hero-slot.intro .hero-bubble { animation: hero-pop 420ms ease-out both; }
.hero-slot.intro .hero-bubble-b { animation-delay: 180ms; }
@keyframes hero-pop { from { opacity: 0; transform: translateY(6px) scale(0.85); } to { opacity: 1; transform: none; } }

/* 캐릭터 몸짓: 말하는 쪽은 상대 방향으로 손을 살짝 듦. 듣는 쪽 차례에는 듣는 캐릭터를 살짝 앞으로 */
.sc-body, .sc-hand { transform-box: fill-box; transition: transform 240ms ease-out; }
.sc-body { transform-origin: 50% 100%; }
.sc-hand { transform-origin: 0% 60%; }
.sc-spot { opacity: 0; transition: opacity 240ms ease-out; }
.scene[data-focus="speaker"] .sc-char-speaker .sc-hand,
.scene[data-focus="both"] .sc-char-speaker .sc-hand,
.hero-svg .sc-char-speaker .sc-hand { transform: rotate(-40deg); }
.scene[data-focus="speaker"] .sc-char-speaker .sc-spot,
.scene[data-focus="listener"] .sc-char-listener .sc-spot { opacity: 1; }
.scene[data-focus="listener"] .sc-char-listener .sc-body { transform: translateY(-3px) scale(1.03); }

.scene {
  margin: 0;
  padding: 12px;
  display: flex; flex-direction: column; gap: 12px;
  background: #FBF5EA;
  border: 1.5px solid var(--line);
  border-radius: 22px;
  container-type: inline-size;
}
.scene-meta { margin: 0; }
.scene-meta .card-tag { margin: 0; }
.scene-stage { position: relative; }
.scene-art { position: relative; width: 100%; margin: 0 auto; container-type: inline-size; }
.scene.is-compact .scene-art { max-width: 240px; }
.scene-svg { display: block; width: 100%; height: auto; border-radius: 16px; }

.scene-bubble {
  position: relative;
  margin: 0 0 4px;
  align-self: flex-start;
  max-width: 94%;
  padding: 12px 16px;
  background: #FFFDF7;
  border: 1.5px solid #D8CFC0;
  border-radius: 18px;
  box-shadow: 2px 3px 0 rgba(60, 45, 30, 0.10);
}
.scene-bubble::after {
  content: "";
  position: absolute; left: 22%; bottom: -8px;
  width: 14px; height: 14px;
  background: #FFFDF7;
  border-right: 1.5px solid #D8CFC0; border-bottom: 1.5px solid #D8CFC0;
  transform: rotate(45deg);
}
.scene-bubble-who { display: block; font-size: 0.8125rem; font-weight: 700; color: var(--muted); }
.scene-bubble-text { display: block; font-size: 1.3125rem; font-weight: 800; line-height: 1.45; }
.scene.is-compact .scene-bubble-text { font-size: 1.125rem; }
.line-bubble.swap { animation: line-swap 240ms ease-out; }
@keyframes line-swap { from { opacity: 0.15; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.scene-tag {
  position: absolute; bottom: 3%;
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 10px;
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.94);
  border: 1.5px solid #CFC6B6;
  font-size: 0.8125rem; font-weight: 700;
  white-space: nowrap;
}
.scene-turn { display: none; font-weight: 600; color: var(--muted); }
.scene-turn::before { content: "· "; }
.scene[data-focus="speaker"] .scene-tag-speaker,
.scene[data-focus="listener"] .scene-tag-listener { border: 2px solid var(--pick); }
.scene[data-focus="speaker"] .scene-tag-speaker .scene-turn,
.scene[data-focus="listener"] .scene-tag-listener .scene-turn { display: inline; }
/* 그림이 좁거나 글자가 크면 이름표가 겹치지 않도록 '차례' 글자를 숨기고, 굵은 테두리·바닥 빛으로 차례를 보여 줍니다 */
@container (max-width: 20em) { .scene-tag .scene-turn { display: none !important; } }

.scene-badge {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: #FFFDF7;
  border: 2px solid var(--pick);
  color: var(--pick);
  box-shadow: 2px 3px 0 rgba(60, 45, 30, 0.12);
  font-size: 20px; line-height: 1; /* 장식 표시(aria-hidden): 그림 크기에 맞춰 고정 */
}
.scene-badge[hidden] { display: none; }
.scene-badge.is-comfort.tone-ease { border-color: var(--ease); background: var(--ease-soft); }
.scene-badge.is-comfort.tone-burden { border-color: var(--burden); background: var(--burden-soft); }
.scene-badge.is-comfort.tone-unknown { border-style: dashed; border-color: var(--unknown); background: var(--unknown-soft); }
.scene-badge.pop { animation: badge-pop 260ms ease-out; }
@keyframes badge-pop { from { opacity: 0; transform: translate(-50%, -50%) scale(0.6); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

/* 두 답: 같은 크기·같은 비중. 넓으면 나란히, 좁거나 글자가 크면 위아래 */
.scene-pair { --tail-l: 30%; --tail-r: 66%; display: grid; grid-template-columns: 1fr; gap: 12px; }
@container (min-width: 18em) {
  .scene-pair { grid-template-columns: 1fr 1fr; gap: 10px; --tail-l: 62%; --tail-r: 31%; }
}
.pair-bubble {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-width: 0;
  padding: 14px 12px 14px;
  background: #FFFDF7;
  border: 2px solid #CFC6B6;
  border-radius: 18px;
  box-shadow: 2px 3px 0 rgba(60, 45, 30, 0.10);
  text-align: center;
}
.pair-bubble::before {
  content: "";
  position: absolute; top: -9px;
  width: 14px; height: 14px;
  background: #FFFDF7;
  border-left: 2px solid #CFC6B6; border-top: 2px solid #CFC6B6;
  transform: translateX(-50%) rotate(45deg);
}
.pair-left::before { left: var(--tail-l); }
.pair-right::before { left: var(--tail-r); }
.pair-who { font-size: 0.8125rem; font-weight: 700; color: var(--muted); }
.pair-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: #F4F0E8; color: var(--pick);
  border: 1.5px solid #D8CFC0;
}
.pair-text { font-size: 1.125rem; font-weight: 800; line-height: 1.45; }
.pair-note { font-size: 0.8125rem; color: var(--muted); }
.pair-comfort {
  margin-top: 4px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 14px; border-radius: 14px; font-weight: 600;
}
.pair-comfort.tone-ease { background: var(--ease-soft); }
.pair-comfort.tone-burden { background: var(--burden-soft); }
.pair-comfort.tone-unknown { background: var(--unknown-soft); }
.scene-pair.is-closed .pair-bubble { min-height: 76px; justify-content: center; background: #F4F0E8; }
.scene-pair.is-closed .pair-bubble::before { background: #F4F0E8; }
.pair-dots { font-size: 1.5rem; font-weight: 800; color: #8C8476; letter-spacing: 0.1em; }
.scene-pair.play .pair-bubble { animation: bubble-open 560ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes bubble-open {
  0% { opacity: 0; transform: scale(0.82) translateY(6px); }
  60% { opacity: 1; }
  100% { opacity: 1; transform: none; }
}
.origin-card {
  margin: 0; align-self: center;
  padding: 8px 14px;
  border: 1.5px dashed #CFC6B6; border-radius: 12px;
  background: #FFFDF7;
  font-size: 0.9375rem;
}

/* 카드 더미에서 한 장이 앞으로 */
.card-deck { position: relative; margin-top: 6px; }
.deck-sheet {
  position: absolute; inset: 0;
  border-radius: 22px;
  background: #F3EADB;
  border: 1.5px solid var(--line);
}
.deck-sheet-1 { transform: translate(6px, -5px) rotate(1.2deg); }
.deck-sheet-2 { transform: translate(-5px, -8px) rotate(-1.4deg); background: #EFE6D6; }
.deck-card {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px;
  background: #FBF5EA;
  border: 1.5px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 3px 0 rgba(60, 45, 30, 0.08);
}
.deck-card .scene { padding: 0; border: 0; background: none; }
.card-deck.play .deck-card { animation: deal 440ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes deal { from { opacity: 0; transform: translateY(18px) scale(0.96) rotate(-1.2deg); } to { opacity: 1; transform: none; } }

/* 휴대폰 넘기기: 카드가 뒤집혀 답을 가림 */
.step-handoff.has-scene { padding-top: 8px; }
.handoff-scene { display: flex; flex-direction: column; align-items: center; gap: 12px; perspective: 900px; }
.flip-card {
  position: relative;
  width: min(250px, 72%);
  aspect-ratio: 360 / 210;
  transform-style: preserve-3d;
  transform: rotateY(180deg);
}
.flip-face {
  position: absolute; inset: 0;
  border-radius: 16px;
  overflow: hidden;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border: 1.5px solid var(--line);
  box-shadow: 3px 4px 0 rgba(60, 45, 30, 0.12);
}
.flip-front svg { display: block; width: 100%; height: 100%; }
.flip-back {
  transform: rotateY(180deg);
  background-color: #EFEAF6;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='44' viewBox='0 0 52 44'%3E%3Cpath d='M7 6h16a5 5 0 0 1 5 5v5a5 5 0 0 1-5 5h-9l-5 4v-4H7a5 5 0 0 1-5-5v-5a5 5 0 0 1 5-5z' fill='%23C3B8DF' opacity='.6'/%3E%3Cpath d='M32 24h12a4 4 0 0 1 4 4v4a4 4 0 0 1-4 4h-3v3l-4-3h-5a4 4 0 0 1-4-4v-4a4 4 0 0 1 4-4z' fill='%239DB4CF' opacity='.55'/%3E%3C/svg%3E");
}
.handoff-scene.play .flip-card { animation: flip 480ms ease-in-out both; }
@keyframes flip { from { transform: rotateY(0deg); } to { transform: rotateY(180deg); } }
.pass-svg { width: min(250px, 80%); height: auto; overflow: visible; }
.pass-labels { margin: -10px 0 0; width: min(250px, 80%); display: flex; justify-content: space-between; font-size: 0.8125rem; font-weight: 700; color: var(--muted); }
.pass-phone { transform: translate(164px, 30px); }
.handoff-scene.play .pass-phone { animation: pass 620ms 260ms ease-out both; }
@keyframes pass { from { transform: translate(60px, 30px) rotate(-8deg); } to { transform: translate(164px, 30px); } }

/* 오늘의 한마디가 담기는 움직임 */
.kept-tray {
  position: relative;
  margin: 0 0 0 auto;
  padding: 1px 10px;
  border-radius: 999px;
  border: 1.5px solid #CFC6B6;
  background: #FFFDF7;
  font-size: 0.8125rem; font-weight: 700;
}
.kept-fly {
  position: absolute; left: 4px; top: 2px;
  width: 26px; height: 18px;
  border-radius: 4px;
  background: #FFF6DE; border: 1.5px solid #E2CF99;
  opacity: 0; pointer-events: none;
}
.kept-tray.arrive { animation: tray-bump 380ms ease-out; }
.kept-tray.arrive .kept-fly { animation: kept-fly 360ms ease-in both; }
@keyframes kept-fly { from { opacity: 1; transform: translate(-60px, 36px) rotate(-8deg); } to { opacity: 0; transform: translate(0, 0) scale(0.6); } }
@keyframes tray-bump { 0%, 70% { transform: none; } 85% { transform: scale(1.06); } 100% { transform: none; } }
.kept-item.kept-in { animation: kept-in 340ms ease-out both; }
@keyframes kept-in { from { opacity: 0; transform: translateY(-12px) scale(0.97); } to { opacity: 1; transform: none; } }

/* 전후 비교: 표시가 제자리에서 짧게 나타남(첫 값에서 두 번째 값으로 이동하지 않음) */
.bars.play .scale-marker { animation: marker-in 300ms ease-out both; }
@keyframes marker-in { from { opacity: 0; transform: translate(-50%, -50%) scale(0.7); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }


/* ───────────── v4.1 그림과 선택을 하나로 ───────────── */
.pilot-entry { margin: 6px 0 0; }
.pilot-entry .text-button { font-size: 0.875rem; color: var(--muted); padding: 0; }

/* 한 사람의 차례 장면: 캐릭터 + 생각 말풍선 */
.scene-solo { gap: 8px; container-type: inline-size; }
.scene-solo .line-bubble { align-self: flex-start; }
.scene-solo--listener .line-bubble { align-self: flex-end; }
.scene-solo--listener .line-bubble::after { left: auto; right: 24%; }
.solo-row { display: grid; grid-template-columns: 1fr; gap: 8px; align-items: center; }
@container (min-width: 19em) {
  .solo-row { grid-template-columns: 9.5rem 1fr; }
  .scene-solo--listener .solo-row { grid-template-columns: 1fr 9.5rem; }
  .scene-solo--listener .solo-char { order: 2; }
}
.solo-char { position: relative; display: flex; flex-direction: column; align-items: center; }
.portrait-svg { display: block; width: 100%; max-width: 9.5rem; height: auto; }
.solo-tag, .duo .scene-tag { position: static; transform: none; margin-top: -6px; }
.scene-solo .scene-tag-speaker, .scene-solo .scene-tag-listener { border: 2px solid var(--pick); }
.scene-solo .scene-turn { display: inline; }
.scene-solo .sc-spot { opacity: 1; }
.scene-solo--speaker .sc-char-speaker .sc-hand { transform: rotate(-40deg); }

.thought {
  position: relative;
  min-height: 64px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 12px 14px;
  background: #FFFDF7;
  border: 2px solid #CFC6B6;
  border-radius: 22px;
  box-shadow: 2px 3px 0 rgba(60, 45, 30, 0.10);
}
/* 생각 말풍선 꼬리: 작은 동그라미 두 개 */
.thought::before, .thought::after {
  content: ""; position: absolute; border-radius: 50%;
  background: #FFFDF7; border: 2px solid #CFC6B6;
}
.thought::before { width: 14px; height: 14px; left: -10px; bottom: 14px; }
.thought::after { width: 8px; height: 8px; left: -20px; bottom: 6px; }
.scene-solo--listener .thought::before { left: auto; right: -10px; }
.scene-solo--listener .thought::after { left: auto; right: -20px; }
@container (max-width: 19em) {
  .thought::before, .thought::after { display: none; }
}
.thought.is-empty { border-style: dashed; background: #F7F2E9; }
.thought.is-empty .thought-text { color: var(--muted); font-weight: 600; }
.thought-icon { color: var(--pick); line-height: 0; }
.thought-icon:empty { display: none; }
.thought-text { font-size: 1.0625rem; font-weight: 800; line-height: 1.45; overflow-wrap: anywhere; }
.thought { min-width: 0; }
.thought > * { max-width: 100%; min-width: 0; }
.thought .pair-comfort { text-align: center; }
.thought-extra:empty, .thought-text:empty { display: none; }
.thought.pop { animation: thought-pop 260ms ease-out; }
@keyframes thought-pop { from { opacity: 0.2; transform: scale(0.96); } to { opacity: 1; transform: none; } }

/* 카드형 선택지 */
.card-choices { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.card-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(5.4rem, 1fr)); }
.card-choices { container-type: inline-size; }
.card-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
@container (max-width: 19em) {
  .card-grid-5 { grid-template-columns: 1fr; }
  .card-grid-5 .cc-box { flex-direction: row; justify-content: flex-start; min-height: 52px; padding: 6px 40px 6px 10px; }
}
.choice-card, .choice-pill { position: relative; display: block; }
.choice-card input, .choice-pill input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.choice-card .cc-box {
  position: relative;
  min-height: 88px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 6px 10px;
  background: #FFFDF7;
  border: 2px solid #D8CFC0;
  border-radius: 18px;
  box-shadow: 2px 3px 0 rgba(60, 45, 30, 0.08);
  text-align: center;
  cursor: pointer;
}
.cc-icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #F4F0E8; color: var(--pick); }
.cc-emoji { font-size: 22px; line-height: 1; }
.cc-label { font-weight: 800; font-size: 1rem; line-height: 1.35; }
.cc-check { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #B9B0A0; background: #FFFDF7; }
.choice-card input:checked + .cc-box { border: 3px solid var(--pick); background: #F3EFE7; transform: translateY(-2px); padding: 11px 5px 9px; }
.choice-card input:checked + .cc-box .cc-check { border-color: var(--pick); background: var(--pick); }
.choice-card input:checked + .cc-box .cc-check::after {
  content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.choice-card input:focus-visible + .cc-box, .choice-pill input:focus-visible + .cc-box { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice-card.tone-ease .cc-box { border-bottom: 6px solid var(--ease); }
.choice-card.tone-burden .cc-box { border-bottom: 6px solid var(--burden); }
.choice-card.tone-unknown .cc-box { border-bottom: 6px dashed var(--unknown); }
.card-grid-5 .cc-label { font-size: 0.875rem; }
.card-grid-5 .cc-box { min-height: 84px; padding-left: 2px; padding-right: 2px; }
.card-grid-5 .cc-check { width: 16px; height: 16px; top: 4px; right: 4px; }
.card-grid-5 input:checked + .cc-box .cc-check::after { left: 3px; top: 0; width: 4px; height: 8px; }
.pill-choices { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.choice-pill .cc-box {
  min-height: 44px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px 6px 8px;
  border: 1.5px dashed #B9B0A0; border-radius: 999px;
  background: transparent; color: var(--text); font-size: 0.9375rem; cursor: pointer;
}
.choice-pill .cc-icon { width: 28px; height: 28px; background: transparent; }
.choice-pill .cc-label { font-weight: 700; font-size: 0.9375rem; }
.choice-pill input:checked + .cc-box { border: 2px solid var(--pick); background: #F3EFE7; }

.rewrite-info { margin: 0; font-size: 0.875rem; color: var(--muted); }
.secondary-button[aria-pressed="true"] { background: #F3EFE7; border-width: 2px; }

/* 두 캐릭터 공개: 방 배경은 작게, 캐릭터와 각자의 말풍선 중심 */
.scene-duo { padding: 14px 10px 12px; background: linear-gradient(#FBF5EA 0 78%, #EFE4D0 78% 100%); container-type: inline-size; }
.duo { display: grid; grid-template-columns: 1fr; gap: 14px; }
@container (min-width: 19em) { .duo { grid-template-columns: 1fr 1fr; gap: 10px; } }
.duo-col { display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-width: 0; }
.duo-col .pair-bubble { flex: 1; }
.duo-col .pair-bubble::before {
  top: auto; bottom: -9px; left: 50%;
  border-left: 0; border-top: 0; border-right: 2px solid #CFC6B6; border-bottom: 2px solid #CFC6B6;
}
.duo-char { display: flex; flex-direction: column; align-items: center; }
.duo-char .portrait-svg { max-width: 7.5rem; }
.scene-duo.is-closed .pair-bubble { min-height: 76px; justify-content: center; background: #F4F0E8; }
.scene-duo.is-closed .pair-bubble::before { background: #F4F0E8; }
.scene-duo.play .pair-bubble { animation: bubble-open 560ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }

@media (max-width: 359px) {
  .option-group.two-col { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal-bubble.animate, .reveal-card.animate { animation: none; }
  .hero-slot.intro .hero-bubble, .line-bubble.swap, .scene-badge.pop, .scene-pair.play .pair-bubble,
  .card-deck.play .deck-card, .handoff-scene.play .flip-card, .handoff-scene.play .pass-phone,
  .kept-tray.arrive, .kept-tray.arrive .kept-fly, .kept-item.kept-in, .bars.play .scale-marker { animation: none !important; }
  .sc-body, .sc-hand, .sc-spot { transition: none; }
  .thought.pop, .scene-duo.play .pair-bubble { animation: none !important; }
  .choice-card input:checked + .cc-box { transform: none; }
  .dot.is-current { transform: none; }
}

@media (forced-colors: active) {
  .choice input:checked + .choice-box,
  .toggle[aria-pressed="true"] { border: 3px solid CanvasText; }
  .scale-marker { border: 3px solid CanvasText; }
}

/* v4.2 — 작은 발견이 있는 대화 놀이 */
.envelope-line { padding: 16px; border-block: 1px solid var(--line, #ded8cb); text-align: center; font-weight: 700; }
.envelope-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 32px 0 20px; }
.heart-envelope { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 190px; padding: 28px 10px 16px; border: 2px solid #b4c4b5; border-radius: 8px 8px 22px 22px; background: #edf2e7; color: #33493b; font: inherit; cursor: pointer; box-shadow: 0 7px 0 #dedfd3; transition: transform .2s, background .2s; }
.heart-envelope::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 45px; background: #d8e3d4; clip-path: polygon(0 0,100% 0,50% 100%); }
.envelope-1 { background: #fff0e7; border-color: #dfb9a6; color: #714c3d; }
.envelope-1::before { background: #efd7c9; }
.envelope-seal { z-index: 1; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #fffaf0; font-size: 27px; box-shadow: 0 3px 0 #0000000b; }
.envelope-label { font-weight: 800; font-size: 18px; }
.envelope-note { font-size: 12px; }
.heart-envelope.is-ready { transform: translateY(-7px) rotate(-2deg); background: #dce9d7; }
.envelope-1.is-ready { transform: translateY(-7px) rotate(2deg); background: #f8dfce; }
.is-ready .envelope-seal { background: #526d57; color: white; }
.envelope-status { text-align: center; min-height: 3em; font-size: 14px; line-height: 1.6; }
.step-envelope > .primary-button:disabled { opacity: .45; cursor: default; }
.discovery-note { text-align: center; font-weight: 700; color: #526d57; animation: discovery-in .4s ease-out both; }
.conversation-replay { border: 1px solid #dbd6c7; border-radius: 24px; background: #f2ede2; padding: 20px; margin: 24px 0; }
.replay-kicker { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-align: center; color: #596c57; }
.replay-controls { display: flex; padding: 5px; border-radius: 30px; gap: 5px; background: #e2dfd3; margin: 16px 0; }
.replay-toggle { flex: 1; min-height: 44px; padding: 8px; border: 0; border-radius: 24px; font: inherit; font-size: 14px; background: transparent; color: #414b40; cursor: pointer; }
.replay-toggle[aria-pressed=true] { background: #fffdf7; box-shadow: 0 2px 7px #00000012; font-weight: 700; }
.replay-stage { text-align: center; background: #fffcf5; border-radius: 18px; padding: 20px; border-bottom: 4px solid #c0cdb7; }
.replay-stage[data-take="0"] { border-color: #dfbda7; }
.replay-actor { display: block; font-size: 48px; color: #60795d; }
.replay-label { font-size: 12px; color: #686b60; }
.replay-line { font-size: clamp(19px, 5vw, 25px); line-height: 1.65; font-weight: 700; overflow-wrap: anywhere; margin: 12px 0; }
.replay-feeling { font-size: 13px; line-height: 1.6; }
.take-in { animation: discovery-in .25s ease-out; }
.solo-char.pop { animation: character-nod .35s ease-out; }
.scene-solo[data-tone=burden] .line-bubble { box-shadow: 0 5px 0 #d8b6a5; }
.scene-solo[data-tone=ease] .line-bubble { box-shadow: 0 5px 0 #bbcfb4; }
.phrase-postcard { position: relative; background: #fffaf0; border: 1px solid #d7d4c3; border-top: 5px solid #8caa84; border-radius: 4px 4px 18px 18px; padding: 24px; box-shadow: 0 6px 0 #eee9dc; margin-bottom: 20px; }
.phrase-postcard::after { content: '우리 집 오늘의 한마디'; display: block; font-size: 11px; color: #64715d; border-top: 1px dashed #cfc9b6; padding-top: 12px; margin-top: 14px; }
.book-bridge { display: flex; gap: 20px; margin: 30px 0; padding: 24px 0; border-block: 1px solid #ded8ca; align-items: center; }
.book-mark { flex: 0 0 85px; white-space: pre-line; background: #526d57; color: #fff9e8; border-radius: 2px 8px 8px 2px; padding: 28px 10px; font-weight: 800; line-height: 1.8; box-shadow: inset 5px 0 #ffffff20, 4px 5px 0 #dfdacb; font-size: 14px; }
.book-bridge h3 { font-size: 18px; margin: 8px 0; line-height: 1.5; }
.book-bridge p { font-size: 13px; line-height: 1.8; margin: 0; }
.book-eyebrow { color: #61795b; font-weight: 700; }
.heart-envelope:focus-visible, .replay-toggle:focus-visible { outline: 3px solid #314c38; outline-offset: 4px; }
@keyframes character-nod { 0%,100% { transform: rotate(0); } 40% { transform: rotate(-4deg) translateY(-5px); } 70% { transform: rotate(2deg); } }
@keyframes discovery-in { from { opacity: .4; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 360px) { .envelope-pair { gap: 10px; } .envelope-label { font-size: 16px; } .book-bridge { gap: 12px; } }
@media (prefers-reduced-motion: reduce) { .heart-envelope { transition: none; } .discovery-note, .take-in, .solo-char.pop { animation: none; } }

/* v4.3 — 상황 카드를 직접 고르는 입구 */
.situation-picker { border: 0; padding: 0; margin: 24px 0; min-width: 0; }
.situation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.situation-pick { position: relative; cursor: pointer; min-width: 0; }
.situation-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.situation-face { height: 100%; box-sizing: border-box; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px 14px 12px; background: #fffdf6; border: 2px solid #dedbce; border-radius: 18px; box-shadow: 0 4px 0 #e9e5d9; transition: background .15s, border-color .15s, transform .15s; }
.situation-icon { font-size: 25px; }
.situation-category { color: #65715e; font-size: 12px; font-weight: 700; }
.situation-line { font-size: 16px; line-height: 1.65; overflow-wrap: anywhere; flex: 1; }
.situation-check { font-size: 11px; color: #3e6144; visibility: hidden; }
.situation-pick input:checked + .situation-face { background: #eaf1e4; border-color: #607e5b; transform: translateY(-3px); }
.situation-pick input:checked + .situation-face .situation-check { visibility: visible; }
.situation-pick input:focus-visible + .situation-face { outline: 3px solid #354f3a; outline-offset: 3px; }
.picked-label { font-size: 12px; font-weight: 800; color: #526d57; margin-top: 24px; }
.step-card-picker > .primary-button:disabled { opacity: .45; cursor: default; }
@media (prefers-reduced-motion: reduce) { .situation-face { transition: none; } }
.card-art { display:block; width:100%; height:auto; aspect-ratio:12/7; object-fit:cover; }
.situation-face,.shelf-card { padding:0 0 12px; overflow:hidden; }
.situation-face > :not(img),.shelf-card > :not(img) { margin-inline:12px; }
.shelf-card { display:flex; flex-direction:column; gap:8px; text-decoration:none; color:inherit; border:1px solid #d6d2bf; border-radius:16px; background:#fffcf4; box-shadow:0 3px 0 #e6dfd1; }
.game-tile { min-width:0; display:flex; flex-direction:column; }
.game-tile .situation-pick { display:block; flex:1; }
.game-tile .primary-button { margin:6px 0 0; width:100%; font-size:14px; padding:10px 4px; }
.story-picture { overflow:hidden; margin-block:18px; border-radius:20px; background:#fffaf1; border:1px solid #ddd6c7; }
.scene-caption { margin:0; padding:12px; font-size:14px; }
.story-answer,.book-invite { margin:12px 0; padding:14px 18px; background:#f0eee3; border-radius:14px; }
.story-answer summary,.book-invite summary { cursor:pointer; font-weight:650; }
.story-answer p,.book-invite p { margin-bottom:0; line-height:1.7; }
.share-actions { display:grid; gap:8px; border-top:1px solid #d9d4c8; margin-top:28px; padding:18px 0; text-align:center; }
.share-actions button { margin:0; }
.share-status { font-size:14px; margin:0; }
.manual-link { width:100%; box-sizing:border-box; }
#reader-body .step-title { margin:18px 0; }
#view-reader nav { justify-content:space-between; }
.picture-quote { margin:-12px 14px 0; padding:12px 16px; position:relative; background:white; border-radius:14px 14px 14px 2px; box-shadow:0 3px 0 #ded9cc; font-weight:700; line-height:1.55; }

.home-images{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0 24px}.home-images a{display:block;overflow:hidden;border:1px solid #dad5c9;border-radius:16px;color:inherit;text-decoration:none;background:#fffaf2}.home-images img{display:block;width:100%;height:auto;aspect-ratio:12/7}.home-images span{display:block;padding:9px 12px;font-weight:700}
