:root {
  color-scheme: light dark;
  --bg: #f0f3e9; --paper: #fbfcf6; --paper-soft: #edf3e4; --ink: #192b20;
  --muted: #4f6557; --line: #cbd9cd; --forest: #183728; --lime: #d7fc80;
  --accent: #326b45; --error: #8b2727; --track: #d7e4d4;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111b16; --paper: #1c2a22; --paper-soft: #263a29; --ink: #edf6ed;
    --muted: #b3c7b6; --line: #405749; --forest: #172d21;
    --accent: #c1ee83; --error: #ffabab; --track: #374b3e;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
.shell { max-width: 60rem; margin: auto; min-height: 100dvh; padding-bottom: max(2rem, env(safe-area-inset-bottom)); }
.header { display: flex; justify-content: space-between; align-items: center; width: 100%;
  background: var(--forest); color: white; padding: .65rem clamp(.75rem, 4vw, 2.2rem); gap: .5rem;
  border-bottom: 1px solid #314f3e; }
button, input, textarea { font: inherit; }
button { cursor: pointer; min-height: 44px; border-radius: .65rem; border: 1px solid transparent; color: inherit;
  padding: .58rem .85rem; transition: background-color .18s, transform .18s, box-shadow .18s; }
button:enabled:active { transform: translateY(1px); }
button:disabled { opacity: .46; cursor: default; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
.brand { display: flex; align-items: center; gap: .45rem; color: #f6fbf4; background: transparent;
  font: bold clamp(1.05rem, 4vw, 1.28rem) Georgia, serif; padding-left: 0; white-space: nowrap; }
.brand span { color: var(--lime); font: bold 1.25rem system-ui; }
nav { display: flex; gap: .12rem; }
nav button { color: #e0eede; background: transparent; font-size: .88rem; padding-inline: clamp(.35rem, 2vw, .75rem); }
nav button.selected { background: #365843; color: #fff; }
.page { padding: 1rem clamp(.85rem, 4vw, 2.2rem); animation: arrive .32s ease-out both; }
.page-head, .row, .goal-heading, .actions { display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.page-head { margin: 1.05rem 0; }
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
h1 { font: 2.1rem/1.05 Georgia, serif; letter-spacing: -.035em; }
h2 { font-size: 1.22rem; line-height: 1.27; }
h3 { font-size: 1rem; }
p { line-height: 1.55; }
.card { border: 1px solid var(--line); background: var(--paper); border-radius: 1.05rem; padding: clamp(1rem, 4vw, 1.6rem);
  min-width: 0; }
.goal-list { display: grid; gap: .9rem; }
.goal-list .card { animation: arrive .32s ease-out both; }
.goal-list .card:nth-child(2) { animation-delay: .04s; }
.goal-list .card:nth-child(3) { animation-delay: .08s; }
.goal-heading { align-items: start; }
.tag { color: var(--accent); font-size: .77rem; font-weight: 750; }
.goal-heading .tag { margin-bottom: .35rem; }
.percent { flex-shrink: 0; color: var(--accent); font: 1.6rem Georgia, serif; }
progress { display: block; width: 100%; height: .55rem; margin: .65rem 0; border: 0; border-radius: 1rem;
  appearance: none; overflow: hidden; background: var(--track); color: var(--accent); }
progress::-webkit-progress-bar { background: var(--track); }
progress::-webkit-progress-value { background: var(--accent); border-radius: 1rem; transition: width .26s ease; }
progress::-moz-progress-bar { background: var(--accent); }
.meta { color: var(--muted); font-size: .88rem; }
.next { background: var(--paper-soft); margin: .95rem 0 .55rem; padding: .95rem; border-radius: .75rem; }
.next h3, .next p { margin: .3rem 0; white-space: pre-line; }
details { border-top: 1px solid var(--line); }
details:first-of-type { margin-top: .65rem; }
summary { min-height: 44px; padding: .65rem 0; font-weight: 650; cursor: pointer; }
ul { padding-left: 1.25rem; margin: .35rem 0 .8rem; }
li { margin: .32rem 0; overflow-wrap: anywhere; }
a { color: var(--accent); }
.stage h3 span { color: var(--muted); font-weight: 400; }
.primary, .chosen { background: var(--lime); color: #17291d; font-weight: 760; border-color: #aed46d; }
.secondary { background: var(--paper-soft); border-color: var(--line); font-weight: 650; }
.quiet { background: transparent; padding-inline: .2rem; color: var(--accent); }
.compact { font-size: .9rem; }
.empty, .finish, .waiting { display: grid; gap: .8rem; justify-items: start; }
.empty p, .finish p, .waiting p { color: var(--muted); }
.empty-mark { display: grid; place-items: center; height: 2.4rem; width: 2.4rem; border-radius: .6rem;
  background: var(--paper-soft); color: var(--accent); font: bold 1.35rem system-ui; }
.wizard { max-width: 45rem; }
.wizard .actions { margin-top: 1rem; flex-wrap: wrap; }
.form-step { display: grid; gap: .6rem; margin-top: 1.15rem; animation: arrive .26s ease-out both; }
.form-step label:not([for="field-hint"]) { font: 1.55rem/1.18 Georgia, serif; }
textarea, input { width: 100%; border: 1px solid var(--line); color: var(--ink); background: var(--bg);
  border-radius: .65rem; padding: .8rem; min-height: 46px; font-size: 1rem; }
textarea { min-height: 6.5rem; resize: vertical; }
.form-step .quiet { justify-self: start; }
.presets { display: flex; flex-wrap: wrap; gap: .35rem; }
.notice { color: var(--muted); padding: .52rem 0; }
.notice.error { color: var(--error); font-weight: 650; }
.large { font-size: 1.65rem; font-weight: 700; margin: .6rem 0 .35rem; }
.large span { font-size: .92rem; color: var(--muted); font-weight: 500; }
.quota { margin-top: .85rem; padding: .65rem 0; border-top: 1px solid var(--line); }
.quota .row { flex-wrap: wrap; }
.spinner { width: 2rem; height: 2rem; border-radius: 50%; border: 3px solid var(--line);
  border-top-color: var(--accent); animation: spin .72s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 360px) {
  .header { padding-inline: .6rem; }
  .brand { gap: .25rem; }
  nav button { font-size: .81rem; }
  .page-head { align-items: start; flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
