/* ==========================================================================
   Tidey — ontwerp (herontwerp september 2026)
   Rustig en warm: zandkleurige ondergrond, pasteltinten per soort registratie,
   grote lichte cijfers. 's Nachts gedimde, warme kleuren zonder fel wit.
   Lettertype: Hanken Grotesk (SIL OFL), meegeleverd zodat het ook offline werkt.
   ========================================================================== */

@font-face {
  font-family: 'Hanken Grotesk';
  src: url('../fonts/hanken-grotesk.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #F4EFE8;
  --bg-deco: #EDE6DC;
  --surface: #FFFCF7;
  --surface-2: #F1EBE2;
  --line: #EAE3D8;
  --ink: #1F1D1A;
  --ink-2: #3F3B36;
  --muted: #5C564F;
  --accent: #1F1D1A;       /* primaire knop */
  --accent-ink: #FFFCF7;
  --accent-soft: #EAE3D8;
  --link: #35577A;
  --plus: #F2B98C; --plus-ink: #1F1D1A;
  --nav: #1F1D1A; --nav-active: #F4EFE8; --nav-active-ink: #1F1D1A; --nav-ink: #CFC8BD;
  --danger: #A6453B;
  --ok: #3D6B44;

  /* per soort: zachte achtergrond + diepe voorgrond */
  --feed-bg: #F7DCC2;   --feed: #8A4A1F;
  --bottle-bg: #F3E6D6; --bottle: #7A5230;
  --pump-bg: #E2DAF2;   --pump: #5B4A8C;
  --growth-bg: #F3E4B0; --growth: #7A5E14;
  --health-bg: #D9E9E4; --health: #2F6457;
  --sleep-bg: #D4E2EA;  --sleep: #35577A;
  --diaper-bg: #D6E5D3; --diaper: #3D6B44;
  --fussy-bg: #F3D6D2;  --fussy: #A6453B;
  --alarm-bg: #D4E2EA;  --alarm: #35577A;

  /* grafiek */
  --viz-feed: #D98A4E; --viz-diaper: #5E9A69; --viz-sleep: #9DBBD8; --viz-pump: #8C79C4;
  --viz-growth: #A8841F; --viz-temp: #2F6457;

  /* kans op onrust: één tint, licht → donker */
  --risk-0: #F1EBE2;
  --risk-1: #F0CFCA;
  --risk-2: #E6B8B0;
  --risk-3: #DDA39A;
  --risk-4: #B5564B;

  --r-xl: 32px;
  --r-lg: 28px;
  --r-md: 24px;
  --r-sm: 16px;
  --shadow: none;
  --tabbar-h: 68px;
  --hero-sky: #F4EFE8;
  --display: 'Hanken Grotesk', -apple-system, 'Helvetica Neue', system-ui, sans-serif;
  --text: 'Hanken Grotesk', -apple-system, 'Helvetica Neue', system-ui, sans-serif;
}

/* Donker: volgt de telefoon, tenzij de app zelf licht of donker kiest
   (automatisch 's nachts, of vast in Instellingen → Weergave). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #121317;
    --bg-deco: #17181d;
    --surface: #1C1D22;
    --surface-2: #24252B;
    --line: #2A2B31;
    --ink: #E6E0D6;
    --ink-2: #BDB7AD;
    --muted: #AAA59C;
    --accent: #F0B98A;       /* primaire knop: warm, geen fel wit */
    --accent-ink: #2A1E16;
    --accent-soft: #2E2F36;
    --link: #9DBBD8;
    --plus: #F0B98A; --plus-ink: #2A1E16;
    --nav: #24252B; --nav-active: #3A3B42; --nav-active-ink: #E6E0D6; --nav-ink: #9A958C;
    --danger: #D98A80;
    --ok: #9CC6A2;
    --feed-bg: #3A2C22;   --feed: #F0B98A;
    --bottle-bg: #302A24; --bottle: #E2BE96;
    --pump-bg: #2C2638;   --pump: #B9A8E0;
    --growth-bg: #33301F; --growth: #D9C98A;
    --health-bg: #1F2D2A; --health: #9CCBBE;
    --sleep-bg: #222C38;  --sleep: #9DBBD8;
    --diaper-bg: #24302A; --diaper: #9CC6A2;
    --fussy-bg: #3A2B2B;  --fussy: #D98A80;
    --alarm-bg: #222C38;  --alarm: #9DBBD8;
    --viz-feed: #D98A4E; --viz-diaper: #7FB88A; --viz-sleep: #7FA3C8; --viz-pump: #A893D6;
    --viz-growth: #D9C98A; --viz-temp: #9CCBBE;
    --risk-0: #26272D;
    --risk-1: #3A2B2B;
    --risk-2: #5A3A36;
    --risk-3: #7A4A45;
    --risk-4: #D98A80;
    --shadow: none;
    --hero-sky: #121317;
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #121317;
  --bg-deco: #17181d;
  --surface: #1C1D22;
  --surface-2: #24252B;
  --line: #2A2B31;
  --ink: #E6E0D6;
  --ink-2: #BDB7AD;
  --muted: #AAA59C;
  --accent: #F0B98A;     /* primaire knop: warm, geen fel wit */
  --accent-ink: #2A1E16;
  --accent-soft: #2E2F36;
  --link: #9DBBD8;
  --plus: #F0B98A; --plus-ink: #2A1E16;
  --nav: #24252B; --nav-active: #3A3B42; --nav-active-ink: #E6E0D6; --nav-ink: #9A958C;
  --danger: #D98A80;
  --ok: #9CC6A2;
  --feed-bg: #3A2C22;   --feed: #F0B98A;
  --bottle-bg: #302A24; --bottle: #E2BE96;
  --pump-bg: #2C2638;   --pump: #B9A8E0;
  --growth-bg: #33301F; --growth: #D9C98A;
  --health-bg: #1F2D2A; --health: #9CCBBE;
  --sleep-bg: #222C38;  --sleep: #9DBBD8;
  --diaper-bg: #24302A; --diaper: #9CC6A2;
  --fussy-bg: #3A2B2B;  --fussy: #D98A80;
  --alarm-bg: #222C38;  --alarm: #9DBBD8;
  --viz-feed: #D98A4E; --viz-diaper: #7FB88A; --viz-sleep: #7FA3C8; --viz-pump: #A893D6;
  --viz-growth: #D9C98A; --viz-temp: #9CCBBE;
  --risk-0: #26272D;
  --risk-1: #3A2B2B;
  --risk-2: #5A3A36;
  --risk-3: #7A4A45;
  --risk-4: #D98A80;
  --shadow: none;
  --hero-sky: #121317;
}

/* ---------- basis ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--text);
  font-weight: 400;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 20px);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 28px; line-height: 1.1; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }
.icon { width: 24px; height: 24px; display: block; flex-shrink: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.error { color: var(--danger); }

/* categoriekleuren: zet --c / --c-bg voor iconen en accenten */
.cat-feed   { --c: var(--feed);   --c-bg: var(--feed-bg); }
.cat-pump   { --c: var(--pump);   --c-bg: var(--pump-bg); }
.cat-sleep  { --c: var(--sleep);  --c-bg: var(--sleep-bg); }
.cat-diaper { --c: var(--diaper); --c-bg: var(--diaper-bg); }
.cat-fussy  { --c: var(--fussy);  --c-bg: var(--fussy-bg); }
.cat-alarm  { --c: var(--alarm);  --c-bg: var(--alarm-bg); }
.cat-growth { --c: var(--growth); --c-bg: var(--growth-bg); }
.cat-health { --c: var(--health); --c-bg: var(--health-bg); }

/* het icoon-blokje dat overal terugkomt */
.ico {
  display: grid; place-items: center; flex-shrink: 0;
  width: 44px; height: 44px; border-radius: 15px;
  background: var(--c-bg, var(--surface-2)); color: var(--c, var(--ink-2));
}

/* ---------- kop ---------- */
.topbar {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 640px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 18px) 20px 14px;
}
.who { position: relative; display: flex; align-items: center; gap: 14px; min-width: 0; }
.who .hello { font-size: 13px; color: var(--muted); font-weight: 500; margin: 0 0 1px; letter-spacing: 0.01em; }
.who p { margin: 2px 0 0; font-size: 14px; color: var(--ink-2); }
.avatar {
  flex-shrink: 0; width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--sleep-bg) center / cover no-repeat;
  color: var(--sleep);
  display: grid; place-items: center;
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--line);
}
.avatar .initial { font-family: var(--display); font-size: 26px; font-weight: 300; letter-spacing: -0.02em; line-height: 1; }
.avatar.lg .initial { font-size: 42px; }
.avatar .icon { width: 30px; height: 30px; }
.avatar.has-photo > * { display: none; }
.avatar.lg { width: 96px; height: 96px; }
.avatar.lg .icon { width: 46px; height: 46px; }

.sync {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  padding: 7px 12px; border-radius: 999px; border: 0;
  background: var(--surface); box-shadow: var(--shadow);
  font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.sync.on i { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.sync.busy i { background: var(--accent); }

main { max-width: 640px; margin: 0 auto; padding: 0 16px; }
.view { display: none; }
.view.active { display: block; animation: fade 0.18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .view.active { animation: none; } }
.page-title { font-size: 52px; font-weight: 300; letter-spacing: -2px; line-height: 1; margin: 8px 4px 18px; }

/* ---------- kaarten ---------- */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 20px;
  margin: 12px 0;
  box-shadow: var(--shadow);
}
.card h2 + * { margin-top: 10px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
}
.badge .icon { width: 14px; height: 14px; }
.section-title { margin: 28px 4px 12px; font-size: 20px; font-weight: 500; color: var(--ink); }
.empty { color: var(--muted); font-size: 15px; padding: 6px 0; }

/* ---------- voorspellingen ---------- */
.pred { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; padding: 14px 0; }
.pred .body { min-width: 0; }
.pred .value-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pred + .pred { border-top: 1px solid var(--line); }
.pred .label { font-size: 13.5px; color: var(--ink-2); font-weight: 600; }
.pred .value { font-family: var(--display); font-size: 22px; font-weight: 500; line-height: 1.2; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pred .sub { font-size: 13px; color: var(--muted); }
.pred .rel { font-size: 13px; font-weight: 600; color: var(--c); white-space: nowrap; background: var(--c-bg); padding: 4px 10px; border-radius: 999px; }
.pred.highlight .value { color: var(--fussy); }
.conf { display: inline-flex; gap: 3px; }
.conf i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.conf i.on { background: var(--accent); }

.timeline { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.timeline-title { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.strip { position: relative; display: grid; grid-template-columns: repeat(48, 1fr); gap: 2px; height: 34px; }
.strip .slot { border-radius: 4px; background: var(--risk-0); }
.strip .slot[data-l='1'] { background: var(--risk-1); }
.strip .slot[data-l='2'] { background: var(--risk-2); }
.strip .slot[data-l='3'] { background: var(--risk-3); }
.strip .slot[data-l='4'] { background: var(--risk-4); }
.marks { position: relative; height: 20px; margin-top: 4px; }
.marks .m {
  position: absolute; top: 0; transform: translateX(-50%);
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--feed-bg); color: var(--feed); display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.marks .m .icon { width: 12px; height: 12px; }
.marks .sleepband { position: absolute; top: 6px; height: 4px; border-radius: 2px; background: var(--sleep); opacity: 0.75; }
.axis { position: relative; height: 16px; font-size: 11px; font-weight: 600; color: var(--muted); }
.axis span { position: absolute; transform: translateX(-50%); }
.axis span:first-child { transform: none; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-top: 8px; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 5px; }
.legend .sw.dot { border-radius: 50%; }
.tip {
  position: fixed; z-index: 30; pointer-events: none;
  background: var(--ink); color: var(--bg);
  font-size: 13px; padding: 7px 10px; border-radius: 10px; max-width: 240px;
  transform: translate(-50%, calc(-100% - 10px));
}
.why { margin-top: 12px; font-size: 14px; color: var(--ink-2); }
.why summary { cursor: pointer; color: var(--accent); font-weight: 600; list-style: none; display: flex; align-items: center; min-height: 44px; }
.why summary::-webkit-details-marker { display: none; }
.why summary::after { content: ' ›'; }
.why[open] summary::after { content: ' ⌄'; }
.why ul { padding-left: 18px; margin: 8px 0 0; }
.why li { margin: 5px 0; }

/* ---------- snel toevoegen ---------- */
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.action {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 6px 14px; border: 0; border-radius: var(--r-md);
  background: var(--surface); box-shadow: var(--shadow);
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  transition: transform 0.12s ease;
}
.action .ico { width: 52px; height: 52px; border-radius: 18px; }
.action .ico .icon { width: 28px; height: 28px; }
.action:active { transform: scale(0.96); }

/* ---------- lopende timers ---------- */
.running { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 12px 14px; background: var(--c-bg); box-shadow: none; }
.running .ico { background: var(--surface); }
.running .what { font-size: 13.5px; font-weight: 600; color: var(--c); }
.running .timer { font-family: var(--display); font-size: 30px; font-weight: 300; letter-spacing: -0.02em; line-height: 1.1; color: var(--ink); }
/* knoppen over de volle breedte en minstens 48 px hoog; "Stop" apart van "Wissel kant" */
.running .btns { grid-column: 1 / -1; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.running .btn { background: var(--surface); min-height: 48px; padding: 10px 8px; }
.running .btn.primary { margin-left: 8px; }
.running .btn.primary { background: var(--c); color: var(--surface); }

/* ---------- lijsten ---------- */
.list-card { padding: 6px 16px; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 10px 0; width: 100%;
  border: 0; background: none; text-align: left;
}
.row + .row { border-top: 1px solid var(--line); }
.row .ico { width: 40px; height: 40px; border-radius: 13px; }
.row .ico .icon { width: 22px; height: 22px; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 600; }
.row .detail { font-size: 13px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.row .time { font-size: 13.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.day-head { margin: 20px 6px 6px; font-size: 14px; color: var(--ink-2); display: flex; justify-content: space-between; align-items: baseline; }
.day-head b { font-family: var(--display); font-weight: 500; font-size: 17px; color: var(--ink); text-transform: capitalize; }
.next-side { margin: 8px 0; font-size: 14px; color: var(--muted); }

.filter { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.filter::-webkit-scrollbar { display: none; }
.chip {
  border: 0; background: var(--surface); box-shadow: var(--shadow);
  border-radius: 999px; padding: 8px 14px; min-height: 44px; font-size: 14px; font-weight: 600; white-space: nowrap; color: var(--ink-2);
}
.chip.active { background: var(--ink); color: var(--bg); }

/* ---------- inzichten ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--c-bg, var(--surface-2)); border-radius: var(--r-md); padding: 14px; }
.stat .k { font-size: 13px; font-weight: 600; color: var(--c, var(--ink-2)); }
.stat .v { font-family: var(--display); font-size: 24px; font-weight: 300; letter-spacing: -0.02em; white-space: nowrap; }
.stat .d { font-size: 12px; color: var(--ink-2); opacity: 0.8; }
.bars { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 8px; align-items: end; height: 120px; margin-top: 14px; }
.bars .bar-col { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.bars .bar { background: var(--c, var(--feed)); border-radius: 6px 6px 2px 2px; min-height: 3px; }
.bars.sleep .bar { background: var(--sleep); }
.bars.hours { gap: 3px; }
.bars.hours .bar { background: var(--fussy); border-radius: 4px 4px 2px 2px; }
.bar-labels { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 8px; font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; margin-top: 6px; }
.bar-labels.hours { gap: 3px; }
.chart-cap { font-size: 13px; color: var(--muted); margin-top: 6px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
table.data th, table.data td { padding: 6px; text-align: right; border-bottom: 1px solid var(--line); }
table.data th { font-weight: 600; color: var(--ink-2); }
table.data th:first-child, table.data td:first-child { text-align: left; }

/* ---------- formulieren ---------- */
.field { display: block; margin: 14px 0; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea {
  display: block; width: 100%; min-width: 0; max-width: 100%; margin-top: 6px;
  padding: 12px 14px; border-radius: 14px; border: 2px solid transparent;
  background: var(--surface-2); color: var(--ink); font-size: 16px; font-weight: 600;
  appearance: none; -webkit-appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238d91a5' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.seg { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; padding: 4px; background: var(--surface-2); border-radius: 16px; }
.seg label { flex: 1; position: relative; }
.seg input, .field .seg input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; margin: 0; padding: 0; }
.seg span {
  display: flex; align-items: center; justify-content: center; min-height: 44px; text-align: center; padding: 9px 6px; border-radius: 12px;
  font-size: 14.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
}
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgb(35 38 59 / 0.12); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.two .field { margin: 6px 0; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.btn-row.end { align-items: center; }
.spacer { flex: 1; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 16px; border-radius: 999px; border: 0;
  background: var(--surface-2); color: var(--ink); font-size: 15px; font-weight: 600;
}
.btn .icon { width: 18px; height: 18px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--danger); background: transparent; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--danger) 25%, transparent); }
.btn.sm { padding: 8px 12px; font-size: 14px; min-height: 44px; }
.btn:disabled { opacity: 0.5; }

dialog {
  width: min(560px, calc(100vw - 20px));
  border: 0; border-radius: 28px; padding: 22px;
  background: var(--surface); color: var(--ink);
  max-height: calc(100dvh - 40px);
}
/* Op de telefoon: als paneel onderin, binnen bereik van je duim. */
@media (max-width: 600px) {
  dialog {
    width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 28px 28px 0 0;
    padding-bottom: calc(22px + env(safe-area-inset-bottom)); max-height: 92dvh;
  }
}
.dialog-title:focus { outline: none; }
#entry-save { flex: 1 1 55%; min-height: 52px; font-size: 17px; }
#entry-cancel, #more-cancel { min-height: 52px; }
.field input[hidden] { display: none; }
.seg.when span { padding: 11px 2px; font-size: 14px; }

/* hoeveelheid: grote −/+ knoppen en de gebruikelijke hoeveelheden */
.stepper { display: grid; grid-template-columns: 60px minmax(0, 1fr) 60px; gap: 8px; margin-top: 6px; }
.field .stepper input { margin: 0; text-align: center; font-size: 22px; min-height: 56px; }
.step { min-height: 56px; border: 0; border-radius: 16px; background: var(--surface-2); color: var(--ink); font-size: 26px; font-weight: 500; touch-action: manipulation; }
.step:active, .chips .chip:active { transform: scale(0.96); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chips .chip { min-height: 44px; padding: 8px 16px; background: var(--surface-2); box-shadow: none; color: var(--ink); }

/* luier: één tik op de soort = opslaan */
.big-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.choice { min-height: 64px; border: 0; border-radius: 18px; background: var(--c-bg); color: var(--c); font-size: 17px; font-weight: 600; touch-action: manipulation; }
.choice:active { transform: scale(0.97); }
details.note-more summary { cursor: pointer; padding: 12px 0; min-height: 44px; font-weight: 600; color: var(--accent); list-style: none; }
details.note-more summary::-webkit-details-marker { display: none; }

dialog::backdrop { background: rgb(20 21 31 / 0.45); backdrop-filter: blur(2px); }
.dialog-title { display: flex; align-items: center; gap: 12px; }
.dialog-title .ico { width: 44px; height: 44px; }

/* ---------- babyfoto ---------- */
.photo-row { display: flex; align-items: center; gap: 18px; margin-top: 14px; }
.photo-row .btn-row { margin-top: 0; }

/* ---------- voedingswekker ---------- */
.alarm-card { display: grid; grid-template-columns: 44px 1fr auto; gap: 2px 14px; align-items: center; }
.alarm-card .label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.alarm-card .count { font-family: var(--display); font-size: 34px; font-weight: 300; letter-spacing: -0.02em; line-height: 1.1; }
.alarm-card .sub { font-size: 13px; color: var(--muted); }
.alarm-card .progress { grid-column: 1 / -1; height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 12px; }
.alarm-card .progress i { display: block; height: 100%; background: var(--alarm); border-radius: 999px; }
.alarm-card.due { background: var(--fussy-bg); box-shadow: none; }
.alarm-card.due .ico { background: var(--surface); color: var(--fussy); }
.alarm-card.due .count { color: var(--fussy); font-size: 22px; }
.alarm-card.due .progress { background: var(--surface); }
.alarm-card.due .progress i { background: var(--fussy); }
.alarm-card.ringing { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--fussy) 18%, transparent); } }
@media (prefers-reduced-motion: reduce) { .alarm-card.ringing { animation: none; } }
#alarm-fields[aria-disabled='true'] { opacity: 0.45; pointer-events: none; }
.switch { position: relative; display: inline-block; width: 52px; height: 32px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: 0.2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.2); transition: 0.2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.push-box { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; padding: 14px; border-radius: var(--r-md); background: var(--alarm-bg); font-size: 14px; }
.push-box > .icon { color: var(--alarm); margin-top: 1px; }
.push-box p { margin: 0 0 8px; }
.push-box p:last-child { margin-bottom: 0; }
.push-box .btn:not(.primary) { background: var(--surface); }

/* ---------- samen gebruiken ---------- */
.invite { margin: 12px 0; padding: 16px; border-radius: var(--r-md); background: var(--accent-soft); text-align: center; }
.invite span { font-family: var(--display); font-size: 30px; font-weight: 300; letter-spacing: -0.02em; letter-spacing: 0.1em; color: var(--accent); }
.sub-title { font-size: 16px; margin-top: 20px; }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 22px);
  transform: translateX(-50%) translateY(20px); opacity: 0; transition: 0.2s;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  pointer-events: none; z-index: 20; max-width: calc(100vw - 32px);
}
/* in een open paneel staat de melding onderin dat paneel (de rest van de pagina is dan niet tikbaar) */
dialog > #toast { bottom: calc(env(safe-area-inset-bottom) + 16px); z-index: 5; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
#toast.has-undo { pointer-events: auto; padding: 6px 6px 6px 18px; }
#toast:not(.show) { pointer-events: none; } /* onzichtbaar: niet in de weg zitten */
#toast span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#toast .undo { flex-shrink: 0; }
#toast .undo { min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--bg) 18%, transparent); color: var(--bg); font: inherit; }

/* ---------- formulieren: veel keuzes in twee kolommen ---------- */
.seg.wrap { display: grid; grid-template-columns: 1fr 1fr; }
.seg.wrap span { white-space: normal; }
#entry-error:empty, #welcome-error:empty { display: none; }
.warn { color: var(--danger); }

/* ---------- inzichten ---------- */
.range-row { display: flex; justify-content: flex-end; margin: 18px 0 4px; }
.seg.range { margin: 0; min-width: 210px; }
.head-ico { display: flex; align-items: center; gap: 10px; }
.head-ico .ico { width: 34px; height: 34px; border-radius: 11px; }
.head-ico .ico .icon { width: 20px; height: 20px; }
.today-list { margin-top: 6px; }
.today-row { display: flex; gap: 12px; align-items: center; padding: 9px 0; width: 100%; border: 0; background: none; text-align: left; }
.today-row + .today-row { border-top: 1px solid var(--line); }
.today-row .ico { width: 38px; height: 38px; border-radius: 12px; }
.today-row .ico .icon { width: 21px; height: 21px; }
.today-row .title { font-weight: 600; }
.today-row .detail { font-size: 13.5px; color: var(--ink-2); }
.stat-line { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 12px; }
.stat-line .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat-line .v { font-family: var(--display); font-size: 24px; font-weight: 300; letter-spacing: -0.02em; line-height: 1.2; }
.delta-cell { margin-left: auto; text-align: right; }
.delta { font-weight: 600; color: var(--ink-2); font-size: 15px; }
.kinds { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-2); margin-top: 10px; }
.kinds b { font-weight: 600; color: var(--ink); }

.toggles { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 8px; }
.toggle { min-height: 44px;
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px 6px 8px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.toggle .icon { width: 16px; height: 16px; }
.toggle .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--vc); }
.toggle[aria-pressed='false'] { opacity: 0.45; }
.toggle[aria-pressed='false'] .sw { background: transparent; box-shadow: inset 0 0 0 1.5px var(--vc); }
.viz-feed { --vc: var(--viz-feed); }
.viz-sleep { --vc: var(--viz-sleep); }
.viz-diaper { --vc: var(--viz-diaper); }
.viz-pump { --vc: var(--viz-pump); }

svg.pattern, svg.linechart { display: block; width: 100%; height: auto; margin-top: 4px; overflow: visible; }
svg .grid { stroke: var(--line); stroke-width: 1; }
svg .tick { fill: var(--muted); font: 600 9.5px var(--text); }
svg .weekend { fill: var(--surface-2); }
svg g.viz-sleep rect { fill: var(--viz-sleep); opacity: 0.45; }
svg g.viz-feed rect { fill: var(--viz-feed); stroke: var(--surface); stroke-width: 0.8; }
svg g.viz-pump rect { fill: var(--viz-pump); stroke: var(--surface); stroke-width: 0.8; }
svg g.viz-diaper rect { fill: var(--viz-diaper); }
svg .now { stroke: var(--danger); stroke-width: 1.2; stroke-dasharray: 3 3; }
svg .now-dot { fill: var(--danger); stroke: var(--surface); stroke-width: 2; }
svg [data-tip] { cursor: pointer; }

svg .band { fill: var(--viz-growth); opacity: 0.08; }
svg .ref { fill: none; stroke: var(--muted); stroke-width: 1; opacity: 0.8; }
svg .ref.median { stroke-dasharray: 4 3; }
svg .ref.fever { stroke: var(--danger); stroke-dasharray: 4 3; opacity: 0.9; }
svg .ref-label { font-size: 9px; }
svg .line { fill: none; stroke-width: 2; }
svg .line.baby { stroke: var(--viz-growth); }
svg .line.temp { stroke: var(--viz-temp); }
svg .dot { stroke: var(--surface); stroke-width: 2; }
svg .dot.baby { fill: var(--viz-growth); }
svg .dot.temp { fill: var(--viz-temp); }
.growth-now { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.growth-now .v { font-family: var(--display); font-size: 26px; font-weight: 300; letter-spacing: -0.02em; }
.growth-now .pct { font-weight: 600; font-size: 13px; padding: 2px 8px; border-radius: 999px; background: var(--growth-bg); color: var(--growth); }
.growth-now .pct.warn { background: var(--fussy-bg); color: var(--fussy); }
.legend .sw.growth { background: var(--viz-growth); }
.legend .sw.band { background: color-mix(in srgb, var(--viz-growth) 18%, transparent); }

/* ---------- snel starten (borstvoeding / slaap) ---------- */
.quick { padding: 6px 0 4px; }
.last-side { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13px; color: var(--muted); font-weight: 600; }
.last-side b { font-family: var(--display); font-weight: 500; font-size: 22px; color: var(--ink); }
.start-btns { display: flex; justify-content: center; gap: 28px; margin: 18px 0 8px; }
.start-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: 104px; height: 104px; border-radius: 50%; border: 2px solid var(--c); background: var(--surface); color: var(--c);
}
.start-btn .side { font-family: var(--display); font-size: 22px; line-height: 1; }
.start-btn .icon { width: 30px; height: 30px; }
.start-btn .hint { font-size: 11px; font-weight: 600; min-height: 14px; }
.start-btn.next { background: var(--c-bg); }
.start-btn:active { transform: scale(0.96); }
.start-btn.wide { flex-direction: row; gap: 10px; width: 100%; height: 64px; border-radius: 999px; font-size: 17px; font-weight: 600; background: var(--c-bg); }
.start-btn.wide .icon { width: 24px; height: 24px; }
details.manual { margin-top: 10px; border-top: 1px solid var(--line); }
details.manual summary { cursor: pointer; padding: 14px 0 4px; font-weight: 600; color: var(--accent); list-style: none; text-align: center; }
details.manual summary::-webkit-details-marker { display: none; }

/* laatste losse tegel in het midden */
.action:last-child:nth-child(3n + 1) { grid-column: 2; }

/* ---------- herinneringen ---------- */
.remind-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.remind-row + .remind-row { border-top: 1px solid var(--line); }
.remind-row .grow { flex: 1; min-width: 0; }
.remind-row .title { font-weight: 600; }
.remind-row .detail { font-size: 13px; color: var(--muted); }
.remind-row.due .detail { color: var(--danger); font-weight: 600; }
.remind-row .done { color: var(--ok); display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 14px; }
.remind-row .done .icon { width: 18px; height: 18px; }
.remind-edit { display: grid; grid-template-columns: minmax(0, 1fr) 96px auto auto; gap: 8px; align-items: center; padding: 8px 0; }
.remind-edit + .remind-edit { border-top: 1px solid var(--line); }
.remind-edit select, .remind-edit input[type='time'] {
  width: 100%; min-width: 0; padding: 9px 10px; border-radius: 12px; border: 2px solid transparent;
  background: var(--surface-2); color: var(--ink); font: inherit; font-size: 15px;
}
.remind-edit .switch { transform: scale(0.85); }
.icon-btn { border: 0; background: none; color: var(--muted); padding: 6px; font-size: 20px; line-height: 1; min-width: 44px; min-height: 44px; }
#reminder-add { margin-top: 10px; }
.card.paused .timer { opacity: 0.5; }

/* ---------- welkom en back-up ---------- */
.welcome h2 { font-size: 24px; }
details.danger-zone { margin-top: 14px; }
details.danger-zone > summary { min-height: 44px; display: flex; align-items: center; color: var(--danger); font-weight: 600; cursor: pointer; }
.feed-total { margin: 4px 0 10px; font-size: 15px; color: var(--ink-2); }
.feed-total b { font-size: 20px; font-weight: 600; color: var(--ink); }
details.modules { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
details.modules > summary { display: flex; justify-content: space-between; align-items: center; min-height: 44px; font-weight: 600; cursor: pointer; list-style: none; }
details.modules > summary::-webkit-details-marker { display: none; }
details.modules > summary::after { content: '›'; font-size: 22px; color: var(--muted); transition: transform 0.2s; }
details.modules[open] > summary::after { transform: rotate(90deg); }
details.modules > summary .muted { margin-left: auto; margin-right: 10px; font-weight: 400; font-size: 14px; }
.welcome fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.welcome fieldset[hidden] { display: none; }
.welcome #welcome-step { margin: 0 0 4px; }
.nudge { display: flex; flex-direction: column; gap: 4px; background: var(--pump-bg); box-shadow: none; }
.nudge .title { font-weight: 600; }
.nudge .detail { font-size: 14px; color: var(--ink-2); }
.nudge .btn-row { margin-top: 8px; }
.nudge .btn:not(.primary) { background: var(--surface); }

/* ---------- voorraad en boodschappen ---------- */
.supplies .sup-form { padding: 0 0 12px; }
.supplies .sup-form .field { margin: 8px 0; }
.supplies .btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.shop { border-top: 1px solid var(--line); padding: 10px 0 8px; }
.shop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; }
.shop-head .title { font-weight: 600; }
.shop-item { display: flex; align-items: center; gap: 8px; }
.shop-item label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 9px 0; min-height: 48px; cursor: pointer; }
.shop-item input { width: 22px; height: 22px; margin: 0; flex-shrink: 0; accent-color: var(--accent); }
.shop-item span { overflow-wrap: anywhere; }
.shop-item.done span { color: var(--muted); text-decoration: line-through; }
.shop-add { display: flex; gap: 8px; margin-top: 8px; }
.shop-add input {
  flex: 1; min-width: 0; padding: 9px 12px; border-radius: 12px; border: 2px solid transparent;
  background: var(--surface-2); color: var(--ink); font: inherit; font-size: 16px;
}
.shop-add input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.shop-add .icon { width: 18px; height: 18px; }

/* ---------- weergave ---------- */
.view-group { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 14px 0 2px; }
.view-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; cursor: pointer; }
.view-opt + .view-opt { border-top: 1px solid var(--line); }

/* ---------- borstvoeding met meerdere kanten in het logboek ---------- */
.row.feed-group { align-items: flex-start; }
.side-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.side-chip {
  border: 0; border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 13px; font-weight: 600;
  background: var(--feed-bg); color: var(--feed); cursor: pointer;
}

/* ---------- sprongetjes ---------- */
.leap-card { padding: 12px 16px; }
.leap-card summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
.leap-card summary::-webkit-details-marker { display: none; }
.leap-card .grow { flex: 1; min-width: 0; }
.leap-card .title { font-weight: 600; }
.leap-card .detail { font-size: 13px; color: var(--muted); }
.leap-card .progress { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.leap-card .progress i { display: block; height: 100%; background: var(--sleep); border-radius: 999px; }
.leap-card .chev { width: 18px; height: 18px; color: var(--muted); transition: transform 0.2s; flex-shrink: 0; }
.leap-card details[open] .chev { transform: rotate(90deg); }
.leap-body { padding: 8px 0 2px 52px; }
.leap-body p { margin: 6px 0; }
.leap-line { list-style: none; margin: 8px 0 0; padding: 0; }
.leap-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; }
.leap-row + .leap-row { border-top: 1px solid var(--line); }
.leap-row .dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--sleep); flex-shrink: 0; }
.leap-row.done { color: var(--muted); }
.leap-row.done .dot { background: var(--sleep); opacity: 0.45; }
.leap-row.now { font-weight: 600; }
.leap-row.now .dot { background: var(--sleep); }
.leap-row .wk { width: 96px; flex-shrink: 0; color: var(--muted); font-size: 13px; }
.leap-row .t { flex: 1; min-width: 0; }
.now-badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--sleep-bg); color: var(--sleep); }

/* ---------- mijlpalen (badges) ---------- */
.medal {
  position: relative; display: grid; place-items: center; flex-shrink: 0;
  width: 56px; height: 56px; border-radius: 50%;
  border: 2px dashed var(--line); color: var(--muted); background: transparent;
}
.medal .icon { width: 26px; height: 26px; }
.medal.earned { border: 0; background: var(--c-bg); color: var(--c); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--c) 35%, transparent); }
.medal .tick {
  position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: var(--c); color: var(--surface); box-shadow: 0 0 0 2px var(--surface);
}
.medal .tick .icon { width: 14px; height: 14px; stroke-width: 2.6; }
.medal.big { width: 84px; height: 84px; }
.medal.big .icon { width: 38px; height: 38px; }
.medal.big .tick { width: 28px; height: 28px; }
.medal.pop { animation: medal-pop 0.7s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes medal-pop { 0% { transform: scale(0.4); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .medal.pop { animation: none; } }

.badge-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0 4px; }
.badge-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 48px;
  padding: 10px 4px; border: 0; border-radius: var(--r-md); background: none; color: var(--ink); text-align: center;
  touch-action: manipulation;
}
.badge-tile:active { background: var(--surface-2); }
.badge-tile .t { font-size: 13px; font-weight: 600; line-height: 1.25; }
.badge-tile:not(.earned) .t { color: var(--ink-2); }
.badge-tile .d { font-size: 12px; color: var(--muted); }
.badge-tile.add .medal { border-style: solid; color: var(--accent); }
.ms-card .view-group { margin-top: 14px; }

.ms-suggest .ms-head { display: flex; align-items: center; gap: 14px; }
.ms-suggest .label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.ms-suggest .title { font-weight: 600; font-size: 16px; }
.ms-suggest .detail { font-size: 13.5px; color: var(--ink-2); }
.ms-suggest .btn-row .btn { flex: 1 1 auto; min-height: 48px; padding: 11px 12px; white-space: nowrap; }
.ms-suggest.celebrate { background: var(--growth-bg); box-shadow: none; }

.badge-hero { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding-top: 4px; }
.badge-hero h2 { font-size: 24px; }
.badge-hero h2:focus { outline: none; }
.badge-hero p { margin: 0; }
#badge-save { flex: 1 1 50%; min-height: 52px; font-size: 17px; }

/* ==========================================================================
   Herontwerp: kop, menubalk, Loggen, Straks, Komende 12 uur, panelen
   ========================================================================== */

body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 64px); }
main { padding: 0 20px; }
.card { border-radius: var(--r-lg); }
.btn { min-height: 44px; }

/* ---------- kop met illustratie ---------- */
.topbar.hero { display: block; padding: calc(env(safe-area-inset-top) + 28px) 0 0; max-width: 640px; }
.hero-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 0 20px; }
.hero .who { display: block; }
.hero .who .hello { font-size: 15px; font-weight: 400; color: var(--muted); letter-spacing: 0; margin: 0 0 4px; }
.hero h1 { font-size: 64px; font-weight: 300; letter-spacing: -2.5px; line-height: 1; overflow-wrap: anywhere; }
.hero .who p { font-size: 15px; color: var(--muted); margin: 6px 0 0; }
.hero .sync { margin-top: 10px; }
.hero .avatar {
  width: 48px; height: 48px; border: 0; padding: 0; flex-shrink: 0;
  box-shadow: none; background-color: var(--sleep-bg); color: var(--sleep); font-size: 18px; font-weight: 600;
}
.hero .avatar .initial { font-family: var(--text); font-size: 18px; font-weight: 600; letter-spacing: 0; }
.hero .avatar .icon { width: 24px; height: 24px; }
.hero-art { display: block; width: 100%; height: 72px; margin-top: 8px; }
.hero-art > g { display: none; }
.hero-art text { font-family: inherit; }
.hero-art[data-scene='eend'] .eend.day, .hero-art[data-scene='hert'] .hert.day { display: inline; }
:root[data-theme='dark'] .hero-art[data-scene] .day { display: none; }
:root[data-theme='dark'] .hero-art[data-scene='eend'] .eend.night,
:root[data-theme='dark'] .hero-art[data-scene='hert'] .hert.night { display: inline; }

/* ---------- sectiekoppen ---------- */
.block-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 28px 0 12px; }
.block-head .section-title { margin: 0; }
.learns { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.learns .icon { width: 16px; height: 16px; }

/* ---------- Loggen: 2×2 tegels ---------- */
.log-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.log-tile {
  display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 96px;
  padding: 14px 16px; border: 0; border-radius: var(--r-md); text-align: left;
  background: var(--c-bg); color: var(--ink); touch-action: manipulation;
}
.log-tile.cat-bottle, .action.cat-bottle { --c: var(--bottle); --c-bg: var(--bottle-bg); }
.log-tile .top { display: flex; justify-content: space-between; align-items: center; }
.log-tile .ico { width: 36px; height: 36px; border-radius: 50%; background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--c); }
.log-tile .ico .icon { width: 20px; height: 20px; }
.log-tile .t { font-size: 17px; font-weight: 600; line-height: 1.2; }
.log-tile .s { font-size: 13px; font-weight: 500; color: var(--c); margin-top: -8px; }
.log-tile .s b { font-weight: 700; }
/* alleen borst of alleen fles: de voedingstegel over de volle breedte */
.log-tiles.three > :first-child { grid-column: span 2; min-height: 104px; }
.log-tile.is-running { box-shadow: inset 0 0 0 1.5px var(--c); }
.log-tile .live { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c); }
.log-tile:active { transform: scale(0.97); }

/* ---------- Straks: kaarten om doorheen te vegen ---------- */
.straks {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin: 0 -20px; padding: 0 20px; scroll-padding: 0 20px;
}
.straks::-webkit-scrollbar { display: none; }
.straks-card {
  flex-shrink: 0; scroll-snap-align: start; display: flex; flex-direction: column; justify-content: space-between; gap: 14px;
  height: 300px; padding: 20px; border-radius: var(--r-xl); background: var(--c-bg); color: var(--ink);
}
.straks-card.big { width: min(296px, calc(100vw - 80px)); }
.straks-card.small { width: 200px; }
.straks-card .ico { width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--c-bg); }
.straks-card .ico.dark { background: var(--ink); }
:root[data-theme='dark'] .straks-card .ico { background: var(--c); color: var(--c-bg); }
.straks-card .row-top { display: flex; justify-content: space-between; align-items: center; }
.straks-card .label { font-size: 16px; font-weight: 500; }
:root[data-theme='dark'] .straks-card .label { color: var(--c); }
.straks-card .huge { font-size: 72px; font-weight: 300; letter-spacing: -3px; line-height: 1; white-space: nowrap; }
.straks-card .big { font-size: 52px; font-weight: 300; letter-spacing: -2px; line-height: 1; white-space: nowrap; }
.straks-card small { font-size: 0.42em; letter-spacing: 0; margin-right: 4px; vertical-align: 0.5em; }
.straks-card .sub { font-size: 14px; color: var(--c); }
.straks-card .body { display: flex; flex-direction: column; gap: 6px; }
.straks-card .row-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.straks-card .pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 999px;
  background: var(--ink); color: var(--c-bg); font-size: 14px; white-space: nowrap;
}
:root[data-theme='dark'] .straks-card .pill { background: var(--c); color: var(--c-bg); }
.straks-card .since { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 12px; color: var(--c); white-space: nowrap; }
.straks-card .bar { display: block; width: 72px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--ink) 15%, transparent); }
.straks-card .bar i { display: block; height: 100%; border-radius: 2px; background: var(--ink); }
:root[data-theme='dark'] .straks-card .bar i { background: var(--c); }
.round-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; padding: 0;
  border: 1.5px solid color-mix(in srgb, var(--ink) 60%, transparent); background: none; color: var(--ink);
}
.round-btn .icon { width: 20px; height: 20px; }
.chip-alarm {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 60%, transparent); color: var(--c); font-size: 13px; font-weight: 600;
}
.chip-alarm .icon { width: 16px; height: 16px; }
.timer-card .live { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c); }
.timer-card .huge { font-size: 60px; }
#feed-timer:empty { display: none; }
#feed-timer .timer-card { width: auto; height: auto; min-height: 240px; margin-top: 10px; }
.timer-card.paused .huge { opacity: 0.55; }
.timer-card .btns { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 8px; }
.timer-card .btn { min-height: 48px; padding: 10px 6px; background: color-mix(in srgb, var(--surface) 75%, transparent); color: var(--ink); }
.timer-card .btn.primary { background: var(--ink); color: var(--c-bg); margin-left: 6px; }
:root[data-theme='dark'] .timer-card .btn.primary { background: var(--c); color: var(--c-bg); }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); cursor: pointer; }
.dots i.on { background: var(--ink); width: 20px; border-radius: 4px; }

/* ---------- Komende 12 uur ---------- */
.predict-card { margin-top: 28px; }
.legend-dots { display: flex; gap: 10px; font-size: 12px; color: var(--muted); }
.legend-dots span { display: inline-flex; align-items: center; gap: 4px; }
.legend-dots i { width: 8px; height: 8px; border-radius: 50%; }
.unrest-line { margin: 6px 0 16px; font-size: 15px; line-height: 1.4; color: var(--ink-2); }
.hbars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; height: 80px; align-items: end; touch-action: none; }
.hbar { border-radius: 10px; background: var(--risk-0); }
.hbar[data-l='1'] { background: var(--risk-1); }
.hbar[data-l='2'] { background: var(--risk-2); }
.hbar[data-l='3'] { background: var(--risk-3); }
.hbar[data-l='4'] { background: var(--risk-4); }
.haxis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.rhythm-line { display: flex; gap: 10px; margin: 16px 0 0; padding: 12px 14px; border-radius: var(--r-sm); background: var(--feed-bg); color: var(--ink); font-size: 14px; }
.rhythm-line .icon { width: 18px; height: 18px; color: var(--feed); flex-shrink: 0; margin-top: 1px; }
.why summary { color: var(--link); font-weight: 500; }

/* ---------- voorraad: compacte kaart met regels ---------- */
.supplies { margin-top: 12px; padding: 8px 20px; }
.supplies .remind-row { min-height: 76px; }
.link-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; min-height: 56px;
  padding: 0; border: 0; border-top: 1px solid var(--line); background: none; color: var(--ink); font-size: 15px; text-align: left;
}
.link-row .muted { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; white-space: nowrap; }
.link-row .icon { width: 18px; height: 18px; }

/* ---------- menubalk: donkere pil met + ---------- */
.tabbar {
  position: fixed; left: 20px; right: 20px; bottom: calc(env(safe-area-inset-bottom) + 16px); z-index: 10;
  max-width: 480px; margin: 0 auto; height: var(--tabbar-h); padding: 0 10px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--nav); border-radius: 34px; box-shadow: 0 12px 30px -12px rgb(0 0 0 / 0.35);
}
.tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; min-width: 48px; padding: 0 12px;
  border: 0; border-radius: 24px; background: none; color: var(--nav-ink); font-size: 14px; font-weight: 600;
}
.tab .icon { width: 22px; height: 22px; }
.tab .lbl { display: none; }
.tab.active { background: var(--nav-active); color: var(--nav-active-ink); padding: 0 16px; }
.tab.active .lbl { display: inline; }
.tab.active .icon { width: 20px; height: 20px; }
.tab-plus {
  width: 52px; height: 52px; border-radius: 50%; border: 0; display: grid; place-items: center; flex-shrink: 0;
  background: var(--plus); color: var(--plus-ink);
}
.tab-plus .icon { width: 24px; height: 24px; stroke-width: 2; }
/* zachte overgang onderaan, zodat niets hard achter de menubalk verdwijnt */
body::after {
  content: ''; position: fixed; left: 0; right: 0; bottom: 0; height: calc(env(safe-area-inset-bottom) + 110px); z-index: 9; pointer-events: none;
  background: linear-gradient(color-mix(in srgb, var(--bg) 0%, transparent), var(--bg) 70%);
}
#toast { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 30px); z-index: 20; }

/* ---------- panelen onderin ---------- */
dialog.sheet { padding: 12px 20px calc(24px + env(safe-area-inset-bottom)); }
.grabber { display: block; width: 40px; height: 5px; margin: 0 auto 14px; border-radius: 3px; background: var(--line); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.sheet-head h2 { font-size: 30px; font-weight: 300; letter-spacing: -1px; line-height: 1.1; }
.sheet-head h2:focus { outline: none; }
.close-btn {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; padding: 0;
  border: 1.5px solid var(--ink); background: none; color: var(--ink);
}
.close-btn .icon { width: 18px; height: 18px; stroke-width: 2; }
#more-dialog .actions { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
#more-dialog .action {
  flex-direction: column; align-items: flex-start; justify-content: space-between; min-height: 112px; padding: 14px;
  border-radius: var(--r-md); background: var(--c-bg); box-shadow: none; font-size: 15px; font-weight: 600; text-align: left;
}
#more-dialog .action .ico { width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--c-bg); }
:root[data-theme='dark'] #more-dialog .action .ico { background: var(--c); }
#more-dialog .action .ico .icon { width: 20px; height: 20px; }
#more-dialog .action:last-child:nth-child(3n + 1) { grid-column: auto; }
#list-body .shop-add { margin-top: 12px; }


/* De kop met illustratie alleen op Nu; de andere tabbladen krijgen een kleine regel en een grote titel. */
body[data-view]:not([data-view='now']) .topbar.hero { display: none; }
body[data-view]:not([data-view='now']) main { padding-top: calc(env(safe-area-inset-top) + 40px); }
.page-kicker { margin: 0 4px 6px; font-size: 15px; color: var(--muted); }
.page-kicker:empty { display: none; }
.page-title { font-size: 56px; margin: 0 4px 22px; }

/* ---------- Inzichten ---------- */
.day-picker { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.day-picker .day {
  height: 64px; border: 0; border-radius: 22px; background: transparent; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px;
}
.day-picker .day .num { font-size: 17px; font-weight: 500; color: var(--ink); }
.day-picker .day.today { background: var(--surface); }
.day-picker .day.on { background: var(--ink); color: color-mix(in srgb, var(--bg) 75%, transparent); }
.day-picker .day.on .num { color: var(--bg); }
.ring-card { display: flex; flex-direction: column; gap: 16px; }
.ring { position: relative; width: 260px; max-width: 100%; aspect-ratio: 1; margin: 0 auto; }
.ring svg { width: 100%; height: 100%; display: block; }
.ring-track { fill: none; stroke: var(--surface-2); stroke-width: 22; }
.ring-sleep { fill: none; stroke: var(--viz-sleep); stroke-width: 22; stroke-linecap: round; }
.ring-feed { fill: var(--viz-feed); stroke: var(--surface); stroke-width: 3; }
.ring-label { font-size: 11px; fill: var(--muted); font-family: var(--text); }
.ring-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; pointer-events: none; }
.ring-mid .v { font-size: 40px; font-weight: 300; letter-spacing: -1.5px; line-height: 1; }
.ring-mid .k { font-size: 13px; color: var(--muted); }
.ring-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ring-tiles > div { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 18px; background: var(--c-bg); }
.ring-tiles .v { font-size: 20px; font-weight: 500; white-space: nowrap; }
.ring-tiles .k { font-size: 12px; color: var(--c); }
.sbars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.sbar { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 12px; }
.sbar .track { display: flex; align-items: flex-end; width: 100%; height: 160px; border-radius: 20px; background: var(--surface-2); }
.sbar .fill {
  display: flex; align-items: flex-end; justify-content: center; width: 100%; padding-bottom: 10px; border-radius: 20px;
  background: color-mix(in srgb, var(--viz-sleep) 60%, var(--surface)); color: var(--ink); font-size: 11px; font-weight: 600;
}
.sbar.on .fill { background: var(--sleep); color: var(--surface); }
.sbar.partial .fill { background: color-mix(in srgb, var(--viz-sleep) 25%, var(--surface)); color: var(--muted); }
.sbar.on .lbl { color: var(--ink); font-weight: 600; }
.insight-card { background: var(--pump-bg); display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.insight-card .kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--pump); }
.insight-card .kicker .icon { width: 16px; height: 16px; }
.insight-card p { margin: 0; font-size: 20px; line-height: 1.3; }
.insight-card .detail { font-size: 14px; color: var(--ink-2); margin-top: -6px; }
