/* HeartBeat – base styles.
   Calm, Apple-HIG-inspired look: system font, generous spacing, rounded cards,
   large touch targets (min 44px), light and dark theme, WCAG AA contrast. */

/* Design tokens (colours, font, sizes) live in tokens.css. */

@media (prefers-reduced-motion: reduce) {
  :root { --fast: 0ms; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;  /* same width with or without a scrollbar: the menu does not jump */
  font-size: 106.25%;        /* 17px: Apple body size, easier to read */
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.4em; letter-spacing: -0.01em; }
h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.3rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 0.8em; }

a { color: var(--blue); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
  vertical-align: -0.2em;
}

.muted { color: var(--text-muted); }
.lead { font-size: 1.15rem; color: var(--text-muted); }

/* ---------- Layout ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: var(--space);
  min-height: 60px;
  padding: 8px max(var(--space), env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-contrast);
}
.brand-mark .icon { width: 20px; height: 20px; }

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: calc(var(--space) * 2) var(--space) calc(var(--space) * 4);
}

.hero { margin-bottom: calc(var(--space) * 2); }

.grid {
  display: grid;
  gap: var(--space);
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: calc(var(--space) * 1.25);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.card > :last-child { margin-bottom: 0; }

.card-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.tone-green  { color: var(--green);  background: var(--green-bg); }
.tone-blue   { color: var(--blue);   background: var(--blue-bg); }
.tone-orange { color: var(--orange); background: var(--orange-bg); }
.tone-red    { color: var(--red);    background: var(--red-bg); }
.tone-purple { color: var(--purple); background: var(--purple-bg); }
.tone-gray   { color: var(--gray);   background: var(--gray-bg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--text);
  transition: transform var(--fast) var(--ease), background var(--fast) var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="licht"]) .btn-primary, :root:not([data-theme="licht"]) .btn-danger { color: #000; }
}
:root[data-theme="donker"] .btn-primary, :root[data-theme="donker"] .btn-danger { color: #000; }

/* ---------- Messages ---------- */
.messages { display: grid; gap: 8px; margin-bottom: var(--space); }
.message {
  padding: 12px 16px;
  border-radius: var(--radius-s);
  background: var(--blue-bg);
  color: var(--blue);
}
.message-success { background: var(--green-bg); color: var(--green); }
.message-warning { background: var(--orange-bg); color: var(--orange); }
.message-error { background: var(--red-bg); color: var(--red); }

/* ---------- Navigation ---------- */
.mainnav {
  display: flex;
  gap: 4px;
  margin-left: 8px;
  flex: 1;
}
.mainnav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}
.mainnav a:hover { background: var(--surface-2); color: var(--text); }
.mainnav a[aria-current="page"] { color: var(--text); background: var(--surface); box-shadow: var(--shadow); }

.usermenu { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.usermenu form { margin: 0; }
.avatar {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blue-bg);
  color: var(--blue);
  font-weight: 700;
  font-size: 0.85rem;
}
.username { font-weight: 500; }

/* The menu never makes the page wider: it scrolls sideways by itself. When it does not fit next to the
   logo and the user menu, app.js adds .nav-wrapped and the menu gets its own row underneath, keeping its
   words (clearer than icons alone). */
.mainnav { min-width: 0; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a { flex-shrink: 0; }
.topbar.nav-wrapped { flex-wrap: wrap; row-gap: 4px; padding-bottom: 4px; }
.topbar.nav-wrapped .mainnav {
  order: 3; flex: 1 0 100%; margin: 0 calc(-1 * max(var(--space), env(safe-area-inset-left)));
  padding: 2px max(var(--space), env(safe-area-inset-left)) 6px;
}
/* fade the edge(s) where there is more menu to scroll to */
.mainnav.is-scrollable { mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
.mainnav.is-scrollable.at-start { mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
.mainnav.is-scrollable.at-end { mask-image: linear-gradient(to right, transparent, #000 40px); }
@media (max-width: 640px) {
  .brand-name, .username { display: none; }
  .mainnav { gap: 2px; }
  .mainnav a { padding: 0 11px; gap: 6px; }
  .mainnav .nav-home { display: none; } /* the logo already goes home */
  .usermenu { flex-shrink: 0; gap: 4px; }
}

.subnav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: -8px 0 calc(var(--space) * 1.5);
  padding: 4px;
  background: var(--surface-2);
  border-radius: 14px;
  width: fit-content;
  max-width: 100%;
  scrollbar-width: none;
}
.subnav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  white-space: nowrap;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}
.subnav a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.backlink {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin-bottom: 4px;
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
}

/* ---------- Page structure ---------- */
.page-narrow { max-width: 480px; }
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space);
  margin-bottom: calc(var(--space) * 1.25);
}
.page-head h1 { margin-bottom: 4px; }
.page-head p { margin: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.split {
  display: grid;
  gap: var(--space);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  align-items: start;
}

.empty {
  text-align: center;
  padding: calc(var(--space) * 3) var(--space);
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  color: var(--text-muted);
}

.danger-zone { margin-top: calc(var(--space) * 2); }
.danger-zone form { margin: 0 0 8px; }

details.archived { margin-top: calc(var(--space) * 2); }
details.archived summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 500;
}
details.archived[open] summary { margin-bottom: 8px; }

/* ---------- Lists (iOS-style grouped rows) ---------- */
.list {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.list-inset { box-shadow: none; background: var(--surface-2); border: 0; }
.list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 10px 16px;
  color: var(--text);
  text-decoration: none;
}
.list-row + .list-row { border-top: 1px solid var(--border); }
a.list-row:hover, .list-link:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.list-main { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.list-link { align-self: stretch; justify-content: center; border-radius: 8px; }
.list-title { font-weight: 600; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list-sub { color: var(--text-muted); font-size: 0.9rem; }
.list-chevron { color: var(--text-muted); opacity: 0.6; }
.is-archived { opacity: 0.65; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--text-muted);
}
.list-inset .chip { background: var(--surface); }
.chip-strong { background: var(--blue-bg); color: var(--blue); }
.chip-warning { background: var(--orange-bg); color: var(--orange); }
.chip-danger { background: var(--red-bg); color: var(--red); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
}

.reorder { display: flex; gap: 2px; }
.reorder form { margin: 0; }

/* ---------- Buttons (extra) ---------- */
.btn-small { min-height: 44px; padding: 0 14px; font-size: 0.95rem; }
.btn-icon { padding: 0; width: var(--tap); }
.btn-quiet { background: transparent; }
.btn-quiet:hover { background: var(--surface-2); }
.btn-block { width: 100%; }
.btn-danger-quiet { background: transparent; color: var(--red); padding-left: 8px; padding-right: 8px; }
.btn-danger-quiet:hover { background: var(--red-bg); }
.btn[disabled] { opacity: 0.3; cursor: default; }
.btn-primary:hover { filter: brightness(1.08); }

/* ---------- Forms ---------- */
.card-form { max-width: 640px; }
.form { display: grid; gap: 18px; }
.form-inline { margin-top: 12px; }
.field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.label { font-weight: 600; font-size: 0.95rem; padding: 0; }
.optional { font-weight: 400; color: var(--text-muted); }
.help { margin: 0; color: var(--text-muted); font-size: 0.88rem; }
.field-error { margin: 0; color: var(--red); font-size: 0.9rem; font-weight: 500; }
.form-errors { padding: 12px 16px; border-radius: var(--radius-s); background: var(--red-bg); color: var(--red); }
.form-errors p, .form-errors ul { margin: 0; padding: 0; list-style: none; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 4px; }

input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="date"], input[type="time"], input[type="number"], input[type="search"],
select, textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 14px;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 12px;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--focus);
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent);
}
.has-error input, .has-error select, .has-error textarea { border-color: var(--red); }

/* Checkbox rows */
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; min-height: 44px; }
.check input { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--blue); flex-shrink: 0; }
.check > span { display: grid; gap: 2px; }
.check-label { font-weight: 600; }

/* Radio choices as segmented buttons */
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 16px;
  border-radius: 12px;
  background: var(--surface-2);
  font-weight: 500;
  border: 2px solid transparent;
}
.choice:has(input[name="weekday"]) span { text-transform: capitalize; } /* "maandag" -> "Maandag" */
.choice input:checked + span { background: var(--blue-bg); color: var(--blue); border-color: var(--blue); }
.choice input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Colour swatches */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 14px 0 10px;
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  font-weight: 500;
}
.swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.swatch-dot { width: 22px; height: 22px; border-radius: 50%; background: currentColor; }
.swatch-label { color: var(--text); }
.swatch:has(input:checked) { border-color: currentColor; }
.swatch:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Icon picker */
.iconpicker { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.iconchoice {
  position: relative;
  display: grid;
  place-items: center;
  height: 52px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 2px solid transparent;
  cursor: pointer;
}
.iconchoice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.iconchoice:has(input:checked) { border-color: var(--blue); background: var(--blue-bg); color: var(--blue); }
.iconchoice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- Week calendar ---------- */
.week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 900px) {
  .week { grid-template-columns: 1fr; }
  .day.is-empty { display: none; }
}
.day {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
}
.day.is-today { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 1rem; margin: 0 0 4px; }
.day-name { text-transform: capitalize; }
.day-date { color: var(--text-muted); font-weight: 500; font-size: 0.9rem; }
.day-none { color: var(--text-muted); font-size: 0.9rem; margin: 0; }
.lesson {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--blue-bg);
  color: var(--text);
  text-decoration: none;
  border-left: 4px solid var(--blue);
  transition: transform var(--fast) var(--ease);
}
.lesson:active { transform: scale(0.98); }
.lesson-time { font-size: 0.85rem; color: var(--blue); font-weight: 600; }
.lesson-group { font-weight: 600; }
.lesson-flag { display: inline-flex; align-items: center; gap: 4px; font-size: 0.82rem; color: var(--text-muted); }
.lesson-flag .icon { width: 14px; height: 14px; }
.lesson.is-cancelled { background: var(--gray-bg); border-left-color: var(--gray); }
.lesson.is-cancelled .lesson-group { text-decoration: line-through; color: var(--text-muted); }
.lesson.is-cancelled .lesson-time { color: var(--text-muted); }

/* ---------- Auth ---------- */
.auth-card { margin-top: 8vh; }
.card-link { color: inherit; text-decoration: none; transition: transform var(--fast) var(--ease); }
.card-link:hover { transform: translateY(-2px); }
.home-links { margin-top: var(--space); }

/* Date/time fields open a picker on click: show that they are clickable. */
input[type="date"], input[type="time"] { cursor: pointer; }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator { cursor: pointer; padding: 6px; opacity: 0.7; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="licht"]) input[type="date"]::-webkit-calendar-picker-indicator,
  :root:not([data-theme="licht"]) input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(1); }
}
:root[data-theme="donker"] input[type="date"]::-webkit-calendar-picker-indicator,
:root[data-theme="donker"] input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(1); }

/* ---------- People ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.filterbar {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 10px;
  margin-bottom: var(--space);
}
@media (max-width: 640px) { .filterbar { grid-template-columns: 1fr; } }
.searchfield { position: relative; display: block; }
.searchfield > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.searchfield input { padding-left: 44px; }
.list-count { margin-top: 8px; }

.avatar-large { width: 88px; height: 88px; font-size: 1.6rem; }
.person-head { display: flex; align-items: center; gap: 14px; }
.person-head h1 { margin: 0 0 4px; }

.split-wide { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); }
@media (max-width: 900px) { .split-wide { grid-template-columns: 1fr; } }
.namefields { display: grid; grid-template-columns: 2fr 1fr 2fr; gap: 12px; align-items: end; }
.pairfields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.quickform .pairfields + .help { margin-top: -8px; }
@media (max-width: 640px) {
  .namefields, .pairfields { grid-template-columns: 1fr; }
}
.choices-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.choices-groups .choice span,
.choices-group .choice span,
.choices-roles .choice span { width: 100%; text-transform: none; }
.choices-roles { display: grid; }
.choices-roles .choice span { padding-top: 8px; padding-bottom: 8px; }
.choices-groups .choice input:checked + span::before {
  content: "✓";
  margin-right: 8px;
  font-weight: 700;
}

.row-actions { display: flex; gap: 4px; flex-shrink: 0; }
.membership-row { flex-wrap: wrap; }
.membership-row .list-main { flex: 1 1 220px; }

.subhead { font-size: 0.95rem; color: var(--text-muted); margin: calc(var(--space) * 1.25) 0 8px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--border); display: grid; gap: 12px; }
.timeline li { position: relative; display: grid; gap: 2px; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -25px; top: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--gray);
}
.timeline li.is-current::before { background: var(--green); border-color: var(--green); }
.timeline li.is-future::before { border-color: var(--blue); }
.timeline li.is-past { color: var(--text-muted); }
.timeline-title { font-weight: 600; }
.timeline-sub { font-size: 0.9rem; color: var(--text-muted); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; margin: 0; }
.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts a { color: var(--blue); }

/* ---------- Attendance screen ---------- */
.reg-days { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: var(--space); }
.reg-days .subnav { margin: 0; }
.lesson-tabs a { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; line-height: 1.2; padding: 6px 16px; }
.lesson-tabs .tab-time { font-size: 0.8rem; font-weight: 600; color: var(--blue); }
.lesson-tabs a.is-cancelled span:last-child { text-decoration: line-through; }

.reg-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.reg-head h1 { margin: 0 0 2px; }
.reg-head p { margin: 0; }

.savestate {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 14px; border-radius: 999px;
  font-weight: 600; font-size: 0.95rem;
  background: var(--green-bg); color: var(--green);
}
.savestate-icon { display: none; }
.savestate[data-state="saved"] [data-for="saved"],
.savestate[data-state="saving"] [data-for="saving"],
.savestate[data-state="waiting"] [data-for="waiting"],
.savestate[data-state="login"] [data-for="login"] { display: inline-flex; }
.savestate[data-state="saving"] { background: var(--blue-bg); color: var(--blue); }
.savestate[data-state="waiting"] { background: var(--orange-bg); color: var(--orange); }
.savestate[data-state="login"] { background: var(--red-bg); color: var(--red); }

.counter { font-size: 1.15rem; font-weight: 600; margin: 0 0 var(--space); }

.reg-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-bottom: var(--space); }
@media (max-width: 640px) { .reg-tools { grid-template-columns: 1fr; } }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.pcard {
  position: relative;
  display: flex;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.pcard[hidden] { display: none; }
.pcard.tone-green  { color: var(--green);  background: var(--green-bg); }
.pcard.tone-blue   { color: var(--blue);   background: var(--blue-bg); }
.pcard.tone-orange { color: var(--orange); background: var(--orange-bg); }
.pcard.tone-red    { color: var(--red);    background: var(--red-bg); }
.pcard.tone-purple { color: var(--purple); background: var(--purple-bg); }
.pcard.tone-gray   { color: var(--gray);   background: var(--gray-bg); }
.pcard.has-status { border-color: currentColor; }
.pcard.has-status .pcard-name { color: var(--text); }
.pcard-main {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 14px;
  min-height: 104px; padding: 12px 4px 12px 12px;
  border: 0; background: none; color: inherit; font: inherit; text-align: left;
  cursor: pointer;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
.pcard-main:active { transform: scale(0.98); }
.pcard-avatar {
  display: grid; place-items: center; flex-shrink: 0;
  width: 76px; height: 76px; border-radius: 50%;
  background: var(--surface-2); color: var(--text-muted);
  font-weight: 700; font-size: 1.35rem;
}
.pcard.has-status .pcard-avatar { background: var(--surface); color: inherit; }
.pcard-text { display: grid; gap: 4px; min-width: 0; }
.pcard-name { font-size: 1.1rem; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.pcard-status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 0.95rem; }
.pcard:not(.has-status) .pcard-status { color: var(--text-muted); font-weight: 500; }
.pcard-icon:empty { display: none; }
.pcard-icon .icon { width: 20px; height: 20px; }
.pcard-more {
  flex-shrink: 0; width: var(--tap); border: 0; background: none; color: inherit; opacity: 0.6;
  border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer;
}
.pcard-more:hover { opacity: 1; }
.pcard.just-changed { animation: pcard-pop 220ms var(--ease); }
@keyframes pcard-pop { 50% { transform: scale(1.03); } }

.reg-note { margin-top: calc(var(--space) * 1.5); display: grid; gap: 8px; }

/* Bottom sheet style dialog */
dialog.sheet {
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100vh - 48px);
  border: 0; border-radius: var(--radius-l);
  padding: calc(var(--space) * 1.25);
  background: var(--surface); color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
dialog.sheet::backdrop { background: rgba(0, 0, 0, 0.4); }
dialog.sheet[open] { display: grid; gap: 12px; animation: sheet-in 180ms var(--ease); }
@keyframes sheet-in { from { transform: translateY(12px); opacity: 0; } }
.sheet-title { margin: 0; font-size: 1.2rem; }
.sheet-options { display: grid; gap: 8px; }
.sheet-option {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 0 16px;
  border: 2px solid transparent; border-radius: 14px;
  font: inherit; font-weight: 600; font-size: 1.05rem; text-align: left; cursor: pointer;
}
.sheet-option.is-current { border-color: currentColor; }
.sheet-option[hidden] { display: none; }
.sheet-clear { background: var(--surface-2); color: var(--text); }
button.list-row { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }

/* ---------- Login, tablet, management ---------- */
.usermenu-link { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; min-height: 44px; padding: 0 6px; border-radius: 10px; }
.usermenu-link:hover { background: var(--surface-2); }
@media (max-width: 640px) { .username-always { display: inline; } }

.page-auth h1 { margin-bottom: 8px; }
.page-auth > form, .page-auth > p, .page-auth > h1 { max-width: 480px; }
.auth-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: calc(var(--space) * 1.25); margin-bottom: var(--space); }
.auth-form a { color: var(--blue); }
.auth-panel { margin-bottom: var(--space); }
.auth-qr { display: block; width: 220px; max-width: 100%; height: auto; background: #fff; padding: 12px; border-radius: 12px; }
.auth-hr { border: 0; border-top: 1px solid var(--border); margin: var(--space) 0; }

.who-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 14px; }
.who-tile {
  display: grid; justify-items: center; gap: 12px;
  padding: 22px 12px; min-height: 150px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  color: var(--text); text-decoration: none; text-align: center;
  transition: transform var(--fast) var(--ease);
}
.who-tile:active { transform: scale(0.97); }
.who-avatar { display: grid; place-items: center; width: 100px; height: 100px; border-radius: 50%; font-size: 1.8rem; font-weight: 700; }
.who-name { font-size: 1.15rem; font-weight: 600; }
.tablet-foot { margin-top: calc(var(--space) * 2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tablet-foot a { color: var(--blue); }
.pin-card { display: grid; justify-items: center; text-align: center; gap: 12px; }
.pin-card .form { width: 100%; text-align: left; }
.pin-input { font-size: 2rem; letter-spacing: 0.5em; text-align: center; }

.stack-actions { display: grid; gap: 8px; justify-items: start; margin-top: var(--space); }
.stack-actions form { margin: 0; }

.audit-filter { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; margin-bottom: var(--space); }
.audit-filter .form-actions { padding: 0; }
.audit-changes { margin: 4px 0 0; padding-left: 18px; font-size: 0.9rem; color: var(--text-muted); overflow-wrap: anywhere; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: var(--space); }
.recovery-card { display: grid; gap: 12px; margin: var(--space) 0; }
.recovery-codes {
  margin: 0; padding: 14px 18px; border-radius: 12px; background: var(--surface-2);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 1.1rem; line-height: 1.7;
  columns: 2; column-gap: 32px;
}
@media (max-width: 480px) { .recovery-codes { columns: 1; } }
.page-auth .help a { color: var(--blue); }

/* ---------- Reports ---------- */
.report-filter { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; margin-bottom: var(--space); }
.report-filter .form-actions { padding: 0; }
.report-quick { grid-column: 1 / -1; }
.report-quick .chip { text-decoration: none; min-height: 36px; padding: 6px 14px; color: var(--blue); background: var(--blue-bg); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: calc(var(--space) * 1.5); }
.stat { display: grid; gap: 2px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-value { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.02em; }
.stat-label { color: var(--text-muted); font-size: 0.9rem; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.report-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.report-table th, .report-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.report-table thead th { position: sticky; top: 0; background: var(--surface-2); color: var(--text-muted); font-weight: 600; font-size: 0.85rem; }
.report-table tbody th { font-weight: 600; }
.report-table tbody th a { color: var(--blue); text-decoration: none; }
.report-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.report-table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.report-table tr.is-total th, .report-table tr.is-total td { font-weight: 700; background: var(--surface-2); }
.report-table tbody tr:last-child th, .report-table tbody tr:last-child td { border-bottom: 0; }
.help-list { margin: 0; padding-left: 20px; color: var(--text-muted); display: grid; gap: 4px; }

/* Emergency contacts (tablet) */
.sheet-emergency { margin-bottom: 8px; color: var(--red); }
.emergency-list { display: grid; gap: 12px; margin-bottom: var(--space); }
.emergency-card { display: flex; align-items: center; gap: 16px; min-height: 72px; text-decoration: none; color: inherit; }
.emergency-phone { font-size: 1.5rem; font-weight: 600; color: var(--red); }
.subhead-row { margin-top: calc(var(--space) * 1.25); margin-bottom: 8px; }
.subhead-row .subhead { margin: 0; }

/* Contributions */
.subnav-sep { flex: 0 0 1px; margin: 8px 4px; background: var(--border); }
.generate-actions { margin-bottom: var(--space); }
.tariff-table input[type="number"] { max-width: 9rem; }
.tariff-table td { vertical-align: middle; }
.report-table th.num { text-align: right; }
.charge-row .badge, .charge-row .btn { white-space: nowrap; flex-shrink: 0; }
.charge-status-inline { display: none; }
@media (max-width: 640px) {
  .charge-row { gap: 10px; padding: 10px 12px; }
  .charge-row > .badge { display: none; }
  .charge-status-inline { display: inline; }
  .stats-money .stat-value { font-size: 1.35rem; }
}

/* Clean-up (Beheer → Opschonen) */
.cleanup-form { margin-top: var(--space); }
.cleanup-form .list-row { cursor: pointer; }
.cleanup-skipped { margin-top: calc(var(--space) * 1.5); }

/* Planning (planbord, rooster) */
.month-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 0 calc(var(--space) * 1.25); }
.roster-row.is-today { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.plan-table-wrap { margin-bottom: calc(var(--space) * 1.25); }
.plan-table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 560px; }
.plan-table th, .plan-table td { padding: 8px; border-top: 1px solid var(--border); text-align: left; vertical-align: top; }
.plan-table thead th { border-top: 0; border-bottom: 2px solid var(--border); }
.plan-table .plan-role-col { width: 140px; font-weight: 600; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.plan-table tbody .plan-role-col { padding-top: 18px; }
.plan-day { border-top: 4px solid var(--border) !important; }
.plan-day.plan-open { border-top-color: var(--red) !important; }
.plan-day.plan-letop { border-top-color: var(--orange) !important; }
.plan-day.plan-compleet { border-top-color: var(--green) !important; }
.plan-day.plan-uitgevallen { opacity: 0.6; }
.plan-day-name { display: block; font-weight: 700; }
.plan-day-lessons { display: block; font-weight: 400; font-size: 0.85rem; color: var(--text-muted); }
.plan-role-start th, .plan-role-start td { border-top-width: 2px; }
.plan-box { margin: 0; }
.plan-box select { min-height: 44px; width: 100%; }
.plan-status-row .badge { white-space: normal; }
.plan-warning { margin: 6px 0 0; font-size: 0.85rem; color: var(--orange); }
.plan-publish { margin-bottom: var(--space); }
.plan-publish .section-head p { margin: 0; }
.round-row { flex-wrap: wrap; }
.avail-quick { display: grid; gap: 8px; margin-bottom: 12px; }
.avail-quick-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.avail-list { display: grid; }
.avail-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--border); }
.avail-day { font-weight: 600; }
.avail-buttons { display: flex; gap: 6px; }
.avail-buttons form { margin: 0; }
.avail-buttons .btn { min-width: 84px; }
.avail-buttons .avail-ja.is-chosen { background: var(--green); color: var(--surface); border-color: var(--green); font-weight: 700; }
.avail-buttons .avail-misschien.is-chosen { background: var(--orange); color: var(--surface); border-color: var(--orange); font-weight: 700; }
.avail-buttons .avail-nee.is-chosen { background: var(--red); color: var(--surface); border-color: var(--red); font-weight: 700; }
.swap-incoming { border-left: 4px solid var(--blue); }
.swap-row, .roster-row { flex-wrap: wrap; }

/* Attendance: choose a day */
.message-info { background: var(--blue-bg); color: var(--blue); }
.day-picker { align-items: center; flex-wrap: nowrap; }
.day-picker input[type="date"] { width: auto; min-height: 44px; }

/* Kijk als (beheerder) */
.view-as-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 16px; background: var(--orange-bg); color: var(--orange); font-size: 0.95rem; }
.view-as-actions { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.view-as-bar form { margin: 0; }
.view-as-row { margin: 0; }
.view-as-choice { width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left; font: inherit; }
.view-as-choice.is-current { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.round-months > h2 { margin-top: 0; }
.plan-time { white-space: nowrap; }
.plan-day { scroll-margin-top: 120px; }
.round-mails { margin-top: var(--space); }

/* Beheer → E-mailteksten */
.mail-fields { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; margin: 0 0 var(--space); font-size: 0.95rem; }
.mail-fields dt { font-weight: 600; }
.mail-fields dd { margin: 0; color: var(--text-muted); }
.mail-reset { margin-top: var(--space); padding-top: var(--space); border-top: 1px solid var(--border); }
#mail-text-form textarea { font-family: inherit; line-height: 1.5; }

/* Mijn account → Weergave */
.theme-card { margin: var(--space) 0; }
.theme-card .choice .icon { vertical-align: -3px; margin-right: 4px; }

/* Photos */
.has-photo { overflow: hidden; padding: 0; background: var(--surface-2); }
.has-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-card { text-align: left; }
.photo-preview { display: flex; justify-content: center; margin-bottom: var(--space); }
.photo-preview .avatar, .photo-new { width: 180px; height: 180px; border-radius: 50%; font-size: 3rem; }
.photo-new { object-fit: cover; box-shadow: var(--shadow); }
.photo-pick { display: grid; gap: 8px; justify-items: start; }
.photo-pick-btn { cursor: pointer; }
.photo-delete { margin-top: var(--space); padding-top: var(--space); border-top: 1px solid var(--border); display: grid; gap: 8px; justify-items: start; }
.person-photo-link { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; font-size: 0.85rem; }
.emergency-photo { width: 140px; height: 140px; font-size: 2.6rem; }
.photo-editor { display: grid; gap: 12px; justify-items: center; margin-bottom: var(--space); }
.photo-stage { position: relative; width: min(100%, 320px); aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.photo-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.photo-stage canvas:active { cursor: grabbing; }
.photo-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at center, transparent 69.5%, rgba(0, 0, 0, 0.45) 70.5%); }
.photo-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.photo-tools input[type="range"] { width: 180px; accent-color: var(--blue); }
.photo-tools .btn-icon { font-size: 1.4rem; font-weight: 700; min-width: 48px; }
.photo-pick-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.photo-editor[hidden] { display: none; }
.side-stack { display: grid; gap: var(--space); align-content: start; }

/* ---------- HAssistent wordmark (login and "Wie ben jij?") ---------- */
.hmark { --hm: clamp(2.6rem, 9vw, 5.2rem); display: grid; justify-items: center; gap: 4px; margin: 4vh 0 calc(var(--space) * 1.5); }
.hmark-word { min-height: var(--hm); font-size: var(--hm); font-weight: 800; letter-spacing: -0.045em; line-height: 1; white-space: nowrap; display: flex; align-items: center; }
.hmark-h { color: var(--accent); display: inline-block; transform-origin: 50% 60%; }
.hmark-rest { color: var(--text); }
.hmark-gone { display: inline-block; overflow: hidden; max-width: 0; opacity: 0; white-space: nowrap; color: var(--text-muted); }
.hmark-pulse { width: min(100%, 420px); height: 56px; }
.hmark-pulse path { fill: none; stroke: var(--accent); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }

/* playing (app.js adds .is-playing once per session) */
/* the long name starts at half size, so it fits; it grows while "eartBeat" folds away */
.hmark.is-playing .hmark-word { font-size: calc(var(--hm) * 0.48); animation: hmark-grow 1s 0.9s cubic-bezier(.7, 0, .2, 1) forwards; }
.hmark.is-playing .hmark-gone { max-width: 9.5em; opacity: 1; animation: hmark-fold 1s 0.9s cubic-bezier(.7, 0, .2, 1) forwards; }
.hmark.is-playing .hmark-h { color: var(--text); animation: hmark-red 0.5s 1.6s ease forwards, hmark-beat 1.2s 2s ease-in-out 2; }
.hmark.is-playing .hmark-pulse path { stroke-dasharray: 1300; stroke-dashoffset: 1300; animation: hmark-draw 1.3s 2s cubic-bezier(.2, .7, .2, 1) forwards; }
@keyframes hmark-grow { to { font-size: var(--hm); } }
@keyframes hmark-fold { 40% { opacity: 0; } to { max-width: 0; opacity: 0; } }
@keyframes hmark-red { to { color: var(--accent); } }
@keyframes hmark-beat { 0% { transform: scale(1); } 14% { transform: scale(1.18); } 28% { transform: scale(1); } 42% { transform: scale(1.1); } 70%, 100% { transform: scale(1); } }
@keyframes hmark-draw { to { stroke-dashoffset: 0; } }

/* Brand: the HeartBeat runner in the red square, and "HAssistent" with a red H */
.brand-mark .lucide-runner { width: 28px; height: 28px; }
.runner-shirt { fill: var(--accent); }
.brand-name { letter-spacing: -0.02em; }
.brand-h { color: var(--accent); }

/* Help: the manuals inside the app */
.help-page { max-width: 820px; line-height: 1.55; }
.help-page h2 { margin-top: 1.6em; }
.help-page h2.help-title { margin-top: 0; }
.help-page h3 { margin-top: 1.4em; }
.help-page img { display: block; max-width: 100%; height: auto; margin: 12px 0 20px; border: 1px solid var(--border); border-radius: var(--radius-s); }
.help-page li { margin: 4px 0; }
.help-page blockquote { margin: 12px 0; padding: 10px 16px; border-left: 4px solid var(--accent); background: var(--surface-2); border-radius: var(--radius-s); }
.help-page blockquote p { margin: 0; }
.help-page hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
.help-page [id] { scroll-margin-top: 170px; }
.help-toc { margin: 8px 0 16px; padding: 8px 14px; background: var(--surface-2); border-radius: var(--radius-s); }
.help-toc summary { cursor: pointer; font-weight: 600; }
.help-hits { list-style: none; padding: 0; margin: 0; }
.help-hits li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.help-hits li:last-child { border-bottom: 0; }
.help-hits p { margin: 4px 0 0; }
.help-search { grid-template-columns: minmax(0, 1fr) auto; max-width: 820px; }

/* Planning board: name picker (planpicker.js) */
.picker-native { position: absolute !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.picker-button, .picker-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; }
.picker-button {
  min-height: 44px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-s);
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
}
.picker-button:hover:not(:disabled) { border-color: var(--text-muted); }
.picker-button:focus-visible { outline: 3px solid var(--focus, var(--blue)); outline-offset: 1px; }
.picker-button[aria-expanded="true"] { border-color: var(--blue); }
.picker-button:disabled { opacity: .55; cursor: not-allowed; }
.picker-button .avatar, .picker-item .avatar { width: 28px; height: 28px; font-size: .72rem; flex: 0 0 auto; }
.picker-empty { background: var(--surface-2); color: var(--text-muted); }
.picker-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-caret { flex: 0 0 auto; width: 8px; height: 8px; margin: 0 4px 3px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(45deg); }
.picker-tag { flex: 0 0 auto; padding: 1px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.picker-tag.is-maybe { background: var(--orange-bg, #fff4e5); color: var(--orange, #a44a00); }
.picker-tag.is-warn { background: var(--red-bg); color: var(--red); }
.picker-menu {
  position: absolute; z-index: 50; max-width: min(340px, calc(100vw - 16px)); max-height: 60vh; overflow-y: auto;
  padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .16);
}
.picker-item { padding: 9px 12px; border-radius: 10px; cursor: pointer; font-weight: 500; }
.picker-item + .picker-item { margin-top: 2px; }
.picker-item:hover, .picker-item:focus { background: var(--surface-2); outline: none; }
.picker-item:focus-visible { box-shadow: inset 0 0 0 2px var(--blue); }
.picker-item[aria-selected="true"] { background: var(--surface-2); }
.picker-item.is-none { color: var(--text-muted); }
.picker-check { flex: 0 0 auto; color: var(--blue); font-weight: 700; }
.picker-hint { margin: 6px 12px 4px; color: var(--text-muted); font-size: .88rem; }

/* Reports: lesson remarks */
.report-table td.report-note { min-width: 220px; max-width: 360px; white-space: normal; color: var(--text); }
.report-notes { margin-top: var(--space); }
.report-notes ul { list-style: none; margin: 0; padding: 0; }
.report-notes li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.report-notes li:last-child { border-bottom: 0; }
.report-notes p { margin: 4px 0 0; }

/* ---------- PIN slip (shown once after the app made a PIN; printable) */
.pin-slip { max-width: 420px; text-align: center; border: 2px dashed var(--border); }
.pin-slip p { margin: 0; }
.pin-slip-club { color: var(--text-muted); font-size: 0.9rem; }
.pin-slip-name { margin-top: 8px !important; font-size: 1.25rem; font-weight: 700; }
.pin-slip-label { margin-top: 16px !important; color: var(--text-muted); }
.pin-slip-code { font-size: 3rem; font-weight: 800; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; color: var(--text); }
.pin-slip-steps { text-align: left; display: inline-block; margin: 12px 0 0; padding-left: 20px; }
.pin-slip + .help { margin-top: var(--space); }
.pin-slip ~ .form-actions { margin-top: var(--space); }

@media print {
  .topbar, .subnav, .messages, .no-print { display: none !important; }
  body, .page { background: #fff !important; color: #000 !important; }
  .pin-slip { box-shadow: none; margin: 0 auto; color: #000; }
  .pin-slip-club, .pin-slip-label { color: #333; }
  .pin-slip-code { color: #000; }
}

/* ---------- day/night button on the tablet: shows the moon in light mode, the sun in dark mode */
.theme-toggle { display: contents; }
.when-light { display: inline-flex; }
.when-dark { display: none; }
:root[data-theme="donker"] .when-dark { display: inline-flex; }
:root[data-theme="donker"] .when-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="licht"]) .when-dark { display: inline-flex; }
  :root:not([data-theme="licht"]) .when-light { display: none; }
}

/* ---------- Emergency button and window (tablet) ---------- */
.btn-emergency { position: relative; gap: 6px; padding: 0 14px; touch-action: manipulation; }
/* Make room for it in the tablet header, so the menu stays on one row. */
.usermenu:has(.btn-emergency) { gap: 4px; }
.btn-emergency.is-armed { animation: emergency-armed 500ms ease-in-out infinite alternate; }
.btn-emergency.is-armed::after {
  content: attr(data-armed-label);
  position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 20;
  padding: 6px 10px; border-radius: 8px; white-space: nowrap;
  background: var(--text); color: var(--bg); font-size: 0.9rem; font-weight: 600;
}
@keyframes emergency-armed { to { box-shadow: 0 0 0 6px var(--red-bg); } }
@media (max-width: 640px) { .btn-emergency .btn-emergency-label { display: none; } }
dialog.emergency { width: min(520px, calc(100vw - 24px)); text-align: center; }
.emergency-title { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--red); font-size: 1.5rem; }
.emergency-call { margin: 0; font-size: 1.6rem; }
.emergency-call strong { font-size: 2.6rem; color: var(--red); }
.emergency-place { padding: 12px 16px; border-radius: 14px; background: var(--surface-2); }
.emergency-label { margin: 0 0 4px; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--text-muted); }
.emergency-address { font-style: normal; font-size: 1.4rem; font-weight: 700; line-height: 1.35; }
.emergency .help { margin: 0; }
.cpr { display: grid; justify-items: center; gap: 8px; }
.cpr[hidden] { display: none; }
.cpr-beat {
  display: grid; place-items: center; width: 140px; height: 140px; border-radius: 50%;
  background: var(--red-bg); color: var(--red); border: 4px solid var(--red);
}
.cpr-beat.is-pulse { animation: cpr-pulse 260ms ease-out; }
@keyframes cpr-pulse { 0% { transform: scale(1.12); background: var(--red); color: #fff; } }
.cpr-count { font-size: 3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.cpr.is-breathing .cpr-count { font-size: 1.3rem; }
.cpr.is-breathing .cpr-beat { background: var(--surface-2); border-color: var(--blue); color: var(--blue); }
.cpr-text { margin: 0; }
.btn-cpr { min-height: 60px; font-size: 1.15rem; }
.cpr-when-on { display: none; }
.emergency.is-cpr .cpr-when-on { display: inline-flex; align-items: center; gap: 8px; }
.emergency.is-cpr .cpr-when-off { display: none; }
.cpr-when-off { display: inline-flex; align-items: center; gap: 8px; }
.emergency.is-cpr .btn-cpr { background: var(--surface-2); color: var(--text); }
