/* Rep Rivals
   Kleuren komen uit de gym: rubbervloer, krijt en de schijfkleuren van halters
   (rood 25, blauw 20, geel 15, groen 10, wit 5). Elke vriend heeft een eigen schijf. */

:root {
  --bg: #1d2024;
  --raise: #272b30;
  --raise-2: #30353b;
  --line: #383d44;
  --text: #ecebe6;
  --muted: #9ba2aa;
  --action: #ecebe6;
  --on-action: #1d2024;
  --done: rgba(236, 235, 230, 0.07);
  --pr: #f2c230;
  --pr-soft: rgba(242, 194, 48, 0.16);
  --danger: #ef5b61;

  --p-red: #d3272f;
  --p-blue: #2563c9;
  --p-yellow: #f2c230;
  --p-green: #2e9f5b;
  --p-white: #f1f0ec;
  --p-black: #0d0e10;
  --p-steel: #9aa3ad;
  --p-bronze: #b07a3e;

  /* Lichaamskaart: één tint rood (de 25-kiloschijf), hoe feller hoe meer sets. */
  --skin: #2b2f35;
  --heat-0: #3b4148;
  --heat-1: #6d3a3f;
  --heat-2: #a9353c;
  --heat-3: #e0444b;

  --cond: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --tabs-h: 64px;
  --active-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #e8eaed;
    --raise: #f7f8f9;
    --raise-2: #dfe2e6;
    --line: #cfd4d9;
    --text: #1d2024;
    --muted: #5b626a;
    --action: #1d2024;
    --on-action: #f4f5f6;
    --done: rgba(29, 32, 36, 0.06);
    --pr: #b58a00;
    --pr-soft: rgba(242, 194, 48, 0.28);
    --danger: #c62b32;
    --skin: #d3d7dc;
    --heat-0: #bcc3ca;
    --heat-1: #eba9ac;
    --heat-2: #db5f65;
    --heat-3: #b8232a;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
main {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 20px) 16px calc(var(--tabs-h) + var(--safe-b) + 32px);
  outline: none;
}
body.has-active main { padding-bottom: calc(var(--tabs-h) + var(--safe-b) + var(--active-h) + 32px); }
body.resting main { padding-bottom: calc(var(--tabs-h) + var(--safe-b) + 112px); }
body.has-active.resting main { padding-bottom: calc(var(--tabs-h) + var(--safe-b) + var(--active-h) + 112px); }
body.no-tabs main { padding-bottom: calc(var(--safe-b) + 40px); }

h1, h2, h3 { font-family: var(--cond); margin: 0; line-height: 1.05; }
h1 { font-size: 36px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 23px; font-weight: 600; margin: 30px 0 10px; }
h3 { font-size: 19px; font-weight: 600; }
p { margin: 0 0 12px; }
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.num { font-family: var(--cond); font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* ---------- kop ---------- */

.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; min-height: 44px; }
.top .sub { color: var(--muted); margin-top: 4px; font-size: 15px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 0 8px; }
.section-head h2 { margin: 0; }
a.plain { color: inherit; text-decoration: none; }
.top .actions { display: flex; gap: 8px; flex-shrink: 0; }
.back svg { width: 18px; height: 18px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-size: 15px; margin-bottom: 10px; padding: 6px 0; }

/* ---------- knoppen en velden ---------- */

button { font: inherit; color: inherit; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border: 0; border-radius: 10px;
  background: var(--action); color: var(--on-action);
  font: 600 16px/1 var(--body);
  text-decoration: none; cursor: pointer;
  touch-action: manipulation;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.quiet { background: var(--raise); color: var(--text); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 8px; }
.link { background: none; border: 0; padding: 8px 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link.danger { color: var(--danger); }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: 10px; background: transparent; color: var(--text); cursor: pointer;
}
.icon-btn:active { background: var(--raise); }
.icon-btn svg, .btn svg { width: 22px; height: 22px; }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
input, select, textarea {
  font: inherit; color: var(--text);
  background: var(--raise); border: 1.5px solid var(--line); border-radius: 10px;
  padding: 11px 12px; width: 100%; min-height: 46px;
}
textarea { min-height: 80px; resize: vertical; }
input[type=range] { padding: 0; border: 0; background: none; min-height: 32px; accent-color: var(--action); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--text); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row { display: flex; align-items: flex-end; gap: 8px; margin: 14px 0 4px; }
.field-row .field { flex: 1; margin: 0; }
.check { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.check input { width: 22px; height: 22px; min-height: 0; accent-color: var(--action); flex-shrink: 0; }
.check .grow { flex: 1; }
.error { color: var(--danger); font-size: 15px; min-height: 22px; margin: 4px 0 10px; }

/* gesegmenteerde keuze en chips */
.seg { display: flex; background: var(--raise); border-radius: 10px; padding: 3px; gap: 2px; margin-bottom: 12px; }
.seg button { flex: 1; min-height: 38px; border: 0; background: transparent; border-radius: 8px; font-weight: 500; font-size: 15px; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--raise-2); color: var(--text); font-weight: 600; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 10px; margin: 0 -16px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1.5px solid var(--line); background: transparent; font-size: 15px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--action); color: var(--on-action); border-color: var(--action); }

/* ---------- schijf (avatar) ---------- */

.disc {
  --c: var(--p-red); --on: #fff;
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--c); color: var(--on);
  font: 700 15px/1 var(--cond); letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.22), inset 0 0 0 7px var(--c), inset 0 0 0 8px rgba(0, 0, 0, 0.14);
}
.disc.s { width: 28px; height: 28px; font-size: 12px; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.22); }
.disc.l { width: 72px; height: 72px; font-size: 26px; box-shadow: inset 0 0 0 5px rgba(0, 0, 0, 0.22), inset 0 0 0 12px var(--c), inset 0 0 0 13px rgba(0, 0, 0, 0.14); }
.disc { position: relative; overflow: hidden; }
.disc.photo { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25); }
.disc.photo img { position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); border-radius: 50%; object-fit: cover; background: var(--raise); }
.disc.s.photo img { inset: 2px; width: calc(100% - 4px); height: calc(100% - 4px); }
.disc.l.photo img { inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); }
.disc-btn { border: 0; padding: 0; background: none; border-radius: 50%; cursor: pointer; display: inline-grid; position: relative; }
.disc-btn::after { content: ''; position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; border-radius: 50%; background: var(--action) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d2024' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 6v12M6 12h12'/%3E%3C/svg%3E") center / 14px no-repeat; box-shadow: 0 0 0 3px var(--bg); }
.photo-row { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.photo-row .grow { flex: 1; }
.photo-row p { margin: 8px 0 0; }
.photo-actions { display: flex; align-items: center; gap: 16px; }
.crop { position: relative; width: min(100%, 320px); aspect-ratio: 1; margin: 0 auto; border-radius: 14px; overflow: hidden; touch-action: none; background: #000; }
.crop canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.crop canvas:active { cursor: grabbing; }
.crop::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.55), inset 0 0 0 2px rgba(255, 255, 255, 0.85); pointer-events: none; }
[data-c="red"] { --c: var(--p-red); }
[data-c="blue"] { --c: var(--p-blue); }
[data-c="yellow"] { --c: var(--p-yellow); --on: #1d2024; }
[data-c="green"] { --c: var(--p-green); }
[data-c="white"] { --c: var(--p-white); --on: #1d2024; }
[data-c="black"] { --c: var(--p-black); }
[data-c="steel"] { --c: var(--p-steel); --on: #1d2024; }
[data-c="bronze"] { --c: var(--p-bronze); }
.disc[data-c="black"] { box-shadow: inset 0 0 0 2px #4a4f57, inset 0 0 0 7px var(--c), inset 0 0 0 8px #3a3f46; }

/* ---------- lijsten ---------- */

.list { border-top: 1px solid var(--line); }
.item { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
button.item { width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; cursor: pointer; }
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 600; }
.item .meta { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .end { text-align: right; flex-shrink: 0; }
.chev { color: var(--muted); width: 18px; height: 18px; flex-shrink: 0; }
.item.go > svg:first-child { width: 24px; height: 24px; color: var(--muted); flex-shrink: 0; }

.empty { padding: 36px 0 12px; }
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 34ch; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-block: 1px solid var(--line); margin: 6px 0 4px; }
.stats.four { grid-template-columns: repeat(2, 1fr); }
.stats > div { background: var(--bg); padding: 12px 0 10px; }
.stats > div:not(:first-child) { padding-left: 14px; }
.stats.four > div:nth-child(odd) { padding-left: 0; }
.stats.four > div:nth-child(even) { padding-left: 14px; }
.stats b { display: block; font: 600 28px/1 var(--cond); font-variant-numeric: tabular-nums; }
.stats span { font-size: 14px; color: var(--muted); }
.stats b small { font: 600 16px/1 var(--cond); color: var(--muted); margin-left: 3px; }

.pr-tag { display: inline-block; font: 700 13px/1 var(--cond); letter-spacing: 0.04em; padding: 3px 6px 2px; border-radius: 4px; background: var(--pr); color: #1d2024; vertical-align: 2px; }
.prs { margin: 10px 0 0; padding: 0; list-style: none; }
.prs li { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; }

/* ---------- tabbalk ---------- */

#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tabs-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--bg); border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  padding-inline: max(0px, calc((100% - 560px) / 2));
}
#tabs[hidden] { display: none; }
#tabs a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 500; }
#tabs a svg { width: 24px; height: 24px; }
#tabs a[aria-current="page"] { color: var(--text); }
#tabs a[aria-current="page"]::before { content: ''; position: absolute; top: -1px; left: 50%; width: 28px; margin-left: -14px; height: 2px; border-radius: 0 0 2px 2px; background: var(--text); }
/* Label en klok even hoog, zodat Trainen met een lopende training niet verspringt. */
#tabs a > span { display: block; height: 16px; line-height: 16px; }
#tabs a .live { font: 600 13px/16px var(--cond); font-variant-numeric: tabular-nums; color: var(--text); }

/* Lopende training, verkleind: smalle balk direct boven het menu. Tik erop en je bent terug. */
#active-bar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabs-h) + var(--safe-b)); z-index: 19;
  height: var(--active-h); background: var(--raise-2); border-top: 1px solid var(--line);
}
#active-bar[hidden] { display: none; }
#active-bar a { position: relative; display: flex; align-items: center; gap: 12px; height: 100%; max-width: 560px; margin: 0 auto; padding: 0 16px; color: var(--text); text-decoration: none; }
#active-bar a:active { background: var(--raise); }
#active-bar .ab-progress { position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: var(--text); transform-origin: left; }
#active-bar .ab-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
#active-bar .ab-text b { font: 600 18px/1.1 var(--cond); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#active-bar .ab-text span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#active-bar .ab-clock { font: 600 19px/1 var(--cond); font-variant-numeric: tabular-nums; }
#active-bar svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--muted); }
body.has-active #rest { bottom: calc(var(--tabs-h) + var(--safe-b) + var(--active-h)); }

/* ---------- rusttimer ---------- */

#rest {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabs-h) + var(--safe-b)); z-index: 21;
  background: var(--raise); border-top: 1px solid var(--line);
  padding: 10px 16px 12px;
}
body.no-tabs #rest { bottom: var(--safe-b); }
#rest[hidden] { display: none; }
#rest .bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin-bottom: 10px; }
#rest .bar i { display: block; height: 100%; background: var(--text); transform-origin: left; }
#rest .row { display: flex; align-items: center; gap: 8px; max-width: 528px; margin: 0 auto; }
#rest .time { flex: 1; font: 700 34px/1 var(--cond); font-variant-numeric: tabular-nums; }
#rest .label { font-size: 13px; color: var(--muted); font-family: var(--body); font-weight: 500; display: block; margin-bottom: 2px; }
#rest.over .time { color: var(--pr); }

/* ---------- toasts ---------- */

#toasts { position: fixed; left: 0; right: 0; top: calc(env(safe-area-inset-top, 0px) + 12px); z-index: 60; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { max-width: 480px; background: var(--action); color: var(--on-action); padding: 12px 16px; border-radius: 10px; font-weight: 500; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28); transition: opacity 0.3s, transform 0.3s; }
.toast.pr { background: var(--p-yellow); color: #1d2024; font-weight: 600; }
.toast.bad { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transform: translateY(-8px); }
.toast:has(.toast-act) { display: flex; align-items: center; gap: 4px; padding-block: 4px; pointer-events: auto; }
.toast-act { min-height: 40px; padding: 0 4px 0 12px; border: 0; background: none; color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- sheets ---------- */

.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); opacity: 0; transition: opacity 0.2s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px;
  max-height: 88vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: 16px 16px 0 0;
  padding: 22px 16px calc(var(--safe-b) + 20px);
  transform: translateY(100%); transition: transform 0.22s ease-out;
}
.sheet.full { height: 92vh; max-height: none; display: flex; flex-direction: column; padding-bottom: 0; }
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet h2 { margin-top: 0; }
.sheet .actions { display: flex; gap: 10px; margin-top: 18px; }
.sheet .actions .btn { flex: 1; }
.menu { list-style: none; margin: 0; padding: 0; }
.menu button { display: flex; width: 100%; align-items: center; gap: 12px; min-height: 52px; padding: 0 4px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; font-size: 17px; cursor: pointer; }
.menu button.danger { color: var(--danger); }
.menu button[aria-pressed="true"] { font-weight: 600; }
.menu button[aria-pressed="true"]::after { content: ''; margin-left: auto; width: 10px; height: 10px; border-radius: 50%; background: var(--text); }

/* ---------- training loggen ---------- */

.wk-head { position: sticky; top: 0; z-index: 5; background: var(--bg); margin: -20px -16px 8px; padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 10px; border-bottom: 1px solid var(--line); }
.wk-head .line { display: flex; align-items: center; gap: 10px; }
.wk-head .wk-min { margin-left: -10px; flex-shrink: 0; color: var(--muted); }
.wk-grab { width: 36px; height: 5px; border-radius: 3px; background: var(--line); margin: -4px auto 6px; }
.wk-enter { animation: wk-up 0.22s ease-out; }
@keyframes wk-up { from { transform: translateY(48px); opacity: 0; } }
.wk-leaving { transform: translateY(70vh) !important; opacity: 0; transition: transform 0.17s ease-in, opacity 0.17s ease-in; }
.wk-head input.name { flex: 1; background: transparent; border: 0; padding: 0; min-height: 40px; font: 700 28px/1 var(--cond); border-radius: 0; }
.wk-head input.name:focus { box-shadow: inset 0 -2px 0 var(--text); }
.wk-head .clock { font: 600 18px/1 var(--cond); font-variant-numeric: tabular-nums; color: var(--muted); }

.ex { padding: 18px 0 10px; border-bottom: 1px solid var(--line); }
.ex.ss { border-left: 3px solid var(--text); padding-left: 12px; margin-left: -15px; }
.ex.ss-cont { border-bottom-style: dashed; }
.ex-head { display: flex; align-items: flex-start; gap: 6px; }
.ex-head .grow { flex: 1; min-width: 0; }
.ex-head h3 { font-size: 22px; }
.ex-head h3 a { text-decoration: none; }
.ex-head .meta { font-size: 14px; color: var(--muted); margin-top: 3px; }
.ex-note { font-size: 14px; color: var(--muted); border-left: 2px solid var(--line); padding: 2px 0 2px 10px; margin: 8px 0 4px; white-space: pre-wrap; }
.ex-advice { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 4px; padding: 9px 12px; border-radius: 10px; background: var(--raise); font-size: 14px; line-height: 1.4; color: var(--muted); }
.ex-advice b { color: var(--text); font-weight: 600; }
.ex-advice svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; color: var(--text); stroke-width: 2.6; }

/* De rand rechts knipt de rode Verwijderen-strook af die meekomt als je een set naar links veegt. */
.sets { margin: 10px -6px 0; padding: 0 6px; overflow-x: clip; }
.set.swiping { position: relative; -webkit-user-select: none; user-select: none; }
.set.swiping::after { content: 'Verwijderen'; position: absolute; top: 0; bottom: 0; left: calc(100% + 6px); width: 100vw; display: flex; align-items: center; padding-left: 16px; border-radius: 10px; background: var(--raise-2); color: var(--muted); font-weight: 600; font-size: 15px; }
.set.swiping.armed::after { background: var(--danger); color: #fff; }
.set.gone { transform: translateX(-110%) !important; opacity: 0; transition: transform 0.16s ease-in, opacity 0.16s ease-in; }
.set {
  display: grid; grid-template-columns: 38px 1fr 76px 64px 48px; gap: 8px; align-items: center;
  padding: 4px 6px; margin: 0 -6px; border-radius: 10px;
}
.set.time { grid-template-columns: 38px 1fr 76px 76px 48px; }
.set.head { font-size: 13px; color: var(--muted); padding-bottom: 0; }
.set.head span:nth-child(n+3) { text-align: center; }
.set.done { background: var(--done); }
.set.is-pr { background: var(--pr-soft); }
.set .no {
  height: 40px; border: 0; background: none; border-radius: 8px; cursor: pointer;
  font: 700 19px/1 var(--cond); color: var(--text);
}
.set .no.warmup { color: var(--muted); }
.set .no.drop, .set .no.failure { color: var(--danger); }
.set .prev { font: 500 16px/1.1 var(--cond); color: var(--muted); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set input {
  text-align: center; padding: 0 4px; min-height: 44px; height: 44px;
  font: 600 22px/1 var(--cond); font-variant-numeric: tabular-nums;
  border-color: transparent; background: var(--raise);
}
.set input::placeholder { color: var(--muted); opacity: 0.75; }
.set.done input { background: transparent; }
.set .tick {
  width: 48px; height: 44px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--raise); color: var(--muted); display: grid; place-items: center;
}
.set .tick svg { width: 24px; height: 24px; }
.set.done .tick { background: var(--action); color: var(--on-action); }
.set.is-pr .tick { background: var(--p-yellow); color: #1d2024; }
.set .stamp { grid-column: 2; font: 700 13px/1 var(--cond); color: var(--pr); letter-spacing: 0.04em; }
.set.flash { animation: flash 0.9s ease-out; }
@keyframes flash {
  0% { background: var(--p-yellow); }
  100% { background: var(--pr-soft); }
}
.add-set { margin: 6px 0 0; }
.wk-foot { margin-top: 22px; display: grid; gap: 12px; }

/* ---------- ranglijst ---------- */

.board { list-style: none; margin: 4px 0 0; padding: 0; border-top: 1px solid var(--line); }
.board li { border-bottom: 1px solid var(--line); }
.board a { display: grid; grid-template-columns: 30px 40px 1fr auto; gap: 4px 12px; align-items: center; padding: 11px 0 12px; text-decoration: none; color: inherit; }
.board .rank { font: 700 26px/1 var(--cond); color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.board li:first-child .rank { color: var(--text); }
.board .who { min-width: 0; }
.board .who .name { font-weight: 600; }
.board .who .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .who .detail { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .val { font: 700 28px/1 var(--cond); font-variant-numeric: tabular-nums; text-align: right; }
.board .val small { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.board .me .name::after { content: 'jij'; margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
/* de laadbalk: hoe ver je van de koploper zit, in jouw schijfkleur */
.board .load { grid-column: 3 / 5; height: 5px; border-radius: 3px; background: var(--raise); overflow: hidden; margin-top: 2px; }
.board .load i { display: block; height: 100%; background: var(--c); border-radius: 3px; }
.board .load i[data-c="black"] { box-shadow: inset 0 0 0 1px #4a4f57; }
.board .load i[data-c="white"] { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25); }
.board li:first-child .val { font-size: 34px; }

.champ { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: 12px; background: var(--raise); margin-bottom: 16px; }
.champ .grow { flex: 1; font-size: 15px; }
.champ b { font-weight: 600; }

details.rules { margin-top: 16px; color: var(--muted); font-size: 15px; }
details.rules summary { cursor: pointer; padding: 8px 0; color: var(--text); font-weight: 500; }
details.rules ul { margin: 4px 0 0; padding-left: 20px; }

.challenge { padding: 16px 0; border-bottom: 1px solid var(--line); display: block; text-decoration: none; color: inherit; }
.challenge .title { font: 600 21px/1.1 var(--cond); }
.challenge .meta { color: var(--muted); font-size: 14px; margin: 3px 0 10px; }
.challenge .mini { display: flex; gap: 16px; flex-wrap: wrap; }
.challenge .mini span { display: inline-flex; align-items: center; gap: 6px; font: 600 18px/1 var(--cond); font-variant-numeric: tabular-nums; }
.status { font: 600 13px/1 var(--body); padding: 4px 8px; border-radius: 6px; background: var(--raise-2); color: var(--muted); margin-left: 6px; vertical-align: 3px; }
.status.active { background: var(--action); color: var(--on-action); }

/* ---------- feed ---------- */

.post { padding: 16px 0 14px; border-bottom: 1px solid var(--line); }
.post-head { display: flex; align-items: center; gap: 12px; }
.post-head .grow { flex: 1; min-width: 0; }
.post-head .grow { display: flex; flex-direction: column; }
.post-head .name { font-weight: 600; line-height: 1.25; }
.post-head .workout { font: 600 19px/1.15 var(--cond); color: var(--muted); }
.post-head .when { font-size: 13px; color: var(--muted); align-self: flex-start; padding-top: 2px; }
.post .facts { display: flex; gap: 22px; margin: 12px 0 2px; }
.post .facts div { font-size: 13px; color: var(--muted); }
.post .facts b { display: block; font: 600 22px/1 var(--cond); color: var(--text); font-variant-numeric: tabular-nums; }
.post .lifts { margin: 10px 0 0; padding: 0; list-style: none; font-size: 15px; }
.post .lifts li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.post .lifts .num { font-size: 17px; color: var(--muted); }
.post-actions { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.respect { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: 19px; border: 1.5px solid var(--line); background: none; font-weight: 600; font-size: 15px; cursor: pointer; }
.respect[aria-pressed="true"] { background: var(--action); color: var(--on-action); border-color: var(--action); }
.respect svg { width: 18px; height: 18px; }
.post-actions .who { font-size: 14px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.respect.pop svg { animation: fist-pop 0.42s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes fist-pop { 40% { transform: scale(1.5) rotate(-14deg); } }

/* Reacties onder een training in de feed: de laatste twee, de rest klapt open. */
.talk { margin-top: 10px; }
.talk-all { background: none; border: 0; padding: 6px 0; color: var(--muted); font-size: 14px; cursor: pointer; }
.talk-c { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; }
.talk-c p { margin: 0; flex: 1; min-width: 0; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; padding-top: 3px; }
.talk-c .name { font-weight: 600; }
.talk-c time { font-size: 13px; color: var(--muted); margin-left: 4px; white-space: nowrap; }
.talk-c.fresh { animation: talk-in 0.35s ease-out; }
@keyframes talk-in { from { opacity: 0; transform: translateY(6px); } }
.quick { display: flex; gap: 8px; overflow-x: auto; margin: 8px -16px 0; padding: 0 16px 2px; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.quick .chip { min-height: 34px; font-size: 14px; padding: 0 13px; }
.quick .chip:active { background: var(--raise); }
.talk-form { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.talk-form input { min-height: 40px; padding: 8px 14px; border-radius: 20px; font-size: 16px; }
.talk-form input:placeholder-shown + button { color: var(--muted); }
.talk-form button svg { width: 20px; height: 20px; }

/* Zelf een bericht plaatsen, en berichten in de feed. */
.compose { display: flex; align-items: flex-end; gap: 8px; padding: 12px 0 14px; border-bottom: 1px solid var(--line); }
.compose .disc { flex: none; margin-bottom: 7px; }
.compose textarea { flex: 1; min-height: 42px; max-height: 168px; padding: 9px 15px; border-radius: 21px; resize: none; font-size: 16px; line-height: 1.4; }
.compose textarea:placeholder-shown + button { color: var(--muted); }
.compose button svg { width: 20px; height: 20px; }
.msg-body { margin: 10px 0 0; font-size: 17px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.post.fresh { animation: talk-in 0.35s ease-out; }
.post-head .when + .icon-btn { align-self: flex-start; margin: -9px -10px 0 -6px; }

/* Ranglijst bovenaan de feed: top drie (of top twee en jij), met de laadbalk in schijfkleur. */
.rank-card { display: block; margin: 0 0 6px; padding: 12px 14px 12px; border-radius: 14px; background: var(--raise); color: inherit; text-decoration: none; }
.rank-card:active { background: var(--raise-2); }
.rc-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 14px; }
.rc-head b { font: 600 22px/1 var(--cond); color: var(--text); margin-right: 8px; }
.rc-top { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 14px; }
.rc-top li { display: grid; gap: 3px; min-width: 0; }
.rc-who { display: flex; align-items: center; gap: 6px; }
.rc-rank { font: 700 24px/1 var(--cond); color: var(--muted); font-variant-numeric: tabular-nums; min-width: 12px; }
.rc-top li:first-child .rc-rank { color: var(--text); }
.rc-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }
.rc-val { font: 700 22px/1 var(--cond); font-variant-numeric: tabular-nums; }
.rc-val small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.rc-load { height: 4px; border-radius: 2px; background: var(--raise-2); overflow: hidden; margin-top: 3px; }
.rc-load i { display: block; height: 100%; background: var(--c); border-radius: 2px; }
.rc-load i[data-c="black"] { box-shadow: inset 0 0 0 1px #4a4f57; }
.rc-load i[data-c="white"] { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25); }
.rc-line { margin: 12px 0 0; font-size: 15px; }
.rc-ch { margin: 8px 0 0; font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-ch .status { margin: 0 8px 0 0; vertical-align: 1px; }

.comment { display: flex; gap: 10px; padding: 10px 0; }
.comment .body { flex: 1; }
.comment .name { font-weight: 600; font-size: 15px; }
.comment-form { display: flex; gap: 8px; margin-top: 8px; }

/* ---------- kalender ---------- */

.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-nav h3 { font-size: 22px; text-transform: none; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal .dow { font-size: 12px; color: var(--muted); padding-bottom: 4px; }
.cal .d { aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; font: 500 17px/1 var(--cond); color: var(--muted); border: 0; background: none; padding: 0; }
.cal .d.has { background: var(--c); color: var(--on, #fff); font-weight: 700; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.2); }
.cal .d.today { box-shadow: inset 0 0 0 1.5px var(--text); color: var(--text); }
.cal .d.has.today { box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.2), 0 0 0 2px var(--bg), 0 0 0 3.5px var(--text); }
.year { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 14px; }
.year h4 { margin: 0 0 6px; font: 600 16px/1 var(--cond); }
.year .mini { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.year .mini i { aspect-ratio: 1; border-radius: 2px; background: var(--raise); }
.year .mini i.has { background: var(--c); }
.year .mini i.pad { background: none; }

/* ---------- grafiek ---------- */

.chart { margin: 8px 0 4px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.chart .axis { fill: var(--muted); font: 500 11px var(--body); }
.chart .fill-top { stop-color: var(--c, var(--text)); stop-opacity: 0.28; }
.chart .fill-bottom { stop-color: var(--c, var(--text)); stop-opacity: 0; }
.chart .lineplot { fill: none; stroke: var(--c, var(--text)); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .trend { stroke: var(--muted); stroke-width: 1.25; stroke-dasharray: 3 5; stroke-linecap: round; opacity: 0.8; }
.chart .guide { stroke: var(--c, var(--text)); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0.6; }
.chart .dot { fill: var(--bg); stroke: var(--c, var(--text)); stroke-width: 1.75; }
.chart .dot.sel { fill: var(--c, var(--text)); stroke: var(--bg); stroke-width: 2; }
.chart .halo { fill: var(--c, var(--text)); opacity: 0.18; }
.chart .hit { fill: transparent; cursor: pointer; }

/* voorbeeld zolang er nog niks gelogd is: zelfde vorm, vaag, met een label */
.demo-tag { display: inline-block; margin: 6px 0 2px; padding: 3px 10px; border-radius: 999px; background: var(--raise); color: var(--muted); font-size: 12px; font-weight: 600; }
.chart svg.is-demo, .demo .board { opacity: 0.5; }
.demo-note { margin-top: 6px; color: var(--muted); font-size: 14px; }
.chart-readout { min-height: 24px; font-size: 15px; }
.seg-stack { display: grid; gap: 8px; margin-top: 12px; }
.seg-stack .seg { margin: 0; }
.chart-readout b { font: 600 20px/1 var(--cond); }

table.records { width: 100%; border-collapse: collapse; font-size: 15px; }
table.records th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line); }
table.records td { padding: 9px 0; border-bottom: 1px solid var(--line); }
table.records td.num { font-size: 19px; }
table.records a { text-decoration: none; font-weight: 500; }
table.records td:last-child, table.records th:last-child { text-align: right; color: var(--muted); }

/* ---------- schema-editor ---------- */

.r-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.r-item.ss { border-left: 3px solid var(--text); padding-left: 12px; margin-left: -15px; }
.r-item .line { display: flex; align-items: center; gap: 6px; }
.r-item .line h3 { flex: 1; font-size: 21px; }
.r-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.r-grid label span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.r-grid input, .r-grid select { min-height: 42px; padding: 6px 8px; text-align: center; font: 600 19px/1 var(--cond); }
.r-grid select { text-align: left; font-size: 17px; }

/* ---------- oefening kiezen ---------- */

.picker-top { flex-shrink: 0; }
.picker-list { flex: 1; overflow-y: auto; margin: 0 -16px; padding: 0 16px; overscroll-behavior: contain; }
.picker-list h4 { margin: 16px 0 4px; font: 600 15px/1 var(--body); color: var(--muted); }
.picker-foot { flex-shrink: 0; padding: 12px 0 calc(var(--safe-b) + 14px); border-top: 1px solid var(--line); background: var(--bg); }

/* ---------- inloggen ---------- */

.auth { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; }
.auth .mark { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.auth .mark h1 { font-size: 44px; }
.auth .intro { color: var(--muted); margin-bottom: 26px; max-width: 34ch; }

.code { font: 700 32px/1 var(--cond); letter-spacing: 0.12em; }
.members { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.palette { display: flex; gap: 10px; flex-wrap: wrap; }
.palette button { border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%; }
.palette button[aria-pressed="true"] .disc { outline: 2.5px solid var(--text); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (min-width: 600px) {
  h1 { font-size: 42px; }
}

/* ---------- lichaamskaart ---------- */

.bm { display: block; width: 100%; max-width: 360px; height: auto; margin: 4px auto 0; -webkit-user-select: none; user-select: none; }
.bm .skin { fill: var(--skin); }
.bm .outline { fill: none; stroke: var(--line); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.bm .m { fill: var(--heat-0); cursor: pointer; transition: fill 0.15s; }
.bm .m[data-l="1"] { fill: var(--heat-1); }
.bm .m[data-l="2"] { fill: var(--heat-2); }
.bm .m[data-l="3"] { fill: var(--heat-3); }
.bm .m.sel { stroke: var(--text); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.bm .bm-label { fill: var(--muted); font: 500 52px var(--body); }
.bm-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin: 6px 0 14px; font-size: 13px; color: var(--muted); }
.bm-legend span:first-child { flex-basis: 100%; text-align: center; }
.bm-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--heat-0); }
.bm-legend i[data-l="1"] { background: var(--heat-1); }
.bm-legend i[data-l="2"] { background: var(--heat-2); }
.bm-legend i[data-l="3"] { background: var(--heat-3); }
.bm-chips .chip .num { margin-left: 4px; font-size: 16px; color: var(--muted); }
.bm-chips .chip[aria-pressed="true"] .num { color: inherit; opacity: 0.7; }
.bm-panel { margin-top: 6px; }
.bm-title { font-size: 26px; margin-bottom: 4px; }
table.bm-ex { margin-top: 18px; }
table.bm-ex td:last-child { white-space: nowrap; padding-left: 10px; }
table.bm-ex td.num small { font: 600 14px var(--cond); color: var(--muted); }
.bm-mode { max-width: 360px; margin: 0 auto 10px; }
.bm-lead { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 12px; width: 100%; margin: 0 0 4px; padding: 10px 14px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.bm-lead span { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.bm-lead strong { font: 600 26px/1 var(--cond); }
.bm-lead em { font: 600 26px/1 var(--cond); font-style: normal; color: var(--pr); font-variant-numeric: tabular-nums; }
.bm-lead-empty { margin: 0 0 4px; font-size: 14px; color: var(--muted); text-align: center; }
.bm-progress { margin: 2px 0 6px; font-size: 15px; color: var(--muted); }
.bm-progress b { color: var(--text); font-weight: 600; }
.bm-more { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 50px; margin-top: 18px; padding: 0; border: 0; border-block: 1px solid var(--line); background: none; color: var(--text); font: 600 17px var(--body); cursor: pointer; }
.bm-more .chev { transition: transform 0.15s; transform: rotate(90deg); }
.bm-more[aria-expanded="true"] .chev { transform: rotate(-90deg); }
.bm-sub { margin: 20px 0 8px; }
.bm-sets { white-space: normal !important; margin-top: 3px; }
.bm-sets b { color: var(--text); font-weight: 500; margin-right: 4px; }
.bm-sets .pr-tag { margin-right: 4px; }
