/* Fit — tijdrit. Asfalt, wit als stem, limoen = voor liggen, rood = achter, paars = persoonlijk record. */
:root {
  --asfalt: #0f1114; --paneel: #1d2128; --paneel2: #262b34; --lijn: #2c323c; --zacht: #8b94a3;
  --wit: #f3f5f7; --lime: #c6f432; --rood: #ff4d4d; --paars: #b16cff;
  --snel: cubic-bezier(.16, 1, .3, 1); --veer: cubic-bezier(.34, 1.3, .64, 1);
  --f112: 112px; --f56: 56px; --f32: 32px; --f20: 20px; --f17: 17px; --f14: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--asfalt); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--asfalt); color: var(--wit); caret-color: var(--lime);
       font: 600 var(--f17)/1.4 -apple-system, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
       font-variant-numeric: tabular-nums; -webkit-tap-highlight-color: transparent;
       padding: max(12px, env(safe-area-inset-top)) 0 calc(84px + env(safe-area-inset-bottom)); }
body.sessie { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
::selection { background: var(--lime); color: var(--asfalt); }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
main { max-width: 560px; margin: 0 auto; }

/* ---------- navigatie onderaan; weg tijdens een sessie ---------- */
header { position: fixed; inset: auto 0 0; z-index: 4; display: flex; background: rgba(15, 17, 20, .92);
         -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
         border-top: 1px solid var(--lijn); padding: 0 8px env(safe-area-inset-bottom); }
body.sessie header { display: none; }
.tab { flex: 1; min-height: 64px; background: none; border: 0; color: var(--zacht); font: inherit;
       font-size: var(--f14); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; position: relative;
       transition: color .3s var(--snel); }
.tab.actief { color: var(--wit); }
.tab::before { content: ""; position: absolute; left: 30%; right: 30%; top: 0; height: 3px; border-radius: 0 0 3px 3px;
               background: var(--lime); transform: scaleX(0); transition: transform .45s var(--veer); }
.tab.actief::before { transform: scaleX(1); }

/* ---------- type: cursief en zwaar voor alles wat telt ---------- */
h1 { font-size: var(--f32); line-height: 1.05; font-weight: 800; font-style: italic; letter-spacing: -.02em; margin: 0 0 10px; text-wrap: balance; }
h2 { font-size: var(--f20); line-height: 1.2; font-weight: 800; font-style: italic; margin: 0 0 10px; }
p { margin: 6px 0; }
.zacht { color: var(--zacht); }
.klein { font-size: var(--f14); }
.cijfer { font-size: var(--f32); font-weight: 800; font-style: italic; line-height: 1.1; margin: 4px 0; }
.fout { color: var(--rood); }
.goed { color: var(--lime); }
.let-op { color: var(--lime); }
.blok { padding: 20px; }

/* ---------- het bord: het actieve paneel ---------- */
.bord { position: relative; background: linear-gradient(180deg, var(--paneel) 0%, var(--asfalt) 100%); padding: 14px 20px 16px; margin: 0 0 2px; }
body.sessie .bord h1 { font-size: 28px; margin-bottom: 6px; }
.bord.nood { background: linear-gradient(180deg, rgba(255, 77, 77, .14) 0%, var(--asfalt) 100%); }
.bord.nieuw { animation: inrijden .5s var(--snel) both; }
@keyframes inrijden { from { transform: translateX(14%); opacity: 0; filter: blur(6px); } to { transform: none; opacity: 1; filter: none; } }
.nood-tag { display: inline-block; background: var(--rood); color: #fff; font-size: var(--f14); font-weight: 800; font-style: italic;
            padding: 4px 10px; border-radius: 6px; margin: 0 0 12px; }

/* feitenrij */
.feiten { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0 0 14px; padding: 0; }
.feiten div { display: flex; flex-direction: column; }
.feiten dt { font-size: var(--f14); color: var(--zacht); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.feiten dd { margin: 0; font-size: var(--f20); font-weight: 800; font-style: italic; }
.feiten .geel { color: var(--lime); }

/* rijen */
.rij { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: baseline;
       padding: 14px 20px; border-bottom: 1px solid var(--lijn); color: var(--zacht); }
.rij .rechts { color: var(--wit); font-weight: 700; }
.rij .groot { font-size: var(--f32); font-weight: 800; font-style: italic; color: var(--wit); line-height: 1; }

/* sectorbalk: opwarmsets smal, werksets breed */
.stappen { display: flex; gap: 4px; padding: 0 20px; margin: 14px 0; }
.stappen i { flex: 1; height: 8px; border-radius: 3px; background: var(--lijn); transform: skewX(-18deg); transition: background-color .4s var(--snel); }
.stappen i.af { background: var(--lime); }
.stappen i.nu { background: var(--wit); animation: sector 1.4s ease-in-out infinite; }
.stappen i.opw { flex: .55; }
@keyframes sector { 50% { opacity: .55; } }

/* ---------- steppers: kg in reuzencijfers ---------- */
.stepper { display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; align-items: center; gap: 8px; margin: 4px 0; }
.stepper button { -webkit-touch-callout: none; width: 56px; height: 58px; border: 0; background: var(--paneel2); color: var(--wit);
                  display: grid; place-items: center; border-radius: 16px; touch-action: manipulation; user-select: none; -webkit-user-select: none;
                  transition: transform .18s var(--veer), background-color .2s; }
.stepper button:active { transform: scale(.9); background: var(--lijn); }
.stepper button svg { width: 26px; height: 26px; }
.stepper .waarde { text-align: center; line-height: .9; font-weight: 800; font-style: italic; white-space: nowrap; overflow: hidden; padding: 4px 0; }
.stepper .waarde span:first-child { display: inline-block; font-size: var(--f56); letter-spacing: -.03em; }
.stepper.hoofd .waarde span:first-child { font-size: 96px; letter-spacing: -.05em; }
.stepper.hoofd.lang .waarde span:first-child { font-size: min(84px, 21vw); } /* gewicht met komma: tweede maat */
.stepper .waarde .x { font-size: var(--f56); letter-spacing: -.02em; }
.stepper .eenheid { font-size: var(--f20); color: var(--zacht); margin-left: 6px; font-weight: 700; }
.stepper .grens { animation: grens .35s var(--veer); }
@keyframes grens { 30% { transform: translateX(-6px); } 60% { transform: translateX(5px); } }
.doel { font-size: var(--f17); line-height: 1.3; margin: -2px 0 8px; color: var(--zacht); }
.doel strong { color: var(--lime); }

/* ---------- ghost: de signatuur ---------- */
.ghost { margin: 4px 0 6px; background: var(--asfalt); border: 1px solid var(--lijn); border-radius: 14px; padding: 8px 12px 10px; }
.ghost .boven { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; }
.ghost small { font-size: var(--f14); color: var(--zacht); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.ghost .wie { font-size: var(--f20); font-weight: 800; font-style: italic; }
.ghost .delta { grid-row: 1 / span 2; grid-column: 2; font-size: 26px; font-weight: 800; font-style: italic; color: var(--zacht); }
.ghost .delta.voor { color: var(--lime); } .ghost .delta.achter { color: var(--rood); } .ghost .delta.record { color: var(--paars); }
.ghost .baan { position: relative; height: 6px; margin-top: 8px; border-radius: 3px; background: var(--lijn); }
.ghost .jij { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--wit); transform-origin: left; transition: transform .45s var(--veer), background-color .3s; }
.ghost .jij.voor { background: var(--lime); } .ghost .jij.achter { background: var(--rood); }
.ghost .spook { position: absolute; left: 0; top: -6px; width: 3px; height: 18px; border-radius: 2px; background: var(--zacht); transition: transform .45s var(--snel); }

/* ---------- knoppen ---------- */
button.knop, a.knop, label.knop { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 74px;
       font: inherit; font-size: var(--f20); font-weight: 800; font-style: italic; letter-spacing: .02em; padding: 12px 16px; margin: 10px 0 0;
       border-radius: 18px; border: 0; background: var(--wit); color: var(--asfalt); text-decoration: none; cursor: pointer;
       touch-action: manipulation; transition: transform .22s var(--veer), background-color .25s var(--snel), box-shadow .25s; }
button.knop:active, label.knop:active, a.knop:active { transform: scale(.96); }
button.knop.tweede, a.knop.tweede { min-height: 56px; background: var(--paneel); color: var(--wit); font-size: var(--f17); font-style: normal; font-weight: 700; }
button.knop:disabled { background: var(--paneel2); color: var(--zacht); cursor: default; transform: none; }
.knoppen { padding: 6px 20px 0; }
.knoppen .knop.tweede + .knop.tweede { margin-top: 8px; }
body.vastknop { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
body.vastknop::after { content: ""; position: fixed; inset: auto 0 0; z-index: 2; height: calc(104px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(15, 17, 20, 0) 0%, var(--asfalt) 38%); pointer-events: none; }
.knop.vast { position: fixed; z-index: 3; left: max(20px, calc(50% - 260px)); right: max(20px, calc(50% - 260px)); width: auto;
  bottom: calc(16px + env(safe-area-inset-bottom)); margin: 0; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
.knop svg { width: 22px; height: 22px; margin-right: 10px; flex: none; }

/* segmenten */
.chips { display: flex; gap: 6px; margin: 8px 0 4px; }
.chip { flex: 1; min-width: 0; min-height: 56px; border: 0; background: var(--paneel2); color: var(--wit); font: inherit;
        font-size: var(--f20); font-weight: 800; font-style: italic; border-radius: 14px; touch-action: manipulation;
        transition: transform .25s var(--veer), background-color .2s, color .2s; }
.chip:active { transform: scale(.92); }
.chip.gekozen { background: var(--lime); color: var(--asfalt); transform: translateY(-2px); }
.vraag { margin: 8px 0 0; color: var(--zacht); }
.chips { margin-bottom: 0; }

/* ---------- rust: startlichten boven de volgende set ---------- */
.ruststrook { background: var(--asfalt); padding: 8px 20px 10px; border-bottom: 1px solid var(--lijn); }
.rustrij { display: flex; align-items: center; gap: 12px; }
.rustrij .label { color: var(--zacht); font-size: 12px; line-height: 1.15; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.rustrij .teller { min-width: 3.1ch; font-size: 44px; line-height: 1; font-weight: 800; font-style: italic; letter-spacing: -.03em; }
.rustrij .lichten { flex: 1; margin: 0; gap: 5px; }
.rustrij .teller.klaar { color: var(--lime); }
.rustrij .knop.tweede { width: auto; min-height: 48px; margin: 0; padding: 0 16px; }
.lichten { display: flex; gap: 8px; margin-top: 12px; }
.lichten.drie { max-width: 200px; margin: 10px auto 4px; }
.lichten.weg { display: none; }
.lichten i { flex: 1; height: 12px; border-radius: 6px; background: var(--lijn); transition: background-color .15s, box-shadow .3s; }
.lichten i.aan { background: var(--rood); box-shadow: 0 0 14px rgba(255, 77, 77, .55); }
.lichten.go i { background: var(--lime); box-shadow: 0 0 14px rgba(198, 244, 50, .5); }
.perron { height: 4px; background: var(--lijn); overflow: hidden; border-radius: 2px; margin-top: 8px; }
.perron div { height: 100%; background: var(--wit); transform-origin: left; transition: transform .5s linear; }

/* ---------- record: één schermvullend paars moment ---------- */
.pr-scherm { position: fixed; inset: 0; z-index: 10; display: grid; place-content: center; text-align: center; padding: 30px;
          background: radial-gradient(120% 80% at 50% 40%, #3b1f63 0%, #160a26 70%); color: #fff;
          animation: record-in .5s var(--snel) both; }
.pr-scherm.weg { animation: record-uit .4s var(--snel) both; }
.pr-scherm h2 { font-size: var(--f32); margin: 0; color: #d9b8ff; }
.pr-scherm .pr-cijfer { font-size: var(--f56); font-weight: 800; font-style: italic; line-height: 1; margin: 12px 0; color: var(--paars); letter-spacing: -.03em; }
.pr-scherm p { font-size: var(--f20); }
.pr-scherm .streep { position: absolute; inset: 0; background: linear-gradient(105deg, transparent 40%, rgba(177, 108, 255, .35) 50%, transparent 60%);
                  animation: veeg 1.1s var(--snel) .1s both; pointer-events: none; }
@keyframes record-in { from { opacity: 0; transform: scale(1.08); } to { opacity: 1; transform: none; } }
@keyframes record-uit { to { opacity: 0; transform: scale(.96); } }
@keyframes veeg { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ---------- finish ---------- */
.finish { text-align: left; }
.finish .groot { font-size: var(--f112); font-weight: 800; font-style: italic; line-height: .85; letter-spacing: -.05em; margin: 6px 0 4px; }
.finish .groot small { font-size: var(--f20); color: var(--zacht); letter-spacing: 0; margin-left: 8px; }
.uitslag { margin: 14px 0 0; }
.uitslag .rij { padding: 12px 0; }
.uitslag .plus { color: var(--lime); } .uitslag .min { color: var(--rood); } .uitslag .pr { color: var(--paars); }

/* ---------- panelen ---------- */
.kaart { padding: 18px 20px; border-bottom: 1px solid var(--lijn); }
.kaart.kritiek { background: rgba(198, 244, 50, .06); }
.kaart.kritiek h2 { color: var(--lime); }
.kaart.alarm { background: rgba(255, 77, 77, .08); }
.kaart.alarm h2 { color: var(--rood); }
.kop { padding: 18px 20px 4px; }
.weekfeiten { padding: 14px 20px 0; }
details { margin: 0 0 12px; color: var(--zacht); }
summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--wit); font-weight: 700; }
summary::marker { color: var(--lime); }
details a { color: var(--lime); text-underline-offset: 3px; }
ul.lijst { padding-left: 20px; margin: 6px 0; }
ul.lijst li { margin: 6px 0; }
.meter { margin: 10px 0 4px; }
.meter .getal { font-size: var(--f32); font-weight: 800; font-style: italic; }
.balk { height: 8px; background: var(--lijn); margin: 6px 0 4px; border-radius: 4px; overflow: hidden; }
.balk > div { height: 100%; background: var(--lime); border-radius: 4px; transform-origin: left; animation: vullen .9s var(--snel) both; }
@keyframes vullen { from { transform: scaleX(0); } }

/* ---------- formulieren ---------- */
label { display: block; margin: 14px 0 6px; color: var(--zacht); }
input[type=password], input[type=number], input[type=time], select {
  width: 100%; min-height: 56px; font: inherit; font-size: var(--f20); padding: 10px 14px; border-radius: 14px;
  border: 2px solid var(--lijn); background: var(--asfalt); color: var(--wit); transition: border-color .2s; }
input::placeholder { color: #7a8392; }
input:focus, select:focus { border-color: var(--lime); outline: none; }
label.vink { display: flex; gap: 12px; align-items: center; color: var(--wit); min-height: 44px; }
label.vink input { width: 24px; height: 24px; accent-color: var(--lime); }
.rijen2 { display: flex; gap: 8px; }

#status { min-height: 1.4em; margin: 12px 20px 0; }
#status.fout { color: var(--rood); }
body.vastknop #status:not(:empty) { position: fixed; z-index: 3; left: max(20px, calc(50% - 260px)); right: max(20px, calc(50% - 260px));
  bottom: calc(104px + env(safe-area-inset-bottom)); margin: 0; padding: 10px 14px; background: var(--paneel); border-radius: 12px; }
svg polyline { color: var(--wit); }
.fotos { display: flex; gap: 8px; margin-top: 12px; }
.fotos figure { flex: 1; margin: 0; }
.fotos img { width: 100%; border-radius: 12px; display: block; }
.fotos figcaption { color: var(--zacht); font-size: var(--f14); margin-top: 4px; }
::-webkit-scrollbar { width: 6px; } ::-webkit-scrollbar-thumb { background: var(--lijn); border-radius: 3px; }

/* ---------- startscherm ---------- */
.start { margin-top: 18px; border-top: 1px solid var(--lijn); }
.dagstrook { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin: 6px 0 4px; }
.dag { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0 10px; background: var(--paneel); border-radius: 12px;
       border: 2px solid transparent; animation: dag-in .5s var(--veer) both; }
.dag:nth-child(2) { animation-delay: .04s; } .dag:nth-child(3) { animation-delay: .08s; } .dag:nth-child(4) { animation-delay: .12s; }
.dag:nth-child(5) { animation-delay: .16s; } .dag:nth-child(6) { animation-delay: .2s; } .dag:nth-child(7) { animation-delay: .24s; }
@keyframes dag-in { from { transform: translateY(10px) scale(.9); opacity: 0; } }
.dag span { font-size: var(--f14); color: var(--zacht); text-transform: uppercase; font-weight: 700; }
.dag b { font-size: var(--f20); min-height: 1.2em; line-height: 1.2; font-style: italic; }
.dag.gedaan { background: var(--lime); }
.dag.gedaan span, .dag.gedaan b { color: var(--asfalt); }
.dag.vandaag { border-color: var(--wit); }
.dagrij { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--lijn); }
.dagrij span { color: var(--zacht); }
.lijnblok { padding: 12px 0 14px; border-bottom: 1px solid var(--lijn); }
.lijnblok:last-child { border-bottom: 0; }
.lijnkop { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.lijnkop .groot { font-size: var(--f20); font-weight: 800; font-style: italic; color: var(--lime); white-space: nowrap; }
.grafiek { display: block; width: 100%; height: auto; margin: 8px 0 4px; overflow: visible; }
.grafiek polyline { color: var(--wit); stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: tekenen 1.2s var(--snel) .15s forwards; }
.grafiek .vlak { opacity: 0; animation: vlak .8s ease .6s forwards; }
.grafiek .eindpunt { fill: var(--lime); transform-box: fill-box; transform-origin: center; animation: punt .5s var(--veer) 1.1s both; }
@keyframes tekenen { to { stroke-dashoffset: 0; } }
@keyframes vlak { to { opacity: 1; } }
@keyframes punt { from { transform: scale(0); } }

/* ---------- smalle telefoons en minder beweging ---------- */
@media (max-width: 369px) { .stepper.hoofd .waarde span:first-child, .klokwaarde { font-size: min(96px, 26vw); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .grafiek polyline { stroke-dashoffset: 0; }
  .stepper .waarde.grens span:first-child { color: var(--rood); }
}
/* rondewissel: het oude scherm rijdt weg (kloon), het nieuwe rijdt binnen */
.wissel-oud { position: fixed; left: 0; right: 0; top: 0; height: 100dvh; overflow: hidden; z-index: 5; pointer-events: none; max-width: 560px; margin: 0 auto; }
.wissel-oud * { animation: none !important; transition: none !important; }

/* kopregel boven de naam: sessie en set, met de sectorbalk eronder */
.kopregel { display: flex; justify-content: space-between; padding: 10px 20px 0; color: var(--zacht); font-size: var(--f14);
            text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.kopregel #set-nr { color: var(--wit); }
.kopregel + .stappen { margin: 8px 0 0; }
.kopregel .soort { color: var(--lime); font-weight: 800; }

/* ---------- links/rechts bij eenzijdige oefeningen ---------- */
.kant { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 6px; }
.kant b { background: var(--wit); color: var(--asfalt); font-style: italic; font-weight: 800; font-size: var(--f17); padding: 3px 10px; border-radius: 8px; }
.kant.rechts b { background: var(--lime); }
.kant span { color: var(--zacht); font-size: var(--f14); }

/* ---------- klok: warming-up en oefeningen op tijd ---------- */
.klok { display: flex; flex-direction: column; align-items: center; margin: 6px 0 8px; }
.klokwaarde { font-size: 96px; line-height: .9; font-weight: 800; font-style: italic; letter-spacing: -.05em; }
.klokwaarde.klaar { color: var(--lime); }
.klokwat { color: var(--zacht); font-size: var(--f14); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin-top: 6px; }
.onderdelen { list-style: none; padding: 0; margin: 14px 0 0; counter-reset: od; }
.onderdelen li { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: 10px 0 10px 14px; border-left: 3px solid var(--lijn); margin-bottom: 4px;
                 transition: border-color .3s, opacity .3s; }
.onderdelen li b { font-style: italic; } .onderdelen li span { grid-column: 1; color: var(--zacht); font-size: var(--f14); }
.onderdelen li em { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-style: italic; font-weight: 800; color: var(--zacht); }
.onderdelen li.nu { border-color: var(--lime); } .onderdelen li.nu em { color: var(--lime); }
.onderdelen li.af { opacity: .45; border-color: var(--wit); }
.knop.vast.stopknop { background: var(--rood); color: #fff; }
h2.sub { margin: 18px 0 0; }
