/* ===========================================================================
   감사선포 챌린지 — 사용자 화면
   방향: 추수 테마(감·단풍, 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; }
/* PC 에서도 휴대폰 화면처럼 — 가운데 560px 한 줄(머리·본문·아래 메뉴 모두), 바깥은 한 톤 진한 배경 */
html { -webkit-text-size-adjust: 100%; background: #efe0d4; }
body {
  margin: 0 auto; max-width: 560px; min-height: 100vh; min-height: 100dvh;
  box-shadow: 0 0 0 1px rgba(140, 107, 90, .08), 0 0 40px rgba(120, 60, 30, .10);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.6;
  padding-bottom: calc(56px + 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: 챌린지 제목(크게) · 기간 · [오늘의 감사선포 + 날짜 + 공유하기] 한 줄 · 진행 바 */
.hero-challenge { margin: 0; font-size: 21px; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; text-wrap: balance; }
.hero-period { margin: 3px 0 0; font-size: 13px; opacity: .88; font-variant-numeric: tabular-nums; }
.hero-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.hero-date { flex: none; font-size: 14px; font-weight: 700; white-space: nowrap; }
.hero-row .progress { flex: 1; min-width: 0; margin: 0; gap: 8px; }
.hero-row .progress b { font-size: 24px; white-space: nowrap; }
.hero-row-fill { flex: 1; }
.hero-share.hero-share--icon { display: grid; place-items: center; padding: 0; gap: 0; width: 40px; height: 40px; min-width: 40px; line-height: 0; -webkit-appearance: none; appearance: none; }
.hero-share.hero-share--icon .icon { width: 19px; height: 19px; margin: 0; vertical-align: 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); }
.day-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.day-nav .hero-share { text-decoration: none; }
.hero-share .icon { width: 15px; height: 15px; }
.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 { position: relative; flex: 1; height: 22px; border-radius: 99px; padding: 4px;
  background: rgba(80, 25, 5, .22); box-shadow: inset 0 1px 3px rgba(60, 20, 5, .3), 0 1px 0 rgba(255, 255, 255, .25); }
.progress-bar i { position: relative; display: block; height: 100%; width: var(--p); min-width: 8px; border-radius: 99px;
  background: linear-gradient(90deg, #fff4c2, #ffd36b 55%, #ffb547); box-shadow: 0 0 10px rgba(255, 210, 100, .75); animation: grow 1.4s var(--ease-out) .2s both; }
/* 손잡이 = 감 열매(감사 열매와 같은 그림) — 흰 동그라미 안에 꼭지 달린 감 */
.progress-bar i::after { content: ""; position: absolute; right: -15px; top: 50%; width: 32px; height: 32px; transform: translateY(-50%); border-radius: 50%;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cellipse cx='12' cy='14' rx='8' ry='7' fill='%23e0703a'/%3E%3Cellipse cx='9.5' cy='11.5' rx='2.2' ry='1.4' fill='%23ffd2b0' opacity='.8'/%3E%3Cpath d='M12 7c-2-.6-4.5-.2-6 1.4 2 .4 4.2.1 6-1.4zM12 7c2-.6 4.5-.2 6 1.4-2 .4-4.2.1-6-1.4zM12 7c-.6-1.8-2-3.2-3.4-3.6.2 1.6 1.6 3 3.4 3.6zM12 7c.6-1.8 2-3.2 3.4-3.6-.2 1.6-1.6 3-3.4 3.6z' fill='%23667a2a'/%3E%3C/svg%3E") center / 23px no-repeat;
  box-shadow: 0 2px 8px rgba(80, 25, 5, .4); }
@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--note .word-body { margin-top: 12px; padding: 0; background: none; font-size: 15px; }
/* 선포 탭 카운터 — 동그란 버튼을 탭할 때마다 +1, 10번까지 테두리가 차오른다(기기 localStorage 에만). */
.tap { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding-top: 14px; border-top: 1.5px dashed var(--line); }
.tap-btn { position: relative; width: 84px; height: 84px; border: 0; border-radius: 50%; padding: 0; cursor: pointer; color: #fff;
  background: conic-gradient(var(--butter) calc(var(--p) * 1%), rgba(224, 112, 58, .18) 0); display: grid; place-items: center;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: transform .12s var(--ease-pop); }
.tap-btn::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: linear-gradient(150deg, var(--acc), var(--acc-deep)); box-shadow: 0 6px 16px rgba(178, 76, 37, .35); }
.tap-btn > * { position: relative; }
.tap-btn { width: 112px; height: 112px; }
.tap-btn .icon { width: 22px; height: 22px; margin-top: 14px; }
.tap-btn b { font-family: var(--f-disp); font-size: 54px; line-height: .7; font-variant-numeric: tabular-nums; margin-top: -10px; }
.tap-btn:active { transform: scale(.92); }
.tap-btn.is-bump b { animation: numUp .25s ease-out; }
.tap .tap-btn.is-wait::before { background: #e6d9d0; box-shadow: none; }
.tap-btn.is-wait { color: #a8907f; }
.tap-btn.is-wait { cursor: default; }
.tap-btn.is-wait:active { transform: none; }
.tap-btn.is-shake { animation: tapShake .35s; }
@keyframes tapShake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.tap-btn.is-done::before { background: linear-gradient(150deg, #e0703a, #8f3216); }
.tap-hint { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--sub); white-space: nowrap; }
.tap-hint b { color: var(--acc-deep); font-variant-numeric: tabular-nums; }
.modal-x.modal-x--2 { right: 58px; }
.modal-x.modal-x--2 .icon { width: 18px; height: 18px; }
.tap-reset { align-self: center; border: 1px solid var(--line); background: var(--soft); color: var(--sub); border-radius: 999px; padding: 3px 10px; font-size: 11.5px; cursor: pointer; }
.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); }
/* 나의 감사 일기 카드의 날짜 — 누르면 그날 상세의 그 나눔으로 */
.when--link { display: inline-flex; align-items: center; gap: 2px; padding: 4px 6px 4px 10px; margin: -4px -6px -4px auto; border-radius: 999px;
  background: var(--bg, #fbf3ec); color: var(--sub); text-decoration: none; transition: background .15s; }
.when--link svg { width: 14px; height: 14px; }
.when--link:hover, .when--link:active { background: #f6e1d0; }
/* 날짜 상세로 넘어와 가리킨 나눔 — 머리에 가리지 않게 + 잠깐 빛남 */
.share:target { scroll-margin-top: 90px; animation: shareFlash 2s ease-out .3s; }
@keyframes shareFlash { 0%, 40% { box-shadow: 0 0 0 3px var(--butter), 0 6px 20px rgba(255, 176, 80, .45); } }
.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; }
/* 나무 카드 머리: 맺은 열매 수 하나만 크게 */
.tree-count { display: flex; align-items: baseline; justify-content: center; gap: 6px; margin: 0 0 4px; color: var(--acc-deep); }
.tree-count span { font-size: 14px; font-weight: 700; }
.tree-count b { font-family: var(--f-disp); font-size: 60px; line-height: .8; font-variant-numeric: tabular-nums; }
.tree-count small { font-size: 14px; font-weight: 700; }
@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;
  text-decoration: none; -webkit-tap-highlight-color: transparent;
  transition: transform .15s;
}
.fruit span { position: relative; z-index: 1; }
a.fruit: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); }
/* 나눔 — 익어 가는 감 / 나눔 + 10번 선포 — 다 익은 감. 메인 진행 바의 감과 **같은 그림**(납작한 몸통 + 윤기 + 네 잎 꼭지).
   그림은 ::before 에 깔고(다 익은 감의 빛은 그림 윤곽을 따라 번지게 drop-shadow), 숫자는 몸통 가운데로. */
.fruit--shared, .fruit--declared { font-weight: 800;
  animation: fillIn .55s var(--ease-pop) both; animation-delay: calc(var(--i) * 22ms + 250ms); }
.fruit--shared::before, .fruit--declared::before { content: ""; position: absolute; inset: -16% -9% -4%; z-index: 0; background: center / 100% 100% no-repeat; }
.fruit--shared span, .fruit--declared span { top: 8%; }
.fruit--shared { color: #7a3a0a; }
.fruit--shared::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='3 2.5 18 19'%3E%3Cellipse cx='12' cy='14' rx='8' ry='7' fill='%23f6a65a'/%3E%3Cellipse cx='9.5' cy='11.5' rx='2.2' ry='1.4' fill='%23ffe2c4' opacity='.8'/%3E%3Cpath d='M12 7c-2-.6-4.5-.2-6 1.4 2 .4 4.2.1 6-1.4zM12 7c2-.6 4.5-.2 6 1.4-2 .4-4.2.1-6-1.4zM12 7c-.6-1.8-2-3.2-3.4-3.6.2 1.6 1.6 3 3.4 3.6zM12 7c.6-1.8 2-3.2 3.4-3.6-.2 1.6-1.6 3-3.4 3.6z' fill='%23667a2a'/%3E%3C/svg%3E"); filter: drop-shadow(0 3px 3px rgba(160, 70, 20, .25)); }
.fruit--declared { color: #fff; text-shadow: 0 1px 2px rgba(110, 40, 0, .5); }
/* 다 익은 감 = 완성 — 감 윤곽을 따라 버터색 테두리 + 따뜻하게 번지는 빛 */
.fruit--declared::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='3 2.5 18 19'%3E%3Cellipse cx='12' cy='14' rx='8' ry='7' fill='%23e0703a'/%3E%3Cellipse cx='9.5' cy='11.5' rx='2.2' ry='1.4' fill='%23ffd2b0' opacity='.8'/%3E%3Cpath d='M12 7c-2-.6-4.5-.2-6 1.4 2 .4 4.2.1 6-1.4zM12 7c2-.6 4.5-.2 6 1.4-2 .4-4.2.1-6-1.4zM12 7c-.6-1.8-2-3.2-3.4-3.6.2 1.6 1.6 3 3.4 3.6zM12 7c.6-1.8 2-3.2 3.4-3.6-.2 1.6-1.6 3-3.4 3.6z' fill='%23667a2a'/%3E%3C/svg%3E");
  filter: drop-shadow(0 0 1.5px #ffc65c) drop-shadow(0 0 1.5px #ffc65c) drop-shadow(0 0 9px rgba(255, 170, 70, .85)); }
.fruit.is-future { background: rgba(255, 255, 255, .5); color: rgba(140, 107, 90, .55); transform: scale(.8); cursor: default; }
/* 오늘 — 열매 아래 작은 '오늘' 꼬리표(빛은 다 익은 감에만) */
.fruit.is-today::after { content: "오늘"; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); z-index: 2;
  padding: 2px 6px 1px; border-radius: 999px; background: #b8401a; color: #fff; font-size: 10px; font-weight: 800; line-height: 1.2;
  white-space: nowrap; letter-spacing: .02em; text-shadow: none; box-shadow: 0 2px 5px rgba(120, 35, 10, .3); }
.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: #f6a65a; }
.fruit-dot--today { width: auto; height: auto; padding: 2px 5px 1px; border-radius: 999px; background: #b8401a; color: #fff; font-size: 9.5px; font-weight: 800; font-style: normal; line-height: 1.2; vertical-align: 0; }
.fruit-dot--declared { margin-right: 7px; background: #e0703a; box-shadow: 0 0 0 2px var(--butter), 0 0 6px 2px rgba(255, 176, 80, .6); }
.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: max(0px, calc(50% - 280px)); right: max(0px, calc(50% - 280px)); bottom: 0; z-index: 30;
  display: flex; justify-content: space-around; gap: 4px;
  padding: 6px 12px calc(6px + 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: row; align-items: center; justify-content: center; gap: 6px; flex: 1; max-width: 160px;
  height: 42px; border: 0; border-radius: 999px; background: none; padding: 0 10px; color: var(--sub); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.tabbar .icon { width: 21px; height: 21px; flex: none; transition: transform .3s var(--ease-pop); }
.tabbar .is-on { color: var(--acc-deep); font-weight: 800; background: var(--butter-soft); }
.tabbar .is-on .icon { transform: scale(1.06); 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; white-space: nowrap; padding-inline: 10px; font-size: 14.5px; }
.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(140px + env(safe-area-inset-bottom, 0px)); z-index: 95;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  width: max-content; max-width: calc(100% - 32px); padding: 15px 24px; border-radius: 22px;
  background: linear-gradient(150deg, var(--acc), var(--acc-deep)); color: #fff; box-shadow: 0 12px 28px rgba(178, 76, 37, .45);
  font-size: 18px; font-weight: 800; line-height: 1.4; text-align: center; word-break: keep-all; white-space: pre-line;   /* \n 은 줄바꿈 */
  transition: transform .35s var(--ease-pop), opacity .25s;
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 360px) {
  .rx-label { display: none; }
}

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

/* ---------- 떠 있는 버튼(확성기 = 선포 시트, 연필 = 나눔 쓰기) ---------- */
/* 페이지 폭(최대 560px) 안에서 두 버튼이 반반 — 하나뿐이면(날짜 상세) 꽉 채운다 */
.fabs { position: fixed; z-index: 35; left: max(16px, calc(50% - 280px + 16px)); right: max(16px, calc(50% - 280px + 16px));
  bottom: calc(66px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 10px; }
.fabs .fab { flex: 1 1 0; justify-content: center; }
.fab { height: 50px; padding: 0 14px; border: 0; border-radius: 999px; display: inline-flex; align-items: center; gap: 7px;
  color: #fff; font-size: 14.5px; font-weight: 800; cursor: pointer; white-space: nowrap;
  background: linear-gradient(150deg, var(--acc), var(--acc-deep)); box-shadow: 0 8px 20px rgba(178, 76, 37, .38);
  -webkit-tap-highlight-color: transparent; transition: transform .15s var(--ease-pop); animation: fillIn .5s var(--ease-pop) both; }
.fab .icon { width: 20px; height: 20px; flex: none; }
.fab:active { transform: scale(.94); }
.fab--declare { background: #fff; color: #8f3216; box-shadow: 0 8px 20px rgba(61, 36, 24, .18), inset 0 0 0 1.5px var(--line); }
.fab--write.is-done { background: linear-gradient(150deg, #c0502a, #8f3216); }
/* 떠 있는 알약 버튼(높이 46px)이 마지막 카드를 가리지 않게 아래 여유 */
.page:has(.fabs) { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
.fab--declare .icon { stroke-width: 2.5; }
/* 메인 맨 아래 가운데 공유 버튼 */
.page-share { display: flex; justify-content: center; padding-top: 8px; }
.page-share-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 26px; font-weight: 700; color: var(--acc-deep); }
.page-share-btn .icon { width: 19px; height: 19px; }

/* 선포 바텀 시트 — 말씀 + 탭 카운터 */
.declare-sheet .declare-verses { max-height: 46dvh; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.declare-sheet .verse-text { font-size: 16px; }

/* 나눔 쓰기 영역(연필 버튼으로 열림) */
.composer > .card { position: relative; }
.composer-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--soft); color: var(--sub); }
.composer:not([hidden]) > .card { animation: sheetUp .38s var(--ease-pop); }

/* 확인 창(브라우저 confirm 대신) */
.modal--confirm { z-index: 70; }
.modal--confirm .modal-card { max-width: 360px; gap: 18px; padding: 24px 20px 18px; }
.confirm-msg { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.5; color: var(--ink); text-align: center; white-space: pre-line; }

/* 가이드 문장 속 버튼 모양 표시(선포하기 · 오늘 감사 쓰기) */
.guide-chip { display: inline-flex; align-items: center; gap: 3px; padding: 1px 9px 1px 7px; border-radius: 999px; vertical-align: 1px;
  background: #fff; color: #8f3216; box-shadow: inset 0 0 0 1.5px var(--line); font-size: .92em; font-weight: 800; white-space: nowrap; }
.guide-chip .icon { width: 14px; height: 14px; }
.guide-chip--fill { background: var(--acc); color: #fff; box-shadow: none; }

/* ---------- 화면 따라 하기(코치마크) ---------- */
/* 가이드 안 [화면에서 하나씩 따라 해 보기] — 눈에 띄게: 버터→주황 채움 + 빛이 스치고 살짝 숨 쉬듯 커졌다 작아짐 */
.btn--tour { position: relative; overflow: hidden; width: 100%; padding: 15px 18px; font-size: 16.5px; color: #fff;
  background: linear-gradient(135deg, #f2a33a, var(--acc) 55%, var(--acc-deep)); box-shadow: 0 8px 20px rgba(178, 76, 37, .35);
  animation: tourBtnBreath 1.8s ease-in-out infinite; }
.btn--tour::after { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: tourBtnShine 2.4s ease-in-out infinite; }
.btn--tour .icon { order: 2; animation: tourBtnNudge 1s ease-in-out infinite; }
@keyframes tourBtnBreath { 50% { transform: scale(1.03); box-shadow: 0 10px 26px rgba(178, 76, 37, .48); } }
@keyframes tourBtnShine { 0% { left: -40%; } 60%, 100% { left: 120%; } }
@keyframes tourBtnNudge { 50% { transform: translateX(4px); } }
.tour { position: absolute; left: 0; top: 0; width: 100%; z-index: 90; }   /* 페이지 좌표로 덮는다(높이는 JS) */
.tour-svg { position: absolute; left: 0; top: 0; overflow: visible; }
.tour-shade { fill: rgba(18, 8, 3, .58); }
.tour-ring { fill: none; stroke: var(--butter); stroke-width: 3; }
.tour-line { fill: none; stroke: #ffc65c; stroke-width: 3; stroke-linecap: round; }
/* 장면이 바뀔 때 한 번에 조용히 나타남(깜빡임·순서대로 튀어나옴 없음) */
.tour.is-in .tour-svg, .tour.is-in .tour-labels { animation: tourFade .28s ease-out both; }
@keyframes tourFade { from { opacity: 0; } }
/* 설명 말풍선 — 화면 버튼과 헷갈리지 않게: 화살표와 같은 버터색 쪽지 + 손글씨체 */
.tour-label { position: absolute; max-width: calc(100vw - 20px); white-space: nowrap; padding: 6px 12px 3px; border-radius: 10px; background: #ffc65c; color: #3d2418;
  font-family: var(--f-disp); font-size: 26px; font-weight: 700; line-height: 1; word-break: keep-all; letter-spacing: .01em;
  box-shadow: 0 6px 16px rgba(20, 8, 2, .4); }
/* 위쪽 진행 막대: 장면 제목 + 이전/다음 + 건너뛰기 */
.tour-bar { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); width: min(calc(100% - 20px), 520px);
  background: #fff; border-radius: 20px; padding: 10px 12px 10px 16px; box-shadow: 0 12px 30px rgba(20, 8, 2, .35);
  display: flex; align-items: center; gap: 10px; }
.tour-bar-head { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tour-step { font-size: 12px; font-weight: 700; color: var(--acc); }
.tour-title { font-family: var(--f-disp); font-size: 25px; line-height: 1; color: var(--acc-deep); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tour-x { align-self: flex-start; margin-top: 2px; border: 0; background: none; padding: 0; color: var(--sub); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.tour-btns { display: flex; gap: 6px; flex: none; }
.tour-btns .btn { padding: 10px 14px; font-size: 15px; }
.tour-btns .btn[hidden] { display: none; }
body.is-touring { overflow: hidden; }
.is-touring.tour-nofabs .fabs { visibility: hidden; }
.is-touring .composer > .card { animation: none; }   /* 따라 하기 중엔 쓰기 칸 등장 애니메이션 끔 — 위치 계산이 틀어지지 않게 */
/* 가이드 안 [홈 화면에 앱으로 추가하기] — [시작할게요] 바로 위, 눈에 띄게: 버터색 채움 + 주황 테두리 + 빛이 스침 */
.btn--install { position: relative; overflow: hidden; width: 100%; margin: 14px 0 10px; padding: 14px 18px; justify-content: center; gap: 6px;
  font-size: 16px; color: var(--acc-deep); background: linear-gradient(135deg, #ffe39a, var(--butter)); border: 2px solid var(--acc);
  box-shadow: 0 6px 16px rgba(255, 176, 80, .45); }
.btn--install::after { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75), transparent); animation: tourBtnShine 2.4s ease-in-out infinite; }
.btn--install .icon { width: 20px; height: 20px; }
.btn--install[hidden] { display: none; }
