/* Hardloopcoach – ontwerpsysteem (zie ontwerp-herontwerp.md).
   Donker, rustig, drie lagen als diepte: --bg (pagina), --surface (tweede laag, tabbalk,
   zijbalk, groepen), --card (verhoogd). Het accent is schaars: hoogstens één gevuld vlak per
   scherm (de hoofdactie), verder alleen kleine indicatoren en de actieve staat. */

:root {
  --bg: #0A0A0A;
  --surface: #141414;
  --card: #1C1C1E;
  --card-hoog: #242426;
  --card-druk: #2C2C2E;     /* knop onder de vinger, lijnen binnen een kaart */
  --text-zacht: #D1D1D6;    /* lopende tekst en neutrale tekens op een kaart */
  --accent-hover: #D2F884;
  --text-3: #6E6E73;        /* stille randen en strepen (geen tekst: te weinig contrast) */
  --kaart-top: #202022;     /* bovenkant van het verloop op de hoofdkaart */
  --orb-licht: #F2FFD0;
  --orb-diep: #2B3A12;
  --text: #F5F5F7;
  --text-2: #98989D;
  --border: #29292C;
  --accent: #C6F568;
  --accent-ink: #0A0A0A;
  --waarschuwing: #FFB457;
  --alarm: #FF6B5E;
  --z1: #48484A;
  --z2: #7FA43A;
  --z3: #C6F568;
  --z4: #FFB457;
  --z5: #FF6B5E;

  /* Doorschijnende tinten (vlakken, ringen, verlopen) van het accent, het alarm en de orb. */
  --ok-vlak: rgba(198, 245, 104, .10);
  --alarm-vlak: rgba(255, 107, 94, .14);
  --medisch-vlak: rgba(255, 107, 94, .16);
  --medisch-rand: rgba(255, 107, 94, .45);
  --orb-glans: rgba(242, 255, 208, 0);
  --orb-ring: rgba(198, 245, 104, .08);
  --orb-ring-wijd: rgba(198, 245, 104, .05);
  --kaart-gloed: rgba(198, 245, 104, .09);
  --kaart-gloed-uit: rgba(198, 245, 104, 0);

  --marge: 20px;
  --r-kaart: 24px;
  --r-hoofd: 28px;
  --r-groep: 20px;
  --r-knop: 14px;
  --tabbalk: 64px;
  --veer: 140ms cubic-bezier(.3, .7, .4, 1);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI",
    system-ui, sans-serif;
  color-scheme: dark;
}

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 24px;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: break-word;
}

/* --- Typografie ------------------------------------------------------------------------ */

h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
h1 { font-size: 34px; line-height: 40px; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 17px; line-height: 22px; font-weight: 600; }
p, li { max-width: 70ch; }
small { font-size: 13px; line-height: 18px; font-weight: 400; color: var(--text-2); }
.bijtekst, .onderwerp { font-size: 15px; line-height: 20px; color: var(--text-2); }
strong { font-weight: 600; }

a { color: var(--text); text-decoration-color: var(--text-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--text); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.tabblad:focus-visible, .menu-profiel:focus-visible { outline-offset: -2px; border-radius: 12px; }

.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;
}
.naar-inhoud {
  position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 16px;
  background: var(--accent); color: var(--accent-ink); border-radius: var(--r-knop); font-weight: 600;
}
.naar-inhoud:focus { top: calc(env(safe-area-inset-top) + 12px); }

/* --- Raamwerk: telefoon ---------------------------------------------------------------- */

.raamwerk { min-height: 100vh; }

.inhoud {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding:
    calc(env(safe-area-inset-top) + 16px)
    calc(env(safe-area-inset-right) + var(--marge))
    calc(env(safe-area-inset-bottom) + var(--tabbalk) + 40px)
    calc(env(safe-area-inset-left) + var(--marge));
  /* Overgang tussen schermen: een korte fade van de inhoud (uit bij reduced motion). */
  animation: verschijn 180ms ease-out both;
}
@keyframes verschijn { from { opacity: 0; } to { opacity: 1; } }

.inhoud > * + * { margin-top: 16px; }
.inhoud > h1 { margin-top: 12px; }
.inhoud > h1 + * { margin-top: 20px; }
.inhoud > h2 { margin-top: 32px; }
/* Ritme binnen en tussen secties met een kop. */
.inhoud > section > * + * { margin-top: 12px; }
.inhoud > section > .groepkop + * { margin-top: 0; }
.inhoud > section:not(.hoofdkaart):not(.medisch):has(> h2:first-child) { margin-top: 32px; }

/* Tabbalk onderin */
.hoofdmenu {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.merk, .menu-profiel { display: none; }
.tabbladen {
  display: grid; grid-template-columns: repeat(4, 1fr);
  list-style: none; padding: 0; margin: 0 auto; max-width: 560px;
}
.tabblad {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: var(--tabbalk); padding: 6px 4px;
  color: var(--text-2); text-decoration: none;
  font-size: 11px; line-height: 13px; font-weight: 500; letter-spacing: 0.01em;
  transition: color var(--veer);
}
.tabblad[aria-current="page"] { color: var(--accent); }
.tabblad:active .icoon { transform: scale(.92); }
.icoon { flex: none; transition: transform var(--veer); }

/* Het coachpaneel bestaat pas op een breed scherm. */
.coachpaneel { display: none; }

/* --- Raamwerk: desktop ------------------------------------------------------------------ */

@media (min-width: 1024px) {
  /* De zijbalk kleurt over de hele hoogte van het raamwerk, ook als de pagina langer is. */
  .raamwerk {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    align-items: start;
    background: linear-gradient(to right, var(--surface) 247px, var(--border) 247px, var(--border) 248px, transparent 248px);
  }
  .hoofdmenu {
    position: sticky; top: 0; bottom: auto; height: 100vh;
    display: flex; flex-direction: column; gap: 6px;
    padding: 28px 14px 24px;
    border-top: 0; background: transparent;
  }
  .merk {
    display: block; padding: 4px 14px 22px;
    font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -0.01em;
    text-decoration: none;
  }
  .tabbladen { display: flex; flex-direction: column; gap: 2px; margin: 0; max-width: none; }
  .tabblad, .menu-profiel {
    flex-direction: row; justify-content: flex-start; gap: 12px;
    min-height: 44px; padding: 10px 14px; border-radius: 12px;
    font-size: 17px; line-height: 22px; font-weight: 500; letter-spacing: 0;
    color: var(--text-2); text-decoration: none;
  }
  .tabblad:hover, .menu-profiel:hover { color: var(--text); background: var(--card); }
  .tabblad[aria-current="page"], .menu-profiel[aria-current="page"] {
    color: var(--accent); background: var(--card);
  }
  .menu-profiel { display: flex; align-items: center; margin-top: auto; }
  .inhoud { padding: 48px 40px 72px; }
}

@media (min-width: 1280px) {
  .raamwerk {
    grid-template-columns: 248px minmax(0, 1fr) 360px;
    background:
      linear-gradient(to left, transparent 359px, var(--border) 359px, var(--border) 360px, transparent 360px),
      linear-gradient(to right, var(--surface) 247px, var(--border) 247px, var(--border) 248px, transparent 248px);
  }
  .coachpaneel {
    display: block; position: sticky; top: 0; max-height: 100vh; overflow-y: auto;
    padding: 48px 28px 32px;
  }
  /* Op Vandaag staat de coach dan rechts; de kaart in het midden zou hem herhalen. */
  .scherm-vandaag .vandaag-coach { display: none; }
}

/* --- Bouwstenen ------------------------------------------------------------------------- */

/* Knoppen */
button, .knop {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; margin: 0;
  border: 0; border-radius: var(--r-knop);
  background: var(--card-hoog); color: var(--text);
  font: inherit; font-size: 17px; line-height: 22px; font-weight: 600;
  text-decoration: none; text-align: center; cursor: pointer;
  transition: transform var(--veer), background-color var(--veer), opacity var(--veer);
}
button:hover, .knop:hover { background: var(--card-druk); }
button:active, .knop:active { transform: scale(.98); }
.knop-accent, button.knop-accent { background: var(--accent); color: var(--accent-ink); }
.knop-accent:hover { background: var(--accent-hover); }
.knop-breed { display: flex; width: 100%; }

/* Formulieren */
label { display: block; margin: 16px 0 6px; font-size: 15px; line-height: 20px; font-weight: 600; }
label small { font-weight: 400; }
input, select, textarea { font: inherit; max-width: 100%; color: var(--text); }
input[type="text"], input[type="file"], select, textarea {
  display: block; width: 100%; min-height: 44px; padding: 11px 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-knop);
  font-size: 17px; line-height: 22px;
}
input[type="file"] { padding: 9px 12px; color: var(--text-2); }
input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 6px 12px; border: 0; border-radius: 10px;
  background: var(--card-hoog); color: var(--text); font: inherit; font-size: 15px; font-weight: 600;
}
textarea { min-height: 88px; resize: vertical; }
select {
  -webkit-appearance: none; appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%),
    linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
input::placeholder, textarea::placeholder { color: var(--text-2); }   /* contrast */
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent;
}
input[type="checkbox"] {
  width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--accent);
}
label:has(> input[type="checkbox"]), label.vink {
  display: flex; align-items: center; gap: 12px; min-height: 44px; font-weight: 400; font-size: 17px;
}
form button[type="submit"], .knoppen { margin-top: 20px; }
fieldset.knoppen {
  border: 0; padding: 0; margin-inline: 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 10px;
}
fieldset.knoppen textarea { flex: 1 1 100%; }
fieldset.knoppen:disabled button { opacity: .5; cursor: wait; }
.uitleg { margin-top: 8px; font-size: 15px; line-height: 20px; color: var(--text-2); }
.fouttekst { display: block; margin-top: 6px; color: var(--alarm); font-size: 15px; font-weight: 600; }
.met-fout input, .met-fout select, .met-fout textarea { border-color: var(--alarm); }

/* Groepen: een gegroepeerde lijst zoals iOS-instellingen */
.groep {
  list-style: none; padding: 0;   /* geen margereset: de marge komt uit het paginaritme */
  background: var(--surface); border-radius: var(--r-groep); overflow: hidden;
}
.groep > li {
  position: relative; max-width: none; padding: 14px 16px; min-height: 52px;
}
.groep > li + li::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--border);
}
.groep > li > a:only-child {
  display: flex; align-items: center; gap: 14px; margin: -14px -16px; padding: 14px 16px;
  min-height: 52px; text-decoration: none;
}
.groep > li > a:only-child:hover { background: var(--card); }
/* De groep knipt af (overflow: hidden): de focusring valt daarom binnen de rij, met de ronde
   hoeken van de groep op de eerste en laatste rij. */
.groep > li > a:only-child:focus-visible { outline-offset: -2px; border-radius: 6px; }
.groep > li:first-child > a:only-child:focus-visible {
  border-top-left-radius: var(--r-groep); border-top-right-radius: var(--r-groep);
}
.groep > li:last-child > a:only-child:focus-visible {
  border-bottom-left-radius: var(--r-groep); border-bottom-right-radius: var(--r-groep);
}
.groep .icoon { color: var(--text-2); }
.groepkop {
  margin: 28px 0 8px 16px; font-size: 15px; line-height: 20px; font-weight: 400; color: var(--text-2);
}

/* Secties van bestaande pagina's: een vlak op de tweede laag */
.blok {
  margin: 16px 0 0; padding: 20px; border-radius: var(--r-kaart);
  background: var(--surface);
}
.blok > * + * { margin-top: 12px; }
p.blok, p.blok.ok { padding: 14px 16px; border-radius: 16px; }
.blok.ok { background: var(--ok-vlak); color: var(--text); }
.blok.fout { background: var(--alarm-vlak); }
.blok.review > h3 { font-size: 17px; line-height: 22px; font-weight: 600; }

/* Meldingen */
.melding {
  margin: 16px 0 0; padding: 16px 18px; border-radius: 18px;
  background: var(--alarm-vlak); color: var(--text);
}
.melding > * + * { margin-top: 8px; }
.melding-kop { font-weight: 600; color: var(--alarm); }
.melding ul { padding-left: 20px; }
/* Een mededeling zonder alarm (`Dit plan is aangepast door de regels.`): de gewone ondergrond met
   een fijne rand, niet het rode vlak. */
.melding.melding-info { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.melding-info .melding-kop { color: var(--text); }

.medisch {
  padding: 18px 20px; border-radius: var(--r-kaart);
  background: var(--medisch-vlak); box-shadow: inset 0 0 0 1px var(--medisch-rand);
}
.medisch-kop {
  display: flex; align-items: center; gap: 10px;
  font-size: 17px; line-height: 22px; font-weight: 600; color: var(--alarm);
}
.medisch-kop::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--alarm); flex: none;
}
.medisch p { margin-top: 10px; font-size: 17px; line-height: 24px; }

.tekst { white-space: pre-wrap; overflow-wrap: anywhere; }

details { border-radius: 16px; }
details > summary {
  display: flex; align-items: center; gap: 10px; min-height: 44px;
  cursor: pointer; font-weight: 600; list-style: none;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::before {
  content: ""; width: 7px; height: 7px; flex: none; margin: 0 4px;
  border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2);
  transform: rotate(-45deg); transition: transform var(--veer);
}
details[open] > summary::before { transform: rotate(45deg); }
details > :not(summary) { margin-top: 8px; }

/* Skelet: laadtoestand zonder draaiwieltje */
.skelet { display: grid; gap: 10px; padding: 4px 0; }
.skelet span {
  display: block; height: 16px; border-radius: 8px; background: var(--card);
  animation: skelet 1.6s ease-in-out infinite;
}
.skelet span.kort { width: 55%; }
@keyframes skelet { 50% { opacity: .5; } }

.htmx-indicator { display: none; }
.htmx-request.htmx-indicator, .htmx-request .htmx-indicator { display: block; }
.bezig { color: var(--text-2); font-size: 15px; }


/* --- Vandaag ---------------------------------------------------------------------------- */

.vandaag-kop { display: flex; align-items: flex-start; gap: 16px; padding-top: 8px; }
.vandaag-kop > div { flex: 1; min-width: 0; }
.begroeting { font-size: 17px; line-height: 22px; color: var(--text-2); }
.vandaag-kop h1 { margin-top: 2px; }
.datum { margin-top: 4px; font-size: 15px; line-height: 20px; color: var(--text-2); }
.profielrondje {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; margin-top: 2px;
  border-radius: 50%; background: var(--card); color: var(--text);
  transition: transform var(--veer), background-color var(--veer);
}
.profielrondje:hover { background: var(--card-hoog); }
.profielrondje:active { transform: scale(.94); }

.scherm-vandaag .inhoud > .vandaag-kop + * { margin-top: 24px; }
/* Taak 28: een grenswijziging door de coach, als gewone bijtekst onder de hoofdkaart. */
.vandaag-coachwijziging { padding: 0 4px; font-size: 15px; line-height: 20px; color: var(--text-2); }
.vandaag-coachwijziging a { color: var(--text); }

.regel-gegevens {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 12px 16px;
  border-radius: var(--r-groep); background: var(--surface); text-decoration: none;
}
.regel-gegevens .punt { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--waarschuwing); }
.regel-gegevens span { flex: 1; min-width: 0; }
.regel-gegevens strong { display: block; font-size: 17px; line-height: 22px; }
.regel-gegevens small { display: block; }
.regel-gegevens .actie { flex: none; font-style: normal; font-size: 15px; font-weight: 600; color: var(--text); }

/* Coachkaart met de orb */
.coachkaart {
  display: grid; grid-template-columns: auto 1fr; column-gap: 14px; row-gap: 14px;
  padding: 18px 20px 16px; border-radius: var(--r-kaart); background: var(--surface);
}
.coachkaart .orb { grid-row: span 2; margin-top: 2px; }
.coachkaart .wie { font-size: 15px; line-height: 20px; color: var(--text-2); }
.coachkaart .briefing { margin-top: 4px; font-size: 17px; line-height: 24px; }
.coachkaart .knop { grid-column: 2; justify-self: start; min-height: 44px; padding: 10px 16px; font-size: 15px; }

.orb {
  position: relative; width: 36px; height: 36px; border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, var(--orb-licht) 0%, var(--orb-glans) 34%),
    radial-gradient(circle at 50% 55%, var(--accent) 0%, var(--z2) 58%, var(--orb-diep) 100%);
  box-shadow: 0 0 0 4px var(--orb-ring);
  animation: ademen 5.5s ease-in-out infinite;
}
@keyframes ademen {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 4px var(--orb-ring); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 8px var(--orb-ring-wijd); }
}

/* Hoofdkaart: de training van vandaag */
.hoofdkaart {
  padding: 24px 22px 22px; border-radius: var(--r-hoofd);
  background:
    radial-gradient(120% 90% at 0% 0%, var(--kaart-gloed) 0%, var(--kaart-gloed-uit) 55%),
    linear-gradient(180deg, var(--kaart-top) 0%, var(--card) 100%);
}
.hoofdkaart .wanneer { font-size: 15px; line-height: 20px; color: var(--text-2); }
.hoofdkaart h2 { margin-top: 4px; font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -0.015em; }
.kerncijfers { display: flex; flex-wrap: wrap; gap: 8px 36px; margin-top: 22px; }
.kerncijfer { display: flex; flex-direction: column; }
.kerncijfer .getal {
  font-size: 52px; line-height: 52px; font-weight: 650; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.kerncijfer .label { margin-top: 6px; font-size: 15px; line-height: 20px; color: var(--text-2); }
.hoofdkaart .intensiteit {
  display: flex; align-items: center; gap: 8px; margin-top: 22px;
  font-size: 15px; line-height: 20px; font-weight: 600;
}
.hoofdkaart .intensiteit::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text-2); flex: none;
}
.hoofdkaart .beschrijving { margin-top: 8px; font-size: 17px; line-height: 24px; color: var(--text-zacht); }
.hoofdkaart .knop { margin-top: 24px; }
.hoofdkaart.gedempt { background: var(--surface); }
.hoofdkaart.gedempt h2, .hoofdkaart.gedempt .getal { color: var(--text-2); }
/* Resultaat: de afstand groot, tijd en tempo kleiner ernaast eronder (past op 393 px). */
.kerncijfers.resultaat { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.kerncijfers.resultaat .kerncijfer:first-child { grid-column: 1 / -1; }
.kerncijfers.resultaat .kerncijfer:not(:first-child) .getal { font-size: 32px; line-height: 36px; letter-spacing: -0.02em; }
.hoofdkaart.leeg-plan p { margin-top: 8px; color: var(--text-2); font-size: 17px; line-height: 24px; }

/* Weekstrook */
.week { padding: 4px 0 0; }
.week-kop { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.week-kop h2 { font-size: 17px; line-height: 22px; }
.week-kop p { font-size: 15px; line-height: 20px; color: var(--text-2); }
.weekstrook {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  list-style: none; padding: 0; margin-top: 12px;
}
.weekstrook li {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 10px 0 12px; border-radius: 16px; max-width: none;
}
.weekstrook li[aria-current="date"] { background: var(--surface); }
.weekstrook .dagkort { font-size: 13px; line-height: 18px; color: var(--text-2); }
.weekstrook li[aria-current="date"] .dagkort { color: var(--text); font-weight: 600; }
.teken { display: grid; place-items: center; width: 14px; height: 14px; }
.teken::before { content: ""; display: block; }
.teken-gelopen::before { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.teken-kracht::before { width: 12px; height: 12px; border-radius: 50%; background: var(--text-zacht); }
.teken-run_gepland::before { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--text-2); }
.teken-kracht_gepland::before { width: 11px; height: 11px; border-radius: 3px; box-shadow: inset 0 0 0 2px var(--text-2); }
.teken-rust::before { width: 4px; height: 4px; border-radius: 50%; background: var(--z1); }

/* Herstel: klein en secundair */
.herstelrij {
  display: grid; grid-template-columns: repeat(3, 1fr);
  list-style: none; padding: 0; border-radius: var(--r-groep); background: var(--surface);
}
.herstelrij li { padding: 14px 14px 12px; max-width: none; min-width: 0; }
.herstelrij li + li { box-shadow: inset 1px 0 0 var(--border); }
.herstelrij .waarde {
  display: flex; align-items: baseline; gap: 6px; min-width: 0;
  font-size: 17px; line-height: 22px; font-weight: 600;
}
.herstelrij .statuspunt { transform: translateY(-2px); }
.herstelrij .label { display: block; margin-top: 2px; font-size: 13px; line-height: 18px; color: var(--text-2); }
.statuspunt { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-2); }
/* Goed herstel is zone 2: het accent blijft voor de hoofdactie. */
.statuspunt-groen { background: var(--z2); }
.statuspunt-oranje { background: var(--waarschuwing); }
.statuspunt-rood { background: var(--alarm); }
.herstelrij .klein-data { font-size: 15px; font-weight: 500; color: var(--text-2); white-space: normal; }

.voetregel { text-align: center; font-size: 13px; line-height: 18px; color: var(--text-2); }
.scherm-vandaag .inhoud > .voetregel { margin-top: 28px; }

/* --- Coachpaneel en coachpagina --------------------------------------------------------- */

.paneel > * + * { margin-top: 24px; }
.paneel-kop { display: flex; align-items: center; gap: 12px; }
.paneel-kop h2 { font-size: 22px; line-height: 28px; }
.paneel .briefing { font-size: 17px; line-height: 24px; }
.paneel h3 { font-size: 15px; line-height: 20px; font-weight: 400; color: var(--text-2); margin-bottom: 8px; }
.paneel .groep { background: var(--surface); }
.paneel .groep > li { font-size: 15px; line-height: 20px; min-height: 0; padding: 12px 14px; }
.paneel .groep > li + li::before { left: 14px; }
.paneel .knop { min-height: 44px; padding: 10px 16px; font-size: 15px; }

.paneel-inzicht { display: flex; align-items: baseline; gap: 10px; }
.ernstpunt { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--text-2); transform: translateY(-1px); }
.ernstpunt-hoog { background: var(--alarm); }
.ernstpunt-middel { background: var(--waarschuwing); }
.ernstpunt-positief { background: var(--z2); }     /* het accent blijft gereserveerd */

/* Coach: het gesprek, de vragen voor je Grok Bot en de ingebouwde coach (ook de fragmenten
   `/ui/vandaag` en `/ui/coach/chat`, en de vragen in het coachpaneel). Elke selector in dit blok
   begint met `.gs-` (of `.inhoud > .gs-`), zodat hij geen ander scherm raakt. Het accent staat
   hier alleen op `Verstuur` (met sleutel); de orb in de kop is het ene bewegende element. */
.gs-kop { display: flex; align-items: center; gap: 14px; padding-top: 8px; }
.gs-kop .orb { width: 44px; height: 44px; flex: none; }
.gs-kop-tekst { flex: 1; min-width: 0; }
.gs-bron { margin-top: 4px; font-size: 15px; line-height: 20px; color: var(--text-2); }
/* De link staat gewoon in de zin (de regelhoogte blijft 20 px); een onzichtbaar vlak van
   44 px hoog rond de link is het aanraakdoel. */
.gs-bron a { position: relative; color: var(--text); }
.gs-bron a::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%); }
/* De medische tekst (of anders het gesprek) staat 24 px onder de kop. */
.inhoud > .gs-kop + * { margin-top: 24px; }

/* Het gesprek: één kolom; de orb in de kop is de afzender, de bellen beginnen links op één lijn. */
.gs-gesprek, .gs-sectie { max-width: 34em; }
.gs-gesprek > section { margin-top: 28px; }
.gs-tussenkop {
  margin-bottom: 8px; font-size: 15px; line-height: 20px; font-weight: 400; letter-spacing: 0;
  color: var(--text-2);
}
.gs-bel {
  min-width: 0; max-width: 100%; padding: 12px 16px; border-radius: 20px 20px 20px 6px;
  background: var(--surface); font-size: 17px; line-height: 24px;
}
.gs-bellen { list-style: none; padding: 0; display: grid; gap: 8px; }
.gs-bellen > li { max-width: none; }
/* De uitklapper heeft zelf een aanraakhoogte van 44 px; de bel sluit er strak onder af. */
.gs-inzicht { padding-bottom: 4px; }

/* Een inzicht: ernstpunt en titel, het bewijs, het label en het uitklapbare advies. */
.gs-titel { display: flex; align-items: flex-start; gap: 10px; }
.gs-titel .ernstpunt { margin-top: 8px; transform: none; }
.gs-tekst { margin-top: 6px; color: var(--text-zacht); }
.gs-labels { margin-top: 10px; }
/* Een omlijnde chip op de bel (`--surface`), geen vlak op `--card`: daar mag 13 px bijtekst. */
.gs-label {
  display: inline-block; padding: 1px 10px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--border);
  font-size: 13px; line-height: 18px; color: var(--text-2);
}
.gs-meer { margin-top: 6px; }
.gs-meer[open] { padding-bottom: 12px; }
.gs-meer > summary { font-size: 15px; line-height: 20px; }
.gs-meer > p { font-size: 15px; line-height: 21px; color: var(--text-zacht); }
.gs-meer-kop { margin-top: 12px; font-size: 15px; line-height: 20px; font-weight: 600; }
.gs-meer > .gs-meer-kop + p { margin-top: 2px; }
/* De link is een blok van 44 px; de bel heeft eronder minder opvulling. */
.gs-plan { padding-bottom: 2px; }
.gs-plan > p + p { margin-top: 0; }
.gs-link a {
  display: flex; align-items: center; width: fit-content; min-height: 44px;
  font-size: 15px; font-weight: 600;
}

/* Vragen voor je Grok Bot: chips die de vraag kopiëren (`coach.js`). */
.gs-kopje { font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: 0; }
.gs-vragen > * + * { margin-top: 12px; }
.gs-uitleg { font-size: 15px; line-height: 20px; color: var(--text-2); }
.gs-chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.gs-chips > li { max-width: 100%; min-width: 0; }
.gs-chip {
  justify-content: flex-start; max-width: 100%; min-height: 44px; padding: 10px 16px;
  border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border);
  color: var(--text); font-size: 15px; line-height: 20px; font-weight: 500; text-align: left;
  white-space: normal; -webkit-user-select: text; user-select: text;
}
.gs-chip:hover { background: var(--card); }
.gs-chip-tekst { min-width: 0; }
.gs-vink { display: none; flex: none; }
.gs-chip.gekopieerd .gs-vink { display: block; }
.gs-gekopieerd { min-height: 20px; font-size: 15px; line-height: 20px; color: var(--text-2); }
.gs-vragen > .gs-gekopieerd { margin-top: 8px; }

/* De ingebouwde coach (alleen met een API-sleutel): dagadvies en chat als bellen. */
.gs-ingebouwd > .gs-tussenkop { margin-bottom: 0; }
.gs-bel-coach { background: var(--surface); }
.gs-dagadvies > * + * { margin-top: 10px; }
.gs-herstel { display: flex; align-items: center; gap: 8px; font-size: 15px; line-height: 20px; font-weight: 600; }
/* Het herstelpunt: groen als zone 2, zodat `Verstuur` het enige accent blijft. */
.gs-herstelpunt { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-2); }
.gs-herstelpunt-groen { background: var(--z2); }
.gs-herstelpunt-oranje { background: var(--waarschuwing); }
.gs-herstelpunt-rood { background: var(--alarm); }
.gs-signalen { padding-left: 20px; font-size: 15px; line-height: 21px; color: var(--text-zacht); }
.gs-bel-kop { margin-top: 16px; font-size: 15px; line-height: 20px; font-weight: 600; }
.gs-dagadvies > .gs-bel-kop + * { margin-top: 6px; }
.gs-leeg { font-size: 15px; line-height: 20px; color: var(--text-2); }
.gs-sessies { list-style: none; padding: 0; }
.gs-sessies > li {
  display: flex; align-items: flex-start; gap: 14px; max-width: none; padding: 8px 0;
}
.gs-sessies > li + li { border-top: 1px solid var(--border); }
.gs-sessie-tekst { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gs-sessie-sub { font-size: 15px; line-height: 20px; color: var(--text-2); }
.gs-maat { flex: none; display: flex; flex-direction: column; align-items: flex-end; }
.gs-maat b { font-size: 17px; line-height: 22px; font-weight: 600; }
.gs-maat small { font-size: 13px; line-height: 16px; color: var(--text-2); }
.gs-chat { list-style: none; padding: 0; display: grid; gap: 10px; }
.gs-chatregel { display: flex; flex-direction: column; align-items: flex-start; max-width: none; }
.gs-chatregel-jij { align-items: flex-end; }
.gs-chatregel .gs-bel { max-width: 85%; }
.gs-bel-jij { background: var(--card); color: var(--text); border-radius: 20px 20px 6px 20px; }
.gs-tijd { margin-top: 4px; padding: 0 6px; font-size: 13px; line-height: 18px; color: var(--text-2); }
.gs-invoer { margin-top: 24px; }
.gs-invoer label { margin-top: 0; }
.gs-invoer .knoppen { margin-top: 0; }
/* Einde coach */

.grok-regel p + p { margin-top: 4px; }

/* --- Training ----------------------------------------------------------------------------- */

/* Ronde icoonknop (weekkiezer, terug); uitgeschakeld is een stille ring zonder link. */
.rondknop {
  display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px;
  border-radius: 50%; background: var(--surface); color: var(--text);
  transition: transform var(--veer), background-color var(--veer);
}
a.rondknop:hover { background: var(--card); }
a.rondknop:active { transform: scale(.94); }
.rondknop[aria-disabled="true"] {
  background: transparent; color: var(--text-3); box-shadow: inset 0 0 0 1px var(--border);
}
.rondknop:focus-visible { border-radius: 50%; }

#deze-week-inhoud > * + * { margin-top: 20px; }
/* De houder van de medische tekst bestaat altijd; leeg neemt hij geen ruimte in. */
#medisch-training:empty { display: none; }
/* … en het blok erna houdt dan de ruimte die onder de kop hoort. */
.inhoud > h1 + #medisch-training:empty + * { margin-top: 20px; }
.trainingsweek > * + * { margin-top: 16px; }
.trainingsweek > .weekkop, .trainingsweek > .tijdlijn { margin-top: 28px; }
.trainingsweek > .toelichting, .trainingsweek > .coach-knoppen { margin-top: 32px; }

.weekkiezer { display: flex; align-items: center; gap: 12px; }
.weeknaam { flex: 1; min-width: 0; text-align: center; }
.weeknaam h2 { font-size: 22px; line-height: 28px; }
.weeknaam p { margin-top: 2px; font-size: 15px; line-height: 20px; color: var(--text-2); }

/* Weekkop: gelopen km groot, het geplande totaal ernaast op de hoogte van het label. */
.weekcijfers { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 4px 16px; }
.weekdoel { font-size: 15px; line-height: 20px; color: var(--text-2); }
progress.voortgang {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 6px;
  margin-top: 18px; border: 0; border-radius: 999px; overflow: hidden;
  background: var(--card); color: var(--accent);
}
progress.voortgang::-webkit-progress-bar { background: var(--card); border-radius: 999px; }
progress.voortgang::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress.voortgang::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--surface);
  font-size: 13px; line-height: 18px; color: var(--text-zacht);
}
.geen-plan { margin-top: 10px; font-size: 17px; line-height: 24px; color: var(--text-2); }

/* Tijdlijn: één gegroepeerde lijst van zeven dagen; links de dag, rechts de regels.
   Elke selector in dit blok begint met `.tijdlijn` (of `.tijdlijn-los`) en gebruikt geen klasse
   uit de weekstrook of het dagadvies van Vandaag (`dag`, `status` …); de dagen heten `tl-dag`. */
.tijdlijn, .tijdlijn-los {
  list-style: none; padding: 0; background: var(--surface); border-radius: var(--r-groep);
}
.tijdlijn > .tl-dag {
  position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 14px;
  max-width: none; padding: 6px 14px;
}
.tijdlijn > .tl-dag + .tl-dag::before {
  content: ""; position: absolute; top: 0; left: 68px; right: 0; height: 1px; background: var(--border);
}
.tijdlijn .tl-datum {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 52px;
}
.tijdlijn .tl-kort { font-size: 13px; line-height: 16px; color: var(--text-2); }
.tijdlijn .tl-nummer {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  font-size: 17px; line-height: 22px; font-weight: 600;
}
/* Vandaag: een ring en de dagnaam in het accent, geen gevuld vlak. */
.tijdlijn > .tl-dag[aria-current="date"] .tl-kort { color: var(--accent); font-weight: 600; }
.tijdlijn > .tl-dag[aria-current="date"] .tl-nummer { box-shadow: inset 0 0 0 1.5px var(--accent); }
.tijdlijn .tl-rust { align-self: center; font-size: 15px; line-height: 20px; color: var(--text-2); }
/* Beschikbaarheid van de dag (Taak 28): bijtekst in de tweede kolom, onder de regels. */
.tijdlijn .tl-beschikbaar {
  grid-column: 2; padding: 0 0 10px; font-size: 15px; line-height: 20px; color: var(--text-2);
}
.tijdlijn .tl-notitie { display: block; color: var(--text-zacht); overflow-wrap: anywhere; }
.tijdlijn .regels { list-style: none; padding: 0; }
.tijdlijn .regels > li, .tijdlijn-los > li { position: relative; max-width: none; }
.tijdlijn .regels > li + li::before, .tijdlijn-los > li + li::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--border);
}
.tijdlijn-los { padding: 0 14px; }
.tijdlijn .regel, .tijdlijn-los .regel {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 0;
  color: var(--text); text-decoration: none;
}
.tijdlijn a.regel, .tijdlijn-los a.regel {
  margin: 0 -8px; padding: 10px 8px; border-radius: 12px;
  transition: transform var(--veer), background-color var(--veer);
}
.tijdlijn a.regel:hover, .tijdlijn-los a.regel:hover { background: var(--card); }
.tijdlijn a.regel:active, .tijdlijn-los a.regel:active { transform: scale(.98); }
.tijdlijn a.regel:focus-visible, .tijdlijn-los a.regel:focus-visible {
  outline-offset: -2px; border-radius: 12px;
}
.tijdlijn .regel-tekst, .tijdlijn-los .regel-tekst {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px;
}
.tijdlijn .regel-naam, .tijdlijn-los .regel-naam { font-size: 17px; line-height: 22px; font-weight: 600; }
.tijdlijn .regel-sub, .tijdlijn-los .regel-sub {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px;
  font-size: 13px; line-height: 18px; color: var(--text-2);
}
/* Een cijfer met zijn eenheid eronder, rechts uitgelijnd in een vaste kolom. */
.tijdlijn .maat, .tijdlijn-los .maat {
  flex: none; width: 40px; display: flex; flex-direction: column; align-items: flex-end;
}
.tijdlijn .maat b, .tijdlijn-los .maat b { font-size: 17px; line-height: 22px; font-weight: 600; }
.tijdlijn .maat small, .tijdlijn-los .maat small { font-size: 13px; line-height: 16px; color: var(--text-2); }
/* Einde tijdlijn */

/* Sessiestatus als klein label met een punt (tijdlijn en het scherm van één training). */
.sessiestatus { display: inline-flex; align-items: center; gap: 6px; color: var(--text-zacht); }
.sessiestatus::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none;
  box-shadow: inset 0 0 0 1.5px var(--text-2);
}
.sessiestatus-gedaan::before { background: var(--accent); box-shadow: none; }
.sessiestatus-ingepland::before { box-shadow: inset 0 0 0 1.5px var(--text-zacht); }
.sessiestatus-overgeslagen { color: var(--text-2); }
.sessiestatus-overgeslagen::before { background: var(--z1); box-shadow: none; }
.sessiestatus-niet_in_te_plannen::before { background: var(--waarschuwing); box-shadow: none; }

.losse-sessies .groepkop { margin-top: 0; }
.toelichting h2, .toelichting h3 { font-size: 17px; line-height: 22px; font-weight: 600; }
/* De terugblik van de coach op de week (Taak 28): gewone alinea's; een regeleinde blijft staan. */
.terugblik h3 { font-size: 17px; line-height: 22px; font-weight: 600; }
.terugblik > * + * { margin-top: 8px; }
.terugblik p { color: var(--text-zacht); white-space: pre-line; overflow-wrap: anywhere; }
.trainingsweek > .terugblik { margin-top: 32px; }
.toelichting > * + * { margin-top: 8px; }
.toelichting .tekst, .toelichting li { color: var(--text-zacht); }
.toelichting .intensiteit { font-size: 15px; line-height: 20px; font-weight: 600; }
.toelichting .beperkingen { padding-left: 20px; }

.coach-knoppen { padding: 20px; border-radius: var(--r-kaart); background: var(--surface); }
.coach-knoppen h3 { font-size: 17px; line-height: 22px; }
.coach-knoppen label { margin-top: 12px; }
.coach-knoppen input[type="text"] { background: var(--card); }

/* --- Eén training ------------------------------------------------------------------------- */

.terugknop { margin-left: -4px; }
.sessiekop .wanneer {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px;
  font-size: 15px; line-height: 20px; color: var(--text-2);
}
.sessiekop h1 { margin-top: 6px; }
.sessiekaart .kerncijfers { margin-top: 0; }
.hoofdkaart .knop + .knop { margin-top: 10px; }
.sessiekaart .opbouw { margin-top: 28px; }

/* De opbouwbalk: elk deel zo breed als zijn minuten, gekleurd naar de hoogste zone. */
.opbouwbalk { display: flex; gap: 3px; height: 14px; }
.opbouwbalk .deel { flex-basis: 0; min-width: 12px; border-radius: 4px; }
.opbouwbalk .deel:first-child { border-top-left-radius: 7px; border-bottom-left-radius: 7px; }
.opbouwbalk .deel:last-child { border-top-right-radius: 7px; border-bottom-right-radius: 7px; }
.zone-1 { background: var(--z1); }
.zone-2 { background: var(--z2); }
.zone-3 { background: var(--z3); }
.zone-4 { background: var(--z4); }
.zone-5 { background: var(--z5); }

.blokken { list-style: none; padding: 0; margin-top: 18px; }
.blokken > li {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; column-gap: 14px;
  max-width: none; padding: 14px 0;
}
.blokken > li + li { border-top: 1px solid var(--card-druk); }
.zonepunt { width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; }
.blok-naam { font-size: 17px; line-height: 22px; font-weight: 600; }
.blok-zone {
  display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 2px;
  font-size: 15px; line-height: 20px; color: var(--text-zacht);
}
.blok-uitleg { margin-top: 4px; font-size: 15px; line-height: 20px; color: var(--text-2); }
/* Op de kaart is bijtekst minstens 15 px (contrast). */
.blokken .maat { display: flex; flex-direction: column; align-items: flex-end; }
.blokken .maat b { font-size: 17px; line-height: 22px; font-weight: 600; }
.blokken .maat small { font-size: 15px; line-height: 20px; color: var(--text-2); }
.richtlijn { margin-top: 4px; font-size: 15px; line-height: 20px; color: var(--text-2); }

/* --- Feedback ----------------------------------------------------------------------------- */

.feedbackformulier > * + * { margin-top: 16px; }
fieldset.veldgroep {
  margin-inline: 0; padding: 0 16px 18px; min-width: 0; border: 0;
  border-radius: var(--r-groep); background: var(--surface);
}
/* `float` haalt de legend uit de rand van de fieldset, zodat hij gewoon bovenin staat. */
/* De ruimte onder de legend komt uit zijn eigen marge: het volgende veld komt eronder (clear). */
.veldgroep legend {
  float: left; width: 100%; margin-bottom: 10px; padding: 16px 0 0;
  font-size: 17px; line-height: 22px; font-weight: 600;
}
.veldgroep legend small { display: block; margin-top: 2px; font-size: 15px; line-height: 20px; }
.veldgroep legend + * { clear: both; }

/* Inspanning: tien keuzerondjes, onder 480 px twee rijen van vijf (elk rondje minstens
   44 × 44 px), vanaf 480 px één rij; het gekozen getal in het accent (geen vlak). */
.rpe {
  display: grid; grid-template-columns: repeat(5, minmax(44px, 1fr)); margin-top: 0;
  border-radius: var(--r-knop); background: var(--card); overflow: hidden;
}
.rpe label:nth-child(n + 6) span { box-shadow: inset 0 1px 0 var(--card-druk); }
.rpe label:nth-child(n + 7) span { box-shadow: inset 1px 1px 0 var(--card-druk); }
@media (min-width: 480px) {
  .rpe { grid-template-columns: repeat(10, minmax(0, 1fr)); }
  .rpe label:nth-child(n + 6) span { box-shadow: inset 1px 0 0 var(--card-druk); }
}
.rpe-wissen { display: flex; justify-content: flex-end; margin: 4px -8px -10px 0; }
.rpe-wissen button { min-height: 44px; padding: 10px 14px; font-size: 15px; font-weight: 500; color: var(--text-2); background: transparent; }
.rpe-wissen button:hover { color: var(--text); background: var(--card); }
.rpe label { position: relative; display: block; margin: 0; font-size: 17px; font-weight: 600; }
.rpe input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer;
}
.rpe span {
  display: grid; place-items: center; min-height: 44px; color: var(--text-zacht);
  transition: background-color var(--veer), color var(--veer);
}
.rpe label + label span { box-shadow: inset 1px 0 0 var(--card-druk); }
.rpe input:checked + span {
  background: var(--card-druk); color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent);
  border-radius: var(--r-knop);
}
.rpe input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }

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

/* Voortgang: de periodekiezer, de samenvatting (hoofdkaart), doel, herstel, de grafiekkaarten en
   regelmaat. Elke selector in dit blok begint met `.vg-` (of `.inhoud > .vg-`), zodat hij geen
   ander scherm raakt. Het accent staat hier nergens: alleen de lopende staaf in de volumegrafiek
   draagt het (`dashboard.js`). De actieve periode is een lichter vlak, geen accentvlak. */
.vg-kiezer {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px;
  padding: 3px; border-radius: var(--r-knop); background: var(--surface);
}
.vg-kiezer a {
  display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 44px;
  padding: 0 2px; border-radius: var(--r-knop); color: var(--text-2); text-decoration: none; text-align: center;
  font-size: 15px; line-height: 20px; font-weight: 600; white-space: nowrap;
  transition: background-color var(--veer), color var(--veer);
}
.vg-kiezer a:hover { color: var(--text); }
.vg-kiezer a[aria-current="true"] { background: var(--card); color: var(--text); }
.vg-kiezer a:focus-visible { outline-offset: -2px; border-radius: var(--r-knop); }
.inhoud > .vg-kiezer + * { margin-top: 20px; }
/* Smal scherm: elk segment zo breed als zijn tekst, de rest gelijk verdeeld (`3 maanden` past). */
@media (max-width: 359px) {
  .vg-kiezer { grid-template-columns: repeat(4, auto); }
  .vg-kiezer a { padding: 0 6px; }
}

/* Cijfers met een label eronder; een tekst in plaats van een cijfer staat kleiner. */
.vg-cijfers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
.vg-cijfers.vg-twee { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vg-cijfer { display: flex; flex-direction: column; min-width: 0; }
.vg-getal { font-size: 24px; line-height: 30px; font-weight: 700; letter-spacing: -0.02em; }
.vg-eenheid { font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--text-2); }
.vg-getal.vg-geen { font-size: 15px; line-height: 20px; padding-top: 6px; font-weight: 500; letter-spacing: 0; color: var(--text-2); }
/* Herstel: elk cijfer zo breed als zijn inhoud, zodat `52 slagen/min` op één regel past; past
   het niet naast elkaar (320 px), dan loopt het door naar een volgende rij. */
.vg-cijfers.vg-herstelcijfers { display: flex; flex-wrap: wrap; justify-content: space-between; }
.vg-herstelcijfers .vg-getal:not(.vg-geen) { white-space: nowrap; }
/* Zo ook de drie cijfers van de samenvatting (`10,6 km` breekt niet af). */
.vg-samenvatting > .vg-cijfers { display: flex; flex-wrap: wrap; justify-content: space-between; }
.vg-samenvatting > .vg-cijfers .vg-getal { white-space: nowrap; }
.vg-label { margin-top: 2px; font-size: 15px; line-height: 20px; color: var(--text-2); }
.vg-bij { font-size: 15px; line-height: 20px; color: var(--text-2); }
/* Kleine links in een zin houden hun regelhoogte; een onzichtbaar vlak van 44 px eromheen is
   het aanraakdoel (zoals `.gs-bron a` op Coach). */
/* Een blok in de regel (`inline-block`): loopt de link over twee regels, dan dekt het vlak ze
   allebei. De link onder `Max. hartslag` is een heel blok (hieronder). */
.vg-bij a, .vg-rij small a { position: relative; display: inline-block; color: var(--text); }
.vg-bij a::after, .vg-rij small a::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%);
}
/* De link onder `Max. hartslag` loopt over twee regels: als blok dekt het vlak beide. */
.vg-rij small a { display: block; }
.vg-chip {
  display: inline-block; padding: 1px 10px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--border);
  font-size: 13px; line-height: 18px; font-weight: 400; color: var(--text-2);
}
.vg-link {
  display: flex; align-items: center; width: fit-content; min-height: 44px;
  font-size: 15px; line-height: 20px; font-weight: 600;
}
.vg-figuur .canvas-wrap { height: 12rem; }

/* De samenvatting: het venster klein, de kilometers groot, het volume eronder. */
.vg-samenvatting .vg-wanneer {
  margin: 0; font-size: 15px; line-height: 20px; font-weight: 400; letter-spacing: 0; color: var(--text-2);
}
.vg-samenvatting > .vg-km { margin-top: 6px; }
.vg-samenvatting > .vg-cijfers { margin-top: 22px; }
.vg-samenvatting > .vg-bij { margin-top: 16px; }
.vg-samenvatting > .vg-bij + .vg-bij { margin-top: 2px; }
.vg-samenvatting > .vg-bij.vg-volumetitel { margin-top: 28px; color: var(--text); font-weight: 600; }
.vg-samenvatting > .vg-volume { margin-top: 10px; }
.vg-volume .canvas-wrap { height: 10rem; }

/* Een kaart op de tweede laag: titel, venster, grafiek en uitleg. */
.vg-kaart { padding: 20px; border-radius: var(--r-kaart); background: var(--surface); }
.vg-kaartkop { display: flex; align-items: center; gap: 10px; }
.vg-kaartkop h2 { font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: 0; }
.vg-kaart > .vg-kaartkop + .vg-bij { margin-top: 2px; }
.vg-kaart > .vg-cijfers { margin-top: 18px; }
.vg-kaart > .vg-figuur { margin-top: 14px; }
.vg-uitleg { font-size: 15px; line-height: 21px; color: var(--text-zacht); }
.vg-kaart > .vg-uitleg { margin-top: 14px; }
.vg-regel { font-size: 17px; line-height: 24px; }
.vg-kaart > .vg-sub { margin-top: 28px; }
.vg-sub > .vg-bij { margin-top: 2px; }
.vg-subtitel { font-size: 15px; line-height: 20px; font-weight: 600; }

/* Je doel: de naam als kop, het aftellen eronder, doeltijd en voorspelling naast elkaar. */
.vg-doel .vg-bovenkop { font-size: 15px; line-height: 20px; font-weight: 400; color: var(--text-2); }
.vg-doel > .vg-doelnaam { margin-top: 4px; font-size: 22px; line-height: 28px; font-weight: 600; }
.vg-doel > .vg-doelnaam + .vg-bij { margin-top: 2px; }
.vg-marge {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 6px;
  font-size: 15px; line-height: 20px; color: var(--text-zacht);
}
/* De link is een aanraakdoel van 44 px; de kaart heeft eronder minder opvulling. */
.vg-doel { padding-bottom: 10px; }
.vg-doel > .vg-link { margin-top: 8px; }

/* Rijen met een waarde rechts (Je zones), een lege regel, regelmaat. */
.vg-rij { display: flex; align-items: center; gap: 14px; }
.vg-leeg { color: var(--text-2); }
.vg-regelmaat { padding: 16px; border-radius: var(--r-groep); background: var(--surface); }
.vg-regelmaat > .vg-bij { margin-top: 12px; }
/* Einde voortgang */

/* --- Eén run ---------------------------------------------------------------------------- */

/* Run: de kop, de hoofdkaart met de kerncijfers, het inzicht van de coach en de kaarten (grafiek,
   splits, zones, drift, loopmechanica). Elke selector in dit blok begint met `.ra-` (of
   `.inhoud > .ra-`), zodat hij geen ander scherm raakt. Het accent staat alleen op de balk van de
   snelste split; de tempolijn in `run.js` is het enige andere accent. */
.ra-kop { padding-top: 4px; }
.ra-wanneer { font-size: 15px; line-height: 20px; color: var(--text-2); }
.ra-kop h1 { margin-top: 4px; }
.inhoud > .ra-kop + * { margin-top: 20px; }

/* Kleinere cijfers met een label eronder (hoofdkaart en loopmechanica). */
.ra-cijfers { display: flex; flex-wrap: wrap; gap: 14px 32px; }
.ra-hoofd > .ra-cijfers { margin-top: 22px; }
.ra-cijfer { display: flex; flex-direction: column; min-width: 0; }
.ra-getal { font-size: 24px; line-height: 30px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.ra-eenheid { font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--text-2); }
.ra-label { margin-top: 2px; font-size: 15px; line-height: 20px; color: var(--text-2); }
.ra-bij { font-size: 15px; line-height: 20px; color: var(--text-2); }

/* Het inzicht van de coach: de kleine orb en één tot drie zinnen. */
.ra-inzicht {
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px;
  padding: 18px 20px; border-radius: var(--r-kaart); background: var(--surface);
}
.ra-inzicht .orb { width: 28px; height: 28px; margin-top: 2px; }
.ra-wie { font-size: 15px; line-height: 20px; font-weight: 400; letter-spacing: 0; color: var(--text-2); }
.ra-inzicht-tekst > p { margin-top: 4px; font-size: 17px; line-height: 24px; }
/* Vanaf 1280 px ademt de orb van het coachpaneel ernaast; één bewegend element per scherm. */
@media (min-width: 1280px) {
  .ra-inzicht .orb { animation: none; }
}

/* Een kaart op de tweede laag. */
.ra-kaart { padding: 20px; border-radius: var(--r-kaart); background: var(--surface); }
.ra-kaart > * + * { margin-top: 14px; }
.ra-kaart > h2 { font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: 0; }
.ra-kaart > .ra-mechanica { margin-top: 18px; }

/* Splits: een tabel; de balk in zijn eigen kolom is decoratie (`aria-hidden`). */
.ra-splits { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 20px; }
.ra-splits thead th {
  padding: 0 0 6px; font-size: 13px; line-height: 18px; font-weight: 400; color: var(--text-2); text-align: left;
}
.ra-splits tbody th, .ra-splits tbody td { padding: 9px 0; border-top: 1px solid var(--border); vertical-align: middle; }
.ra-splits th[scope="row"] { width: 3.5em; text-align: left; font-weight: 600; white-space: nowrap; }
.ra-splits th[scope="row"] small { display: block; font-weight: 400; }
.ra-splits .ra-balk { width: 100%; padding-right: 14px; }
.ra-balk > span {
  display: block; height: 8px; border-radius: 999px; background: var(--text-2); transform-origin: left;
}
.ra-snelste .ra-balk > span { background: var(--accent); }
.ra-splits thead th:nth-last-child(-n + 2), .ra-tempo, .ra-hartslag { text-align: right; white-space: nowrap; }
.ra-tempo { font-weight: 600; }
.ra-splits .ra-hartslag, .ra-splits thead th:last-child { padding-left: 18px; }
.ra-hartslag { color: var(--text-2); }
.ra-kaart > .ra-splits + .ra-bij { margin-top: 12px; }

/* Hartslagzones: één gestapelde balk en per zone een regel. */
.ra-zonebalk { display: flex; gap: 2px; height: 14px; border-radius: 7px; overflow: hidden; }
.ra-zonebalk > span { flex-basis: 0; min-width: 3px; }
.ra-zones { list-style: none; padding: 0; }
.ra-zones > li {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 3.25em; align-items: center; column-gap: 12px;
  max-width: none; padding: 8px 0; font-size: 15px; line-height: 20px;
}
.ra-zones > li + li { border-top: 1px solid var(--border); }
.ra-zonepunt { width: 10px; height: 10px; border-radius: 50%; }
.ra-zonenaam { font-weight: 600; }
.ra-zonetijd, .ra-zonepct { text-align: right; }
.ra-zonepct { color: var(--text-2); }

/* Cardiac drift: het percentage groot, het oordeel ernaast. */
.ra-drift { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.ra-groot { font-size: 40px; line-height: 44px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.ra-oordeel { font-size: 17px; line-height: 22px; font-weight: 600; }
.ra-toelichting { font-size: 17px; line-height: 24px; color: var(--text-zacht); }
.ra-kaart > .ra-drift + * { margin-top: 8px; }

.ra-opmerkingen > * + * { margin-top: 8px; }
.inhoud > .ra-opmerkingen { margin-top: 24px; }
/* Einde run */

/* --- Runs ------------------------------------------------------------------------------- */

/* Runs: een gegroepeerde lijst; links de datum, rechts de afstand, eronder drie kleine cijfers.
   Elke selector begint met `.rl-` (of `.groep > li > a.rl-rij`, `.inhoud > .rl-`). */
.rl-kop { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-top: 4px; }
.rl-kop h1 { min-width: 0; }
.rl-aantal { flex: none; font-size: 15px; line-height: 20px; color: var(--text-2); }
.inhoud > .rl-kop + * { margin-top: 20px; }
.rl-leeg { color: var(--text-2); }
.groep > li > a.rl-rij { flex-direction: column; align-items: stretch; gap: 10px; }
.rl-boven { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rl-datum { min-width: 0; font-size: 17px; line-height: 22px; font-weight: 600; }
.rl-datum small { margin-left: 8px; font-size: 15px; line-height: 20px; }
.rl-km { flex: none; font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.rl-eenheid { font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--text-2); }
.rl-cijfers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rl-cijfer { min-width: 0; }
.rl-cijfer b { display: block; font-size: 17px; line-height: 22px; font-weight: 600; white-space: nowrap; }
.rl-cijfer small { display: block; }
/* Einde runs */

/* --- Records ---------------------------------------------------------------------------- */

/* Records: de lijst met records (afstand links, tijd rechts), cijfers met een label, de balkjes
   per weekdag en de onderbrekingen. Elke selector begint met `.rc-` (of `.groep > li > a.rc-rij`). */
.rc-leeg { color: var(--text-2); }
.groep > li > a.rc-rij { align-items: flex-start; }
.rc-tekst { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rc-afstand { font-size: 17px; line-height: 22px; font-weight: 600; }
.rc-sub {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
  font-size: 15px; line-height: 20px; color: var(--text-2);
}
.rc-chip {
  display: inline-block; padding: 1px 10px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--border);
  font-size: 13px; line-height: 18px; color: var(--text-2);
}
.rc-sneller { display: block; font-size: 15px; line-height: 20px; }
.rc-nog { display: block; font-size: 15px; line-height: 20px; }
.rc-tijd { flex: none; font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }

/* Cijfers met een label eronder. */
.rc-cijfers { display: flex; flex-wrap: wrap; gap: 14px 32px; }
.rc-cijfer { display: flex; flex-direction: column; min-width: 0; }
.rc-getal { font-size: 24px; line-height: 30px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.rc-eenheid { font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--text-2); }
.rc-label { margin-top: 2px; font-size: 15px; line-height: 20px; color: var(--text-2); }
.rc-bij { font-size: 15px; line-height: 20px; color: var(--text-2); }
.rc-cijfer > .rc-bij { color: var(--text-zacht); }
/* Kleine links in een regel: een onzichtbaar vlak van 44 px is het aanraakdoel. */
.rc-bij a { position: relative; display: inline-block; color: var(--text); }
.rc-bij a::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%); }
.rc-uitersten { padding: 18px 16px 4px; }
.rc-uitleg { padding: 0 16px; font-size: 15px; line-height: 20px; color: var(--text-2); }

.rc-kaart { padding: 18px 16px; border-radius: var(--r-groep); background: var(--surface); }
.rc-kaart > * + * { margin-top: 14px; }
.rc-kaart > .rc-dagdelen { margin-top: 20px; }

/* Wanneer je loopt: per weekdag een regel; het balkje is decoratie, de tekst de bron. */
.rc-dagen { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 20px; }
.rc-dagen thead th {
  padding: 0 0 6px; font-size: 13px; line-height: 18px; font-weight: 400; color: var(--text-2); text-align: left;
}
.rc-dagen tbody th, .rc-dagen tbody td { padding: 7px 0; border-top: 1px solid var(--border); vertical-align: middle; }
.rc-dagen th[scope="row"] { width: 7.5em; padding-right: 12px; text-align: left; font-weight: 400; }
.rc-dagen .rc-balk { width: 100%; padding-right: 14px; }
.rc-balk > span {
  display: block; height: 8px; border-radius: 999px; background: var(--text-2); transform-origin: left;
}
.rc-dagen thead th:nth-last-child(-n + 2), .rc-dagen tbody td:not(.rc-balk) { text-align: right; white-space: nowrap; }
.rc-dagen tbody td:last-child, .rc-dagen thead th:last-child { padding-left: 16px; color: var(--text-2); }

.rc-gat .waarde { font-weight: 600; }
section > .groepkop + .rc-bij { padding: 0 16px; }
.groep > li.rc-gat { display: flex; align-items: center; gap: 14px; }
/* Einde records */

/* --- Profiel ---------------------------------------------------------------------------- */

/* Profiel: groepen zoals iOS-instellingen. Op de telefoon staan label en invoer onder elkaar,
   vanaf 600 px het label links en de invoer rechts; uitleg en foutmelding direct onder het
   veld. Elke selector begint met `.pf-`. */
.pf-melding { padding: 14px 16px; border-radius: 16px; background: var(--ok-vlak); }
.pf-melding-fout { background: var(--alarm-vlak); }
.pf-formulier > section > .groepkop + * { margin-top: 0; }
.pf-formulier > section:first-child > .groepkop { margin-top: 4px; }
.pf-veld > label { margin: 0; font-size: 17px; line-height: 22px; font-weight: 400; }
.pf-veld > label small { display: block; margin-top: 2px; }
.pf-veld > input, .pf-veld > select, .pf-veld > textarea { margin-top: 8px; }
.pf-veld > .uitleg { margin-top: 8px; }
.pf-veld > .fouttekst { margin-top: 6px; }
.pf-vinkje > label.vink { min-height: 44px; margin: -8px 0; }
/* De terugknop alleen zonder zijbalk (onder 1024 px); daarboven staat Profiel in de zijbalk. */
@media (min-width: 1024px) {
  .pf-terug { display: none; }
}
@media (min-width: 600px) {
  .pf-veld:not(.pf-lang):not(.pf-vinkje) {
    display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); column-gap: 16px; align-items: center;
  }
  .pf-veld:not(.pf-lang):not(.pf-vinkje) > input,
  .pf-veld:not(.pf-lang):not(.pf-vinkje) > select { grid-column: 2; margin-top: 0; }
  .pf-veld:not(.pf-lang):not(.pf-vinkje) > input[type="text"] { text-align: right; }
  .pf-veld:not(.pf-lang):not(.pf-vinkje) > .fouttekst { grid-column: 2; text-align: right; }
  .pf-veld:not(.pf-lang):not(.pf-vinkje) > .uitleg { grid-column: 1 / -1; }
}
/* Je coach houdt bij (Taak 28): onder het formulier, vóór Gegevens. Een kop en drie
   gegroepeerde lijsten; per regel een kop, de tekst en bijtekst, elk op een eigen regel. */
.pf-coach { margin-top: 40px; }
.pf-kop { font-size: 22px; line-height: 28px; font-weight: 600; }
.pf-coach > section > .groepkop { margin-top: 20px; }
.pf-item { display: flex; flex-direction: column; gap: 2px; }
.pf-item-kop { font-weight: 600; }
.pf-item-tekst { color: var(--text-zacht); overflow-wrap: anywhere; }
.pf-item-bij { font-size: 15px; line-height: 20px; color: var(--text-2); overflow-wrap: anywhere; }
.pf-leeg { padding: 0 16px; font-size: 15px; line-height: 20px; color: var(--text-2); }
.pf-verwijder { margin-top: 8px; }
.pf-verwijder button[type="submit"] { margin-top: 0; min-height: 44px; padding: 10px 14px; font-size: 15px; background: var(--card); }
.pf-verwijder button:hover { background: var(--card-hoog); }
/* Einde profiel */

/* --- Upload ----------------------------------------------------------------------------- */

/* Upload: genummerde stappen, de bestandskiezer, de voortgangsbalk van de import, de laatste
   imports en de verdachte workouts. Elke selector begint met `.up-` (of `.inhoud > .up-`). */
.up-melding { padding: 14px 16px; border-radius: 16px; background: var(--surface); }
.up-melding-fout { background: var(--alarm-vlak); }
.up-stappen { list-style: none; padding: 0; counter-reset: stap; display: grid; gap: 12px; }
.up-stappen > li {
  counter-increment: stap; position: relative; padding-left: 40px; min-height: 28px;
  font-size: 17px; line-height: 24px;
}
.up-stappen > li::before {
  content: counter(stap); position: absolute; left: 0; top: -2px;
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--card); font-size: 15px; line-height: 20px; font-weight: 600;
}
.up-formulier { margin-top: 20px; padding: 16px; border-radius: var(--r-groep); background: var(--surface); }
.up-kiezer {
  display: flex; align-items: center; gap: 14px; margin: 0 0 12px;
  font-size: 17px; line-height: 22px; font-weight: 600;
}
.up-kiezer .icoon { color: var(--text-2); }
.up-kiezer-tekst { display: flex; flex-direction: column; }
.up-kiezer-tekst small { font-size: 15px; line-height: 20px; }
.up-formulier input[type="file"] { min-height: 52px; padding: 13px 12px; }
.up-formulier input[type="file"]::file-selector-button { min-height: 32px; }
.up-formulier button[type="submit"] { margin-top: 14px; }

.up-status { padding: 16px; border-radius: var(--r-groep); background: var(--surface); }
.up-status > * + * { margin-top: 8px; }
.up-mislukt { background: var(--alarm-vlak); }
.up-balk { height: 6px; border-radius: 999px; background: var(--card); overflow: hidden; }
.up-balk > span { display: block; height: 100%; border-radius: 999px; background: var(--text); transform-origin: left; }
/* Bezig: de duur is onbekend, dus geen lengte maar een gestreepte balk (stil: de orb is het enige
   element dat doorlopend beweegt). */
.up-bezig > span {
  width: 100%;
  background: repeating-linear-gradient(-45deg, var(--text-3) 0 6px, var(--card) 6px 12px);
}
.up-bij { font-size: 15px; line-height: 20px; color: var(--text-2); }
.up-bij a { position: relative; display: inline-block; color: var(--text); }
.up-bij a::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%); }
.up-tot { padding: 0 16px; font-size: 15px; line-height: 20px; color: var(--text-2); }
section > .groep + .up-bij { margin-top: 8px; padding: 0 16px; }
/* Een lege lijst (`Nog geen imports.`) staat in lijn met de kop van de groep. */
section > .groepkop + .up-bij { padding: 0 16px; }

.up-boven { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.up-bestand { min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.up-datum { flex: none; font-size: 15px; line-height: 20px; color: var(--text-2); }
.up-aantallen { display: block; margin-top: 4px; font-size: 15px; line-height: 20px; }
.up-reden { margin-top: 6px; font-size: 15px; line-height: 20px; color: var(--text-zacht); }
.up-chip {
  display: inline-block; padding: 1px 10px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--border);
  font-size: 13px; line-height: 18px; color: var(--text-2);
}
.up-knoppen { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.up-knoppen button { padding: 10px 14px; font-size: 15px; background: var(--card); }
.up-knoppen button:hover { background: var(--card-hoog); }
/* Einde upload */

/* Apparaten: de lijst met ingelogde apparaten; elke selector begint met `.ap-`. */
.ap-rij { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ap-tekst { min-width: 0; }
.ap-naam { font-weight: 600; overflow-wrap: anywhere; }
.ap-tekst small { display: block; margin-top: 2px; font-size: 15px; line-height: 20px; }
.ap-chip { margin-left: 6px; }
.ap-rij button { flex: none; padding: 10px 14px; font-size: 15px; background: var(--card); }
.ap-rij button:hover { background: var(--card-hoog); }
.ap-overal { margin-top: 24px; }
.ap-overal button { background: var(--card); }
.ap-overal button:hover { background: var(--card-hoog); }
/* Einde apparaten */

/* --- Logboek ---------------------------------------------------------------------------- */

/* Logboek: een gegroepeerde lijst met per aanroep de soort, de tijd en de gegevens met een eigen
   label; technische tekst kleiner, in het gewone lettertype, en hij breekt binnen de kolom.
   Elke selector begint met `.lb-`. */
.lb-bij { font-size: 15px; line-height: 20px; color: var(--text-2); }
.inhoud > .lb-bij + * { margin-top: 20px; }
.lb-rij > * + * { margin-top: 8px; }
.lb-boven { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.lb-soort { font-weight: 600; }
.lb-tijd { font-size: 15px; line-height: 20px; color: var(--text-2); }
.lb-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 15px; line-height: 20px; }
.lb-meta div { min-width: 0; }
.lb-meta dt { font-size: 13px; line-height: 18px; color: var(--text-2); }
.lb-meta dd { overflow-wrap: anywhere; }
.lb-fout { padding: 10px 12px; border-radius: 12px; background: var(--alarm-vlak); font-size: 15px; line-height: 20px; overflow-wrap: anywhere; }
.lb-rij details > summary { font-size: 15px; }
.lb-tekst {
  margin: 4px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--card); max-width: 100%;
  font-family: var(--font); font-size: 13px; line-height: 18px; color: var(--text-zacht);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
/* Einde logboek */

.canvas-wrap { position: relative; height: 13rem; width: 100%; }
.grafiek-melding { padding: 24px 0; text-align: center; color: var(--text-2); font-size: 15px; }

/* Rij met een tweede regel en een waarde rechts (gegroepeerde lijst) */
.rij-tekst { flex: 1; min-width: 0; }
.rij-tekst small { display: block; margin-top: 2px; }
.groep .waarde { flex: none; font-weight: 600; }
/* Een rij met een icoon vóór de link; de hele rij is het aanraakdoel. */
.rij-link { display: flex; align-items: center; gap: 14px; }
.rij-link > a { flex: 1; text-decoration: none; }
.rij-link > a::after { content: ""; position: absolute; inset: 0; }
.rij-link:hover { background: var(--card); }
.rij-link:has(> a:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
.rij-link:first-child:has(> a:focus-visible) {
  border-top-left-radius: var(--r-groep); border-top-right-radius: var(--r-groep);
}
.rij-link:last-child:has(> a:focus-visible) {
  border-bottom-left-radius: var(--r-groep); border-bottom-right-radius: var(--r-groep);
}
.rij-link > a:focus-visible { outline: none; }

/* --- Beweging --------------------------------------------------------------------------- */

/* Overgang tussen schermen: de fade van 180 ms op `.inhoud` (boven, bij het raamwerk). */

/* Tikbare rijen, segmenten en de bestandskiezer veren kort in bij aanraken (knoppen: zie boven). */
.groep > li > a:only-child, .rij-link, .vg-kiezer a, .up-kiezer {
  transition: transform var(--veer), background-color var(--veer), color var(--veer);
}
.groep > li > a:only-child:active { transform: scale(.98); }
.rij-link:active { transform: scale(.98); }
.vg-kiezer a:active { transform: scale(.98); }
.up-kiezer:active { transform: scale(.98); }

/* Balken groeien: alleen de vulling (de baan staat stil), één keer, in 300 ms van 0 naar hun
   breedte, en alleen bij het eerste laden van de pagina: `.eerste-weergave` op <body> verdwijnt
   na de eerste groei of 600 ms (`beweging.js`), zodat een balk in een htmx-fragment na een
   vervanging niet opnieuw groeit. De opbouw- en zonebalk hebben geen baan; daar groeit de balk
   zelf. */
@keyframes groei { from { transform: scaleX(0); } }
.eerste-weergave progress.voortgang::-webkit-progress-value { animation: groei 300ms ease-out both; transform-origin: left; }
.eerste-weergave progress.voortgang::-moz-progress-bar { animation: groei 300ms ease-out both; transform-origin: left; }
.eerste-weergave .opbouwbalk { animation: groei 300ms ease-out both; transform-origin: left; }
.eerste-weergave .ra-balk > span { animation: groei 300ms ease-out both; transform-origin: left; }
.eerste-weergave .rc-balk > span { animation: groei 300ms ease-out both; transform-origin: left; }
.eerste-weergave .ra-zonebalk { animation: groei 300ms ease-out both; transform-origin: left; }
.eerste-weergave .up-klaar > span { animation: groei 300ms ease-out both; transform-origin: left; }
/* Einde groeien */

/* --- Beweging uit bij voorkeur ---------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
  .orb, .skelet span { animation: none !important; }
  /* De vendor-pseudo's elk in een eigen regel: een onbekende in een lijst verwerpt de hele regel. */
  progress.voortgang::-webkit-progress-value { animation: none !important; }
  progress.voortgang::-moz-progress-bar { animation: none !important; }
  .opbouwbalk, .ra-balk > span, .rc-balk > span, .ra-zonebalk, .up-klaar > span, .inhoud { animation: none !important; }
  button:active, .knop:active, .profielrondje:active, .tabblad:active .icoon,
  a.rondknop:active, .tijdlijn a.regel:active, .tijdlijn-los a.regel:active,
  .groep > li > a:only-child:active, .rij-link:active, .vg-kiezer a:active, .up-kiezer:active {
    transform: none;
  }
}

/* --- Inlogscherm (zelfstandige pagina, zonder menu) ------------------------------------- */
.inlog-pagina { display: grid; place-items: center; padding: var(--marge); }
.inlog { width: 100%; max-width: 380px; }
.inlog h1 { font-size: 28px; line-height: 34px; font-weight: 700; margin-bottom: 8px; }
.inlog-veld input[type="password"] {
  display: block; width: 100%; min-height: 44px; padding: 11px 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-knop);
  font-size: 17px; line-height: 22px;
}
.inlog-veld input[type="password"]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent;
}
.inlog-veld.met-fout input[type="password"] { border-color: var(--alarm); }
