/* Leafy: calm, simple, two looks from the same five colours. */
:root, [data-look='dark'] {
  --bg: #0D0B33; --surface: #1A1648; --surface2: #221D57; --line: #2C2660;
  --text: #E7C9E7; --muted: #A99CCB; --accent: #C366A8; --accent-text: #C366A8; --on-accent: #0D0B33;
  --icon: #8A80D6; --sel: #4C2F6F; --sel-text: #E7C9E7; --preview: #E7C9E7; --preview-text: #0D0B33;
  color-scheme: dark;
}
[data-look='light'] {
  --bg: #FAF5FA; --surface: #FFFFFF; --surface2: #F4EAF4; --line: #E7C9E7;
  --text: #0D0B33; --muted: #6E5E8C; --accent: #C366A8; --accent-text: #9C3F84; --on-accent: #0D0B33;
  --icon: #5248A0; --sel: #4C2F6F; --sel-text: #FFFFFF; --preview: #4C2F6F; --preview-text: #FFFFFF;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: 'Atkinson Hyperlegible Next', system-ui, sans-serif; font-size: 16px; line-height: 1.4;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) { button, a { transition: background-color .15s, color .15s; } }

.page {
  max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; gap: 14px;
  padding: calc(14px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
}
.center { justify-content: center; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; }
.back { height: 44px; display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--muted); text-decoration: none; }

h1 { margin: 0; font-size: 32px; line-height: 1.1; font-weight: 600; }
h2 { margin: 0; font-size: 18px; font-weight: 600; }
.sub { color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.heading { display: flex; flex-direction: column; gap: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.card { background: var(--surface); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.list { background: var(--surface); border-radius: 20px; padding: 2px 16px; display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.row + .row { border-top: 1px solid var(--line); }
.row .grow { flex: 1; min-width: 0; }
.plant-link { color: inherit; text-decoration: none; min-height: 58px; }
.plant-link .name { font-size: 17px; font-weight: 600; display: block; }
.status { font-size: 15px; color: var(--muted); display: block; }
.status.due { color: var(--accent-text); font-weight: 600; }
.task-label { font-size: 17px; }
.task-label.done { color: var(--muted); text-decoration: line-through; }
.chip { width: 40px; height: 40px; border-radius: 12px; background: var(--surface2); color: var(--icon); display: grid; place-items: center; flex-shrink: 0; }
.card h2 { display: flex; align-items: center; gap: 10px; }
.card h2 .chip { width: 36px; height: 36px; border-radius: 10px; }

.btn {
  height: 44px; padding: 0 18px; border-radius: 12px; border: 0; background: var(--accent); color: var(--on-accent);
  font-size: 16px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none;
}
.btn.quiet { background: var(--surface2); color: var(--muted); font-weight: 400; font-size: 15px; padding: 0 14px; }
.btn.plain { background: var(--surface); color: var(--text); }
.btn.big { height: 52px; border-radius: 14px; width: 100%; }
.btn:disabled { background: var(--surface); color: var(--muted); cursor: default; font-weight: 400; }
.link-btn { height: 44px; border: 0; background: transparent; color: var(--accent-text); cursor: pointer; padding: 0; align-self: flex-start; font-size: 15px; }
.bottom { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.seg > * {
  height: 40px; border-radius: 10px; background: var(--surface2); color: var(--muted); display: grid; place-items: center;
  font-size: 15px; border: 0; cursor: pointer;
}
.seg > .on { background: var(--sel); color: var(--sel-text); font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--sel-text); }
.seg.boxed { background: var(--surface2); border-radius: 12px; padding: 4px; }
.seg.boxed > * { height: 44px; border-radius: 9px; background: transparent; }
.seg.boxed > .on { background: var(--sel); box-shadow: none; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { font-size: 15px; color: var(--muted); }
.input {
  min-height: 48px; border-radius: 12px; border: 0; background: var(--surface2); padding: 0 12px; font-size: 16px; width: 100%;
}
textarea.input { padding: 12px; min-height: 76px; resize: vertical; }
.inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inline .input { width: auto; }
.search { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 14px; padding: 0 14px; color: var(--muted); }
.search input { flex: 1; min-width: 0; height: 48px; border: 0; background: transparent; color: var(--text); font-size: 16px; }
.search input:focus { outline: none; }
.search:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.pick { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; cursor: pointer; font-size: 17px; }
.pick + .pick { border-top: 1px solid var(--line); }
.pick input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); flex-shrink: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

.switch { width: 60px; height: 44px; border: 0; background: transparent; padding: 0; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.switch .track { width: 50px; height: 30px; border-radius: 15px; display: flex; align-items: center; padding: 3px; background: var(--line); justify-content: flex-start; }
.switch .knob { width: 24px; height: 24px; border-radius: 12px; background: var(--muted); }
.switch[aria-checked='true'] .track { background: var(--accent); justify-content: flex-end; }
.switch[aria-checked='true'] .knob { background: var(--on-accent); }
.time { height: 44px; border-radius: 12px; border: 0; background: var(--surface2); font-size: 17px; padding: 0 12px; }

.preview { background: var(--preview); color: var(--preview-text); border-radius: 20px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; }
.preview .mark { width: 38px; height: 38px; border-radius: 10px; background: var(--sel); color: var(--sel-text); display: grid; place-items: center; flex-shrink: 0; }
.preview .meta { display: flex; justify-content: space-between; font-size: 12px; opacity: .85; }
.preview .line { font-weight: 600; }
.error { color: var(--accent-text); font-size: 15px; }
.confirm { background: var(--surface); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
