@font-face { font-family: 'Young Serif'; src: url('fonts/young-serif-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Atkinson'; src: url('fonts/atkinson-hyperlegible-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Atkinson'; src: url('fonts/atkinson-hyperlegible-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Atkinson'; src: url('fonts/atkinson-hyperlegible-latin-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --glass: #e6eeec;        /* achtergrond: serreglas */
  --panel: #fafcfb;
  --panel-2: #f0f5f3;
  --ink: #17362c;          /* flessengroen */
  --ink-soft: #4f685e;
  --muted: #7a8e86;
  --line: #d3dfdb;
  --late: #b5384c;
  --late-bg: #f8e3e6;
  --ok: #2f7a55;
  --focus: #2f6fb0;
  --shadow: 0 1px 0 rgba(23, 54, 44, .06), 0 8px 24px -16px rgba(23, 54, 44, .35);
  --radius-l: 22px;
  --radius-m: 14px;
  --nav-h: 68px;
  --serif: 'Young Serif', Georgia, serif;
  --sans: 'Atkinson', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --glass: #0f1d19;
    --panel: #172a24;
    --panel-2: #1e342d;
    --ink: #e3eee9;
    --ink-soft: #b4c7bf;
    --muted: #89a097;
    --line: #2a433b;
    --late: #f08a99;
    --late-bg: #3a1e25;
    --ok: #6cc497;
    --focus: #8cc0f0;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--glass);
  color: var(--ink);
  font: 17px/1.45 var(--sans);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 2.1rem; line-height: 1.1; }
h2 { font-size: 1.45rem; line-height: 1.2; }
h3 { font-size: 1.15rem; line-height: 1.25; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.soft { color: var(--ink-soft); }
.small { font-size: .88rem; }
em.sci { font-style: italic; color: var(--ink-soft); }

/* ---------- layout ---------- */
#app { max-width: 680px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 18px) 16px calc(var(--nav-h) + 96px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; min-height: 44px; }
.topbar h1, .topbar h2 { flex: 1; }
.back { flex: none; }

.panel { background: var(--panel); border-radius: var(--radius-l); padding: 18px 18px 14px; box-shadow: var(--shadow); margin-bottom: 16px; }
.panel.flat { box-shadow: none; background: var(--panel-2); }
.panel h2 + * { margin-top: 10px; }

nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
nav.tabs .in { max-width: 680px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); height: var(--nav-h); }
nav.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: .78rem; }
nav.tabs a svg { width: 26px; height: 26px; }
nav.tabs a.on { color: var(--ink); font-weight: 700; }
nav.tabs a.on svg { background: var(--panel-2); border-radius: 12px; padding: 3px 14px; width: 54px; height: 32px; box-sizing: content-box; margin: -3px 0; }

.fab {
  position: fixed; z-index: 21; right: max(16px, calc(50vw - 340px + 16px)); bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom));
  width: 62px; height: 62px; border-radius: 22px; border: 0; background: var(--ink); color: var(--panel);
  display: grid; place-items: center; box-shadow: 0 10px 24px -10px rgba(23, 54, 44, .7); cursor: pointer;
}
.fab svg { width: 28px; height: 28px; }

/* ---------- knoppen & velden ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--panel-2); color: var(--ink); font-weight: 700; text-decoration: none; font-size: .95rem;
}
.btn.primary { background: var(--ink); color: var(--panel); }
.btn.danger { background: var(--late-bg); color: var(--late); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 20px; height: 20px; }
.iconbtn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink-soft); flex: none; }
.iconbtn svg { width: 24px; height: 24px; }
.iconbtn.filled { background: var(--panel); box-shadow: var(--shadow); color: var(--ink); }

.field { display: block; margin-bottom: 16px; }
label.field > span { display: block; font-size: .88rem; color: var(--ink-soft); margin-bottom: 5px; font-weight: 700; }
input[type=text], input[type=search], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--radius-m);
  border: 1px solid var(--line); background: var(--panel); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--focus); }
textarea { min-height: 90px; resize: vertical; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.stack > * + * { margin-top: 10px; }

.seg { display: inline-flex; background: var(--panel-2); border-radius: 999px; padding: 4px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 9px 18px; border-radius: 999px; cursor: pointer; color: var(--ink-soft); font-weight: 700; font-size: .95rem; }
.seg button.on { background: var(--ink); color: var(--panel); }
.seg.wide { display: flex; }
.seg.wide button { flex: 1; padding: 9px 6px; white-space: nowrap; font-size: .9rem; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--panel-2); font-size: .88rem; font-weight: 700; color: var(--ink-soft); border: 0; cursor: default; }
button.chip { cursor: pointer; }
button.chip.on { background: var(--ink); color: var(--panel); }
.chip svg { width: 16px; height: 16px; }

/* ---------- vandaag ---------- */
.hello { margin: 6px 0 18px; }
.hello h1 { margin-bottom: 8px; }
.hello .sum { font-size: 1.05rem; color: var(--ink-soft); max-width: 40ch; }
.hello .sum b { color: var(--ink); }
.hello .sum .lt { color: var(--late); }
.wx { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-m); background: var(--panel-2); font-size: .93rem; margin-bottom: 16px; color: var(--ink-soft); }
.wx svg { width: 22px; height: 22px; flex: none; color: var(--ink); }
.view-switch { display: flex; justify-content: center; margin: 4px 0 18px; }

.group { --c: var(--ink); }
.group-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.group-head h2 { flex: 1; }
.typeicon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); flex: none; }
.typeicon svg { width: 22px; height: 22px; }
.count { font-size: .85rem; color: var(--muted); font-weight: 700; }
.weather-note { font-size: .88rem; color: var(--ink-soft); background: var(--panel-2); border-radius: 10px; padding: 8px 12px; margin: 8px 0 4px; display: flex; gap: 10px; align-items: center; justify-content: space-between; }

.items { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); transition: opacity .35s, transform .35s; }
.item:last-child { border-bottom: 0; }
.item.gone { opacity: 0; transform: translateX(24px); }
.item .main { flex: 1; min-width: 0; cursor: pointer; }
.item .name { font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.item .sub { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.item .task-label { font-size: .92rem; color: var(--ink-soft); line-height: 1.3; margin: 1px 0 2px; }
.tabs-inline .seg { display: flex; }
.tabs-inline .seg button { flex: 1; padding: 9px 6px; white-space: nowrap; font-size: .9rem; }
.thumb { position: relative; width: 58px; height: 58px; flex: none; cursor: pointer; }
.thumb .img { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; background: var(--panel-2); display: grid; place-items: center; color: var(--muted); overflow: hidden; }
.thumb .img svg { width: 26px; height: 26px; }
.badge { position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); white-space: nowrap; font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--late-bg); color: var(--late); }
.badge.soon { background: var(--panel-2); color: var(--ink-soft); }

/* het afvinkrondje: vult zich met de kleur van de taak */
.check { position: relative; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ink); background: transparent; cursor: pointer; flex: none; overflow: hidden; padding: 0; }
.check::before { content: ''; position: absolute; left: -2px; right: -2px; bottom: -2px; height: 0; background: var(--c); transition: height .38s cubic-bezier(.3, .7, .3, 1); }
.check svg { position: relative; width: 24px; height: 24px; color: #fff; opacity: 0; transform: scale(.4); transition: opacity .2s .25s, transform .25s .25s; margin: auto; }
.check.done { border-color: var(--c); }
.check.done::before { height: calc(100% + 4px); }
.check.done svg { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .check::before, .check svg, .item { transition: none; }
}

.group-foot { display: flex; justify-content: center; gap: 10px; padding-top: 12px; flex-wrap: wrap; }

.date-head { font-family: var(--serif); font-size: 1.15rem; margin: 22px 4px 10px; color: var(--ink-soft); }
.date-head:first-child { margin-top: 0; }

.empty { text-align: center; padding: 36px 16px; color: var(--ink-soft); }
.empty svg { width: 64px; height: 64px; color: var(--ok); margin: 0 auto 12px; }
.empty h2 { margin-bottom: 8px; color: var(--ink); }

/* ---------- planten ---------- */
.searchbar { position: relative; margin-bottom: 16px; }
.searchbar svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); }
.searchbar input { padding-left: 44px; border-radius: 999px; }
.loc-head { display: flex; align-items: baseline; gap: 10px; margin: 22px 4px 10px; }
.loc-head h2 { font-size: 1.25rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pcard { background: var(--panel); border-radius: var(--radius-m); overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.pcard .ph { aspect-ratio: 1; background: var(--panel-2); display: grid; place-items: center; color: var(--muted); }
.pcard .ph img { width: 100%; height: 100%; object-fit: cover; }
.pcard .ph svg { width: 40px; height: 40px; }
.pcard .tx { padding: 10px 12px 12px; }
.pcard .nm { font-weight: 700; line-height: 1.2; }
.pcard .nx { font-size: .84rem; color: var(--muted); margin-top: 3px; }
.pcard .nx.lt { color: var(--late); font-weight: 700; }

/* ---------- plantdetail ---------- */
.hero { position: relative; margin: calc(-18px - env(safe-area-inset-top)) -16px 18px; height: min(62vw, 360px); background: var(--panel-2); overflow: hidden; }
.hero .strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; height: 100%; scrollbar-width: none; }
.hero .strip::-webkit-scrollbar { display: none; }
.hero .strip img { flex: none; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: start; }
.hero .noimg { height: 100%; display: grid; place-items: center; color: var(--muted); }
.hero .noimg svg { width: 64px; height: 64px; }
.hero .over { position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; justify-content: space-between; }
.hero .chips { position: absolute; bottom: 12px; right: 12px; left: 12px; justify-content: flex-end; }
.hero .chips .chip { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.hero .dots { position: absolute; bottom: 52px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.hero .dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .6); }
.pname h1 { font-size: 2.3rem; }
.pname .sci { font-size: 1.05rem; margin-top: 4px; }
.tabs-inline { margin: 18px 0; overflow-x: auto; }

.task { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task .main { flex: 1; min-width: 0; }
.task .t { font-weight: 700; }
.task .s { font-size: .88rem; color: var(--muted); }
.task .s.lt { color: var(--late); font-weight: 700; }
.task.off { opacity: .55; }

.care dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.care dt { color: var(--muted); font-size: .9rem; }
.care dd { margin: 0; }
.tox { padding: 10px 14px; border-radius: var(--radius-m); background: var(--late-bg); color: var(--late); font-weight: 700; font-size: .92rem; margin-bottom: 14px; }
.tox.safe { background: var(--panel-2); color: var(--ok); }

.loglist { list-style: none; margin: 0; padding: 0; }
.loglist li { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: center; }
.loglist li:last-child { border-bottom: 0; }
.loglist .d { width: 88px; flex: none; color: var(--muted); font-size: .9rem; }
.loglist .skip { color: var(--muted); font-style: italic; }

.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photos figure { margin: 0; position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--panel-2); }
.photos img { width: 100%; height: 100%; object-fit: cover; }
.photos figcaption { position: absolute; bottom: 0; left: 0; right: 0; font-size: .72rem; padding: 3px 6px; background: rgba(0, 0, 0, .45); color: #fff; display: flex; justify-content: space-between; }
.photos figure.cover { outline: 3px solid var(--ok); outline-offset: -3px; }

/* maandstrook: toont in welke maanden een taak actief is */
.months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; margin-top: 6px; max-width: 320px; }
.months span { font-size: .66rem; text-align: center; padding: 2px 0; border-radius: 4px; color: var(--muted); background: var(--panel-2); font-weight: 700; }
.months span.on { background: color-mix(in srgb, var(--c, var(--ok)) 32%, transparent); color: var(--ink); }
.months span.now { outline: 1.5px solid var(--ink); outline-offset: -1.5px; }

/* ---------- herkenning ---------- */
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius-l); min-height: 220px; display: grid; place-items: center; text-align: center; padding: 18px; cursor: pointer; background: var(--panel); position: relative; overflow: hidden; }
.dropzone img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dropzone svg { width: 46px; height: 46px; color: var(--ink-soft); margin: 0 auto 8px; }
.suggest { list-style: none; padding: 0; margin: 0; }
.suggest li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.suggest li:last-child { border-bottom: 0; }
.suggest .main { flex: 1; min-width: 0; }
.score { width: 52px; flex: none; text-align: right; font-weight: 700; }
.bar { height: 5px; border-radius: 3px; background: var(--panel-2); margin-top: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ok); }
.picklist { max-height: 46vh; overflow-y: auto; margin-top: 10px; border-radius: var(--radius-m); border: 1px solid var(--line); background: var(--panel); }
.picklist button { display: block; width: 100%; text-align: left; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; }
.picklist button:last-child { border-bottom: 0; }
.picklist button.on { background: var(--panel-2); }
.picklist .cat { float: right; font-size: .78rem; color: var(--muted); }

/* ---------- dialoog ---------- */
dialog { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100%; margin: auto 0 0; }
dialog::backdrop { background: rgba(10, 25, 20, .45); }
dialog .sheet { background: var(--panel); border-radius: 24px 24px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); max-width: 680px; margin: 0 auto; max-height: 92vh; overflow-y: auto; }
dialog .sheet h2 { margin-bottom: 14px; }
dialog .actions { display: flex; gap: 10px; margin-top: 18px; }
dialog .actions > * { flex: 1; }
@media (min-width: 720px) {
  dialog { margin: auto; }
  dialog .sheet { border-radius: 24px; }
}
.monthgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.monthgrid label { display: flex; flex-direction: column; gap: 3px; font-size: .82rem; color: var(--ink-soft); font-weight: 700; }
.monthgrid input { min-height: 40px; padding: 6px 10px; }
.monthpick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.monthpick button { min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-weight: 700; font-size: .85rem; }
.monthpick button.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.steps { padding-left: 1.3em; margin: 8px 0 0; }
.steps li { margin-bottom: 6px; }

/* ---------- toast ---------- */
.toast { position: fixed; z-index: 50; left: 16px; right: 16px; bottom: calc(var(--nav-h) + 92px + env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto; background: var(--ink); color: var(--panel); border-radius: 16px; padding: 12px 12px 12px 18px; display: flex; align-items: center; gap: 12px; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); }
.toast span { flex: 1; }
.toast button { background: transparent; color: inherit; border: 1px solid currentColor; border-radius: 999px; padding: 6px 14px; font-weight: 700; cursor: pointer; }

/* ---------- login ---------- */
.login { min-height: 80vh; display: grid; place-items: center; }
.login form { width: 100%; max-width: 360px; }
.login .mark { width: 72px; height: 72px; color: var(--ok); margin-bottom: 16px; }
.login h1 { margin-bottom: 6px; }
.err { color: var(--late); font-weight: 700; margin: 8px 0; }

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain > li { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-plain > li:last-child { border-bottom: 0; }
.list-plain .main { flex: 1; min-width: 0; }
pre.code { background: var(--panel-2); padding: 12px; border-radius: 10px; overflow-x: auto; font-size: .8rem; line-height: 1.4; }
.spin { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: sp 0.8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes sp { to { transform: rotate(360deg); } }
code { overflow-wrap: anywhere; font-size: .88em; }
