:root {
    --brand: #800000;       
    --brand-light: #f4e9e9; 
    --brand-dark: #5c0000;  
    --green: #15803d;
    --green-light: #f0fdf4;
    --text: #1f2937;
    --border: #dcdcdc;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}

body {
    margin: 0;
    font-family: "Inter", sans-serif;
    background: #fafafa;
    color: var(--text);
    line-height: 1.6;
}

/* HEADER */
#zk-header {
    background: white;
    border-bottom: 4px solid var(--brand);
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow);
}
#zk-header h1 { margin: 0; color: var(--brand); font-size: 28px; }
#zk-header h2 { margin: 5px 0 0; font-weight: 400; font-size: 16px; color: #666; }

/* DASHBOARD */
#zk-dashboard {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
    background: white;
    border-bottom: 1px solid var(--border);
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 500; /* Verhoogd voor zekerheid */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.zk-dash-block { display: flex; flex-direction: column; gap: 4px; min-width: 200px; }
.zk-dash-block label { font-size: 12px; font-weight: 600; text-transform: uppercase; color: #666; display: flex; align-items: center; }
.zk-dash-block select { padding: 8px; border: 1px solid var(--border); border-radius: 6px; }

.zk-opt-row { display: flex; gap: 15px; font-size: 13px; align-items: center; }
.zk-opt-row label { text-transform: none; color: var(--text); cursor: pointer; }
.zk-opt-row input { accent-color: var(--brand); transform: scale(1.1); margin-right: 6px; }

/* TOTAL BOX */
#zk-total {
    margin-left: auto;
    background: var(--brand-light);
    padding: 10px 20px;
    border-radius: 8px;
    border-left: 5px solid var(--brand);
    text-align: right;
    min-width: 180px;
}
.zk-total-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--brand); }
.zk-total-value { font-size: 24px; font-weight: 700; color: var(--brand); }
.zk-total-note { font-size: 10px; color: var(--brand-dark); }

/* SCENARIO SELECTOR */
#zk-scenario-panel { max-width: 800px; margin: 30px auto; padding: 0 20px; text-align: center; }
#zk-scenario-select { width: 100%; padding: 12px; font-size: 16px; border-radius: 8px; border: 1px solid var(--border); }

/* OUTPUT CONTAINER */
#zk-detail-container { max-width: 800px; margin: 0 auto 60px; padding: 0 20px; }

/* INTRO CARD */
.zk-intro-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    border-top: 4px solid var(--brand);
}

/* ACCORDION STEPS */
.zk-step {
    background: white;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.2s ease;
}
.zk-step-header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: white;
}
.zk-step-header:hover { background: #fcfcfc; border-color: #999; }
.zk-step-title { font-weight: 600; display: flex; align-items: center; gap: 10px; }
.zk-step-cost { font-weight: 700; color: var(--brand); }

.zk-step-body {
    display: none;
    padding: 15px;
    background: #fafafa;
    border-top: 1px solid var(--border);
    font-size: 14px;
}
.zk-step.open .zk-step-body { display: block; }
.zk-step.open .zk-step-header { background: var(--brand-light); }

.zk-row { display: flex; justify-content: space-between; margin-bottom: 6px; }
.zk-subtext { color: #666; font-size: 13px; }
.zk-warning {
    display: flex; align-items: center; gap: 8px;
    background: #fee2e2; color: #991b1b;
    padding: 10px; border-radius: 6px; margin-top: 10px; font-size: 13px;
}

/* TOOLTIP STYLING */
.zk-info-icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-left: 5px;
    cursor: help;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.zk-info-icon:hover { opacity: 1.0; }

.zk-tooltip-wrapper { position: relative; display: inline-flex; align-items: center; }

/* Tooltip pop-up */
.zk-tooltip-wrapper:hover::after {
    content: attr(data-tip);
    position: absolute;
    top: 140%; /* Eronder in dashboard */
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 400;
    width: 200px;
    z-index: 9999; /* Moet boven alles liggen */
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    line-height: 1.4;
    text-align: center;
    pointer-events: none;
    text-transform: none; /* Reset uppercase from labels */
    white-space: normal;
}

/* Pijltje omhoog */
.zk-tooltip-wrapper:hover::before {
    content: "";
    position: absolute;
    top: 100%; 
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent #333 transparent;
    z-index: 9999;
}

/* FOOTER */
#zk-footer { text-align: center; font-size: 12px; color: #999; padding: 40px 0; }
.icon-img { width: 20px; height: 20px; vertical-align: middle; }

/* PEIL-LABEL: voorbehoud, stempel en voettekstalinea. Alleen zichtbaar als PEIL_LABEL_AAN in scenarioEngine.js true is. */
.voorbehoud { margin: 14px 0 0; padding: 14px 16px; background: #fff6e0; border: 1px solid #e9c46a; border-left: 5px solid #b7791f; border-radius: 8px; font-size: 16px; line-height: 1.55; color: #2a2117; }
.voorbehoud strong { color: #1a140f; }
.peil-stempel:focus-visible, .peil-alinea a:focus-visible { outline: 2px solid #800000; outline-offset: 3px; border-radius: 4px; }
.peil-stempel-rij { display: flex; justify-content: flex-end; margin-top: 12px; }
.peil-stempel { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 4px 12px 4px 4px; border: 1px solid #eadede; border-radius: 999px; background: #fff; color: #800000; text-decoration: none; transition: border-color .15s, background .15s; }
.peil-stempel svg { flex: none; width: 36px; height: 36px; display: block; opacity: .85; filter: drop-shadow(0 1px 0 rgba(255,255,255,.9)) drop-shadow(0 -1px 0 rgba(128,0,0,.12)); }
.peil-stempel__tk { display: flex; flex-direction: column; line-height: 1.25; }
.peil-stempel__t1 { font-size: 13px; font-weight: 700; color: #7a1f1f; }
.peil-stempel__t2 { font-size: 12px; color: #6a5d58; }
.peil-stempel:hover { border-color: #cfa9a9; background: #fcf7f7; }
.peil-pijl { display: inline-block; margin-left: .25em; font-size: 12px; line-height: 1; color: inherit; transition: transform .15s; }
@media (prefers-reduced-motion: no-preference) { .peil-stempel:hover .peil-pijl { transform: translate(2px, -2px); } }
.peil-stempel:hover .peil-stempel__t1 { text-decoration: underline; text-underline-offset: 2px; }
.peil-merk { flex: none; display: inline-block; width: 18px; height: 18px; border-radius: 50%; background: #800000; color: #fff; font: 700 12px/18px system-ui, sans-serif; text-align: center; text-decoration: none; }
.peil-alinea { position: relative; margin: 14px auto 0; padding: 0 20px 0 46px; max-width: 72ch; font-size: 13px; line-height: 1.6em; color: #666; text-align: left; }
.peil-alinea[hidden] { display: none; }
.peil-alinea .peil-merk { position: absolute; left: 20px; top: 3px; }
.peil-alinea strong { color: var(--text); }
.peil-alinea a { display: inline-block; padding: 12px 0; color: #800000; text-decoration: underline; text-underline-offset: 3px; }

/* Smal scherm: geen horizontale scroll, tikdoelen van minstens 44 px */
@media (max-width: 600px) {
    #zk-dashboard { padding: 14px; gap: 12px; }
    .zk-dash-block { min-width: 0; width: 100%; }
    .zk-dash-block select, #zk-scenario-select { min-height: 44px; box-sizing: border-box; }
    .zk-opt-row { flex-wrap: wrap; gap: 4px 12px; }
    .zk-opt-row label { min-height: 44px; display: flex; align-items: center; }
    #zk-total { margin-left: 0; width: 100%; box-sizing: border-box; }
    .zk-step-header { min-height: 44px; }
    .zk-row { gap: 10px; }
}

/* Mutuelle: uitleg en OPTAM */
.zk-tooltip-wrapper.zk-tip-wide:hover::after { width: 280px; text-align: left; }
.zk-hint { font-size: 12px; color: #666; line-height: 1.4; max-width: 260px; }
.zk-uitleg { font-size: 13px; color: #444; max-width: 280px; }
.zk-uitleg summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--brand); font-weight: 600; }
.zk-uitleg p { margin: 0 0 8px; line-height: 1.45; }
.zk-uitleg a { color: var(--brand); }
@media (max-width: 600px) { .zk-hint, .zk-uitleg { max-width: none; } .zk-tooltip-wrapper.zk-tip-wide:hover::after { width: 240px; left: 0; transform: none; } }
@media (max-width: 600px) { #zk-dashboard { position: static; } }
