/* ===========================================================================
   감사선포 챌린지 — 사용자 화면
   방향: 추수 테마(감·단풍, 2026-10-11) 색 + 시안 A(새벽 햇살)의 디테일.
   - 감·단풍 팔레트(주황·버터), 헤더에 햇살이 번지는 빛(아이콘 없음)
   - 카드가 아래에서 떠오르며 등장, 반짝이는 감사선포 알약, 나무에 감사 열매가 톡톡 맺힘
   =========================================================================== */
:root {
  --bg: #fbf3ec;
  --ink: #3d2418;
  --sub: #8c6b5a;
  --card: #ffffff;
  --line: #f0dccf;
  --soft: #fdf6f1;
  --acc: #e0703a;
  --acc-deep: #b24c25;
  --butter: #ffc65c;
  --butter-soft: #ffecd0;
  --danger: #e2574c;
  --g0: #eee5df;   /* 아직(지난 날, 나눔 없음) — 옅은 베이지 */
  --g1: #f5b088;   /* 나눔 — 익어 가는 감 */
  --g2: #c0502a;   /* 나눔 + 10번 선포 — 다 익은 감 */
  --rx-heart: #ff4f7a;
  --rx-amen: #8a5cff;
  --rx-good: #2f8fff;
  --rx-fighting: #ff8a1f;
  --r: 24px;
  --r-sm: 16px;
  --shadow: 0 8px 24px rgba(61, 36, 24, .07);
  --f-disp: "Dongle", "IBM Plex Sans KR", system-ui, sans-serif;
  --f-body: "IBM Plex Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  --f-word: "Gowun Dodum", "IBM Plex Sans KR", serif;
  --ease-pop: cubic-bezier(.3, 1.6, .5, 1);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.6;
  padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}
img, svg { max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--acc) 55%, transparent); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--sub); }
.small { font-size: 12.5px; }

.icon { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.icon .fill { fill: currentColor; stroke: none; }

/* ---------- 상단 바 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: var(--acc);
  color: #fff;
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; font-family: var(--f-disp); font-size: 30px; font-weight: 700; line-height: 1; }
.brand img { border-radius: 9px; background: #fff; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px; max-width: 60%;
  border: 0; border-radius: 999px; padding: 6px 12px 6px 6px;
  background: rgba(255, 255, 255, .18); color: #fff; font-size: 13.5px; font-weight: 500;
  transition: background .2s, transform .15s;
}
.chip-btn:active { transform: scale(.96); }
.chip-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-btn .icon { width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: rgba(255,255,255,.25); }
.chip-btn--kakao { background: #fee500; color: #191600; padding: 6px 12px; }
.chip-btn--kakao .icon { background: none; padding: 0; width: 18px; height: 18px; }
.avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }

.page { max-width: 560px; margin: 0 auto; padding-inline: 16px; padding-block: 0 24px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- 히어로: 정원 초록 + 번지는 햇살 ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  margin-inline: -16px; padding: 18px 20px 24px;
  background: linear-gradient(165deg, var(--acc) 0%, var(--acc-deep) 100%);
  color: #fff; border-radius: 0 0 44px 0;
}
.hero::before { /* 햇살 — 오른쪽 위에서 번지는 따뜻한 빛, 천천히 숨 쉬듯 */
  content: ""; position: absolute; z-index: -1; right: -30%; top: -60%;
  width: 120%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 236, 150, .55) 0%, rgba(255, 216, 77, .22) 32%, rgba(255, 216, 77, 0) 62%);
  animation: sunlight 7s ease-in-out infinite;
}
.hero::after { /* 햇살 줄기 — 가끔 비스듬히 스쳐 지나가는 빛 */
  content: ""; position: absolute; z-index: -1; inset: -40% -60%;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 250, 220, .16) 48%, rgba(255, 250, 220, .05) 52%, transparent 58%);
  animation: lightsweep 9s ease-in-out 1.2s infinite;
}
@keyframes sunlight { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.12); opacity: 1; } }
@keyframes lightsweep { 0% { transform: translateX(-35%); opacity: 0; } 15% { opacity: 1; } 45%, 100% { transform: translateX(35%); opacity: 0; } }
.hero-eyebrow { margin: 0; font-size: 12.5px; letter-spacing: .03em; opacity: .9; }
.hero-title { margin: 2px 0 0; font-family: var(--f-disp); font-weight: 700; font-size: 50px; line-height: .95; text-wrap: balance; animation: rise .7s var(--ease-out) both; }
.hero-sub { margin: 8px 0 0; font-size: 14px; opacity: .92; }
.hero-count { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; font-size: 13px; opacity: .95; }
.hero-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.hero-foot .hero-count { margin: 0; }
.hero-share { flex: none; display: inline-flex; align-items: center; gap: 5px; border: 1.5px solid rgba(255,255,255,.55); background: rgba(255,255,255,.16); color: #fff; border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 700; backdrop-filter: blur(4px); transition: transform .15s, background .2s; }
.hero-share:active { transform: scale(.94); }
.hero-share .icon { width: 15px; height: 15px; }
.hero-count b { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.progress { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 14px; font-variant-numeric: tabular-nums; }
.progress b { font-family: var(--f-disp); font-size: 28px; line-height: 1; }
.progress-bar { flex: 1; height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .26); overflow: hidden; }
.progress-bar i { display: block; height: 100%; width: var(--p); border-radius: inherit; background: linear-gradient(90deg, #fff2a8, var(--butter)); box-shadow: 0 0 12px rgba(255, 216, 77, .7); animation: grow 1.4s var(--ease-out) .2s both; }
@keyframes grow { from { width: 0; } }

/* ---------- 카드 공통 ---------- */
.card { background: var(--card); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.card--empty { text-align: center; padding: 26px 18px; }
.empty-title { margin: 0 0 4px; font-family: var(--f-disp); font-size: 26px; line-height: 1.1; }
.rise { animation: rise .6s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 90ms + 120ms); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.label { display: flex; align-items: center; gap: 6px; margin: 0; font-family: var(--f-disp); font-weight: 700; font-size: 27px; line-height: 1; color: var(--acc-deep); }
.label .icon { width: 20px; height: 20px; }
.label .count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 99px; background: var(--acc); color: #fff; font-family: var(--f-body); font-size: 12px; font-weight: 700; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ---------- 감사말씀 ---------- */
.ver-toggle { display: inline-flex; align-items: center; gap: 4px; border: 1.5px solid var(--line); background: var(--soft); border-radius: 99px; padding: 4px 10px; font-size: 12.5px; color: var(--sub); transition: transform .15s; }
.ver-toggle:active { transform: scale(.95); }
.verse { margin-top: 14px; }
.verse + .verse { padding-top: 14px; border-top: 1.5px dashed var(--line); }
.verse-ref { margin: 0; font-weight: 700; font-size: 13px; color: var(--sub); }
.verse-text { margin: 4px 0 0; font-family: var(--f-word); font-size: 17px; line-height: 1.85; }
.verse-text sup { font-family: var(--f-body); font-size: 10.5px; color: var(--acc); font-weight: 700; margin-right: 3px; }
/* 절마다 줄을 바꾼다. 둘째 줄부터는 절 번호 뒤로 들여쓰기 */
.vl { display: block; padding-left: 20px; text-indent: -20px; }
.vl + .vl { margin-top: 4px; }
.verse-text sup { display: inline-block; min-width: 20px; text-indent: 0; margin-right: 0; vertical-align: super; line-height: 1; }
.v-new { display: none; }
body.ver-new .v-rev { display: none; }
body.ver-new .v-new { display: inline; }
.verse-text.swap { animation: fadeSwap .35s ease; }
@keyframes fadeSwap { from { opacity: .2; transform: translateY(4px); } }
.word-body { margin: 16px 0 0; padding: 14px; border-radius: var(--r-sm); background: var(--butter-soft); font-size: 14.5px; line-height: 1.75; overflow-wrap: anywhere; }
.word-body > :first-child { margin-top: 0; } .word-body > :last-child { margin-bottom: 0; }
.word-body p { margin: 0 0 .5em; }
.word-body img { max-width: 100%; height: auto; display: block; margin: 10px auto; border-radius: 10px; }
.word-body ul, .word-body ol { margin: 0 0 .5em; padding-left: 1.4em; }
.word-body hr { border: 0; border-top: 1.5px dashed var(--line); margin: 12px 0; }

/* ---------- 나눔 작성 ---------- */
.share-section { display: flex; flex-direction: column; gap: 14px; }
.share-form { display: flex; flex-direction: column; gap: 12px; }
.name-row { display: flex; align-items: center; gap: 10px; }
.name-box { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); border-radius: 999px; padding: 9px 14px; background: var(--card); transition: border-color .2s; }
.name-box:focus-within { border-color: var(--acc); }
.name-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-weight: 500; }
.name-box.is-locked { background: var(--soft); color: var(--sub); }
.name-box.is-locked input { color: var(--ink); }
.kakao-tag { flex: none; font-size: 11px; font-weight: 700; background: #fee500; color: #191600; border-radius: 99px; padding: 2px 8px; }
.link-btn { border: 1.5px solid var(--line); background: var(--soft); border-radius: 999px; padding: 5px 12px; color: var(--acc-deep); font-size: 13px; font-weight: 600; white-space: nowrap; transition: border-color .15s, transform .15s; }
.link-btn:hover { border-color: var(--acc); }
.link-btn:active { transform: scale(.95); }
textarea#shareContent {
  width: 100%; min-height: 168px; resize: vertical;
  border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px;
  background: var(--soft); font-size: 15px; line-height: 1.75; transition: border-color .2s, background .2s;
}
textarea#shareContent:focus { outline: 0; border-color: var(--acc); background: #fff; }
textarea#shareContent::placeholder { color: var(--sub); opacity: .7; }

.declare { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--soft); border: 1.5px solid transparent; cursor: pointer; user-select: none; transition: border-color .2s, background .2s; }
.declare input { position: absolute; opacity: 0; pointer-events: none; }
.declare-box { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 9px; border: 2px solid var(--acc); background: #fff; transition: background .2s, transform .25s var(--ease-pop); }
.declare-box .icon { width: 17px; height: 17px; stroke: #fff; stroke-width: 3; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .35s .05s; }
.declare input:checked ~ .declare-box { background: var(--acc); transform: scale(1.08); }
.declare input:checked ~ .declare-box .icon { stroke-dashoffset: 0; }
.declare input:checked ~ .declare-text b { color: var(--acc-deep); }
.declare:has(input:checked) { border-color: color-mix(in srgb, var(--acc) 40%, transparent); background: color-mix(in srgb, var(--acc) 8%, #fff); }
.declare input:focus-visible ~ .declare-box { outline: 3px solid color-mix(in srgb, var(--acc) 55%, transparent); outline-offset: 2px; }
.declare-text b { display: block; font-size: 14.5px; }
.declare-text small { display: block; font-size: 12px; color: var(--sub); }

.form-actions { display: flex; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 999px; padding: 12px 18px; font-weight: 700; transition: transform .15s, background .2s, box-shadow .2s; }
.btn:active { transform: scale(.96); }
.btn--primary { background: var(--acc); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--acc) 35%, transparent); }
.btn--primary:hover { background: var(--acc-deep); }
.btn--primary[disabled] { opacity: .6; }
.btn--kakao { background: #fee500; color: #191600; }
.btn--kakao .icon { width: 20px; height: 20px; }
.login-choice { text-align: center; }
.login-choice .label { justify-content: center; }
.login-choice .muted { margin: 4px 0 14px; }
.login-choice-btns { display: grid; gap: 8px; }
.login-choice .hint { margin: 12px 0 0; font-size: 12.5px; color: var(--sub); line-height: 1.6; }
.btn--ghost { background: var(--soft); color: var(--sub); border: 1.5px solid var(--line); }
.btn--icon { width: 48px; padding: 0; flex: none; }
.btn--icon .icon { width: 20px; height: 20px; }
.btn--grow { flex: 1; font-family: var(--f-disp); font-size: 26px; font-weight: 700; padding: 6px 18px; line-height: 1.2; }
.btn--block { width: 100%; }
.form-error { margin: 0; padding: 10px 12px; border-radius: 12px; background: #fde9e7; color: #a3291f; font-size: 13.5px; animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

/* ---------- 나눔 카드 ---------- */
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 4px 0; }
.share-list { display: flex; flex-direction: column; gap: 12px; }
.share { display: flex; flex-direction: column; gap: 10px; }
.share-list .share:nth-child(1) { --i: 3; } .share-list .share:nth-child(2) { --i: 4; } .share-list .share:nth-child(3) { --i: 5; }
.share-list .share:nth-child(n+4) { --i: 6; }
.share-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.who { font-weight: 700; font-size: 15.5px; }
.when { margin-left: auto; font-size: 12px; color: var(--sub); font-variant-numeric: tabular-nums; }
.when b { color: var(--acc-deep); }
.me-tag { font-size: 11px; font-weight: 700; color: var(--acc-deep); background: color-mix(in srgb, var(--acc) 14%, #fff); border-radius: 99px; padding: 1px 8px; }
.share-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.75; }

/* 감사선포 알약 — 초록→버터 그라데이션 위로 빛이 스쳐 지나간다 */
.pill {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px 3px 8px; border-radius: 999px;
  background: linear-gradient(100deg, var(--acc-deep) 0%, var(--acc) 55%, #f2a33a 100%);
  color: #fff; font-size: 11.5px; font-weight: 700; line-height: 1.35; white-space: nowrap;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--acc) 35%, transparent);
  animation: pillIn .6s var(--ease-pop) both, pillBob 3.2s ease-in-out 1s infinite;
}
.pill .icon { width: 12px; height: 12px; stroke-width: 2.4; }
.pill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .8) 50%, transparent 70%); transform: translateX(-130%); animation: shine 2.6s ease-in-out .8s infinite; }
@keyframes shine { 55%, 100% { transform: translateX(130%); } }
@keyframes pillIn { from { transform: scale(.4); opacity: 0; } }
@keyframes pillBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.5px); } }

/* 반응 버튼 */
.word .reacts { margin-top: 18px; padding-top: 14px; border-top: 1.5px dashed var(--line); }
.reacts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.rx {
  --rx: var(--sub);
  display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-width: 0;
  border: 1.5px solid var(--line); background: var(--card); color: var(--sub);
  border-radius: 999px; padding: 5px 4px; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums;
  transition: color .2s, border-color .2s, background .2s, transform .15s;
}
.rx:active { transform: scale(.93); }
.rx .icon { width: 17px; height: 17px; transition: fill .2s; }
.rx-n { font-weight: 700; min-width: .7em; }
.rx--heart { --rx: var(--rx-heart); } .rx--amen { --rx: var(--rx-amen); } .rx--good { --rx: var(--rx-good); } .rx--fighting { --rx: var(--rx-fighting); }
.rx.is-on { color: var(--rx); border-color: var(--rx); background: color-mix(in srgb, var(--rx) 10%, #fff); }
.rx.is-on .icon { fill: color-mix(in srgb, var(--rx) 28%, transparent); }
.rx.pop .icon { animation: rxPop .5s var(--ease-pop); }
.rx.pop .rx-n { animation: numUp .35s ease-out; }
@keyframes rxPop { 0% { transform: scale(.6); } 55% { transform: scale(1.4) rotate(-10deg); } 100% { transform: scale(1); } }
@keyframes numUp { from { transform: translateY(6px); opacity: 0; } }
.spark { position: fixed; z-index: 60; width: 7px; height: 7px; border-radius: 50%; pointer-events: none; animation: spark .7s ease-out forwards; }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }

/* ---------- 감사 열매 ---------- */
.hero--garden .hero-title { font-size: 46px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { background: var(--card); border-radius: var(--r-sm); padding: 10px 6px 8px; text-align: center; box-shadow: var(--shadow); }
.stat b { display: block; font-family: var(--f-disp); font-size: 34px; line-height: .9; color: var(--acc-deep); font-variant-numeric: tabular-nums; }
.stat span { font-size: 11.5px; color: var(--sub); white-space: nowrap; }
.grass-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; font-weight: 500; color: var(--sub); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
@keyframes fillIn { from { transform: scale(.3); opacity: 0; } }

/* 나무: 그림(svg) 위에 날짜별 열매 버튼을 % 좌표로 얹는다(view/FruitTree). 열매 크기는 나무 폭 기준(cqw). */
.tree { position: relative; aspect-ratio: 360 / 380; container-type: inline-size; max-width: 420px; margin: 0 auto; }
.tree-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.tree-ground { fill: var(--line); }
.tree-trunk { fill: #8a5a3c; }
.tree-canopy { fill: #fdebd9; }
.tree-canopy--back { fill: #f6d3b2; }
.fruit {
  position: absolute; aspect-ratio: 1; border: 0; padding: 0; border-radius: 50%;
  display: grid; place-items: center; background: transparent; color: var(--sub);
  font-size: calc(var(--d) * 100cqw / 360 * var(--k, .4)); /* 글자 수에 따라 --k(10/11 같은 긴 날짜는 작게) */ font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1;
  transition: transform .15s;
}
.fruit span { position: relative; z-index: 1; }
.fruit:not([disabled]):active { transform: scale(.88); }
/* 아직(지난 날, 나눔 없음) — 점선 동그라미 */
.fruit--empty { box-shadow: inset 0 0 0 1.5px rgba(140, 107, 90, .35); background: rgba(255, 255, 255, .55); }
/* 나눔 — 익어 가는 감 */
.fruit--shared, .fruit--declared { animation: fillIn .55s var(--ease-pop) both; animation-delay: calc(var(--i) * 22ms + 250ms); }
.fruit--shared { background: radial-gradient(circle at 34% 30%, #ffe1c9 0 12%, var(--g1) 46%, #e8935f 100%); color: var(--ink); font-weight: 700; }
/* 나눔 + 10번 선포 — 다 익은 감 */
.fruit--declared { background: radial-gradient(circle at 34% 30%, #ffb38a 0 12%, var(--g2) 55%, #8f3216 100%); color: #fff; font-weight: 700; }
/* 감 꼭지 */
.fruit--shared::before, .fruit--declared::before {
  content: ""; position: absolute; left: 50%; top: -9%; width: 42%; height: 24%; transform: translateX(-50%);
  background: #6d7a2c; border-radius: 50% 50% 45% 45% / 70% 70% 30% 30%;
}
.fruit.is-future { background: rgba(255, 255, 255, .5); color: rgba(140, 107, 90, .55); transform: scale(.8); cursor: default; }
.fruit.is-today { box-shadow: 0 0 0 3px var(--butter), 0 0 0 6px rgba(255, 198, 92, .3); }
.fruit--empty.is-today { box-shadow: inset 0 0 0 1.5px rgba(140, 107, 90, .35), 0 0 0 3px var(--butter); }
.fruit.is-picked { box-shadow: 0 0 0 3px var(--ink); }
.tree--dense .fruit span { display: none; }
.fruit--empty.is-future { box-shadow: inset 0 0 0 1.5px rgba(140, 107, 90, .22); }
.legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 12px; margin-top: 10px; font-size: 11.5px; color: var(--sub); }
.fruit-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.fruit-dot--empty { box-shadow: inset 0 0 0 1.5px rgba(140, 107, 90, .35); }
.fruit-dot--shared { background: var(--g1); }
.fruit-dot--declared { background: var(--g2); }
.garden-list { display: flex; flex-direction: column; gap: 12px; }
.garden-list.htmx-swapping, .garden-list.htmx-settling { transition: opacity .2s; }
.more { display: grid; place-items: center; padding: 14px; }
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--acc); animation: dot 1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 50% { transform: translateY(-5px); opacity: .5; } }

/* ---------- 하단 탭바 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: center; gap: min(14vw, 64px);
  padding: 8px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 56px; border: 0; background: none; padding: 2px; color: var(--sub); font-size: 11.5px; text-decoration: none; }
.tabbar .icon { width: 24px; height: 24px; transition: transform .3s var(--ease-pop); }
.tabbar .is-on { color: var(--acc-deep); font-weight: 700; }
.tabbar .is-on .icon { transform: translateY(-2px) scale(1.08); fill: color-mix(in srgb, var(--acc) 18%, transparent); }

/* ---------- 모달 / 토스트 ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: end center; padding: 16px; background: rgba(40, 22, 14, .42); animation: fade .2s ease; }
@media (min-width: 600px) { .modal { place-items: center; } }
@keyframes fade { from { opacity: 0; } }
.modal-card { position: relative; width: 100%; max-width: 420px; max-height: calc(100dvh - 40px); overflow-y: auto; background: var(--card); border-radius: 28px; padding: 24px 20px 20px; animation: sheetUp .38s var(--ease-pop); display: flex; flex-direction: column; gap: 12px; }
.modal-card--wide { max-width: 520px; }
@keyframes sheetUp { from { transform: translateY(40px) scale(.97); opacity: 0; } }
.modal-card h2 { margin: 0; padding-right: 32px; font-family: var(--f-disp); font-size: 32px; line-height: 1.05; color: var(--acc-deep); }
.modal-card p { margin: 0; }
.modal-card form { display: flex; flex-direction: column; gap: 10px; }
.modal-card input[type="text"] { width: 100%; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--soft); }
.modal-card input[type="text"]:focus { outline: 0; border-color: var(--acc); background: #fff; }
.modal-x { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--soft); color: var(--sub); }
.field-label { font-size: 13px; color: var(--sub); }
.row-actions { display: flex; gap: 8px; justify-content: space-between; }
.row-actions .btn { flex: 1; }
.guide-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 12px; }
.guide-steps li { counter-increment: step; position: relative; padding: 12px 14px 12px 50px; border-radius: var(--r-sm); background: var(--soft); }
.guide-steps li::before { content: counter(step); position: absolute; left: 12px; top: 12px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--acc); color: #fff; font-weight: 700; font-size: 13px; }
.guide-steps b { display: block; }
.guide-steps p { margin: 2px 0 0; font-size: 13.5px; color: var(--sub); }
.guide-note { font-size: 12.5px; color: var(--sub); padding: 0 4px; }
.toast {
  position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); z-index: 70;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); padding: 10px 18px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: transform .35s var(--ease-pop), opacity .25s;
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 360px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .rx-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
