/* FamilyCats — tokens en componenten */

:root {
  /* Kleur */
  --paper: #f7f4ef;
  --surface: #fffdf9;
  --sunken: #efeae2;
  --line: #e4ded4;
  --line-strong: #d3cbbf;
  --ink: #211d1a;
  --ink-2: #6f665e;
  --ink-3: #8f857b;
  --accent: #8b4a2f;
  --accent-hover: #773f27;
  --accent-soft: #f1e5dd;
  --accent-ink: #fffdf9;
  --ok: #4f6f52;
  --ok-soft: #e6ece3;
  --let: #a8741a;
  --let-soft: #f5ead3;
  --alarm: #a33b2c;
  --alarm-soft: #f5e1dc;
  --band: #e9e3d6;
  --focus: #8b4a2f;

  /* Typografie */
  --font-ui: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 22px;
  --fs-2xl: 28px;
  --fs-3xl: 34px;
  --lh: 1.45;

  /* Ruimte */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s7: 32px;
  --s8: 40px;
  --s9: 56px;

  /* Vorm */
  --r: 6px;
  --r-pill: 999px;
  --tap: 44px;
  --sidebar: 236px;
  --phone: 430px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t-fast: 150ms;
  --t: 220ms;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 58px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  line-height: var(--lh);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.icon { flex: none; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--accent-soft); }

/* ---------- Shell ---------- */

.shell { min-height: 100dvh; }
.main { min-width: 0; }
.view { padding: var(--s5) var(--s4) calc(var(--tabbar-h) + var(--safe-bottom) + var(--s8)); }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--s2);
  min-height: calc(52px + var(--safe-top));
  padding: var(--safe-top) var(--s2) 0 var(--s4);
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-fast);
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-title.fade { opacity: 0; transition: opacity var(--t-fast); }
.topbar.scrolled .topbar-title.fade { opacity: 1; }
.topbar-title { flex: 1; min-width: 0; font-weight: 600; font-size: var(--fs-lg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-back { margin-left: calc(var(--s2) * -1); }
.topbar-actions { display: flex; align-items: center; gap: 2px; }
.topbar-search { display: none; }

.wordmark { font-family: var(--font-display); font-weight: 560; font-size: 19px; letter-spacing: -.01em; font-variation-settings: 'opsz' 36; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding-bottom: var(--safe-bottom);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.tabbar a {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--tabbar-h);
  font-size: 11px; font-weight: 500; color: var(--ink-3);
}
.tabbar a[aria-current="page"] { color: var(--accent); }
.tabbar .badge { position: absolute; top: 6px; left: calc(50% + 6px); }

.sidebar { display: none; }

.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--accent); color: var(--accent-ink);
  font-size: 11px; font-weight: 600; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.icon-btn { position: relative; }
.icon-btn .badge { position: absolute; top: 4px; right: 2px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }

@media (min-width: 960px) {
  .shell.admin { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
  .shell.admin .sidebar {
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100dvh;
    padding: var(--s5) var(--s3) var(--s3);
    border-right: 1px solid var(--line);
    background: var(--paper);
  }
  .shell.admin .tabbar { display: none; }
  .shell.admin .topbar { padding: 0 var(--s7); min-height: 60px; gap: var(--s3); }
  .shell.admin .topbar-title { display: none; }
  .shell.admin .topbar-search { display: block; flex: 1; max-width: 420px; }
  .shell.admin .topbar .only-mobile { display: none; }
  .shell.admin .view { padding: var(--s6) var(--s7) var(--s9); max-width: 1320px; }
  .shell.admin .topbar-back { display: none; }
}

.side-brand { display: flex; align-items: center; gap: var(--s2); padding: 0 var(--s2) var(--s5); }
.side-nav { display: flex; flex-direction: column; gap: 1px; }
.side-nav a {
  display: flex; align-items: center; gap: var(--s3);
  height: 36px; padding: 0 var(--s2);
  border-radius: var(--r);
  font-size: 14px; font-weight: 500; color: var(--ink-2);
}
.side-nav a:hover { background: var(--sunken); color: var(--ink); }
.side-nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.side-nav a[aria-current="page"] .icon { color: var(--accent); }
.side-nav .badge { margin-left: auto; }
.side-group { margin: var(--s4) var(--s2) var(--s1); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.side-foot { margin-top: auto; padding-top: var(--s3); border-top: 1px solid var(--line); }
.profile-btn {
  display: flex; align-items: center; gap: var(--s2); width: 100%;
  padding: var(--s2); border: 0; border-radius: var(--r); background: none; text-align: left; cursor: pointer;
}
.profile-btn:hover { background: var(--sunken); }
.profile-btn .who { flex: 1; min-width: 0; line-height: 1.25; }
.profile-btn .who span { display: block; font-size: var(--fs-xs); color: var(--ink-2); }

/* Gastgezin op desktop: telefoonweergave */
@media (min-width: 700px) {
  body.phone-frame { background: var(--sunken); }
  body.phone-frame .shell.family {
    max-width: var(--phone); margin: 0 auto; background: var(--paper);
    border-left: 1px solid var(--line); border-right: 1px solid var(--line);
    min-height: 100dvh;
  }
  body.phone-frame .shell.family .tabbar { max-width: var(--phone); margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

/* ---------- Typografie in pagina's ---------- */

.page-head { display: flex; align-items: flex-end; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s6); }
.page-head .grow { flex: 1; min-width: 200px; }
.page-title { font-family: var(--font-display); font-weight: 500; font-size: var(--fs-2xl); line-height: 1.15; letter-spacing: -.015em; font-variation-settings: 'opsz' 72; }
.page-sub { margin-top: var(--s1); color: var(--ink-2); }
.eyebrow { font-size: var(--fs-sm); color: var(--ink-2); margin-bottom: var(--s1); }
.eyebrow a:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 959px) {
  .page-title { font-size: 26px; }
  .page-head { margin-bottom: var(--s5); }
  .page-head.hide-mobile-title .page-title { display: none; }
}

.section { margin-top: var(--s7); }
.section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: baseline; gap: var(--s3); padding-bottom: var(--s2); border-bottom: 1px solid var(--line); }
.section-head h2 { font-size: var(--fs-md); font-weight: 600; }
.section-head .count { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: var(--fs-sm); }
.section-head .right { margin-left: auto; display: flex; gap: var(--s2); align-items: center; }
.section-head a.more { font-size: var(--fs-sm); color: var(--ink-2); }
.section-head a.more:hover { color: var(--ink); }
.section-note { font-size: var(--fs-sm); color: var(--ink-2); padding: var(--s2) 0 0; }

.prose p { margin: 0 0 var(--s3); max-width: 62ch; }
.prose h3 { font-size: var(--fs-md); font-weight: 600; margin: var(--s5) 0 var(--s2); }
.prose ul { padding-left: 1.1em; margin: 0 0 var(--s3); list-style: disc; max-width: 62ch; }
.prose li { margin: 0 0 var(--s1); }
.prose li::marker { color: var(--ink-3); }

/* ---------- Grids ---------- */

.cols { display: grid; gap: var(--s7) var(--s8); }
@media (min-width: 960px) {
  .cols-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .cols-main { grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); }
  .cols-side { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); }
}

/* ---------- Kerncijfers ---------- */

.stats {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stat { padding: var(--s3) var(--s3) var(--s3) 0; border-bottom: 1px solid var(--line); }
.stat:nth-child(odd) { border-right: 1px solid var(--line); }
.stat:nth-child(even) { padding-left: var(--s4); }
.stats > .stat:nth-last-child(-n+2):nth-child(odd), .stats > .stat:last-child { border-bottom: 0; }
.stat a { display: block; }
.stat-num { font-size: var(--fs-2xl); font-weight: 500; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { font-size: var(--fs-sm); color: var(--ink-2); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.stat.is-alarm .stat-num { color: var(--alarm); }
.stat.is-let .stat-num { color: var(--let); }
@media (min-width: 960px) {
  .stats { grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); }
  .stat, .stat:nth-child(even) { padding: var(--s4) var(--s4); border-bottom: 0; border-right: 1px solid var(--line); }
  .stat:first-child { padding-left: 0; }
  .stat:last-child { border-right: 0; }
}

/* ---------- Lijsten ---------- */

.list > li, .list > .row { border-bottom: 1px solid var(--line); }
.list.no-last > li:last-child { border-bottom: 0; }
.row {
  display: flex; align-items: center; gap: var(--s3);
  min-height: 56px; padding: var(--s3) 0;
}
a.row, button.row, .row[data-href] { cursor: pointer; }
button.row { width: 100%; border: 0; background: none; text-align: left; }
a.row:hover .row-title, .row[data-href]:hover .row-title { color: var(--accent); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.row-title.wrap { white-space: normal; }
.row-sub { font-size: var(--fs-sm); color: var(--ink-2); margin-top: 1px; }
.row-meta { text-align: right; font-size: var(--fs-sm); color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-meta strong { color: var(--ink); font-weight: 500; font-size: var(--fs-md); display: block; }
.row .chev { color: var(--ink-3); }
.row.compact { min-height: 44px; padding: var(--s2) 0; }
.row.done .row-title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.row.is-late .due { color: var(--alarm); }

.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; }
.kv dt, .kv dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--ink-2); font-size: var(--fs-sm); padding-top: 12px; }
.kv dd { font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Tabellen ---------- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-weight: 500; font-size: var(--fs-xs); color: var(--ink-2);
  padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--line); vertical-align: middle; font-variant-numeric: tabular-nums; }
.table tr[data-href] { cursor: pointer; }
.table tr[data-href]:hover td { background: var(--sunken); }
.table tr[data-href]:hover td:first-child { box-shadow: -8px 0 0 var(--sunken); }
.table .r { text-align: right; }
.table .cell-main { display: flex; align-items: center; gap: var(--s3); font-weight: 500; }
.table .cell-main .sub { display: block; font-weight: 400; font-size: var(--fs-xs); color: var(--ink-2); }
.table tr.is-selected td { background: var(--accent-soft); }

/* Tabel als lijst op mobiel */
@media (max-width: 959px) {
  .table.stack thead { display: none; }
  .table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; width: 100%; }
  .table.stack tr { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
  .table.stack td { padding: 0; border: 0; }
  .table.stack td.hide-m { display: none; }
  .table.stack td { grid-column: 1 / -1; }
  .table.stack td:first-child { grid-column: 1; }
  .table.stack td.m-meta { font-size: var(--fs-sm); color: var(--ink-2); }
  .table.stack td.m-right { text-align: right; grid-column: 2; grid-row: 1; align-self: center; }
}

/* ---------- Status ---------- */

.dot { display: inline-block; width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--ink-3); flex: none; }
.dot.ok { background: var(--ok); }
.dot.let { background: var(--let); }
.dot.alarm { background: var(--alarm); }
.dot.accent { background: var(--accent); }
.dot.hollow { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); white-space: nowrap; }
.status.ok { color: var(--ok); }
.status.let { color: var(--let); }
.status.alarm { color: var(--alarm); }
.status.muted { color: var(--ink-2); }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px;
  border-radius: var(--r); border: 1px solid var(--line);
  font-size: var(--fs-xs); font-weight: 500; color: var(--ink-2); white-space: nowrap; background: var(--surface);
}
.tag.ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.tag.let { color: #83580f; background: var(--let-soft); border-color: transparent; }
.tag.alarm { color: var(--alarm); background: var(--alarm-soft); border-color: transparent; }
.tag.accent { color: var(--accent); background: var(--accent-soft); border-color: transparent; }

/* ---------- Knoppen ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 40px; padding: 0 var(--s4);
  border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--surface); color: var(--ink);
  font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.btn:hover { background: var(--sunken); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: var(--sunken); color: var(--ink); }
.btn-danger { color: var(--alarm); }
.btn-sm { min-height: 32px; padding: 0 var(--s3); font-size: 13px; }
.btn-block { width: 100%; min-height: 48px; font-size: var(--fs-md); }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--tap); height: var(--tap); border: 0; border-radius: var(--r);
  background: transparent; color: var(--ink-2); cursor: pointer;
}
.btn-icon:hover { background: var(--sunken); color: var(--ink); }
.btn-row { display: flex; gap: var(--s2); flex-wrap: wrap; }
.link { color: var(--accent); font-weight: 500; background: none; border: 0; padding: 0; cursor: pointer; }
.link:hover { text-decoration: underline; }

/* ---------- Formulieren ---------- */

.field { display: block; margin-bottom: var(--s4); }
.field > span, .field-label { display: block; font-size: var(--fs-sm); font-weight: 500; margin-bottom: 6px; }
.field .hint { font-size: var(--fs-xs); color: var(--ink-2); margin-top: 4px; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--surface); font-size: 16px;
  transition: border-color var(--t-fast);
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236f665e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.select-sm { min-height: 34px; padding: 5px 32px 5px 10px; font-size: 14px; background-position: right 8px center; width: auto; }
@media (min-width: 960px) { .input, .select, .textarea { font-size: 15px; } }
.form-grid { display: grid; gap: 0 var(--s4); grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }

.seg { display: inline-flex; padding: 2px; border-radius: var(--r); background: var(--sunken); gap: 2px; max-width: 100%; overflow-x: auto; }
.seg button, .seg a {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 0 var(--s3); border: 0; border-radius: 5px;
  background: transparent; color: var(--ink-2); font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.seg [aria-pressed="true"], .seg [aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.seg .count { font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: 12px; }
.seg.full { display: flex; }
.seg.full > * { flex: 1; justify-content: center; }

.toolbar { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin-bottom: var(--s4); }
.toolbar .spacer { flex: 1; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); }
.stepper button { width: 44px; height: 44px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; color: var(--ink-2); }
.stepper output { min-width: 40px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

.switch { position: relative; display: inline-flex; align-items: center; gap: var(--s2); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 38px; height: 22px; border-radius: var(--r-pill); background: var(--line-strong); position: relative; transition: background var(--t-fast); flex: none; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); transition: transform var(--t-fast) var(--ease); }
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Avatars ---------- */

.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  border-radius: var(--r-pill); overflow: hidden;
  font-weight: 600; letter-spacing: .01em; line-height: 1;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--paper); margin-left: -6px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ---------- Voortgang ---------- */

.bar { height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.bar.accent > span { background: var(--accent); }
.bar.let > span { background: var(--let); }
.progress-inline { display: flex; align-items: center; gap: var(--s2); min-width: 80px; }
.progress-inline .bar { flex: 1; }
.progress-inline .num { font-size: var(--fs-sm); color: var(--ink-2); min-width: 34px; text-align: right; }

/* ---------- Taken ---------- */

.task { display: flex; align-items: flex-start; gap: var(--s2); padding: 6px 0; border-bottom: 1px solid var(--line); min-height: 60px; }
.task .check-hit { flex: none; width: var(--tap); height: var(--tap); display: grid; place-items: center; border: 0; background: none; padding: 0; margin-left: -8px; cursor: pointer; }
.check {
  width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); background: var(--surface);
  display: grid; place-items: center; color: transparent;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--ease);
}
.check-hit:hover .check { border-color: var(--ok); }
.check-hit:active .check { transform: scale(.9); }
.task.is-done .check { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.task.is-late .check { border-color: var(--alarm); }
.task-main { flex: 1; min-width: 0; padding-top: 9px; }
.task-title { font-weight: 500; }
.task.is-done .task-title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.task-sub { font-size: var(--fs-sm); color: var(--ink-2); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: center; }
.task-sub .late { color: var(--alarm); font-weight: 500; }
.task-proof { display: inline-flex; align-items: center; gap: 4px; }
.task-action { padding-top: 8px; }
.task.just-done .check { animation: pop var(--t) var(--ease); }
@keyframes pop { 0% { transform: scale(.7); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* ---------- Meldingen / feed ---------- */

.feed-item { display: flex; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.feed-item .marker { padding-top: 7px; }
.feed-item .body { flex: 1; min-width: 0; }
.feed-item .title { font-weight: 500; }
.feed-item .text { font-size: var(--fs-sm); color: var(--ink-2); margin-top: 1px; }
.feed-item .time { font-size: var(--fs-xs); color: var(--ink-3); white-space: nowrap; padding-top: 3px; font-variant-numeric: tabular-nums; }
.feed-item.unread .title::after { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: 8px; vertical-align: middle; }
a.feed-item:hover .title { color: var(--accent); }

/* ---------- Agenda ---------- */

.agenda-day { display: grid; grid-template-columns: 76px 1fr; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.agenda-date { font-size: var(--fs-sm); color: var(--ink-2); padding-top: 1px; font-variant-numeric: tabular-nums; }
.agenda-date strong { display: block; color: var(--ink); font-weight: 600; font-size: var(--fs-md); }
.agenda-items li { display: flex; gap: var(--s2); align-items: baseline; padding: 2px 0; }
.agenda-items .dot { transform: translateY(-1px); }
.agenda-items .where { color: var(--ink-2); font-size: var(--fs-sm); }

/* ---------- Grafieken ---------- */

.chart { width: 100%; position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .axis text, .chart .label { font-family: var(--font-ui); font-size: 11px; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .band { fill: var(--band); }
.chart .series { fill: none; stroke: var(--ink-3); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .series.hi { stroke: var(--accent); stroke-width: 2; }
.chart .series.warn { stroke: var(--let); stroke-width: 2; }
.chart .series.alarm { stroke: var(--alarm); stroke-width: 2; }
.chart .pt { fill: var(--surface); stroke-width: 1.5; }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 3; }
.chart-legend { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); font-size: var(--fs-xs); color: var(--ink-2); margin-top: var(--s2); }
.chart-legend .sw { display: inline-block; width: 14px; height: 2px; vertical-align: middle; margin-right: 6px; background: var(--ink-3); }
.chart-legend .sw.band { height: 10px; background: var(--band); }
.chart-legend .sw.hi { background: var(--accent); }
.chart-legend .sw.warn { background: var(--let); }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 5;
  min-width: 120px; padding: 8px 10px;
  background: var(--ink); color: var(--surface); border-radius: var(--r);
  font-size: 12px; line-height: 1.4; font-variant-numeric: tabular-nums;
  opacity: 0; transition: opacity var(--t-fast);
}
.chart-tip.on { opacity: 1; }
.chart-tip .tip-h { color: #cfc6bb; margin-bottom: 2px; }
.chart-tip .tip-row { display: flex; justify-content: space-between; gap: 12px; }

.hbar { display: grid; grid-template-columns: minmax(96px, 150px) 1fr 52px; gap: var(--s3); align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.hbar .track { height: 10px; background: var(--sunken); border-radius: 0 4px 4px 0; position: relative; }
.hbar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: var(--ink-3); }
.hbar .fill.ok { background: var(--ok); }
.hbar .fill.let { background: var(--let); }
.hbar .fill.alarm { background: var(--alarm); }
.hbar .fill.accent { background: var(--accent); }
.hbar .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.hbar .target { position: absolute; top: -4px; bottom: -4px; width: 1px; background: var(--ink-2); }

/* ---------- Sheet / paneel ---------- */

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(33, 29, 26, .32);
  opacity: 0; transition: opacity var(--t) var(--ease);
}
.sheet-backdrop.open { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  max-height: calc(100dvh - 40px - var(--safe-top));
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: 12px 12px 0 0;
  transform: translateY(100%); transition: transform var(--t) var(--ease);
}
.sheet.open { transform: translateY(0); }
.sheet::before { content: ''; display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s2) var(--s2) var(--s5); border-bottom: 1px solid var(--line); flex: none; }
.sheet-head h2 { flex: 1; font-size: var(--fs-lg); font-weight: 600; }
.sheet-head .sub { font-size: var(--fs-sm); color: var(--ink-2); font-weight: 400; }
.sheet-body { padding: var(--s5); overflow-y: auto; overscroll-behavior: contain; flex: 1; }
.sheet-foot { padding: var(--s3) var(--s5) calc(var(--s3) + var(--safe-bottom)); border-top: 1px solid var(--line); display: flex; gap: var(--s2); flex: none; }
.sheet-foot .btn { flex: 1; min-height: 48px; }
@media (min-width: 700px) {
  .sheet { left: auto; top: 0; bottom: 0; width: 460px; max-height: none; border-radius: 0; border-left: 1px solid var(--line); transform: translateX(100%); }
  .sheet.wide { width: 620px; }
  .sheet.open { transform: translateX(0); }
  .sheet::before { display: none; }
  .sheet-head { padding: var(--s3) var(--s3) var(--s3) var(--s6); min-height: 60px; }
  .sheet-body { padding: var(--s6); }
  .sheet-foot { padding: var(--s4) var(--s6); justify-content: flex-end; }
  .sheet-foot .btn { flex: none; min-height: 40px; }
  body.phone-frame .sheet.phone-sheet { left: 50%; right: auto; top: auto; bottom: 0; width: var(--phone); max-height: calc(100dvh - 40px); transform: translate(-50%, 100%); border-radius: 12px 12px 0 0; border: 1px solid var(--line); border-bottom: 0; }
  body.phone-frame .sheet.phone-sheet.open { transform: translate(-50%, 0); }
  body.phone-frame .sheet.phone-sheet::before { display: block; }
}

/* Popover (profielmenu) */
.popover {
  position: fixed; z-index: 70; min-width: 260px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 8px 24px rgba(33, 29, 26, .12);
  padding: var(--s1) 0;
  opacity: 0; transform: translateY(-4px); transition: opacity var(--t-fast), transform var(--t-fast) var(--ease);
}
.popover.open { opacity: 1; transform: none; }
.popover .pop-head { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.popover .pop-label { padding: var(--s3) var(--s4) var(--s1); font-size: var(--fs-xs); color: var(--ink-3); }
.popover button.pop-item {
  display: flex; align-items: center; gap: var(--s3); width: 100%;
  min-height: 48px; padding: var(--s2) var(--s4); border: 0; background: none; text-align: left; cursor: pointer;
}
.popover button.pop-item:hover { background: var(--sunken); }
.popover .pop-item .check-mark { margin-left: auto; color: var(--accent); }
.popover .pop-foot { border-top: 1px solid var(--line); margin-top: var(--s1); }
.popover .pop-quiet { font-size: var(--fs-xs); color: var(--ink-3); min-height: 36px !important; }

/* Dialoog */
.dialog {
  position: fixed; z-index: 81; left: 50%; top: 50%; transform: translate(-50%, -48%);
  width: min(400px, calc(100vw - 32px));
  background: var(--surface); border-radius: var(--r); border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(33, 29, 26, .18);
  padding: var(--s5); opacity: 0; transition: opacity var(--t-fast), transform var(--t-fast) var(--ease);
}
.dialog.open { opacity: 1; transform: translate(-50%, -50%); }
.dialog h2 { font-size: var(--fs-lg); font-weight: 600; margin-bottom: var(--s2); }
.dialog p { color: var(--ink-2); margin-bottom: var(--s5); }
.dialog .btn-row { justify-content: flex-end; }

/* Toast */
.toast {
  position: fixed; z-index: 90; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  transform: translate(-50%, 12px); opacity: 0;
  max-width: calc(100vw - 32px);
  display: flex; align-items: center; gap: var(--s2);
  padding: 10px 16px; border-radius: var(--r);
  background: var(--ink); color: var(--surface); font-size: 14px; font-weight: 500;
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast .icon { color: #b9d0b7; }
@media (min-width: 960px) { .shell-admin-active .toast { bottom: 24px; } }

/* ---------- Lege toestand ---------- */

.empty { padding: var(--s7) 0; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.empty strong { display: block; color: var(--ink); font-weight: 500; margin-bottom: 2px; }
.empty .btn { margin-top: var(--s3); }

/* ---------- Kitten/kat kop ---------- */

.profile-head { display: flex; align-items: center; gap: var(--s4); margin-bottom: var(--s5); }
.profile-head .grow { flex: 1; min-width: 0; }
.profile-head .page-title { font-size: var(--fs-2xl); }
.meta-line { display: flex; flex-wrap: wrap; gap: 2px var(--s3); color: var(--ink-2); font-size: var(--fs-sm); margin-top: 2px; }
.meta-line > * + *::before { content: '·'; margin-right: var(--s3); color: var(--ink-3); }

.big-num { font-size: var(--fs-3xl); font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.big-num small { font-size: var(--fs-md); color: var(--ink-2); font-weight: 400; margin-left: 4px; letter-spacing: 0; }

/* ---------- Gewichtsinvoer ---------- */

.weigh-row { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.weigh-row .info { flex: 1; min-width: 0; }
.weigh-row .prev { font-size: var(--fs-sm); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.weigh-input { position: relative; width: 116px; flex: none; }
.weigh-input input { width: 100%; height: 48px; padding: 0 30px 0 12px; text-align: right; font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); }
.weigh-input input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.weigh-input .unit { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }
.weigh-delta { display: block; font-size: var(--fs-xs); margin-top: 2px; min-height: 16px; font-variant-numeric: tabular-nums; }
.weigh-delta.ok { color: var(--ok); }
.weigh-delta.let { color: var(--let); }
.weigh-delta.alarm { color: var(--alarm); }

/* ---------- Foto's ---------- */

.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
.photo-grid figure { margin: 0; aspect-ratio: 1; overflow: hidden; background: var(--sunken); position: relative; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 6px; font-size: 11px; color: #fff; background: rgba(33,29,26,.55); }
@media (min-width: 960px) { .photo-grid.wide { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s2); padding: var(--s6); border: 1px dashed var(--line-strong); border-radius: var(--r); color: var(--ink-2); cursor: pointer; text-align: center; background: var(--surface); }
.drop:hover { border-color: var(--accent); color: var(--ink); }
.preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: var(--s3); }
.preview-grid img { aspect-ratio: 1; object-fit: cover; width: 100%; border-radius: 3px; }

/* ---------- Berichten ---------- */

.split { display: grid; }
@media (min-width: 960px) {
  .split { grid-template-columns: 300px minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); height: calc(100dvh - 60px - 130px); min-height: 480px; overflow: hidden; }
  .split .pane-list { border-right: 1px solid var(--line); overflow-y: auto; }
  .split .pane-list .row { padding-left: var(--s4); padding-right: var(--s4); }
  .split .pane-list .row[aria-current="page"] { background: var(--accent-soft); }
  .split .pane-thread { display: flex; flex-direction: column; min-height: 0; }
  .split .pane-empty { display: grid; place-items: center; color: var(--ink-2); }
}
@media (max-width: 959px) {
  .split.has-thread .pane-list { display: none; }
  .split:not(.has-thread) .pane-thread { display: none; }
}
.thread-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.thread { flex: 1; overflow-y: auto; padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
.msg { max-width: min(78%, 520px); padding: 9px 12px; border-radius: 10px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.them { align-self: flex-start; background: var(--sunken); border-bottom-left-radius: 3px; }
.msg.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 3px; }
.msg-time { font-size: 11px; color: var(--ink-3); margin: 2px 4px var(--s1); font-variant-numeric: tabular-nums; }
.msg-time.me { align-self: flex-end; }
.day-sep { align-self: center; font-size: var(--fs-xs); color: var(--ink-3); margin: var(--s3) 0 var(--s1); }
.announcement { align-self: stretch; border-left: 2px solid var(--accent); padding: 4px 0 4px 12px; margin: var(--s2) 0; }
.announcement .title { font-weight: 600; font-size: 14px; }
.announcement .text { font-size: 14px; color: var(--ink-2); }
.composer { display: flex; gap: var(--s2); align-items: flex-end; padding: var(--s3) var(--s4); border-top: 1px solid var(--line); background: var(--surface); }
.composer textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 22px; background: var(--paper); font-size: 16px; line-height: 1.35; }
.composer textarea:focus { outline: none; border-color: var(--accent); }
.composer .send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.composer .send:disabled { background: var(--line-strong); cursor: default; }

/* Chatweergave gastgezin (volledige hoogte) */
.chat-page { display: flex; flex-direction: column; height: calc(100dvh - 52px - var(--safe-top) - var(--tabbar-h) - var(--safe-bottom)); margin: calc(var(--s5) * -1) calc(var(--s4) * -1) 0; }
.chat-page .composer { background: var(--paper); }

/* ---------- Kanban (kopers) ---------- */

.board { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: var(--s3); overflow-x: auto; padding-bottom: var(--s2); }
.board-col { min-width: 0; }
.board-col-head { display: flex; align-items: baseline; gap: var(--s2); padding: 0 0 var(--s2); border-bottom: 2px solid var(--line); margin-bottom: var(--s2); font-weight: 600; font-size: 14px; }
.board-col-head .count { color: var(--ink-3); font-weight: 400; font-variant-numeric: tabular-nums; }
.board-item { display: block; padding: 10px 12px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: pointer; }
.board-item:hover { border-color: var(--line-strong); }
.board-item .name { font-weight: 500; }
.board-item .sub { font-size: var(--fs-xs); color: var(--ink-2); margin-top: 2px; }
.board-item .kit { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: var(--fs-xs); }

/* ---------- Pipeline-stappen ---------- */

.steps { display: flex; gap: 2px; margin: var(--s2) 0 var(--s5); }
.steps .step { flex: 1; min-width: 0; }
.steps .step .line { height: 4px; background: var(--sunken); border-radius: 2px; }
.steps .step.done .line { background: var(--accent); }
.steps .step .lbl { font-size: 11px; color: var(--ink-3); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps .step.current .lbl { color: var(--ink); font-weight: 600; }
@media (max-width: 959px) { .steps .step .lbl { display: none; } }

/* ---------- Leren ---------- */

.lesson-body { font-size: 16px; line-height: 1.6; }
.quiz { margin-top: var(--s6); padding-top: var(--s5); border-top: 1px solid var(--line); }
.quiz h3 { font-size: var(--fs-md); font-weight: 600; margin-bottom: var(--s3); }
.quiz-opt { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 52px; padding: var(--s2) var(--s3); margin-bottom: var(--s2); border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); text-align: left; cursor: pointer; }
.quiz-opt:hover { border-color: var(--ink-3); }
.quiz-opt .radio { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-strong); flex: none; display: grid; place-items: center; }
.quiz-opt[aria-pressed="true"] { border-color: var(--accent); }
.quiz-opt[aria-pressed="true"] .radio { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--surface); background: var(--accent); }
.quiz-opt.correct { border-color: var(--ok); background: var(--ok-soft); }
.quiz-opt.wrong { border-color: var(--alarm); background: var(--alarm-soft); }
.quiz-result { margin: var(--s3) 0; font-weight: 500; }
.quiz-result.ok { color: var(--ok); }
.quiz-result.alarm { color: var(--alarm); }

/* ---------- Assistent ---------- */

.assist { display: flex; flex-direction: column; gap: var(--s4); min-height: calc(100dvh - 300px - var(--safe-top) - var(--safe-bottom)); }
.qa-q { align-self: flex-end; max-width: 85%; background: var(--sunken); padding: 9px 12px; border-radius: 10px; border-bottom-right-radius: 3px; }
.qa-a { max-width: 100%; }
.qa-a .answer { line-height: 1.55; }
.qa-a .answer p:last-child, .qa-a .answer ul:last-child { margin-bottom: 0; }
.qa-a .source { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--s2); font-size: var(--fs-sm); color: var(--accent); font-weight: 500; }
.qa-a .source:hover { text-decoration: underline; }
.typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: blink 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.suggest { display: flex; gap: var(--s2); overflow-x: auto; padding: var(--s1) 0 var(--s2); scrollbar-width: none; }
.suggest::-webkit-scrollbar { display: none; }
.suggest button { flex: none; min-height: 36px; padding: 0 var(--s3); border: 1px solid var(--line-strong); border-radius: 18px; background: var(--surface); font-size: 14px; cursor: pointer; white-space: nowrap; }
.suggest button:hover { border-color: var(--ink-3); }
.ask-bar { position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-bottom)); background: var(--paper); padding: var(--s2) 0 var(--s3); margin-top: var(--s4); border-top: 1px solid var(--line); }
.ask-bar form { display: flex; gap: var(--s2); }
.ask-bar input { flex: 1; min-height: 46px; border: 1px solid var(--line-strong); border-radius: 23px; padding: 0 16px; background: var(--surface); font-size: 16px; }
.ask-bar input:focus { outline: none; border-color: var(--accent); }
.ask-bar button[type="submit"] { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; cursor: pointer; flex: none; }

/* Protocol */
.protocol-sec { scroll-margin-top: 70px; }
mark { background: var(--let-soft); color: inherit; padding: 0 1px; border-radius: 2px; }

/* ---------- Zoeken ---------- */

.search-box { position: relative; }
.search-box .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search-box input { width: 100%; height: 38px; padding: 0 12px 0 38px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-size: 14px; }
.search-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box.lg input { height: 46px; font-size: 16px; }
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 8px 24px rgba(33, 29, 26, .12); max-height: 60vh; overflow-y: auto; padding: var(--s1) 0; }
.search-results .grp { padding: var(--s2) var(--s4) 2px; font-size: 11px; color: var(--ink-3); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.search-results a { display: flex; align-items: center; gap: var(--s3); padding: 7px var(--s4); }
.search-results a:hover, .search-results a.active { background: var(--sunken); }
.search-results .sub { font-size: var(--fs-xs); color: var(--ink-2); }
.search-results .none { padding: var(--s3) var(--s4); color: var(--ink-2); font-size: 14px; }

/* ---------- Diversen ---------- */

.inline-list { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.divider { height: 1px; background: var(--line); margin: var(--s5) 0; }
.callout { display: flex; gap: var(--s3); padding: var(--s3) var(--s4); border-left: 3px solid var(--let); background: var(--let-soft); border-radius: 0 var(--r) var(--r) 0; margin-bottom: var(--s5); }
.callout.alarm { border-left-color: var(--alarm); background: var(--alarm-soft); }
.callout .icon { color: var(--let); margin-top: 1px; }
.callout.alarm .icon { color: var(--alarm); }
.callout .title { font-weight: 600; }
.callout .text { font-size: var(--fs-sm); color: var(--ink); margin-top: 1px; }
.callout .btn-row { margin-top: var(--s2); }

.more-list .row { min-height: 52px; }
.more-list .row .icon { color: var(--ink-2); }

.hide-desktop { }
@media (min-width: 960px) { .hide-desktop { display: none !important; } }
@media (max-width: 959px) { .hide-mobile { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}

/* ---------- Lessen ---------- */

.lesson-steps { display: flex; gap: 3px; margin-top: var(--s2); }
.lesson-steps span { flex: 1; height: 4px; border-radius: 2px; background: var(--sunken); }
.lesson-steps span.done { background: var(--ok); }
.lesson-steps span.cur { background: var(--accent); }
.lesson-body h3 { font-size: var(--fs-lg); margin-top: var(--s6); }
.lesson-body .callout { margin: var(--s4) 0; }
.lesson-body .callout .text { font-size: var(--fs-md); line-height: 1.5; }
.lesson-body .callout.alarm .icon { color: var(--alarm); }
.lesson-figure { margin: var(--s4) 0 var(--s5); }
.lesson-link { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; margin: var(--s4) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--accent); font-weight: 500; font-size: var(--fs-md); }
.lesson-link > span { flex: 1; }
.lesson-link:hover { color: var(--accent-hover); }
.lesson-preview { padding-top: var(--s2); }

.checklist { list-style: none !important; padding: 0 !important; margin: var(--s2) 0 var(--s4) !important; border-top: 1px solid var(--line); }
.checklist li { margin: 0 !important; border-bottom: 1px solid var(--line); }
.check-item { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 48px; padding: var(--s2) 0; border: 0; background: none; text-align: left; font-size: var(--fs-md); cursor: pointer; }
.check-item:disabled { cursor: default; }
.check-item .box { flex: none; width: 22px; height: 22px; border-radius: 5px; border: 1.5px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; color: transparent; transition: background var(--t-fast), border-color var(--t-fast); }
.check-item.on .box { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.check-item.on > span:last-child { color: var(--ink-2); }

.assigned { display: flex; gap: var(--s3); padding: var(--s3) 0; margin-bottom: var(--s4); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--ink); font-size: 14px; }
.assigned .icon { color: var(--accent); margin-top: 1px; }

.quiz-title { font-family: var(--font-display); font-weight: 500; font-size: var(--fs-xl); margin-bottom: var(--s3); }
.quiz-progress { display: flex; gap: 4px; }
.quiz-progress span { flex: 1; height: 4px; border-radius: 2px; background: var(--sunken); }
.quiz-progress span.cur { background: var(--accent); }
.quiz-progress span.ok { background: var(--ok); }
.quiz-progress span.alarm { background: var(--alarm); }
.quiz-opt:disabled { cursor: default; }
.quiz-opt.correct .radio { border-color: var(--ok); background: var(--ok); box-shadow: inset 0 0 0 4px var(--ok-soft); }
.quiz-opt.wrong .radio { border-color: var(--alarm); background: var(--alarm); box-shadow: inset 0 0 0 4px var(--alarm-soft); }
.quiz-explain { padding: var(--s3) var(--s4); border-left: 3px solid var(--ok); background: var(--ok-soft); border-radius: 0 var(--r) var(--r) 0; font-size: 14px; line-height: 1.5; margin-top: var(--s2); }
.quiz-explain.alarm { border-left-color: var(--alarm); background: var(--alarm-soft); }
.quiz-result-box { padding: var(--s4) 0; border-top: 1px solid var(--line); }
.quiz-result-box.ok .big-num { color: var(--ok); }
.quiz-result-box.alarm .big-num { color: var(--alarm); }
.quiz-review { list-style: none; padding: 0; margin: var(--s3) 0 0; border-top: 1px solid var(--line); }
.quiz-review li { display: flex; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.quiz-review li.ok > .icon { color: var(--ok); margin-top: 2px; }
.quiz-review li.alarm > .icon { color: var(--alarm); margin-top: 2px; }
.quiz-review strong { font-weight: 500; }
.quiz-key { list-style: none; padding: 0; margin: 6px 0 0; }
.quiz-key li { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); padding: 1px 0; }
.quiz-key li.ok { color: var(--ok); font-weight: 500; }

.lesson-nav { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); margin-top: var(--s7); border-top: 1px solid var(--line); }
.lesson-nav .row { min-height: 64px; }
.lesson-nav .row-title { font-size: 14px; white-space: normal; }

.q-edit { position: relative; border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4); margin: 0 0 var(--s3); }
.q-edit legend { font-size: var(--fs-sm); font-weight: 600; padding: 0 4px; }
.q-edit .q-del { position: absolute; top: 2px; right: 2px; }
.textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.55; }
.syntax { margin: -8px 0 8px; }
.syntax summary { cursor: pointer; font-size: var(--fs-sm); color: var(--ink-2); }
.syntax ul { padding-left: 1.1em; list-style: disc; margin-top: 6px; }
.syntax code { font-size: 12px; background: var(--sunken); padding: 1px 4px; border-radius: 3px; }
