/* ===================== Reset ===================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
::placeholder { color: var(--muted); opacity: 1; }
svg { width: 18px; height: 18px; flex-shrink: 0; display: inline-block; vertical-align: middle; }

/* ===================== Theme tokens ===================== */
:root[data-theme="light"] {
  --page-bg: #ece6d8;
  --bg: #f7f2e7;
  --ink: #1b1712;
  --paper: #fffdf8;
  --card-bg: #fffdf8;
  --card-border: #1b1712;
  --text: #1b1712;
  --text-secondary: #6b6252;
  --muted: #a89d87;
  --divider: #e1d7c3;
  --tag-border: #c8bca1;
  --tag-text: #6b6252;
  --disabled-bg: #e9e2d2;
  --disabled-text: #b0a48c;
  --shadow: 0 1px 2px rgba(27, 23, 18, 0.05);
  --gate-overlay: rgba(12, 10, 8, 0.6);
  --ghost-opacity: 0.045;
}

:root[data-theme="dark"] {
  --page-bg: #030302;
  --bg: #0c0a08;
  --ink: #f3ede0;
  --paper: #0c0a08;
  --card-bg: #15120c;
  --card-border: #3a3325;
  --text: #f3ede0;
  --text-secondary: #b8ad97;
  --muted: #6c6353;
  --divider: #221d14;
  --tag-border: #4a4230;
  --tag-text: #a89d87;
  --disabled-bg: #1b170f;
  --disabled-text: #56503f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  --gate-overlay: rgba(3, 3, 2, 0.72);
  --ghost-opacity: 0.06;
}

/* ===================== Fonts (사용자가 설정에서 선택) ===================== */
:root[data-font="nanum"] {
  --font-ui: "NanumSquare", "Noto Sans KR", -apple-system, sans-serif;
  --letter-spacing-ui: -0.07em;
}
:root[data-font="gothic"] {
  --font-ui: "Inter", "Noto Sans KR", -apple-system, sans-serif;
  --letter-spacing-ui: -0.01em;
}
:root[data-font="serif"] {
  --font-ui: "Noto Serif KR", "Inter", serif;
  --letter-spacing-ui: -0.01em;
}
:root[data-font="handwriting"] {
  --font-ui: "Nanum Pen Script", "Noto Sans KR", cursive;
  --letter-spacing-ui: -0.01em;
}

body {
  font-family: var(--font-ui);
  background: var(--page-bg);
  color: var(--text);
  letter-spacing: var(--letter-spacing-ui, -0.07em);
}

/* ===================== App shell / phone frame ===================== */
.app-shell {
  height: 100vh;
  height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: var(--page-bg);
  overflow: hidden;
}

.phone {
  width: 100%;
  max-width: 448px;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background 0.2s ease;
}

/* 모바일 브라우저 주소창이 나타났다 사라졌다 하며 100vh를 넘겨 하단 내비가
   화면 밖으로 잘려나가는 문제 때문에, .phone을 실제 보이는 화면 높이에
   정확히 맞추고 내부(.view)만 스크롤되게 한다 — 내비게이션은 항상 고정. */
@media (min-width: 560px) {
  .app-shell { padding: 40px 16px; height: auto; min-height: 100vh; min-height: 100dvh; overflow: visible; }
  .phone {
    height: 900px;
    max-height: 900px;
    border-radius: 36px;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.35), 0 0 0 8px #0000000d;
    border: 1px solid var(--card-border);
  }
}

.view {
  position: relative;
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 20px 28px;
  padding-bottom: 96px;
  overflow-x: hidden;
}

/* ===================== Ghost typography backdrop ===================== */
.ghost-type {
  position: absolute;
  z-index: -1;
  inset: -8px -20px auto -20px;
  height: 320px;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  font-size: 42px;
  line-height: 1.35;
  letter-spacing: 0.02em;
  word-break: keep-all;
  color: var(--text);
  opacity: var(--ghost-opacity);
  -webkit-mask-image: linear-gradient(to bottom, black, transparent);
  mask-image: linear-gradient(to bottom, black, transparent);
}

/* ===================== View transitions (route change motion) ===================== */
::view-transition-old(root) { animation: viewFadeOut 180ms ease forwards; }
::view-transition-new(root) { animation: viewFadeIn 240ms ease forwards; }
@keyframes viewFadeOut { to { opacity: 0; transform: translateY(-6px); } }
@keyframes viewFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@keyframes revealIn {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: none; }
}
.sentence-reveal { animation: revealIn 480ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.reveal-1 { animation-delay: 0ms; }
.reveal-2 { animation-delay: 100ms; }
.reveal-3 { animation-delay: 200ms; }
.reveal-4 { animation-delay: 300ms; }
.reveal-5 { animation-delay: 400ms; }

/* 가이드 리스트 항목 순차 등장 */
@keyframes rowIn {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: none; }
}
.guide-list li {
  animation: rowIn 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.guide-list li:nth-child(1) { animation-delay: 160ms; }
.guide-list li:nth-child(2) { animation-delay: 220ms; }
.guide-list li:nth-child(3) { animation-delay: 280ms; }
.guide-list li:nth-child(4) { animation-delay: 340ms; }
.guide-list li:nth-child(n+5) { animation-delay: 400ms; }

/* 타이틀 자간이 살짝 벌어졌다가 제자리로 — 감각적인 등장 효과 */
@keyframes trackIn {
  from { opacity: 0; letter-spacing: 0.05em; transform: translateY(4px); }
  to { opacity: 1; letter-spacing: -0.03em; transform: none; }
}
.page-title { animation: trackIn 520ms ease-out both; }

/* 카드 호버 리프트 (포인터 지원 기기) */
@media (hover: hover) {
  .card-outline:hover,
  .challenge-link-card:hover,
  .entry-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -14px rgba(20, 18, 15, 0.28);
  }
}

/* 카운트다운 — 아주 느린 숨쉬기 모션 */
@keyframes breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}
.countdown-clock { animation: breathe 3.6s ease-in-out infinite; }

/* ===================== Typography helpers ===================== */
.kicker {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 18px;
}
.page-title--sm { font-size: 19px; }

.page-head-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 5px;
  margin-bottom: 10px;
  padding-right: 5px;
}

.page-date {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: scale(0.97); }

.btn-solid {
  background: var(--ink);
  color: var(--paper);
}
.btn-outline {
  background: var(--card-bg);
  color: var(--ink);
  border: 1.5px solid var(--ink);
}
.btn-disabled,
.btn:disabled {
  background: var(--disabled-bg);
  color: var(--disabled-text);
  border: 1.5px solid transparent;
  cursor: not-allowed;
}
.btn-disabled:active,
.btn:disabled:active { transform: none; }

.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; }
.btn-block { width: 100%; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--divider);
}

/* ===================== Cards ===================== */
.card-outline {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: 16px;
  padding: 20px;
  transition: transform 0.15s ease;
}

.section-gap { margin-bottom: 22px; }

/* ===================== Home: countdown + notify ===================== */
.countdown-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
  text-align: center;
}
.countdown-label {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.countdown-clock {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

.notify-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--divider);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  text-align: center;
}
.notify-toggle span:last-child {
  min-width: 0;
  white-space: normal;
  line-height: 1.4;
}
.notify-toggle svg { width: 15px; height: 15px; flex-shrink: 0; }
.notify-toggle.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.notify-toggle:disabled { opacity: 0.4; cursor: not-allowed; }

.countdown-row > div:first-child { min-width: 0; width: 100%; }

/* ===================== Home: lock / sentence / practice ===================== */
.sentence-lock {
  text-align: center;
  padding: 40px 22px;
  margin-bottom: 16px;
}
.lock-teaser {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 14px 0 22px;
}

.sentence-card { margin-bottom: 16px; }
.sentence-display {
  font-size: 21px;
  line-height: 1.68;
  font-weight: 600;
  margin: 14px 0 14px;
}
.passage-source {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px dashed var(--divider);
}
.passage-book { font-size: 13px; font-weight: 700; color: var(--text); }
.passage-author { font-size: 12px; color: var(--text-secondary); }

.passage-photo-card {
  --passage-bg-image: url("../assets/passage-bg.jpg");
  position: relative;
  overflow: hidden;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 36px 26px;
  border-radius: 16px;
  color: #f7f5ef;
  background: linear-gradient(rgba(8, 7, 6, 0.58), rgba(5, 4, 3, 0.84)), var(--passage-bg-image);
  background-size: cover;
  background-position: center;
}
.passage-photo-card .kicker { color: rgba(247, 245, 239, 0.8); }
.passage-photo-card .sentence-display {
  font-size: 15.5px;
  line-height: 1.55;
  font-weight: 500;
  color: #fff;
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.4);
  text-align: justify;
  text-align-last: center;
}
.passage-photo-card .passage-source {
  width: 100%;
  border-top-color: rgba(247, 245, 239, 0.32);
}
.passage-photo-card .passage-book { color: rgba(247, 245, 239, 0.65); }
.passage-photo-card .passage-author { color: rgba(247, 245, 239, 0.85); }

/* 나만의 글 — 원문을 직접 적어 넣는 카드 (사진 삽입 시 배경으로 반영) */
.source-input {
  width: 100%;
  min-height: 90px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px dashed rgba(247, 245, 239, 0.4);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
  color: #fff;
  text-align: center;
  resize: none;
}
.source-input::placeholder { color: rgba(247, 245, 239, 0.6); }
.source-image-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.source-image-actions .btn-outline {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(247, 245, 239, 0.55);
}
.source-image-actions .btn-ghost { color: rgba(247, 245, 239, 0.75); border-color: rgba(247, 245, 239, 0.3); }

.editor-back-row { margin-bottom: 14px; }
.editor-back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}
.editor-back-link svg { width: 16px; height: 16px; }

/* ===================== 구조 분석 / 리라이팅 가이드 ===================== */
.guide-box { margin-bottom: 16px; }

.guide-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  cursor: pointer;
  padding: 0;
  margin-bottom: 14px;
}
.guide-toggle-label {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}
.guide-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  margin-left: 7px;
  color: var(--text);
  transition: transform 250ms ease;
  flex-shrink: 0;
}
.guide-toggle-icon svg { width: 100%; height: 100%; }
.guide-toggle.open .guide-toggle-icon { transform: rotate(90deg); }

@keyframes guideIconGradient {
  0%, 100% { color: var(--text); }
  50% { color: #b8863f; }
}
.guide-toggle-icon.pulse-hint { animation: guideIconGradient 1.7s ease-in-out infinite; }

.guide-collapse {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 320ms cubic-bezier(0.16, 1, 0.3, 1);
}
.guide-collapse.open { grid-template-rows: 1fr; }
.guide-collapse-inner { overflow: hidden; }

.field-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 10px;
}
.guide-list {
  margin: 0 0 16px;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.guide-list li {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-secondary);
}
.guide-list--numbered { list-style: decimal; }
.guide-list:not(.guide-list--numbered) { list-style: disc; }

.rewrite-example {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--disabled-bg);
}
.rewrite-example-label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.rewrite-example-original {
  font-size: 12.5px;
  line-height: 1.6;
  font-style: italic;
  color: var(--text-secondary);
}
.rewrite-example-arrow {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0;
}
.rewrite-example-rewrite {
  font-size: 13px;
  line-height: 1.7;
  font-weight: 600;
  color: var(--text);
}
.rewrite-example-note {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--divider);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
}

.editor-textarea-wrap {
  position: relative;
  border: 1.5px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 10px;
}
.editor-textarea {
  display: block;
  width: 100%;
  min-height: 180px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.9;
  color: var(--text);
  resize: none;
}
/* 필사 배경지 — 글을 쓸 때 고른 그대로 그 글에 저장된다 */
.paper-select-block { margin-bottom: 16px; }
.paper-select-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.paper-select-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.paper-pill {
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--divider);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  background: var(--card-bg);
  transition: transform 0.15s ease;
}
.paper-pill:active { transform: scale(0.96); }
.paper-pill.selected {
  border: 2px solid var(--ink);
  color: var(--text);
  font-weight: 800;
}

.paper-white .editor-textarea { background: #ffffff; }
.paper-cream .editor-textarea { background: #f2ecdd; }
.paper-grid .editor-textarea {
  background-color: #fdfcf8;
  background-image:
    repeating-linear-gradient(to right, rgba(20, 18, 15, 0.08) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(to bottom, rgba(20, 18, 15, 0.08) 0 1px, transparent 1px 26px);
}
.paper-lined .editor-textarea {
  background-color: #fdfcf8;
  background-image: repeating-linear-gradient(to bottom, transparent 0 33px, rgba(20, 18, 15, 0.12) 33px 34px);
  line-height: 34px;
  padding-top: 4px;
}
:root[data-theme="dark"] .paper-white .editor-textarea,
:root[data-theme="dark"] .paper-grid .editor-textarea,
:root[data-theme="dark"] .paper-lined .editor-textarea { background-color: #1c1a14; }
:root[data-theme="dark"] .paper-cream .editor-textarea { background: #2a2416; }

.char-count { text-align: right; font-size: 12px; color: var(--muted); margin-bottom: 16px; }

/* ===================== Challenge CTA ===================== */
.banner-stack { margin-top: 24px; }
.banner-stack--top { margin-top: 28px; }

.challenge-link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 20px;
  border: 1.5px solid transparent;
  border-radius: 16px;
  background: linear-gradient(var(--card-bg), var(--card-bg)) padding-box, linear-gradient(135deg, #d8b978, #a9773f, #d8b978) border-box;
  transition: transform 0.15s ease;
  margin-bottom: 12px;
}
.challenge-link-card:last-child { margin-bottom: 0; }
.challenge-link-card:active { transform: scale(0.98); }
.challenge-link-kicker {
  display: block;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 5px;
}
.challenge-link-label {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
}
.challenge-link-arrow { color: var(--muted); }

/* ===================== Archive ===================== */
.section-label-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  margin: 24px 0 14px;
}
.section-label-row::before,
.section-label-row::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--divider);
}

.empty-box {
  border: 1.5px dashed var(--divider);
  border-radius: 16px;
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 22px;
}
.empty-box--photo {
  position: relative;
  border: 1px solid var(--card-border);
  color: #f5f2ea;
  background: linear-gradient(rgba(10, 9, 7, 0.5), rgba(10, 9, 7, 0.74)), url("../assets/splash-alley.jpg") center/cover no-repeat;
  padding: 64px 22px;
  font-size: 13.5px;
}

.entry-card { margin-bottom: 12px; display: block; color: inherit; text-decoration: none; cursor: pointer; }
.entry-card:active { transform: scale(0.99); }
.entry-card .entry-meta {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.entry-card .entry-source-sentence {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--divider);
}
.entry-card .entry-content {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.entry-card .entry-analysis {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--divider);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.entry-card .entry-analysis span {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.entry-card .entry-date { font-size: 11px; color: var(--muted); margin-top: 10px; }

.book-card { margin-bottom: 12px; }
.book-card .entry-meta {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.book-card .entry-source-sentence {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
  font-style: italic;
  margin-bottom: 14px;
}
.book-card-btn { margin: 0; }

/* ===================== Bottom navigation ===================== */
.bottom-nav {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: var(--bg);
  border-top: 1px solid var(--divider);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  transition: color 0.15s ease;
}
.nav-item svg { width: 21px; height: 21px; }
.nav-item.active { color: var(--ink); font-weight: 800; }
.nav-item .nav-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  position: relative;
}
.nav-item.active .nav-icon-wrap::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink);
  transform: translateX(-50%);
}

/* ===================== Settings page ===================== */
.settings-group-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 26px 0 10px;
}
.settings-group-label:first-of-type { margin-top: 0; }

.settings-caption {
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--muted);
  margin: 10px 0 24px;
}

.option-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.option-card .option-label { font-size: 15px; font-weight: 700; }
.option-card .option-sample { font-size: 12px; color: var(--text-secondary); margin-top: 3px; display: block; }
.option-card.selected .option-sample { color: var(--paper); opacity: 0.7; }
.option-card .check-icon { flex-shrink: 0; opacity: 0; transform: scale(0.6); transition: 0.15s ease; }
.option-card.selected .check-icon { opacity: 1; transform: scale(1); }
.option-card.selected {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.theme-toggle-row { display: flex; gap: 10px; margin-bottom: 8px; }
.theme-toggle-row .option-card { margin-bottom: 0; justify-content: center; text-align: center; }

.data-actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }

.credits-subgroup-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin: 14px 0 8px;
}
.credits-subgroup-label:first-of-type { margin-top: 0; }
.credits-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.credit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--divider);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: transform 0.15s ease;
}
.credit-row:active { transform: scale(0.98); }
.credit-row svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.credit-row--static { cursor: default; }
.credit-row--static:active { transform: none; }

/* ===================== Coupang gate ===================== */
.coupang-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--gate-overlay);
}
@media (min-width: 560px) {
  .phone .coupang-gate-overlay { position: absolute; }
}
.coupang-gate-card {
  width: 100%;
  max-width: 300px;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: 18px;
  padding: 22px;
  text-align: center;
}
.coupang-gate-disclosure--top {
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-secondary);
  background: var(--disabled-bg);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 16px;
}
.coupang-gate-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 10px;
}
.coupang-gate-desc { font-size: 13px; line-height: 1.6; color: var(--text-secondary); margin-bottom: 18px; }
.coupang-gate-card .btn-block { margin-bottom: 8px; }

/* ===================== Install guide ===================== */
.install-guide-card .theme-toggle-row { margin: 4px 0 4px; }
.install-warning {
  text-align: left;
  font-size: 12.5px;
  line-height: 1.6;
  font-weight: 600;
  color: var(--text);
  background: var(--disabled-bg);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 4px 0 14px;
}
.install-warning b { color: var(--text); }
.install-steps {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}
.install-steps li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.install-steps b { color: var(--text); }
.install-steps svg { width: 15px; height: 15px; vertical-align: -2px; }
.install-step-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===================== Splash ===================== */
.splash-screen {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}
.splash-bg {
  position: absolute;
  inset: 0;
  background: url("../assets/splash-window.jpg") center/cover no-repeat;
  filter: saturate(0.85) brightness(0.96);
  transform: scale(1.04);
}
.splash-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 38%, rgba(14, 12, 9, 0.25), rgba(10, 9, 7, 0.6) 60%, rgba(8, 7, 6, 0.88) 100%),
    linear-gradient(180deg, rgba(16, 14, 11, 0.35) 0%, rgba(10, 9, 7, 0.55) 45%, rgba(8, 7, 6, 0.92) 100%);
}
.splash-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-height: 100%;
  overflow-y: auto;
  padding: 48px 34px;
  color: #f7f5ef;
  text-align: center;
}
.splash-mark {
  font-size: 30px;
  width: 66px;
  height: 66px;
  margin-bottom: 4px;
  border-radius: 50%;
  border: 1px solid rgba(247, 245, 239, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.splash-title {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
  max-width: 280px;
}
.splash-divider {
  width: 26px;
  height: 1px;
  margin: 2px 0 4px;
  background: rgba(247, 245, 239, 0.32);
  flex-shrink: 0;
}
.splash-quotes {
  display: flex;
  flex-direction: column;
  gap: 26px;
  margin: 4px 0 8px;
}
.splash-quote p {
  font-size: 15.5px;
  line-height: 1.75;
  font-style: italic;
  letter-spacing: -0.01em;
  color: #f2efe8;
  opacity: 0.94;
  max-width: 300px;
}
.splash-quote cite {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.6;
}
.splash-tap-hint {
  margin-top: 6px;
  font-size: 13px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.tap-pulse {
  display: inline-block;
  animation: tapPulse 1.8s ease-in-out infinite;
}
@keyframes tapPulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.8; } }

.reveal-item {
  opacity: 0;
  animation: splashItemIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes splashItemIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.splash-hide { opacity: 0; transition: opacity 0.5s ease; pointer-events: none; }

/* ===================== Toast ===================== */
.toast {
  position: absolute;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%) translateY(10px);
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
