@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  /* Terugval op de maat van Geist Mono, zodat het wachtwoord meteen zichtbaar is en niet verspringt.
     Courier New is even breed (600/1000); Consolas is smaller (550/1000), dus 9,1% groter. */
  font-family: "Geist Mono Fallback";
  src: local("Courier New"), local("Menlo");
  size-adjust: 100%;
  ascent-override: 100.5%;
  descent-override: 29.5%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Geist Mono Fallback Win";
  src: local("Consolas");
  size-adjust: 109.1%;
  ascent-override: 92.1%;
  descent-override: 27%;
  line-gap-override: 0%;
}

@font-face {
  /* Terugval op de maat van Geist: wisselen naar Geist geeft geen zichtbare sprong.
     Gemeten: Geist is 5,3% breder dan Arial; ascent/descent van Geist (1005/295 per 1000) gecorrigeerd voor die schaal. */
  font-family: "Geist Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica");
  size-adjust: 105.3%;
  ascent-override: 95.4%;
  descent-override: 28%;
  line-gap-override: 0%;
}
@font-face {
  /* Android heeft geen Arial maar Roboto (iets smaller). */
  font-family: "Geist Fallback Android";
  src: local("Roboto");
  size-adjust: 107%;
  ascent-override: 93.9%;
  descent-override: 27.6%;
  line-gap-override: 0%;
}

:root {
  --bg: #ffffff;
  --ink: #22252b;
  --ink-2: #3d4047;
  --muted: #6c6f77;
  --faint: #a2a5ab;
  --line: #e7e7e9;
  --line-2: #d6d7da;
  --control: #898c93; /* rand van invoervelden en knoppen: 3,4:1 op wit */
  --soft: #f4f4f5;
  --btn-hover: #3a3e46;
  --bad: #b42318;
  --good: #007a4d;
  --select: rgb(34 37 43 / .12);
  --show-light: block; --inline-light: inline-block; --inline-dark: none;
  --show-dark: none;
  color-scheme: light;
  --sans: "Geist", "Geist Fallback", "Geist Fallback Android", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", "Geist Mono Fallback Win", "Geist Mono Fallback", ui-monospace, monospace;
}

/* Donker: volgt het systeem, tenzij je zelf kiest (data-theme, niet opgeslagen) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --bg: #16181c;
  --ink: #e8e9ec;
  --ink-2: #c3c5ca;
  --muted: #9a9da5;
  --faint: #6b6e76;
  --line: #2a2d33;
  --line-2: #3b3f46;
  --control: #6b6f78; /* 3,5:1 op de donkere achtergrond */
  --soft: #202328;
  --btn-hover: #c9cbd0;
  --bad: #f97066;
  --good: #3ccb7f;
  --select: rgb(232 233 236 / .18);
  --show-light: none; --inline-light: none; --inline-dark: inline-block;
  --show-dark: block;
  color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16181c;
  --ink: #e8e9ec;
  --ink-2: #c3c5ca;
  --muted: #9a9da5;
  --faint: #6b6e76;
  --line: #2a2d33;
  --line-2: #3b3f46;
  --control: #6b6f78; /* 3,5:1 op de donkere achtergrond */
  --soft: #202328;
  --btn-hover: #c9cbd0;
  --bad: #f97066;
  --good: #3ccb7f;
  --select: rgb(232 233 236 / .18);
  --show-light: none; --inline-light: none; --inline-dark: inline-block;
  --show-dark: block;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  grid-template-columns: minmax(0, 1fr); /* nooit breder dan het scherm, ook niet door een brede rij (themakeuze) */
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, p { margin: 0; }
button, input, output { font: inherit; color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
/* Eigen iconenstijl: ronde punten als accent (wifi, dobbelsteen, lijst, info) zijn gevuld */
svg .dot { fill: currentColor; stroke: none; }
::selection { background: var(--select); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nowrap { white-space: nowrap; }

.page {
  width: min(100% - 2.5rem, 35rem);
  margin: 0 auto;
  padding: clamp(1.5rem, 5vh, 3.5rem) 0 2rem;
}

/* Logo */
.top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 1rem; }
.top .logo { grid-area: 1 / 1; }
.top .prefs { grid-area: 1 / 3; }
/* Maker, klein rechts onder het logo */
.brand-by { grid-area: 2 / 1; justify-self: end; margin-top: -.2rem; font-size: .8125rem; line-height: 1.2; color: var(--muted); }
.brand-by a { color: var(--ink); font-weight: 600; text-decoration: none; }
.brand-by a:hover { text-decoration: underline; text-underline-offset: .2em; }
@media (max-width: 600px) { .brand-by { margin-top: -.4rem; } }
.logo { display: inline-block; line-height: 0; border-radius: 6px; }
.logo-light { display: var(--show-light) !important; }
.logo-dark { display: var(--show-dark) !important; }
/* Instellingen (tandwiel) */
.prefs { position: relative; flex: none; }
/* Tandwiel: geen rand, draait een stukje bij aanwijzen en bij openen */
#prefs-btn { box-shadow: none; background: none; }
#prefs-btn:hover { background: var(--soft); }
#prefs-btn svg { width: 1.3rem; height: 1.3rem; stroke-width: 1.75; transition: transform .45s cubic-bezier(.2,.7,.2,1); }
#prefs-btn:hover svg, #prefs-btn:focus-visible svg { transform: rotate(60deg); }
#prefs-btn:active svg { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { #prefs-btn svg { transition: none; } #prefs-btn:hover svg, #prefs-btn:focus-visible svg, #prefs-btn:active svg { transform: none; } }
/* Instellingen: dialoog, links uitgelijnd */
.dialog.prefs-dialog { text-align: left; width: min(21rem, calc(100vw - 2rem)); }
.prefs-dialog .dialog-title { margin: 0 2.5rem 1.1rem 0; }
.prefs-dialog fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.prefs-dialog fieldset + fieldset { margin-top: .95rem; }
.prefs-dialog legend { padding: 0; margin-bottom: .4rem; font-size: .8125rem; color: var(--muted); }
.prefs-coffee { margin: 1.2rem 0 0; }
.prefs-coffee svg { width: 1.1rem; height: 1.1rem; stroke-width: 1.9; }
/* Telefoon: paneel dat van onderen omhoog schuift, binnen duimbereik */
@media (max-width: 559px) {
  .dialog.prefs-dialog { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 20px 20px 0 0; border-bottom: 0; padding-bottom: calc(1.3rem + env(safe-area-inset-bottom)); }
  .dialog.prefs-dialog[open] { animation: sheet-in .28s cubic-bezier(.2,.7,.2,1); }
  .dialog.prefs-dialog.is-closing { animation: sheet-out .16s ease-in forwards; }
}
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }
.install-btn { display: flex; align-items: center; justify-content: center; gap: .45rem; text-decoration: none; width: 100%; height: 2.6rem; margin-bottom: .45rem; }
.install-btn[hidden], .install[hidden] { display: none; }
.seg { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 11px; }
.seg label { position: relative; flex: 1 1 auto; padding: .45rem .5rem; border-radius: 8px; text-align: center; font-size: .875rem; font-weight: 500; color: var(--muted); cursor: pointer; transition: color .15s, background-color .15s; }
.seg input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.seg label:hover { color: var(--ink); background: var(--soft); }
.seg label:has(input:checked) { background: var(--ink); color: var(--bg); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.logo { min-width: 0; }
.logo img { display: block; width: clamp(10.5rem, 100vw - 7.5rem, 17rem); height: auto; }
@media (min-width: 560px) { .logo img { width: 21rem; } }
.theme-btn { flex: none; }

.title {
  margin-top: clamp(1.5rem, 6vh, 4.5rem);
  font-size: clamp(1.6rem, 5.6vw, 2.35rem);
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -.045em;
  text-wrap: balance;
}

/* Apparaatkeuze */
.devices {
  margin-top: clamp(1.25rem, 4vh, 2.5rem);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.device {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem;
  min-height: 3.75rem;
  padding: .5rem .2rem;
  white-space: nowrap;
  border-radius: 11px;
  color: var(--muted);
  font-size: .8125rem; font-weight: 500;
  cursor: pointer;
  transition: color .15s, background-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.device svg { width: 1.375rem; height: 1.375rem; }
.device:hover { color: var(--ink); background: var(--soft); }
.device { text-decoration: none; }
.device[aria-current="page"], .device[aria-current="page"]:hover { background: var(--ink); color: var(--bg); }
.device:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* Tabs zo breed als hun tekst (gelijke ruimte tussen de woorden); alleen op heel smalle schermen mag een label afbreken */
.devices { display: flex; }
.device { flex: 1 1 auto; padding: .5rem .45rem; text-align: center; line-height: 1.15; }
@media (max-width: 359px) { .device { white-space: normal; padding: .5rem .25rem; } }
@media (min-width: 560px) {
  .device { min-height: 4.1rem; font-size: .875rem; }
}

/* Het wachtwoord */
.result {
  margin-top: .75rem;
  padding: clamp(1.15rem, 4.5vw, 1.6rem) clamp(1.15rem, 4.5vw, 1.6rem) clamp(.9rem, 3vw, 1.1rem);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.pw {
  display: block;
  min-height: 1.3em;
  font: 500 clamp(1.45rem, 6vw, 2.3rem)/1.28 var(--mono);
  letter-spacing: .01em;
  overflow-wrap: anywhere;
  word-break: break-all;
  user-select: all;
  -webkit-user-select: all;
  cursor: text;
}
.pw[data-mode="wifi"] { word-break: normal; font-size: clamp(1.2rem, 5.2vw, 1.85rem); }
.pw[data-mode="wifi"] .g { display: inline-block; margin-right: 0; } /* aan elkaar, maar mag per woord afbreken */
.pw .g { display: inline-block; margin-right: .5em; }
.pw .g:last-child { margin-right: 0; }
.pw-off { font: 400 1rem/1.5 var(--sans); color: var(--muted); }
.js .pw-off { display: none; } /* met JavaScript komt hier meteen het wachtwoord: geen tweeregelige melding die daarna verdwijnt */

.result-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem;
  margin-top: 1.1rem; padding-top: .9rem;
  border-top: 1px solid var(--line);
}
.strength { display: flex; align-items: center; gap: .6rem; font-size: .875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.strength b { color: var(--ink); font-weight: 600; }
.bars { display: inline-flex; align-items: flex-end; gap: 3px; }
.bars i { display: block; width: 4px; border-radius: 2px; background: var(--line-2); }
.bars i:nth-child(1) { height: 6px; }
.bars i:nth-child(2) { height: 9px; }
.bars i:nth-child(3) { height: 12px; }
.bars i:nth-child(4) { height: 15px; }
.bars i.on { background: var(--ink); }

.result-actions { display: flex; gap: .625rem; margin-left: auto; }
@media (max-width: 479px) {
  .result-actions { width: 100%; margin-left: 0; }
  .result-actions .btn { flex: 1; }
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  height: 2.75rem; padding: 0 1.15rem;
  border: 0; border-radius: 11px;
  background: var(--ink); color: var(--bg);
  font-weight: 500; font-size: .9375rem;
  cursor: pointer;
  transition: background-color .15s, transform .1s;
  touch-action: manipulation;
}
.btn:hover { background: var(--btn-hover); }
.btn:active, .icon-btn:active { transform: scale(.97); }
.btn:disabled, .icon-btn:disabled { opacity: .45; cursor: default; }
.btn svg, .icon-btn svg { width: 1.125rem; height: 1.125rem; }
.btn .i-check { display: none; }
.btn.is-done .i-copy { display: none; }
.btn.is-done .i-check { display: block; }
.btn-quiet { height: 2.5rem; padding: 0 1rem; background: var(--bg); color: var(--ink); box-shadow: inset 0 0 0 1px var(--control); }
.btn-quiet:hover { background: var(--soft); }
.icon-btn {
  display: grid; place-items: center;
  width: 2.75rem; height: 2.75rem;
  border: 0; border-radius: 11px;
  background: var(--bg); box-shadow: inset 0 0 0 1px var(--control);
  cursor: pointer;
  transition: background-color .15s, transform .1s;
  touch-action: manipulation;
}
.icon-btn:hover { background: var(--soft); }
#again svg { width: 1.25rem; height: 1.25rem; stroke-width: 2; }

.meta { position: relative; display: flex; align-items: center; gap: .35rem; }
.info-btn {
  display: grid; place-items: center; flex: none;
  width: 2rem; height: 2rem; margin: -.25rem 0;
  border: 0; border-radius: 50%; background: none; color: var(--muted);
  cursor: pointer; touch-action: manipulation;
}
.info-btn svg { width: 1.15rem; height: 1.15rem; stroke-width: 1.9; }
.info-btn:hover, .info-btn[aria-expanded="true"] { color: var(--ink); background: var(--soft); }
.hint {
  transform-origin: top left;
  position: absolute; z-index: 5; top: calc(100% + .55rem); left: 0;
  width: max-content; max-width: min(19rem, calc(100vw - 4rem));
  padding: .65rem .8rem; border-radius: 11px;
  background: var(--ink); color: var(--bg);
  font-size: .8125rem; line-height: 1.45;
  box-shadow: 0 6px 20px rgb(0 0 0 / .14);
}

/* Instellingen: alleen wat bij het apparaat hoort */
.settings { margin-top: .9rem; }
.panel { border-top: 1px solid var(--line); }
.panel > * + * { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.1rem; font-size: .9375rem; }
label.row { cursor: pointer; }
.row-range { display: grid; grid-template-columns: 1fr auto; gap: .1rem 1rem; padding: .7rem 0 .4rem; }
.row-range output { font-weight: 600; font-variant-numeric: tabular-nums; }
.row-range input { grid-column: 1 / -1; width: 100%; height: 1.75rem; margin: 0; accent-color: var(--ink); cursor: pointer; }
.label-note { color: var(--muted); font-size: .8125rem; }
.qr[hidden] { display: none; }
.row-field input {
  width: min(62%, 16rem); height: 2.6rem; padding: 0 .8rem;
  border: 0; border-radius: 10px;
  box-shadow: inset 0 0 0 1px var(--control);
  background: var(--bg);
  outline: none;
}
.row-field input::placeholder { color: var(--muted); }
.row-field input:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); }

input[role="switch"] {
  appearance: none; -webkit-appearance: none;
  position: relative; flex: none;
  width: 2.6rem; height: 1.5rem; margin: 0;
  border-radius: 99px;
  background: var(--line-2);
  cursor: pointer;
  transition: background-color .15s;
}
input[role="switch"]::before {
  content: ""; position: absolute; top: .1875rem; left: .1875rem;
  width: 1.125rem; height: 1.125rem; border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 1px 2px rgb(0 0 0 / .2);
  transition: transform .15s;
}
input[role="switch"]:checked { background: var(--ink); }
input[role="switch"]:checked::before { transform: translateX(1.1rem); }

/* Wifi QR-code */
.row-stack { flex-direction: column; align-items: stretch; gap: .45rem; padding: .8rem 0 .9rem; }
.row-stack input { width: 100%; }
.row-stack[hidden] { display: none; }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.count { font-size: .8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.count.is-full { color: var(--bad); }
.field-note { font-size: .8125rem; color: var(--muted); line-height: 1.45; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  height: 2rem; padding: 0 .75rem; border: 0; border-radius: 99px;
  background: var(--soft); color: var(--ink-2); font-size: .8125rem; font-weight: 500;
  cursor: pointer; transition: background-color .15s, color .15s, transform .1s; touch-action: manipulation;
}
.chip:hover { background: var(--line); color: var(--ink); }
.chip:active { transform: scale(.96); }
.chip svg { width: 1rem; height: 1rem; stroke-width: 1.9; }
/* Gokkast: dobbelsteen draait, namen flitsen voorbij in het veld (alleen de tekst, het veld zelf staat stil) */
#ssid-random.is-rolling svg { animation: roll-die .45s linear infinite; }
@keyframes roll-die { to { transform: rotate(360deg); } }
#w-ssid.is-rolling { animation: roll-name .09s ease-out infinite; }
@keyframes roll-name { from { color: var(--muted); } to { color: var(--ink); } }
.qr { display: grid; grid-template-columns: 8.5rem 1fr; grid-template-areas: "code text" "actions actions"; gap: .9rem 1.1rem; align-items: center; padding: 1rem 0 .25rem; }
.qr-code { grid-area: code; }
.qr-side { grid-area: text; }
.qr-code { width: 8.5rem; height: 8.5rem; padding: .4rem; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.qr-code.is-empty { box-shadow: none; border: 1px dashed var(--line-2); background: transparent; }
.qr-code svg { display: block; width: 100%; height: 100%; stroke: none; }
.qr-text { font-size: .875rem; color: var(--muted); }
.qr-actions { grid-area: actions; display: flex; gap: .5rem; }
.qr-actions .btn { flex: 1; padding: 0 .75rem; }
.qr-actions .btn[hidden] { display: none; }
@media (max-width: 359px) {
  .qr { grid-template-columns: 1fr; grid-template-areas: "code" "text" "actions"; justify-items: start; }
  .qr-actions { width: 100%; }
}
@media (min-width: 560px) {
  .qr { grid-template-areas: "code text" "code actions"; align-items: end; }
  .qr-side { align-self: start; }
  .qr-actions .btn { flex: none; }
}

/* Lekcheck */
/* Lekcheck: een eigen kaart onder de generator, altijd open */
/* Lekcheck: rustige open sectie onder de generator, zonder kaart (de generator blijft het hoofdonderdeel) */
.leak { min-width: 0; margin-top: 2.75rem; }
.leak-title { margin: 0 0 .75rem; font-size: 1.125rem; font-weight: 600; letter-spacing: -.015em; }
.leak-field { display: flex; gap: .5rem; min-width: 0; }
.leak-check { height: 2.875rem; padding: 0 1rem; flex: none; border-radius: 12px; }
.legal table { width: 100%; margin-top: .8rem; border-collapse: collapse; font-size: .875rem; }
.legal th, .legal td { padding: .55rem .5rem .55rem 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; color: var(--ink-2); }
.legal th { color: var(--ink); font-weight: 600; }
.legal-table { overflow-x: auto; }
/* Overzicht in de privacyverklaring: elke rij als blokje (geen smalle kolommen).
   Telefoon: kolomnaam boven de tekst. Groter scherm: kolomnaam links, tekst ernaast. */
.legal table, .legal tbody, .legal tr, .legal td { display: block; width: auto; }
.legal thead { display: none; }
.legal tr { padding: .85rem 0; border-bottom: 1px solid var(--line); }
.legal tr:first-child { border-top: 1px solid var(--line); }
.legal td { padding: .15rem 0; border: 0; font-size: .9375rem; }
.legal td::before { content: attr(data-label); display: block; margin-top: .35rem; font-size: .75rem; font-weight: 600; color: var(--muted); }
.legal td:first-child { color: var(--ink); font-weight: 600; font-size: 1rem; }
.legal td:first-child::before { display: none; }
@media (min-width: 561px) {
  .legal td:not(:first-child) { display: grid; grid-template-columns: 9.5rem 1fr; gap: 1rem; }
  .legal td:not(:first-child)::before { margin-top: .15rem; }
  .legal td:first-child { margin-bottom: .2rem; }
}
.leak-note a { overflow-wrap: anywhere; }
/* Oogje in het veld: met streep zolang het wachtwoord verborgen is */
.leak-input { position: relative; flex: 1; min-width: 0; display: flex; }
.leak-eye { position: absolute; top: 0; right: 0; width: 2.875rem; height: 2.875rem; display: grid; place-items: center; border: 0; border-radius: 11px; background: none; color: var(--muted); cursor: pointer; }
.leak-eye:hover { color: var(--ink); }
.leak-eye:focus-visible { outline: 2px solid var(--ink); outline-offset: -4px; }
.leak-eye svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.leak-eye[aria-pressed="true"] .slash { display: none; }
.leak-field input { padding-right: 2.75rem !important; }
.leak-field input { flex: 1; width: 0; min-width: 0; height: 2.875rem; padding: 0 .9rem; border: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--control); background: var(--bg); outline: none; font-family: var(--mono); }
.leak-field input::placeholder { font-family: var(--sans); color: var(--muted); }
.leak-field input:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); }
.leak-result { min-height: 1.4em; margin-top: .75rem; font-size: .9375rem; color: var(--ink-2); transition: opacity .2s; }
.leak-result.is-pending { opacity: .45; }
.leak-result b { font-weight: 600; color: var(--ink); }
.lr-count { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.leak-result:empty { display: none; }
/* Uitkomst: zacht gekleurd blokje met icoon, titel en één regel uitleg */
.leak-result.is-bad, .leak-result.is-ok { padding: .8rem .95rem; border-radius: 12px; }
.lr-head { display: flex; align-items: center; gap: .45rem; }
.leak-result.is-bad { background: color-mix(in srgb, var(--bad) 10%, transparent); }
.leak-result.is-ok { background: color-mix(in srgb, var(--good) 10%, transparent); }
.lr-icon { width: 1.15rem; height: 1.15rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.is-bad .lr-icon { color: var(--bad); }
.is-ok .lr-icon { color: var(--good); }
.lr-head b { font-weight: 600; }
.is-bad .lr-head b { color: var(--bad); }
.is-ok .lr-head b { color: var(--good); }
.lr-text { margin-top: .25rem; color: var(--ink-2); font-size: .9375rem; }
.lr-text b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.leak-note { margin-top: .6rem; font-size: .8125rem; color: var(--muted); }
.leak-note { display: flex; align-items: center; flex-wrap: wrap; gap: 0 .3rem; }
.leak-shield { width: 1rem; height: 1rem; flex: none; fill: none; stroke: var(--good); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.leak-how { padding: 0; border: 0; background: none; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.leak-how:hover { color: var(--ink); }
/* Uitlegdialoog: links uitgelijnd, scrollt als het niet past */
.dialog.info-dialog { text-align: left; width: min(30rem, calc(100vw - 2rem)); max-height: min(80svh, 40rem); overflow: auto; }
.info-dialog .dialog-title { margin: 0 2.5rem .6rem 0; }
.info-body h3 { margin: 1rem 0 .25rem; font-size: .9375rem; font-weight: 600; }
.info-body p { color: var(--ink-2); font-size: .9375rem; }
.leak-note a { color: inherit; }

.leak-make { margin-top: .8rem; }
.leak-make[hidden] { display: none; }


.foot { padding: 1.25rem 1.25rem max(1.5rem, env(safe-area-inset-bottom)); text-align: center; font-size: .8125rem; }
.foot p + p { margin-top: .35rem; }
/* Privacypagina */
.legal h2 { margin: 2rem 0 .4rem; font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; }
.legal p { color: var(--ink-2); max-width: 62ch; }
.legal p + p { margin-top: .7rem; }
.legal a { color: var(--ink); text-underline-offset: 2px; }
.legal code { font: .875em var(--mono); padding: .05em .3em; border-radius: 5px; background: var(--soft); }
.legal-lead { margin-top: 1rem; font-size: 1.0625rem; }
.legal-date, .legal-back { margin-top: 2rem; font-size: .875rem; color: var(--muted); }
.coffee-btn {
  display: inline-flex; align-items: center; gap: .4rem; height: 2.2rem; padding: 0 .9rem;
  border: 0; border-radius: 99px; background: var(--soft); color: var(--ink-2);
  font-size: .8125rem; font-weight: 500; cursor: pointer; transition: background-color .15s, color .15s, transform .1s;
}
.coffee-btn:hover { background: var(--line); color: var(--ink); }
.coffee-btn:active { transform: scale(.97); }
.coffee-btn svg { width: 1.05rem; height: 1.05rem; }

/* Dialoog */
.dialog {
  width: min(23rem, calc(100vw - 2rem)); padding: 1.6rem 1.4rem 1.3rem; margin: auto;
  border: 1px solid var(--line); border-radius: 20px; background: var(--bg); color: var(--ink);
  box-shadow: 0 24px 64px rgb(0 0 0 / .22); text-align: center;
}
.dialog::backdrop { background: rgb(12 13 16 / .45); backdrop-filter: blur(3px); }
.dialog[open] { animation: dialog-in .26s cubic-bezier(.2,.7,.2,1); }
.dialog[open]::backdrop { animation: fade-in .26s ease; }
.dialog.is-closing { animation: dialog-out .16s ease-in forwards; }
.dialog.is-closing::backdrop { animation: fade-out .16s ease-in forwards; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes dialog-out { to { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
.dialog .dialog-title { margin: .8rem 0 .35rem; font-size: 1.2rem; font-weight: 600; letter-spacing: -.02em; }
.dialog-text { color: var(--muted); font-size: .9375rem; }
.dialog-close { position: absolute; top: .7rem; right: .7rem; display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.dialog-close:hover { background: var(--soft); color: var(--ink); }
.dialog-close svg { width: 1.1rem; height: 1.1rem; stroke-width: 1.9; }
.dialog-icon { display: grid; place-items: center; width: 3.2rem; height: 3.2rem; margin: 0 auto; border-radius: 50%; background: var(--soft); color: var(--ink); }
.dialog-icon svg { width: 1.6rem; height: 1.6rem; stroke-width: 1.6; }
.dialog-icon.is-good { background: #00A86B; color: #fff; }
.dialog-icon.is-good svg { stroke-width: 2; }
.dialog .amounts { margin-top: 1.1rem; }
.dialog .amounts label { font-size: 1rem; padding: .6rem .5rem; }
.custom-amount { display: flex; align-items: center; gap: .5rem; margin-top: .6rem; padding: 0 .9rem; height: 3rem; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--control); font-size: 1.2rem; font-weight: 600; }
.custom-amount[hidden] { display: none; }
.custom-amount:focus-within { box-shadow: inset 0 0 0 2px var(--ink); }
.custom-amount input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font: inherit; font-variant-numeric: tabular-nums; }
.custom-amount.is-invalid { box-shadow: inset 0 0 0 1.5px var(--bad); }
.dialog-main { width: 100%; margin-top: 1rem; }
.dialog-note { margin-top: .7rem; }
.dialog-error { margin-top: .6rem; font-size: .875rem; color: var(--bad); }
.dialog-error:empty { display: none; }
.step[hidden] { display: none; }
.qr-pay { display: grid; place-items: center; width: 13rem; height: 13rem; margin: 1rem auto 0; padding: .9rem; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.qr-pay img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.spinner { width: 2.6rem; height: 2.6rem; margin: .3rem auto 0; border-radius: 50%; border: 3px solid var(--line); border-top-color: #00A86B; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .prefs-dialog[open], .prefs-dialog.is-closing, .dialog[open], .dialog[open]::backdrop, .dialog.is-closing, .dialog.is-closing::backdrop { animation: none; } .spinner { animation: none; } }
.foot-quiet { color: var(--muted); text-decoration: none; }
.foot-quiet:hover { color: var(--ink); }
.foot-legal { display: flex; justify-content: center; gap: 1.1rem; font-size: .8125rem; }
.foot-brand { color: var(--ink); font-weight: 600; text-decoration: none; }
.foot-brand:hover { text-decoration: underline; text-underline-offset: .2em; }

/* Afdrukken: alleen de wifi-kaart */
.print-card { display: none; }
/* Afdrukken: alleen de wifi-kaart (de PNG), zonder datum, titel, adres of paginanummers van de browser.
   Paginamarge 0 laat de browser die kop- en voetregels weglaten; de witruimte zit in de kaart zelf. */
@media print {
  @page { size: A4 portrait; margin: 0; }
  html, body { background: #fff !important; }
  body { display: block; min-height: 0; margin: 0; }
  body > :not(.print-card) { display: none !important; }
  .print-card { display: block; width: 125mm; margin: 0 auto; padding-top: 22mm; break-inside: avoid; }
  .print-card img { display: block; width: 100%; height: auto; }
}

/* Lage schermen (kleine telefoons): minder lucht boven de kaart */
@media (max-height: 720px) {
  .page { padding-top: 1rem; }
  .title { margin-top: 1.1rem; }
  .devices { margin-top: .9rem; }
}

/* Overgang tussen licht en donker */
::view-transition-old(root),
::view-transition-new(root) { animation-duration: .4s; animation-timing-function: ease; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
.dialog .dialog-title:focus { outline: none; } /* focus alleen voor schermlezers, geen zichtbare rand om de kop */

/* Pagina met wifi-namen: rustige lijst in kolommen, elke naam is een link naar de generator */
.names { margin: 1.2rem 0 1.4rem; padding: 0; list-style: none; columns: 2 15rem; column-gap: 1.5rem; }
.names li { break-inside: avoid; }
.names a { display: block; padding: .38rem 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .9375rem; }
.names a:hover { color: var(--ink); background: var(--soft); }

/* Woordmerk midden in een zin (koffiedialoog): zelfde hoogte als de x-hoogte plus stokken, op de basislijn */
.inline-logo { display: inline-block; height: 1.05em; width: auto; vertical-align: -0.24em; margin: 0 .05em; }
.inline-light { display: var(--inline-light) !important; }
.inline-dark { display: var(--inline-dark) !important; }

/* Voettekst: paginanavigatie boven de regel met Vienix, privacy en voorwaarden */
.foot-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem 1.1rem; margin: .9rem 0 .5rem; font-size: .875rem; }
.foot-nav a[aria-current="page"], .foot a[aria-current="page"] { color: var(--ink); }
/* Lekcheckpagina: de paginakop is al "Is je wachtwoord gelekt?", dus geen tweede kop; de check staat direct onder de kop */
[data-page="leak"] .leak { margin-top: clamp(1.25rem, 4vh, 2rem); }
[data-page="leak"] .leak-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[data-page="leak"] .devices { margin-top: 2.75rem; }

/* Meer opties (computer): rustige knop, daaronder extra schakelaars en leestekens als vinkjes */
.more-btn { display: inline-flex; align-items: center; gap: .3rem; margin-top: .55rem; padding: .35rem 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: .875rem; cursor: pointer; }
.more-btn:hover { color: var(--ink); }
.more-btn svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s cubic-bezier(.2,.7,.2,1); }
.more-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.adv[hidden], .sym-pick[hidden] { display: none; }
.sym-pick { margin: .6rem 0 .2rem; padding: 0; border: 0; min-width: 0; }
.sym-pick legend { padding: 0; margin-bottom: .5rem; font-size: .875rem; color: var(--muted); }
.sym-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.4rem, 1fr)); gap: .35rem; }
.sym { position: relative; display: grid; place-items: center; height: 2.4rem; border-radius: 9px; box-shadow: inset 0 0 0 1px var(--line-2); font-family: var(--mono); font-size: 1rem; color: var(--muted); cursor: pointer; transition: background-color .15s, color .15s; }
.sym input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.sym:hover { background: var(--soft); }
.sym:has(input:checked) { background: var(--ink); color: var(--bg); box-shadow: none; }
.sym:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .more-btn svg { transition: none; } }

/* Betaalvenster na Mollie: alleen een kort bericht in het midden */
.venster-page { display: grid; place-items: center; min-height: 100vh; margin: 0; text-align: center; }

/* Snelkeuze boven de leestekens */
.sym-presets { display: flex; gap: .4rem; margin-bottom: .55rem; }
.sym-presets .chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

a.chip { text-decoration: none; }

/* Namenpagina: thema-koppen met aantal */
.names-page h2 .names-count { margin-left: .35rem; font-size: .8125rem; font-weight: 500; color: var(--muted); }
.names-page .legal-date { margin-top: .4rem; }

/* Zachte overgang tussen pagina's (Chrome, Edge, Samsung Internet, Safari 18.2+; andere browsers laden gewoon).
   De opt-in (@view-transition) staat als kleine inline-style in elke pagina, toegestaan via een hash in de CSP.
   De kop met logo en tandwiel blijft staan; de rest vervaagt kort naar de nieuwe pagina. */
.top { view-transition-name: site-top; }
.theme-swap .top { view-transition-name: none; } /* weergave wisselen: alles in één laag, dus onder de dialoog */
::view-transition-old(root) { animation: vt-out .16s ease-in both; }
::view-transition-new(root) { animation: vt-in .26s cubic-bezier(.2,.7,.2,1) both; }
::view-transition-group(site-top) { animation-duration: .26s; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* Namenpagina: zwevende themakeuze bovenaan tijdens het scrollen */
.names-cats { position: sticky; top: 0; z-index: 5; display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none;
  margin: 1rem -1.25rem 0; padding: .6rem 1.25rem; background: var(--bg); transition: box-shadow .2s; }
.names-cats::-webkit-scrollbar { display: none; }
.names-cats[hidden] { display: none; }
.names-cats.is-stuck { box-shadow: 0 1px 0 var(--line); }
.names-cats .chip { flex: none; }
.names-cats .chip[aria-current="true"] { background: var(--ink); color: var(--bg); }
.names-group h2 { scroll-margin-top: 4rem; }
/* Mobiel: zachte vervaging rechts als hint dat er meer thema's zijn om naartoe te vegen (verdwijnt aan het eind) */
.names-cats.has-more { -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); }

/* Statistieken (afgeschermde overzichtspagina) */
.stats-page { width: min(100% - 2.5rem, 46rem); }
.stats-demo { margin-top: .8rem; padding: .6rem .8rem; border-radius: 10px; background: var(--soft); font-size: .875rem; color: var(--ink-2); }
.stats-table table { width: 100%; border-collapse: collapse; font-size: .9375rem; font-variant-numeric: tabular-nums; }
.stats-page .stats-table table { display: table; width: 100%; }
.stats-page .stats-table thead { display: table-header-group; }
.stats-page .stats-table tbody { display: table-row-group; }
.stats-page .stats-table tr { display: table-row; padding: 0; border: 0; }
.stats-page .stats-table th, .stats-page .stats-table td { display: table-cell; }
.stats-page .stats-table td::before { display: none; }
.stats-table th, .stats-table td { padding: .5rem .5rem .5rem 0; border-bottom: 1px solid var(--line); text-align: right; color: var(--ink-2); }
.stats-table th:first-child, .stats-table td:first-child { text-align: left; color: var(--ink); font-weight: 500; font-size: .9375rem; }
.stats-table th { font-size: .75rem; font-weight: 600; color: var(--muted); }
.stats-table td:last-child, .stats-table th:last-child { text-align: right; }
.stats-table .spark { display: inline-block; vertical-align: middle; }
.stats-scroll { overflow-x: auto; margin-top: .4rem; }
.heatmap { display: block; max-width: none; }
/* grafieken: geen lijnen zoals bij iconen, alleen vlakken en tekst */
.heatmap, .heatmap *, .spark, .spark * { stroke: none; }
.hm-label { font: 500 9px var(--sans); fill: var(--muted); }
@media (max-width: 560px) { .stats-table th:nth-child(2), .stats-table td:nth-child(2) { display: none; } }
.heatmap .c0 { fill: #eef1f0; } .heatmap .c1 { fill: #cfe9dc; } .heatmap .c2 { fill: #9fd8bb; }
.heatmap .c3 { fill: #5fbe92; } .heatmap .c4, .spark .c4 { fill: #1fa56c; } .heatmap .c5 { fill: #00824f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .heatmap .c0 { fill: #23262c; } :root:not([data-theme="light"]) .heatmap .c1 { fill: #1d3a2e; } :root:not([data-theme="light"]) .heatmap .c2 { fill: #1f5a40; } :root:not([data-theme="light"]) .heatmap .c3 { fill: #1d7d52; } :root:not([data-theme="light"]) .heatmap .c5 { fill: #3ccb7f; } }
:root[data-theme="dark"] .heatmap .c0 { fill: #23262c; } :root[data-theme="dark"] .heatmap .c1 { fill: #1d3a2e; } :root[data-theme="dark"] .heatmap .c2 { fill: #1f5a40; } :root[data-theme="dark"] .heatmap .c3 { fill: #1d7d52; } :root[data-theme="dark"] .heatmap .c5 { fill: #3ccb7f; }
/* Statistieken: kerncijfers, verdelingen en klikkaart */
.stats-key { display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; margin-top: 1.2rem; font-size: .9375rem; color: var(--muted); }
.stats-key b { display: block; font-size: 1.5rem; font-weight: 650; color: var(--ink); letter-spacing: -.02em; }
.stats-page table.dist { display: table; width: 100%; margin-top: .6rem; border-collapse: collapse; font-size: .9375rem; font-variant-numeric: tabular-nums; }
.stats-page table.dist tbody { display: table-row-group; }
.stats-page table.dist tr { display: table-row; padding: 0; border: 0; }
.stats-page table.dist td { display: table-cell; padding: .35rem .6rem .35rem 0; border: 0; border-bottom: 1px solid var(--line); color: var(--ink-2); font-weight: 400; font-size: .9375rem; }
.stats-page table.dist td::before { display: none; }
.stats-page table.dist td:first-child { width: 42%; color: var(--ink); }
.stats-page table.dist td:nth-child(3), .stats-page table.dist td:nth-child(4) { text-align: right; width: 4.5rem; }
.stats-page table.dist td:nth-child(4) { color: var(--muted); width: 3.5rem; }
.stats-page table.dist + table.dist { margin-top: 1rem; }
.bar { display: block; width: 100%; max-width: 160px; }
.bar, .bar * { stroke: none; }
.bar .c0 { fill: var(--soft); }
.bar .c4 { fill: #1fa56c; }
.clickmaps { margin-top: .8rem; }
.clickmaps figure { margin: .8rem 0 0; }
.cm-tabs { flex-wrap: wrap; }
/* Tabs zonder JavaScript: alleen de kaart van de gekozen tab tonen */
.clickmaps .cm { display: none; }
.clickmaps:has(input[value="accounts"]:checked) .cm[data-cm="accounts"], .clickmaps:has(input[value="tv"]:checked) .cm[data-cm="tv"],
.clickmaps:has(input[value="wifi"]:checked) .cm[data-cm="wifi"], .clickmaps:has(input[value="smart"]:checked) .cm[data-cm="smart"],
.clickmaps:has(input[value="leak"]:checked) .cm[data-cm="leak"] { display: block; }
.clickmap { display: block; width: 100%; height: auto; border-radius: 14px; box-shadow: 0 0 0 1px var(--line); }
.clickmap circle.spot { stroke: #fff; stroke-width: 2; opacity: .82; }
.clickmap .c1 { fill: #9fd8bb; } .clickmap .c2 { fill: #5fbe92; } .clickmap .c3 { fill: #1fa56c; } .clickmap .c4 { fill: #00824f; } .clickmap .c5 { fill: #005c38; }
.clickmap .spot-n { font: 700 12px var(--sans); fill: #fff; text-anchor: middle; stroke: none; }
@media (max-width: 560px) { .stats-page table.dist td:first-child { width: 48%; } .bar { max-width: 90px; } }

/* Wifi: keuze nieuw of eigen wachtwoord, en het veld voor je eigen wachtwoord */
.wifi-source { margin: .2rem 0 .4rem; }
.own-input { margin-top: .45rem; }
.own-input input { flex: 1; width: 0; min-width: 0; height: 2.875rem; padding: 0 2.875rem 0 .9rem; border: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--control); background: var(--bg); color: var(--ink); outline: none; font-family: var(--mono); font-size: 1rem; }
.own-input input:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); }
.own-input input::placeholder { font-family: var(--sans); color: var(--muted); }
.pw.is-empty { font-family: var(--sans); font-size: 1.05rem; color: var(--muted); }
.own-label { font-size: .875rem; color: var(--muted); }

/* Rijen in een paneel die verborgen zijn, echt verbergen (de grid/flex-stijl van .row zou hidden anders overschrijven) */
.panel [hidden] { display: none !important; }

/* Eigen wifi-wachtwoord: geen wachtwoordvak bovenaan, de keuze en het invulveld staan bovenaan de kaart */
.result.is-own > .pw, .result.is-own > .result-bar { display: none; }
.result.is-own .settings { margin-top: 0; }
.result.is-own .panel[data-for="wifi"] { border-top: 0; }
.result.is-own .wifi-source { margin-top: 0; }

/* Links in lopende tekst (uitleg lekcheck, vragen op de lekcheckpagina): zelfde stijl als in privacy en voorwaarden */
.info-body a, .leak-faq a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--muted); }
.info-body a:hover, .leak-faq a:hover { text-decoration-color: currentColor; }

/* Grotere aanraakvlakken (minstens 24px, WCAG 2.5.8) zonder dat tekst of opmaak verschuift */
.foot-nav a, .foot-legal a { padding: .4rem .3rem; margin: -.4rem -.3rem; }
.leak-how { padding: .4rem .25rem; margin: -.4rem -.25rem; }
.brand-by a { padding: .35rem .2rem; margin: -.35rem -.2rem; }
/* Eigen wifi-wachtwoord te kort: rand in de foutkleur */
.own-input input[aria-invalid="true"] { box-shadow: inset 0 0 0 1px var(--bad); }

/* Heel smal (zoals 200% zoom op een telefoon): logo krimpt mee, tabs in twee rijen */
@media (max-width: 300px) {
  .top { grid-template-columns: minmax(0, 1fr) auto; }
  .top .prefs { grid-area: 1 / 2; }
  .logo img { width: 100%; }
  .devices { display: grid; grid-template-columns: 1fr 1fr; }
  .result-actions { width: 100%; min-width: 0; }
  .result-actions .btn { min-width: 0; padding-inline: .6rem; }
  .result-actions .btn svg { display: none; } /* tekst krijgt voorrang */
}

/* Uitleg onder de tool: rustig, dezelfde opmaak als de vragen op de lekcheckpagina */
.guide { margin-top: 2.6rem; padding-top: .4rem; border-top: 1px solid var(--line); }
.guide h2:first-child { margin-top: 1.4rem; }

/* Wifi op mobiel: vijf woorden lopen vaak over twee regels; die ruimte vooraf reserveren zodat de pagina niet verspringt */
html[data-mode="wifi"] .pw { font-size: clamp(1.2rem, 5.2vw, 1.85rem); } /* zelfde maat als het wifi-wachtwoord, al vóór het laden */
@media (max-width: 479px) { html[data-mode="wifi"] .pw { min-height: 2.56em; } }
