/* Tekstballon vervagen als uitleg open is */
details.help[open] ~ .tekstballon, details.help[open] ~ .tekstballon * {
    opacity: 0.25 !important;
    pointer-events: none !important;
    transition: opacity 0.3s;
}
body {
    min-height: 100vh;
    background: linear-gradient(120deg, #e0e7ff 0%, #f0fdf4 100%);
    font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
    color: #222;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    margin: 0;
}

div.basisKolomBreed {
    flex-grow: 1;
    padding: 2.5rem 2rem 2rem 2.5rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

div.basisKolomSmal {
    margin: 2.5rem 2.5rem 2.5rem 0;
    width: 20rem;
    min-width: 16rem;
    max-width: 22rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

div.results {
    margin: 0;
    width: 100%;
}

/* Resultaten grid */
.resultsGrid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
}

div.controls {
    background: #fff;
    border-radius: 1.2rem;
    box-shadow: 0 4px 24px 0 rgba(30, 64, 175, 0.10), 0 1.5px 6px 0 rgba(16, 185, 129, 0.08);
    border: none;
    display: block;
    padding: 2.2rem 2rem 1.5rem 2rem;
    width: 100%;
    max-width: 20rem;
    min-width: 15rem;
    margin: 0;
    opacity: 1;
}

div.controls select {
    margin-bottom: 0.7rem;
    border-radius: 0.5rem;
    border: 1px solid #c7d2fe;
    padding: 0.4rem 0.7rem;
    font-size: 1rem;
    background: #f1f5f9;
    color: #222;
}

div.controls label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.2rem;
    color: #2563eb;
}

div.controls label.text {
    display: inline-block;
    width: 38%;
    color: #222;
    font-weight: 400;
}

div.controls input {
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid #c7d2fe;
    padding: 0.4rem 0.7rem;
    font-size: 1rem;
    background: #f8fafc;
    color: #222;
    margin-bottom: 0.7rem;
}

div.controls input[type="text"],
div.controls input[type="number"] {
    width: 55%;
    display: inline-block;
}

div.controls input[type="checkbox"] {
    width: 1.25em;
    height: 1.25em;
    margin-right: 0.7em;
    accent-color: #22c55e;
    transform: none;
    border-radius: 0.35em;
    border: 2px solid #22c55e;
    background: #f8fafc;
    box-shadow: 0 1.5px 6px 0 rgba(34,197,94,0.10);
    transition: box-shadow 0.2s, border 0.2s;
}
div.controls input[type="checkbox"]:hover,
div.controls input[type="checkbox"]:focus {
    box-shadow: 0 2px 8px 0 rgba(34,197,94,0.18);
    border: 2px solid #2563eb;
}
div.controls label.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 1.1rem 0 1.1rem 0;
    font-size: 0.98rem;
    color: #222;
    font-weight: 500;
    letter-spacing: 0.01em;
    gap: 0.5em;
}
div.controls label.checkbox-label span {
    display: inline-block;
    margin-left: 0.1em;
    color: #2563eb;
    font-weight: 500;
}

div.maxpunten-control {
    display: flex;
    gap: 0.7rem;
    margin-bottom: 0.7rem;
}

div.maxpunten-control select,
div.maxpunten-control input {
    flex: 1;
}

div.controls span.textinput {
    text-align: right;
}

table.cijfers {
    border-collapse: collapse;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 2px 12px 0 rgba(30, 64, 175, 0.07);
    overflow: hidden;
    margin: 0 auto 1.5rem auto;
    font-size: 1.08rem;
}

table.cijfers th {
    padding: 0.85rem 0.7rem 0.55rem 0.7rem;
    text-align: center;
    font-size: 1.09rem;
    font-weight: 600;
    color: #2563eb;
    background: #f1f5f9;
    border-bottom: 2.5px solid #e0e7ff;
    letter-spacing: 0.01em;
}

table.cijfers tr td {
    padding: 0.45rem 0.7rem;
    text-align: center;
    width: 5.2rem;
    border-bottom: 1px solid #e0e7ff;
    font-variant-numeric: tabular-nums;
}

div.kolom {
    display: block;
    margin-bottom: 1.5rem;
}

div.grafiek-kolom {
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 1.2rem;
    box-shadow: 0 2px 12px 0 rgba(16, 185, 129, 0.10);
    border: none;
}

#cijferGrafiek {
    display: block;
    max-width: 100%;
    height: auto;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 1.5px 6px 0 rgba(30, 64, 175, 0.08);
    border: 1px solid #e0e7ff;
}

@media (min-width: 900px) {
    .resultsGrid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        align-items: start;
    }
}

.radio-row {
    display: flex;
    gap: 1.2rem;
    margin: 0.25rem 0 0.7rem 0;
}

.radio-row .radio {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 1.01rem;
}

.subcontrols {
    margin: 0.7rem 0 0.7rem 0;
}

details.help summary {
    cursor: pointer;
    color: #22c55e;
    font-weight: 500;
    font-size: 1.08rem;
    margin-top: 0.7rem;
}
details.help[open] summary {
    color: #2563eb;
}
details.help div {
    color: #222;
    font-size: 1.01rem;
    margin-bottom: 0.5rem;
}

button {
    background: linear-gradient(90deg, #2563eb 60%, #22c55e 100%);
    color: #fff;
    border: none;
    border-radius: 0.7rem;
    box-shadow: 0 2px 8px 0 rgba(30, 64, 175, 0.10);
    font-size: 1.08rem;
    font-weight: 500;
    padding: 0.7rem 0;
    margin-top: 1rem;
    width: 100%;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}
button:hover, button:focus {
    background: linear-gradient(90deg, #1d4ed8 60%, #16a34a 100%);
    box-shadow: 0 4px 16px 0 rgba(30, 64, 175, 0.13);
}

/* Tekstballon rechtsonderaan (zoals op homepage) */
div.tekstballon {
	position: fixed;
	bottom: 0px;
	right: 0;

	transition: opacity 0.5s, transform 0.5s, bottom 0.5s, right 0.5s;
	opacity: 1;
	cursor: pointer;
    z-index: 1000;
}

div.tekstballon.verborgen {
	opacity: 0;
	pointer-events: none;
}

div.tekstballon img {
    height: 10rem;
}

div.bubble {
    background-color: #fff;
    border: 4px solid #333;
    border-radius: 30px;
    font-family: sans-serif;
    font-size: large;
    line-height: 1.4em;
    margin: 40px 3rem;
    padding: 20px;
    position: relative;
    text-align: center;
    width: 300px;
}

div.bubble:before,
div.bubble:after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
}

div.speech:before {
    left: 34px;
    bottom: -40px;
    border: 20px solid;
    border-color: #333 transparent transparent #333;
}

div.speech:after {
    left: 38px;
    bottom: -30px;
    border: 15px solid;
    border-color: #fff transparent transparent #fff;
}

@media print {
    body {
        display: block;
        background: #fff !important;
    }
    .basisKolomSmal, .controls, details.help, button, .grafiek-kolom, .tekstballon {
        display: none !important;
    }
    .basisKolomBreed {
        width: 100%;
        padding: 0;
    }
    .resultsGrid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.7cm !important;
        align-items: start;
    }
    table.cijfers {
        page-break-inside: avoid;
        width: 100%;
        margin-bottom: 1rem;
        background: #fff !important;
        box-shadow: none !important;
        border: none !important;
    }
    table.cijfers th, table.cijfers td {
        font-size: 10pt;
        padding: 0.15rem 0.3rem;
    }
}

body.uitleg-open .tekstballon:not(.verborgen), body.uitleg-open .tekstballon:not(.verborgen) * {
    opacity: 0.25 !important;
    pointer-events: none !important;
    transition: opacity 0.3s;
}

@media (max-height: 700px) {
    div.tekstballon {
        transform: scale(0.7);
        right: -2rem !important;
        bottom: -3.5rem !important;
        min-height: 0;
        display: block;
        height: auto;
    }
    div.tekstballon img {
        height: 7rem;
        margin-bottom: 0;
    }
    div.bubble {
        width: 200px;
        font-size: 0.95em;
        padding: 12px;
        margin: 20px 1.2rem 0 1.2rem;
    }
}