/* Stijlen van module klant (zie SPEC.md 0.2). Bouwt voort op de variabelen uit app.css;
   alleen merkkleuren via --accent, --accent-bright en --accent-soft. Alles begint met ks-. */

/* ---------- Aftellen naar de 24-uursgrens ---------- */

.ks-aftel { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; background: var(--panel); color: var(--ink-2); }
.ks-aftel .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); flex: none; }
.ks-aftel-rustig .dot { background: var(--accent-bright); }
.ks-aftel-let-op { background: var(--warn-soft); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn-line); }
.ks-aftel-let-op .dot { background: var(--warn-dot); }
.ks-aftel-fout { background: var(--bad-soft); color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad-line); }
.ks-aftel-fout .dot { background: var(--bad-dot); }

/* ---------- Categorie als klein pastel label ---------- */

.ks-cat { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 16px; box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.05); }
.ks-cat-blauw { background: var(--p-blauw); color: var(--i-blauw); }
.ks-cat-groen { background: var(--p-groen); color: var(--i-groen); }
.ks-cat-paars { background: var(--p-paars); color: var(--i-paars); }
.ks-cat-oranje { background: var(--p-oranje); color: var(--i-oranje); }
.ks-cat-rood { background: var(--p-rood); color: var(--i-rood); }
.ks-cat-grijs { background: var(--p-grijs); color: var(--i-grijs); }

.ks-concept-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.ks-concept-label .icon { width: 15px; height: 15px; color: var(--accent-bright); }

/* ---------- Inbox ---------- */

.ks-notice { padding: 14px 18px; flex-wrap: nowrap; align-items: flex-start; }
.ks-notice .notice-text { flex: 1 1 auto; }
.ks-notice .icon-round { width: 36px; height: 36px; }

.ks-autopiloot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-card); }
.ks-autopiloot .icon-round { width: 34px; height: 34px; }
.ks-autopiloot .icon-round .icon { width: 17px; height: 17px; }
.ks-autopiloot p { flex: 1 1 260px; min-width: 0; }

.ks-tel { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; }

.ks-table td { vertical-align: top; }
.ks-table .c-tijd { width: 150px; }
.ks-table .c-klant { width: 200px; }
.ks-table .c-order { width: 130px; }
.ks-table .c-concept { width: 150px; }
.ks-table .c-vraag { min-width: 0; }
.ks-table .c-vraag .ks-cat { margin-bottom: 4px; }
.ks-regel { display: block; color: var(--ink-2); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.ks-order { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.ks-table tr:not(.is-open) .ks-regel { color: var(--muted); }

@media (min-width: 900px) {
  .ks-table .c-vraag .ks-cat { margin: 0 8px 0 0; vertical-align: 1px; }
  .ks-regel { display: inline; -webkit-line-clamp: unset; line-clamp: unset; }
  .ks-table .c-vraag { max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Telefoon en tablet: elke vraag als kaartje */
@media (max-width: 899px) {
  .ks-table thead { display: none; }
  .ks-table tr { display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'klant tijd' 'vraag vraag' 'order concept'; gap: 6px 12px; padding: 14px 20px; border-top: 1px solid var(--line); }
  .ks-table tbody tr:first-child { border-top: 0; }
  .ks-table td { padding: 0; border: 0; width: auto !important; }
  .ks-table .c-klant { grid-area: klant; }
  .ks-table .c-klant .cell-sub { display: inline; margin-left: 6px; }
  .ks-table .c-tijd { grid-area: tijd; text-align: right; }
  .ks-table .c-tijd .cell-sub { display: none; }
  .ks-table .c-vraag { grid-area: vraag; }
  .ks-table .c-order { grid-area: order; font-size: 13px; }
  .ks-table .c-concept { grid-area: concept; text-align: right; }
  .ks-table .c-concept:empty { display: none; }
}

/* ---------- Gesprek ---------- */

.ks-chat { list-style: none; display: grid; gap: 18px; }
.ks-msg { display: grid; gap: 6px; max-width: min(620px, 88%); }
.ks-msg-in { justify-self: start; }
.ks-msg-uit { justify-self: end; justify-items: end; }
.ks-meta { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; color: var(--muted); }
.ks-meta strong { font-size: 13px; }
.ks-meta-onder { margin-top: -2px; }
.ks-bubble { padding: 12px 16px; border-radius: 16px; background: var(--panel); color: var(--heading); box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.03); }
.ks-msg-in .ks-bubble { border-top-left-radius: 6px; }
.ks-msg-uit .ks-bubble { border-top-right-radius: 6px; background: var(--navy-soft); }
.ks-msg-bol .ks-bubble { background: var(--surface); border: 1px dashed var(--line-2); color: var(--ink-2); }
.ks-tekst { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 22px; font-weight: 450; }

.ks-msg-concept .ks-bubble { background: var(--surface); border: 1.5px dashed var(--accent-line); color: var(--ink-2); }
.ks-msg-concept .ks-tekst { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; }
.ks-msg-mislukt .ks-bubble { background: var(--bad-soft); }

/* ---------- Antwoord schrijven ---------- */

.ks-antwoord { border-color: var(--line); }
.ks-form { display: grid; gap: 10px; }
.ks-form textarea { min-height: 120px; line-height: 1.55; resize: vertical; }
.ks-form textarea { min-height: 200px; }
.ks-form textarea:hover { border-color: #b5b5b5; }
.ks-knoppen { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; }
.ks-sluit { margin-left: auto; }
.ks-sluit:hover { color: var(--heading); }

.ks-gesloten { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 16px; }
.ks-gesloten > div { flex: 1 1 260px; }
.ks-gesloten h2 { font-size: 17px; }
.ks-gesloten p { margin-top: 2px; }

/* ---------- Contextkaart ---------- */

.ks-orderlink { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--line); color: var(--heading); transition: background var(--t), border-color var(--t); }
.ks-orderlink:hover { background: var(--surface); border-color: var(--line-2); color: var(--heading); }
.ks-orderlink .icon { width: 18px; height: 18px; color: var(--muted); }
.ks-items { list-style: none; display: grid; gap: 8px; margin-top: 14px; }
.ks-items li { display: flex; gap: 10px; color: var(--ink-2); }
.ks-qty { flex: none; min-width: 26px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ks-code { font-family: var(--mono); font-size: 13px; letter-spacing: 0.02em; overflow-wrap: anywhere; }
.ks-context .facts dd { min-width: 0; }

@media (max-width: 639px) {
  .ks-msg { max-width: 94%; }
  .ks-knoppen .btn { flex: 1 1 auto; }
  .ks-sluit { margin: 4px auto 0; flex-basis: 100% !important; }
}

/* ---------- Instellingen › Klantenservice ---------- */

.ks-adresblok { padding: 18px; border-radius: var(--radius); background: var(--accent-soft); margin-bottom: 26px; }
.ks-adres-label { display: block; margin-bottom: 8px; color: var(--heading); }
.ks-adres-rij { display: flex; flex-wrap: wrap; gap: 10px; }
.ks-adres { flex: 1 1 280px; min-width: 0; min-height: 48px; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; color: var(--accent); background: var(--surface); font-family: var(--mono); }
.ks-adres:hover { border-color: var(--line-2); }
.ks-adres-rij .btn { min-height: 48px; }
.ks-adresblok .help { margin-top: 8px; }

.ks-sub { font-size: 15px; margin: 0 0 14px; }
.ks-steps { margin-bottom: 0; }

.ks-bevestig { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 12px; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--accent-bright); background: var(--surface); }
.ks-bevestig-code { font-family: var(--mono); font-size: 28px; font-weight: 700; letter-spacing: 0.06em; color: var(--accent); font-variant-numeric: tabular-nums; }
.ks-bevestig-tekst { font-size: 13px; color: var(--muted); }
.ks-bevestig.is-oud { border-color: var(--line-2); }
.ks-bevestig.is-oud .ks-bevestig-code { color: var(--faint); }
.ks-code-wacht { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-size: 13px; color: var(--muted); }
.ks-code-wacht .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--faint); }

/* ---------- Vandaag: kaartje ---------- */

.ks-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ks-mini > div { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--line-soft); }
.ks-mini .big-number { font-size: 24px; line-height: 30px; }
.ks-mini .muted { font-size: 13px; line-height: 19px; }

/* ---------- Inbox en gesprek: ingepland en "waarom" (0.4) ---------- */

.ks-ingepland-label { color: var(--i-teal); }
.ks-ingepland-label .icon { color: var(--accent-bright); }
.ks-msg-ingepland .ks-bubble { background: var(--surface); border: 1.5px dashed var(--accent-bright); color: var(--ink-2); box-shadow: 0 0 0 4px rgba(0, 169, 157, 0.06); }
.ks-ingepland-acties { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 12px; }
.ks-msg-auto .ks-bubble { background: linear-gradient(180deg, var(--accent-soft), var(--navy-soft)); }

.ks-waarom { font-size: 12.5px; color: var(--muted); max-width: 100%; }
.ks-waarom > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; font-weight: 600; color: var(--i-teal); border-radius: 6px; }
.ks-waarom > summary::-webkit-details-marker { display: none; }
.ks-waarom > summary .icon { width: 14px; height: 14px; }
.ks-waarom > summary:focus-visible { outline: none; box-shadow: var(--ring); }
.ks-waarom[open] { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-xs); }
.ks-waarom[open] > summary { margin-bottom: 8px; }
.ks-waarom-lijst { display: grid; gap: 4px; margin: 0; }
.ks-waarom-lijst > div { display: flex; justify-content: space-between; gap: 16px; }
.ks-waarom-lijst dt { color: var(--muted); }
.ks-waarom-lijst dd { margin: 0; color: var(--heading); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.ks-waarom-regel { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-soft); color: var(--ink-2); line-height: 19px; }

/* Verwijzing bij Instellingen */
.ks-verwijzing-lijst { list-style: none; display: grid; gap: 0; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel-2); padding: 4px 16px; }
.ks-verwijzing-lijst li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.ks-verwijzing-lijst li:first-child { border-top: 0; }
.ks-verwijzing-lijst .icon { width: 17px; height: 17px; color: var(--faint); }
.ks-verwijzing-lijst strong { font-weight: 600; color: var(--heading); text-align: right; }

/* ================================================================================================
   Instellingen › Klantenservice (/instellingen/klantenservice)
   ================================================================================================ */

/* Terugval zolang het formuliersysteem in app.css er niet is (nul specificiteit: app.css wint altijd). */
:where(.ksi .form-section-head) h3 { font-size: 15px; }
:where(.ksi .form-grid > .field-wide) { grid-column: 1 / -1; }

.ksi { scroll-margin-top: 80px; }
.ksi .stack { gap: 20px; }
.ksi-sectie { padding: 24px; scroll-margin-top: 84px; }
@media (min-width: 900px) { .ksi-sectie { padding: 28px 32px; } }
.ksi-kop { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 26px; }
.ksi-kop-tekst { flex: 1 1 auto; min-width: 0; }
.ksi-kop h2 { font-size: 18px; line-height: 26px; letter-spacing: -0.02em; }
.ksi-kop .muted { margin-top: 2px; max-width: 64ch; }
.ksi-kop > .badge { flex: none; margin-top: 4px; }
.ksi-nr { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--navy-soft); color: var(--accent); font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.02em; box-shadow: inset 0 0 0 1px rgba(11, 36, 84, 0.06); }
.ksi-nr .icon { width: 17px; height: 17px; color: var(--accent-bright); }
.ksi-h3 { font-size: 15px; margin-bottom: 10px; }
.ksi-legend { padding: 0; margin-bottom: 8px; font-weight: 600; color: var(--ink-2); font-size: 13.5px; }
.ksi-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.ksi-fieldset > legend { padding: 0; margin-bottom: 8px; font-weight: 600; color: var(--ink-2); font-size: 13.5px; line-height: 20px; }

.ksi-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; background: var(--accent-soft); color: var(--i-teal); font-size: 11px; font-weight: 650; letter-spacing: 0.02em; white-space: nowrap; }
.ksi-tag-zacht { background: var(--panel); color: var(--muted); }

/* Overzicht */
.ksi-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 22px; }
.ksi-stats > div { padding: 14px 16px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-soft); min-width: 0; }
.ksi-stats dt { font-size: 11px; line-height: 16px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.ksi-stats dd { margin: 6px 0 0; font-size: 26px; line-height: 32px; font-weight: 700; letter-spacing: -0.03em; color: var(--heading); font-variant-numeric: tabular-nums; }
.ksi-stats dd.sub { margin-top: 2px; font-size: 12.5px; line-height: 18px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.ksi-overzicht { display: grid; gap: 22px; }
.ksi-grafiek { margin: 0; min-width: 0; }
.ksi-staaf { display: block; width: 100%; max-width: 360px; height: auto; }
.ksi-staaf text { font-size: 10px; fill: var(--faint); font-family: var(--font); font-weight: 600; }
.ksi-staaf-grond { fill: var(--panel); }
.ksi-staaf-auto { fill: var(--accent-bright); }
.ksi-staaf-esc { fill: var(--warn-dot); }
.ksi-grafiek figcaption { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.ksi-legenda { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.ksi-legenda-auto { background: var(--accent-bright); }
.ksi-legenda-esc { background: var(--warn-dot); margin-left: 8px; }
.ksi-recent ul { list-style: none; display: grid; }
.ksi-recent li > a, .ksi-recent li > div { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 8px; margin: 0 -8px; border-radius: var(--radius-sm); color: inherit; transition: background var(--t); }
.ksi-recent li > a:hover { background: var(--hover); }
.ksi-recent li + li > a, .ksi-recent li + li > div { border-top: 1px solid var(--line-soft); border-radius: 0; }
.ksi-recent .icon-round { width: 30px; height: 30px; }
.ksi-recent .icon-round .icon { width: 15px; height: 15px; }
.ksi-recent li span > strong { display: block; font-size: 13px; color: var(--heading); }
.ksi-recent li span > .muted { display: block; font-size: 12.5px; line-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ksi-recent time { font-size: 12px; color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ksi-melding { display: flex; gap: 8px; align-items: flex-start; margin-top: 18px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--warn); font-size: 13.5px; font-weight: 550; }
.ksi-melding .icon { width: 17px; height: 17px; flex: none; margin-top: 1px; }

/* Autonomie: vier niveaus met een kleine meter */
.ksi-niveaus { grid-template-columns: minmax(0, 1fr); }
.ksi-niveau { padding: 16px; }
.ksi-niveau { min-width: 0; }
.ksi-niveau .choice-body { gap: 3px; min-width: 0; }
.ksi-niveau .choice-body strong { font-size: 14.5px; }
.ksi-niveau-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 8px; margin-bottom: 6px; min-height: 20px; }
.ksi-meter { display: inline-flex; gap: 3px; }
.ksi-meter span { width: 14px; height: 6px; border-radius: 3px; background: var(--line); }
.ksi-meter span.aan { background: var(--accent-bright); }
.ksi-niveau:has(input:checked) .ksi-meter span.aan { background: var(--accent); }

.ksi-cats { list-style: none; display: grid; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.ksi-cats li { display: grid; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line-soft); }
.ksi-cats li:first-child { border-top: 0; }
.ksi-cat-naam { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ksi-cat-tekst .help { margin-top: 6px; }
.ksi-cat-keuze { min-width: 0; }
.ksi-noot { display: flex; gap: 8px; align-items: flex-start; }
.ksi-noot .icon { width: 16px; height: 16px; margin-top: 2px; flex: none; color: var(--faint); }

/* Grenzen */
.ksi-segment { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--panel); box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.04); width: max-content; max-width: 100%; }
.ksi-segment label { position: relative; cursor: pointer; }
.ksi-segment input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ksi-segment span { display: grid; place-items: center; min-width: 64px; height: 38px; padding: 0 14px; border-radius: 8px; color: var(--muted); font-weight: 650; font-size: 14px; font-variant-numeric: tabular-nums; transition: background var(--t), color var(--t), box-shadow var(--t); }
.ksi-segment label:hover span { color: var(--heading); }
.ksi-segment input:checked + span { background: var(--surface); color: var(--heading); box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08), 0 0 0 1px rgba(16, 24, 40, 0.05); }
.ksi-segment input:focus-visible + span { box-shadow: var(--ring); }
.ksi-uren, .ksi-modi { grid-template-columns: minmax(0, 1fr); }
.ksi-tijden { margin-top: 2px; }
.ksi-tijden.is-verborgen, .ksi-eigen.is-verborgen { display: none; }

/* Escalaties */
.ksi-regels { list-style: none; display: grid; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel-2); padding: 2px 14px; }
.ksi-regels li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.ksi-regels li:first-child { border-top: 0; }
.ksi-regels .icon-round { width: 28px; height: 28px; }
.ksi-regels .icon-round .icon { width: 14px; height: 14px; }
.ksi-regels li > span:nth-child(2) { display: grid; gap: 1px; min-width: 0; }
.ksi-regels strong { font-size: 13.5px; color: var(--heading); }
.ksi-regels .muted { font-size: 12.5px; line-height: 18px; }
.switch-row.ksi-switches { gap: 16px; grid-template-columns: minmax(0, 1fr); }
.ksi-waarschuwing { display: flex; gap: 8px; align-items: flex-start; margin: -6px 0 0 54px; color: var(--warn); font-size: 13px; line-height: 19px; font-weight: 550; }
.ksi-waarschuwing .icon { width: 16px; height: 16px; flex: none; margin-top: 1px; }

/* Kennisbank: herhaalbare rijen */
.ksi-tonen { grid-template-columns: minmax(0, 1fr); }
.ksi-rijen { list-style: none; display: grid; gap: 10px; counter-reset: rij; }
.ksi-rij { position: relative; display: grid; gap: 12px; padding: 14px 16px 14px 44px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-soft); counter-increment: rij; }
.ksi-rij::before { content: counter(rij, decimal-leading-zero); position: absolute; left: 14px; top: 16px; font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--faint); }
.ksi-rij textarea { min-height: 72px; }
.ksi-weg { justify-self: end; text-decoration: none; }
.ksi-weg .icon { width: 14px; height: 14px; }

/* Test de AI */
.ksi-voorbeelden { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.ksi-chip { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: inherit; font-size: 12.5px; font-weight: 550; cursor: pointer; transition: border-color var(--t), background var(--t); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ksi-chip:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.ksi-chip:focus-visible { outline: none; box-shadow: var(--ring); }

.ksi-uitkomst { margin-top: 24px; padding: 20px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel-2), var(--surface) 140px); box-shadow: var(--shadow-float); display: grid; gap: 16px; scroll-margin-top: 90px; }
.ksi-uitkomst:focus { outline: none; }
.ksi-uitkomst.is-fout { box-shadow: none; background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad); font-weight: 600; }
.ksi-uitkomst-versturen { border-color: var(--ok-line); }
.ksi-uitkomst-escalatie { border-color: var(--warn-line); }
.ksi-uitkomst-kop { display: flex; gap: 14px; align-items: flex-start; }
.ksi-uitkomst-titel { font-size: 17px; line-height: 24px; font-weight: 700; letter-spacing: -0.02em; color: var(--heading); }
.ksi-uitkomst-kop .muted { margin-top: 2px; }
.ksi-uitkomst-wanneer { display: flex; gap: 6px; align-items: center; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--i-teal); }
.ksi-uitkomst-wanneer .icon { width: 15px; height: 15px; }
.ksi-feiten { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.ksi-feiten > div { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line-soft); min-width: 0; }
.ksi-feiten dt { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.ksi-feiten dd { margin: 4px 0 0; font-weight: 650; color: var(--heading); font-variant-numeric: tabular-nums; }
.ksi-feiten dd .muted { font-weight: 500; font-size: 12.5px; }
.ksi-esc { list-style: none; display: grid; gap: 6px; }
.ksi-esc li { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--ink-2); font-size: 13.5px; line-height: 20px; }
.ksi-esc .icon { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--warn-dot); }
.ksi-regel { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--ok-soft); color: var(--ink-2); font-size: 13.5px; line-height: 20px; }
.ksi-regel .icon { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--ok-dot); }
.ksi-antwoord { padding: 14px 16px; border-radius: 14px; border-top-right-radius: 6px; background: var(--navy-soft); }
.ksi-antwoord-kop { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; font-size: 12.5px; font-weight: 650; color: var(--accent); }
.ksi-antwoord-kop .icon { width: 15px; height: 15px; color: var(--accent-bright); }
.ksi-uitkomst > .help { display: flex; gap: 6px; align-items: center; }
.ksi-uitkomst > .help .icon { width: 15px; height: 15px; color: var(--faint); }

/* Koppelen met bol: binnen een sectie wat minder ruimte onder het adres */
.ksi-sectie .ks-adresblok { margin-bottom: 22px; }

@media (min-width: 640px) {
  .ksi-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ksi-niveaus { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
  .ksi-tonen, .ksi-modi { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
  .ksi-cats li { grid-template-columns: minmax(0, 1fr) minmax(210px, 270px); align-items: center; gap: 16px; }
  .ksi-rij-product { grid-template-columns: 170px minmax(0, 1fr); }
  .ksi-rij .ksi-weg { grid-column: 1 / -1; }
  .ksi-feiten { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1100px) {
  .ksi-overzicht { grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 32px; align-items: start; }
}

@media (max-width: 639px) {
  .ksi-kop { gap: 12px; margin-bottom: 20px; }
  .ksi-kop > .badge { display: none; }
  .ksi-nr { width: 30px; height: 30px; }
  .ksi-stats dd { font-size: 22px; line-height: 28px; }
  .ksi-segment { width: 100%; }
  .ksi-segment label { flex: 1; }
  .ksi-segment span { min-width: 0; }
  .ksi-waarschuwing { margin-left: 0; }
  .ksi-rij { padding-left: 16px; padding-top: 34px; }
  .ksi-rij::before { top: 12px; left: 16px; }
  .ksi-uitkomst { padding: 16px; }
  .ksi-recent time { display: none; }
  .ksi-recent li > a, .ksi-recent li > div { grid-template-columns: auto minmax(0, 1fr); }
}
