:root {
  --bg: #f6f4ef; --card: #ffffff; --ink: #1d2a28; --muted: #5f6d6a; --line: #e2ddd2;
  --brand: #1f4d46; --brand-ink: #ffffff; --accent: #e0a43a; --danger: #b3412f; --ok: #2f7a4f;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #131b1a; --card: #1b2625; --ink: #eceae3; --muted: #9aa8a4; --line: #2b3836; --brand: #5fb3a5; --brand-ink: #0e1716; --accent: #e0a43a; --danger: #e5826f; --ok: #6cc08e; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
main { max-width: 720px; margin: 0 auto; padding: 12px 16px 24px; }
header.top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); padding: calc(8px + env(safe-area-inset-top)) 16px 8px; display: flex; align-items: center; gap: 8px; max-width: none; }
header.top h1 { font-size: 1.15rem; margin: 0; flex: 1; }
h2 { font-size: 1rem; margin: 22px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); font-size: .9rem; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 8px 12px; min-height: 40px; cursor: pointer; }
button.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
button.ghost { border-color: transparent; background: transparent; padding: 6px 8px; }
button.danger { color: var(--danger); }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 9px 11px; min-height: 42px; }
textarea { min-height: 84px; resize: vertical; }
label { display: block; font-size: .85rem; color: var(--muted); margin: 10px 0 4px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.check { width: 26px; height: 26px; min-height: 26px; padding: 0; border-radius: 50%; border: 2px solid var(--muted); flex: none; display: grid; place-items: center; }
.check.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.done .title { text-decoration: line-through; color: var(--muted); }
.title { font-weight: 500; overflow-wrap: anywhere; }
.chip { display: inline-block; font-size: .78rem; padding: 1px 8px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); margin-right: 4px; }
.chip.late { color: var(--danger); border-color: var(--danger); }
.chip.g { color: var(--brand); border-color: var(--brand); }
.prio1 { border-left: 4px solid var(--danger); } .prio3 { border-left: 4px solid var(--line); }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--ok); }
.nav { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; }
.nav strong { flex: 1; text-align: center; }
.add { display: flex; gap: 8px; margin: 8px 0; }
.add input { flex: 1; }
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom); z-index: 6; }
nav.tabs button { border: 0; border-radius: 0; background: transparent; min-height: 58px; font-size: .78rem; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
nav.tabs button span { font-size: 1.3rem; line-height: 1; }
nav.tabs button[aria-current="page"] { color: var(--brand); font-weight: 700; }
.weekgrid { display: grid; gap: 8px; }
.day { cursor: pointer; }
.day.today { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.day ul { margin: 6px 0 0; padding-left: 18px; font-size: .92rem; }
.login { max-width: 360px; margin: 18vh auto 0; padding: 0 16px; }
.err { color: var(--danger); min-height: 1.4em; }
.tl { border-left: 3px solid var(--brand); padding-left: 10px; margin: 8px 0; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); width: min(92vw, 460px); padding: 16px; }
dialog::backdrop { background: rgba(0,0,0,.45); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.seg button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
@media (prefers-reduced-motion: no-preference) { .bar > i { transition: width .3s; } }
.plant { width: 96px; height: 112px; flex: none; overflow: visible; }
.plant .stem { stroke-dasharray: var(--len); stroke-dashoffset: 0; }
.plant .sway { transform-box: view-box; transform-origin: 60px 124px; }
.plant .leaf, .plant .bloom { transform-box: fill-box; }
.plant .leaf.r { transform-origin: left bottom; } .plant .leaf.l { transform-origin: right bottom; } .plant .leaf.top { transform-origin: center bottom; }
.plant .bloom { transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  .plant .stem { stroke-dashoffset: var(--len); animation: draw 3s ease-out forwards; }
  .plant .leaf, .plant .bloom { transform: scale(0); animation: unfurl 1.4s ease-out forwards; }
  .plant .sway { animation: sway 8s ease-in-out 4s infinite alternate; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes unfurl { to { transform: scale(1); } }
@keyframes sway { from { transform: rotate(-1.6deg); } to { transform: rotate(1.6deg); } }
