:root {
  --bg: #f4f6f3; --card: #ffffff; --ink: #1d2521; --muted: #6c7770; --line: #e3e8e4;
  --accent: #2f8f5b; --accent-soft: #e2f2e8; --danger: #c8553d; --warn-bg: #fff4e0; --warn-ink: #7a5a12;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, textarea { font-family: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app { max-width: 480px; margin: 0 auto; min-height: 100vh; padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) calc(96px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
header { padding: 18px 0 12px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
header h1 { font-size: 28px; margin: 0; letter-spacing: -0.02em; }
header .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.weeknav { display: flex; gap: 6px; }
.iconbtn { border: 1px solid var(--line); background: var(--card); min-width: 38px; height: 38px; border-radius: 11px; font-size: 17px; cursor: pointer; color: var(--ink); }
#todayBtn { font-size: 9px; color: var(--accent); }

.hint { background: var(--accent-soft); color: #1f5e3c; border-radius: 14px; padding: 11px 40px 11px 14px; font-size: 13px; margin-bottom: 12px; position: relative; line-height: 1.45; }
.hint button { position: absolute; top: 6px; right: 6px; border: 0; background: none; font-size: 16px; color: inherit; padding: 6px; cursor: pointer; }

.day { background: var(--card); border-radius: 16px; padding: 12px; margin-bottom: 10px; display: flex; gap: 12px; align-items: center; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.day.today { box-shadow: 0 0 0 2px var(--accent); }
.day.filled { cursor: pointer; }
.daylabel { width: 40px; text-align: center; flex-shrink: 0; }
.daylabel b { display: block; font-size: 15px; }
.daylabel span { font-size: 12px; color: var(--muted); }
.thumb { width: 54px; height: 54px; border-radius: 12px; display: grid; place-items: center; font-size: 28px; flex-shrink: 0; }
.rinfo { flex: 1; min-width: 0; }
.rinfo .t { font-weight: 600; font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; }
.rinfo .m { color: var(--muted); font-size: 13px; margin-top: 3px; }
.rinfo .m.warn { color: #a06a00; }
.add { flex: 1; border: 1.5px dashed #c7d1ca; border-radius: 12px; background: transparent; padding: 17px 14px; color: var(--accent); font-weight: 600; font-size: 14px; cursor: pointer; text-align: left; }
.more { background: none; border: 0; font-size: 20px; color: var(--muted); cursor: pointer; padding: 8px 4px; }

nav.tabs { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); display: flex; justify-content: center; padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); z-index: 5; }
nav.tabs .inner { max-width: 480px; width: 100%; display: flex; }
nav.tabs button { flex: 1; border: 0; background: none; padding: 9px 0 10px; font-size: 12px; font-weight: 500; color: var(--muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; position: relative; }
nav.tabs button .ic { font-size: 22px; }
nav.tabs button.on { color: var(--accent); font-weight: 700; }
.badge { position: absolute; top: 5px; left: 54%; background: var(--accent); color: #fff; font-size: 10px; border-radius: 10px; padding: 1px 6px; }

/* Boodschappen */
.progress { background: var(--card); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.progress .row { display: flex; justify-content: space-between; font-size: 14px; }
.bar { height: 8px; border-radius: 8px; background: var(--line); margin-top: 10px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 13px; font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.switch { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; }
.switch .tr { width: 36px; height: 22px; border-radius: 22px; background: #cfd6d1; position: relative; transition: .2s; }
.switch .tr::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + .tr { background: var(--accent); }
.switch input:checked + .tr::after { left: 16px; }
.linkbtn { border: 0; background: none; color: var(--muted); text-decoration: underline; font-size: 13px; cursor: pointer; padding: 4px; }
.group h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 4px 6px; }
.list { background: var(--card); border-radius: 16px; overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; color: inherit; font-size: inherit; }
.item:last-child { border-bottom: 0; }
.cb { width: 23px; height: 23px; border-radius: 7px; border: 2px solid #c3ccc6; flex-shrink: 0; display: grid; place-items: center; color: #fff; font-size: 13px; }
.item.done .cb { background: var(--accent); border-color: var(--accent); }
.item .nm { flex: 1; font-size: 15px; min-width: 0; }
.item.done .nm { text-decoration: line-through; color: var(--muted); }
.item .days { font-size: 11px; color: var(--muted); }
.item .q { font-size: 13px; color: var(--muted); white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 36px 10px; line-height: 1.5; }
.warnbox { background: var(--warn-bg); color: var(--warn-ink); border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; line-height: 1.45; }

/* Receptpagina */
.back { border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 16px; padding: 18px 0 12px; cursor: pointer; }
.hero { height: 160px; border-radius: 20px; display: grid; place-items: center; font-size: 80px; }
.rday { margin-top: 16px; font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.rtitle { font-size: 24px; line-height: 1.2; margin: 4px 0 8px; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.btn { display: block; width: 100%; text-align: center; margin-top: 10px; padding: 13px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btnrow { display: flex; gap: 8px; }
.btnrow .btn { flex: 1; }
.rsec h3 { font-size: 18px; margin: 26px 0 10px; display: flex; justify-content: space-between; align-items: baseline; }
.rsec h3 button { border: 0; background: none; color: var(--accent); font-size: 14px; font-weight: 600; cursor: pointer; padding: 4px; }
.ing { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.ing:last-child { border-bottom: 0; }
.catdot { border: 0; background: none; padding: 6px; margin: -6px; cursor: pointer; display: grid; place-items: center; }
.catdot i { width: 12px; height: 12px; border-radius: 50%; display: block; }
.ing .n { flex: 1; font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
.ing .n small { margin-left: 6px; font-size: 11px; color: var(--accent); background: var(--accent-soft); padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.ing .q { color: var(--muted); font-size: 14px; white-space: nowrap; }
.steps { list-style: none; counter-reset: st; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { counter-increment: st; background: var(--card); border-radius: 14px; padding: 12px 14px 12px 50px; position: relative; font-size: 15px; line-height: 1.5; }
.steps li::before { content: counter(st); position: absolute; left: 14px; top: 12px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.howto { background: var(--card); border-radius: 16px; padding: 14px 16px; font-size: 14px; line-height: 1.5; }
.howto ol { margin: 6px 0 4px; padding-left: 20px; }
.legend { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* Sheet */
.scrim { position: fixed; inset: 0; background: rgba(20,30,25,.4); display: none; align-items: flex-end; justify-content: center; z-index: 10; }
.scrim.open { display: flex; }
.sheet { background: var(--card); width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 10px max(18px, env(safe-area-inset-right, 0px)) calc(22px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px)); animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
.grab { width: 40px; height: 4px; background: var(--line); border-radius: 4px; margin: 0 auto 14px; }
.sheet h2 { margin: 0 0 4px; font-size: 19px; }
.sheet p { margin: 0 0 14px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.or { text-align: center; color: var(--muted); font-size: 12px; margin: 12px 0; }
.field { display: flex; gap: 8px; }
input[type=text], input[type=password], textarea { width: 100%; padding: 13px; border: 1px solid var(--line); border-radius: 12px; font-size: 16px; background: #fff; color: var(--ink); min-width: 0; }
textarea { min-height: 140px; resize: vertical; line-height: 1.45; }
.field button { padding: 0 16px; border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent); border-radius: 12px; font-weight: 600; font-size: 15px; cursor: pointer; }
.sheet label.lbl { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
.msg { font-size: 13px; margin-top: 10px; min-height: 18px; color: var(--muted); }
.msg.err { color: var(--danger); }
.menu button, .menu a { display: block; width: 100%; text-align: left; padding: 15px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; font-size: 16px; cursor: pointer; color: var(--ink); text-decoration: none; }
.menu .del { color: var(--danger); border-bottom: 0; }

.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(10px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; transition: .25s; pointer-events: none; z-index: 30; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.foot { font-size: 12px; color: var(--muted); text-align: center; margin: 20px 0 0; }
.foot a { color: var(--muted); }

/* Toegangsscherm */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); }
.gate-card { background: var(--card); border-radius: 24px; padding: 28px 22px; width: 100%; max-width: 380px; text-align: center; box-shadow: 0 6px 24px rgba(0,0,0,.06); }
.gate-card img { border-radius: 18px; }
.gate-card h1 { margin: 12px 0 6px; font-size: 24px; }
.gate-card p { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 16px; }
.gate-card input { margin-bottom: 10px; text-align: center; }
.gate-card button { width: 100%; padding: 14px; border: 0; border-radius: 14px; background: var(--accent); color: #fff; font-weight: 600; font-size: 16px; cursor: pointer; }
.loading { text-align: center; color: var(--muted); padding: 40px 0; }
