/* Familie Link: stijl volgens het Familie App-design system ("Zacht Blauw") */
:root {
  --bg: #EDF3FB; --card: #FFFFFF; --sub: #F4F8FE; --line: #E4ECF7; --line2: #EEF3FA;
  --ink: #1E2B3C; --ink2: #45566E; --ink3: #6B7A90; --weak: #94A3B8;
  --primary: #4D82F3; --primary-press: #3B6FE0; --chip: #DCE9FE; --chip-ink: #2C5BC7; --chip2: #E7EEFD; --chip2-ink: #3B67C4;
  --empty: #C7D4E8; --badge: #E5637E; --badge-ink: #FFFFFF;
  --green-bg: #D9F2E3; --green: #2E7D57; --green-ink: #14532D; --green-dot: #22A06B;
  --orange-bg: #FFE9DC; --orange: #E0762F; --orange-ink: #7A551B;
  --yellow-bg: #FFF4D6; --yellow-av: #FFD262; --yellow-ink: #7A551B; --yellow-accent: #E8A020;
  --red: #E5484D;
  --shadow-card: 0 4px 16px rgba(40,60,100,0.07); --shadow-el: 0 2px 8px rgba(40,60,100,0.06); --shadow-btn: 0 8px 16px rgba(77,130,243,0.35);
  --head-parent: linear-gradient(160deg, #FDF3D8 0%, #EDF3FB 60%);
  --nav-bg: #FFFFFF; --nav-pill: #DCE9FE; --nav-pill-ink: #2C5BC7;
  --scrim: rgba(30,43,60,0.42);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1624; --card: #1B2537; --sub: #141D2E; --line: #24344F; --line2: #24344F;
    --ink: #ECF2FA; --ink2: #B4C2D6; --ink3: #8DA0B9; --weak: #64748C;
    --chip: #24344F; --chip-ink: #8FB4FA; --chip2: #24344F; --chip2-ink: #8FB4FA; --empty: #37455E; --badge: #F0698A; --badge-ink: #2A1420;
    --green-bg: #1B3328; --green: #5FC48E; --green-ink: #5FC48E; --green-dot: #5FC48E;
    --orange-bg: #3A2A20; --orange: #F29A5C; --orange-ink: #F29A5C;
    --yellow-bg: #33301E; --yellow-ink: #E8B44C; --yellow-accent: #FFC53D; --red: #F0698A;
    --shadow-card: none; --shadow-el: none; --shadow-btn: none;
    --head-parent: linear-gradient(160deg, #2B2E20 0%, #0F1624 60%);
    --nav-bg: #141D2E; --nav-pill: #2C4370; --nav-pill-ink: #B7CEFC; --scrim: rgba(0,0,0,0.55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1624; --card: #1B2537; --sub: #141D2E; --line: #24344F; --line2: #24344F;
  --ink: #ECF2FA; --ink2: #B4C2D6; --ink3: #8DA0B9; --weak: #64748C;
  --chip: #24344F; --chip-ink: #8FB4FA; --chip2: #24344F; --chip2-ink: #8FB4FA; --empty: #37455E; --badge: #F0698A; --badge-ink: #2A1420;
  --green-bg: #1B3328; --green: #5FC48E; --green-ink: #5FC48E; --green-dot: #5FC48E;
  --orange-bg: #3A2A20; --orange: #F29A5C; --orange-ink: #F29A5C;
  --yellow-bg: #33301E; --yellow-ink: #E8B44C; --yellow-accent: #FFC53D; --red: #F0698A;
  --shadow-card: none; --shadow-el: none; --shadow-btn: none;
  --head-parent: linear-gradient(160deg, #2B2E20 0%, #0F1624 60%);
  --nav-bg: #141D2E; --nav-pill: #2C4370; --nav-pill-ink: #B7CEFC; --scrim: rgba(0,0,0,0.55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Plus Jakarta Sans', system-ui, sans-serif; font-weight: 700; -webkit-tap-highlight-color: transparent; }
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
button { border: 0; margin: 0; cursor: pointer; background: none; padding: 0; }
a { color: var(--chip-ink); }
:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(77,130,243,0.45) !important; border-radius: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.app.no-nav { padding-bottom: 32px; }
.head { padding: calc(20px + env(safe-area-inset-top)) 24px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.head.parent, .head.kid-w { background: none; }
.date { font-size: 14px; font-weight: 600; color: var(--ink3); }
h1 { margin: 0; font-weight: 800; font-size: 26px; line-height: 1.1; }
h1 .accent { color: var(--yellow-accent); }
.sec { display: flex; justify-content: space-between; align-items: baseline; padding: 20px 24px 0; gap: 10px; }
.sec h2 { margin: 0; font-weight: 800; font-size: 18px; }
.sec .meta, .meta { font-size: 13px; font-weight: 700; color: var(--ink3); }
.label { margin: 0; padding: 20px 28px 0; font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--ink3); text-transform: uppercase; }
.stack { display: flex; flex-direction: column; gap: 12px; padding: 12px 24px 0; }
.card { background: var(--card); border-radius: 26px; padding: 16px; box-shadow: var(--shadow-card); }
.card.list { padding: 4px 16px; }
.card + .card { margin-top: 0; }
.mx { margin: 12px 24px 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.row + .row { border-top: 1.5px solid var(--line2); }
.grow { flex: 1; min-width: 0; }
.t { font-weight: 700; font-size: 14.5px; }
.t8 { font-weight: 800; font-size: 15px; }
.s { font-size: 12.5px; font-weight: 700; color: var(--ink3); }
.big { font-weight: 800; font-size: 22px; line-height: 1.1; }
.right { text-align: right; }
.avatar { width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%; background: var(--av); color: var(--av-ink); font-weight: 800; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.avatar.lg { width: 48px; height: 48px; border: 3px solid var(--card); box-shadow: 0 4px 12px rgba(40,60,100,.15); }
.bar { height: 10px; border-radius: 999px; background: var(--kid-bg); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--kid); }
.split { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--ink3); }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px; font-size: 12.5px; font-weight: 800; background: var(--sub); color: var(--ink2); white-space: nowrap; }
.pill.green { background: var(--green-bg); color: var(--green-ink); }
.pill.orange { background: var(--orange-bg); color: var(--orange-ink); }
.pill.blue { background: var(--chip); color: var(--chip-ink); }
.pill.red { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); }
.btn.lockbtn { width: 100%; color: var(--red) !important; flex-wrap: wrap; gap: 2px 8px; }
.btn.lockbtn .s { width: 100%; font-weight: 700; font-size: 12.5px; color: var(--ink3); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.kidcard { display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: var(--ink); cursor: pointer; text-align: left; width: 100%; transition: transform .15s ease; }
.kidcard:active { transform: scale(.98); }
.low { color: var(--orange); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 12px 18px; font-weight: 800; font-size: 14px; min-height: 44px; text-decoration: none; }
.btn.primary { background: var(--primary); color: #FFFFFF; box-shadow: var(--shadow-btn); }
.btn.primary:active { background: var(--primary-press); transform: scale(.97); }
.btn.secondary { background: var(--chip2); color: var(--chip2-ink); }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: var(--shadow-el); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btns { display: flex; gap: 8px; }
.btns > * { flex: 1; }
.quick { display: flex; gap: 10px; padding: 14px 24px 0; }
.quick .btn { flex: 1; justify-content: flex-start; padding: 8px 14px 8px 8px; }
.ico { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ico.green { background: var(--green-bg); color: var(--green); }
.ico.orange { background: var(--orange-bg); color: var(--orange); }
.ico.blue { background: var(--chip); color: var(--chip-ink); }
.ico.tile { width: 40px; height: 40px; border-radius: 13px; font-weight: 800; font-size: 15px; }
.iconbtn { width: 44px; height: 44px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow-el); display: inline-flex; align-items: center; justify-content: center; position: relative; flex-shrink: 0; color: var(--ink); }
.badge-dot { position: absolute; top: 8px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--badge); border: 2px solid var(--card); }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.seg { display: flex; background: var(--card); border-radius: 999px; padding: 4px; box-shadow: var(--shadow-el); }
.seg button { flex: 1; border-radius: 999px; padding: 9px 10px; font-weight: 700; font-size: 13.5px; color: var(--ink3); min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--chip); color: var(--ink); font-weight: 800; }
.seg button.kid[aria-pressed="true"] { background: var(--kid-bg); }

.ring { position: relative; width: 168px; height: 168px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring .v { font-weight: 800; font-size: 30px; line-height: 1.05; }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.days > div { display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--sub); border-radius: 16px; padding: 10px 0; }
.days > div.today { background: var(--kid-bg); box-shadow: 0 0 0 2px var(--kid); }
.days .d { font-size: 12px; font-weight: 800; color: var(--ink3); }
.days .today .d { color: var(--kid); }
.days .m { font-size: 13px; font-weight: 800; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px 24px 0; }
.tile { border-radius: 22px; padding: 14px; text-align: left; color: var(--ink); }
.tile .n { font-weight: 800; font-size: 22px; }
.tile .l { font-weight: 800; font-size: 13px; }
.tile.blue { background: var(--chip); } .tile.blue .l { color: var(--chip-ink); }
.tile.green { background: var(--green-bg); } .tile.green .l { color: var(--green); }
.tile.red { background: var(--kid-bg-red, #FDECEF); } .tile.red .l { color: #C4405E; }
.info { display: flex; gap: 12px; align-items: flex-start; background: var(--chip); border-radius: 22px; padding: 14px 16px; color: var(--chip-ink); font-size: 13px; }
.info b { display: block; color: var(--ink); font-size: 14.5px; font-weight: 800; }
.warnbox { background: var(--yellow-bg); border-radius: 16px; padding: 10px 12px; font-size: 12.5px; color: var(--ink2); margin-bottom: 10px; }
.empty { text-align: center; padding: 28px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .ico { width: 56px; height: 56px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--ink3); text-transform: uppercase; }
.input { width: 100%; background: var(--sub); border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 14px; font-weight: 700; font-size: 15px; color: var(--ink); min-height: 48px; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(77,130,243,0.25); }
.err { color: var(--red); font-size: 13px; font-weight: 700; }
.chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.chips button { background: var(--sub); border-radius: 18px; padding: 14px 4px; font-weight: 800; font-size: 15px; min-height: 48px; }
.chips button[aria-pressed="true"] { background: var(--primary); color: #FFFFFF; }
.dayrow { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 10px; }
.dayrow .times { display: flex; gap: 6px; align-items: center; }
.dayrow .times .input { min-height: 42px; padding: 8px 10px; }
.dayrow .kies { display: flex; gap: 8px; min-width: 0; }
.dayrow .kies select { flex: 1; min-width: 0; }
.dayrow .kies .min { width: 92px; flex: none; }
.eigen .eigen-rij { display: flex; gap: 10px; align-items: center; }
.eigen .eigen-rij .input { width: 120px; flex: none; }
.switch { width: 48px; height: 28px; border-radius: 999px; background: var(--line); position: relative; flex-shrink: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 2px 6px rgba(40,60,100,.2); transition: left .15s; }
.switch[aria-checked="true"] { background: var(--primary); }
.switch[aria-checked="true"]::after { left: 23px; }

nav.nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--nav-bg); border-top: 1.5px solid var(--line); z-index: 5; }
nav.nav .in { max-width: 480px; margin: 0 auto; display: flex; padding: 10px 8px calc(12px + env(safe-area-inset-bottom)); gap: 2px; }
nav.nav a { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--ink3); font-size: 11.5px; font-weight: 700; }
nav.nav a span.p { padding: 5px 18px; border-radius: 999px; display: flex; position: relative; }
nav.nav a[aria-current="page"] { color: var(--ink); font-weight: 800; }
nav.nav a[aria-current="page"] span.p { background: var(--nav-pill); color: var(--nav-pill-ink); }
.count { position: absolute; top: -2px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--badge); color: var(--badge-ink); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }

.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 10; animation: fade .15s ease; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 11; max-width: 480px; margin: 0 auto; background: var(--card); border-radius: 32px 32px 0 0; padding: 12px 24px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 18px; max-height: 92vh; max-height: calc(100% - 24px - env(safe-area-inset-top)); overflow: auto; overscroll-behavior: contain; animation: up .2s ease; }
.sheet .grip { width: 44px; height: 5px; border-radius: 999px; background: var(--line); align-self: center; }
.sheet h2 { margin: 0; font-weight: 800; font-size: 22px; }
.sheet .top { display: flex; justify-content: space-between; align-items: center; }
.sheet .iconbtn { background: var(--sub); box-shadow: none; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 800; opacity: 0; pointer-events: none; transition: all .2s; z-index: 20; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.sk { background: var(--line2); border-radius: 999px; animation: puls 1.4s ease-in-out infinite; }
@keyframes puls { 50% { opacity: .5; } }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.stale { opacity: .6; }
.center { text-align: center; }
code, .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; background: var(--sub); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
pre.mono { display: block; padding: 10px 12px; white-space: pre-wrap; margin: 0; }

/* ---------- kindscherm ---------- */
.kid-c { color: var(--kid); }
.ring.big { width: 200px; height: 200px; }
.ring.big .v { font-size: 40px; }
.kid-ring { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px 16px 20px; }
.kid-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; padding: 12px 24px 0; }
.kid-apps > div { background: var(--green-bg); border-radius: 22px; padding: 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; text-align: center; overflow-wrap: anywhere; }
.kid-apps > div span { width: 40px; height: 40px; border-radius: 14px; background: var(--card); color: var(--green-ink); font-weight: 800; font-size: 15px; display: flex; align-items: center; justify-content: center; }
.kid-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; align-items: end; min-height: 120px; }
.kid-week > div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.kid-week i { width: 18px; border-radius: 999px; display: block; }
.kid-week span { font-size: 12px; font-weight: 800; color: var(--ink3); }
.kid-full { position: fixed; inset: 0; z-index: 10; background: var(--scrim); display: flex; align-items: center; justify-content: center; padding: 24px; animation: fade .15s ease; }
.kid-dialog { width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 28px 22px 22px; border-radius: 32px; }
.kid-dialog h1 { font-size: 24px; }
.kid-p { margin: 0; padding: 0 16px; font-size: 15px; font-weight: 700; color: var(--ink2); line-height: 1.45; text-align: center; }
.kid-end { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; text-align: center; background: var(--bg); padding: calc(64px + env(safe-area-inset-top)) 24px calc(32px + env(safe-area-inset-bottom)); gap: 10px; }
.kid-end h1 { font-size: 28px; padding: 14px 8px 0; }
.kid-art { max-width: 60vw; height: auto; }
.kid-still { width: 100%; max-width: 420px; text-align: left; margin-top: 16px; }
.kid-still .kid-apps { padding: 12px 0 0; }
.kid-foot { margin-top: auto; padding-top: 24px; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 10px; }
.main { width: 100%; }
.app.kidc .main { max-width: 640px; margin: 0 auto; }

/* ---------- tablet ---------- */
@media (min-width: 640px) {
  .app { max-width: 760px; }
  .kids { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
  .stack.grid2 { gap: 12px; }
  .sheet { bottom: auto; top: 50%; left: 50%; right: auto; width: min(480px, calc(100vw - 48px)); transform: translate(-50%, -50%); border-radius: 32px; padding-bottom: 28px; animation: pop .18s ease; }
  .sheet .grip { display: none; }
  @keyframes pop { from { opacity: 0; transform: translate(-50%, -46%); } }
}
/* ---------- laptop en desktop: zijbalk ---------- */
nav.nav .brand { display: none; }
@media (min-width: 1000px) {
  .app { max-width: none; padding: 0 0 40px 250px; }
  .app.no-nav { padding-left: 0; }
  .main { width: 100%; max-width: 1240px; margin: 0; padding: 0 12px; }
  .app.no-nav .main { margin: 0 auto; max-width: 560px; }
  .head { padding: 32px 24px 8px; }
  .head .date { font-size: 15px; }
  h1 { font-size: 32px; }
  .sec h2 { font-size: 20px; }
  nav.nav { top: 0; right: auto; width: 250px; border-top: 0; }
  nav.nav .in { flex-direction: column; max-width: none; height: 100%; padding: 22px 12px; gap: 4px; }
  nav.nav .brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; color: var(--ink); }
  nav.nav .brand .logo { width: 42px; height: 42px; border-radius: 13px; background: var(--primary); color: #FFFFFF; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  nav.nav .brand b { display: block; font-weight: 800; font-size: 17px; line-height: 1.2; }
  nav.nav .brand small { display: block; font-size: 12px; font-weight: 700; color: var(--ink3); }
  nav.nav a { flex: 0 0 auto; flex-direction: row; gap: 12px; font-size: 15px; font-weight: 700; color: var(--ink); padding: 11px 16px; border-radius: 999px; }
  nav.nav a span.p { padding: 0; background: none !important; color: inherit !important; }
  nav.nav a[aria-current="page"] { background: var(--nav-pill); color: var(--ink); font-weight: 800; }
  nav.nav a:hover:not([aria-current]) { background: var(--sub); }
  nav.nav a span.p .count { position: absolute; top: -6px; right: -10px; }
  .kids { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
  .cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 8px; align-items: start; }
  .tiles { max-width: 720px; }
  .quick { justify-content: flex-start; }
  .quick .btn { flex: 0 1 240px; }
  .toast { bottom: 32px; left: calc(50% + 125px); }
  .app.no-nav ~ .toast, body.kidmode .toast { left: 50%; }
  .app.kidc .main { max-width: 900px; margin: 0 auto; }
  .app.kidc .kid-ring { flex-direction: row; justify-content: center; gap: 32px; }
}
@media (hover: hover) {
  .kidcard:hover { box-shadow: 0 8px 24px rgba(40,60,100,0.12); }
  .btn.ghost:hover, .btn.secondary:hover { filter: brightness(0.97); }
}
.notice { touch-action: pan-y; user-select: none; }
.notice.read { opacity: .75; }
.readlist summary { cursor: pointer; padding: 18px 4px 0; list-style: revert; }
