:root {
  color-scheme: light;
  --pagina: #d9dce2; --bg: #f5f6f8; --kaart: #ffffff; --lijn: #e3e5ea; --tekst: #1f2126; --zacht: #6c717a;
  --rood: #e6292a; --groen: #1fa25f; --amber: #dc9208; --grijs: #a2a8b1; --neutraal: #2b2d33;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--pagina); color: var(--tekst);
       font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1, h2, p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--rood) 55%, transparent); outline-offset: 2px; }
.sprite { position: absolute; }
.ic { width: 24px; height: 24px; flex: none; }

.kolom { width: min(100%, 440px); margin: 0 auto; min-height: 100vh; min-height: 100dvh; background: var(--bg);
         box-shadow: 0 0 0 1px var(--lijn), 0 24px 70px -20px rgba(20,22,26,.25); position: relative; }
.kop { display: flex; justify-content: center; padding: 18px 20px 6px; }
.kop .logo { height: 40px; width: auto; }
.noscript { margin: 16px 20px; padding: 14px 16px; border-radius: 14px; background: var(--kaart); border: 1px solid var(--rood); }

/* Groot, vingervriendelijk */
.grootknop { width: 100%; min-height: 62px; border: 0; border-radius: 20px; font-size: 19px; font-weight: 700; color: #fff;
             background: var(--neutraal); display: flex; align-items: center; justify-content: center; gap: 12px; cursor: pointer;
             transition: transform .05s, filter .15s; }
.grootknop:active { transform: scale(.985); }
.grootknop[data-type=start] { background: var(--groen); }
.grootknop[data-type=stop] { background: var(--rood); }
.grootknop.bezig { background: var(--amber); }
.grootknop:disabled { cursor: default; transform: none; }
.grootknop:disabled:not(.bezig) { opacity: .5; }
.spin { display: none; width: 22px; height: 22px; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff;
        border-radius: 50%; animation: draai .8s linear infinite; }
.bezig .spin { display: block; }
@keyframes draai { to { transform: rotate(360deg); } }

/* Inloggen */
.login { padding: 8vh 24px 24px; display: grid; gap: 14px; }
.login .logo { width: 260px; max-width: 80%; height: auto; margin: 0 auto 18px; display: block; }
.login-formulier { display: grid; gap: 14px; }
.login label { font-weight: 600; font-size: 14px; }
.login input[type=password] { font: inherit; font-size: 18px; height: 60px; padding: 0 18px; border-radius: 18px; color: inherit;
               border: 1px solid var(--lijn); background: var(--kaart); width: 100%; }
.login input[type=password]:focus { outline: 3px solid color-mix(in srgb, var(--rood) 35%, transparent); border-color: var(--rood); }
.fout { color: var(--rood); font-size: 15px; }

/* Tabbladen */
.tab { padding: 8px 20px 110px; }
.tab-kop { font-size: 22px; font-weight: 750; margin: 12px 0 14px; }
.tabbalk { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 440px); z-index: 20;
           display: grid; grid-template-columns: repeat(3, 1fr); background: color-mix(in srgb, var(--kaart) 92%, transparent);
           backdrop-filter: blur(14px); border-top: 1px solid var(--lijn); padding-bottom: env(safe-area-inset-bottom); }
.tabbalk button { border: 0; background: none; padding: 10px 0 9px; display: grid; justify-items: center; gap: 3px;
                  font-size: 12px; font-weight: 600; color: var(--zacht); cursor: pointer; position: relative; }
.tabbalk button[aria-selected=true] { color: var(--rood); }
.tabbalk button[aria-selected=true]::before { content: ""; position: absolute; top: -1px; width: 34px; height: 3px;
                                               border-radius: 0 0 3px 3px; background: var(--rood); }

/* Statuscirkel */
.cirkel { --k: var(--grijs); position: relative; width: 224px; height: 224px; margin: 14px auto 26px; display: grid; place-items: center; }
.cirkel[data-kleur=groen] { --k: var(--groen); }
.cirkel[data-kleur=rood] { --k: var(--rood); }
.cirkel[data-kleur=amber] { --k: var(--amber); }
.ring { position: absolute; inset: 0; border-radius: 50%; border: 10px solid color-mix(in srgb, var(--k) 22%, var(--bg)); transition: border-color .3s; }
.ring::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 10px solid transparent; }
.cirkel[data-kleur=amber] .ring::after { border-top-color: var(--k); animation: draai 1.1s linear infinite; }
.puls { position: absolute; inset: 0; border-radius: 50%; background: var(--k); opacity: 0; }
.cirkel[data-kleur=groen] .puls { animation: rimpel 2.6s ease-out infinite; }
@keyframes rimpel { 0% { transform: scale(1); opacity: .26; } 100% { transform: scale(1.3); opacity: 0; } }
.kern { position: relative; width: 172px; height: 172px; border-radius: 50%; background: var(--kaart); display: grid; place-items: center;
        color: var(--k); box-shadow: 0 14px 34px -14px color-mix(in srgb, var(--k) 60%, transparent), inset 0 0 0 1px var(--lijn);
        transition: color .3s; }
.kern .ic { width: 74px; height: 74px; }

.status-tekst { text-align: center; margin-bottom: 22px; }
.status-tekst h1 { font-size: 25px; line-height: 1.2; }
.status-tekst p { color: var(--zacht); margin-top: 4px; }
.chips { display: flex; justify-content: center; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 99px; background: var(--kaart);
        border: 1px solid var(--lijn); font-size: 14px; color: var(--zacht); font-variant-numeric: tabular-nums; }
.chip b { color: var(--tekst); }
.chip .ic { width: 16px; height: 16px; color: var(--rood); }

/* Kaarten en lijsten */
.kaart { background: var(--kaart); border-radius: 22px; border: 1px solid var(--lijn); overflow: hidden; margin-bottom: 14px; }
.lijst > :not(:first-child) { border-top: 1px solid var(--lijn); }
.meter { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; }
.meter > span:first-child { color: var(--zacht); display: flex; align-items: center; gap: 10px; }
.meter > span:first-child .ic { width: 20px; height: 20px; }
.meter b { font-size: 19px; font-variant-numeric: tabular-nums; }
.meter b small { font-size: 13px; color: var(--zacht); font-weight: 600; margin-left: 3px; }

.stekker { padding: 22px 20px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.stekker .rond { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; color: var(--k, var(--grijs));
                 background: color-mix(in srgb, var(--k, var(--grijs)) 14%, var(--kaart)); }
.stekker .rond .ic { width: 40px; height: 40px; }
.stekker h2 { font-size: 20px; }
.stekker p { color: var(--zacht); font-size: 14px; margin-top: -8px; }
.randknop { width: 100%; min-height: 56px; border-radius: 18px; border: 2px solid var(--rood); background: transparent;
            color: var(--rood); font-size: 17px; font-weight: 700; cursor: pointer; }
.randknop.aan { border-color: var(--groen); color: var(--groen); }
.randknop:disabled { opacity: .4; cursor: default; }

.rij { display: flex; align-items: center; gap: 14px; width: 100%; padding: 18px; border: 0;
       background: none; color: inherit; text-decoration: none; font-weight: 600; text-align: left; cursor: pointer; }
.rij:active { background: var(--bg); }
.rij .ic { color: var(--rood); }
.rij small { margin-left: auto; color: var(--zacht); font-weight: 500; font-variant-numeric: tabular-nums; }
.rij-formulier { margin: 0; }

/* Melding bovenop de tabbalk */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(82px + env(safe-area-inset-bottom));
         width: min(calc(100% - 32px), 408px); z-index: 30; background: var(--neutraal); color: #fff; border-radius: 16px;
         padding: 14px 16px; font-size: 15px; box-shadow: 0 14px 40px -10px rgba(20,22,26,.5); }

/* Bevestiging als onderste blad */
dialog.dlg { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 440px; border-radius: 26px 26px 0 0;
             background: var(--kaart); color: var(--tekst); box-shadow: 0 30px 80px rgba(0,0,0,.35);
             font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
dialog.dlg::backdrop { background: rgba(10,11,14,.55); backdrop-filter: blur(2px); }
dialog.dlg form { padding: 26px 22px calc(22px + env(safe-area-inset-bottom)); }
dialog.dlg h2 { margin: 0 0 8px; font-size: 20px; }
dialog.dlg p { margin: 0 0 22px; color: var(--zacht); }
.dlg-knoppen { display: flex; flex-direction: column-reverse; gap: 10px; }
.dlg-knoppen button { width: 100%; padding: 17px; border-radius: 16px; font-size: 17px; font-weight: 700; cursor: pointer;
                      border: 1px solid var(--lijn); background: transparent; color: inherit; }
.dlg-knoppen .dlg-ja { background: var(--neutraal); border-color: transparent; color: #fff; }
dialog.gevaar .dlg-ja { background: var(--rood); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
