/* Juul MedSchema. Same warm-paper identity as "Voor Julia"; Fraunces only for the time and the page titles, Inter for everything you read or tap. */
:root {
  --bg: #faf6f1; --bg2: #f4ece4; --paper: #fff; --ink: #2b2422; --ink2: #4a403c; --muted: #6f625b; --line: #e6dbd0; --line2: #d9cabc;
  --accent: #c65a46; --accent-d: #a94634; --accent-soft: #f8e4dc; --accent-ink: #7d2f20;
  --ok: #2f7049; --ok-soft: #e4f1e8; --ok-ink: #1f4d31;
  --signal: #b3261e; --signal-bg: #fdecea; --signal-ink: #5f140e; --signal-line: #e8a29c;
  --serif: Fraunces, Georgia, serif; --text: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 14px; --shadow: 0 1px 2px rgba(70,40,30,.06), 0 8px 24px -14px rgba(70,40,30,.3);
  --btn: #b84f3c; --ok-btn: #2f7049; --inv-bg: #2b2422; --inv-fg: #fbf3ea; --hero-bg: #fffdfa; --hero-ink: #2b2422; --hero-soft: #66564e; --hero-accent: #9a3c28; --blue-bg: #e3ebf5; --blue-ink: #1961ab; --late-bg: #fdf3d3; --late-line: #e3c86a; --late-ink: #5e4605; --nav-bg: rgba(255,255,255,.96); --off: #b6a89d;
  --tab-h: 64px; --pad: 16px; --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { position: relative; margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font: 400 1rem/1.5 var(--text); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
h1, h2, h3, h4, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent-d); outline-offset: 2px; border-radius: 6px; }
.ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); } .small { font-size: .875rem; color: var(--muted); }

.title { font-family: var(--serif); font-weight: 400; font-size: 2.25rem; line-height: 1.1; letter-spacing: -.02em; text-wrap: balance; }
.title em { color: var(--accent); font-style: italic; }
.lede { color: var(--ink2); margin-top: 8px; max-width: 52ch; text-wrap: pretty; }
.head { padding: 28px 0 8px; }
.head.row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.sec { font-size: 1.125rem; font-weight: 600; letter-spacing: -.005em; margin: 28px 0 0; }

.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; padding: calc(10px + env(safe-area-inset-top, 0px)) var(--pad) 10px; background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { font-family: var(--serif); font-size: 1.5rem; line-height: 1; text-decoration: none; margin-right: auto; }
.brand span { color: var(--accent); font-style: italic; }
.desk-nav { display: none; gap: 2px; }
.desk-nav a { text-decoration: none; font-size: .9375rem; font-weight: 500; color: var(--ink2); padding: 8px 14px; border-radius: 999px; }
.desk-nav a:hover { background: var(--bg2); }
.desk-nav a.active { background: var(--paper); color: var(--accent-d); box-shadow: var(--shadow); }
.logout { font-size: .875rem; color: var(--muted); background: none; border: 0; padding: 8px; }
.tabbar { position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); height: var(--tab-h); padding: 5px; background: var(--nav-bg); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 2px 4px rgba(70,40,30,.05), 0 18px 40px -20px rgba(70,40,30,.45); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: .6875rem; font-weight: 500; border-radius: 15px; transition: background .2s, color .2s; }
.tabbar a.active { background: var(--accent-soft); color: var(--accent-ink); }
main { max-width: 760px; margin: 0 auto; padding: 0 var(--pad) calc(var(--tab-h) + 48px); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border: 1px solid var(--btn); border-radius: 999px; background: var(--btn); color: #fff; font-size: 1rem; font-weight: 500; transition: background .15s, transform .1s; }
.btn:hover { filter: brightness(1.08); } .btn:active { transform: scale(.98); }
.btn.ghost { background: var(--paper); color: var(--ink2); border-color: var(--line2); min-height: 44px; padding: 0 16px; }
.btn.ghost:hover { background: var(--bg2); }
.btn.danger { color: var(--signal); border-color: var(--signal-line); }
.btn:disabled { opacity: .5; cursor: default; }
.pager { display: flex; gap: 8px; }

/* ---------- Warnings: ONE block per medicine, unmistakable ---------- */
.warn { margin-top: 12px; border: 1.5px solid var(--signal); border-radius: 12px; background: var(--signal-bg); overflow: hidden; }
.warn-h { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--signal); color: #fff; font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.warn-h .ico { width: 18px; height: 18px; stroke-width: 2.2; }
.warn li { padding: 9px 12px; color: var(--signal-ink); font-weight: 600; line-height: 1.35; }
.warn li + li { border-top: 1px solid var(--signal-line); }

.now-banner { display: flex; gap: 12px; align-items: center; margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: var(--btn); color: #fff; text-decoration: none; font-weight: 600; }
.now-banner small { display: block; font-weight: 400; opacity: .95; }

/* ---------- Day timeline: one block per clock moment ---------- */
.moment { margin-top: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; scroll-margin-top: 70px; }
.m-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.m-clock { font-family: var(--serif); font-size: 1.75rem; line-height: 1; letter-spacing: -.02em; }
.chip { margin-left: auto; font-size: .8125rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--paper); color: var(--ink2); border: 1px solid var(--line2); white-space: nowrap; }
.moment.is-due { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.moment.is-due .m-head { background: var(--accent-soft); border-color: var(--line2); }
.moment.is-due .chip { background: var(--btn); border-color: var(--btn); color: #fff; }
.moment.is-next .chip { background: var(--inv-bg); border-color: var(--inv-bg); color: var(--inv-fg); }
.moment.is-late .chip { background: var(--late-bg); border-color: var(--late-line); color: var(--late-ink); }
.moment.is-done { border-color: var(--line); }
.moment.is-done .m-head { background: var(--ok-soft); border: 0; }
.moment.is-done .chip { background: var(--ok-btn); border-color: var(--ok-btn); color: #fff; }
button.m-head { width: 100%; text-align: left; border: 0; }
.m-sum { color: var(--ok-ink); font-size: .9375rem; }
.m-all { display: flex; justify-content: flex-end; padding: 0 14px 14px; }

.dose { padding: 14px; }
.dose + .dose { border-top: 1px solid var(--line); }
.d-main { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.d-name { font-weight: 600; font-size: 1.0625rem; line-height: 1.3; text-wrap: balance; }
.d-meta { margin-top: 2px; color: var(--muted); font-size: .9375rem; }
.d-meta b { color: var(--ink); font-weight: 600; }
.take { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--accent); background: var(--paper); color: var(--accent-ink); font-weight: 600; font-size: .9375rem; transition: background .15s, color .15s, border-color .15s; }
.take:hover { background: var(--accent-soft); }
.take .ico { width: 18px; height: 18px; stroke-width: 2.4; }
.dose.is-taken .take { background: var(--ok-btn); border-color: var(--ok-btn); color: #fff; }
.d-when { margin-top: 6px; font-size: .875rem; color: var(--ok-ink); font-weight: 500; }

.fx-toggle { margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 999px; background: var(--paper); font-size: .9375rem; font-weight: 500; color: var(--ink2); }
.fx-toggle .ico { width: 18px; height: 18px; transition: transform .2s var(--ease); }
.fx-toggle[aria-expanded="true"] .ico { transform: rotate(180deg); }
.fx-toggle .n { background: var(--btn); color: #fff; border-radius: 999px; font-size: .75rem; padding: 0 7px; line-height: 1.5; }
.fx { margin-top: 10px; padding: 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); display: grid; gap: 14px; }
.fx h4 { margin: 0 0 4px; font-size: .875rem; font-weight: 600; color: var(--ink2); }
.fx p { color: var(--ink2); font-size: .9375rem; }
.fx textarea { width: 100%; min-height: 76px; padding: 10px 12px; border: 1px solid var(--line2); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; resize: vertical; }
.fx .log li { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); font-size: .9375rem; }
.fx .log time { color: var(--muted); font-size: .8125rem; display: block; }
.linkbtn { background: none; border: 0; padding: 4px 0; color: var(--accent-d); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.fx .help { font-size: .8125rem; color: var(--muted); }

/* ---------- Prescriber + facts ---------- */
.doc { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.doc .mono { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--blue-bg); color: var(--blue-ink); font-weight: 700; font-size: .875rem; letter-spacing: .02em; }
.doc .who { min-width: 0; line-height: 1.3; }
.doc .who small { display: block; color: var(--muted); font-size: .8125rem; }
.doc .who b { font-weight: 600; }
.doc .dept { display: inline-block; margin-left: 6px; font-size: .75rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--blue-bg); color: var(--blue-ink); }

/* Facts: no box. Label over value on a shared grid; a long value takes the whole row. */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; padding-top: 12px; border-top: 1px solid var(--line); }
.facts > div { min-width: 0; }
.facts .wide { grid-column: 1 / -1; }
.facts dt { font-size: .8125rem; line-height: 1.3; color: var(--muted); }
.facts dd { margin-top: 1px; font-weight: 600; line-height: 1.35; color: var(--ink); overflow-wrap: anywhere; }
@media (min-width: 560px) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } .facts .wide { grid-column: span 2; } }

/* ---------- Week plan ---------- */
.med { margin-top: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.med-top { padding: 14px; display: grid; gap: 12px; }
.med h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.25; }
.med-top .warn { margin-top: 0; }
.scroll { overflow-x: auto; border-top: 1px solid var(--line); }
table.wk { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 540px; }
.wk th, .wk td { padding: 8px 4px; text-align: center; font-size: .875rem; border-bottom: 1px solid var(--line); }
.wk tr:last-child td { border-bottom: 0; }
.wk th { font-weight: 600; color: var(--muted); font-size: .75rem; line-height: 1.2; background: var(--bg2); }
.wk .today { background: var(--accent-soft); }
.wk th.today { color: var(--accent-ink); }
.wk td.time, .wk th:first-child { position: sticky; left: 0; background: var(--paper); font-family: var(--serif); font-size: 1.0625rem; text-align: left; padding-left: 14px; width: 4.5rem; z-index: 1; }
.wk th:first-child { background: var(--bg2); }
.wk td.on { font-weight: 600; white-space: nowrap; } .wk td.off { color: var(--off); }
.wk td.tk { color: var(--ok-ink); font-weight: 700; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-top: 12px; display: grid; gap: 12px; }
.card h2 { font-size: 1.125rem; font-weight: 600; }
.card p { color: var(--ink2); }
.card .warn { margin-top: 0; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .04em; padding: 2px 9px; border-radius: 999px; background: var(--inv-bg); color: var(--inv-fg); }
.disclaimer { margin-top: 32px; color: var(--muted); font-size: .875rem; }

/* ---------- Forms ---------- */
form.card label { display: grid; gap: 4px; font-size: .875rem; font-weight: 500; color: var(--ink2); }
form.card input:not([type=checkbox]), form.card textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line2); border-radius: 10px; background: var(--bg); font: inherit; font-size: 1rem; color: var(--ink); }
form.card input:focus, form.card textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
form.card .warnlabel textarea { border: 1.5px solid var(--signal); background: var(--signal-bg); }
form.card label.check { display: flex; gap: 10px; align-items: center; font-size: 1rem; }
form.card input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.errors { color: var(--signal); font-weight: 600; font-size: .875rem; }
.errors:empty { display: none; }
.mrow { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.mrow + .mrow { margin-top: 8px; }
.mrow .t { font-size: .8125rem; color: var(--muted); min-width: 5.2rem; }
.mrow .name { font-weight: 600; flex: 1; min-width: 0; }
.ok-msg { color: var(--ok-ink); font-weight: 500; }
@media (max-width: 420px) { .two { grid-template-columns: 1fr; } }

.login-body { display: grid; place-items: center; padding: 20px; }
.login { width: 100%; max-width: 420px; }
.login-card { padding: 28px 22px; }
.login-card label { display: grid; gap: 6px; font-weight: 500; }
.login-card input { background: var(--bg); color: var(--ink); padding: 12px; border: 1px solid var(--line2); border-radius: 10px; font: inherit; font-size: 1rem; }

@media (min-width: 860px) {
  .desk-nav { display: flex; } .tabbar { display: none; } main { padding-bottom: 80px; }
  .title { font-size: 2.75rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Dark theme (same tokens as Voor Julia): follows the phone, the sun/moon button overrides ---------- */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #1c1716; --bg2: #261f1d; --paper: #2a2321; --ink: #f3ebe6; --ink2: #d8cdc7; --muted: #a8998f; --line: #3e3431; --line2: #54483f;
    --accent: #e07a63; --accent-d: #f29c86; --accent-soft: #3d2722; --accent-ink: #f4b3a3;
    --ok: #86c9a0; --ok-soft: #1f3228; --ok-ink: #9bd6b2; --btn: #c0553f; --ok-btn: #2f7049;
    --signal: #c9372d; --signal-bg: #3a1a17; --signal-ink: #ffd9d4; --signal-line: #7c3a35;
    --inv-bg: #f3ebe6; --inv-fg: #1c1716; --hero-bg: #282322; --hero-ink: #f5efea; --hero-soft: #b8aca6; --hero-accent: #f2a892;
    --blue-bg: #22344a; --blue-ink: #a9cbf2; --late-bg: #352c17; --late-line: #6b5824; --late-ink: #f2d98c; --nav-bg: rgba(42,35,33,.96); --off: #6b5e56;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px -16px rgba(0,0,0,.7); color-scheme: dark; } }
:root[data-theme="dark"] { --bg: #1c1716; --bg2: #261f1d; --paper: #2a2321; --ink: #f3ebe6; --ink2: #d8cdc7; --muted: #a8998f; --line: #3e3431; --line2: #54483f;
    --accent: #e07a63; --accent-d: #f29c86; --accent-soft: #3d2722; --accent-ink: #f4b3a3;
    --ok: #86c9a0; --ok-soft: #1f3228; --ok-ink: #9bd6b2; --btn: #c0553f; --ok-btn: #2f7049;
    --signal: #c9372d; --signal-bg: #3a1a17; --signal-ink: #ffd9d4; --signal-line: #7c3a35;
    --inv-bg: #f3ebe6; --inv-fg: #1c1716; --hero-bg: #282322; --hero-ink: #f5efea; --hero-soft: #b8aca6; --hero-accent: #f2a892;
    --blue-bg: #22344a; --blue-ink: #a9cbf2; --late-bg: #352c17; --late-line: #6b5824; --late-ink: #f2d98c; --nav-bg: rgba(42,35,33,.96); --off: #6b5e56;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px -16px rgba(0,0,0,.7); color-scheme: dark; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(120% 50% at 100% 0%, #f9dfd3 0%, transparent 60%), radial-gradient(100% 45% at 100% 85%, #f7e1e3 0%, transparent 70%), var(--bg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body::before { background: radial-gradient(120% 50% at 100% 0%, rgba(224,122,99,.16) 0%, transparent 60%), radial-gradient(90% 40% at 0% 40%, rgba(150,70,100,.12) 0%, transparent 70%), radial-gradient(100% 45% at 100% 85%, rgba(224,122,99,.1) 0%, transparent 70%), var(--bg); } }
:root[data-theme="dark"] body::before { background: radial-gradient(120% 50% at 100% 0%, rgba(224,122,99,.16) 0%, transparent 60%), radial-gradient(90% 40% at 0% 40%, rgba(150,70,100,.12) 0%, transparent 70%), radial-gradient(100% 45% at 100% 85%, rgba(224,122,99,.1) 0%, transparent 70%), var(--bg); }
.theme-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line2); background: var(--paper); color: var(--ink2); }
.theme-btn:hover { background: var(--bg2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.doc .who { flex: 1 1 auto; } .doc .who small { white-space: nowrap; }
@media (max-width: 420px) { .doc .mono { display: none; } }

/* UMC Utrecht logo: the SVG is transparent; it is drawn as a mask so it takes the theme colour (original blue on light, lighter blue on dark). */
.umc { margin-left: auto; flex: none; width: 82px; height: 24px; background: #1961ab; -webkit-mask: url(umc-logo.svg) no-repeat right center / contain; mask: url(umc-logo.svg) no-repeat right center / contain; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .umc { background: #7fb0ea; } }
:root[data-theme="dark"] .umc { background: #7fb0ea; }

/* Leaflet text */
.se { max-height: 340px; overflow-y: auto; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font-size: .9375rem; line-height: 1.45; overscroll-behavior: contain; }
.se p { margin: 0 0 8px; color: var(--ink2); }
.se .se-h { margin: 14px 0 4px; font-weight: 700; color: var(--ink); }
.se .se-urgent { font-weight: 600; color: var(--signal-ink); background: var(--signal-bg); border-radius: 8px; padding: 8px 10px; }
.se-list { margin: 0 0 8px; padding-left: 18px; list-style: disc; color: var(--ink2); }
.se-list li { margin: 2px 0; }
.fx-det { margin-top: 4px; } .fx-det summary { cursor: pointer; font-weight: 600; min-height: 40px; display: flex; align-items: center; }
.fx-det .se { margin-top: 8px; }
.fx .help a { color: var(--accent-d); }
.fx { grid-template-columns: minmax(0, 1fr); } .fx > div { min-width: 0; }
.se, .fx .help, .fx p { overflow-wrap: anywhere; }
.dose { min-width: 0; } .d-main > div { min-width: 0; }
/* .card p / .fx p set a grey text colour; the warning header must always be white on red */
.warn .warn-h { color: #fff; }
.warn li { color: var(--signal-ink); }

/* Phone chooser */
.seg { display: inline-grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px; border: 1px solid var(--line2); border-radius: 999px; background: var(--bg2); width: 100%; max-width: 340px; }
.seg button { min-height: 44px; border: 0; border-radius: 999px; background: transparent; font-weight: 600; color: var(--ink2); }
.seg button[aria-selected="true"] { background: var(--btn); color: #fff; }
.lead { display: grid; gap: 4px; font-size: .875rem; font-weight: 500; color: var(--ink2); max-width: 340px; }
.lead select { padding: 11px 12px; border: 1px solid var(--line2); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; font-size: 1rem; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--ink2); }
.alarms { margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font: inherit; font-size: .9375rem; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; user-select: text; }

/* Dose row hierarchy: name = headline, strength = secondary, dose = pill (what to take), route = quiet */
.d-name { font-size: 1.1875rem; font-weight: 700; line-height: 1.25; letter-spacing: -.005em; color: var(--ink); }
.d-name .d-str { display: block; margin-top: 1px; font-size: .9375rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.d-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.d-dose { padding: 3px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: .9375rem; border: 1px solid var(--line2); }
.d-route { font-size: .875rem; color: var(--muted); }

/* Agenda card spacing + app chips */
.card .steps { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
.card .actions { margin-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line2); background: var(--paper); color: var(--ink2); font-weight: 600; font-size: .9375rem; }
.chips button[aria-checked="true"] { border-color: var(--btn); background: var(--accent-soft); color: var(--accent-ink); }
a.btn { text-decoration: none; }

/* Route badge: how the medicine is given (IV stands out) */
.route { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px 3px 8px; border-radius: 999px; border: 1px solid var(--line2); background: var(--paper); color: var(--ink2); font-size: .875rem; font-weight: 600; white-space: nowrap; }
.route .ico { width: 16px; height: 16px; stroke-width: 1.9; }
.route.r-iv { background: var(--blue-bg); color: var(--blue-ink); border-color: transparent; }

.se-unknown { padding: 12px 14px; border: 1.5px dashed var(--line2); border-radius: 10px; background: var(--paper); }
.se-unknown p { margin: 0 0 8px; color: var(--ink); }
.se-links { margin: 0; padding-left: 18px; list-style: disc; display: grid; gap: 6px; }
.se-links a { color: var(--accent-d); overflow-wrap: anywhere; }

/* Moment header is a real toggle */
button.m-head { width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; color: inherit; font: inherit; }
button.m-head:hover { filter: brightness(.97); }
.moment.is-folded button.m-head { border-bottom: 0; }
.m-chev { display: grid; place-items: center; color: var(--muted); }
.m-chev .ico { width: 20px; height: 20px; transition: transform .2s var(--ease); transform: rotate(180deg); }
.moment.is-folded .m-chev .ico { transform: none; }
.m-head .m-sum { margin-left: 4px; color: var(--muted); font-size: .9375rem; }
.moment.is-done .m-head .m-sum { color: var(--ok-ink); }
.m-head .chip { margin-left: auto; }
.m-head .m-sum + .chip { margin-left: auto; }

/* Moment header: time (tap = change time) + fold area */
.m-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 8px; }
.m-time { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 10px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); cursor: pointer; }
.m-time .ico { width: 16px; height: 16px; color: var(--muted); }
.m-time .m-clock { text-decoration: underline dotted var(--muted); text-underline-offset: 6px; text-decoration-thickness: 1.5px; }
.m-time:hover, .m-time[aria-expanded="true"] { background: rgba(127,127,127,.14); }
.m-shift { font-size: .8125rem; color: var(--late-ink); background: var(--late-bg); border: 1px solid var(--late-line); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.m-fold { flex: 1; min-width: 0; min-height: 48px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 0 6px 0 8px; border: 0; background: transparent; color: inherit; cursor: pointer; border-radius: 12px; }
.m-fold .chip { margin-left: 0; }
.m-fold .m-sum { margin-right: auto; }
.m-edit { padding: 12px 14px 14px; border-bottom: 1px solid var(--line); background: var(--bg); display: grid; gap: 10px; }
.m-edit label { display: grid; gap: 4px; font-size: .875rem; font-weight: 500; color: var(--ink2); }
.m-edit input[type="time"] { max-width: 180px; padding: 10px 12px; border: 1px solid var(--line2); border-radius: 10px; background: var(--paper); color: var(--ink); font: inherit; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.moment.is-folded .m-head { border-bottom: 0; }

/* Medicine card header + clear blocks (Weekplan, Zo nodig) */
.med-name { font-size: 1.25rem; font-weight: 700; line-height: 1.25; letter-spacing: -.005em; color: var(--ink); text-wrap: balance; }
.med-name .d-str { display: block; margin-top: 2px; font-size: .9375rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.card.as-needed .d-meta, .med-top .d-meta { margin-top: 0; }
.usage { display: flex; align-items: center; gap: 10px; margin: 0; padding: 11px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; line-height: 1.3; }
.usage .ico { width: 20px; height: 20px; flex: none; }
.card .usage, .med-top .usage { color: var(--accent-ink); }
.note-box { padding: 12px 14px; border: 1px solid var(--line2); border-radius: 12px; background: var(--bg); }
.note-box h4 { margin: 0 0 4px; font-size: .8125rem; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.card .note-box p, .med-top .note-box p { margin: 0; color: var(--ink); font-size: .9375rem; line-height: 1.45; }
.mchips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.mchip { font-size: .875rem; padding: 4px 11px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); color: var(--ink2); }
.mchip b { font-weight: 600; color: var(--muted); margin-right: 4px; }
.card .mchips, .med-top .mchips { color: var(--ink2); }
details.fx-det > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line2); border-radius: 999px; background: var(--paper); font-weight: 600; font-size: .9375rem; color: var(--ink2); cursor: pointer; }
details.fx-det > summary::-webkit-details-marker { display: none; }
details.fx-det > summary::after { content: ''; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .2s var(--ease); }
details.fx-det[open] > summary::after { transform: rotate(225deg) translateY(-2px); }
.card.as-needed { gap: 14px; }


/* ---------- Hero v4: the next-dose ticket. Clock time on top, countdown under it, then one aligned row per medicine. Every colour below is solid (mixed into --hero-bg) so contrast is predictable. ---------- */
.hero { --hero-line: color-mix(in srgb, var(--hero-ink) 13%, var(--hero-bg)); --hero-fill: color-mix(in srgb, var(--hero-ink) 7%, var(--hero-bg)); --hero-tint: color-mix(in srgb, var(--hero-accent) 13%, var(--hero-bg));
  margin-top: 16px; padding: 16px 18px 4px; border-radius: 20px; border: 1px solid var(--hero-line); background: var(--hero-bg); color: var(--hero-ink); box-shadow: var(--shadow), 0 22px 40px -28px rgba(40,20,14,.38); }
.hero-top { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
.h-time { display: inline-flex; align-items: center; gap: 10px; min-height: 60px; margin-left: -8px; padding: 0 10px 0 8px; border: 0; border-radius: 14px; background: transparent; color: var(--hero-ink); cursor: pointer; }
.h-time time { font-family: var(--serif); font-size: 3.5rem; line-height: 1; letter-spacing: -.025em; font-weight: 400; font-variant-numeric: lining-nums tabular-nums; }
.h-time .ico { width: 18px; height: 18px; color: var(--hero-soft); }
.h-time:hover, .h-time[aria-expanded="true"] { background: var(--hero-fill); }
.hero .day { padding: 4px 12px; border-radius: 999px; background: var(--hero-tint); color: var(--hero-accent); font-size: .875rem; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.hero .m-shift { padding: 3px 10px; border: 1px solid var(--hero-line); background: transparent; color: var(--hero-soft); font-size: .8125rem; line-height: 1.4; }
.hero .count { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 10px; margin: 2px 0 0; color: var(--hero-soft); font-size: 1rem; line-height: 1.3; white-space: nowrap; }
.hero .cd { display: inline-flex; align-items: baseline; gap: 4px; }
.hero .cd b { min-width: 1ch; font-family: var(--text); font-size: 1.625rem; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; color: var(--hero-ink); font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "tnum" 1, "zero" 0; text-align: right; }
.hero .cd i { font-style: normal; font-size: .875rem; font-weight: 500; color: var(--hero-soft); }
.hero .count .sep { display: none; }
.hero .m-edit { margin-top: 10px; padding: 14px 0 16px; border: 0; border-top: 1px solid var(--hero-line); border-bottom: 1px solid var(--hero-line); border-radius: 0; background: transparent; }
.hero .m-edit + .count { margin-top: 12px; }
.hero .m-edit label, .hero .m-edit .small { color: var(--hero-soft); }
.hero ul { margin-top: 16px; }
.hero .hrow { display: block; padding: 14px 0 0; border-top: 1px solid var(--hero-line); }
.hero .hrow:first-child { border-top-style: dashed; }
.hero .hrow-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 4px 12px; }
.hero .what-name { min-width: 0; font-size: 1.0625rem; font-weight: 600; line-height: 1.3; color: var(--hero-ink); overflow-wrap: anywhere; }
.hero .amt { display: inline-flex; align-items: baseline; gap: 7px; max-width: 11rem; padding: 3px 11px; border-radius: 999px; background: var(--hero-fill); color: var(--hero-ink); font-size: .9375rem; font-weight: 600; line-height: 1.45; font-variant-numeric: tabular-nums; }
.hero .amt .dl { margin: 0; font-size: .6875rem; font-weight: 600; letter-spacing: .06em; color: var(--hero-soft); opacity: 1; }
.hero .what-sub { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 24px; }
.hero .what-sub small { font-size: .9375rem; font-weight: 400; line-height: 1.4; color: var(--hero-soft); }
.hero .route { margin: 0; padding: 0; gap: 5px; border: 0; background: transparent; color: var(--hero-soft); font-size: .875rem; font-weight: 500; line-height: 1.4; }
.hero .route .ico { width: 15px; height: 15px; }
.hero .route.r-iv { padding: 2px 10px 2px 7px; background: var(--blue-bg); color: var(--blue-ink); font-weight: 600; }
.hero .what-last { white-space: nowrap; }
.hero .info-btn { margin: -3px 0 -1px 8px; vertical-align: middle; }
.hero .info-panel { margin: 10px 0 4px; }
.hero .fx-toggle { display: inline-flex; justify-content: flex-start; gap: 4px; width: auto; min-height: 44px; margin: 2px 0 0; padding: 0 12px 0 0; border: 0; background: transparent; color: var(--hero-accent); font-size: .875rem; font-weight: 600; }
.hero .fx-toggle .fx-label { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; transition: text-decoration-color .15s; }
.hero .fx-toggle:hover .fx-label, .hero .fx-toggle[aria-expanded="true"] .fx-label { text-decoration-color: currentColor; }
.hero .fx-toggle .ico { width: 16px; height: 16px; color: currentColor; }
.hero .fx { margin: 0; padding: 2px 0 18px; border: 0; border-radius: 0; background: transparent; text-align: left; color: var(--ink); }
.hero .empty { padding: 6px 0 14px; color: var(--hero-soft); }
@media (min-width: 860px) { .hero { padding: 22px 26px 6px; } .h-time time { font-size: 4.5rem; } .h-time { min-height: 76px; } .hero .cd b { font-size: 2rem; } .hero .count { font-size: 1.0625rem; } }

/* ---------- Wijzigen list ---------- */
.mrow { align-items: center; gap: 12px; padding: 14px; }
.mrow-main { flex: 1; min-width: 0; }
.mrow .d-name { font-size: 1.0625rem; }
.mrow-times { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 0; }
.tchip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--line2); color: var(--accent-ink); font-weight: 700; font-size: .9375rem; font-variant-numeric: tabular-nums; }
.tchip-need { background: var(--bg2); color: var(--ink2); }

/* "Dosis" label inside the dose pill: the amount to take each time, not the pack strength */
.dl { margin-right: 7px; font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; opacity: .75; }

/* Bijwerkingen: a full-width row at the bottom of each medicine (aligned with the content, not a floating pill) */
.fx-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; margin-top: 12px; padding: 0 2px; min-height: 46px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; font-weight: 600; font-size: .9375rem; color: var(--ink2); text-align: left; }
.fx-toggle:hover { color: var(--ink); }
.fx-label { display: inline-flex; align-items: center; gap: 8px; }
.fx-toggle .ico { color: var(--muted); }
.fx { margin-top: 4px; }
.fx-toggle { padding-left: 0; padding-right: 0; }

/* ---------- "i" info button + panel (blue, small press animation) ---------- */
:root { --info: #2467c0; --info-soft: #e6effa; --info-ink: #174a8f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --info: #3a7bd5; --info-soft: #1d2a3c; --info-ink: #a9c9f4; } }
:root[data-theme="dark"] { --info: #3a7bd5; --info-soft: #1d2a3c; --info-ink: #a9c9f4; }
.d-name-t { display: inline; }
.info-btn { position: relative; display: inline-grid; place-items: center; width: 26px; height: 26px; margin: 0 0 0 8px; padding: 0; vertical-align: 2px; border: 0; border-radius: 50%; background: var(--info); color: #fff; font: 700 .9375rem/1 var(--serif); font-style: italic; cursor: pointer; transition: transform .14s cubic-bezier(.2,.8,.2,1), box-shadow .2s; -webkit-tap-highlight-color: transparent; }
.info-btn::after { content: ''; position: absolute; inset: -9px; }
.info-btn:hover { box-shadow: 0 0 0 4px color-mix(in srgb, var(--info) 22%, transparent); }
.info-btn:active { transform: scale(.86); }
.info-btn.on { box-shadow: 0 0 0 4px color-mix(in srgb, var(--info) 30%, transparent); }
.info-panel { margin-top: 10px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--info) 35%, transparent); border-radius: 12px; background: var(--info-soft); color: var(--ink); text-align: left; }
.info-panel h4 { margin: 0 0 4px; font-size: .8125rem; font-weight: 700; color: var(--info-ink); letter-spacing: .02em; }
.info-panel p { margin: 0; color: var(--ink); font-size: .9375rem; line-height: 1.45; }
.info-panel p + p { margin-top: 8px; }
.info-panel .help { font-size: .8125rem; color: var(--ink2); }
.info-panel .help a { color: var(--info-ink); overflow-wrap: anywhere; }
.info-panel.enter { animation: infoIn .22s cubic-bezier(.2,.8,.2,1); transform-origin: top left; }
@keyframes infoIn { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }
