:root {
  color-scheme: light;
  --paper: #e7e1d6;
  --paper-2: #efeae2;
  --card: #f7f4ef;
  --ink: #1c1915;
  --muted: #5c564c;
  --line: #d9d0c3;
  --accent: #1f6b4a;
  --accent-soft: #e5f0ea;
  --clay: #9a3412;
  --clay-soft: #f6ebe3;
  --copper: #c4491d;
  --gekozen: #e7f2ec;
  --fout: #7f1d1d;
  --fout-soft: #f8e6e4;
  --schaduw: 0 1px 0 rgba(28, 25, 21, 0.04);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Segoe UI", system-ui, sans-serif;
  --afname: #1f4f42;
  --injectie: #c4491d;
  --piek: #8a8175;
  --piek-met: #1f6b4a;
  --minlijn: #9a3412;
  --grid: rgba(28, 25, 21, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #141311;
    --paper-2: #1a1916;
    --card: #221f1b;
    --ink: #f3efe7;
    --muted: #b7afa3;
    --line: #3a342c;
    --accent: #3dbe9a;
    --accent-soft: #173328;
    --clay: #e7a07a;
    --clay-soft: #3a261c;
    --copper: #e07a45;
    --gekozen: #1c3329;
    --fout: #ffb4a8;
    --fout-soft: #3c2422;
    --schaduw: none;
    --afname: #8fd0c0;
    --injectie: #e07a45;
    --piek: #b7afa3;
    --piek-met: #3dbe9a;
    --minlijn: #e7a07a;
    --grid: rgba(243, 239, 231, 0.08);
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.5;
}

.breed {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.kop {
  padding: 1.75rem 0 1.25rem;
  border-top: 8px solid var(--copper);
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}

.kicker {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.titelrij {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.merk {
  width: 48px;
  height: 48px;
  flex: none;
  color: var(--ink);
}

h1, h2, legend, summary {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.05;
}

h2 {
  margin: 0 0 0.75rem;
  font-size: 1.45rem;
}

.lede {
  max-width: 42rem;
  margin: 0.9rem 0 0;
  font-size: 1.12rem;
}

.privacy {
  max-width: 46rem;
  margin: 1rem 0 0;
  padding: 0.75rem 0.9rem;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  color: var(--ink);
}

main { padding: 1.25rem 0 3rem; }

.layout {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.kolom-invoer,
.kolom-resultaat {
  display: grid;
  gap: 1rem;
  align-content: start;
  min-width: 0;
}

.kolom-invoer { overflow: clip; }

#uitkomst {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.kaart {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.05rem 1.1rem;
  box-shadow: var(--schaduw);
  min-width: 0;
  max-width: 100%;
}

.toelichting {
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.toelichting a {
  color: var(--accent);
}

.dropzone {
  position: relative;
  display: grid;
  gap: 0.2rem;
  justify-items: center;
  padding: 1.4rem 1rem;
  border: 1.5px dashed var(--copper);
  border-radius: 10px;
  background: var(--clay-soft);
  text-align: center;
  cursor: pointer;
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone:focus-within,
.dropzone.is-drag {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  background: var(--accent-soft);
}

.dropzone.is-geladen {
  padding: 0.7rem 0.85rem;
  background: transparent;
}

.drop-titel {
  font-family: var(--serif);
  font-size: 1.2rem;
}

.dropzone.is-geladen .drop-titel { font-size: 1.05rem; }

.drop-of { color: var(--muted); font-size: 0.92rem; }

.status {
  display: grid;
  gap: 0.12rem;
  min-height: 1.4em;
  min-width: 0;
  margin: 0.7rem 0 0;
  font-size: 0.95rem;
}

.bestandsnaam {
  font-weight: 650;
  overflow-wrap: anywhere;
}

.bestandmeta { color: var(--muted); font-size: 0.88rem; }

.fout {
  margin: 0.7rem 0 0;
  padding: 0.7rem 0.8rem;
  background: var(--fout-soft);
  color: var(--fout);
  border-radius: 8px;
}

.kwaliteit {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.85rem;
  min-width: 0;
  font-size: 0.95rem;
}

.kwaliteit p { margin: 0; overflow-wrap: anywhere; }

.feit { display: grid; gap: 0.05rem; }

.feit-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.feit-waarde { font-variant-numeric: tabular-nums; }

.kwaliteit .noot {
  color: var(--muted);
  font-size: 0.88rem;
}

.velden {
  display: grid;
  gap: 0.7rem;
}

.veld {
  display: grid;
  gap: 0.25rem;
  font-size: 0.92rem;
}

.hint {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.invoer {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

input, select {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink);
  font: inherit;
  font-variant-numeric: tabular-nums;
}

.invoer input { flex: 1; }

.eenheid {
  flex: none;
  color: var(--muted);
  font-size: 0.85rem;
  min-width: 5.2rem;
}

input[aria-invalid="true"] {
  border-color: var(--clay);
  background: var(--fout-soft);
}

.prijzen {
  margin: 0.9rem 0 0;
  padding: 0.75rem 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}

legend { padding: 0 0.3rem; }

.stappen {
  margin: 0;
  padding-left: 1.2rem;
}

.stappen li + li { margin-top: 0.45rem; }

.periode {
  margin: 0 0 0.8rem;
  font-family: var(--serif);
  font-size: 1.15rem;
}

.kerncijfers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.75rem, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.kern {
  padding: 0.7rem 0.75rem;
  background: var(--paper-2);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.kern span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.kern strong {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.tabel-wrap {
  overflow-x: auto;
  max-width: 100%;
  overscroll-behavior-x: contain;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
}

th, td {
  padding: 0.55rem 0.65rem;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: var(--card);
}

th:first-child, td:first-child { text-align: left; }

th {
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0.01em;
  line-height: 1.25;
  white-space: normal;
  vertical-align: bottom;
}

tbody tr { cursor: pointer; }

tbody tr:hover td { background: var(--paper-2); }

tr.is-gekozen td { background: var(--gekozen); }

th:first-child, td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--card);
}

thead th:first-child { z-index: 2; }

tbody tr:hover td:first-child { background: var(--paper-2); }
tr.is-gekozen td:first-child {
  background: var(--gekozen);
  box-shadow: inset 3px 0 0 var(--accent);
}

.naam { font-weight: 650; }
.sub { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 450; }
.positief { color: var(--accent); }
.lang { color: var(--clay); }

.grafiek-wrap { height: 240px; }

.conclusie p { margin: 0 0 0.75rem; }
.conclusie p:last-child { margin-bottom: 0; }

.waarschuwingen ul {
  margin: 0;
  padding-left: 1.15rem;
}

.waarschuwingen li + li { margin-top: 0.55rem; }

details summary {
  cursor: pointer;
  font-size: 1.2rem;
}

details p, details .tabel-wrap { margin-top: 0.8rem; }

.voet {
  padding: 0 0 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.visueel-verborgen {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.noscript {
  width: min(1120px, calc(100% - 2rem));
  margin: 1rem auto;
  padding: 0.8rem;
  background: var(--fout-soft);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (min-width: 900px) {
  .layout {
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    align-items: start;
  }

  .grafiek-wrap { height: 300px; }

  .kern strong { font-size: 1.6rem; }
}

@media (max-width: 640px) {
  .breed { width: min(1120px, calc(100% - 1.25rem)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  .kop { border-top-color: #000; }
  .dropzone, .voet, .kolom-invoer { display: none; }
  .layout { display: block; }
  .kaart { break-inside: avoid; }
  body { background: #fff; }
}
