/* ==========================================================================
   MOTION — gedeeld rekentool-patroon
   --------------------------------------------------------------------------
   Generalisatie van de drie referentietools (tool_radiator / tool_gas_pipe /
   tool_dilution). Die zetten hun CSS nog lokaal per template neer; alles wat
   daar hetzelfde was staat nu hier één keer, onder de naamruimte `.mt-tool`.

   Twee bewuste keuzes:

   1. NIET gescoped onder html[data-theme="motion"]. De tools worden ook via
      `tool_base.html` in een iframe geladen; als die shell ooit weer op een
      ander thema staat, blijft de rekentool er hetzelfde uitzien. De tokens
      staan daarom lokaal op `.mt-tool` in plaats van op :root.

   2. `html body`-prefix + !important op koppen, labels en invoervelden. De
      themascope schrijft `html[data-theme="motion"] h1 { … !important }` en
      `… input[type="number"] { … !important }`; zonder die prefix verliezen
      onze regels dat specificiteitsduel (0,1,1 vs 0,0,1).

   Bijbehorende valkuil: mobile.css zet `input { min-height: 44px }` — bij
   checkboxen en radio's zetten we die expliciet terug op 0.
   ========================================================================== */

.mt-tool {
    --mtt-card: #ffffff;
    --mtt-dark: #0e1726;
    --mtt-ink: #0e1726;
    --mtt-ink2: #51607a;
    --mtt-ink3: #5f6e88; /* AA-conform gedempt (was #93a0b4, 2.5:1) */
    --mtt-ondark: #c6d0de;
    --mtt-ondark2: #8fa0ba;
    --mtt-accent: #2563eb;
    --mtt-accent-h: #1d4ed8;
    /* accent in tekstrol (links, eyebrows, uitkomsten). Gescheiden van
       --mtt-accent (knop-achtergronden) zodat de donkere variant tekst kan
       verlichten zonder de kobalt knoppen te verbleken. */
    --mtt-link: #2563eb;
    --mtt-link-h: #1d4ed8;
    --mtt-input-focus: #ffffff;
    --mtt-blue: #60a5fa;
    --mtt-line: rgba(14, 23, 38, 0.10);
    --mtt-line-soft: rgba(14, 23, 38, 0.08);
    --mtt-line-in: rgba(14, 23, 38, 0.15);
    --mtt-input: #fbfcfe;
    --mtt-ok: #15803d;
    --mtt-ok-dark: #34d399;
    --mtt-warn: #b45309;
    --mtt-err: #b91c1c;
    --mtt-err-dark: #f87171;
    --mtt-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
    --mtt-sans: 'Archivo', system-ui, -apple-system, sans-serif;
    font-family: var(--mtt-sans);
    color: var(--mtt-ink);
    position: relative;
    z-index: 1;
    overflow-x: hidden;
}

/* [hidden] verliest van elke display-regel die we zelf zetten (grid/flex),
   dus forceren we het terug binnen de naamruimte. */
.mt-tool [hidden] { display: none !important; }

.mt-tool-wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 40px 40px 72px;
    width: 100%;
    box-sizing: border-box;
}
.mt-tool-wrap-narrow { max-width: 880px; }


/* ── Kop ────────────────────────────────────────────────────────────────── */
.mt-tool-crumbs { font-size: 0.8rem; color: var(--mtt-ink3); margin-bottom: 18px; }
.mt-tool-crumbs a { color: var(--mtt-ink3); text-decoration: none; }
.mt-tool-crumbs a:hover { color: var(--mtt-link); }
.mt-tool-crumbs .sep { margin: 0 6px; }
.mt-tool-crumbs .cur { color: var(--mtt-ink2); }

.mt-tool-head {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
html body .mt-tool-head h1 {
    font-family: var(--mtt-sans) !important;
    font-size: 1.7rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.03em !important;
    color: var(--mtt-ink) !important;
    line-height: 1.2;
    margin: 0 !important;
    text-transform: none !important;
}
.mt-tool-nr {
    font-family: var(--mtt-mono);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--mtt-link);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.mt-tool-intro {
    color: var(--mtt-ink2);
    font-size: 0.94rem;
    line-height: 1.6;
    margin: 0 0 30px;
    max-width: 64ch;
}


/* ── Kaarten & velden ───────────────────────────────────────────────────── */
.mt-tool-card {
    background: var(--mtt-card);
    border: 1px solid var(--mtt-line);
    border-radius: 14px;
    padding: 26px;
    margin-bottom: 20px;
}
.mt-tool-eyebrow {
    font-family: var(--mtt-mono);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--mtt-ink3);
    text-transform: uppercase;
    margin-bottom: 16px;
}
.mt-tool-eyebrow-dark { color: var(--mtt-ondark2); }

.mt-tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
}
.mt-tool-grid-narrow { max-width: 440px; }
.mt-tool-grid-2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.mt-tool-grid-wide { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.mt-tool-span-all { grid-column: 1 / -1; }

.mt-tool-field { min-width: 0; }
html body .mt-tool .mt-tool-field label,
html body .mt-tool label.mt-tool-label {
    display: block;
    color: var(--mtt-ink2) !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    margin-bottom: 6px;
}
html body .mt-tool .mt-tool-field input,
html body .mt-tool .mt-tool-field select,
html body .mt-tool .mt-tool-field textarea {
    width: 100%;
    box-sizing: border-box;
    background: var(--mtt-input) !important;
    border: 1px solid var(--mtt-line-in) !important;
    border-radius: 10px !important;
    color: var(--mtt-ink) !important;
    padding: 11px 13px !important;
    font-size: 0.94rem !important;
    font-family: var(--mtt-mono) !important;
    transition: border-color 0.15s, box-shadow 0.15s;
}
/* Keuzelijsten en vrije tekst lezen prettiger in de schreefloze */
html body .mt-tool .mt-tool-field select,
html body .mt-tool .mt-tool-field input[type="text"],
html body .mt-tool .mt-tool-field textarea {
    font-family: var(--mtt-sans) !important;
}
html body .mt-tool .mt-tool-field select { cursor: pointer; }
html body .mt-tool .mt-tool-field input:focus,
html body .mt-tool .mt-tool-field select:focus,
html body .mt-tool .mt-tool-field textarea:focus {
    outline: none !important;
    background: var(--mtt-input-focus) !important;
    border-color: var(--mtt-accent) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
    transform: none !important;
}
.mt-tool-unit {
    font-family: var(--mtt-mono);
    font-size: 0.72rem;
    color: var(--mtt-ink3);
    margin-top: 5px;
    display: block;
}
/* Berekende waarde die als veld in een witte kaart staat (niet invulbaar) */
.mt-tool-readout {
    font-family: var(--mtt-mono);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--mtt-link);
    padding: 11px 0 0;
    line-height: 1.3;
}

.mt-tool-hint {
    font-size: 0.76rem;
    color: var(--mtt-ink3);
    margin: 10px 0 0;
    line-height: 1.55;
}
.mt-tool-hint strong { color: var(--mtt-ink2); }

/* Selectievakjes / radio's — mobile.css zet input{min-height:44px}, wat een
   checkbox tot een balk oprekt. */
.mt-tool-checks { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.mt-tool-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.86rem;
    color: var(--mtt-ink2);
    cursor: pointer;
}
html body .mt-tool .mt-tool-check input[type="checkbox"],
html body .mt-tool .mt-tool-check input[type="radio"] {
    width: 16px !important;
    height: 16px !important;
    min-height: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    accent-color: var(--mtt-accent);
    cursor: pointer;
    flex: 0 0 auto;
}


/* ── Knoppen ────────────────────────────────────────────────────────────── */
.mt-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--mtt-accent);
    color: #fff;
    border: 1px solid var(--mtt-accent);
    border-radius: 10px;
    font-family: var(--mtt-sans);
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    text-align: center;
    padding: 11px 20px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}
.mt-tool-btn:hover {
    background: var(--mtt-accent-h);
    border-color: var(--mtt-accent-h);
    color: #fff;
    transform: none;
    box-shadow: none;
}
.mt-tool-btn-sm { font-size: 0.82rem; padding: 9px 16px; border-radius: 8px; }
.mt-tool-btn-block { width: 100%; }
.mt-tool-btn-ghost {
    background: transparent;
    color: var(--mtt-ink2);
    border: 1px solid var(--mtt-line-in);
}
.mt-tool-btn-ghost:hover {
    background: transparent;
    border-color: var(--mtt-ink);
    color: var(--mtt-ink);
}
.mt-tool-btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.mt-tool-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--mtt-link);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.mt-tool-link:hover { text-decoration: underline; color: var(--mtt-link-h); }


/* ── Donker resultaatpaneel ─────────────────────────────────────────────── */
.mt-tool-result {
    background: var(--mtt-dark);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 14px;
    padding: 28px;
    color: #fff;
    margin-bottom: 20px;
    /* JS-gegenereerde markup in de tools grijpt vaak naar deze globale
       tokens; binnen het donkere paneel krijgen ze donkerpaneel-waarden. */
    --border-color: rgba(255, 255, 255, 0.14);
    --text-muted: #8fa0ba;
    --text-primary: #ffffff;
    --accent-color: #60a5fa;
    --accent-rgb: 96, 165, 250;
}
html body .mt-tool .mt-tool-result h2,
html body .mt-tool .mt-tool-result h3,
html body .mt-tool .mt-tool-result h4 { color: #fff !important; }
.mt-tool-result p { color: var(--mtt-ondark); }

.mt-tool-res-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 18px;
}
.mt-tool-result .result-item,
.mt-tool-res-item { display: flex; flex-direction: column; min-width: 0; }
.mt-tool-result .result-label,
.mt-tool-res-label {
    font-family: var(--mtt-mono);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--mtt-ondark2);
    margin-bottom: 6px;
}
.mt-tool-result .result-value,
.mt-tool-res-value {
    font-family: var(--mtt-mono);
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--mtt-ondark);
    line-height: 1.25;
    text-shadow: none;
}
.mt-tool-result .result-value.highlight,
.mt-tool-res-value.highlight { color: var(--mtt-blue); }
.mt-tool-res-value.ok { color: var(--mtt-ok-dark); }
.mt-tool-res-value.err { color: var(--mtt-err-dark); }

/* Uitgelicht hoofdgetal */
.mt-tool-res-hero {
    background: rgba(96, 165, 250, 0.10);
    border: 1px solid rgba(96, 165, 250, 0.25);
    border-radius: 12px;
    padding: 14px;
}
.mt-tool-res-hero .result-label,
.mt-tool-res-hero .mt-tool-res-label { color: var(--mtt-blue); }
.mt-tool-res-hero .result-value,
.mt-tool-res-hero .mt-tool-res-value {
    font-size: 1.7rem;
    font-weight: 600;
    color: var(--mtt-blue);
}

/* Enkelvoudige grote uitkomst (Ohm, Vermogen, Eenheden …) */
.mt-tool-res-single { text-align: center; }
.mt-tool-res-single .mt-tool-res-label { text-align: center; }
.mt-tool-res-single .mt-tool-res-value {
    font-size: clamp(1.5rem, 5vw, 2.3rem);
    font-weight: 600;
    color: var(--mtt-blue);
    word-break: break-word;
}

/* Losse regels/notities binnen het paneel */
.mt-tool-res-note {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 20px;
    padding-top: 16px;
    font-size: 0.82rem;
    line-height: 1.65;
    color: var(--mtt-ondark2);
}
.mt-tool-res-note strong { color: var(--mtt-ondark); }

/* Statusmelding op donker (veilig / let op / fout) */
.mt-tool-res-status {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 18px;
    font-size: 0.85rem;
    line-height: 1.55;
    background: rgba(96, 165, 250, 0.10);
    border: 1px solid rgba(96, 165, 250, 0.25);
    color: var(--mtt-ondark);
}
.mt-tool-res-status.ok {
    background: rgba(52, 211, 153, 0.10);
    border-color: rgba(52, 211, 153, 0.28);
    color: var(--mtt-ok-dark);
}
.mt-tool-res-status.warn {
    background: rgba(251, 191, 36, 0.10);
    border-color: rgba(251, 191, 36, 0.28);
    color: #fbbf24;
}
.mt-tool-res-status.err {
    background: rgba(248, 113, 113, 0.10);
    border-color: rgba(248, 113, 113, 0.28);
    color: var(--mtt-err-dark);
}


/* ── Tabellen in het donkere paneel ─────────────────────────────────────── */
.mt-tool-result .breakdown-section,
.mt-tool-res-section {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 22px;
    padding-top: 18px;
}
.mt-tool-result .breakdown-title,
.mt-tool-res-section-title {
    font-family: var(--mtt-mono);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--mtt-ondark2);
    margin-bottom: 12px;
}
.mt-tool-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mt-tool-result table,
.mt-tool-res-table { width: 100%; border-collapse: collapse; }
.mt-tool-result table th,
.mt-tool-res-table th {
    text-align: left;
    padding: 0 8px 8px;
    font-family: var(--mtt-mono);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mtt-ondark2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}
.mt-tool-result table td,
.mt-tool-res-table td {
    padding: 9px 8px;
    font-size: 0.82rem;
    color: var(--mtt-ondark);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: top;
}
.mt-tool-result table tr:last-child td,
.mt-tool-res-table tr:last-child td { border-bottom: none; }
.mt-tool-result table strong { color: #fff; font-weight: 600; }
.mt-tool-result table small { color: var(--mtt-ondark2); }
.mt-tool-num { font-family: var(--mtt-mono); text-align: right; white-space: nowrap; }
.mt-tool-res-table .total-row td {
    font-weight: 600;
    color: #fff;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    border-bottom: none;
    padding-top: 12px;
}

/* Opslaan/kopiëren-knoppen die CalcSave in het paneel injecteert */
.mt-tool-result .calc-save-actions {
    margin-top: 20px !important;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.mt-tool-result .calc-action-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    color: var(--mtt-ondark);
    font-family: var(--mtt-sans);
}
.mt-tool-result .calc-action-btn:hover {
    background: rgba(96, 165, 250, 0.10);
    border-color: var(--mtt-blue);
    color: var(--mtt-blue);
}


/* ── Lichte tabel (referentiewaarden in een witte kaart) ────────────────── */
.mt-tool-lighttable { width: 100%; border-collapse: collapse; }
.mt-tool-lighttable th {
    text-align: left;
    padding: 0 10px 8px;
    font-family: var(--mtt-mono);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mtt-ink3);
    border-bottom: 1px solid var(--mtt-line);
    white-space: nowrap;
}
.mt-tool-lighttable td {
    padding: 9px 10px;
    font-size: 0.84rem;
    color: var(--mtt-ink2);
    border-bottom: 1px solid var(--mtt-line-soft);
}
.mt-tool-lighttable tr:last-child td { border-bottom: none; }
.mt-tool-lighttable td.mt-tool-num,
.mt-tool-lighttable th.mt-tool-num { color: var(--mtt-ink); }


/* ── Ingebedde rekentool (SEO-landingspagina's laden de tool in een iframe) ── */
.mt-tool-frame {
    display: block;
    width: 100%;
    height: 820px;
    border: 1px solid var(--mtt-line);
    border-radius: 14px;
    background: var(--mtt-card);
}
@media (max-width: 640px) {
    .mt-tool-frame { height: 1000px; border-radius: 12px; }
}

/* Kenmerkchips onder de introductie */
.mt-tool-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.mt-tool-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--mtt-card);
    border: 1px solid var(--mtt-line);
    border-radius: 99px;
    padding: 7px 14px;
    font-size: 0.82rem;
    color: var(--mtt-ink2);
}
.mt-tool-chip svg { color: var(--mtt-link); flex: 0 0 auto; }


/* ── Tegels (overzichtspagina's: kies een rekentool / een merk) ─────────
   Let op twee dingen in de themascope: `html[data-theme="motion"] a` kleurt
   álle links kobalt, en h2/h3 krijgen daar !important. Beide worden hier
   binnen de tegel teruggezet. */
.mt-tool-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 14px;
}
html body .mt-tool a.mt-tool-tile {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--mtt-card);
    border: 1px solid var(--mtt-line);
    border-radius: 14px;
    padding: 18px 20px;
    color: var(--mtt-ink);
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
html body .mt-tool a.mt-tool-tile:hover {
    border-color: rgba(37, 99, 235, 0.50);
    color: var(--mtt-ink);
}
.mt-tool-tile-icon {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--mtt-link);
}
.mt-tool-tile-body { flex: 1 1 auto; min-width: 0; }
html body .mt-tool .mt-tool-tile-body h2,
html body .mt-tool .mt-tool-tile-body h3 {
    font-family: var(--mtt-sans) !important;
    font-size: 0.94rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em !important;
    color: var(--mtt-ink) !important;
    margin: 0 0 4px !important;
    text-transform: none !important;
}
.mt-tool-tile-body p {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--mtt-ink2);
}
.mt-tool-tile-meta {
    display: block;
    margin-top: 8px;
    font-family: var(--mtt-mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mtt-ink3);
}
.mt-tool-tile-go {
    flex: 0 0 auto;
    align-self: center;
    color: var(--mtt-ink3);
    font-size: 1rem;
    transition: color 0.15s, transform 0.15s;
}
html body .mt-tool a.mt-tool-tile:hover .mt-tool-tile-go {
    color: var(--mtt-link);
    transform: translateX(3px);
}

/* Groepskop boven een reeks tegels */
.mt-tool-group { margin-bottom: 28px; }
.mt-tool-group-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding-bottom: 10px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--mtt-line-soft);
}
html body .mt-tool .mt-tool-group-head h2 {
    font-family: var(--mtt-sans) !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
    color: var(--mtt-ink) !important;
    margin: 0 !important;
    text-transform: none !important;
}
.mt-tool-group-count {
    font-family: var(--mtt-mono);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--mtt-ink3);
}


/* ── CTA-strook & uitlegkaart ───────────────────────────────────────────── */
.mt-tool-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    background: var(--mtt-card);
    border: 1px solid var(--mtt-line);
    border-radius: 14px;
    padding: 16px 20px;
    margin-top: 20px;
}
.mt-tool-cta span { font-size: 0.84rem; color: var(--mtt-ink2); }

.mt-tool-explain {
    background: var(--mtt-card);
    border: 1px solid var(--mtt-line);
    border-radius: 14px;
    padding: 22px 26px;
    margin-top: 20px;
}
.mt-tool-explain p {
    margin: 0 0 8px;
    font-size: 0.88rem;
    color: var(--mtt-ink2);
    line-height: 1.7;
}
.mt-tool-explain p:last-child { margin-bottom: 0; }
.mt-tool-explain strong { color: var(--mtt-ink); }
.mt-tool-explain a { color: var(--mtt-link); font-weight: 600; }
.mt-tool-explain ul, .mt-tool-explain ol {
    margin: 0 0 10px;
    padding-left: 20px;
    font-size: 0.88rem;
    color: var(--mtt-ink2);
    line-height: 1.7;
}
.mt-tool-explain li { margin-bottom: 4px; }
.mt-tool-explain li::marker { color: var(--mtt-ink3); }

/* Uitleg-/SEO-tekst onder de tool */
.mt-tool-prose { margin-top: 20px; }
html body .mt-tool .mt-tool-prose h2 {
    font-family: var(--mtt-sans) !important;
    font-size: 1.12rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
    color: var(--mtt-ink) !important;
    margin: 22px 0 8px !important;
    text-transform: none !important;
}
html body .mt-tool .mt-tool-prose h3 {
    font-family: var(--mtt-sans) !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: var(--mtt-ink) !important;
    margin: 18px 0 6px !important;
    text-transform: none !important;
}
html body .mt-tool .mt-tool-prose h2:first-child,
html body .mt-tool .mt-tool-prose h3:first-child { margin-top: 0 !important; }
.mt-tool-prose p,
.mt-tool-prose li {
    font-size: 0.88rem;
    color: var(--mtt-ink2);
    line-height: 1.7;
}
.mt-tool-prose p { margin: 0 0 10px; }
.mt-tool-prose ul, .mt-tool-prose ol { margin: 0 0 12px; padding-left: 20px; }
.mt-tool-prose li { margin-bottom: 4px; }
.mt-tool-prose li::marker { color: var(--mtt-ink3); }
.mt-tool-prose strong { color: var(--mtt-ink); }
.mt-tool-prose a { color: var(--mtt-link); font-weight: 600; }


/* ── Formule-, notitie- en bronblokken ──────────────────────────────────── */
.mt-tool .formula-box,
.mt-tool-formula {
    background: var(--mtt-input);
    border: 1px solid var(--mtt-line-soft);
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
    font-family: var(--mtt-mono);
    font-size: 0.8rem;
    line-height: 1.8;
    color: var(--mtt-ink);
    overflow-x: auto;
}
.mt-tool .formula-box .var,
.mt-tool-formula .var { color: var(--mtt-link); font-weight: 600; }

.mt-tool .note-box,
.mt-tool-note {
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.20);
    border-radius: 10px;
    padding: 12px 14px;
    margin: 12px 0;
    color: var(--mtt-ink2);
    font-size: 0.84rem;
    line-height: 1.6;
}
.mt-tool .note-box strong,
.mt-tool-note strong { color: var(--mtt-ink); }
.mt-tool-note.warn {
    background: rgba(180, 83, 9, 0.07);
    border-color: rgba(180, 83, 9, 0.22);
}
.mt-tool-note.err {
    background: rgba(185, 28, 28, 0.06);
    border-color: rgba(185, 28, 28, 0.20);
}
.mt-tool-note.ok {
    background: rgba(21, 128, 61, 0.06);
    border-color: rgba(21, 128, 61, 0.20);
}

.mt-tool .source-link,
.mt-tool-source {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(37, 99, 235, 0.07);
    border: 1px solid rgba(37, 99, 235, 0.20);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--mtt-link);
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
}
.mt-tool .source-link:hover,
.mt-tool-source:hover { background: rgba(37, 99, 235, 0.12); color: var(--mtt-link-h); }


/* ── Modals ─────────────────────────────────────────────────────────────── */
.mt-tool .info-modal,
.mt-tool-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(14, 23, 38, 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.mt-tool .info-modal.active,
.mt-tool-modal.active { display: flex; }
.mt-tool .info-content,
.mt-tool-modal-content {
    position: relative;
    background: var(--mtt-card);
    border: 1px solid var(--mtt-line);
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(14, 23, 38, 0.35);
    width: 100%;
    max-width: 680px;
    max-height: 84vh;
    overflow-y: auto;
    padding: 28px;
    color: var(--mtt-ink);
}
html body .mt-tool .info-content h2,
html body .mt-tool .mt-tool-modal-content h2 {
    font-family: var(--mtt-sans) !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
    color: var(--mtt-ink) !important;
    margin: 0 0 16px !important;
    padding-right: 44px;
    text-transform: none !important;
}
html body .mt-tool .info-content h3,
html body .mt-tool .mt-tool-modal-content h3 {
    font-family: var(--mtt-sans) !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: var(--mtt-ink) !important;
    margin: 20px 0 8px !important;
    text-transform: none !important;
}
.mt-tool .info-content p,
.mt-tool-modal-content p {
    color: var(--mtt-ink2);
    font-size: 0.88rem;
    line-height: 1.7;
    margin: 0 0 12px;
}
.mt-tool .info-close,
.mt-tool-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(220, 38, 38, 0.08);
    color: var(--mtt-err);
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}
.mt-tool .info-close:hover,
.mt-tool-modal-close:hover { background: var(--mtt-err); color: #fff; }
.mt-tool .report-pre,
.mt-tool-pre {
    background: var(--mtt-dark);
    color: var(--mtt-ondark);
    border-radius: 12px;
    padding: 18px;
    margin: 0;
    font-family: var(--mtt-mono);
    font-size: 0.76rem;
    line-height: 1.55;
    white-space: pre;
    overflow: auto;
    max-height: 52vh;
}


/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .mt-tool-wrap { padding: 28px 18px 56px; }
    .mt-tool-card,
    .mt-tool-result { padding: 20px; }
    .mt-tool-cta { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
    html body .mt-tool-head h1 { font-size: 1.4rem !important; }
    .mt-tool-res-hero .result-value,
    .mt-tool-res-hero .mt-tool-res-value { font-size: 1.45rem; }
    .mt-tool-btn-row .mt-tool-btn { width: 100%; }
}


/* ── Donkere variant ─────────────────────────────────────────────────────
   Volgt data-theme-mode="dark" op <html> — óók in de iframe-shell
   (tool_base.html leest dezelfde theme_mode-cookie, en de ouderpagina
   schakelt geladen iframes live mee). De tokens staan op .mt-tool, dus
   dit blok hoeft ze alleen te herdefiniëren; knoppen houden hun kobalt
   achtergrond (--mtt-accent) met witte tekst, tekst-accenten schuiven
   naar lichtblauw (--mtt-link) voor AA-contrast op donkere grond. */
html[data-theme-mode="dark"] .mt-tool {
    --mtt-card: #121c30;
    --mtt-dark: #131f34;
    --mtt-ink: #e8edf6;
    --mtt-ink2: #a9b6cb;
    --mtt-ink3: #8b99b2;
    --mtt-link: #60a5fa;
    --mtt-link-h: #93c5fd;
    --mtt-line: rgba(214, 226, 246, 0.10);
    --mtt-line-soft: rgba(214, 226, 246, 0.07);
    --mtt-line-in: rgba(214, 226, 246, 0.14);
    --mtt-input: #0f1828;
    --mtt-input-focus: #121c30;
    --mtt-ok: #34d399;
    --mtt-warn: #fbbf24;
    --mtt-err: #f87171;
}
/* Lichtblauwe tinten die op wit waren berekend, iets versterken. */
html[data-theme-mode="dark"] .mt-tool .mt-tool-tile-ico { background: rgba(96, 165, 250, 0.12); }
html[data-theme-mode="dark"] .mt-tool .note-box,
html[data-theme-mode="dark"] .mt-tool-note {
    background: rgba(96, 165, 250, 0.08);
    border-color: rgba(96, 165, 250, 0.25);
}
html[data-theme-mode="dark"] .mt-tool .source-link,
html[data-theme-mode="dark"] .mt-tool-source {
    background: rgba(96, 165, 250, 0.10);
    border-color: rgba(96, 165, 250, 0.25);
}
html[data-theme-mode="dark"] .mt-tool .source-link:hover,
html[data-theme-mode="dark"] .mt-tool-source:hover { background: rgba(96, 165, 250, 0.16); }
/* Focusring op donker. */
html[data-theme-mode="dark"] body .mt-tool .mt-tool-field input:focus,
html[data-theme-mode="dark"] body .mt-tool .mt-tool-field select:focus,
html[data-theme-mode="dark"] body .mt-tool .mt-tool-field textarea:focus {
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18) !important;
}
