/* ══════════════════════════════════════════════════════════════════════════
   Kaart (2026-10 redesign): the page and everything Leaflet draws on it.

   One global sheet, namespaced km-*: the page's own parts (Map.razor and the
   components in Components/MapView) and the markers map.js builds outside any
   Blazor scope share the same primitives (avatar, square, dot), so they live
   together and can never drift apart.

   Colour rule: ink (--aab-text) for normal, the AAB accent only for selected
   and attention, greys for done/old. AAB tokens only; no colour is written here
   that the theme does not define. Kijkmodus is always dark: it sets
   data-theme="dark" on its own root, which swaps the same tokens.
   ══════════════════════════════════════════════════════════════════════════ */

/* --- Page frame ------------------------------------------------------------ */

.pnl-content:has(> .km),
.content:has(.km) {
    max-width: none;
    padding: var(--aab-space-4) var(--aab-space-5);
}

/* The map fills the screen under the top bar AND whatever stands between it and the page: the
   Platform-operator bar, the environment banner, session and MFA warnings (#271). The content
   area already takes the height left in the shell's main column (shell.css: flex 1 0 auto); as a
   flex column it hands all of it to the map. A fixed calc(100dvh - top bar) did not know about
   those banners and ran ~40 px past the bottom of every screen, cutting off the time strip. */
.pnl-content:has(> .km) {
    display: flex;
    flex-direction: column;
}

/* One search per screen: on the map its own field (which also owns Ctrl+K and /) stands in
   for the Panel's quick search in the top bar. */
.pnl-main:has(.km) .pnl-topbar-search,
.pnl-shell .pnl-main:has(.km) .pnl-search-btn { display: none; }

.km {
    --km-ink: var(--aab-text);
    --km-on-ink: var(--aab-surface);
    --km-side: 320px;
    --km-radius: 18px;
    /* How much of the map the inspector covers at its tallest where it is a sheet along the map's
       bottom (a phone, a tablet, a narrow map): over 40% of the map stays in view above it
       (owner, 2026-10-27; it was 70% on a phone and a tablet). */
    --km-sheet-max: 55%;
    /* Its own stacking context: the map's z-indexes (the session-expired cover, 2000) count only
       inside it. It used to come with the size container now on the bar (.km-bar). */
    isolation: isolate;
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    /* Basis 0: the map's content never sets its height, the free space does. Below 440 px of
       free space the page scrolls instead of squeezing the map. */
    flex: 1 1 0;
    min-height: 440px;
    background: var(--aab-surface);
    color: var(--aab-text);
    border: 1px solid var(--aab-line);
    border-radius: var(--km-radius);
    overflow: hidden;
    font-family: var(--aab-font-body);
    font-size: 14px;
    line-height: 1.45;
}

/* The legacy theme dresses every button[type="button"] and text input (0,1,1): centred,
   bordered, 36 px tall. Reset here (same weight, later in the cascade); every rule below is
   scoped under .km (0,2,0), the same way page.css and shell.css outrank it. */
.km button {
    display: inline-block;
    min-height: 0;
    gap: normal;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: inherit;
    font: inherit;
    line-height: inherit;
    text-align: inherit;
    white-space: normal;
    justify-content: normal;
    align-items: normal;
    transition: none;
    user-select: auto;
}

.km input {
    min-height: 0;
    font: inherit;
    color: inherit;
}

.km :focus-visible {
    outline: 2px solid var(--aab-accent);
    outline-offset: 2px;
}

.km.km-full {
    position: fixed;
    inset: 0;
    z-index: var(--z-overlay);
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    border-radius: 0;
    border: 0;
}

.km .km-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

/* --- Top bar: title, tabs, search, Kijkmodus ------------------------------- */

.km .km-bar {
    /* The bar sizes its parts to the map's own width, not the window's (the Panel sidebar and the
       side panel take a varying share of it). The size container is the bar, not the whole map
       (.km): with the whole map one, Chrome now and then kept the map's height from before the
       Dag time strip arrived, and the strip overlapped the map or the list under it (#271). */
    container: km / inline-size;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--aab-line);
}

.km .km-title {
    margin: 0 4px 0 2px;
    font-family: var(--aab-font-display);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.1;
}

.km .km-tabs {
    display: flex;
    gap: 2px;
    padding: 3px;
    background: var(--aab-surface-2);
    border-radius: 11px;
}

.km .km-tabs button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--aab-text-2);
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
}

.km .km-tabs button[aria-selected="true"] {
    background: var(--aab-surface);
    color: var(--aab-text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.km .km-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--aab-accent);
}

@media (prefers-reduced-motion: no-preference) {
    .km .km-live-dot { animation: km-pulse 2s infinite; }
    @keyframes km-pulse { 50% { opacity: 0.35; } }
}

.km .km-search {
    position: relative;
    flex: 1 1 240px;
    max-width: 400px;
    margin-left: auto;
}

.km .km-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--aab-text-3);
    font-size: 13px;
    pointer-events: none;
}

.km .km-search-input {
    width: 100%;
    padding: 7px 40px 7px 32px;
    border: 1px solid var(--aab-line-strong);
    border-radius: 10px;
    background: var(--aab-surface);
}

.km .km-search-input::-webkit-search-cancel-button { display: none; }

.km .km-kbd {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    padding: 1px 6px;
    border: 1px solid var(--aab-line-strong);
    border-radius: 5px;
    color: var(--aab-text-3);
    font: 600 11px var(--aab-font-body);
    pointer-events: none;
}

.km .km-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: var(--z-floating);
    overflow: hidden;
    background: var(--aab-surface);
    border: 1px solid var(--aab-line-strong);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
}

.km .km-result {
    display: grid;
    grid-template-columns: 26px 1fr;
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    border-bottom: 1px solid var(--aab-line);
    background: none;
    text-align: left;
    cursor: pointer;
}

.km .km-result:last-child { border-bottom: 0; }
.km .km-result:hover,
.km .km-result.is-hl { background: var(--aab-surface-2); }
.km .km-result.is-empty { display: block; color: var(--aab-text-3); cursor: default; }
.km .km-result-t { min-width: 0; font-weight: 600; }
.km .km-result-t small { display: block; color: var(--aab-text-3); font-weight: 400; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* The result's icon uses the map's own shapes: round = technician, square = opdracht, dot = location. */
.km .km-result-ic {
    justify-self: center;
    display: grid;
    place-items: center;
    font: 700 9px var(--aab-font-body);
}
.km .km-result-technician { width: 22px; height: 22px; border-radius: 50%; background: var(--km-ink); color: var(--km-on-ink); }
.km .km-result-task { width: 12px; height: 12px; border: 2px solid var(--km-ink); border-radius: 3px; }
.km .km-result-location { width: 10px; height: 10px; border-radius: 50%; background: var(--aab-text-3); }
.km .km-result-customer { width: 14px; height: 10px; border: 2px solid var(--aab-text-3); border-radius: 2px; }

.km .km-watchbtn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border: 1px solid var(--aab-line-strong);
    border-radius: 10px;
    background: var(--aab-surface);
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
}

/* A narrow bar stays one row (#271): "Gereden routes" and "Kijkmodus" show only their icon
   (their text stays as the name, visually hidden), and on a phone the title goes the same way;
   the active tab says where you are. Every row the bar saves is map height. The widths are the
   bar's own, inside its padding: 836 and 536 px are 860 and 560 px of map frame. */
@media (min-width: 901px) {
    @container km (max-width: 836px) {
        .km .km-btn-t {
            position: absolute;
            width: 1px;
            height: 1px;
            overflow: hidden;
            clip: rect(0 0 0 0);
            white-space: nowrap;
        }
    }
}

@media (max-width: 900px) {
    @container km (max-width: 536px) {
        .km .km-btn-t,
        .km .km-title {
            position: absolute;
            width: 1px;
            height: 1px;
            overflow: hidden;
            clip: rect(0 0 0 0);
            white-space: nowrap;
        }

        .km .km-tabs button { padding: 6px 11px; }
    }
}

/* --- Body: side panel + map ---------------------------------------------- */

.km .km-body {
    display: grid;
    grid-template-columns: var(--km-side) minmax(0, 1fr);
    min-height: 0;
}

.km .km-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    padding: 12px;
    overflow-y: auto;
    border-right: 1px solid var(--aab-line);
}

.km .km-side section { display: flex; flex-direction: column; }
/* The side panel scrolls; its parts keep their own height instead of shrinking to fit. */
.km .km-side > * { flex-shrink: 0; }

.km .km-center {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 0;
}

.km .km-mapwrap {
    /* The chrome on the map (legend, inspector) sizes to the map, not the window. */
    container: km-map / inline-size;
    /* Its z-indexes (buttons 500, inspector 510, layers 520) count only on the map: scrolled
       under the Panel's sticky top bar (also 500) on a phone or tablet, they painted over it. */
    isolation: isolate;
    position: relative;
    min-height: 0;
    overflow: hidden;
    background: var(--aab-surface-2);
}

.km .km-map {
    position: absolute;
    inset: 0;
    z-index: 0;
    font: inherit;
    background: var(--aab-surface-2);
}

/* --- Small shared parts --------------------------------------------------- */

.km .km-h {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 6px;
    color: var(--aab-text-3);
    font-family: var(--aab-font-display);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.km .km-h-gap { margin-top: 10px; }

.km .km-h-act {
    padding: 2px;
    border: 0;
    background: none;
    color: var(--aab-accent-text);
    font: 600 12.5px var(--aab-font-body);
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
}

.km .km-note {
    margin: 0;
    color: var(--aab-text-3);
    font-size: 12.5px;
}

.km .km-note a { color: var(--aab-text-2); font-weight: 600; }
/* Attention text: the accent, whatever the element's own colour (the :is() lifts it above
   .km .km-meta and friends, which set a grey). */
.km :is(span, p, dd, small, div, b).is-att { color: var(--aab-accent-text); }
.km .km-note.is-att { font-weight: 600; }

.km .km-ok {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: var(--aab-text-3);
    font-size: 13px;
}

.km .km-stamp { margin-top: auto; }

.km .km-av {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: none;
    border-radius: 50%;
    background: var(--km-ink);
    color: var(--km-on-ink);
    font: 700 11px var(--aab-font-body);
    letter-spacing: 0.02em;
}

.km .km-av.is-off {
    background: var(--aab-surface-2);
    color: var(--aab-text-3);
    box-shadow: inset 0 0 0 1.5px var(--aab-line-strong);
}

/* Location dot: the same four states as on the map. */
.km .km-ld {
    display: inline-block;
    justify-self: center;
    width: 10px;
    height: 10px;
    flex: none;
    border-radius: 50%;
    background: var(--aab-text-3);
}
.km .km-ld.is-findings { background: var(--aab-accent); }
.km .km-ld.is-overdue { background: transparent; box-shadow: 0 0 0 2.5px var(--aab-accent); }
.km .km-ld.is-old { background: transparent; box-shadow: 0 0 0 2px var(--aab-text-3); }

.km .km-skel { display: flex; flex-direction: column; gap: 10px; }
.km .km-skel span { height: 44px; border-radius: 12px; background: var(--aab-surface-2); }
@media (prefers-reduced-motion: no-preference) {
    .km .km-skel span { animation: km-pulse 1.4s infinite; }
}

.km .km-spin {
    display: inline-block;
    width: 11px;
    height: 11px;
    border: 2px solid var(--aab-line-strong);
    border-top-color: var(--aab-text-2);
    border-radius: 50%;
    vertical-align: -1px;
}
@media (prefers-reduced-motion: no-preference) {
    .km .km-spin { animation: km-spin 0.8s linear infinite; }
    @keyframes km-spin { to { transform: rotate(360deg); } }
}

/* --- Live: KPI tiles, the Aandacht feed, lists ---------------------------- */

.km .km-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.km .km-kpi {
    padding: 8px 9px;
    border: 1px solid var(--aab-line);
    border-radius: 12px;
    background: var(--aab-surface);
    text-align: left;
    cursor: pointer;
}

.km .km-kpi b {
    display: block;
    font: 600 21px var(--aab-font-display);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.km .km-kpi span { color: var(--aab-text-3); font-size: 12px; }
.km .km-kpi.is-att b { color: var(--aab-accent-text); }
.km .km-kpi[aria-pressed="true"] { border-color: var(--km-ink); box-shadow: inset 0 0 0 1px var(--km-ink); }
.km .km-kpi.is-att[aria-pressed="true"] { border-color: var(--aab-accent); box-shadow: inset 0 0 0 1px var(--aab-accent); }

.km .km-feed { display: flex; flex-direction: column; gap: 6px; }

.km .km-alert {
    display: grid;
    grid-template-columns: 4px 1fr auto;
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 9px 10px 9px 0;
    overflow: hidden;
    border: 1px solid var(--aab-line);
    border-radius: 12px;
    background: var(--aab-surface);
    text-align: left;
    cursor: pointer;
}

.km .km-alert::before {
    content: "";
    align-self: stretch;
    border-radius: 0 3px 3px 0;
    background: var(--aab-accent);
}

.km .km-alert b { display: block; font-weight: 600; }
.km .km-alert small { display: block; color: var(--aab-text-2); font-size: 12.5px; }
.km .km-alert time { padding-right: 2px; color: var(--aab-text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.km .km-alert.is-sel { background: var(--aab-accent-soft); }

.km .km-list { display: flex; flex-direction: column; }

.km .km-item {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 7px 8px;
    border: 0;
    border-radius: 10px;
    background: none;
    text-align: left;
    cursor: pointer;
}

.km .km-item:hover { background: var(--aab-surface-2); }
.km .km-item.is-sel { background: var(--aab-accent-soft); }
.km .km-nm { display: block; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.km .km-meta { display: block; color: var(--aab-text-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.km .km-meta.is-att { font-weight: 600; }
.km .km-rt { color: var(--aab-text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.km .km-rt.is-att { font-weight: 600; }

.km .km-more {
    margin-top: 6px;
    padding: 7px;
    border: 1px solid var(--aab-line-strong);
    border-radius: 10px;
    background: var(--aab-surface);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

/* A row with a time on the left: Dagverloop, planning, inspector lists. */
.km .km-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 8px;
    width: 100%;
    padding: 6px 8px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.km .km-row:hover { background: var(--aab-surface-2); }
.km .km-row.is-static { cursor: default; }
.km .km-row.no-time { grid-template-columns: minmax(0, 1fr); }
.km .km-row.no-time time { display: none; }
.km .km-row.is-static:hover { background: none; }
.km .km-row time { padding-top: 1px; color: var(--aab-text-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.km .km-row b { display: block; font-weight: 600; }
.km .km-row small { display: block; color: var(--aab-text-3); font-size: 12.5px; }
.km .km-row.is-att small { color: var(--aab-accent-text); font-weight: 600; }
.km .km-row.is-active { background: var(--aab-accent-soft); }
.km .km-row.is-muted b { color: var(--aab-text-3); font-weight: 400; }

/* --- Dag ------------------------------------------------------------------- */

.km .km-daybar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.km .km-daybar button {
    padding: 5px 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: none;
    color: var(--aab-text-2);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.km .km-daybar button[aria-pressed="true"] {
    border-color: var(--aab-line-strong);
    background: var(--aab-surface);
    color: var(--aab-text);
}

.km .km-datepick {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    color: var(--aab-text-3);
}

.km .km-datepick input {
    padding: 4px 6px;
    border: 1px solid var(--aab-line-strong);
    border-radius: 8px;
    background: var(--aab-surface);
    font-size: 12.5px;
    width: 118px;
    max-width: 118px;
}

.km .km-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.km .km-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid var(--aab-line-strong);
    border-radius: 999px;
    background: var(--aab-surface);
    font-weight: 600;
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.km .km-chip[aria-pressed="true"] { border-color: var(--km-ink); background: var(--km-ink); color: var(--km-on-ink); }
.km .km-chip .km-av { width: 20px; height: 20px; margin-left: -6px; font-size: 9px; }
.km .km-chip[aria-pressed="true"] .km-av { background: var(--km-on-ink); color: var(--km-ink); }
.km .km-chip[aria-pressed="false"] .km-av { opacity: 0.55; }
.km .km-chip-n { font-weight: 600; }
.km .km-chip[aria-pressed="true"] .km-ld.is-overdue,
.km .km-chip[aria-pressed="true"] .km-ld.is-old { box-shadow: 0 0 0 2px var(--km-on-ink); }

.km .km-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.km .km-stats div { padding: 8px; border-radius: 10px; background: var(--aab-surface-2); }
.km .km-stats b { display: block; font: 600 16px var(--aab-font-display); font-variant-numeric: tabular-nums; }
.km .km-stats span { color: var(--aab-text-3); font-size: 11.5px; }

.km .km-plan { gap: 0; }

.km .km-input {
    width: 100%;
    padding: 7px 12px;
    border: 1px solid var(--aab-line-strong);
    border-radius: 10px;
    background: var(--aab-surface);
}

/* --- Map chrome: controls, layers, legend --------------------------------- */

.km .km-ctl {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.km .km-ctl button {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--aab-line-strong);
    border-radius: 10px;
    background: var(--aab-surface);
    color: var(--aab-text);
    font-size: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    cursor: pointer;
}

.km .km-ctl button:hover { background: var(--aab-surface-2); }
.km .km-ctl button.is-on { border-color: var(--km-ink); box-shadow: inset 0 0 0 1px var(--km-ink); }

.km .km-layers {
    position: absolute;
    top: 12px;
    right: 56px;
    z-index: 520;
    width: 280px;
    max-width: calc(100% - 72px);
    padding: 10px 12px 12px;
    background: var(--aab-surface);
    border: 1px solid var(--aab-line-strong);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.km .km-sw {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid var(--aab-line);
}

.km .km-sw small { display: block; color: var(--aab-text-3); font-size: 12px; }

.km .km-tog {
    position: relative;
    flex: none;
    width: 36px;
    height: 22px;
    padding: 0;
    border: 1px solid var(--aab-line-strong);
    border-radius: 999px;
    background: var(--aab-surface-2);
    cursor: pointer;
}

.km .km-tog::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--aab-text-3);
    transition: transform var(--aab-duration-fast) var(--aab-ease-standard);
}

.km .km-tog[aria-checked="true"] { border-color: var(--km-ink); background: var(--km-ink); }
.km .km-tog[aria-checked="true"]::after { transform: translateX(14px); background: var(--km-on-ink); }

.km .km-bases { display: flex; gap: 4px; }

.km .km-bases button {
    flex: 1;
    padding: 5px;
    border: 1px solid var(--aab-line-strong);
    border-radius: 8px;
    background: var(--aab-surface);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
}

.km .km-bases button[aria-pressed="true"] { border-color: var(--km-ink); background: var(--km-ink); color: var(--km-on-ink); }

.km .km-legend {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 450;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    max-width: calc(100% - 140px);
    padding: 6px 10px;
    background: var(--aab-surface);
    border: 1px solid var(--aab-line);
    border-radius: 10px;
    color: var(--aab-text-2);
    font-size: 12px;
    opacity: 0.96;
}

/* With the inspector open the legend keeps to the free part of the map. On a map too narrow to
   leave it a useful strip (a 1024 px laptop, where the max-width below went negative and the
   legend became a 22 px column spilling under the inspector) it steps aside until the inspector
   closes, as it already did on a phone (#271). The width is the one where the inspector becomes
   a sheet along the map's bottom, over the legend (see "A narrow map" below). */
.km .km-mapwrap.has-insp .km-legend { max-width: calc(100% - 360px - 92px); }

@container km-map (max-width: 720px) {
    .km .km-mapwrap.has-insp .km-legend { display: none; }
}

.km .km-legend-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.km .km-legend-item i { display: inline-block; flex: none; }

.km .km-sw-tech { width: 12px; height: 12px; border-radius: 50%; background: var(--km-ink); }
.km .km-sw-task-scheduled,
.km .km-sw-task-enRoute,
.km .km-sw-task-inProgress,
.km .km-sw-task-done,
.km .km-sw-task-notVisited { width: 10px; height: 10px; border: 2px solid var(--km-ink); border-radius: 3px; background: var(--aab-surface); }
.km .km-sw-task-enRoute { border-style: dashed; }
.km .km-sw-task-inProgress { background: var(--km-ink); }
.km .km-sw-task-done { border-color: var(--aab-text-3); background: var(--aab-text-3); opacity: 0.5; }
.km .km-sw-task-notVisited { border-color: var(--aab-accent); background: var(--aab-accent); }
.km .km-sw-loc-ok { width: 8px; height: 8px; border-radius: 50%; background: var(--aab-text-3); }
.km .km-sw-loc-findings { width: 8px; height: 8px; border-radius: 50%; background: var(--aab-accent); }
.km .km-sw-loc-overdue { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 0 2px var(--aab-accent); }
.km .km-sw-loc-old { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 0 2px var(--aab-text-3); }
.km .km-sw-trail { width: 16px; height: 3px; border-radius: 2px; background: var(--aab-text-3); }
.km .km-sw-focus { width: 16px; height: 3px; border-radius: 2px; background: var(--aab-accent); }
.km .km-sw-plan { width: 16px; height: 0; border-top: 2px dashed var(--aab-text-3); }
.km .km-sw-link { width: 16px; height: 0; border-top: 2px dashed var(--aab-text-2); }
.km .km-sw-nodata { width: 16px; height: 0; border-top: 2px dotted var(--aab-text-3); }
.km .km-sw-stop { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--aab-text-3); }
.km .km-sw-stop-unplanned { width: 10px; height: 10px; border-radius: 50%; border: 2px dashed var(--aab-accent); }
.km .km-sw-building { width: 10px; height: 8px; border: 1px solid var(--aab-text-3); background: var(--aab-surface-2); }

.km .km-error {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 540;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: calc(100% - 80px);
    padding: 8px 12px;
    background: var(--aab-surface);
    border: 1px solid var(--aab-accent);
    border-radius: 10px;
    color: var(--aab-accent-text);
    font-weight: 600;
}

/* --- Inspector --------------------------------------------------------------- */

.km .km-insp {
    position: absolute;
    top: 12px;
    right: 56px;
    bottom: 12px;
    z-index: 510;
    display: flex;
    flex-direction: column;
    width: 360px;
    max-width: calc(100% - 72px);
    overflow: hidden;
    background: var(--aab-surface);
    border: 1px solid var(--aab-line-strong);
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

@media (prefers-reduced-motion: no-preference) {
    .km .km-insp { animation: km-slide var(--aab-duration-base) var(--aab-ease-enter); }
    @keyframes km-slide { from { opacity: 0; transform: translateX(16px); } }
}

.km .km-x {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--aab-text-3);
    font-size: 15px;
    cursor: pointer;
}

.km .km-x:hover { background: var(--aab-surface-2); color: var(--aab-text); }

.km .km-insp-h { padding: 14px 40px 10px 14px; border-bottom: 1px solid var(--aab-line); }

.km .km-kind {
    color: var(--aab-text-3);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.km .km-insp-h h2 {
    margin: 2px 0;
    font: 600 20px var(--aab-font-display);
    line-height: 1.2;
}

.km .km-insp-h p { margin: 0; color: var(--aab-text-2); }
.km .km-insp-h p.is-att { color: var(--aab-accent-text); font-weight: 600; }

.km .km-insp-b {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 12px 14px 14px;
    overflow-y: auto;
}

.km .km-insp-sec { display: flex; flex-direction: column; }

.km .km-pills { display: flex; flex-wrap: wrap; gap: 6px; }

.km .km-pill {
    padding: 1px 9px;
    border-radius: 999px;
    background: var(--aab-surface-2);
    color: var(--aab-text-2);
    font-size: 11.5px;
    font-weight: 700;
}

.km .km-pill.is-att { background: var(--aab-accent-soft); color: var(--aab-accent-text); }

.km .km-kv {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
    margin: 0;
    color: var(--aab-text-2);
    font-size: 13.5px;
}

.km .km-kv dt { font-weight: 400; }
.km .km-kv dd { margin: 0; color: var(--aab-text); font-weight: 600; overflow-wrap: anywhere; }
.km .km-kv dd.is-att { color: var(--aab-accent-text); }

.km .km-visits {
    position: relative;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0 0 0 16px;
    list-style: none;
}

.km .km-visits::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: var(--aab-line-strong);
}

.km .km-visit {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 8px;
    padding: 6px 0 8px;
}

.km .km-visit::before {
    content: "";
    position: absolute;
    left: -16px;
    top: 11px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--aab-surface);
    box-shadow: 0 0 0 2px var(--km-ink);
}

.km .km-visit.is-marked::before { background: var(--aab-accent); box-shadow: 0 0 0 2px var(--aab-accent); }
.km .km-visit b { font-weight: 600; }
.km .km-visit small { grid-column: 1 / -1; color: var(--aab-text-3); font-size: 12.5px; }
.km .km-visit-link { color: var(--aab-text-2); font-size: 12.5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.km .km-visit-link:hover { text-decoration: underline; }
.km .km-visit-link.is-plain { font-weight: 400; color: var(--aab-text-3); }

.km .km-links { display: flex; flex-wrap: wrap; gap: 6px; }

.km .km-lnk {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border: 1px solid var(--aab-line-strong);
    border-radius: 9px;
    background: var(--aab-surface);
    color: var(--aab-text);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
}

.km .km-lnk:hover { background: var(--aab-surface-2); color: var(--aab-text); }
.km .km-lnk.is-pri { border-color: var(--km-ink); background: var(--km-ink); color: var(--km-on-ink); }
.km .km-lnk.is-pri:hover { opacity: 0.9; background: var(--km-ink); color: var(--km-on-ink); }
.km .km-ext { font-size: 11px; opacity: 0.7; }

/* --- Time strip ------------------------------------------------------------ */

.km .km-tl {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 18px 14px 10px 44px;
    border-top: 1px solid var(--aab-line);
    background: var(--aab-surface);
}

.km .km-tl.is-playable { grid-template-columns: auto 1fr auto; padding-left: 14px; }
.km .km-tl.is-playable .km-track-wrap { padding-left: 30px; }

.km .km-track-wrap { position: relative; min-width: 0; }

.km .km-track { position: relative; touch-action: none; }
.km .km-tl.is-playable .km-track { cursor: pointer; }

.km .km-lane {
    position: absolute;
    left: 0;
    right: 0;
    border-radius: 3px;
    background: var(--aab-surface-2);
}

.km .km-lane.is-hl { box-shadow: 0 0 0 2px var(--aab-accent); }

.km .km-band { position: absolute; top: 0; height: 100%; border-radius: 3px; }
.km .km-band.is-drive { background: var(--aab-text-3); opacity: 0.45; }
.km .km-band.is-stop { background: var(--km-ink); }
.km .km-band.is-unplanned { background: var(--aab-accent); }
.km .km-band.is-noData { background: repeating-linear-gradient(90deg, var(--aab-line-strong) 0 3px, transparent 3px 6px); }

.km .km-lane-label {
    position: absolute;
    left: -32px;
    width: 26px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: none;
    color: var(--aab-text-3);
    font: 700 10px var(--aab-font-body);
    cursor: pointer;
}

.km .km-lane-label:hover { background: var(--aab-surface-2); color: var(--aab-text); }

.km .km-ticks {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 14px;
    color: var(--aab-text-3);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

/* The time labels never hang past the strip's ends (#271). Centred on their moment at the end of
   the day, half a label stuck out: side by side into the speed button's gap, but on a phone or
   tablet (the speed button on its own row) past the map's frame, which then scrolled sideways.
   --km-at is the moment as a fraction of the strip (MapTimeStrip.razor, map-replay.js).
   An hour label is a box of five digits (HH:mm, tabular figures) centred on its hour, held
   inside the track at either end. */
.km .km-ticks span {
    position: absolute;
    left: clamp(0px, calc(var(--km-at, 0) * 100% - 2.5ch), calc(100% - 5ch));
    width: 5ch;
    text-align: center;
}

.km .km-now {
    position: absolute;
    top: 0;
    bottom: 14px;
    border-left: 2px dotted var(--aab-text-3);
    pointer-events: none;
}

.km .km-head {
    position: absolute;
    top: -4px;
    bottom: 14px;
    left: 0;
    width: 2px;
    transform: translateX(-1px);
    background: var(--aab-accent);
    pointer-events: none;
}

/* The replay's time rides along with the playhead: from starting at it at the start of the strip
   to ending at it at the end (--km-at, set by map-replay.js), so it never leaves the strip. */
.km .km-head::before {
    content: attr(data-t);
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(calc(var(--km-at, 0.5) * -100%));
    padding: 0 3px;
    border-radius: 4px;
    background: var(--aab-surface);
    color: var(--aab-accent-text);
    font: 700 11px var(--aab-font-body);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.km .km-play {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: var(--km-ink);
    color: var(--km-on-ink);
    font-size: 18px;
    cursor: pointer;
}

.km .km-speed {
    padding: 5px 9px;
    border: 1px solid var(--aab-line-strong);
    border-radius: 8px;
    background: var(--aab-surface);
    font-weight: 600;
    font-size: 12.5px;
    white-space: nowrap;
    cursor: pointer;
}

.km .km-tl-note { white-space: nowrap; }

/* --- Session expired ------------------------------------------------------- */

.km .km-expired {
    position: absolute;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: var(--aab-space-6);
    background: var(--aab-bg);
    text-align: center;
}

.km .km-expired > div { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 420px; }
.km .km-expired i { font-size: 40px; color: var(--aab-text-3); }
.km .km-expired h2 { margin: 0; font: 600 30px var(--aab-font-display); }
.km .km-expired p { margin: 0; color: var(--aab-text-2); font-size: 17px; }
.km .km-expired .km-lnk { padding: 10px 18px; font-size: 15px; }
.km.km-watch .km-expired { position: fixed; }

/* --- Kijkmodus ------------------------------------------------------------- */

.km.km-watch {
    position: fixed;
    inset: 0;
    z-index: var(--z-overlay);
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 16px;
    padding: calc(18px + env(safe-area-inset-top, 0px)) 22px calc(14px + env(safe-area-inset-bottom, 0px));
    border: 0;
    border-radius: 0;
    background: var(--aab-bg);
    color: var(--aab-text);
}

.km.km-watch .km-body { grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; }
.km.km-watch .km-center { grid-template-rows: minmax(0, 1fr); }
.km.km-watch .km-mapwrap { border: 1px solid var(--aab-line); border-radius: 16px; }

.km .km-wtop { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; }
.km .km-wclock { font: 600 46px var(--aab-font-display); font-variant-numeric: tabular-nums; line-height: 1; }
.km .km-wdate { margin-top: 4px; color: var(--aab-text-2); font-size: 15px; }
/* Two failed polls in a row: the wall says its numbers are old instead of looking current. */
.km .km-wstale { margin-top: 6px; color: var(--aab-accent-text); font-size: 15px; font-weight: 600; }
.km .km-wk { display: flex; flex-wrap: wrap; gap: 28px; margin-left: auto; }
.km .km-wk b { display: block; font: 600 34px var(--aab-font-display); font-variant-numeric: tabular-nums; line-height: 1; }
.km .km-wk span { color: var(--aab-text-3); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; }
.km .km-wk .is-att b { color: var(--aab-accent-text); }

.km .km-wexit {
    padding: 8px 14px;
    border: 1px solid var(--aab-line-strong);
    border-radius: 10px;
    background: var(--aab-surface);
    font-weight: 600;
    cursor: pointer;
}

/* The wall's side panel never cuts a card in half (#271). The alerts give way first: their
   container shrinks, and as a wrapping column that hides its overflow it shows only the whole
   cards that fit (the next card wraps into a column off to the right). The team keeps its place;
   the header still counts every alert. Only a team taller than the whole screen scrolls. */
.km .km-wside { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: hidden auto; }
.km .km-wside > * { flex-shrink: 0; }
.km .km-wside .km-h { font-size: 13px; }

.km .km-wside > .km-walerts {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 12px;
    flex: 0 1 auto;
    min-height: 0;
    overflow: hidden;
}

.km .km-walerts > * { width: 100%; }

.km .km-walert {
    display: grid;
    gap: 2px;
    padding: 14px 16px;
    border: 1px solid var(--aab-line);
    border-radius: 14px;
    background: var(--aab-surface);
    transition: background var(--aab-duration-slow), border-color var(--aab-duration-slow);
}

.km .km-walert b { font: 600 19px var(--aab-font-display); }
.km .km-walert span { color: var(--aab-text-2); font-size: 15px; }
.km .km-walert.is-on { border-color: var(--aab-accent); background: var(--aab-accent-soft); }

.km .km-wteam { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.km .km-wteam > div {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--aab-line);
    border-radius: 12px;
    background: var(--aab-surface);
    font-size: 14px;
    min-width: 0;
}

.km .km-wteam small { display: block; color: var(--aab-text-3); font-size: 12.5px; }
.km .km-wteam small.is-att { color: var(--aab-accent-text); }

/* One line of whole events, newest first (#271): an event that does not fit wraps onto a second
   line below the box instead of being cut off mid-word at the screen edge. One event longer than
   the line (a phone) ends in an ellipsis. */
.km .km-wtick {
    display: flex;
    flex-wrap: wrap;
    column-gap: 28px;
    row-gap: 12px;
    height: calc(12px + 1px + 22px);
    overflow: hidden;
    padding-top: 12px;
    border-top: 1px solid var(--aab-line);
    color: var(--aab-text-2);
    font-size: 15px;
    line-height: 22px;
    white-space: nowrap;
}

.km .km-wtick > span { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.km .km-wtick b { margin-right: 6px; color: var(--aab-text); font-variant-numeric: tabular-nums; }

/* A short wall screen (a 720p or 768p TV, a laptop): the same wall, a size smaller, so more
   alert cards fit. */
@media (min-width: 901px) and (max-height: 820px) {
    .km.km-watch { gap: 12px; padding-top: calc(12px + env(safe-area-inset-top, 0px)); padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
    .km .km-wclock { font-size: 38px; }
    .km .km-wk b { font-size: 28px; }
    .km .km-wside,
    .km .km-wside > .km-walerts { gap: 8px; }
    .km .km-walert { padding: 9px 14px; border-radius: 12px; }
    .km .km-walert b { font-size: 17px; }
    .km .km-walert span { font-size: 14px; }
    .km .km-wteam > div { padding: 6px 10px; }
}

/* --- Phone and narrow screens: stacked, map first -------------------------- */

@media (max-width: 900px) {
    .pnl-content:has(> .km),
    .content:has(.km) { padding: var(--aab-space-2); }

    /* The page scrolls here: the map takes its content's height, not the screen's. */
    .km { flex: none; height: auto; min-height: 0; grid-template-rows: auto auto; }
    .km .km-body { grid-template-columns: 1fr; }
    .km .km-side { order: 2; border-right: 0; border-top: 1px solid var(--aab-line); overflow: visible; }
    .km .km-center { order: 1; }
    /* svh: the screen with the browser's address bar showing, so the map's bottom (legend,
       scale) is on screen when the page opens; plain vh is the screen without it. */
    .km .km-mapwrap { height: 62vh; height: 62svh; min-height: 340px; }
    /* A pick in a list below the map scrolls the map back into view (map.js revealInspector):
       it lands just under the Panel's sticky top bar, the inspector sheet at its foot on screen. */
    .km .km-mapwrap { scroll-margin-top: calc(var(--topbar-height, 60px) + var(--aab-space-2)); }
    .km .km-insp { scroll-margin-bottom: var(--aab-space-2); }
    .km .km-search { order: 3; flex-basis: 100%; max-width: none; margin-left: 0; }
    .km .km-watchbtn { margin-left: auto; }
    .km .km-mapwrap.has-insp .km-legend { display: none; }

    /* A sheet along the bottom, left of the map buttons: it covered the lower ones (#271).
       --km-sheet is how much of the map it covers at its tallest; map.js flyTo reads it and lifts
       a picked point into the part above it, never sideways (that clears a side inspector). */
    .km .km-mapwrap {
        --km-sheet: var(--km-sheet-max);
    }

    .km .km-insp {
        top: auto;
        left: 8px;
        right: 56px;
        bottom: 8px;
        width: auto;
        max-width: none;
        max-height: var(--km-sheet);
    }

    .km .km-layers { right: 54px; left: 8px; width: auto; }
    .km .km-tl { padding-left: 40px; }
    .km .km-ticks span:nth-child(even) { display: none; }
    .km .km-legend { max-width: calc(100% - 120px); }
    .km .km-tl.is-playable { grid-template-columns: auto 1fr; }
    .km .km-tl.is-playable .km-speed { grid-column: 1 / -1; justify-self: end; }

    /* Kijkmodus on a narrow screen scrolls as a whole: map first, then every alert and the team. */
    .km.km-watch { overflow: auto; grid-template-rows: auto auto auto; }
    /* min-height auto: the rows take their content's height. With 0 the one-screen frame
       squeezed the body row and the ticker sat on top of the map and the alerts. */
    .km.km-watch .km-body { grid-template-columns: 1fr; min-height: auto; }
    .km.km-watch .km-mapwrap { height: 50vh; height: 50svh; }
    .km .km-wside { order: 2; overflow: visible; }
    .km .km-wside > .km-walerts { flex-wrap: nowrap; overflow: visible; }
    .km .km-wteam { grid-template-columns: 1fr; }

    /* Full screen is the map and its time strip, filling the screen under the bar whatever the
       bar's height; the side panel waits until full screen closes. */
    .km.km-full { grid-template-rows: auto minmax(0, 1fr); }
    .km.km-full .km-body { grid-template-rows: minmax(0, 1fr); }
    .km.km-full .km-side { display: none; }
    .km.km-full .km-mapwrap { height: auto; min-height: 0; }
}

/* --- A narrow map beside the side panel: the inspector as a sheet ---------- */

/* A map under 720 px wide has no room for the inspector at its side: on a 1024 px laptop with the
   Panel menu open the map is about 400 px and the side inspector covered all but 4% of it (owner,
   2026-10-27). There it is the same sheet along the map's bottom as on a phone or tablet (above).
   The width is the map's own (its container, .km-mapwrap), so the Panel menu, the side panel and
   full screen all count; a 1440 px screen (an 820 px map) keeps the inspector at the side. A
   container query styles only what is inside the container, so --km-sheet goes on the map element
   itself, where map.js flyTo reads it, and on the sheet. */
@media (min-width: 901px) {
    @container km-map (max-width: 720px) {
        .km .km-map,
        .km .km-insp { --km-sheet: var(--km-sheet-max); }

        .km .km-insp {
            top: auto;
            left: 8px;
            right: 56px;
            bottom: 8px;
            width: auto;
            max-width: none;
            max-height: var(--km-sheet);
        }
    }
}

/* ══════════════════════════════════════════════════════════════════════════
   Leaflet: markers map.js and map-replay.js draw (outside any Blazor scope)
   Round avatar = technician, rounded square = opdracht, dot = location.
   ══════════════════════════════════════════════════════════════════════════ */

.km .km-icon { background: none !important; border: 0 !important; }

.km .km-mk { position: relative; cursor: pointer; }

/* Technician: the round avatar with initials and the first name under it. */
.km .km-mk-tech { width: 30px; height: 30px; }

.km .km-mk-tech .km-av {
    width: 30px;
    height: 30px;
    border: 2.5px solid var(--aab-surface);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    font-size: 10.5px;
}

.km .km-mk-tech.is-stale .km-av {
    background: var(--aab-surface);
    color: var(--aab-text-2);
    border: 2px dashed var(--aab-text-3);
    opacity: 0.8;
}

.km .km-mk-tech.is-alert .km-av { border-color: var(--aab-accent); }

.km .km-mk-tech.is-sel::before {
    content: "";
    position: absolute;
    inset: -8px;
    border: 2px solid var(--aab-accent);
    border-radius: 50%;
    background: var(--aab-accent-soft);
}

@media (prefers-reduced-motion: no-preference) {
    .km .km-mk-tech.is-sel::before { animation: km-ring 1.8s ease-out infinite; }
    @keyframes km-ring { 0% { transform: scale(0.9); opacity: 1; } 100% { transform: scale(1.25); opacity: 0.35; } }
}

.km .km-mk-label {
    position: absolute;
    left: 50%;
    top: calc(100% + 2px);
    transform: translateX(-50%);
    color: var(--aab-text);
    font: 600 11.5px var(--aab-font-body);
    font-style: normal;
    white-space: nowrap;
    pointer-events: none;
    text-shadow: 0 0 3px var(--aab-surface), 0 0 3px var(--aab-surface), 0 0 2px var(--aab-surface);
}

.km .km-mk-tech.label-top .km-mk-label { top: auto; bottom: calc(100% + 2px); }
.km .km-mk-tech.label-left .km-mk-label { left: auto; right: calc(100% + 4px); top: 50%; transform: translateY(-50%); }
.km .km-mk-tech.label-right .km-mk-label { left: calc(100% + 4px); top: 50%; transform: translateY(-50%); }

/* Opdracht: outline = gepland, dashed = onderweg, filled = bezig, faded = klaar, red = niet bezocht. */
.km .km-mk-task { width: 18px; height: 18px; display: grid; place-items: center; }

.km .km-mk-task > i {
    display: block;
    width: 14px;
    height: 14px;
    border: 2.2px solid var(--km-ink, var(--aab-text));
    border-radius: 3.5px;
    background: var(--aab-surface);
    box-shadow: 0 0 0 1.5px var(--aab-surface);
}

.km .km-mk-task.is-enRoute > i { border-style: dashed; }
.km .km-mk-task.is-inProgress > i { background: var(--aab-text); }
.km .km-mk-task.is-done > i { border-color: var(--aab-text-3); background: var(--aab-text-3); opacity: 0.55; }
.km .km-mk-task.is-notVisited > i { border-color: var(--aab-accent); background: var(--aab-accent); }
.km .km-mk-task.is-sel > i { width: 18px; height: 18px; border-width: 3px; border-color: var(--aab-accent); box-shadow: 0 0 0 4px var(--aab-accent-soft); }

.km .km-mk-task .km-mk-label { left: calc(100% + 4px); top: 50%; transform: translateY(-50%); color: var(--aab-text-2); font-size: 11px; font-weight: 700; }

/* Location: grey dot, red fill = bevindingen, red ring = achterstallig, grey ring = > 90 dagen. */
.km .km-mk-loc { width: 18px; height: 18px; display: grid; place-items: center; }

.km .km-mk-loc > i {
    display: block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--aab-text-3);
    opacity: 0.75;
    box-shadow: 0 0 0 1.5px var(--aab-surface);
}

.km .km-mk-loc.is-findings > i { width: 11px; height: 11px; background: var(--aab-accent); opacity: 1; }
.km .km-mk-loc.is-overdue > i { width: 11px; height: 11px; background: var(--aab-surface); box-shadow: 0 0 0 2.5px var(--aab-accent); opacity: 1; }
.km .km-mk-loc.is-old > i { width: 11px; height: 11px; background: var(--aab-surface); box-shadow: 0 0 0 2px var(--aab-text-3); opacity: 1; }
.km .km-mk-loc.is-sel > i { width: 15px; height: 15px; box-shadow: 0 0 0 3px var(--aab-accent), 0 0 0 10px var(--aab-accent-soft); opacity: 1; }

/* Clustered locations: a quiet disc with the count; a red ring when attention hides inside. */
.km .km-cluster {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--aab-surface);
    border: 2px solid var(--aab-text-3);
    color: var(--aab-text);
    font: 700 12px var(--aab-font-body);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.km .km-cluster.has-attention { border-color: var(--aab-accent); }

/* Lines. */
.km .km-line-plan { stroke: var(--aab-text-3); stroke-width: 2; stroke-dasharray: 6 6; fill: none; }
.km .km-line-focus { stroke: var(--aab-accent); stroke-width: 4; stroke-opacity: 0.85; fill: none; }
/* The selected opdracht and the technician on their way to it: a quiet straight dashed line. */
.km .km-line-link { stroke: var(--aab-text-2); stroke-width: 2; stroke-dasharray: 6 4; stroke-opacity: 0.75; fill: none; }

/* Replay: the whole day faint (where the van will go), the part already driven in grey, and
   only the technician in focus in the accent. A team stays readable instead of a black tangle. */
.km .km-trail { fill: none; stroke: var(--aab-text-3); stroke-width: 2.5; stroke-opacity: 0.28; }
.km .km-trail-stop { stroke-width: 4; }
.km .km-trail-noData { stroke-width: 2; stroke-dasharray: 3 7; stroke-opacity: 0.45; }
.km .km-trail.is-dim { stroke-opacity: 0.15; }
.km .km-trail.is-hl { stroke-opacity: 0.4; }

.km .km-travelled { fill: none; stroke: var(--aab-text-2); stroke-width: 3; stroke-opacity: 0.8; }
.km .km-travelled.is-hl { stroke: var(--aab-accent); stroke-width: 4.5; stroke-opacity: 1; }
.km .km-travelled.is-dim { stroke-opacity: 0.35; }

.km .km-stop { fill: var(--aab-surface); fill-opacity: 0.9; stroke: var(--aab-text-2); stroke-width: 2; cursor: pointer; }
.km .km-stop.is-unplanned { stroke: var(--aab-accent); stroke-dasharray: 3 2; }

.km .km-building-sel { fill: var(--aab-accent); fill-opacity: 0.12; stroke: var(--aab-accent); stroke-width: 2.5; }

/* BAG and cadastral overlays: blended on the dark map so they read as lines, not slabs. */
.km .km-bag-overlay { opacity: 0.7; }
[data-theme="dark"] .km-bag-overlay { mix-blend-mode: screen; }

/* Leaflet's own bits, themed. */
.km .leaflet-container { background: var(--aab-surface-2); font-family: var(--aab-font-body); }

.km .leaflet-control-scale-line {
    background: var(--aab-surface);
    border-color: var(--aab-text-3);
    color: var(--aab-text-2);
    opacity: 0.9;
}

.km .leaflet-control-attribution {
    background: var(--aab-surface);
    color: var(--aab-text-3);
    opacity: 0.85;
    font-size: 10px;
}

.km .leaflet-control-attribution a { color: var(--aab-text-2); }
.km .leaflet-bottom.leaflet-right { margin-bottom: 0; }
.km .leaflet-marker-icon:focus-visible { outline: 2px solid var(--aab-accent); outline-offset: 3px; border-radius: 50%; }

/* Dark basemap (Panel overhaul, 2026-09): the PDOK grey tiles turned into a dark map. Invert
   gives dark land and light roads; the hue turn keeps water blue; brightness/contrast soften
   it to the AAB dark surfaces. Only the tiles are filtered, never the markers. */
.aab-dark-tiles {
    filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9);
}
