/* ══════════════════════════════════════════════════════
   하루 또 하루 — 회복의 동반자
   디자인: "하루의 하늘" (4a)
   · 아침 = 새벽빛(블루→살구), 낮 = 맑은 하늘, 밤 = 딥 인디고 다크 전환
   · 아이보리 바탕 + AA 서클 블루, 명조(고운바탕) 인사말
   · 밤에는 앱 전체가 어두워진다 (body.night)
   ══════════════════════════════════════════════════════ */

:root {
  /* 낮 팔레트 */
  --bg: #fbfaf7;
  --card: #ffffff;
  --line: #edeae2;
  --ink: #2e3644;
  --ink-strong: #25324a;
  --ink-soft: #a5b2c6;
  --muted: #93a5c0;
  --blue: #3c6ba8;
  --blue-mid: #5b8bc9;
  --blue-pale: #eef3fa;
  --apricot: #e8a87c;
  --apricot-pale: #fdf1e3;
  --gold: #c08a54;            /* 아이브로우/포인트 */
  --sos: #c15b4a;
  --sos-deep: #a84a3b;
  --card-shadow: 0 2px 10px rgba(60, 90, 140, 0.06);
  --tabbar-bg: #ffffff;
  --tab-idle: #b8c4d6;

  --sans: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --serif: "Gowun Batang", "Noto Serif KR", serif;

  --radius: 20px;
  --tabbar-h: 68px;
}

/* 밤: 딥 인디고 다크 (1c) */
body.night {
  --bg: #171a30;
  --card: #1e2340;
  --line: rgba(255, 255, 255, 0.09);
  --ink: #e6e6f0;
  --ink-strong: #f2f2fa;
  --ink-soft: #8890bd;
  --muted: #8890bd;
  --blue: #8d9bd6;
  --blue-mid: #a8afdb;
  --blue-pale: rgba(141, 155, 214, 0.14);
  --apricot: #f4d9ac;
  --apricot-pale: rgba(244, 217, 172, 0.12);
  --gold: #f4d9ac;
  --sos: #d07362;
  --sos-deep: #b85a49;
  --card-shadow: none;
  --tabbar-bg: #14172b;
  --tab-idle: #565e8f;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.6s ease, color 0.6s ease;
}
body.night {
  background: linear-gradient(180deg, #14162b 0%, #1a1e38 55%, #232849 100%);
  background-attachment: fixed;
}

.view {
  max-width: 560px;
  margin: 0 auto;
  min-height: calc(100vh - 120px);
  padding: 20px 16px calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom));
}
@media (min-width: 601px) {
  .view { box-shadow: 0 0 60px rgba(40, 60, 100, 0.08); background: var(--bg); }
  body.night .view { background: transparent; box-shadow: none; }
}

::selection { background: var(--apricot-pale); }

/* ── 상단바 ───────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: #3c6ba8;
  transition: background 0.6s ease;
}
body.night .topbar { background: #14162b; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.topbar-brand { display: flex; align-items: center; gap: 10px; }
.topbar-mark {
  width: 26px; height: 26px; flex: none;
  border-radius: 50%;
  background: #fff; object-fit: cover;
  outline: 1.5px solid rgba(255, 255, 255, 0.6);
}
.topbar-title {
  font-weight: 700; font-size: 1.02rem; letter-spacing: 0.02em;
  color: #ffffff;
}
body.night .topbar-title { color: #c3c9ee; }
.lang-toggle {
  border: 1px solid rgba(255, 255, 255, 0.45); background: transparent;
  color: #ffffff; border-radius: 999px; padding: 4px 16px;
  min-height: 40px; min-width: 56px;
  font-size: 0.82rem; font-weight: 700; letter-spacing: 0.04em;
  cursor: pointer; font-family: var(--sans);
}
body.night .lang-toggle { border-color: rgba(195, 201, 238, 0.35); color: #a8afdb; }
.lang-toggle:active { background: rgba(255, 255, 255, 0.15); }

/* ── 카드 공통 ────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  margin-bottom: 12px;
  box-shadow: var(--card-shadow);
}
.card h2 {
  font-size: 1.12rem; line-height: 1.4; font-weight: 750;
  margin-bottom: 10px; color: var(--ink-strong);
}
.card h3 {
  font-size: 0.96rem; font-weight: 700; margin: 16px 0 6px; color: var(--ink-strong);
}

.section-label {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.74rem; font-weight: 800; letter-spacing: 0.16em;
  color: var(--muted); margin: 24px 2px 10px;
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ── 홈 히어로: 하루의 하늘 ─────────────────────────── */
.counter-hero {
  position: relative; overflow: hidden;
  margin: -20px -16px 0;
  padding: 34px 24px 96px;
  text-align: center; color: #fff;
}
.sky-morning { background: linear-gradient(178deg, #3c6ba8 0%, #5b8bc9 38%, #a3b8d9 66%, #eec9a4 92%, #f5ddc0 100%); }
.sky-day     { background: linear-gradient(178deg, #2f6fb5 0%, #4a89cc 45%, #8fb8e2 80%, #c8ddf1 100%); }
.sky-night   { background: transparent; }

.hero-greet {
  position: relative;
  font-family: var(--serif);
  font-size: 1.32rem; line-height: 1.55;
  white-space: pre-line;
  text-shadow: 0 1px 8px rgba(30, 50, 90, 0.25);
}
body.night .hero-greet { color: #eceef8; text-shadow: none; }

/* 해와 달 */
.sky-orb { position: absolute; border-radius: 50%; pointer-events: none; }
.sky-morning .sky-orb {
  width: 120px; height: 120px; left: 50%; bottom: -58px; transform: translateX(-50%);
  background: radial-gradient(circle at 42% 38%, #fff3dd, #f3cf9a 70%, rgba(243, 207, 154, 0));
  filter: blur(1px);
  animation: hero-breathe 8s ease-in-out infinite;
}
.sky-day .sky-orb {
  width: 64px; height: 64px; right: 28px; top: 22px;
  background: radial-gradient(circle at 40% 36%, #fffbef, #f5e7bd 72%, rgba(245, 231, 189, 0));
  box-shadow: 0 0 34px 10px rgba(255, 246, 216, 0.35);
}
.sky-night .sky-orb {
  width: 8px; height: 8px; right: 56px; top: 48px;
  background: #f4d9ac;
  box-shadow: 0 0 18px 6px rgba(244, 217, 172, 0.5);
  animation: hero-drift 7s ease-in-out infinite;
}
@keyframes hero-breathe { 0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.85; } 50% { transform: translateX(-50%) scale(1.08); opacity: 1; } }
@keyframes hero-drift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* 흘러가는 구름 — 아침·낮 하늘에만 */
.sky-cloud {
  position: absolute; border-radius: 50%;
  filter: blur(16px); pointer-events: none;
  background: rgba(255, 255, 255, 0.16);
}
/* 음수 딜레이 = 열자마자 구름이 이미 하늘에 떠 있다 */
.sky-cloud.c1 { width: 190px; height: 54px; top: 18%; left: -190px; background: rgba(255, 255, 255, 0.26); animation: cloud-drift 52s linear -14s infinite; }
.sky-cloud.c2 { width: 130px; height: 40px; top: 46%; left: -130px; background: rgba(255, 255, 255, 0.19); animation: cloud-drift 74s linear -48s infinite; }
.sky-cloud.c3 { width: 240px; height: 62px; top: 64%; left: -240px; background: rgba(255, 255, 255, 0.14); animation: cloud-drift 96s linear -76s infinite; }
.sky-night .sky-cloud { display: none; }
@keyframes cloud-drift {
  from { transform: translateX(0); }
  to { transform: translateX(calc(100vw + 480px)); }
}

/* 낮의 해도 은은하게 숨쉰다 (아침 해와 같은 리듬) */
.sky-day .sky-orb { animation: orb-breathe 9s ease-in-out infinite; }
@keyframes orb-breathe {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.07); opacity: 1; }
}

/* 아침·낮 하늘의 잔잔한 빛 일렁임 */
.sky-morning::after, .sky-day::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 60% at 50% 110%, rgba(255, 244, 220, 0.32), transparent 65%);
  animation: sky-glow 12s ease-in-out infinite;
}
@keyframes sky-glow {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* 밤하늘의 별 */
.sky-stars { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.sky-night .sky-stars {
  opacity: 1;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 24%, #c3c9ee 60%, transparent),
    radial-gradient(1px 1px at 27% 62%, #9aa2d6 60%, transparent),
    radial-gradient(1.4px 1.4px at 44% 18%, #c3c9ee 60%, transparent),
    radial-gradient(1px 1px at 58% 44%, #8890bd 60%, transparent),
    radial-gradient(1.2px 1.2px at 71% 70%, #b8bfe8 60%, transparent),
    radial-gradient(1px 1px at 84% 30%, #9aa2d6 60%, transparent),
    radial-gradient(1.3px 1.3px at 91% 56%, #c3c9ee 60%, transparent);
}
/* 반짝이는 별 레이어 */
.sky-night .sky-stars.twinkle {
  background-image:
    radial-gradient(1.4px 1.4px at 19% 40%, #e6e9ff 60%, transparent),
    radial-gradient(1.2px 1.2px at 37% 74%, #c3c9ee 60%, transparent),
    radial-gradient(1.5px 1.5px at 52% 26%, #e6e9ff 60%, transparent),
    radial-gradient(1.2px 1.2px at 66% 58%, #c3c9ee 60%, transparent),
    radial-gradient(1.4px 1.4px at 79% 16%, #e6e9ff 60%, transparent),
    radial-gradient(1.2px 1.2px at 94% 44%, #c3c9ee 60%, transparent);
  animation: star-twinkle 4.5s ease-in-out infinite;
}
@keyframes star-twinkle {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}
/* 가끔 하나 떨어지는 별똑별 */
.sky-night .sky-stars.twinkle::after {
  content: ""; position: absolute;
  width: 54px; height: 1.5px; border-radius: 99px;
  background: linear-gradient(90deg, rgba(230, 233, 255, 0.9), rgba(230, 233, 255, 0));
  top: 18%; left: 72%; opacity: 0;
  transform: rotate(152deg);
  animation: shooting-star 11s ease-in infinite;
}
@keyframes shooting-star {
  0%, 90% { opacity: 0; transform: rotate(152deg) translateX(0); }
  91% { opacity: 0.9; }
  96%, 100% { opacity: 0; transform: rotate(152deg) translateX(150px); }
}

/* 떠 있는 카운터 카드 */
.counter-card {
  position: relative;
  margin: -68px 4px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 24px 20px 20px;
  text-align: center;
  box-shadow: 0 12px 36px rgba(60, 90, 140, 0.14);
}
body.night .counter-card {
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(6px);
  box-shadow: none;
}
.counter-card .hero-label {
  font-size: 0.78rem; letter-spacing: 0.2em; font-weight: 700;
  color: var(--blue-mid); text-transform: uppercase;
}
body.night .counter-card .hero-label { color: #8d9bd6; }
.counter-days {
  font-size: 3.6rem; font-weight: 780; line-height: 1.1;
  letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
  color: var(--ink-strong); margin-top: 2px;
}
body.night .counter-days { font-weight: 300; letter-spacing: -0.02em; }
.counter-days small { font-size: 1.2rem; font-weight: 600; margin-left: 4px; color: var(--muted); }
.counter-breakdown { font-size: 0.9rem; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 2px; }
.counter-oneday {
  margin-top: 14px; padding-top: 12px;
  font-size: 0.88rem; color: var(--ink-soft);
  border-top: 1px solid var(--line);
}

/* ── 칩: AA 메달리온 ──────────────────────────────── */
.chip-next { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.chip-next strong { color: var(--ink-strong); }
.chip-next-date { font-size: 0.79rem; color: var(--ink-soft); margin-top: 2px; text-align: right; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.chip { width: 62px; text-align: center; }
.chip .coin {
  position: relative;
  width: 56px; height: 56px; border-radius: 50%;
  margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.68rem; font-weight: 800; line-height: 1.1;
  color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.4),
    inset 0 -3px 5px rgba(0, 0, 0, 0.3),
    0 3px 6px rgba(40, 60, 100, 0.22);
}
.chip .coin::before {
  content: ""; position: absolute; inset: 4px; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  border-bottom-color: rgba(0, 0, 0, 0.25);
  pointer-events: none;
}
/* 메달 광택 */
.coin::after, .big-coin::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 35% 26%, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 52%);
  pointer-events: none;
}
.chip.locked .coin::after { display: none; }
/* 티어 메달 — 5년 금장 → 10·15년 플래티넘 → 20·30년 다이아 → 40년+ 레전드 */
.coin.t-gold, .big-coin.t-gold {
  background: linear-gradient(140deg, #f0d98a 0%, #d4af37 45%, #a67c1a 100%) !important;
  color: #3d2f05 !important; text-shadow: 0 1px 1px rgba(255, 255, 255, 0.45) !important;
}
.coin.t-gold::before, .big-coin.t-gold::before {
  border-color: rgba(255, 255, 255, 0.7) !important;
  border-bottom-color: rgba(90, 65, 10, 0.45) !important;
}
.coin.t-plat, .big-coin.t-plat {
  background: linear-gradient(140deg, #f7fafc 0%, #cbd7e2 45%, #93a5b8 100%) !important;
  color: #3a4a5c !important; text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6) !important;
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.6),
    inset 0 -3px 5px rgba(60, 80, 100, 0.25),
    0 3px 8px rgba(40, 60, 100, 0.2),
    0 0 14px rgba(150, 185, 220, 0.45) !important;
}
.coin.t-plat::before, .big-coin.t-plat::before {
  border-color: rgba(255, 255, 255, 0.85) !important;
  border-bottom-color: rgba(70, 90, 110, 0.35) !important;
}
.coin.t-dia, .big-coin.t-dia {
  background: linear-gradient(135deg, #bfe3f5 0%, #a8b6ee 35%, #d6b8ef 68%, #9fdbe8 100%) !important;
  background-size: 220% 220% !important;
  color: #2b3a66 !important; text-shadow: 0 1px 1px rgba(255, 255, 255, 0.55) !important;
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.65),
    inset 0 -3px 5px rgba(80, 90, 160, 0.3),
    0 3px 8px rgba(60, 80, 160, 0.22),
    0 0 18px rgba(150, 180, 255, 0.55) !important;
  animation: dia-shimmer 5s ease-in-out infinite;
}
.coin.t-dia::before, .big-coin.t-dia::before {
  border-color: rgba(255, 255, 255, 0.9) !important;
  border-bottom-color: rgba(90, 100, 180, 0.35) !important;
}
@keyframes dia-shimmer {
  0%, 100% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
}
.coin.t-legend, .big-coin.t-legend {
  background: radial-gradient(circle at 35% 30%, #3a4668, #1a2138 72%) !important;
  color: #f4d9ac !important; text-shadow: 0 0 8px rgba(244, 217, 172, 0.7) !important;
  box-shadow:
    inset 0 2px 3px rgba(180, 200, 255, 0.25),
    inset 0 -3px 6px rgba(0, 0, 0, 0.5),
    0 3px 8px rgba(10, 15, 35, 0.4),
    0 0 20px rgba(244, 217, 172, 0.45) !important;
}
.coin.t-legend::before, .big-coin.t-legend::before {
  border-color: rgba(244, 217, 172, 0.65) !important;
  border-bottom-color: rgba(244, 217, 172, 0.25) !important;
}
.chip.locked .coin {
  background: var(--blue-pale) !important;
  color: var(--muted); text-shadow: none;
  box-shadow: inset 0 2px 5px rgba(40, 60, 100, 0.1);
}
.chip.locked .coin::before { border-color: rgba(40, 60, 100, 0.08); }
/* 밤 테마: 잠긴 칩이 배경에 묻히지 않도록 — 텍스트는 밝게, 링은 또렷하게
   (.coin.light의 !important 어두운 글씨 규칙보다 우선해야 하므로 !important 필요) */
body.night .chip.locked .coin,
body.night .chip.locked .coin.light {
  background: rgba(141, 155, 214, 0.22) !important;
  color: #eceef8 !important;
  text-shadow: none !important;
  box-shadow: inset 0 0 0 1.5px rgba(141, 155, 214, 0.5);
}
body.night .chip.locked .coin::before { border-color: rgba(141, 155, 214, 0.4) !important; }
.coin.light, .big-coin.light {
  color: #25324a !important; text-shadow: none !important;
}
.coin.light::before, .big-coin.light::before { border-color: rgba(40, 60, 100, 0.2) !important; }

/* ── 목록 ─────────────────────────────────────────── */
.list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 15px 17px; margin-bottom: 10px; cursor: pointer;
  text-decoration: none; color: var(--ink);
  min-height: 56px;
  box-shadow: var(--card-shadow);
}
.list-item:active { background: var(--blue-pale); }
.list-item .li-body { flex: 1; min-width: 0; }
.list-item .li-title { font-weight: 650; }
.list-item .li-title.serif { font-family: var(--serif); font-weight: 700; }
.list-item .li-sub { font-size: 0.79rem; color: var(--ink-soft); margin-top: 1px; }
.list-item .li-teaser { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .li-arrow { color: var(--ink-soft); font-size: 1.15rem; flex: none; }

/* 홈: 지금 할 일 타일 + 리딩/기도문 전체 보기 */
.task-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.task-grid.single { grid-template-columns: 1fr; }
.task-tile {
  display: block; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 16px; min-height: 78px;
  box-shadow: var(--card-shadow);
}
.task-tile:active { background: var(--blue-pale); }
.task-tile .li-title { font-weight: 700; font-size: 0.95rem; color: var(--ink-strong); }
.task-tile .li-sub { font-size: 0.79rem; color: var(--ink-soft); margin-top: 3px; line-height: 1.5; }
.browse-row { display: flex; gap: 10px; margin-top: 2px; }
.browse-link {
  flex: 1; display: flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 10px 14px;
  border: 1px dashed var(--line); border-radius: 16px;
  background: transparent;
  font-size: 0.86rem; font-weight: 650; color: var(--blue);
  text-decoration: none;
}
.browse-link:active { background: var(--blue-pale); }
body.night .browse-link { color: var(--blue-mid); }

/* ── 기도문: 평온의 기도 히어로 ────────────────────── */
.prayer-hero {
  display: block; text-decoration: none; color: var(--ink-strong);
  background: linear-gradient(135deg, #f2f6fc, #fdf4e9);
}
body.night .prayer-hero {
  background: linear-gradient(135deg, rgba(141, 155, 214, 0.16), rgba(141, 155, 214, 0.05));
  border-color: rgba(141, 155, 214, 0.22);
  color: var(--ink);
}
.prayer-hero:active { opacity: 0.85; }
.prayer-hero-body {
  font-family: var(--serif);
  white-space: pre-line; line-height: 1.9; font-size: 1.02rem;
  margin-top: 4px;
}

/* ── 더보기 ────────────────────────────────────────── */
.list-item .more-ic { margin-bottom: 0; flex: none; }
.about-footer {
  margin-top: 32px; padding: 0 8px;
  font-size: 0.78rem; line-height: 1.7; color: var(--muted);
  text-align: center; white-space: pre-line;
}
.feedback-link {
  display: block; text-align: center; margin-top: 10px;
  font-size: 0.78rem; color: var(--blue); text-decoration: underline;
  text-underline-offset: 3px;
}
.more-ic {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--blue-pale); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.more-ic svg { width: 20px; height: 20px; }
.more-label { font-weight: 700; font-size: 0.95rem; color: var(--ink-strong); }
.more-sub { font-size: 0.78rem; color: var(--ink-soft); margin-top: 2px; line-height: 1.5; }

/* ── 본문 ─────────────────────────────────────────── */
.reading-body {
  white-space: pre-wrap;
  font-size: 1.03rem; line-height: 1.85;
}
.reading-body.large { font-size: 1.34rem; line-height: 1.9; }
.reading-source {
  font-size: 0.78rem; color: var(--ink-soft); margin-top: 16px;
  padding-top: 10px; border-top: 1px solid var(--line);
}
.quote {
  font-family: var(--serif);
  border-left: 2px solid var(--apricot); padding: 6px 2px 6px 14px;
  color: var(--ink-strong); margin-bottom: 14px; white-space: pre-wrap;
  font-size: 1.05rem; line-height: 1.8;
}

/* ── 홈 '오늘의 묵상' 카드 ─────────────────────────── */
.refl-card {
  background: linear-gradient(135deg, #f2f6fc, #fdf4e9);
  border: 1px solid var(--line);
}
body.night .refl-card {
  background: linear-gradient(135deg, rgba(141, 155, 214, 0.16), rgba(141, 155, 214, 0.05));
  border-color: rgba(141, 155, 214, 0.22);
}
.refl-eyebrow {
  font-size: 0.74rem; font-weight: 800; letter-spacing: 0.14em;
  color: var(--gold); margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.refl-card h2 { font-family: var(--serif); font-weight: 700; font-size: 1.24rem; margin-bottom: 6px; }
.refl-teaser {
  color: var(--ink-soft); line-height: 1.7; margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.read-badge {
  background: var(--blue-pale); color: var(--blue);
  border-radius: 999px; padding: 2px 10px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0;
}
.btn.gold {
  background: linear-gradient(140deg, var(--blue-mid), var(--blue));
  color: #fff; font-weight: 800;
  box-shadow: 0 4px 14px rgba(60, 107, 168, 0.3);
}
body.night .btn.gold {
  background: linear-gradient(140deg, #f4d9ac, #e0b16f);
  color: #2a2410; box-shadow: none;
}

.back-btn {
  background: none; border: none; padding: 10px 0; cursor: pointer;
  color: var(--ink-soft); font-size: 0.88rem; font-family: var(--sans);
}

.summary-box {
  background: var(--blue-pale);
  border-radius: 14px;
  padding: 12px 14px;
  margin-top: 18px;
  font-size: 1rem; font-weight: 600;
  color: var(--ink-strong);
}
.summary-tag {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.14em;
  color: var(--blue-mid); margin-bottom: 4px;
}

.journal-detail { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 4px; }

.pill-row { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.pill {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 10px 16px; font-size: 0.85rem; cursor: pointer; color: var(--ink);
  font-family: var(--sans); min-height: 44px;
}
.pill.active { background: var(--blue); color: #fff; border-color: var(--blue); }
body.night .pill.active { color: #14162b; }

/* ── 날짜 네비 ────────────────────────────────────── */
.date-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.date-nav button {
  border: 1px solid var(--line); background: var(--card); border-radius: 14px;
  width: 46px; height: 46px; font-size: 1.2rem; cursor: pointer; color: var(--blue);
}
.date-nav .date-label { font-weight: 750; font-size: 1.05rem; color: var(--ink-strong); }

/* ── 폼 ───────────────────────────────────────────── */
label.field { display: block; margin-bottom: 12px; font-size: 0.88rem; font-weight: 600; }
input[type="date"], input[type="time"], input[type="text"], input[type="tel"], textarea, select {
  width: 100%; margin-top: 6px; padding: 13px; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card);
  font-family: var(--sans); color: var(--ink);
}
body.night input, body.night textarea, body.night select { background: #262c4e; }
textarea { min-height: 96px; resize: vertical; }

.btn {
  display: block; width: 100%; min-height: 54px;
  padding: 15px; border: none; border-radius: 16px;
  background: var(--blue); color: #fff;
  font-size: 1rem; font-weight: 700; font-family: var(--sans);
  cursor: pointer; margin-top: 10px; text-align: center; text-decoration: none;
  box-shadow: 0 2px 8px rgba(60, 107, 168, 0.25);
}
body.night .btn { color: #14162b; box-shadow: none; }
.btn.secondary {
  background: transparent; color: var(--blue);
  border: 1.5px solid var(--blue); box-shadow: none;
}
body.night .btn.secondary { color: var(--blue-mid); border-color: rgba(141, 155, 214, 0.5); }
.btn.danger { background: var(--sos); color: #fff; box-shadow: 0 2px 8px rgba(193, 91, 74, 0.3); }
.btn:active { opacity: 0.85; }

/* ── 체크리스트 ───────────────────────────────────── */
.check-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--line); font-size: 0.96rem;
}
.check-item:last-child { border-bottom: none; }
.check-item input {
  width: 22px; height: 22px; margin-top: 2px; flex: none;
  accent-color: var(--blue);
}

/* ── SOS ─────────────────────────────────────────── */
/* ── SOS: 숨 고르기 ─────────────────────── */
.sos-hero {
  text-align: center;
  padding: 32px 22px 26px;
  background: linear-gradient(170deg, #eef3fa, #fdf4e9);
}
body.night .sos-hero {
  background: linear-gradient(170deg, rgba(141, 155, 214, 0.14), rgba(244, 217, 172, 0.05));
  border-color: rgba(141, 155, 214, 0.22);
}
.sos-hero h2 { margin-top: 16px; margin-bottom: 6px; }
.sos-sub { color: var(--ink-soft); font-size: 0.94rem; line-height: 1.7; }
.breath-orb {
  width: 92px; height: 92px; border-radius: 50%;
  margin: 8px auto 14px;
  background: radial-gradient(circle at 40% 34%, #d8e5f4, #9db9dc);
  box-shadow: 0 0 0 14px rgba(91, 139, 201, 0.08), 0 0 0 28px rgba(91, 139, 201, 0.04);
  animation: breath 8s ease-in-out infinite;
}
body.night .breath-orb {
  background: radial-gradient(circle at 40% 34%, #a8afdb, #565e8f);
  box-shadow: 0 0 0 14px rgba(141, 155, 214, 0.1), 0 0 0 28px rgba(141, 155, 214, 0.05);
}
@keyframes breath {
  0%, 100% { transform: scale(0.84); }
  40%, 55% { transform: scale(1.08); }
}
.breath-hint { font-size: 0.8rem; color: var(--muted); letter-spacing: 0.04em; }
/* 들숨·날숨 안내 — 숨 원(8초)과 동기화 */
.breath-words { position: relative; height: 1.3em; font-size: 0.82rem; color: var(--muted); letter-spacing: 0.04em; }
.breath-words span { position: absolute; left: 0; right: 0; }
.breath-words .bw-in { animation: bw-in 8s ease-in-out infinite; }
.breath-words .bw-out { animation: bw-out 8s ease-in-out infinite; opacity: 0; }
@keyframes bw-in { 0% { opacity: 0; } 8%, 34% { opacity: 1; } 46%, 100% { opacity: 0; } }
@keyframes bw-out { 0%, 46% { opacity: 0; } 56%, 88% { opacity: 1; } 100% { opacity: 0; } }
.halt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.halt-tile { background: var(--blue-pale); border-radius: 16px; padding: 14px; }
.halt-tile .halt-k {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--card); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem; margin-bottom: 8px;
}
.halt-tile .halt-label { font-weight: 700; font-size: 0.92rem; color: var(--ink-strong); }
.halt-tile .halt-hint { font-size: 0.8rem; color: var(--ink-soft); margin-top: 2px; line-height: 1.55; }
.sos-timer {
  font-size: 3.4rem; font-weight: 300; text-align: center;
  color: var(--ink-strong); font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* ── 하단 탭바 ────────────────────────────────────── */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: center;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--tabbar-bg);
  border-top: 1px solid var(--line);
  transition: background 0.6s ease;
}
.tabbar-inner { display: flex; width: 100%; max-width: 560px; }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; text-decoration: none;
  color: var(--tab-idle); font-size: 0.68rem; letter-spacing: 0.02em;
}
.tab svg { width: 24px; height: 24px; }
.tab.active { color: var(--blue); }
.tab.active .tab-label { font-weight: 700; }

/* SOS 탭: 떠 있는 블루 배지 */
.tab-sos .tab-badge {
  width: 48px; height: 48px; border-radius: 50%;
  margin-top: -22px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, #5b8bc9, #3c6ba8);
  color: #fff;
  box-shadow: 0 6px 18px rgba(60, 107, 168, 0.4);
  border: 3px solid var(--tabbar-bg);
}
body.night .tab-sos .tab-badge {
  background: linear-gradient(140deg, #f4d9ac, #e0b16f);
  color: #2a2410;
  box-shadow: 0 6px 20px rgba(244, 217, 172, 0.3);
}
.tab-sos .tab-badge svg { width: 22px; height: 22px; }
.tab-sos { color: var(--tab-idle); }
.tab-sos.active { color: var(--blue); }

/* ── 오버레이 ─────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20, 25, 45, 0.55);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.overlay.hidden { display: none; }
.overlay .sheet {
  position: relative; overflow: hidden;
  background: var(--card); border-radius: 26px; padding: 28px 22px;
  width: 100%; max-width: 420px; max-height: 85vh; overflow-y: auto;
  border: 1px solid var(--line);
}
body.night .overlay .sheet { background: #1e2340; }
.overlay .sheet h2 { color: var(--ink-strong); font-size: 1.3rem; font-weight: 750; }

.celebrate { text-align: center; }
.celebrate .big-coin {
  position: relative;
  width: 120px; height: 120px; border-radius: 50%; margin: 16px auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; font-weight: 800;
  color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  box-shadow:
    inset 0 3px 5px rgba(255, 255, 255, 0.4),
    inset 0 -5px 8px rgba(0, 0, 0, 0.3),
    0 6px 16px rgba(40, 60, 100, 0.3);
  animation: coin-pop 0.7s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.celebrate .big-coin::before {
  content: ""; position: absolute; inset: 7px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-bottom-color: rgba(0, 0, 0, 0.25);
}
@keyframes coin-pop {
  from { transform: scale(0.3) rotate(-14deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

/* 칩 축하 콘페티 */
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i {
  position: absolute; top: -16px; width: 8px; height: 13px; border-radius: 2px;
  opacity: 0;
  animation: confetti-fall 2.8s ease-in 2;
}
.confetti i:nth-child(1)  { left: 6%;  background: #5b8bc9; animation-delay: 0s; }
.confetti i:nth-child(2)  { left: 14%; background: #e8a87c; animation-delay: 0.5s; height: 9px; }
.confetti i:nth-child(3)  { left: 24%; background: #d4af37; animation-delay: 0.2s; }
.confetti i:nth-child(4)  { left: 33%; background: #2e6b55; animation-delay: 0.8s; height: 10px; }
.confetti i:nth-child(5)  { left: 42%; background: #c0392b; animation-delay: 0.35s; }
.confetti i:nth-child(6)  { left: 50%; background: #6c3d8f; animation-delay: 1.1s; height: 9px; }
.confetti i:nth-child(7)  { left: 58%; background: #e8a87c; animation-delay: 0.15s; }
.confetti i:nth-child(8)  { left: 66%; background: #5b8bc9; animation-delay: 0.7s; height: 11px; }
.confetti i:nth-child(9)  { left: 74%; background: #d4af37; animation-delay: 0.45s; }
.confetti i:nth-child(10) { left: 82%; background: #2c5f8a; animation-delay: 0.95s; height: 9px; }
.confetti i:nth-child(11) { left: 90%; background: #c0392b; animation-delay: 0.25s; }
.confetti i:nth-child(12) { left: 96%; background: #2e6b55; animation-delay: 0.6s; height: 10px; }
@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0) skewX(0); opacity: 1; }
  100% { transform: translateY(460px) rotate(560deg) skewX(18deg); opacity: 0; }
}

/* ── 유틸 ─────────────────────────────────────────── */
.muted { color: var(--ink-soft); font-size: 0.86rem; }
.center { text-align: center; }
.mt { margin-top: 14px; }
.hidden { display: none !important; }

a { color: var(--blue); }
:focus-visible { outline: 2.5px solid var(--blue-mid); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  .celebrate .big-coin, .sky-orb, .breath-orb, .sky-cloud, .sky-stars.twinkle, .sky-stars.twinkle::after, .breath-words span,
  .sky-morning::after, .sky-day::after { animation: none; }
  .confetti { display: none; }
}
