/* Digizap pocket knife — one stylesheet for every tool.

   Dag en nacht in één set variabelen: elk paar staat als `light-dark(dag, nacht)` en de browser
   kiest de kant op de instelling van het systeem. Het icoon rechts naast het zoekveld kan die
   keuze expliciet maken — dan zet `data-theme` op de html een `color-scheme`, en `light-dark()`
   volgt die gedwongen kleurstand mee. Eerst staat er een kale dagwaarde: browsers zonder
   `light-dark()` (older dan 2024) vallen daarop terug en zien het dagthema in plaats van iets kapots. */

:root {
  color-scheme: light dark;

  --blue: #0b5fff;
  --blue: light-dark(#0b5fff, #5b9bff);
  --blue-dark: #0847bd;
  --blue-dark: light-dark(#0847bd, #7fb0ff);
  --ink: #0d1117;
  --ink: light-dark(#0d1117, #e6edf3);
  --muted: #5a6674;
  --muted: light-dark(#5a6674, #97a3b4);
  --bg: #fbfcfe;
  --bg: light-dark(#fbfcfe, #0b1220);
  --panel: #ffffff;
  --panel: light-dark(#ffffff, #151d2b);
  --surface: #ffffff;
  --surface: light-dark(#ffffff, #101826);
  --wash: #f6f8fb;
  --wash: light-dark(#f6f8fb, #1b2434);
  --line: #e3e8ef;
  --line: light-dark(#e3e8ef, #2b3648);
  --line-strong: #cfd8e3;
  --line-strong: light-dark(#cfd8e3, #3a4658);
  --line-accent: #c9d9f7;
  --line-accent: light-dark(#c9d9f7, #2c4a7c);
  --tint: #eef4ff;
  --tint: light-dark(#eef4ff, #1d2b45);
  --fail: #e11d48;
  --fail: light-dark(#e11d48, #ff8fa3);
  --warn: #d97706;
  --warn: light-dark(#d97706, #f5b04c);
  --pass: #16a34a;
  --pass: light-dark(#16a34a, #5ecb8a);
  --neutral: #9aa4b2;
  --neutral: light-dark(#9aa4b2, #7c8798);
  --fail-bg: #fff1f2;
  --fail-bg: light-dark(#fff1f2, #2a1420);
  --fail-ink: #9f1239;
  --fail-ink: light-dark(#9f1239, #ffb3c1);
  --warn-bg: #fffbeb;
  --warn-bg: light-dark(#fffbeb, #2b2110);
  --warn-ink: #8a5a06;
  --warn-ink: light-dark(#8a5a06, #f7c878);
  --pass-bg: #ecfdf3;
  --pass-bg: light-dark(#ecfdf3, #12271c);
  --pass-ink: #10613a;
  --pass-ink: light-dark(#10613a, #8fe3b0);
  --mark-bg: #dce9ff;
  --mark-bg: light-dark(#dce9ff, #24344d);
  --del-bg: #ffe3e6;
  --del-bg: light-dark(#ffe3e6, #33161f);
  --del-ink: #8d1424;
  --del-ink: light-dark(#8d1424, #ffa3b1);
  --ins-bg: #dcf5e5;
  --ins-bg: light-dark(#dcf5e5, #142b1e);
  --ins-ink: #0f5c36;
  --ins-ink: light-dark(#0f5c36, #8fe3b0);
  --row-del: #fff5f6;
  --row-del: light-dark(#fff5f6, #1f1520);
  --row-ins: #f2fbf6;
  --row-ins: light-dark(#f2fbf6, #10231a);
  --row-chg: #f7f9ff;
  --row-chg: light-dark(#f7f9ff, #141d2c);
  --code-bg: #0d1117;
  --code-bg: light-dark(#0d1117, #0a111d);
  --code-ink: #e6edf3;
  --code-ink: light-dark(#e6edf3, #dfe7f0);
  /* Inkt op een blauw vlak (knoppen, geselecteerde onderwerp-knop): in het donker wordt het
     blauw lichter en de inkt donker — anders zakt het contrast onder de 4,5 die de tool zelf eis. */
  --on-blue: #ffffff;
  --on-blue: light-dark(#ffffff, #071019);
  --radius: 12px;
}

/* Het icoon naast het zoekveld dwingt hier dezelfde kleurstand af als de variables kiezen;
   `light-dark()`, de scrollbalk en de form controls volgen die gedwongen stand. */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }

/* De ruimte voor de verticale scrollbalk wordt altijd gereserveerd. Zonder die reservering
   verspringt de hele pagina enkele pixels tussen een route die net in het beeld past (website-scan)
   en een route die dat niet doet (e-mail scan, regex-tester): de balk duwt de gecentreerde kolommen. */
html { scrollbar-gutter: stable; }

body {
  margin: 0;
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

a { color: var(--blue); }

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--blue); color: var(--on-blue); padding: 10px 14px;
}
.skip-link:focus { left: 12px; top: 12px; z-index: 20; }

/* header ------------------------------------------------------------------ */

.masthead {
  max-width: 1100px; margin: 0 auto; padding: 24px 22px 14px;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 18px;
}
.brand { display: flex; align-items: baseline; gap: 9px; text-decoration: none; color: var(--ink); }
.brand-mark { font-size: 24px; color: var(--blue); }
.brand-name { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.tagline { flex: 1 1 34ch; margin: 0; color: var(--muted); font-size: 15px; }
.search-row { display: flex; align-items: stretch; gap: 8px; width: min(340px, 100%); }
.tool-search {
  flex: 1 1 auto; min-width: 0; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 10px;
  font: inherit; color: var(--ink); background: var(--surface);
}
.tool-search:focus { outline: 2px solid var(--blue); outline-offset: 1px; }

/* Het thema-icoon: één knop, drie toestanden (volgt het systeem / licht / donker). De svg die
   hoort bij de stand die nu geldt, is zichtbaar. De omlijning is even hoog als het zoekveld
   ernaast: `stretch` geeft de knop de hoogte van de input, en `aspect-ratio` houdt hem vierkant;
   `min-width` is het vangnet voor browsers zonder ratio. De taalknop deelt die maten. */
.theme-toggle,
.lang-toggle {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  align-self: stretch; aspect-ratio: 1; min-width: 40px; padding: 0; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink);
}
.theme-toggle:hover,
.lang-toggle:hover { background: var(--wash); border-color: var(--line-accent); }
.theme-toggle:focus-visible,
.lang-toggle:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.theme-toggle svg { width: 20px; height: 20px; }
/* De taalknop toont de taal die nu op het scherm staat: nl of en. */
.lang-toggle .lang-code { font: inherit; font-weight: 650; font-size: 13px; letter-spacing: 0.04em; }
.theme-toggle .i-sun, .theme-toggle .i-moon { display: none; }
:root[data-theme="light"] .theme-toggle .i-auto, :root[data-theme="dark"] .theme-toggle .i-auto { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: block; }

/* subject menu ------------------------------------------------------------ */

.subject-nav { max-width: 1100px; margin: 0 auto; padding: 0 22px 6px; }

.subject-row { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.subject {
  padding: 8px 15px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 600;
}
.subject:hover { background: var(--wash); border-color: var(--line-accent); }
.subject[aria-current="true"] { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }

.tool-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.tool-row-note { color: var(--muted); font-size: 13px; }
.tool-chip {
  display: inline-flex; flex-direction: column; gap: 2px; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink);
  text-decoration: none; font-size: 14px;
}
.tool-chip small { color: var(--muted); font-size: 12px; }
.tool-chip:hover { background: var(--wash); border-color: var(--line-accent); }
.tool-chip[aria-current="true"] { background: var(--tint); border-color: var(--line-accent); color: var(--blue-dark); font-weight: 600; }
.nav-empty { margin: 10px 0 0; color: var(--muted); font-size: 14px; }

/* the tool itself --------------------------------------------------------- */

.tool-host { max-width: 1100px; margin: 0 auto; padding: 18px 22px 56px; min-height: 60vh; }

.tool-head { margin: 4px 0 18px; }
/* Flits en toolnaam op één regel: het merkteken staat als glyph in de titel zelf, iets kleiner
   dan de titeltekst, met de blauwe kleur van de merk. */
.tool-head h1 { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: clamp(24px, 4vw, 32px); line-height: 1.2; }
.tool-head .brand-mark { font-size: 0.85em; }
.tool-head p { margin: 0; color: var(--muted); max-width: 70ch; }

/* cards and controls ------------------------------------------------------ */

.card {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  padding: 16px 18px; margin: 0 0 16px;
}
.card-title { margin: 0 0 12px; font-size: 17px; }
.card h4 { margin: 16px 0 8px; font-size: 15px; }

.field { display: block; margin: 0 0 12px; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px;
  font: inherit; color: var(--ink); background: var(--surface);
}
.input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
textarea.input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
select.input { padding: 9px 10px; }

.btn {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 10px; padding: 10px 14px;
  border: 1px solid transparent;
}
.btn-primary { background: var(--blue); color: var(--on-blue); }
.btn-primary:hover { background: var(--blue-dark); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--blue-dark); padding: 6px 10px; font-weight: 600; }
.btn:disabled { opacity: 0.6; cursor: progress; }

/* A keyboard user must see where they are; a mouse click does not need the ring. */
.btn:focus-visible, .tool-chip:focus-visible, .subject:focus-visible, .check input:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}
/* The tool head is focused on purpose after navigating, so it needs no ring of its own. */
.tool-head:focus { outline: none; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.checks { display: flex; gap: 6px 14px; flex-wrap: wrap; margin: 0 0 12px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }

.status { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.status-info { background: var(--wash); color: var(--muted); }
.status-error { background: var(--fail-bg); color: var(--fail-ink); border-left: 3px solid var(--fail); }
.status-ok { background: var(--pass-bg); color: var(--pass-ink); border-left: 3px solid var(--pass); }

.hint { color: var(--muted); font-size: 14px; margin: 8px 0 0; max-width: 74ch; }

/* results ----------------------------------------------------------------- */

/* `min(100%, 190px)`: op een smal scherm mag een kolom niet breder zijn dan het scherm zelf,
   en `min-width: 0` houdt een grid-cel in bedwang als de inhoud er breder in is dan de cel. */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 10px; margin: 0; }
.stat { background: var(--wash); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.stat dt { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat dd { margin: 4px 0 0; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
/* Een cipher, een serienummer of een issuer met alle zijn onderdelen is lang en kent geen
   breekpunt: die waarden krijgen een smaller monospace-lettertype zodat ze in hun cel passen. */
.stat dd.stat-long { font-size: 13px; font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 0 0 8px; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.table td.mono, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; overflow-wrap: anywhere; }
/* A table full of URLs needs a scroll box on a narrow screen instead of a broken layout. */
.table-scroll { overflow-x: auto; }

.findings { list-style: none; margin: 0; padding: 0; }
.finding { padding: 10px 12px; border-radius: 10px; margin-bottom: 8px; background: var(--wash); border-left: 3px solid var(--neutral); }
.finding b { display: block; font-size: 14px; }
.finding small { color: var(--muted); }
.finding-fail { background: var(--fail-bg); border-left-color: var(--fail); }
.finding-warn { background: var(--warn-bg); border-left-color: var(--warn); }
.finding-pass { background: var(--pass-bg); border-left-color: var(--pass); }

.copyable { display: flex; gap: 10px; align-items: start; }
.copyable pre {
  flex: 1; margin: 0; padding: 10px 12px; background: var(--code-bg); color: var(--code-ink); border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; overflow: auto; max-height: 320px;
  overflow-wrap: anywhere; white-space: pre-wrap;
}

.mark-hit { background: var(--mark-bg); border-radius: 4px; padding: 0 2px; }
pre.preview {
  white-space: pre-wrap; overflow-wrap: anywhere; background: var(--wash); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
}

.results { margin-top: 8px; }

/* colofon ----------------------------------------------------------------- */

/* Eén regel handtekening onder de pagina: geen linkblok, geen verkoopverhaal. */
.page-footer { max-width: 1100px; margin: 0 auto; padding: 0 22px 26px; color: var(--muted); font-size: 13px; }
.page-footer p { margin: 0; padding-top: 12px; border-top: 1px solid var(--line); text-align: center; }
/* De enige link die de handtekening mag dragen: wijzen naar de eigen documentatie is geen verkoop. */
.page-footer a { color: var(--muted); text-decoration: none; }
.page-footer a:hover, .page-footer a:focus-visible { color: var(--blue); text-decoration: underline; }

/* diff en contrast --------------------------------------------------------- */

/* Tekstvergelijking markt woorden, niet alleen regels. */
.mark-del { background: var(--del-bg); color: var(--del-ink); border-radius: 4px; padding: 0 2px; text-decoration: line-through; }
.mark-ins { background: var(--ins-bg); color: var(--ins-ink); border-radius: 4px; padding: 0 2px; }
.diff-cell { display: block; white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.row-removed { background: var(--row-del); }
.row-added { background: var(--row-ins); }
.row-changed { background: var(--row-chg); }

/* Kleurcontrast: twee vakken die de combinatie echt laten zien. De vakken zelf zijn neutralen —
   de tool die erin rekent, tekent zijn eigen paar. */
.swatch { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 0 0 10px; background: var(--panel); }
.swatch p { margin: 0; font-size: 18px; font-weight: 700; }
.swatch small { display: block; margin-top: 6px; font-size: 13px; font-weight: 400; }
.swatch-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }

@media (max-width: 700px) {
  .masthead { padding: 18px 16px 12px; }
  .subject-nav { padding: 0 16px 6px; }
  .tool-host { padding: 16px 16px 44px; }
  .page-footer { padding: 0 16px 22px; }
  .search-row { width: 100%; }
  .subject { font-size: 14px; padding: 7px 13px; }
}

/* ---- API-documentatiepagina (src/openapi.mjs) ----
   Server-side gerenderd, dus alle stijlen leven hier in de sheet en niet in de panelen:
   alles blijft gescoped onder .docs zodat de tool-interfaces byte-identical blijven. */

.docs-lang-switch { margin: 0 0 0 auto; font-size: 14px; }
.docs-lang-switch a { color: var(--blue); text-decoration: none; }
.docs-lang-switch a:hover { text-decoration: underline; }

.docs { max-width: 900px; margin: 0 auto; padding: 10px 22px 44px; color: var(--ink); }
.docs h1 { font-size: 26px; margin: 0 0 10px; }
.docs h2 { font-size: 19px; margin: 30px 0 8px; }
.docs h3 { font-size: 16px; margin: 0 0 6px; }
.docs p, .docs li { line-height: 1.55; font-size: 15px; }
.docs a { color: var(--blue); }
.docs code {
  background: var(--wash); border: 1px solid var(--line); border-radius: 6px;
  padding: 1px 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em;
}
.docs-rules { margin: 0; padding-left: 22px; }
.docs-rules li { margin: 7px 0; }

.docs-endpoint {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin: 14px 0;
}
.docs-endpoint table { border-collapse: collapse; width: 100%; margin: 10px 0 0; font-size: 14px; }
.docs-endpoint th, .docs-endpoint td { text-align: left; border-bottom: 1px solid var(--line); padding: 6px 8px; vertical-align: top; }
.docs-endpoint th { color: var(--muted); font-weight: 600; }
.docs-endpoint tr:last-child td { border-bottom: none; }

.docs-example { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.docs-example dfn { font-style: normal; }
.docs-limit { margin: 8px 0 0; color: var(--muted); font-size: 14px; }

@media (max-width: 640px) {
  .docs { padding: 8px 16px 34px; }
  .docs-lang-switch { margin: 0; }
}
