/*
VOICE   Kleedkamer tussen vrienden: direct, droog.
IDEA    Halterschijven: ieder heeft zijn eigen schijfkleur.
PICTURE Een schijf op het beginscherm die je weekdoel als segmenten vult.
COLOUR  Lichtgrijs vlak, witte kaarten, donkergrijze tekst, lichte tint per persoon.
TYPE    Barlow Condensed (cijfers) + Barlow voor tekst.
*/
:root {
  --floor: #f4f4f2;     /* achtergrond */
  --panel: #ffffff;     /* vlakken en invoervelden */
  --panel-2: #e8e9e6;   /* lege segmenten, skeletons */
  --line: #dcddda;
  --field: #878b90;     /* randen van velden en knoppen, 3:1 */
  --slot: #cfd1cd;      /* lege weekdoel-vakjes */
  --chip: #e3e4e0;      /* gevulde knoppen en keuzes, geen randen */
  --chalk: #26282b;     /* hoofdtekst en primaire knoppen */
  --muted: #565a60;     /* secundaire tekst, contrast > 6:1 */
  --dim: #686c72;       /* kleine tekst, contrast > 4.5:1 */
  --red: #d2463c;
  --blue: #2f6fc0;
  --yellow: #e3a51c;
  --ok: #2e7d4a;
  --r: 2px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
/* Avond: donkergrijs met gebroken wit */
:root[data-theme="dark"] {
  --floor: #1f2124;
  --panel: #2a2d31;
  --panel-2: #3b3f44;
  --line: #3d4146;
  --field: #757a81;
  --slot: #4a4f55;
  --chip: #363a3f;
  --chalk: #eeece8;
  --muted: #b9bdc2;
  --dim: #a4a9af;
  --ok: #82d39b;
  color-scheme: dark;
}
* { box-sizing: border-box; min-width: 0; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--floor); color: var(--chalk); }
body {
  font: 16px/1.5 "Barlow", system-ui, sans-serif;
  overflow-x: clip;
  min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.num, h1, h2, .big { font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-weight: 700; }
h1 { font-size: 34px; line-height: 1.05; margin: 0; letter-spacing: .2px; }
h2 { font-size: 22px; line-height: 1.1; margin: 0 0 12px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- Schermindeling ---------- */
.screen { padding: calc(var(--safe-t) + 20px) 18px calc(var(--safe-b) + 96px); max-width: 560px; margin: 0 auto; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.top .sub { color: var(--muted); font-size: 15px; }
section.block { border-top: 1px solid var(--line); padding: 20px 0 8px; }

/* ---------- Tabbalk ---------- */
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--panel); border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
nav.tabs button {
  background: none; border: 0; padding: 10px 4px 12px; min-height: 58px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--dim); font-size: 13px; font-weight: 600; position: relative;
}
nav.tabs button svg { width: 22px; height: 22px; }
nav.tabs button[aria-current="page"] { color: var(--chalk); }
nav.tabs button[aria-current="page"]::before {
  content: ""; position: absolute; top: -1px; left: 30%; right: 30%; height: 3px; background: var(--chalk);
}

/* ---------- De schijf ---------- */
.plate-wrap { display: grid; place-items: center; margin: 4px 0 6px; }
.plate { width: min(72vw, 280px); aspect-ratio: 1; border: 0; padding: 0; background: none; border-radius: 50%; position: relative; }
.plate svg { width: 100%; height: 100%; display: block; }
.plate .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.plate .center .big { font-size: 64px; line-height: .9; }
.plate .center .lbl { font-size: 14px; color: var(--muted); margin-top: 4px; }
.plate:active svg { transform: scale(.97); transition: transform .12s; }
.status { text-align: center; color: var(--muted); margin: 6px 0 16px; min-height: 24px; }
.status b { color: var(--chalk); }

/* ---------- Knoppen ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: var(--r);
  border: 1px solid var(--field); background: var(--panel); font-weight: 600;
}
.btn.primary { background: var(--chalk); color: var(--floor); border-color: var(--chalk); font-size: 18px; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: #e0b4ad; color: #a3342a; background: transparent; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; }
.link { background: none; border: 0; padding: 8px 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; min-height: 44px; }

/* ---------- Stat-raster (2 x 2) ---------- */
.stats { background: var(--panel); display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 18px; }
.stats > div { padding: 12px 14px; }
.stats > div:nth-child(odd) { border-right: 1px solid var(--line); }
.stats > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
.stats .big { font-size: 34px; line-height: 1; display: block; }
.stats .lbl { color: var(--muted); font-size: 14px; }

/* ---------- Groepsrijen ---------- */
.member { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; padding: 10px 0; }
.dot { object-fit: cover; background: var(--a); color: var(--b); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 17px; box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .06); }
.segs { display: flex; gap: 4px; margin-top: 4px; }
.segs i { flex: 1; height: 8px; background: var(--slot); }
.segs i.on { background: var(--c, var(--chalk)); }
.segs i.extra { background: var(--c, var(--chalk)); opacity: .55; }

/* ---------- Live en aanvullen ---------- */
.live { font-size: 13px; font-weight: 600; color: var(--ok); margin-left: 4px; }
.todo { margin-bottom: 18px; }
.todo .list-row { padding: 6px 0; }
details.more { margin-bottom: 18px; }
details.more summary { color: var(--muted); min-height: 44px; display: flex; align-items: center; cursor: pointer; }

/* ---------- Meldingsbalk ---------- */
.nudge { background: #fdf6e3; border: 1px solid #e8c768; padding: 12px 14px; border-radius: var(--r); margin-bottom: 18px; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.nudge p { margin: 0; }

/* ---------- Feed ---------- */
.item { border-top: 1px solid var(--line); padding: 16px 0 12px; }
.item-head { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: start; }
.item-head .who b { font-weight: 600; }
.item-head time { color: var(--dim); font-size: 13px; white-space: nowrap; }
.item .meta { color: var(--muted); font-size: 15px; }
.item .note { margin: 8px 0 0 46px; }
.lifts { margin: 10px 0 0 46px; display: grid; gap: 4px; }
.lifts div { display: flex; gap: 8px; align-items: baseline; }
.lifts .kg { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 20px; }
.pr { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 13px; letter-spacing: .3px; background: #fbefcc; color: #5e4504; padding: 1px 6px; border-radius: var(--r); }
.shame-tag { color: #a3342a; }
.reacts { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0 46px; }
.chip { min-height: 36px; padding: 0 10px; border: 1px solid var(--field); border-radius: var(--r); background: var(--panel); font-size: 14px; font-weight: 600; color: var(--muted); }
.chip .n { margin-left: 6px; color: var(--chalk); }
.chip.mine { background: var(--chalk); color: var(--floor); border-color: var(--chalk); }
.chip.mine .n { color: var(--floor); }
.actions { display: flex; gap: 16px; margin: 2px 0 0 46px; }
.actions .link { font-size: 14px; }
.comments { margin: 6px 0 0 46px; display: grid; gap: 6px; font-size: 15px; }
.comments b { font-weight: 600; margin-right: 6px; }
.comment-form { display: flex; gap: 8px; margin: 10px 0 0 46px; }
.comment-form input { flex: 1; }

/* ---------- Formulieren ---------- */
label.f { display: block; margin-bottom: 14px; }
label.f > span { display: block; color: var(--muted); font-size: 14px; margin-bottom: 6px; }
input[type=text], input[type=number], input[type=date], input[type=time], input[type=password], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; font-size: 16px;
  background: var(--panel); border: 1px solid var(--field); border-radius: var(--r);
}
::placeholder { color: var(--dim); opacity: 1; }
textarea { min-height: 72px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 8px; align-items: end; margin-bottom: 8px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices button { min-height: 44px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--field); background: var(--panel); font-weight: 600; }
.choices button[aria-pressed="true"] { background: var(--chalk); color: var(--floor); border-color: var(--chalk); }
.stepper { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; border: 1px solid var(--field); border-radius: var(--r); }
.stepper button { height: 56px; border: 0; background: var(--floor); font-size: 26px; }
.stepper output { text-align: center; font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 32px; }
.stepper output small { font-size: 16px; color: var(--muted); margin-left: 4px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; border-bottom: 1px solid var(--line); }
.toggle input { width: 24px; height: 24px; accent-color: var(--chalk); }

/* ---------- Ranglijst ---------- */
.seg { background: var(--panel); display: inline-grid; grid-auto-flow: column; border: 1px solid var(--field); border-radius: var(--r); margin-bottom: 14px; }
.seg button { min-height: 40px; padding: 0 16px; border: 0; background: transparent; color: var(--muted); font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--chalk); color: var(--floor); }
.rank { display: grid; grid-template-columns: 28px 34px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rank .pos { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 22px; color: var(--muted); }
.rank:first-child .pos { color: var(--chalk); }
.rank .val { text-align: right; }
.rank .val .big { font-size: 26px; line-height: 1; }
table.prs { width: 100%; border-collapse: collapse; font-size: 15px; }
table.prs th, table.prs td { padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: right; }
table.prs th:first-child, table.prs td:first-child { text-align: left; padding-left: 0; }
table.prs th { color: var(--muted); font-weight: 600; font-size: 14px; }
table.prs td .num { font-size: 20px; }
.pot { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 0; }
.pot .big { font-size: 40px; }

/* ---------- Gewicht-grafiek ---------- */
.spark { width: 100%; height: 110px; display: block; margin: 6px 0 10px; }
.list-row { display: flex; justify-content: space-between; align-items: center; min-height: 48px; border-bottom: 1px solid var(--line); gap: 10px; }
.x { background: none; border: 0; color: var(--dim); min-width: 44px; min-height: 44px; font-size: 22px; }

/* ---------- Bottom sheet ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(30, 32, 34, .35); z-index: 40; opacity: 0; transition: opacity .2s; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--panel); border-top: 4px solid var(--c, var(--chalk));
  padding: 10px 18px calc(var(--safe-b) + 20px);
  transform: translateY(100%); transition: transform .26s cubic-bezier(.2, .8, .2, 1);
  max-width: 560px; margin: 0 auto;
}
.sheet .grab { width: 40px; height: 4px; background: var(--line); margin: 0 auto 14px; }
.sheet h2 { font-size: 28px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.open .backdrop { opacity: 1; }
.open .sheet { transform: none; }
.sheet section { margin-bottom: 18px; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 12px); z-index: 60;
  transform: translate(-50%, calc(-100% - 40px)); transition: transform .25s; width: max-content;
  background: var(--chalk); color: var(--floor); font-weight: 600;
  padding: 12px 18px; border-radius: var(--r); max-width: calc(100vw - 32px);
}
#toast.show { transform: translate(-50%, 0); }
#toast.err { background: #fbe3e0; color: #8a2018; border: 1px solid #efb9b2; }

/* ---------- Skeleton loaders ---------- */
.sk { background: var(--panel-2); border-radius: var(--r); position: relative; overflow: hidden; }
.sk::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent);
  animation: sk 1.3s infinite;
}
.sk.circle { border-radius: 50%; }
@keyframes sk { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: calc(var(--safe-t) + 24px) 22px calc(var(--safe-b) + 24px); max-width: 440px; margin: 0 auto; }
.login h1 { font-size: 56px; }
.who-list { display: grid; gap: 10px; margin: 24px 0; }
.who-list button { color: var(--chalk); display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: center; text-align: left; min-height: 64px; padding: 10px 14px; border: 1px solid var(--field); border-radius: var(--r); background: var(--panel); font-size: 20px; font-weight: 600; }
.who-list .dot { width: 44px; height: 44px; }
.legal { margin-top: 28px; font-size: 13px; color: var(--dim); }
.legal button { color: var(--muted); }

.prose h3 { font-size: 17px; margin: 16px 0 4px; }
.prose p, .prose li { color: var(--muted); font-size: 15px; }
.prose ul { padding-left: 18px; margin: 0 0 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::after { transition: none !important; animation: none !important; }
}
@media (min-width: 700px) {
  .sheet { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

/* ---------- Schijf en avatar per thema ---------- */
.p-bg { fill: var(--pl); stroke: var(--line); }
.p-in { fill: var(--panel); stroke: var(--line); }
[data-theme="dark"] .p-bg { fill: var(--pn); }
[data-theme="dark"] .dot { background: var(--n); color: var(--a); }
[data-theme="dark"] .nudge { background: #3a3422; border-color: #8a6d1f; }
[data-theme="dark"] .shame-tag, [data-theme="dark"] .btn.danger { color: #f2aaa0; border-color: #7a443d; }
[data-theme="dark"] .backdrop { background: rgba(0, 0, 0, .55); }

/* ---------- Atletische stijl: vet, smal, strak ---------- */
h1, h2, .sheet h2 { font-weight: 800; text-transform: uppercase; letter-spacing: .4px; }
h1 { font-size: 38px; }
h2 { font-size: 21px; }
.login h1 { font-size: 64px; }
.num, .big { font-weight: 800; }
.btn.primary {
  font-family: "Barlow Condensed", sans-serif; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; font-size: 20px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
}
section.block { border-top-width: 2px; border-top-color: var(--chalk); }
:root, .btn, .chip, input, select, textarea, .stats, .seg, .nudge, #toast { --r: 0; }
nav.tabs button { text-transform: uppercase; letter-spacing: .5px; font-size: 12px; font-weight: 700; }

/* ---------- Onboarding ---------- */
.ob { padding-bottom: calc(var(--safe-b) + 40px); }
.ob-bar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 4px 0 26px; }
.ob-bar i { height: 4px; background: var(--slot); }
.ob-bar i.on { background: var(--chalk); }
.ob .f { display: block; margin-bottom: 18px; }
.lbl-s { display: block; color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.ob-nav { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; margin-top: 26px; }
.ob-do { margin-top: 18px; border-top: 2px solid var(--chalk); padding-top: 12px; }
.ob-do p { font-size: 15px; margin-bottom: 8px; }
.ob-sum p { margin-bottom: 12px; }
.why { border: 1px solid var(--line); background: var(--panel); padding: 12px 14px; margin: -8px 0 18px; }
.why p { margin: 0; }
.why p + p { margin-top: 6px; }

/* ---------- Trainingsplan per dag ---------- */
.plan-ed { display: grid; gap: 6px; margin-bottom: 8px; }
.plan-row { display: grid; grid-template-columns: 88px 1fr; gap: 10px; align-items: center; min-height: 48px; }
.plan-row button { min-height: 44px; border: 1px solid var(--field); background: var(--panel); font-weight: 600; border-radius: var(--r); }
.plan-row button[aria-pressed="true"] { background: var(--chalk); color: var(--floor); border-color: var(--chalk); }
.plan-row select { min-height: 44px; }

/* ---------- Uitklapblokken ---------- */
.acc { border-top: 2px solid var(--chalk); }
.acc:last-of-type { border-bottom: 1px solid var(--line); }
.acc summary, .acc-link {
  list-style: none; display: grid; grid-template-columns: 26px 1fr auto 20px; align-items: center; gap: 12px;
  min-height: 60px; padding: 8px 0; cursor: pointer;
}
.acc summary::-webkit-details-marker { display: none; }
.acc-t { font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: 19px; text-transform: uppercase; letter-spacing: .4px; line-height: 1.1; }
.acc-m { color: var(--muted); font-size: 14px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 38vw; }
.ic { width: 24px; height: 24px; }
.acc summary > .ic:last-child { width: 20px; height: 20px; color: var(--muted); transition: transform .18s; }
.acc[open] summary > .ic:last-child { transform: rotate(180deg); }
.acc-body { padding: 4px 0 20px; }
.acc + section.block, .acc + .acc { margin-top: 0; }
.acc-link { width: 100%; background: none; border: 0; border-top: 2px solid var(--chalk); border-bottom: 1px solid var(--line); text-align: left; grid-template-columns: 26px 1fr; margin-top: 12px; }

/* ---------- Stijl zonder dunne grijze randen: vlakken, dikke lijnen, onderstreepte velden ---------- */
.btn { border: 2px solid var(--chalk); background: transparent; }
.btn.primary { border: 0; }
.btn.danger { border: 2px solid currentColor; }
input[type=text], input[type=number], input[type=date], input[type=time], input[type=password], select, textarea {
  border: 0; border-bottom: 2px solid var(--chalk); background: var(--chip);
}
.chip, .choices button, .seg button, .plan-row button { border: 0; background: var(--chip); }
.seg { border: 0; gap: 4px; background: transparent; }
.stepper { border: 0; border-bottom: 2px solid var(--chalk); background: var(--chip); }
.stepper button { background: transparent; }
.who-list button { border: 0; background: var(--panel); border-left: 0; }
.stats { border: 0; gap: 6px; background: transparent; }
.stats > div { background: var(--panel); border: 0 !important; }
.why { border: 0; background: var(--chalk); color: var(--floor); }
.why .lbl-s, .why .muted { color: var(--floor); opacity: .78; }
.nudge { border: 0; background: #f1d27a; color: #26282b; }
.nudge .btn { border-color: #26282b; color: #26282b; }
.item { border-top: 0; background: var(--panel); padding: 16px 14px 12px; margin: 0 -4px 8px; }
.rank, .list-row { border-bottom: 0; }
.rank + .rank, .list-row + .list-row { border-top: 0; }
table.prs th { border-bottom: 2px solid var(--chalk); }
table.prs td { border-bottom: 0; }
table.prs tbody tr:nth-child(odd) td { background: var(--chip); }
.acc:last-of-type { border-bottom: 0; }
.acc-link { border-bottom: 0; }
.todo .list-row { background: var(--panel); padding: 8px 12px; margin-bottom: 6px; }
.p-bg, .p-in { stroke: none; }

/* ---------- Logo ---------- */
.logo { display: block; width: auto; max-width: 100%; color: var(--chalk); }
.brandbar { margin: 0 0 18px; }
