:root {
  color-scheme: light;
  --page: #f9f9f7; --surface: #fcfcfb; --ink: #0b0b0b; --ink-2: #52514e; --muted: #898781;
  --grid: #e1e0d9; --axis: #c3c2b7; --border: rgba(11,11,11,0.10);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s7: #6250d6;
  --up: #006300; --down: #d03b3b; --strava: #fc5200;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781;
    --grid: #2c2c2a; --axis: #383835; --border: rgba(255,255,255,0.10);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s7: #9085e9;
    --up: #0ca30c; --down: #e66767;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781;
  --grid: #2c2c2a; --axis: #383835; --border: rgba(255,255,255,0.10);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s7: #9085e9;
  --up: #0ca30c; --down: #e66767;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-text-size-adjust: 100%; }
main { max-width: 1240px; margin: 0 auto; padding: max(20px, env(safe-area-inset-top)) 16px 48px; }
a { color: inherit; }
button { font: inherit; }
.laden { color: var(--muted); padding: 60px 0; text-align: center; }

/* kop */
.kop { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.atleet { display: flex; gap: 12px; align-items: center; min-width: 0; }
.atleet img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--grid); }
h1 { font-size: 20px; margin: 0; font-weight: 650; }
.sub { color: var(--muted); font-size: 12.5px; }
.acties { display: flex; gap: 8px; align-items: center; }
.knop { border: 1px solid var(--border); background: var(--surface); color: var(--ink); padding: 7px 12px; border-radius: 8px; cursor: pointer; }
.knop:hover { background: var(--grid); }
.knop:disabled { opacity: .5; cursor: default; }
.knop.klein { padding: 4px 10px; font-size: 12.5px; display: inline-block; }
.linkknop { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }
.knop.primair { background: var(--ink); color: var(--surface); border-color: transparent; }

/* filters */
.filterbalk { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filters { display: inline-flex; flex-wrap: wrap; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.filters button { border: 0; background: none; color: var(--ink-2); padding: 5px 11px; border-radius: 6px; cursor: pointer; }
.filters button:hover { background: var(--grid); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--surface); font-weight: 600; }

/* meer filters */
.meerfilters { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin: -6px 0 12px; }
.meerfilters summary { cursor: pointer; padding: 8px 12px; color: var(--ink-2); font-weight: 600; list-style: none; user-select: none; }
.meerfilters summary::-webkit-details-marker { display: none; }
.meerfilters summary::before { content: "▸ "; color: var(--muted); }
.meerfilters[open] summary::before { content: "▾ "; }
.teller { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 9px; background: var(--ink); color: var(--surface); font-size: 11.5px; text-align: center; }
.extragrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px 18px; padding: 4px 12px 2px; }
.extraveld { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.extraveld.breed { grid-column: 1 / -1; }
.extraveld small { color: var(--muted); }
.vantot { display: flex; align-items: center; gap: 6px; }
.vantot input { width: 0; flex: 1 1 0; }
.extraveld input { font: inherit; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--page); color: var(--ink); min-width: 0; }
.meerfilters > .delta { padding: 6px 12px 10px; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin: -4px 0 14px; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; cursor: pointer; }
.chip:hover { background: var(--grid); }
.chips .linkknop { font-size: 12.5px; color: var(--ink-2); }

/* tegels en kaarten */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile, .card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.tile { padding: 14px 16px; position: relative; }
.greep { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border: 0; border-radius: 6px; background: none;
  color: var(--muted); font-size: 16px; line-height: 1; cursor: grab; touch-action: none; opacity: .35; }
.tile:hover .greep, .card:hover > .greep, .greep:focus-visible { opacity: 1; }
.card > .greep { top: 8px; right: 8px; }
.card > .kaartkop { padding-right: 30px; }
.card > h2 { padding-right: 30px; }
.grid.bezig, .grid.bezig * { cursor: grabbing; user-select: none; }
.card.slepen { opacity: .55; outline: 2px dashed var(--s1); outline-offset: -2px; }
.greep:hover { background: var(--grid); }
@media (hover: none) { .greep { opacity: .6; } }
.tiles.bezig, .tiles.bezig * { cursor: grabbing; user-select: none; }
.tile.slepen { opacity: .55; outline: 2px dashed var(--s1); outline-offset: -2px; }
.tile .lbl { color: var(--ink-2); font-size: 12.5px; }
.tile .val { font-size: 26px; font-weight: 650; margin: 2px 0; letter-spacing: -0.01em; white-space: nowrap; }
.tile .val small { font-size: 14px; font-weight: 500; color: var(--ink-2); margin-left: 3px; }
.delta { font-size: 12px; color: var(--muted); }
.goed { color: var(--up); font-weight: 600; } .slecht { color: var(--down); font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card { padding: 16px; min-width: 0; position: relative; }
.card.breed { grid-column: 1 / -1; }
.card h2 { font-size: 14.5px; margin: 0 0 2px; font-weight: 600; }
.kaartkop { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.kaartkop h2 { margin: 0 !important; }
.card .uitleg { color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
.chart { position: relative; height: 240px; }
.chart.hoog { height: 300px; }
.leeg { color: var(--muted); padding: 40px 0; text-align: center; }

/* tabellen */
.tabelwrap { overflow: auto; max-height: 460px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12px; position: sticky; top: 0; background: var(--surface); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .delta { display: block; font-size: 11px; }
tr.huidig td:first-child { font-weight: 600; }
.stravalink { color: var(--strava); font-weight: 600; text-decoration: none; }
.stravalink:hover { text-decoration: underline; }

/* welkom */
.welkom { max-width: 560px; margin: 8vh auto 0; text-align: center; }
.welkom h1 { font-size: 30px; margin-bottom: 8px; }
.welkom p { color: var(--ink-2); font-size: 15px; }
.welkom .knoppen { display: flex; flex-direction: column; gap: 10px; align-items: center; margin: 28px 0; }
.strava-knop { background: var(--strava); color: #fff; border: 0; border-radius: 6px; padding: 12px 22px; font-weight: 700; font-size: 15px; cursor: pointer; }
.strava-knop:hover { filter: brightness(0.95); }
.strava-officieel { border: 0; background: none; padding: 0; cursor: pointer; line-height: 0; border-radius: 6px; }
.strava-officieel img { display: block; height: 48px; width: auto; }
.strava-officieel:hover { filter: brightness(0.95); }
.acties .strava-officieel img { height: 40px; }
.powered-logo { display: inline-block; height: 15px; width: auto; vertical-align: middle; }
.powered-logo.donker { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .powered-logo.licht { display: none; }
  :root:not([data-theme="light"]) .powered-logo.donker { display: inline-block; }
}
:root[data-theme="dark"] .powered-logo.licht { display: none; }
:root[data-theme="dark"] .powered-logo.donker { display: inline-block; }
.garminrij { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 10px; }
.garminrij .linkknop { font-size: 12.5px; color: var(--muted); cursor: pointer; }
.invoer { font: inherit; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--ink); min-width: 0; flex: 1 1 220px; }
.stappen { margin: 10px 0 0; padding-left: 20px; color: var(--ink-2); font-size: 13px; }
.stappen li { margin: 2px 0; }
.garminstatus { margin: 8px 0 0; font-size: 13px; color: var(--ink-2); }
.garminstatus.fout { color: var(--down); font-weight: 600; }
.garminstatus.goed { color: var(--up); }
#garminFormulier .delta { margin: 8px 0 0; }
.welkom ul { text-align: left; color: var(--ink-2); display: inline-block; margin: 0; padding-left: 20px; }
.melding { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; }
.melding.fout { border-color: var(--down); }
.voortgang { color: var(--ink-2); font-size: 13px; }

footer { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; color: var(--muted); font-size: 12px; }
footer button { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 0; }
.powered { color: var(--strava); font-weight: 700; letter-spacing: .02em; }

@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; }
  .chart { height: 210px; }
  .tile .val { font-size: 22px; }
}
