/* Expandable SEO — designsysteem.
   De kleuren voor datavisualisatie komen uit een gevalideerd palet: alle acht
   categorische tinten halen de lichtheidsband, de chroma-ondergrens en de
   kleurenblindheid-scheiding in zowel licht als donker. Drie tinten in de
   lichte modus zitten onder 3:1 contrast met het oppervlak; daarom staat bij
   elke grafiek een tabel of directe labels, nooit kleur als enige signaal. */

:root {
    color-scheme: light;

    /* Oppervlakken en inkt */
    --plane: #f9f9f7;
    --surface: #fcfcfb;
    --surface-2: #f3f3f0;
    --surface-3: #ebebe6;
    --ink: #0b0b0b;
    --ink-2: #52514e;
    --ink-3: #898781;
    --grid: #e1e0d9;
    --axis: #c3c2b7;
    --border: rgba(11, 11, 11, 0.1);
    --border-strong: rgba(11, 11, 11, 0.18);
    --shadow: 0 1px 2px rgba(11, 11, 11, .04), 0 8px 24px -12px rgba(11, 11, 11, .12);

    /* Categorische reeksen, vaste volgorde — nooit cyclisch hergebruiken */
    --s1: #2a78d6;
    --s2: #eb6834;
    --s3: #1baf7a;
    --s4: #eda100;
    --s5: #e87ba4;
    --s6: #008300;
    --s7: #4a3aa7;
    --s8: #e34948;

    /* Sequentiële ramp (één tint, licht naar donker) */
    --seq-1: #cde2fb;
    --seq-2: #9ec5f4;
    --seq-3: #6da7ec;
    --seq-4: #3987e5;
    --seq-5: #256abf;
    --seq-6: #184f95;
    --seq-7: #0d366b;

    /* Ordinale ramp: op licht niet lichter dan stap 250 (2:1 contrast) */
    --ord-1: #86b6ef;
    --ord-2: #5598e7;
    --ord-3: #3987e5;
    --ord-4: #256abf;
    --ord-5: #184f95;

    /* Status — gereserveerd, altijd met icoon en label, nooit als reekskleur */
    --good: #0ca30c;
    --warning: #fab219;
    --serious: #ec835a;
    --critical: #d03b3b;
    --good-text: #006300;
    --critical-text: #b02a2a;

    --accent: #2a78d6;
    --accent-ink: #ffffff;
    --focus: #2a78d6;

    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --font: system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    --header-h: 56px;
    --nav-h: 60px;
}

@media (prefers-color-scheme: dark) {
    :root:where(:not([data-theme="light"])) {
        color-scheme: dark;
        --plane: #0d0d0d;
        --surface: #161615;
        --surface-2: #1f1f1e;
        --surface-3: #2a2a28;
        --ink: #ffffff;
        --ink-2: #c3c2b7;
        --ink-3: #898781;
        --grid: #2c2c2a;
        --axis: #383835;
        --border: rgba(255, 255, 255, 0.1);
        --border-strong: rgba(255, 255, 255, 0.18);
        --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
        --s1: #3987e5;
        --s2: #d95926;
        --s3: #199e70;
        --s4: #c98500;
        --s5: #d55181;
        --s6: #008300;
        --s7: #9085e9;
        --s8: #e66767;
        --seq-1: #0d366b;
        --seq-2: #184f95;
        --seq-3: #256abf;
        --seq-4: #3987e5;
        --seq-5: #6da7ec;
        --seq-6: #9ec5f4;
        --seq-7: #cde2fb;
        --ord-1: #184f95;
        --ord-2: #256abf;
        --ord-3: #3987e5;
        --ord-4: #6da7ec;
        --ord-5: #9ec5f4;
        --good-text: #0ca30c;
        --critical-text: #e66767;
        --accent: #3987e5;
        --focus: #6da7ec;
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --plane: #0d0d0d;
    --surface: #161615;
    --surface-2: #1f1f1e;
    --surface-3: #2a2a28;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --ink-3: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.18);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    --s4: #c98500;
    --s5: #d55181;
    --s6: #008300;
    --s7: #9085e9;
    --s8: #e66767;
    --seq-1: #0d366b;
    --seq-2: #184f95;
    --seq-3: #256abf;
    --seq-4: #3987e5;
    --seq-5: #6da7ec;
    --seq-6: #9ec5f4;
    --seq-7: #cde2fb;
    --ord-1: #184f95;
    --ord-2: #256abf;
    --ord-3: #3987e5;
    --ord-4: #6da7ec;
    --ord-5: #9ec5f4;
    --good-text: #0ca30c;
    --critical-text: #e66767;
    --accent: #3987e5;
    --focus: #6da7ec;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--plane);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: none;
}

body { padding-bottom: env(safe-area-inset-bottom); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ------------------------------------------------------------------ header */

.app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 12px;
    height: var(--header-h);
    padding: 0 16px;
    padding-top: env(safe-area-inset-top);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: saturate(1.6) blur(12px);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 650;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: var(--ink);
    color: var(--plane);
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
}

.brand-sub { color: var(--ink-3); font-weight: 450; font-size: 13px; }

.header-spacer { flex: 1; }

.header-tools { display: flex; align-items: center; gap: 8px; }

/* ------------------------------------------------------------------ controls */

.select, .btn, .input {
    font: inherit;
    font-size: 13.5px;
    color: var(--ink);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    cursor: pointer;
    transition: background .12s, border-color .12s;
}

.select { padding-right: 26px; appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
                      linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
    background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.input { cursor: text; }
.select:hover, .btn:hover, .input:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.btn-primary {
    background: var(--accent);
    border-color: transparent;
    color: var(--accent-ink);
    font-weight: 560;
}
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 86%, black); }

.btn-icon { padding: 6px 8px; line-height: 1; }

.btn-sm { font-size: 12.5px; padding: 4px 8px; }

/* ------------------------------------------------------------------ nav */

.tabs {
    display: flex;
    gap: 2px;
    padding: 8px 16px 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: calc(var(--header-h) + env(safe-area-inset-top));
    z-index: 35;
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 13px 11px;
    border: none;
    background: none;
    color: var(--ink-2);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    border-radius: 6px 6px 0 0;
}
.tab:hover { background: var(--surface-2); color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); font-weight: 620; border-bottom-color: var(--accent); }
.tab svg { width: 16px; height: 16px; flex-shrink: 0; }
.tab-badge {
    background: var(--critical);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    padding: 0 4px;
}

/* ------------------------------------------------------------------ filter row */

.filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: var(--plane);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: calc(var(--header-h) + 43px + env(safe-area-inset-top));
    z-index: 30;
}

.filter-label { font-size: 12px; color: var(--ink-3); font-weight: 550; text-transform: uppercase; letter-spacing: .04em; }

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

.chip {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink-2);
    font: inherit;
    font-size: 12.5px;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
}
.chip:hover { background: var(--surface-2); color: var(--ink); }
.chip[aria-pressed="true"] {
    background: var(--ink);
    color: var(--plane);
    border-color: var(--ink);
    font-weight: 560;
}

/* ------------------------------------------------------------------ layout */

main { padding: 18px 16px 24px; max-width: 1560px; margin: 0 auto; }

.section { margin-bottom: 26px; scroll-margin-top: 190px; }

.section-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.section-head h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 640;
    letter-spacing: -0.01em;
}

.section-head .hint { color: var(--ink-3); font-size: 13px; flex: 1; min-width: 200px; }

.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-wide { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
    min-width: 0;
}

.card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.card-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.card-sub { font-size: 12px; color: var(--ink-3); }

/* ------------------------------------------------------------------ KPI tiles */

.kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 13px 14px;
    box-shadow: var(--shadow);
    min-width: 0;
}

.kpi-label {
    font-size: 12px;
    color: var(--ink-3);
    font-weight: 550;
    text-transform: uppercase;
    letter-spacing: .045em;
    margin-bottom: 5px;
}

.kpi-value {
    font-size: 26px;
    font-weight: 680;
    letter-spacing: -0.025em;
    line-height: 1.1;
    color: var(--ink);
}
.kpi-value .unit { font-size: 15px; font-weight: 500; color: var(--ink-2); margin-left: 2px; }

.kpi-deltas { display: flex; gap: 12px; margin-top: 7px; flex-wrap: wrap; }

.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 550; }
.delta .tag { color: var(--ink-3); font-weight: 500; }
.delta.up { color: var(--good-text); }
.delta.down { color: var(--critical-text); }
.delta.flat { color: var(--ink-3); }

.kpi-note { margin-top: 5px; font-size: 11.5px; color: var(--ink-3); }

.kpi-spark { margin-top: 8px; }

/* ------------------------------------------------------------------ tables */

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    -webkit-overflow-scrolling: touch;
}

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

thead th {
    position: sticky;
    top: 0;
    background: var(--surface-2);
    text-align: left;
    font-size: 11.5px;
    font-weight: 620;
    color: var(--ink-2);
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    z-index: 1;
}
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--ink); background: var(--surface-3); }
thead th .arrow { color: var(--accent); }

tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }

.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.truncate { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wrap-cell { max-width: 460px; }

.url-cell { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.url-cell .path { font-family: var(--mono); font-size: 12.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.url-cell .meta { font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ badges */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 5px;
    background: var(--surface-3);
    color: var(--ink-2);
    white-space: nowrap;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.badge.critical { background: color-mix(in srgb, var(--critical) 16%, transparent); color: var(--critical-text); }
.badge.warning { background: color-mix(in srgb, var(--warning) 24%, transparent); color: color-mix(in srgb, var(--warning) 70%, var(--ink)); }
.badge.good { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good-text); }
.badge.info { background: color-mix(in srgb, var(--s1) 14%, transparent); color: color-mix(in srgb, var(--s1) 80%, var(--ink)); }

.flag {
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .03em;
    padding: 2px 5px;
    border-radius: 4px;
    background: var(--surface-3);
    color: var(--ink-2);
}

/* ------------------------------------------------------------------ legend */

.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.legend-swatch { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.legend-swatch.line { height: 3px; border-radius: 2px; width: 15px; }

/* ------------------------------------------------------------------ chart */

.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .tick { font-size: 11px; fill: var(--ink-3); }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axisline { stroke: var(--axis); stroke-width: 1; }
.chart .mark-label { font-size: 11.5px; font-weight: 600; fill: var(--ink-2); }
.chart .series-label { font-size: 12px; font-weight: 620; }

.chart-tooltip {
    position: absolute;
    pointer-events: none;
    z-index: 20;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    padding: 8px 10px;
    font-size: 12.5px;
    min-width: 130px;
    opacity: 0;
    transition: opacity .1s;
}
.chart-tooltip.on { opacity: 1; }
.chart-tooltip .tt-title { font-weight: 640; margin-bottom: 5px; color: var(--ink); }
.chart-tooltip .tt-row { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.chart-tooltip .tt-row .name { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); }
.chart-tooltip .tt-row .value { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.chart-tooltip .sw { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }

/* ------------------------------------------------------------------ bullet bar */

.bullet { display: flex; align-items: center; gap: 7px; min-width: 90px; }
.bullet-track { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; min-width: 40px; }
.bullet-fill { height: 100%; border-radius: 3px; background: var(--s1); }
.bullet-value { font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--ink-2); min-width: 40px; text-align: right; }

/* ------------------------------------------------------------------ funnel */

.funnel { display: flex; flex-direction: column; gap: 3px; }
.funnel-step { display: grid; grid-template-columns: 118px 1fr auto; align-items: center; gap: 10px; }
.funnel-label { font-size: 12.5px; color: var(--ink-2); }
.funnel-bar-track {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--surface-2);
    border-radius: 4px;
    height: 26px;
}
.funnel-bar {
    height: 100%;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding-left: 8px;
    min-width: 3px;
    flex-shrink: 0;
}
.funnel-bar span { font-size: 12px; font-weight: 620; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.funnel-bar-outside { font-size: 12px; font-weight: 600; color: var(--ink-2); padding-left: 7px; white-space: nowrap; }
.funnel-rate {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    min-width: 52px;
    text-align: right;
}

/* ------------------------------------------------------------------ alerts */

.alert-row {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
}
.alert-row:last-child { border-bottom: none; }
.alert-icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }
.alert-body { flex: 1; min-width: 0; }
.alert-title { font-size: 13.5px; font-weight: 570; color: var(--ink); }
.alert-detail { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; word-break: break-word; }
.alert-advice { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; padding-left: 9px; border-left: 2px solid var(--accent); }
.alert-meta { display: flex; gap: 8px; margin-top: 5px; align-items: center; flex-wrap: wrap; }

/* ------------------------------------------------------------------ misc */

.empty {
    display: grid;
    place-items: center;
    gap: 8px;
    padding: 34px 18px;
    text-align: center;
    color: var(--ink-3);
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
}
.empty strong { color: var(--ink-2); font-weight: 570; }

.notice {
    display: flex;
    gap: 9px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--s1) 8%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--s1) 24%, transparent);
    font-size: 13px;
    color: var(--ink-2);
    margin-bottom: 12px;
}
.notice.warn { background: color-mix(in srgb, var(--warning) 12%, var(--surface)); border-color: color-mix(in srgb, var(--warning) 34%, transparent); }
.notice strong { color: var(--ink); }

.spinner {
    width: 15px; height: 15px;
    border: 2px solid var(--border-strong);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading { display: grid; place-items: center; gap: 10px; padding: 48px; color: var(--ink-3); }

.skeleton {
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.3s infinite;
    border-radius: var(--radius-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }

.toast-host {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom) + 16px);
    right: 16px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(420px, calc(100vw - 32px));
}
.toast {
    background: var(--ink);
    color: var(--plane);
    padding: 10px 13px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    box-shadow: var(--shadow);
    animation: slide-in .18s ease-out;
}
.toast.error { background: var(--critical); color: #fff; }
.toast.success { background: var(--good-text); color: #fff; }
.toast.warn { background: var(--warning); color: var(--ink-1); }
@keyframes slide-in { from { transform: translateY(10px); opacity: 0; } }

dialog {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--ink);
    padding: 0;
    max-width: min(760px, calc(100vw - 24px));
    width: 100%;
    max-height: 86vh;
    box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .4);
}
dialog::backdrop { background: rgba(0, 0, 0, .5); backdrop-filter: blur(3px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.dialog-head h3 { margin: 0; font-size: 15px; font-weight: 640; }
.dialog-body { padding: 16px; overflow-y: auto; max-height: calc(86vh - 58px); }

/* Korte labels alleen op smalle schermen. */
.lbl-short { display: none; }

.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.pointer { cursor: pointer; }

/* ------------------------------------------------------------------ responsive */

@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-wide { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
    body { font-size: 15px; }
    main { padding: 14px 12px 88px; }
    .lbl-long { display: none; }
    .lbl-short { display: inline; }
    .hide-mobile { display: none; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
    .brand-sub { display: none; }
    .filters { top: calc(var(--header-h) + env(safe-area-inset-top)); padding: 10px 12px; gap: 6px; }
    .section { scroll-margin-top: 130px; }
    .kpi-value { font-size: 23px; }
    .truncate, .wrap-cell { max-width: 190px; }
    .funnel-step { grid-template-columns: 96px 1fr auto; }
    .funnel-label { font-size: 12px; }

    /* Tabbladen naar een vaste balk onderaan: beter met de duim te bereiken. */
    .tabs {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        height: calc(var(--nav-h) + env(safe-area-inset-bottom));
        padding: 0 4px env(safe-area-inset-bottom);
        border-top: 1px solid var(--border);
        border-bottom: none;
        background: color-mix(in srgb, var(--surface) 94%, transparent);
        backdrop-filter: blur(12px);
        justify-content: space-around;
        overflow: visible;
        z-index: 50;
    }
    .tab {
        flex-direction: column;
        gap: 2px;
        padding: 8px 4px;
        font-size: 10.5px;
        font-weight: 550;
        border-bottom: none;
        border-radius: 8px;
        flex: 1;
        justify-content: center;
        position: relative;
        text-align: center;
        line-height: 1.15;
    }
    .tab svg { width: 21px; height: 21px; }
    .tab[aria-selected="true"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
    .tab-badge { position: absolute; top: 3px; right: 12px; }
    .toast-host { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px); left: 12px; right: 12px; max-width: none; }
}

@media print {
    .app-header, .tabs, .filters, .toast-host { display: none; }
    .card, .table-wrap { break-inside: avoid; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
