:root {
  color-scheme: light;
  --ink: #23332f;
  --muted: #65726e;
  --paper: #f7f4ed;
  --surface: #fffdf8;
  --green: #315f55;
  --green-soft: #dce8e1;
  --orange: #d9865b;
  --orange-soft: #f6e5da;
  --line: #deddd5;
  --danger: #9c5145;
  --shadow: 0 14px 36px rgb(35 51 47 / 8%);
  font-family: ui-rounded, "SF Pro Rounded", "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid #7ca99e; outline-offset: 2px; }
img { max-width: 100%; display: block; }

.shell { width: min(100%, 760px); min-height: 100vh; margin: 0 auto; padding: env(safe-area-inset-top) 20px calc(96px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 12px; }
.brand { font-size: 1.3rem; letter-spacing: .12em; font-weight: 750; color: var(--green); }
.eyebrow { color: var(--orange); font-size: .78rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 8px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 9vw, 3.5rem); line-height: 1.1; letter-spacing: -.04em; margin-bottom: 14px; }
h2 { font-size: 1.45rem; letter-spacing: -.02em; margin-bottom: 14px; }
h3 { font-size: 1rem; margin-bottom: 8px; }
.lede { color: var(--muted); line-height: 1.7; font-size: 1.03rem; }
.muted { color: var(--muted); }
.tiny { font-size: .8rem; color: var(--muted); line-height: 1.5; }
.hero { padding: 34px 0 22px; }
.hero-art { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: var(--orange-soft); color: var(--orange); font-size: 2rem; margin-bottom: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.soft-card { background: var(--green-soft); border: 0; box-shadow: none; }
.warning-card { background: var(--orange-soft); border-color: #e9c8b4; box-shadow: none; }
.section { margin-top: 30px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.stack { display: grid; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 15px 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.stat strong { display: block; font-size: 1.55rem; color: var(--green); }
.stat span { font-size: .75rem; color: var(--muted); }
.primary, .secondary, .ghost, .danger, .decision { border: 0; border-radius: 16px; min-height: 50px; padding: 12px 18px; font-weight: 700; }
.primary { background: var(--green); color: white; width: 100%; box-shadow: 0 8px 20px rgb(49 95 85 / 20%); }
.secondary { background: var(--green-soft); color: var(--green); }
.ghost { background: transparent; color: var(--green); padding-inline: 8px; }
.danger { background: #f5e1dd; color: var(--danger); }
.round-button { width: 44px; min-height: 44px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }
.button-row > * { flex: 1; }
label { display: grid; gap: 8px; font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid #c9ccc6; background: #fff; border-radius: 14px; padding: 13px 14px; color: var(--ink); min-height: 48px; }
textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
.field-help { font-size: .78rem; color: var(--muted); font-weight: 400; }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: block; height: 100%; min-height: 86px; border: 1px solid var(--line); border-radius: 18px; padding: 14px; background: var(--surface); }
.choice input:checked + span { border: 2px solid var(--green); background: var(--green-soft); }
.choice strong { display: block; margin-bottom: 5px; }
.photo-input { border: 1px dashed #aeb8b3; border-radius: 18px; padding: 16px; text-align: center; background: rgb(255 255 255 / 45%); }
.photo-input input { border: 0; padding: 4px; min-height: auto; }
.preview { border-radius: 18px; aspect-ratio: 4/3; object-fit: cover; width: 100%; margin-top: 12px; background: var(--green-soft); }
.timer-wrap { text-align: center; padding: 28px 0 18px; }
.timer { font-size: clamp(4rem, 23vw, 7rem); line-height: 1; letter-spacing: -.06em; font-variant-numeric: tabular-nums; color: var(--green); }
.timer.over { color: var(--orange); }
.progress { height: 8px; background: var(--green-soft); border-radius: 99px; overflow: hidden; margin: 18px 0; }
.progress > span { display: block; height: 100%; background: var(--orange); border-radius: inherit; transition: width .3s; }
.question { font-family: ui-serif, "Songti TC", serif; font-size: 1.6rem; line-height: 1.45; text-align: center; min-height: 110px; display: grid; place-items: center; }
.question-dots { display: flex; justify-content: center; gap: 7px; margin: 12px 0 20px; }
.question-dots span { width: 7px; height: 7px; background: var(--line); border-radius: 50%; }
.question-dots span.active { background: var(--orange); }
.decisions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.decision { background: var(--surface); border: 1px solid var(--line); padding: 10px 6px; font-size: .85rem; }
.decision b { display: block; font-size: 1.25rem; color: var(--green); margin-bottom: 3px; }
.decision:last-child { grid-column: span 2; }
.session-meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .85rem; }
.nav { position: fixed; z-index: 20; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 760px); padding: 9px 12px calc(9px + env(safe-area-inset-bottom)); background: rgb(247 244 237 / 92%); backdrop-filter: blur(18px); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); }
.nav button { border: 0; background: none; color: var(--muted); min-height: 52px; font-size: .72rem; display: grid; place-items: center; gap: 2px; }
.nav button span { font-size: 1.15rem; }
.nav button.active { color: var(--green); font-weight: 750; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item img { width: 68px; height: 68px; object-fit: cover; border-radius: 14px; background: var(--green-soft); }
.list-main { flex: 1; min-width: 0; }
.list-main p { margin: 4px 0 0; }
.badge { display: inline-flex; border-radius: 99px; padding: 4px 9px; font-size: .7rem; font-weight: 750; background: var(--green-soft); color: var(--green); }
.badge.overdue { background: #f5e1dd; color: var(--danger); }
.badge.soon { background: var(--orange-soft); color: #945231; }
.empty { text-align: center; padding: 44px 18px; color: var(--muted); }
.empty-mark { display: block; font-size: 2.4rem; color: #9bb3ac; margin-bottom: 12px; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.memory { overflow: hidden; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.memory img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.memory-body { padding: 12px; }
.memory-body p { line-height: 1.5; margin-bottom: 8px; }
.before-after { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.before-after figure { margin: 0; }
.before-after img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 14px; background: var(--green-soft); }
.before-after figcaption { font-size: .7rem; color: var(--muted); padding-top: 5px; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(82px + env(safe-area-inset-bottom)); transform: translate(-50%, 18px); width: min(calc(100% - 40px), 500px); background: var(--ink); color: white; padding: 13px 16px; border-radius: 14px; opacity: 0; pointer-events: none; transition: .25s; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.update-prompt { position: fixed; z-index: 300; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(calc(100% - 32px), 600px); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 20px 50px rgb(20 30 27 / 22%); }
.update-prompt strong { display: block; margin-bottom: 4px; }
.update-prompt p { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.update-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.update-actions button { min-height: 42px; padding: 8px 12px; }
.modal { position: fixed; inset: 0; z-index: 50; background: rgb(20 30 27 / 42%); display: grid; align-items: end; padding: 20px; }
.modal-card { width: min(100%, 600px); max-height: 90vh; overflow: auto; margin: 0 auto; background: var(--paper); padding: 24px; border-radius: 28px; box-shadow: 0 30px 70px rgb(0 0 0 / 20%); }
.install-note { display: flex; gap: 12px; align-items: start; }
.install-note span { font-size: 1.4rem; }
.encouragement-overlay { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom)); background: linear-gradient(160deg, rgb(220 232 225 / 96%), rgb(247 244 237 / 98%) 58%, rgb(246 229 218 / 96%)); overflow: auto; }
.encouragement-card { width: min(100%, 540px); text-align: center; padding: 28px 24px; }
.encouragement-mark { width: 76px; height: 76px; display: grid; place-items: center; margin: 0 auto 28px; border-radius: 50%; background: var(--surface); color: var(--green); font-size: 1.65rem; box-shadow: var(--shadow); }
.encouragement-card h2 { font-size: 1rem; color: var(--muted); font-weight: 600; margin-bottom: 26px; }
.encouragement-text { max-width: 16em; min-height: 4.4em; margin: 0 auto 34px; display: grid; place-items: center; color: var(--ink); font-family: ui-serif, "Songti TC", serif; font-size: clamp(1.7rem, 7vw, 2.45rem); line-height: 1.55; letter-spacing: .01em; text-wrap: balance; }
.encouragement-actions { width: min(100%, 360px); margin: 0 auto; }

@media (min-width: 600px) {
  .shell { padding-inline: 32px; }
  .decisions { grid-template-columns: repeat(5, 1fr); }
  .decision:last-child { grid-column: auto; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
  .update-prompt { align-items: stretch; flex-direction: column; }
  .update-actions { justify-content: flex-end; }
}

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