:root {
  color-scheme: light;
  --ink: #102c28;
  --ink-soft: #3e514c;
  --muted: #526660;
  --faint: #64776f;
  --line: #dce6e1;
  --line-strong: #c9d8d1;
  --paper: #ffffff;
  --wash: #f3f7f4;
  --wash-deep: #e9f0ec;
  --green: #0d5f55;
  --green-dark: #08483f;
  --on-green: #cfe8de;
  --lime: #dff5a7;
  --lime-tint: #eef7d9;
  --lime-faint: #f7faec;
  --coral: #c74631;
  --coral-deep: #8b3025;
  --coral-text: #9a4c42;
  --yellow: #ffd66b;
  --yellow-tint: #fff8df;
  --yellow-line: #eed9a0;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-md: 14px;
  --text-lg: 17px;
  --text-xl: 22px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-full: 999px;
  --shadow-lg: 0 16px 40px rgba(16, 44, 40, 0.1);
  --shadow-sm: 0 3px 10px rgba(16, 44, 40, 0.08);
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--wash); color: var(--ink); }
body { min-width: 320px; font-size: 15px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:not(:disabled) { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid rgba(13, 95, 85, 0.3); outline-offset: 2px; }

.splash, .fatal { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; text-align: center; background: radial-gradient(circle at 20% 12%, #fff2b8 0 12%, transparent 34%), linear-gradient(160deg, #eff8d8, #d8f0e7 62%, #fff); }
.splash h1 { margin: 8px 0 28px; font-size: 34px; line-height: 1.25; }
.brand-mark { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 26px 26px 26px 8px; background: var(--green); color: white; font-size: 38px; box-shadow: var(--shadow-lg); transform: rotate(-3deg); }
.eyebrow { margin: 0; color: var(--green); font-size: var(--text-xs); font-weight: 800; letter-spacing: .04em; }
.loading-dots { display: flex; gap: 8px; }
.loading-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: bounce 1s infinite alternate; }
.loading-dots span:nth-child(2) { animation-delay: .18s; }.loading-dots span:nth-child(3) { animation-delay: .36s; }
@keyframes bounce { to { transform: translateY(-9px); opacity: .35; } }

.onboarding { min-height: 100dvh; background: linear-gradient(150deg, var(--lime) 0 31%, #eef7e7 31% 47%, var(--wash) 47%); padding: max(32px, env(safe-area-inset-top)) 20px 36px; }
.onboarding-hero, .setup-panel { max-width: 520px; margin-inline: auto; }
.mini-logo { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.mini-logo span { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 9px 9px 9px 3px; color: white; background: var(--green); }
.step-label { margin: 32px 0 8px; color: var(--green); font-size: 13px; font-weight: 800; }
.onboarding-hero h1 { margin: 0; font-size: 32px; line-height: 1.25; }
.onboarding-hero > p:last-of-type { color: var(--ink-soft); line-height: 1.55; }
.setup-panel { margin-top: 20px; padding: 20px; border: 1px solid rgba(16, 44, 40, .08); border-radius: var(--r-md); background: var(--paper); box-shadow: var(--shadow-lg); }
.setup-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: var(--r-md); background: var(--wash-deep); }
.setup-tabs button { border: 0; border-radius: var(--r-sm); padding: 10px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 800; transition: color .15s ease; }
.setup-tabs button.active { color: var(--green); background: white; box-shadow: var(--shadow-sm); }
.setup-form { display: grid; gap: 20px; padding-top: 20px; }
.setup-form label, .rename-form { font-size: 13px; font-weight: 800; }
input { width: 100%; margin-top: 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: white; color: var(--ink); }
fieldset { margin: 0; padding: 0; border: 0; } legend { width: 100%; font-size: 13px; font-weight: 800; } legend small { float: right; color: var(--muted); font-weight: 500; }
.template-frequency-helper { margin: 7px 0 0; color: var(--muted); font-size: var(--text-xs); font-weight: 600; }
.template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.template-tile { position: relative; min-height: 132px; display: flex; flex-direction: column; align-items: flex-start; padding: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--wash); text-align: left; cursor: pointer; }
.template-tile-emoji { font-size: 26px; }
.template-tile-title { margin-top: 8px; width: 100%; overflow: hidden; font-size: var(--text-md); text-overflow: ellipsis; white-space: nowrap; }
.template-tile-cadence { margin-top: 3px; color: var(--green); font-size: var(--text-xs); font-weight: 800; }
.template-tile-subtasks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.template-tile-subtasks i { padding: 3px 7px; border-radius: var(--r-full); background: white; color: var(--muted); font-size: 10px; font-style: normal; font-weight: 700; }
.template-option:has(input:checked) { border-color: var(--green); background: var(--lime-tint); box-shadow: inset 0 0 0 1px var(--green); }
.template-option input { position: absolute; opacity: 0; pointer-events: none; }
.template-check { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--line-strong); border-radius: 50%; color: transparent; background: white; }
.template-option:has(input:checked) .template-check { color: white; border-color: var(--green); background: var(--green); }
.primary-button, .fatal button { min-height: 52px; border: 0; border-radius: var(--r-md); background: var(--green); color: white; font-size: 15px; font-weight: 800; box-shadow: 0 6px 16px rgba(13, 95, 85, .25); transition: transform .12s ease; }
.primary-button:active, .fatal button:active { transform: translateY(1px); }
.primary-button:disabled { opacity: .55; }.hidden { display: none !important; }
.join-illustration { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 28px; font-size: 38px; }.join-illustration i { width: 70px; border-top: 3px dashed var(--line-strong); }
.helper { margin: 0; color: var(--muted); font-size: var(--text-sm); line-height: 1.5; }

.app-shell { position: relative; width: min(100%, 560px); min-height: 100dvh; margin: 0 auto; padding-bottom: calc(84px + env(safe-area-inset-bottom)); background: var(--wash); box-shadow: 0 0 50px rgba(16, 44, 40, .08); }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: max(20px, env(safe-area-inset-top)) 20px 14px; background: rgba(243, 247, 244, .92); backdrop-filter: blur(18px); }
.topbar h1 { margin: 4px 0 0; font-size: var(--text-xl); }
.topbar-settings-button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r-full); background: white; color: var(--green); }
.topbar-settings-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.topbar-settings-button.active { border-color: var(--green); background: var(--lime-tint); }
.profile-menu-backdrop { position: fixed; inset: 0; z-index: 8; background: rgba(9, 40, 35, .28); }
.profile-menu { position: absolute; z-index: 9; top: calc(max(20px, env(safe-area-inset-top)) + 58px); right: 16px; left: 16px; display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-md); background: white; box-shadow: 0 12px 30px rgba(9, 40, 35, .18); }
.profile-menu > header { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px; border-bottom: 1px solid var(--line); background: var(--wash-deep); font-size: var(--text-sm); }
.profile-menu > header button { min-width: 32px; min-height: 32px; border: 0; background: none; color: var(--muted); font-size: 19px; }
.profile-menu .notification-settings { margin: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.profile-menu-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 14px; border: 0; border-bottom: 1px solid var(--line); background: white; color: inherit; text-align: left; text-decoration: none; }
.profile-menu-item span { display: grid; gap: 2px; }
.profile-menu-item strong { font-size: 14px; }
.profile-menu-item small { color: var(--muted); font-size: var(--text-xs); }
.profile-menu-item i { color: var(--muted); font-size: 15px; font-style: normal; }
.profile-menu-item.danger strong { color: var(--coral-deep); }
.profile-menu-item:last-child { border-bottom: 0; }
.level-chip { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-full); background: white; color: var(--green); font-size: var(--text-xs); font-weight: 800; }
.level-chip span { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 6px 6px 6px 2px; background: var(--green); color: white; }
.page { padding: 2px 16px 28px; }
.page.home-page { padding-bottom: 96px; }
.progress-banner { position: relative; overflow: hidden; padding: 20px; border-radius: var(--r-md); background: var(--green); color: white; box-shadow: 0 10px 24px rgba(13, 95, 85, .18); }
.progress-banner::after { content: ''; position: absolute; right: -27px; top: -39px; width: 115px; height: 115px; border-radius: 50%; background: rgba(223, 245, 167, .13); }
.progress-copy { display: flex; align-items: center; gap: 12px; }.progress-copy .sun { font-size: 29px; }.progress-copy small, .progress-copy strong { display: block; }.progress-copy small { color: var(--on-green); font-size: var(--text-sm); }.progress-copy strong { margin-top: 4px; font-size: var(--text-lg); }
.progress-track { height: 7px; margin: 16px 0 10px; overflow: hidden; border-radius: var(--r-full); background: rgba(255, 255, 255, .16); }.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--lime); transition: width .35s ease; }
.progress-banner p { margin: 0; color: var(--on-green); font-size: var(--text-sm); }
.quest-notification-prompt { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-top: 10px; padding: 12px 12px 12px 14px; border: 1px solid var(--yellow-line); border-radius: var(--r-md); background: var(--yellow-tint); }
.quest-notification-prompt > span { font-size: 22px; }
.quest-notification-prompt strong { display: block; font-size: 13px; }
.quest-notification-prompt p { margin: 2px 0 0; color: var(--muted); font-size: var(--text-xs); }
.quest-notification-prompt button { min-height: 40px; padding: 0 12px; border: 0; border-radius: var(--r-sm); background: var(--green); color: white; font-size: var(--text-sm); font-weight: 800; }
.activity-strip { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: white; overflow: hidden; }
.activity-strip-header { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 46px; padding: 0 14px; border: 0; background: var(--wash-deep); }
.activity-strip-title { flex: 1; text-align: left; font-size: var(--text-sm); font-weight: 800; }
.activity-unseen { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--coral-deep); color: white; font-size: 11px; font-weight: 800; }
.activity-strip-chevron { color: var(--muted); font-size: 15px; }
.activity-list { display: grid; margin: 0; padding: 0; list-style: none; }
.activity-list[hidden] { display: none; }
.activity-item + .activity-item { border-top: 1px solid var(--line); }
.activity-item button { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; width: 100%; padding: 11px 14px; border: 0; background: white; text-align: left; }
.activity-item.help button { background: var(--yellow-tint); }
.activity-emoji { font-size: 17px; }
.activity-copy { min-width: 0; }
.activity-line { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.activity-line strong { font-weight: 800; }
.activity-meta { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: var(--text-xs); text-overflow: ellipsis; white-space: nowrap; }
.section-block, .family-strip, .profile-section { margin-top: 24px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }.section-heading h2 { margin: 0; font-size: var(--text-lg); }.section-heading > span { color: var(--muted); font-size: var(--text-sm); }
.routine-heading > div { display: flex; align-items: center; gap: 9px; }
.routine-heading > div > span { color: var(--muted); font-size: var(--text-sm); }
.routine-heading button { min-height: 38px; padding: 0 11px; border: 1px solid var(--green); border-radius: var(--r-sm); background: white; color: var(--green); font-size: var(--text-xs); font-weight: 800; }
.quest-list { display: grid; gap: 8px; }
.quest-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: white; }
.quest-row.settings-open { position: relative; z-index: 4; }
.quest-row.done { background: var(--wash-deep); }.quest-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--lime-tint); font-size: 22px; }
.quest-row.locked { border-style: dashed; background: linear-gradient(135deg, #f8faf8, var(--wash-deep)); }
.quest-row.locked .quest-icon, .quest-row.locked .quest-copy { opacity: .62; }
.quest-copy { min-width: 0; }.quest-copy h3 { margin: 0; font-size: var(--text-md); }
.quest-meta { display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 5px; }
.routine-frequency-label { color: var(--green); font-size: var(--text-xs); font-weight: 800; }
.quest-completion { min-width: 0; overflow: hidden; color: var(--muted); font-size: var(--text-xs); text-overflow: ellipsis; white-space: nowrap; }
.empty-quests { display: flex; flex-direction: column; align-items: center; padding: 36px 20px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); background: white; text-align: center; }
.empty-quests span { font-size: 34px; }.empty-quests strong { margin-top: 10px; font-size: var(--text-md); }.empty-quests p { margin: 5px 0 0; color: var(--muted); font-size: var(--text-sm); }
.start-button { display: flex; align-items: center; gap: 5px; min-height: 44px; padding: 0 14px; border: 1px solid var(--green); border-radius: var(--r-md); background: white; color: var(--green); font-size: 13px; font-weight: 800; transition: transform .12s ease; }
.start-button:active { transform: scale(.96); }
.help-button.alone { border-color: var(--line-strong); background: var(--wash-deep); color: var(--muted); }
.help-button { min-height: 44px; padding: 0 11px; border: 1px solid var(--yellow-line); border-radius: var(--r-md); background: var(--yellow-tint); color: var(--coral-deep); font-size: var(--text-xs); font-weight: 800; white-space: nowrap; }
.home-story-filters { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.home-story-filters::-webkit-scrollbar { display: none; }
.home-story-filters button { flex: 0 0 auto; min-height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-full); background: white; color: var(--muted); font-size: var(--text-xs); font-weight: 800; white-space: nowrap; }
.home-story-filters button.active { border-color: var(--green); background: var(--lime-tint); color: var(--green); }
.complete-button { display: flex; align-items: center; gap: 5px; min-height: 44px; padding: 0 14px; border: 0; border-radius: var(--r-md); background: var(--coral); color: white; font-size: 13px; font-weight: 800; transition: transform .12s ease; }
.complete-button:active { transform: scale(.96); }
.quest-actions { display: flex; align-items: center; gap: 6px; }
.routine-unlock-button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--yellow-line); border-radius: var(--r-md); background: var(--yellow-tint); font-size: 17px; }
.quest-row { display: block; padding: 0; }
.quest-routine-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; }
.routine-expand-toggle { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; min-width: 0; min-height: 60px; padding: 6px; border: 0; border-radius: var(--r-md); background: transparent; text-align: left; }
.routine-expand-toggle:hover, .routine-expand-toggle:focus-visible { background: var(--wash); }
.routine-expand-toggle .quest-icon { flex: 0 0 auto; }
.routine-expand-toggle .quest-copy { display: grid; min-width: 0; }
.quest-routine-title { overflow: hidden; font-size: var(--text-md); font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.routine-chevron { color: var(--muted); font-size: 15px; line-height: 1; }
.quest-routine-header .quest-meta { display: block; margin-top: 4px; min-width: 0; }
.quest-routine-header .quest-meta span { display: block; overflow: hidden; color: var(--green); font-size: var(--text-xs); font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.quest-routine-header .quest-meta .next-visit { color: var(--coral-text); }
.quest-subtask-next { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 700; }
.quest-subtask-copy .next-visit { color: var(--coral-text); }
.routine-close-button { flex: 0 0 auto; min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--r-md); background: var(--coral); color: white; font-size: 13px; font-weight: 800; }
.routine-close-button:disabled { background: var(--wash-deep); color: var(--faint); }
.routine-contributors { display: flex; flex-direction: row-reverse; padding-right: 4px; }
.routine-contributors .member-avatar { margin-left: -8px; box-shadow: 0 0 0 2px white; }
.member-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; overflow: hidden; border-radius: 50%; background: var(--yellow); color: var(--ink); font-size: var(--text-xs); font-weight: 800; }
.member-avatar.md { width: 38px; height: 38px; font-size: var(--text-sm); }
.member-avatar img { width: 100%; height: 100%; object-fit: cover; }
.quest-row.closed { background: var(--wash-deep); }
.quest-row.closed .routine-expand-toggle .quest-icon { opacity: .7; }
.add-subtask-button { min-height: 38px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: white; color: var(--green); font-size: var(--text-xs); font-weight: 800; }
.quest-subtask-list { border-top: 1px solid var(--line); }
.quest-subtask-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 62px; padding: 9px 12px 9px 17px; border-bottom: 1px solid var(--line); background: white; }
.quest-subtask-row:last-child { border-bottom: 0; border-radius: 0 0 var(--r-md) var(--r-md); }
.quest-subtask-row.done { background: var(--wash-deep); }
.quest-subtask-row.settings-open { z-index: 5; }
.quest-subtask-copy { min-width: 0; }
.quest-subtask-copy > strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.quest-subtask-copy > div { display: flex; align-items: center; gap: 7px; margin-top: 4px; }
.quest-subtask-copy > div > span { color: var(--green); font-size: var(--text-xs); font-weight: 800; }
.quest-subtask-copy > div > small { min-width: 0; overflow: hidden; color: var(--muted); font-size: var(--text-xs); text-overflow: ellipsis; white-space: nowrap; }
.quest-subtask-actions { display: flex; align-items: center; gap: 5px; }
.subtask-edit-button { min-height: 40px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: white; color: var(--green); font-size: var(--text-xs); font-weight: 800; }
.subtask-edit-button.active { border-color: var(--green); background: var(--lime-tint); }
.subtask-settings-menu { grid-column: 1 / -1; margin-top: 10px; padding: 12px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--wash); }
.subtask-settings-menu > strong { display: block; margin: 10px 2px 5px; color: var(--muted); font-size: var(--text-xs); }
.subtask-title-edit { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.subtask-title-edit input, .subtask-interval-form input { min-width: 0; height: 40px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: white; color: var(--ink); }
.subtask-title-edit button { min-height: 40px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: var(--green); color: white; font-weight: 800; }
.subtask-frequency-option { width: 100%; min-height: 38px; display: flex; align-items: center; justify-content: space-between; padding: 0 9px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink); text-align: left; }
.subtask-frequency-option.selected { background: var(--lime-tint); color: var(--green); font-weight: 800; }
.subtask-frequency-option i { font-style: normal; }
.subtask-interval-form { display: grid; gap: 8px; margin-top: 8px; }
.subtask-interval-form > button { min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: white; color: var(--green); font-weight: 800; }
.subtask-interval-form > button.selected { border-color: var(--green); background: var(--lime-tint); }
.interval-stepper { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto 52px; align-items: center; gap: 6px; padding: 4px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: white; }
.interval-stepper input { width: 100%; min-width: 0; height: 44px; margin: 0; padding: 0 8px; border: 0; background: transparent; color: var(--ink); font-size: var(--text-lg); font-weight: 800; text-align: center; -moz-appearance: textfield; }
.interval-stepper input::-webkit-outer-spin-button, .interval-stepper input::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }
.interval-stepper > span { color: var(--muted); font-size: var(--text-sm); font-weight: 700; }
.interval-step { width: 52px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--r-sm); background: var(--lime-tint); color: var(--green); font-size: 20px; font-weight: 800; line-height: 1; }
.interval-step:active { background: var(--lime); }
.reorder-controls { display: flex; gap: 4px; }
.reorder-button { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: white; color: var(--green); font-size: 11px; }
.reorder-button:disabled { opacity: .35; }
.routine-settings-toggle { display: grid; place-items: center; width: 40px; height: 38px; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: white; color: var(--green); }
.routine-settings-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.routine-settings-toggle.active { border-color: var(--green); background: var(--lime-tint); }
.routine-settings-hint { margin: -4px 0 10px; color: var(--muted); font-size: var(--text-xs); font-weight: 600; }
.quest-routine-footer { display: flex; justify-content: flex-end; padding: 0 12px 12px; }
.add-routine-button { min-height: 52px; border: 1px dashed var(--green); border-radius: var(--r-md); background: var(--lime-faint); color: var(--green); font-weight: 800; }
.routine-lock-button { min-height: 52px; border: 0; border-radius: var(--r-md); background: var(--green); color: white; font-weight: 800; }
.subtask-delete-button { width: 100%; min-height: 40px; margin-top: 9px; border: 0; border-radius: var(--r-sm); background: rgba(199, 70, 49, .1); color: var(--coral-deep); font-weight: 800; }
.subtask-add-form { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 12px; border-top: 1px solid var(--line); background: var(--wash); }
.subtask-suggestions { flex: 1 0 100%; display: flex; align-items: center; gap: 7px; min-width: 0; }
.subtask-suggestions > span { flex: 0 0 auto; color: var(--muted); font-size: var(--text-xs); font-weight: 800; }
.subtask-suggestions > div { display: flex; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.subtask-suggestions > div::-webkit-scrollbar { display: none; }
.subtask-suggestion-chip { flex: 0 0 auto; min-height: 34px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: white; color: var(--green); font-size: var(--text-xs); font-weight: 800; white-space: nowrap; }
.subtask-add-form > input { flex: 1 1 150px; min-width: 0; }
.subtask-add-form input, .subtask-add-form select { height: 40px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: white; color: var(--ink); }
.subtask-add-form > [data-subtask-add-interval] { flex: 1 0 100%; }
.subtask-add-form .interval-stepper input { height: 44px; border: 0; }
.subtask-add-form > button { min-height: 40px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: white; color: var(--muted); font-weight: 800; }
.subtask-add-form > button[type="submit"] { border-color: var(--green); background: var(--green); color: white; }
.praise-button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 44px; min-height: 44px; border: 0; background: transparent; font-size: 18px; }.praise-button span { color: var(--muted); font-size: var(--text-xs); font-weight: 700; }
.praise-button.praised { opacity: .72; }.complete-state { display: flex; flex-direction: column; align-items: center; color: var(--green); font-size: 18px; font-weight: 800; }.complete-state small { margin-top: 2px; color: var(--muted); font-size: var(--text-xs); font-weight: 700; }
.family-strip { padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--lime-faint); }.family-strip h2 { margin: 4px 0 14px; font-size: 16px; }.member-list { display: grid; gap: 10px; }.member { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--yellow); font-weight: 800; }.member strong, .member small { display: block; }.member strong { font-size: 13px; }.member small { margin-top: 2px; color: var(--muted); font-size: var(--text-xs); }.member button { min-height: 40px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 0 10px; background: white; font-size: var(--text-sm); font-weight: 800; }.me-label { padding: 5px 9px; border-radius: var(--r-full); background: var(--wash-deep); color: var(--muted); font-size: var(--text-xs); font-weight: 700; }

.bottom-nav { position: fixed; z-index: 8; left: 50%; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); width: min(100%, 560px); padding: 8px 8px max(8px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255, 255, 255, .95); backdrop-filter: blur(18px); transform: translateX(-50%); }
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); font-size: var(--text-xs); font-weight: 700; transition: color .15s ease; }.nav-item svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }.nav-item.active { color: var(--green); font-weight: 800; }

.home-chat-preview { position: fixed; z-index: 7; left: 50%; bottom: calc(72px + env(safe-area-inset-bottom)); width: min(calc(100% - 24px), 536px); min-height: 52px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: rgba(255, 255, 255, .97); box-shadow: 0 8px 24px rgba(16, 44, 40, .14); color: var(--ink); text-align: left; transform: translateX(-50%); backdrop-filter: blur(18px); }
.home-chat-preview:active { transform: translateX(-50%) translateY(1px); }
.home-chat-preview-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-sm); background: var(--lime-tint); font-size: 17px; }
.home-chat-preview-lines { display: grid; min-width: 0; }
.home-chat-preview-lines { gap: 1px; }
.home-chat-preview-line { display: flex; gap: 5px; min-width: 0; font-size: var(--text-sm); line-height: 1.35; }
.home-chat-preview-line strong { flex: 0 0 auto; max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-chat-preview-line > span { min-width: 0; overflow: hidden; color: var(--ink-soft); text-overflow: ellipsis; white-space: nowrap; }
.home-chat-preview-empty { overflow: hidden; color: var(--muted); font-size: var(--text-sm); text-overflow: ellipsis; white-space: nowrap; }
.home-chat-preview-arrow { color: var(--muted); font-size: 25px; line-height: 1; }

.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px 14px; }
.calendar-toolbar h2 { margin: 0; font-size: var(--text-xl); }
.calendar-toolbar button { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: var(--r-sm); background: white; color: var(--green); font-size: 28px; }
.calendar-board { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-md); background: white; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { padding: 8px 6px 4px; color: var(--muted); font-size: var(--text-xs); font-weight: 800; text-align: center; }
.calendar-weekdays span:last-child { color: var(--coral); }
.calendar-grid { gap: 2px; padding: 4px 6px 8px; }
.calendar-day { position: relative; min-width: 0; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; overflow: hidden; padding: 7px 2px 4px; border: 0; border-radius: var(--r-sm); background: transparent; font-size: var(--text-sm); line-height: 1.15; }
.calendar-day.empty { pointer-events: none; }
.calendar-day.today { box-shadow: inset 0 0 0 1px var(--green); color: var(--green); font-weight: 800; }
.calendar-day.sunday, .calendar-day.holiday { color: var(--coral); font-weight: 800; }
.calendar-day-number { flex: 0 0 auto; }
.calendar-holiday-label { display: block; width: 100%; overflow: hidden; color: var(--coral-deep); font-size: 8px; font-weight: 800; line-height: 1.25; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.calendar-day.selected { background: var(--green); color: white; box-shadow: none; font-weight: 800; }
.calendar-day.selected .calendar-holiday-label { color: var(--on-green); }
.calendar-day i { position: absolute; right: 3px; top: 3px; display: grid; place-items: center; min-width: 15px; height: 15px; padding: 0 3px; border-radius: var(--r-full); background: var(--coral); color: white; font-size: 9px; font-style: normal; font-weight: 800; }
.calendar-day.selected i { background: var(--lime); color: var(--green-dark); }
.calendar-agenda { margin-top: 22px; }
.calendar-selected-holiday { display: flex; align-items: center; gap: 7px; margin: -4px 0 12px; padding: 9px 11px; border: 1px solid rgba(199, 70, 49, .22); border-radius: var(--r-sm); background: rgba(199, 70, 49, .07); color: var(--coral-deep); font-size: var(--text-sm); font-weight: 800; }
.calendar-selected-holiday span { color: var(--coral); font-size: 8px; }

.calendar-day-head { display: inline-flex; align-items: center; gap: 3px; }
.calendar-due { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.calendar-day.has-overdue .calendar-due { background: var(--coral); box-shadow: 0 0 0 2px rgba(226, 90, 66, .18); }
/* 밀린 항목은 완료 배지(빨강)와 헷갈리지 않게 왼쪽 점과 제목 옆 배지로만 알린다. */
.overdue-badge { margin-left: 6px; padding: 1px 6px; border-radius: var(--r-full); background: var(--coral-tint, #fdecea); color: var(--coral-deep); font-size: 10px; font-style: normal; font-weight: 800; vertical-align: middle; white-space: nowrap; }
.quest-subtask-row.overdue { background: #fff8f6; box-shadow: inset 3px 0 0 var(--coral); }
.quest-row.has-overdue .quest-routine-title::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--coral); vertical-align: middle; }
.home-story-due-item.overdue strong { color: var(--coral-deep); }
.home-story-due { display: grid; gap: 6px; margin-bottom: 12px; padding: 12px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); background: white; }
.home-story-due-title { margin: 0; color: var(--green); font-size: var(--text-xs); font-weight: 800; }
.home-story-due-item { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 9px; }
.home-story-due-item.done { opacity: .55; }
.home-story-due-emoji { font-size: 17px; }
.home-story-due-item strong { display: block; font-size: 13px; }
.home-story-due-item small { display: block; margin-top: 1px; color: var(--muted); font-size: var(--text-xs); }
.calendar-empty { margin: 0; padding: 20px 12px; border-block: 1px solid var(--line); color: var(--muted); font-size: var(--text-sm); text-align: center; }
.home-story-list { display: grid; gap: 7px; }
.home-story-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: white; }
.home-story-emoji { display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-sm); background: var(--lime-tint); font-size: 19px; }
.home-story-copy { min-width: 0; }
.home-story-copy strong { display: block; overflow: hidden; font-size: var(--text-md); text-overflow: ellipsis; white-space: nowrap; }
.home-story-copy small { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: var(--text-xs); text-overflow: ellipsis; white-space: nowrap; }
.home-story-item time { flex: 0 0 auto; color: var(--green); font-size: var(--text-sm); font-weight: 800; }

.chat-card { min-height: calc(100dvh - 170px); overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-md); background: white; }
.chat-layout { min-height: calc(100dvh - 170px); display: grid; grid-template-columns: minmax(0, 1fr); }
.chat-room-panel { min-width: 0; display: flex; flex-direction: column; }
.chat-room-header { min-height: 58px; display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.chat-room-header > span:last-child { display: grid; }
.chat-room-header strong { font-size: var(--text-md); }
.chat-room-header small { margin-top: 1px; color: var(--muted); font-size: var(--text-xs); }
.chat-room-symbol { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border: 0; border-radius: var(--r-sm); background: var(--lime-tint); }
.messages { flex: 1; height: calc(100dvh - 288px); min-height: 320px; overflow-y: auto; padding: 16px; background: var(--wash); }
.empty-chat { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); }.empty-chat span { font-size: 34px; }.empty-chat strong { margin-top: 10px; color: var(--ink); font-size: var(--text-md); }.empty-chat p { margin: 5px 0; font-size: var(--text-sm); }
.message { position: relative; width: fit-content; max-width: 80%; margin: 12px 0; padding-right: 44px; }
.message.mine { margin-left: auto; padding: 0 0 0 44px; text-align: right; }
.message-author { display: flex; align-items: center; gap: 6px; margin: 0 0 5px 2px; }
.message-avatar { display: grid; place-items: center; flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; background: var(--yellow); color: var(--ink); font-size: var(--text-xs); font-weight: 800; }
.message-identity { display: flex; align-items: baseline; gap: 4px; min-width: 0; font-size: var(--text-xs); }
.message-badge { color: var(--green); font-weight: 800; white-space: nowrap; }
.message-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bubble { padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px 10px 10px; background: white; font-size: var(--text-md); line-height: 1.45; text-align: left; white-space: pre-wrap; word-break: break-word; }
.mine .bubble { border-color: var(--green); border-radius: 10px 4px 10px 10px; background: var(--green); color: white; }
.message time { display: inline-block; margin: 4px 3px 0; color: var(--faint); font-size: 10px; }
.message.user-menu-open { z-index: 6; }
.message-author-anchor { position: relative; width: max-content; max-width: 100%; }
.chat-compose { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }.chat-compose input { min-width: 0; margin: 0; padding: 12px; background: var(--wash); }.chat-compose button { width: 46px; border: 0; border-radius: var(--r-md); background: var(--coral); color: white; transition: transform .12s ease, opacity .12s ease; }.chat-compose button:active { transform: scale(.94); }.chat-compose button:disabled { opacity: .38; cursor: not-allowed; transform: none; }.chat-compose svg, .invite-code strong { user-select: all; -webkit-user-select: all; }
.invite-code svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.invite-code.expired { border-color: var(--coral); color: var(--coral-deep); }
.invite-code-refresh { width: 100%; min-height: 40px; margin-top: 8px; border: 1px solid var(--line); border-radius: var(--r-md); background: white; color: var(--ink-soft); font-size: var(--text-xs); font-weight: 800; }

@media (max-width: 420px) {
  .messages { padding: 13px 11px; }
}

.community-board { display: grid; gap: 14px; }
.community-intro { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px; border-radius: var(--r-md); background: var(--yellow-tint); }
.community-intro h2 { margin: 4px 0 2px; font-size: var(--text-lg); }
.community-intro p:last-child { margin: 0; color: var(--muted); font-size: var(--text-xs); }
.community-intro > button { flex: 0 0 auto; min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--r-md); background: var(--green); color: white; font-weight: 800; }
.community-compose { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: white; }
.community-compose > label { color: var(--ink); font-size: var(--text-sm); font-weight: 800; }
.community-compose textarea, .community-reply-form textarea { width: 100%; margin-top: 7px; padding: 13px 14px; resize: vertical; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--wash); color: var(--ink); line-height: 1.55; }
.community-compose-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.community-anonymous { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: var(--text-sm); font-weight: 700; }
.community-anonymous input { width: 19px; height: 19px; margin: 0; accent-color: var(--green); }
.community-compose-footer > button { min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--r-md); background: var(--coral); color: white; font-weight: 800; }
.community-compose-footer > button:disabled { opacity: .55; }
.community-sort-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: var(--r-md); background: var(--wash-deep); }
.community-sort-tabs button { min-height: 40px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); font-size: 13px; font-weight: 800; }
.community-sort-tabs button.active { background: white; color: var(--green); box-shadow: var(--shadow-sm); }
.community-hot-badge { justify-self: start; padding: 4px 9px; border-radius: var(--r-full); background: var(--yellow-tint); color: var(--coral-deep); font-size: 10px; font-weight: 800; }
.community-post-list { display: grid; gap: 8px; }
.community-notice { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--yellow-line); border-radius: var(--r-md); background: var(--yellow-tint); }
.community-notice > div { display: flex; align-items: center; gap: 8px; }
.community-notice strong { font-size: var(--text-md); }
.community-notice-label { padding: 3px 7px; border-radius: var(--r-full); background: var(--green); color: white; font-size: 10px; font-weight: 800; }
.community-notice p { margin: 0; color: var(--ink-soft); font-size: var(--text-sm); line-height: 1.55; }
.community-post-card { width: 100%; display: grid; gap: 7px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: white; text-align: left; }
.community-post-card:active { border-color: var(--green); }
.community-post-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--text-xs); }
.community-post-meta strong { color: var(--green); }
.community-post-meta time { margin-left: auto; }
.community-post-title { overflow: hidden; font-size: var(--text-md); font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.community-post-preview { overflow: hidden; color: var(--ink-soft); font-size: var(--text-sm); text-overflow: ellipsis; white-space: nowrap; }
.community-post-counts { display: flex; gap: 12px; color: var(--muted); font-size: var(--text-xs); font-weight: 700; }
.community-post-counts span:first-child { color: var(--coral-text); }
.community-empty { display: flex; min-height: 240px; flex-direction: column; align-items: center; justify-content: center; padding: 24px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); background: white; text-align: center; }
.community-empty > span { font-size: 38px; }
.community-empty strong { margin-top: 12px; }
.community-empty p { margin: 5px 0 0; color: var(--muted); font-size: var(--text-sm); }
.community-detail { display: grid; gap: 12px; }
.community-detail-post { padding: 18px; border: 1px solid var(--line); border-radius: var(--r-md); background: white; }
.community-detail-post h2 { margin: 15px 0 10px; font-size: var(--text-xl); line-height: 1.35; }
.community-detail-post > p { min-height: 92px; margin: 0; color: var(--ink-soft); line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.community-detail-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line); }
.community-like { min-height: 42px; padding: 0 14px; border: 1px solid var(--yellow-line); border-radius: var(--r-full); background: var(--yellow-tint); color: var(--coral-text); font-weight: 800; }
.community-like.liked, .community-like:disabled { opacity: .72; }
.community-block { min-height: 42px; padding: 0; border: 0; background: transparent; color: var(--coral-text); font-size: var(--text-xs); text-decoration: underline; }
.community-replies { padding-top: 8px; }
.community-reply { position: relative; padding: 14px 0; border-top: 1px solid var(--line); }
.community-reply p { margin: 7px 0 0; color: var(--ink-soft); font-size: var(--text-sm); line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.community-reply > button { min-height: 38px; margin-top: 5px; padding: 0; border: 0; background: transparent; color: var(--coral-text); font-size: var(--text-xs); text-decoration: underline; }
.community-reply-empty { margin: 0; padding: 28px 0; border-block: 1px solid var(--line); color: var(--muted); font-size: var(--text-sm); text-align: center; }
.community-reply-form { display: grid; gap: 10px; margin-top: 16px; }
.community-reply-form textarea { margin-top: 0; background: white; }

.tip-feature { position: relative; overflow: hidden; min-height: 190px; padding: 22px; border-radius: var(--r-md); background: var(--yellow); }.tip-feature::after { content: '🧽'; position: absolute; right: 18px; bottom: 0; font-size: 78px; filter: drop-shadow(0 10px 10px rgba(16, 44, 40, .14)); transform: rotate(-9deg); }.tip-feature h2 { margin: 8px 0 14px; font-size: 26px; line-height: 1.2; }.tip-feature > span { display: inline-block; padding: 6px 10px; border-radius: var(--r-sm); background: rgba(255, 255, 255, .65); font-size: var(--text-xs); font-weight: 800; }
.tip-list { display: grid; gap: 8px; }.tip-list article { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: white; }.tip-list article > span { font-size: 28px; }.tip-list h3 { margin: 0; font-size: var(--text-md); }.tip-list p { margin: 5px 0 0; color: var(--muted); font-size: var(--text-sm); line-height: 1.55; }
.community-cta { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin-top: 20px; padding: 16px; border: 0; border-radius: var(--r-md); background: var(--green); color: white; text-align: left; transition: transform .12s ease; }.community-cta:active { transform: translateY(1px); }.community-cta > span { font-size: 28px; }.community-cta strong { font-size: var(--text-md); }.community-cta p { margin: 3px 0 0; color: var(--on-green); font-size: var(--text-xs); }.community-cta b { font-size: 21px; }

.profile-hero { position: relative; display: flex; flex-direction: column; align-items: center; padding: 24px 16px; border-radius: var(--r-md); background: linear-gradient(145deg, var(--lime), #f0f9dd); text-align: center; }
.plan-badge { position: absolute; top: 14px; right: 14px; padding: 6px 11px; border-radius: var(--r-sm); font-size: var(--text-xs); font-weight: 800; }
.plan-badge.free { border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .82); color: var(--muted); }
.plan-badge.plus { border: 1px solid var(--green); background: var(--green); color: white; }
.profile-photo-control { display: grid; justify-items: center; gap: 7px; }
.profile-avatar-wrap { position: relative; }
.profile-avatar-wrap .avatar-settings-button { position: absolute; top: -2px; right: -8px; width: 28px; height: 28px; box-shadow: var(--shadow-sm); }
.profile-avatar-wrap .avatar-settings-button svg { width: 15px; height: 15px; }
.profile-avatar { display: grid; place-items: center; width: 72px; height: 72px; overflow: hidden; border: 3px solid white; border-radius: 50%; background: var(--yellow); font-size: 25px; font-weight: 800; box-shadow: var(--shadow-sm); }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo-button { position: relative; min-height: 34px; padding: 7px 11px; border: 1px solid var(--green); border-radius: var(--r-full); background: white; color: var(--green); cursor: pointer; font-size: var(--text-xs); font-weight: 800; }
.profile-photo-button.loading { cursor: wait; opacity: .6; }
.avatar-color-picker { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 220px; margin-top: 4px; }
.avatar-color { width: 30px; height: 30px; padding: 0; border: 2px solid transparent; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(16, 44, 40, .12); }
.avatar-color.selected { border-color: var(--green); }
.avatar-color:disabled { opacity: .6; }
.profile-photo-button input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.profile-hero p { margin: 10px 0 2px; color: var(--green); font-size: var(--text-xs); font-weight: 800; }
.profile-name { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 4px; max-width: 100%; padding-inline: 30px; }
.profile-name h2 { margin: 0; max-width: 100%; overflow: hidden; font-size: var(--text-xl); line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.nickname-edit-button { position: absolute; top: 50%; right: 0; display: grid; flex: 0 0 auto; place-items: center; width: 30px; height: 30px; margin-top: -15px; padding: 0; border: 0; background: transparent; color: var(--green); }
.nickname-edit-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.profile-hero > span { margin-top: 5px; color: var(--muted); font-size: var(--text-sm); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }.stat-grid article { padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: white; }.stat-grid small { display: block; color: var(--muted); font-size: var(--text-xs); }.stat-grid strong { display: inline-block; margin-top: 6px; font-size: 24px; }.stat-grid span { color: var(--muted); font-size: var(--text-xs); }
.invite-code { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border: 1px dashed var(--green); border-radius: var(--r-md); background: var(--lime-tint); text-align: left; }.invite-code small, .invite-code strong { display: block; }.invite-code small { color: var(--muted); font-size: var(--text-xs); }.invite-code strong { margin-top: 3px; font-size: 19px; letter-spacing: .08em; }.invite-code svg { color: var(--green); }
.invite-share-button { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; margin-bottom: 8px; padding: 14px; border: 0; border-radius: var(--r-md); background: var(--green); color: white; text-align: left; box-shadow: var(--shadow-sm); }
.invite-share-button > span:first-child { display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-sm); background: rgba(255, 255, 255, .13); font-size: 20px; }
.invite-share-button strong, .invite-share-button small { display: block; }
.invite-share-button strong { font-size: var(--text-md); }
.invite-share-button small { margin-top: 2px; color: var(--on-green); font-size: var(--text-xs); }
.invite-share-button i { color: var(--on-green); font-size: 26px; font-style: normal; }
.invite-share-button:disabled { opacity: .6; }
.rename-form { display: grid; gap: 8px; }
.nickname-check-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.rename-form input { margin: 0; }
.rename-form button { min-height: 46px; border: 0; border-radius: var(--r-md); padding: 0 18px; background: var(--green); color: white; font-weight: 800; }
.rename-form button:disabled { background: var(--wash-deep); color: var(--muted); }
.nickname-check-status { min-height: 18px; margin: 0; color: var(--muted); font-size: var(--text-xs); font-weight: 700; }
.nickname-check-status.available { color: var(--green); }
.nickname-check-status.taken, .nickname-check-status.invalid, .nickname-check-status.reserved { color: var(--coral-text); }
.nickname-modal-backdrop { position: fixed; z-index: 40; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 20px 12px max(12px, env(safe-area-inset-bottom)); background: rgba(5, 25, 22, .48); backdrop-filter: blur(3px); }
.nickname-modal { width: min(100%, 520px); padding: 18px; border-radius: var(--r-md); background: white; box-shadow: 0 24px 70px rgba(5, 25, 22, .28); }
.nickname-modal > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.nickname-modal > header small { color: var(--green); font-size: var(--text-xs); font-weight: 800; }
.nickname-modal > header h2 { margin: 2px 0 0; font-size: var(--text-xl); }
.nickname-modal > header > button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--r-sm); background: var(--wash); color: var(--muted); font-size: 27px; line-height: 1; }
.nickname-field { display: grid; gap: 7px; }
.nickname-field .nickname-check-row { margin-top: 0; }
.nickname-modal .helper { margin-top: 10px; }
.subscription-entry { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: white; }
.subscription-entry small, .subscription-entry strong, .subscription-entry span { display: block; }
.subscription-entry small, .subscription-entry span { color: var(--muted); font-size: var(--text-xs); }
.subscription-entry strong { margin: 3px 0; font-size: var(--text-md); }
.subscription-entry > button { flex: 0 0 auto; min-height: 42px; padding: 0 12px; border: 1px solid var(--green); border-radius: var(--r-sm); background: white; color: var(--green); font-size: var(--text-sm); font-weight: 800; }
.subscription-entry i { font-style: normal; }
.subscription-management { display: grid; gap: 14px; }
.subscription-status-card { padding: 22px; border-radius: var(--r-md); background: var(--green); color: white; box-shadow: var(--shadow-lg); }
.subscription-status-card .eyebrow { color: var(--lime); }
.subscription-status-card h2 { margin: 5px 0 20px; font-size: 26px; }
.subscription-status-card dl { display: grid; gap: 10px; margin: 0; }
.subscription-status-card dl > div { display: flex; justify-content: space-between; gap: 18px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .18); }
.subscription-status-card dt { color: var(--on-green); }
.subscription-status-card dd { margin: 0; font-weight: 800; text-align: right; }
.subscription-list { display: grid; gap: 8px; }
.subscription-list-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: white; }
.subscription-list-item > div:last-child { text-align: right; }
.subscription-list-item strong, .subscription-list-item small, .subscription-list-item span { display: block; }
.subscription-list-item small { margin-top: 2px; color: var(--muted); font-size: var(--text-xs); }
.subscription-list-item span { color: var(--green); font-size: var(--text-sm); font-weight: 800; }
.plan-offer-card { padding: 18px; border: 1px solid var(--green); border-radius: var(--r-md); background: white; }
.plan-event { margin: 0; padding: 5px 10px; border-radius: var(--r-full); background: var(--yellow-tint); color: var(--coral-deep); font-size: var(--text-xs); font-weight: 800; display: inline-block; }
.plan-offer-card h3 { margin: 10px 0 12px; font-size: var(--text-lg); }
.plan-benefits { display: grid; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.plan-benefits li { position: relative; padding-left: 20px; color: var(--ink-soft); font-size: var(--text-sm); }
.plan-benefits li::before { position: absolute; top: 0; left: 0; color: var(--green); font-weight: 800; content: '✓'; }
.plan-products { display: grid; gap: 8px; }
.plan-products button { display: grid; gap: 2px; min-height: 62px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: white; text-align: left; }
.plan-products button.recommended { border-color: var(--green); background: var(--lime-tint); }
.plan-products button strong { font-size: var(--text-md); }
.plan-products button small { color: var(--muted); font-size: var(--text-xs); }
.subscription-cancel-confirm { padding: 16px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: white; }
.subscription-cancel-confirm strong { display: block; font-size: var(--text-md); }
.subscription-cancel-confirm ul { display: grid; gap: 6px; margin: 10px 0; padding-left: 18px; color: var(--ink-soft); font-size: var(--text-sm); }
.subscription-cancel-confirm p { margin: 0 0 14px; color: var(--muted); font-size: var(--text-xs); }
.subscription-cancel-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.subscription-cancel-actions button { min-height: 48px; border-radius: var(--r-md); font-weight: 800; }
.subscription-cancel-actions .cancel-confirm { border: 1px solid var(--line-strong); background: white; color: var(--coral-text); }
.subscription-cancel-actions .cancel-keep { border: 0; background: var(--green); color: white; }
.subscription-cancel { min-height: 48px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: white; color: var(--coral-text); font-weight: 800; }
.subscription-cancel-guide, .subscription-owner-note { margin: 0; padding: 16px; border: 1px solid var(--yellow-line); border-radius: var(--r-md); background: var(--yellow-tint); color: var(--ink-soft); font-size: var(--text-sm); }
.subscription-cancel-guide strong { color: var(--ink); }
.subscription-cancel-guide p { margin: 5px 0 0; }
.notification-settings { overflow: hidden; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); background: white; }
.notification-settings-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 0 16px; border: 0; background: transparent; text-align: left; }
.notification-settings-toggle strong { display: block; font-size: var(--text-md); }
.notification-settings-toggle small { display: block; margin-top: 2px; color: var(--muted); font-size: var(--text-xs); font-weight: 700; }
.notification-settings-toggle i { color: var(--muted); font-size: 15px; font-style: normal; }
.notification-empty { margin: 0; padding: 0 16px 14px; color: var(--muted); font-size: var(--text-xs); }
.notification-kind-list { display: grid; gap: 6px; margin: 0; padding: 0 12px 12px; list-style: none; }
.notification-kind-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--wash); }
.notification-kind-list strong { display: block; font-size: 13px; }
.notification-kind-list small { display: block; margin-top: 2px; color: var(--muted); font-size: var(--text-xs); }
.notification-kind-button { flex: 0 0 auto; min-height: 38px; padding: 0 14px; border: 0; border-radius: var(--r-sm); background: var(--green); color: white; font-size: var(--text-xs); font-weight: 800; }
.notification-kind-button.on, .notification-kind-button:disabled { background: var(--wash-deep); color: var(--muted); }
.notification-settings .helper { margin: 0 16px 14px; }
.avatar-settings-button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--green); border-radius: 50%; background: white; color: var(--green); }
.avatar-settings-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.badge-entry { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; margin-top: 24px; padding: 14px 16px; border: 1px solid var(--yellow-line); border-radius: var(--r-md); background: var(--yellow-tint); text-align: left; }
.badge-entry .badge-emblem { width: 42px; height: 50px; }
.badge-entry small { display: block; color: var(--muted); font-size: var(--text-xs); }
.badge-entry strong { display: block; margin: 2px 0; font-size: var(--text-md); }
.badge-entry i { color: var(--muted); font-size: 24px; font-style: normal; }
.badge-modal { max-height: min(720px, calc(100dvh - 32px)); overflow-y: auto; }
.badge-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.badge-tile { position: relative; display: grid; justify-items: center; gap: 6px; padding: 12px 8px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--wash); }
.badge-tile img { width: 44px; height: 52px; }
.badge-tile span { overflow: hidden; font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.badge-tile.locked { background: #f2f4f3; }
.badge-tile.locked img { filter: grayscale(1) brightness(1.5) contrast(.35); opacity: .65; }
.badge-tile.locked span { color: var(--faint); }
.badge-tile.equipped { border-color: var(--green); background: var(--lime-tint); }
.badge-tile i { position: absolute; top: 4px; right: 4px; padding: 2px 5px; border-radius: var(--r-full); background: var(--green); color: white; font-size: 9px; font-style: normal; font-weight: 800; }
.badge-detail-backdrop { z-index: 44; }
.badge-detail-modal { text-align: center; }
.badge-detail-modal > header { text-align: left; }
.badge-detail-how { display: grid; gap: 4px; margin: 0 0 12px; color: var(--ink-soft); font-size: var(--text-sm); }
.badge-detail-how strong { color: var(--green); font-size: var(--text-xs); }
.badge-progress-track { height: 8px; overflow: hidden; border-radius: var(--r-full); background: var(--wash-deep); }
.badge-progress-track span { display: block; height: 100%; border-radius: var(--r-full); background: var(--green); }
.badge-detail-locked-note { margin: 6px 0 0; color: var(--muted); font-size: var(--text-xs); text-align: center; }
.badge-detail-emblem { width: 84px; height: 98px; margin: 4px auto 12px; display: block; }
.badge-detail-copy { margin: 0; color: var(--ink-soft); font-size: var(--text-sm); line-height: 1.6; }
.badge-detail-progress { margin: 12px 0 16px; color: var(--muted); font-size: var(--text-sm); }
.badge-detail-progress strong { color: var(--green); font-size: var(--text-lg); }
.badge-equip-button { width: 100%; min-height: 48px; border: 0; border-radius: var(--r-md); background: var(--green); color: white; font-weight: 800; }
.badge-equip-button:disabled { background: var(--wash-deep); color: var(--muted); }


.routine-modal-backdrop { position: fixed; z-index: 30; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 20px 12px max(12px, env(safe-area-inset-bottom)); background: rgba(5, 25, 22, .48); backdrop-filter: blur(3px); }
.routine-modal { width: min(100%, 520px); max-height: min(760px, calc(100dvh - 32px)); overflow-y: auto; padding: 18px; border-radius: var(--r-md); background: white; box-shadow: 0 24px 70px rgba(5, 25, 22, .28); }
.routine-modal > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.routine-modal > header small { color: var(--green); font-size: var(--text-xs); font-weight: 800; }
.routine-modal > header h2 { margin: 2px 0 0; font-size: var(--text-xl); }
.routine-modal > header > button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--r-sm); background: var(--wash); color: var(--muted); font-size: 27px; line-height: 1; }
.routine-quota-summary { margin: -6px 0 14px; color: var(--muted); font-size: var(--text-xs); }
.routine-template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.routine-template-card.locked { border-style: dashed; background: #f5f6f5; }
.routine-template-card.locked .template-tile-emoji, .routine-template-card.locked .template-tile-title { opacity: .62; }
.routine-template-card.locked .template-tile-cadence { color: var(--coral-deep); }
.routine-template-card:disabled { cursor: default; opacity: .52; }
.routine-template-card.custom { border-color: var(--yellow-line); background: var(--yellow-tint); }
.routine-template-lock { font-style: normal; }
.custom-routine-form { display: grid; gap: 15px; margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--wash); }
.custom-routine-form > label { color: var(--ink); font-size: var(--text-sm); font-weight: 800; }
.custom-routine-form input, .custom-routine-form select { width: 100%; margin-top: 6px; padding: 12px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: white; color: var(--ink); }
.custom-routine-form > button { min-height: 48px; border: 0; border-radius: var(--r-md); background: var(--green); color: white; font-weight: 800; }
.custom-emoji-options { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; margin-top: 7px; }
.custom-emoji-options label { position: relative; }
.custom-emoji-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.custom-emoji-options span { display: grid; place-items: center; aspect-ratio: 1; border: 1px solid var(--line); border-radius: var(--r-sm); background: white; font-size: 19px; }
.custom-emoji-options input:checked + span { border-color: var(--green); background: var(--lime-tint); box-shadow: inset 0 0 0 1px var(--green); }

.plus-backdrop { z-index: 32; }
.plus-sheet { width: min(100%, 480px); padding: 22px 18px 16px; border-radius: var(--r-md); background: white; box-shadow: 0 24px 70px rgba(5, 25, 22, .3); text-align: center; }
.plus-mark { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 50%; background: var(--green); color: var(--lime); font-size: 27px; font-weight: 800; }
.plus-sheet h2 { margin: 0; font-size: 21px; line-height: 1.35; }
.plus-sheet > p { margin: 8px auto 18px; max-width: 330px; color: var(--muted); font-size: var(--text-sm); word-break: keep-all; }
.plus-products { display: grid; gap: 8px; }
.plus-products button { min-height: 70px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; padding: 11px 16px; border: 1px solid var(--green); border-radius: var(--r-md); background: var(--green); color: white; text-align: left; }
.plus-products button:not(.recommended) { border-color: var(--yellow-line); background: var(--yellow-tint); color: var(--ink); }
.plus-products button strong, .plus-products button small { display: block; }
.plus-products button strong { font-size: var(--text-md); white-space: nowrap; }
.plus-products button small { color: inherit; font-size: var(--text-xs); line-height: 1.4; opacity: .76; word-break: keep-all; }
.plus-products button:disabled { border-color: var(--line); background: var(--wash); color: var(--muted); }
.plus-later { min-height: 44px; margin-top: 8px; padding: 0 16px; border: 0; background: transparent; color: var(--muted); font-size: var(--text-sm); font-weight: 800; }

.policy-page { width: min(100%, 680px); min-height: 100dvh; margin: 0 auto; padding: max(28px, env(safe-area-inset-top)) 20px 52px; background: white; }.policy-page > a { color: var(--green); font-size: var(--text-sm); font-weight: 800; }.policy-page h1 { margin: 24px 0 6px; font-size: 26px; }.policy-page .updated { margin: 0 0 28px; color: var(--muted); font-size: var(--text-sm); }.policy-page section { margin-top: 28px; }.policy-page h2 { margin: 0 0 10px; font-size: var(--text-lg); }.policy-page h3 { margin: 18px 0 6px; font-size: var(--text-md); }.policy-page p, .policy-page li { color: var(--ink-soft); font-size: var(--text-md); line-height: 1.7; }.policy-page ul, .policy-page ol { padding-left: 20px; }.policy-page table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }.policy-page th, .policy-page td { padding: 10px; border: 1px solid var(--line); vertical-align: top; text-align: left; }.policy-page th { background: var(--wash); }

.toast-region { position: fixed; z-index: 20; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); width: min(calc(100% - 32px), 460px); transform: translateX(-50%); pointer-events: none; }.toast { margin-top: 8px; padding: 12px 14px; border-radius: var(--r-md); background: var(--ink); color: white; box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 700; animation: toast-in .2s ease-out; }.toast-error { background: var(--coral-deep); } @keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.fatal h1 { margin-bottom: 5px; }.fatal p { color: var(--muted); }.fatal button { padding: 0 24px; }

@media (min-width: 720px) {
  body { background: var(--wash-deep); }
  .onboarding { padding-block: 54px; }
}

@media (max-width: 370px) {
  .praise-button span { display: none; }
  .template-grid { grid-template-columns: 1fr; }
  .onboarding-hero h1 { font-size: 28px; }
  .splash h1 { font-size: 29px; }
  .calendar-edit-form { grid-template-columns: 1fr; }
  .calendar-edit-actions { grid-column: 1; }
  .quest-notification-prompt { grid-template-columns: auto 1fr; }
  .quest-notification-prompt button { grid-column: 1 / -1; }
  .routine-heading { align-items: flex-start; }
  .routine-heading > div { align-items: flex-end; flex-direction: column; gap: 4px; }
  .routine-template-grid { grid-template-columns: 1fr; }
  .custom-emoji-options { grid-template-columns: repeat(4, 1fr); }
}

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