/* EnergieTeller – één stylesheet, geen framework. Mobile-first. */
:root {
  --bg: #f3f5f4;
  --surface: #ffffff;
  --ink: #1d2b33;
  --muted: #4f5d66;
  --line: #d3dadb;
  --accent: #0b5f6e;
  --accent-ink: #ffffff;
  --accent-soft: #e2eff1;
  --elec: #d99a16;
  --elec-ink: #7a5200;
  --gas: #2f5fd0;
  --dyn: #6b4fa0;
  --ode: #9aa7ad;
  --meter: #22282c;
  --meter-digit: #f3f5f4;
  --meter-red: #b3261e;
  --error: #b3261e;
  --focus: #f2b705;
  --radius-s: 4px;
  --radius-m: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --measure: 70ch;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font);
  font-variant-numeric: tabular-nums;
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
main:focus { outline: none; }

.wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1.125rem; }
main .wrap { padding-top: 1rem; padding-bottom: 3rem; }
main .wrap > :is(p, ul, ol, dl, h1, h2, h3, .note) { max-width: var(--measure); }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 10; }
.skip:focus { left: 0.5rem; top: 0.5rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 1.4rem + 2.4vw, 2.9rem); font-weight: 750; margin: 0.5rem 0 1rem; letter-spacing: -0.025em; }
h2 { font-size: 1.5rem; font-weight: 700; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.15rem; font-weight: 650; margin: 1.75rem 0 0.5rem; }
.lead { font-size: 1.2rem; color: var(--ink); max-width: 62ch; }
.hint, .source, .reviewed, .meter-note { color: var(--muted); font-size: 0.9rem; }
.note { background: var(--surface); border-left: 4px solid var(--accent); padding: 0.75rem 1rem; border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.source { margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.source a { color: var(--muted); }
.reviewed { margin-top: 3rem; border-top: 1px solid var(--line); padding-top: 1rem; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 3.5rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; font-weight: 750; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand-mark { width: 30px; height: 22px; }
.brand-mark rect:first-child { fill: var(--meter); }
.brand-mark .d { fill: var(--meter-digit); }
.brand-mark .r { fill: var(--meter-red); }
.lang { display: flex; gap: 0.4rem; align-items: center; font-weight: 600; font-size: 0.95rem; color: var(--muted); }
.lang a, .lang span[aria-current] { padding: 0.35rem 0.4rem; min-width: 2.25rem; text-align: center; }
.lang span[aria-current] { color: var(--ink); border-bottom: 2px solid var(--ink); }
.mainnav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: none; }
.mainnav ul::-webkit-scrollbar { display: none; }
.mainnav a { display: block; white-space: nowrap; padding: 0.6rem 0.7rem; color: var(--ink); text-decoration: none; font-weight: 550; font-size: 0.95rem; border-bottom: 3px solid transparent; }
.mainnav a:hover { border-bottom-color: var(--line); }
.mainnav a[aria-current] { border-bottom-color: var(--accent); color: var(--accent); }

.crumbs ol { list-style: none; padding: 0; margin: 0.5rem 0 0; display: flex; flex-wrap: wrap; font-size: 0.875rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin: 0 0.45rem; color: var(--line); }
.crumbs a { color: var(--muted); }

/* Hero met meterdisplay */
.hero { display: grid; gap: 2rem; padding: 1rem 0 1.5rem; align-items: center; }
.hero-text h1 { margin-top: 0.5rem; }
.hero-meters { display: grid; gap: 1rem; }
.meter { margin: 0; }
.meter-face { display: inline-flex; align-items: center; gap: 4px; background: var(--meter); padding: 10px 12px; border-radius: var(--radius-m); box-shadow: inset 0 0 0 2px #3a4247; }
.drum {
  font: 600 clamp(1.6rem, 1.2rem + 2vw, 2.4rem)/1 var(--font-num);
  color: var(--meter-digit); width: 1.2em; padding: 0.3em 0; text-align: center; border-radius: 3px;
  background: linear-gradient(#15191c, #2d3439 45%, #2d3439 55%, #15191c);
}
.drum.lead { color: #7d878d; }
.drum.red { background: linear-gradient(#7c1a15, var(--meter-red) 45%, var(--meter-red) 55%, #7c1a15); }
.meter-unit { color: var(--meter-digit); font-weight: 600; margin-left: 0.5rem; font-size: 1rem; }
.meter figcaption { font-weight: 600; margin-top: 0.4rem; }
@media (prefers-reduced-motion: no-preference) {
  .meter-face .drum:not(.lead) { animation: roll 700ms cubic-bezier(.2,.8,.2,1) both; }
  .meter-face .drum:nth-child(2) { animation-delay: 60ms; } .meter-face .drum:nth-child(3) { animation-delay: 120ms; }
  .meter-face .drum:nth-child(4) { animation-delay: 180ms; } .meter-face .drum:nth-child(5) { animation-delay: 240ms; }
  @keyframes roll { from { transform: translateY(-35%); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* Taken en onderwerpen */
.tasks { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.75rem; }
.tasks a { display: block; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 1rem 1.1rem; text-decoration: none; color: var(--ink); }
.tasks a:hover { border-color: var(--accent); }
.task-q { display: block; font-weight: 650; font-size: 1.08rem; line-height: 1.35; }
.task-t { display: block; color: var(--accent); margin-top: 0.35rem; font-size: 0.95rem; text-decoration: underline; text-underline-offset: 0.15em; }
.topics, .related ul { list-style: none; padding: 0; margin: 0.5rem 0; display: grid; gap: 0; }
.topics li, .related li { border-top: 1px solid var(--line); padding: 0.7rem 0; display: grid; gap: 0.1rem; }
.topics a, .related a { font-weight: 650; }
.topics span, .related span { color: var(--muted); font-size: 0.95rem; }
.related { margin-top: 2.5rem; max-width: var(--measure); }
.related h2 { font-size: 1.2rem; }

/* Knoppen */
.btn, .btn-secondary, .btn-link { font: inherit; cursor: pointer; }
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: var(--radius-s); padding: 0.7rem 1.15rem; font-weight: 650; text-decoration: none; min-height: 44px; }
.btn:hover { background: #084b57; }
.btn-lg { font-size: 1.1rem; padding: 0.85rem 1.4rem; }
.btn-secondary { background: var(--accent-soft); color: var(--accent); border: 1px solid #b7d4d9; border-radius: var(--radius-s); padding: 0.55rem 0.9rem; font-weight: 600; min-height: 44px; }
.btn-link { background: none; border: 0; color: var(--accent); text-decoration: underline; padding: 0.7rem 0.5rem; min-height: 44px; }

/* Rekenhulp */
.calc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 1.1rem; margin: 1.5rem 0; max-width: 46rem; }
.calc-form fieldset { border: 0; border-top: 1px solid var(--line); padding: 1rem 0 0; margin: 1rem 0 0; min-width: 0; }
.calc-form legend { font-weight: 700; font-size: 1.05rem; padding: 0; }
.field { margin: 0.9rem 0; }
.field > label { display: block; font-weight: 600; margin-bottom: 0.2rem; }
.field .hint { margin: 0 0 0.35rem; }
.input-unit { display: flex; align-items: stretch; max-width: 100%; }
.w-m { width: 16rem; } .w-s { width: 13rem; }
input[type="text"], input[type="date"], select {
  font: inherit; color: var(--ink); background: #fff; border: 2px solid #6d7a82; border-radius: var(--radius-s);
  padding: 0.5rem 0.6rem; min-height: 44px; width: 100%;
}
select { width: auto; min-width: 10rem; }
input[type="date"] { width: 13rem; max-width: 100%; }
.input-unit input { border-top-right-radius: 0; border-bottom-right-radius: 0; min-width: 0; flex: 1; }
.unit { display: flex; align-items: center; padding: 0 0.6rem; background: var(--bg); border: 2px solid #6d7a82; border-left: 0; border-radius: 0 var(--radius-s) var(--radius-s) 0; color: var(--muted); white-space: nowrap; font-size: 0.9rem; }
input[aria-invalid="true"] { border-color: var(--error); }
.field.has-error { border-left: 4px solid var(--error); padding-left: 0.75rem; }
.error { color: var(--error); font-weight: 600; margin: 0 0 0.3rem; }
.read { color: var(--muted); font-size: 0.875rem; margin: 0.25rem 0 0; min-height: 0; }
.read:empty { display: none; }
.check { display: grid; grid-template-columns: auto 1fr; gap: 0.1rem 0.6rem; align-items: start; }
.check input { width: 1.4rem; height: 1.4rem; margin: 0.15rem 0 0; accent-color: var(--accent); }
.check label { font-weight: 500; }
.check .hint { grid-column: 2; }
.fill { margin: 0.25rem 0 0.5rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1.25rem; }
.error-summary { border: 3px solid var(--error); padding: 0.75rem 1rem; border-radius: var(--radius-s); margin-bottom: 1rem; }
.error-summary-title { font-weight: 700; margin: 0 0 0.25rem; }
.error-summary ul { margin: 0; padding-left: 1.2rem; }
.error-summary a { color: var(--error); font-weight: 600; }
.notice { background: #fff7e0; border-left: 4px solid var(--elec); padding: 0.75rem 1rem; }

.result { margin-top: 1.5rem; border-top: 3px solid var(--ink); padding-top: 1rem; }
.result:focus { outline: none; }
.result-title { margin-top: 0; }
.big { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; margin: 0.5rem 0 1rem; }
.big div { display: grid; }
.big .v { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.3rem); font-weight: 750; letter-spacing: -0.02em; line-height: 1.1; }
.big .k { color: var(--muted); font-size: 0.9rem; }
.warn { background: #fff7e0; border-left: 4px solid var(--elec); padding: 0.6rem 0.9rem; margin: 0.75rem 0; }

/* Tabellen */
.table-scroll, .chart-scroll { overflow-x: auto; margin: 1rem 0 0.25rem; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; background: var(--surface); font-size: 0.95rem; }
caption { text-align: left; font-weight: 650; padding: 0 0 0.5rem; caption-side: top; }
th, td { padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { border-bottom: 2px solid var(--ink); font-weight: 650; font-size: 0.875rem; }
tbody th { font-weight: 500; }
.num { text-align: right; white-space: nowrap; }
table.compact { font-size: 0.875rem; }
table.compact th, table.compact td { padding: 0.35rem 0.6rem; }
table.calc-lines { max-width: 42rem; }
table.calc-lines tr.total th, table.calc-lines tr.total td { font-weight: 750; border-top: 2px solid var(--ink); }
table.figures td:last-child { color: var(--muted); font-size: 0.875rem; }
.table-details { margin: 0.75rem 0; }
.table-details summary { cursor: pointer; color: var(--accent); font-weight: 600; padding: 0.4rem 0; min-height: 44px; display: flex; align-items: center; }
dl.defs dt { font-weight: 650; margin-top: 0.8rem; }
dl.defs dd { margin: 0.1rem 0 0; }
ul.formula { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0.75rem 1rem 0.75rem 2rem; font-family: var(--font-num); font-size: 0.9rem; }

/* Grafieken */
.chart { display: block; width: 100%; min-width: 520px; height: auto; background: var(--surface); }
.chart .grid { stroke: #e3e8e9; stroke-width: 1; }
.chart .axis { stroke: var(--ink); stroke-width: 1.5; }
.chart .tick { fill: var(--muted); font: 12px var(--font); }
.chart .line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.elec { stroke: var(--elec); } .chart .dot.elec { fill: var(--elec); }
.chart .line.gas { stroke: var(--gas); } .chart .dot.gas { fill: var(--gas); }
.chart .line.dyn { stroke: var(--dyn); } .chart .dot.dyn { fill: var(--dyn); }
.chart .line.dashed { stroke-dasharray: 6 4; }
.chart .marker line { stroke: var(--muted); stroke-dasharray: 3 3; }
.chart .marker text { fill: var(--muted); font: 12px var(--font); }
.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; font-size: 0.875rem; color: var(--muted); margin: 0.4rem 0; }
.key::before { content: ""; display: inline-block; width: 1.4em; height: 0.35em; border-radius: 2px; margin-right: 0.45em; vertical-align: middle; background: currentColor; }
.key.elec::before { background: var(--elec); } .key.gas::before { background: var(--gas); } .key.ode::before { background: var(--ode); }
.key.dyn::before { background: repeating-linear-gradient(90deg, var(--dyn) 0 6px, transparent 6px 9px); }
.yunit { margin-left: auto; }

.bars { margin: 1.5rem 0 0.5rem; max-width: 50rem; }
.bars figcaption { font-weight: 650; margin-bottom: 0.6rem; }
.bars ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.bars li { display: grid; grid-template-columns: minmax(6rem, 13rem) 1fr auto; gap: 0.75rem; align-items: center; font-size: 0.9rem; }
.bar-track { display: flex; height: 1.1rem; background: #e7ecec; border-radius: 2px; overflow: hidden; }
.bar { display: block; height: 100%; }
.bar.elec { background: var(--elec); } .bar.gas { background: var(--gas); } .bar.ode { background: var(--ode); }
.bar.forecast { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.45) 0 4px, transparent 4px 8px); }
.bar-value { font-weight: 600; white-space: nowrap; text-align: right; min-width: 5.5rem; }
.bar-value small { font-weight: 400; color: var(--muted); }

/* Footer */
.site-footer { background: var(--ink); color: #dfe6e8; padding: 2.5rem 0; font-size: 0.95rem; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; gap: 1.5rem; }
.footer-brand { font-weight: 750; font-size: 1.1rem; color: #fff; margin: 0 0 0.3rem; }
.footer-h { font-weight: 650; color: #fff; margin: 0 0 0.4rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { padding: 0.2rem 0; }

@media (min-width: 40rem) {
  .tasks { grid-template-columns: repeat(2, 1fr); }
  .calc { padding: 1.5rem 1.75rem; }
}
@media (min-width: 56rem) {
  .hero { grid-template-columns: 1.25fr 1fr; gap: 3rem; padding: 2rem 0; }
  .tasks { grid-template-columns: repeat(2, 1fr); max-width: 56rem; }
  .topics { grid-template-columns: repeat(2, 1fr); column-gap: 2rem; max-width: 56rem; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}
@media (max-width: 30rem) {
  .bars li { grid-template-columns: 1fr auto; }
  .bars .bar-label { grid-column: 1 / -1; }
  .bars .bar-track { grid-column: 1; }
  .w-m, .w-s { width: 100%; }
}
@media print {
  .site-header, .site-footer, .calc-form, .related, .skip { display: none; }
  body { background: #fff; }
}
.meter-face .sep { color: var(--meter-digit); font: 700 1.6rem/1 var(--font-num); align-self: flex-end; margin: 0 -1px; }
main .wrap > :is(p, li, dd), main li { overflow-wrap: anywhere; }
.calc-sub { display: block; color: var(--muted); font-size: 0.85rem; font-family: var(--font-num); }
.big { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: 0.75rem 1.5rem; }
@media (max-width: 30rem) { .calc { padding: 1rem 0.85rem; margin-left: -0.35rem; margin-right: -0.35rem; } }
.chart-scroll { max-width: 46rem; }
.chart-scroll + .legend { max-width: 46rem; }
textarea { font: inherit; color: var(--ink); background: #fff; border: 2px solid #6d7a82; border-radius: var(--radius-s); padding: 0.5rem 0.6rem; width: 100%; min-height: 10rem; resize: vertical; }
textarea[aria-invalid="true"] { border-color: var(--error); }
.contact input[type="email"] { font: inherit; color: var(--ink); background: #fff; border: 2px solid #6d7a82; border-radius: var(--radius-s); padding: 0.5rem 0.6rem; min-height: 44px; width: 100%; max-width: 28rem; }
.contact input[type="text"] { max-width: 28rem; }
.form-status { margin-top: 1rem; padding: 0.75rem 1rem; border-radius: var(--radius-s); }
.form-status.ok { background: #e6f4ea; border-left: 4px solid #1e7a3c; }
.form-status.fail { background: #fdecea; border-left: 4px solid var(--error); }
.form-status:focus { outline: none; }
.btn[disabled] { opacity: 0.6; cursor: wait; }
.contact h2 { margin-top: 0; }
