/* ==========================================================================
   XASI PREMIUM LAAG
   Komt NA style.css en verfijnt vorm, typografie, diepte en beweging.
   Kleuren blijven uit de thema-variabelen komen, dus elk kleurenschema
   (licht, neon, matrix, fluid, axiom, ...) krijgt dezelfde afwerking.
   Uitzetten: verwijder de <link> naar premium.css in index.html.
   Tegels hoeven NIET aangepast te worden: alles werkt op .tile.
   ========================================================================== */

/* --- 1. LETTERTYPES (zelf gehost, OFL-licentie) --- */
@font-face {
    font-family: "Inter";
    src: url("../_fonts/inter-var.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Sora";
    src: url("../_fonts/sora-var.woff2") format("woff2");
    font-weight: 100 800;
    font-style: normal;
    font-display: swap;
}

/* --- 2. ONTWERPMATEN --- */
:root {
    --xp-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --xp-display: "Sora", "Inter", "Segoe UI", sans-serif;
    --xp-ease: cubic-bezier(0.22, 0.8, 0.24, 1);
    --xp-ease-spring: cubic-bezier(0.34, 1.4, 0.5, 1);
    --xp-radius-tile: 14px;
    --xp-radius-ctrl: 11px;
    --xp-gap: clamp(8px, 0.75vw, 14px);
    --xp-gutter: clamp(10px, 1.6vw, 32px);
    --xp-tile-min: 116px;
    --xp-rail-w: 64px;
    --xp-hairline: color-mix(in srgb, var(--text-color) 10%, transparent);
    --xp-sheen: rgba(255, 255, 255, 0.16);
    --xp-lift-shadow: rgba(0, 0, 0, 0.55);
}

body.light-mode {
    --xp-sheen: rgba(255, 255, 255, 0.55);
    --xp-lift-shadow: color-mix(in srgb, var(--accent-color) 30%, rgba(0, 0, 0, 0.30));
}

/* --- 3. TYPOGRAFIE --- */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body,
button,
input,
select,
textarea {
    font-family: var(--xp-font);
    font-feature-settings: "cv11", "ss01", "ss03";
}

html body .copyright-wrapper {
    font-family: var(--xp-font);
    /* Facebook en disclaimer altijd op gelijke hoogte; passen ze niet naast
       elkaar, dan netjes gecentreerd onder elkaar (o.a. Z Fold uitgeklapt). */
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

html body .copyright-wrapper .facebook-pulse-link,
html body .copyright-wrapper .copyright-text {
    box-sizing: border-box;
    height: 36px;
    min-height: 36px;
    margin: 0;
    line-height: 1;
    vertical-align: middle;
}

::selection {
    background: color-mix(in srgb, var(--accent-color) 38%, transparent);
    color: var(--text-color);
}

/* Slanke scrollbalk in de themakleur */
html {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--accent-color) 55%, var(--border-color)) transparent;
}

/* --- 4. LOGO-INTRO: zelfde regenboog, verfijnder lettertype en gloed --- */
html body .rgb-logo-svg,
html body .rgb-logo-mobile {
    font-family: var(--xp-display) !important;
    font-weight: 700 !important;
}

html body .rgb-logo-svg text {
    letter-spacing: -0.01em;
}

html body .layer-glow text {
    stroke-width: 5px;
    opacity: 0.62;
}

html body .layer-sharp text {
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.55));
}

/* --- 5. HEADER: glas, haarlijn en diepte zodra je scrolt --- */
html body .main-header {
    -webkit-backdrop-filter: blur(18px) saturate(1.5);
    backdrop-filter: blur(18px) saturate(1.5);
    transition: background-color 0.3s, box-shadow 0.45s var(--xp-ease);
}

html.xp-scrolled body .main-header {
    box-shadow:
        0 1px 0 var(--xp-hairline),
        0 18px 40px -26px var(--xp-lift-shadow);
}

html body .main-header .header-welcome {
    letter-spacing: 0.06em;
}

/* Glazen header op desktop, voor alle thema's: main schuift onder de header door,
   zodat raster, matrix-regen, bellen en andere achtergronden erdoorheen schijnen.
   De inhoud zelf blijft exact op zijn plek. Mobiel blijft dekkend (te zwaar). */
@media (min-width: 1025px) and (hover: hover) and (pointer: fine) {
    html.xp-glass-header body main {
        margin-top: calc(-1 * var(--xp-header-h, 0px));
        padding-top: var(--xp-header-h, 0px);
        background-position: 0 var(--xp-header-h, 0px);
    }

    html.xp-glass-header body.light-mode main {
        background-position: 0 calc(var(--xp-header-h, 0px) - 1px);
    }

    /* Zachte blur: fijne details (matrix-regen, raster, tegels) blijven herkenbaar */
    html:root body .main-header {
        background-color: rgb(from var(--header-bg) r g b / 0.52) !important;
        -webkit-backdrop-filter: blur(8px) saturate(1.5) !important;
        backdrop-filter: blur(8px) saturate(1.5) !important;
        box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--accent-color) 22%, transparent);
    }

    /* Licht: iets meer dekking, anders wordt de grijze rubriektekst te zwak */
    html:root body.light-mode .main-header {
        background-color: rgb(from var(--header-bg) r g b / 0.66) !important;
    }
}

/* --- 6. ZOEKEN & THEMAKEUZE --- */
html body .search-panel {
    gap: 10px;
    padding-left: var(--xp-gutter);
    padding-right: var(--xp-gutter);
}

html body .search-box input {
    border-radius: var(--xp-radius-ctrl);
    border-color: color-mix(in srgb, var(--border-color) 80%, transparent);
    box-shadow: inset 0 1px 2px color-mix(in srgb, #000 18%, transparent);
    font-size: 0.98rem;
    letter-spacing: 0.005em;
    transition: border-color 0.25s var(--xp-ease), box-shadow 0.25s var(--xp-ease), background-color 0.25s;
}

html body .search-box input::placeholder {
    color: color-mix(in srgb, var(--text-color) 46%, transparent);
}

html body .search-box input:focus {
    border-color: var(--accent-color);
    box-shadow:
        0 0 0 4px color-mix(in srgb, var(--accent-color) 16%, transparent),
        0 8px 24px -14px color-mix(in srgb, var(--accent-color) 70%, transparent);
}

html body .search-submit,
html body .search-clear,
html body .search-engine {
    border-radius: var(--xp-radius-ctrl);
    font-weight: 600;
    letter-spacing: 0.01em;
    background-image: linear-gradient(180deg, color-mix(in srgb, var(--text-color) 6%, transparent), transparent 60%);
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, #fff 9%, transparent),
        0 1px 2px color-mix(in srgb, #000 22%, transparent);
    transition:
        color 0.22s var(--xp-ease),
        border-color 0.22s var(--xp-ease),
        box-shadow 0.3s var(--xp-ease),
        transform 0.22s var(--xp-ease);
}

html body .search-submit:hover,
html body .search-clear:hover,
html body .search-engine:hover,
html body .search-engine.is-active {
    text-shadow: none;
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, #fff 12%, transparent),
        0 0 0 1px color-mix(in srgb, var(--accent-color) 30%, transparent),
        0 6px 18px -8px color-mix(in srgb, var(--accent-color) 65%, transparent);
}

html body .search-submit:active,
html body .search-clear:active,
html body .search-engine:active,
html body .theme-option:active {
    transform: translateY(1px) scale(0.98);
}

html body .theme-selector {
    border-radius: calc(var(--xp-radius-ctrl) + 3px);
    border-color: color-mix(in srgb, var(--border-color) 80%, transparent);
    background: color-mix(in srgb, var(--card-bg) 35%, transparent);
    box-shadow: inset 0 1px 2px color-mix(in srgb, #000 16%, transparent);
}

html body .theme-option {
    border-radius: var(--xp-radius-ctrl);
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: color 0.22s var(--xp-ease), background-color 0.22s, box-shadow 0.3s var(--xp-ease), transform 0.22s var(--xp-ease);
}

html body .theme-option.is-active {
    text-shadow: none;
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, #fff 10%, transparent),
        0 4px 14px -6px color-mix(in srgb, var(--accent-color) 60%, transparent),
        0 0 0 1px color-mix(in srgb, var(--accent-color) 28%, transparent);
}

/* --- 7. RUBRIEKBALK: rustige letterspatiëring + actieve rubriek --- */
html body nav a {
    position: relative;
    font-weight: 600;
    letter-spacing: 0.09em;
    font-size: clamp(0.68rem, 0.84vw, 1rem);
}

html body nav a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 6px;
    width: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--accent-color);
    box-shadow: 0 0 10px color-mix(in srgb, var(--accent-color) 70%, transparent);
    transform: translateX(-50%);
    opacity: 0;
    transition: width 0.4s var(--xp-ease), opacity 0.3s;
}

html body nav a.xp-current {
    color: var(--accent-color) !important;
}

html body nav a.xp-current::after {
    width: 18px;
    opacity: 1;
}

/* Op desktop vervangt de vlam op de headerlijn het streepje onder de actieve rubriek;
   mobiel houdt het streepje, want daar scrollt de rubriekenbalk zelf ook. */
@media (min-width: 1025px) and (hover: hover) and (pointer: fine) {
    html.xp-has-flame body nav a.xp-current::after {
        opacity: 0;
    }
}

@media (max-width: 1024px), (hover: none), (pointer: coarse) {
    html body .xp-navline,
    html body .xp-flame {
        display: none;
    }

    /* De letterafstand telt ook achter de laatste letter: het streepje schuift dat halve stukje terug. */
    html body nav a::after {
        bottom: 7px;
        left: calc(50% - 0.045em);
    }

    html body nav .xp-nav-yours a::after {
        left: calc(50% + 10px - 0.045em);
    }

    /* A.I. eindigt op een lichte punt: optisch ligt het midden daar iets naar links. */
    html body nav a[href="#ai"]::after {
        left: calc(50% - 0.045em - 1px);
    }
}

/* Bij (prik)bord staat het hoverstreepje onder het woord, niet onder punaise plus woord. */
html body nav .xp-nav-yours a::after {
    left: calc(50% + 10px);
}

/* Boven de themaknop (1200), zodat die de vlam niet half bedekt; onder de open cirkel (1300). */
html.xp-has-flame body .main-header {
    z-index: 1250;
}

@media (max-width: 1024px), (hover: none), (pointer: coarse) {
    html.xp-has-flame body .main-header { z-index: 20000; }
}

html body .xp-navline {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1.5px;
    background: radial-gradient(ellipse 300px 100% at var(--xp-flame-x, 50%) 50%,
        color-mix(in srgb, var(--accent-color) 45%, #fff) 0%,
        var(--accent-color) 34%,
        transparent 100%);
    pointer-events: none;
}

html body .xp-flame {
    position: absolute;
    left: 0;
    bottom: -0.25px;
    width: 0;
    height: 0;
    pointer-events: none;
    will-change: transform;
}

html body .xp-flame i {
    position: absolute;
    display: block;
    border-radius: 50%;
}

html body .xp-flame-core {
    left: -2.5px;
    top: -2.5px;
    width: 5px;
    height: 5px;
    background: color-mix(in srgb, var(--accent-color) 30%, #fff);
}

html body .xp-flame-glow {
    left: -18px;
    top: -18px;
    width: 36px;
    height: 36px;
    background: radial-gradient(circle closest-side, var(--accent-color), color-mix(in srgb, var(--accent-color) 30%, transparent) 42%, transparent);
    animation: xpBurstFlare 4.2s ease-in-out infinite;
}

/* De staart verschijnt alleen tijdens het glijden en wijst tegen de beweging in. */
html body .xp-flame-tail {
    right: 0;
    top: -1.5px;
    width: 110px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-color) 70%, #fff);
    transform: scaleX(0);
    transform-origin: 100% 50%;
}

@media (prefers-reduced-motion: reduce) {
    html body .xp-flame-glow { animation: none; opacity: 0.8; }
}

/* Lichte thema's: een kleine, ingetogen dot. Een grote gloed oogt daar als een vlek
   en hangt bij (prik)bord over de themaknop. */
html body.light-mode .xp-flame-glow {
    left: -8px;
    top: -8px;
    width: 16px;
    height: 16px;
    background: radial-gradient(circle closest-side, color-mix(in srgb, var(--accent-color) 45%, transparent), transparent);
    animation: none;
    opacity: 1;
}

html body.light-mode .xp-flame-core {
    left: -3px;
    top: -3px;
    width: 6px;
    height: 6px;
    background: var(--accent-color);
    box-shadow: 0 0 0 1.5px var(--bg-color);
}

html body.light-mode .xp-navline {
    background: radial-gradient(ellipse 220px 100% at var(--xp-flame-x, 50%) 50%,
        var(--accent-color) 0%,
        color-mix(in srgb, var(--accent-color) 55%, transparent) 40%,
        transparent 100%);
}

@media (hover: hover) and (pointer: fine) {
    html body nav a:hover {
        text-shadow: none !important;
    }

    html body nav a:hover::after {
        width: 28px;
        opacity: 0.85;
    }
}

/* --- 8. RUBRIEKKOPPEN: zwevende pil met display-letter --- */
html body .category-jump-control {
    border-radius: 999px;
    border-color: color-mix(in srgb, var(--border-color) 85%, transparent);
    -webkit-backdrop-filter: blur(10px) saturate(1.3);
    backdrop-filter: blur(10px) saturate(1.3);
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, #fff 8%, transparent),
        0 10px 30px -16px var(--xp-lift-shadow),
        0 0 22px -6px color-mix(in srgb, var(--accent-color) 22%, transparent);
}

html body .category-jump-button,
html body .category-title-button {
    border-right-color: color-mix(in srgb, var(--border-color) 55%, transparent);
    transition: color 0.25s var(--xp-ease), background 0.3s var(--xp-ease), box-shadow 0.3s var(--xp-ease);
}

html body .category-jump-button {
    font-weight: 500;
    text-shadow: none;
}

html body .category-jump-edge {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
}

html body .category-jump-control .category-header,
html body .category-header {
    font-family: var(--xp-display);
    font-weight: 600;
    font-size: 1.12rem;
    letter-spacing: 0.2em;
    text-indent: 0.2em; /* compenseert de spatiëring rechts, zodat het echt centreert */
}

/* --- 9. GRID: volle schermbreedte, zodat widescreen meer tegels per rij toont --- */
html body .grid-container {
    gap: var(--xp-gap);
    padding-left: var(--xp-gutter);
    padding-right: var(--xp-gutter);
}

@media (min-width: 600px) {
    html body .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(var(--xp-tile-min), 1fr));
    }
}

/* "In huis ontwikkeld"-rij: zelfde tussenruimte als het gewone raster */
html body .showcase-grid {
    gap: var(--xp-gap);
}

/* --- 10. TEGELS: diepte, zachte lift, glans en een tastbare klik --- */
html:root body .tile {
    border-radius: var(--xp-radius-tile);
    isolation: isolate;
    box-shadow:
        0 1px 2px color-mix(in srgb, #000 22%, transparent),
        0 6px 16px -10px var(--xp-lift-shadow);
    transition:
        transform 0.45s var(--xp-ease),
        box-shadow 0.45s var(--xp-ease),
        border-color 0.3s var(--xp-ease),
        background-color 0.3s;
}

html:root body .tile img,
html:root body a.tile.tile-featured img {
    border-radius: calc(var(--xp-radius-tile) - 1px);
}

/* Lichtrand + glans (alleen gewone tegels: featured gebruikt ::before/::after al) */
html body .tile:not(.tile-featured)::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    pointer-events: none;
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, #fff 16%, transparent),
        inset 0 0 0 1px color-mix(in srgb, #fff 4%, transparent);
    background: linear-gradient(
        115deg,
        transparent 0%,
        transparent 38%,
        var(--xp-sheen) 50%,
        transparent 62%,
        transparent 100%
    ) no-repeat;
    background-size: 260% 100%;
    background-position: 130% 0;
    transition: background-position 0.9s var(--xp-ease);
}

html:root body .tile:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}

/* Muis: zachte lift met gekleurde diepte in de themakleur */
@media (hover: hover) and (pointer: fine) {
    html:root body .tile:hover {
        z-index: 10;
        /* Alleen schalen vanuit het midden: de tegel schuift nooit onder de
           cursor vandaan, dus geen hover-flikkering bij verticaal bewegen. */
        transform: scale(1.045);
        box-shadow:
            0 2px 4px color-mix(in srgb, #000 18%, transparent),
            0 22px 44px -18px var(--xp-lift-shadow),
            0 14px 34px -14px color-mix(in srgb, var(--accent-color) 55%, transparent),
            0 0 0 1px color-mix(in srgb, var(--accent-color) 45%, transparent);
    }

    html body .tile:not(.tile-featured):hover::after {
        background-position: -30% 0;
    }

}

/* Touch: geen blijvende hover, wel een directe druk-respons */
@media (hover: none), (pointer: coarse) {
    html:root body .tile:hover {
        transform: none;
    }
}

html:root body .tile:active {
    transform: translateY(0) scale(0.965);
    transition-duration: 0.12s;
}

/* Naamlabel onderin de tegel (data-name komt uit de alt-tekst via premium.js) */
@media (hover: hover) and (pointer: fine) {
    html body .tile[data-name]::before {
        content: attr(data-name);
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 3;
        /* Vastgepinde tegels knippen niet af (de punaise steekt uit): zelf de hoeken volgen. */
        border-bottom-left-radius: inherit;
        border-bottom-right-radius: inherit;
        padding: 22px 8px 7px;
        background: linear-gradient(180deg, transparent, rgba(6, 8, 12, 0.55) 40%, rgba(6, 8, 12, 0.86));
        color: #fff;
        font-family: var(--xp-font);
        font-size: 0.7rem;
        font-weight: 600;
        letter-spacing: 0.02em;
        line-height: 1.2;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
        opacity: 0;
        transform: translateY(8px);
        transition: opacity 0.28s var(--xp-ease), transform 0.35s var(--xp-ease);
        pointer-events: none;
    }

    html body .tile[data-name]:hover::before,
    html body .tile[data-name]:focus-visible::before {
        opacity: 1;
        transform: none;
    }
}

/* --- RECENT BEZOCHT --- */
html body .xp-recent-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    margin: 30px auto;
    padding: 4px 4px 4px 22px;
    border: 1px solid color-mix(in srgb, var(--border-color) 85%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--card-bg) 82%, transparent);
    -webkit-backdrop-filter: blur(10px) saturate(1.3);
    backdrop-filter: blur(10px) saturate(1.3);
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, #fff 8%, transparent),
        0 10px 30px -16px var(--xp-lift-shadow),
        0 0 22px -6px color-mix(in srgb, var(--accent-color) 22%, transparent);
}

html body .xp-recent-title {
    padding-right: 10px;
    color: var(--accent-color);
    font-family: var(--xp-display);
    font-size: 1.12rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    white-space: nowrap;
}

html body .xp-recent-clear {
    min-height: 30px;
    padding: 0 14px;
    border: 1px solid color-mix(in srgb, var(--border-color) 60%, transparent);
    border-radius: 999px;
    background: transparent;
    color: var(--nav-text);
    font: inherit;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.22s var(--xp-ease), border-color 0.22s var(--xp-ease), background-color 0.22s;
}

html body .xp-recent-clear:hover,
html body .xp-recent-clear:focus-visible {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background: color-mix(in srgb, var(--accent-color) 10%, transparent);
    outline: none;
}

html body .xp-recent[hidden] {
    display: none;
}

/* Aan/uit-schakelaar (iOS-stijl): aan = themakleur, knop schuift veerkrachtig */
html body .xp-switch {
    position: relative;
    flex: 0 0 auto;
    width: 44px;
    height: 26px;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--border-color) 80%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-color) 14%, transparent);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: background-color 0.3s var(--xp-ease), border-color 0.3s var(--xp-ease), box-shadow 0.3s var(--xp-ease);
}

html body .xp-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--text-color) 82%, var(--bg-color));
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    transition: transform 0.4s var(--xp-ease-spring), background-color 0.3s var(--xp-ease);
}

html body .xp-switch[aria-checked="true"] {
    border-color: var(--accent-color);
    background: var(--accent-color);
    box-shadow:
        inset 0 1px 3px rgba(0, 0, 0, 0.2),
        0 0 16px -2px color-mix(in srgb, var(--accent-color) 65%, transparent);
}

html body .xp-switch[aria-checked="true"]::after {
    transform: translateX(18px);
    background: #fff;
}

html body .xp-switch:hover {
    border-color: var(--accent-color);
}

html body .xp-switch:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}

html body .xp-switch:active::after {
    width: 24px;
}

html body .xp-switch[aria-checked="true"]:active::after {
    transform: translateX(14px);
}

html body .xp-recent-bar .xp-switch {
    margin-right: 4px;
}

/* Net aangezet of net gewist: lege vakjes die laten zien waar tegels komen */
html body .xp-recent-hint {
    margin: -14px 0 16px;
    color: var(--nav-text);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-align: center;
}

html body .xp-recent-ghost {
    aspect-ratio: 1 / 1;
    border: 1.5px dashed color-mix(in srgb, var(--border-color) 75%, transparent);
    border-radius: var(--xp-radius-tile);
    background: color-mix(in srgb, var(--text-color) 3%, transparent);
    animation: xpGhostIn 0.6s var(--xp-ease) backwards;
}

html body .xp-recent-ghost[hidden] {
    display: none;
}

/* Bij elke klik opnieuw opgebouwd: de lege vakjes blijven dan rustig staan */
html body .xp-recent-grid.xp-static > .xp-recent-ghost {
    animation: none;
}

@keyframes xpGhostIn {
    from { opacity: 0; transform: scale(0.94); }
    to { opacity: 1; transform: none; }
}

/* Uitzetten: de rij vouwt zacht in */
html body .xp-recent.is-leaving .xp-recent-grid,
html body .xp-recent.is-leaving .xp-recent-hint {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
    transition: opacity 0.3s var(--xp-ease), transform 0.3s var(--xp-ease);
}

html body .xp-recent.is-leaving .xp-recent-bar {
    opacity: 0.5;
    transition: opacity 0.3s var(--xp-ease);
}

/* Uit: klein schakelaartje in de welkomstregel van de header, buiten de content */
html body .main-header .header-welcome .xp-recent-off {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid color-mix(in srgb, var(--text-color) 22%, transparent);
    color: color-mix(in srgb, var(--text-color) 70%, transparent);
    font-weight: 500;
    letter-spacing: 0.04em;
    vertical-align: middle;
}

html body .main-header .header-welcome .xp-recent-off-label {
    color: inherit;
    font-weight: 500;
    letter-spacing: 0.04em;
}

html body .header-welcome .xp-recent-off .xp-switch {
    width: 28px;
    height: 16px;
}

html body .header-welcome .xp-recent-off .xp-switch::after {
    top: 1px;
    left: 1px;
    width: 12px;
    height: 12px;
}

html body .header-welcome .xp-recent-off .xp-switch:active::after {
    width: 15px;
}

/* Bevestiging onderin */
html body .xp-toast {
    position: fixed;
    left: 50%;
    bottom: max(24px, env(safe-area-inset-bottom));
    z-index: 30000;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100vw - 32px);
    padding: 12px 20px 12px 16px;
    border: 1px solid color-mix(in srgb, var(--accent-color) 45%, var(--border-color));
    border-radius: 999px;
    background: color-mix(in srgb, var(--card-bg) 88%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
    box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.6), 0 0 24px -8px color-mix(in srgb, var(--accent-color) 45%, transparent);
    color: var(--text-color);
    font-family: var(--xp-font);
    font-size: 0.84rem;
    font-weight: 600;
    opacity: 0;
    transform: translate(-50%, 16px);
    pointer-events: none;
    transition: opacity 0.35s var(--xp-ease), transform 0.45s var(--xp-ease-spring);
}

html body .xp-toast::before {
    content: "";
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
}

html body .xp-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (max-width: 599px) {
    html body .main-header .header-welcome .xp-recent-off {
        margin-left: 8px;
        padding-left: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html body .xp-switch::after,
    html body .xp-toast,
    html body .xp-recent-ghost {
        transition: none;
        animation: none;
    }
}

/* --- (prik)bord: punaise, menu en schakelaarlabel --- */
html body .xp-recent-switch-label {
    color: var(--nav-text);
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

html body .xp-recent-menu-wrap {
    position: relative;
}

/* De balk (met het menu) ligt boven de tegels eronder, ook boven gepinde tegels */
html body .xp-recent-bar {
    position: relative;
    z-index: 60;
}

html body .xp-recent-menu-button {
    min-width: 34px;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid color-mix(in srgb, var(--border-color) 60%, transparent);
    border-radius: 999px;
    background: transparent;
    color: var(--nav-text);
    font: 700 0.9rem/1 var(--xp-font);
    letter-spacing: 0.05em;
    cursor: pointer;
}

html body .xp-recent-menu-button:hover,
html body .xp-recent-menu-button[aria-expanded="true"] {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

html body .xp-recent-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 50;
    display: grid;
    min-width: 190px;
    padding: 6px;
    border: 1px solid color-mix(in srgb, var(--accent-color) 40%, var(--border-color));
    border-radius: 14px;
    /* Dekkend: de tegels eronder mogen niet door de tekst heen schijnen */
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--accent-color) 7%, transparent), transparent 70%),
        var(--bg-color);
    box-shadow:
        0 24px 48px -16px rgba(0, 0, 0, 0.8),
        0 0 0 1px color-mix(in srgb, #fff 4%, transparent);
}

html body .xp-recent-menu[hidden] {
    display: none;
}

html body .xp-recent-menu button {
    padding: 10px 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-color);
    font: 500 0.86rem/1.2 var(--xp-font);
    text-align: left;
    cursor: pointer;
}

html body .xp-recent-menu button:hover,
html body .xp-recent-menu button:focus-visible {
    outline: none;
    background: color-mix(in srgb, var(--accent-color) 14%, transparent);
    color: var(--accent-color);
}

/* Punaise rechtsboven in de tegel */
html body .tile .xp-pin {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 6;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.35s var(--xp-ease-spring), opacity 0.25s var(--xp-ease), background-color 0.25s;
}

html body .tile .xp-pin svg {
    width: 30px;
    height: 30px;
    overflow: visible;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45));
}

html body .xp-pin .pin-head {
    fill: #e8322b;
}

html body .xp-pin .pin-body {
    fill: #c21d18;
}

html body .xp-pin .pin-shine {
    fill: rgba(255, 255, 255, 0.75);
}

html body .xp-pin .pin-needle {
    stroke: #d6dbe0;
    stroke-width: 1.6;
    stroke-linecap: round;
}

html body .xp-pin .pin-shadow {
    fill: rgba(0, 0, 0, 0.35);
}

/* Nog niet vastgepind: glazen knopje met een grijze punaise */
html body .tile .xp-pin:not(.is-pinned) {
    /* Altijd donker glas, in elk thema en elke browser: de witte punaise blijft zichtbaar. */
    background: rgba(14, 16, 22, 0.72);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    /* Licht randje en schaduw: los van zwarte, witte en gekleurde tegels. */
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.42), 0 1px 5px rgba(0, 0, 0, 0.35);
}

html body .tile .xp-pin:not(.is-pinned) svg {
    width: 22px;
    height: 22px;
    filter: none;
}

html body .tile .xp-pin:not(.is-pinned) .pin-head,
html body .tile .xp-pin:not(.is-pinned) .pin-body {
    fill: #f1f3f6;
}

html body .tile .xp-pin:not(.is-pinned) .pin-shine,
html body .tile .xp-pin:not(.is-pinned) .pin-shadow {
    display: none;
}

html body .tile .xp-pin:hover {
    transform: scale(1.12) rotate(-8deg);
}

html body .tile .xp-pin:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 1px;
}

/* Vastgepind: de punaise zit "in" de tegel, licht scheef zoals op een prikbord */
html body .tile.is-pinned .xp-pin.is-pinned {
    top: -6px;
    right: -4px;
    transform: rotate(8deg);
}

html body .tile.is-pinned .xp-pin.is-pinned:hover {
    transform: rotate(-4deg) scale(1.1);
}

html body .tile.is-pinned {
    overflow: visible;
}

/* In (prik)bord op een computer: het losse knopje pas bij hover tonen */
@media (hover: hover) and (pointer: fine) {
    html body .xp-recent-grid .tile .xp-pin:not(.is-pinned) {
        opacity: 0;
    }

    html body .xp-recent-grid .tile:hover .xp-pin:not(.is-pinned),
    html body .xp-recent-grid .tile .xp-pin:not(.is-pinned):focus-visible {
        opacity: 1;
    }
}

/* Touch: kleiner knopje, altijd zichtbaar in (prik)bord */
@media (hover: none), (pointer: coarse) {
    html body .xp-recent-grid .tile .xp-pin:not(.is-pinned) {
        width: 30px;
        height: 30px;
        opacity: 0.85;
    }
}

/* Duidelijk onderscheid: gepind = rand in themakleur + punaise, recent = klokje */
html body .xp-recent-grid .tile.is-pinned {
    /* Zelfde 1px-rand als alle tegels, alleen in de themakleur: optisch even dik */
    border-color: var(--accent-color);
    box-shadow:
        0 1px 2px color-mix(in srgb, #000 22%, transparent),
        0 10px 24px -14px color-mix(in srgb, var(--accent-color) 60%, transparent);
}

html body .xp-recent-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 5;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--card-bg) 72%, transparent);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, #fff 18%, transparent);
    pointer-events: none;
}

html body .xp-recent-badge svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: #f1f3f6;
    stroke-width: 2;
    stroke-linecap: round;
}

/* Telefoon: compacte balk die altijd binnen het scherm past */
@media (max-width: 599px) {
    html body .xp-recent-bar {
        max-width: calc(100% - 16px);
        gap: 6px;
        padding-left: 16px;
    }

    html body .xp-recent-title {
        padding-right: 4px;
        font-size: 0.86rem;
        letter-spacing: 0.14em;
    }


    html body .xp-recent-clear {
        padding: 0 10px;
        white-space: nowrap;
    }

    html body .xp-recent-clear-extra {
        display: none;
    }
}

/* Uitleg in het eerste lege vakje */
html body .xp-recent-ghost.xp-ghost-hint {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    padding: 10px;
    border-color: color-mix(in srgb, var(--accent-color) 55%, transparent);
    background: color-mix(in srgb, var(--accent-color) 6%, transparent);
    color: color-mix(in srgb, var(--text-color) 78%, transparent);
    font-family: var(--xp-font);
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
}

html body .xp-recent-ghost.xp-ghost-hint[hidden] {
    display: none;
}

html body .xp-ghost-hint svg {
    width: 30px;
    height: 30px;
    overflow: visible;
    animation: xpPinBob 2.6s var(--xp-ease) infinite;
}

html body .xp-ghost-hint .pin-head { fill: #e8322b; }
html body .xp-ghost-hint .pin-body { fill: #c21d18; }
html body .xp-ghost-hint .pin-shine { fill: rgba(255, 255, 255, 0.75); }
html body .xp-ghost-hint .pin-needle { stroke: #d6dbe0; stroke-width: 1.6; stroke-linecap: round; }
html body .xp-ghost-hint .pin-shadow { fill: rgba(0, 0, 0, 0.3); }

@keyframes xpPinBob {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-4px) rotate(-6deg); }
}

/* Slepen: (prik)bord licht op als landingsplek */
html.xp-dragging body .xp-recent {
    border-radius: 24px;
    outline: 2px dashed color-mix(in srgb, var(--accent-color) 55%, transparent);
    outline-offset: 8px;
    transition: outline-color 0.2s, background-color 0.2s;
}

html.xp-dragging body .xp-recent.is-drop {
    outline-style: solid;
    outline-color: var(--accent-color);
    background: color-mix(in srgb, var(--accent-color) 8%, transparent);
}

/* Touch: geen systeem-pop-up of tekstselectie bij lang indrukken */
@media (hover: none), (pointer: coarse) {
    html body main a.tile {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
}

/* Paneel na lang indrukken */
html body .xp-pin-sheet {
    position: fixed;
    inset: 0;
    z-index: 40000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 12px max(12px, env(safe-area-inset-bottom));
    font-family: var(--xp-font);
}

html body .xp-pin-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s var(--xp-ease);
}

html body .xp-pin-sheet-card {
    position: relative;
    width: min(440px, 100%);
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid color-mix(in srgb, var(--accent-color) 40%, var(--border-color));
    border-radius: 26px;
    background: color-mix(in srgb, var(--card-bg) 92%, transparent);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    backdrop-filter: blur(20px) saturate(1.5);
    box-shadow: 0 -10px 50px -12px rgba(0, 0, 0, 0.7), 0 0 34px -12px color-mix(in srgb, var(--accent-color) 60%, transparent);
    color: var(--text-color);
    transform: translateY(110%);
    transition: transform 0.42s var(--xp-ease-spring);
}

html body .xp-pin-sheet.is-open .xp-pin-sheet-backdrop { opacity: 1; }
html body .xp-pin-sheet.is-open .xp-pin-sheet-card { transform: none; }

html body .xp-pin-sheet-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

html body .xp-pin-sheet-thumb img {
    width: 58px;
    height: 58px;
    display: block;
    border-radius: 14px;
    box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.6);
}

html body .xp-pin-sheet-head strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 600;
}

html body .xp-pin-sheet-head small {
    color: var(--nav-text);
    font-size: 0.8rem;
}

html body .xp-pin-sheet-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 54px;
    border: 0;
    border-radius: 16px;
    background: var(--accent-color);
    color: var(--bg-color);
    font: 700 1rem/1 var(--xp-font);
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--accent-color) 80%, transparent);
}

html body.light-mode .xp-pin-sheet-main { color: #fff; }

html body .xp-pin-sheet-main svg {
    width: 26px;
    height: 26px;
    overflow: visible;
}

html body .xp-pin-sheet-main .pin-head { fill: #e8322b; }
html body .xp-pin-sheet-main .pin-body { fill: #c21d18; }
html body .xp-pin-sheet-main .pin-shine { fill: rgba(255, 255, 255, 0.8); }
html body .xp-pin-sheet-main .pin-needle { stroke: #fff; stroke-width: 1.6; stroke-linecap: round; }
html body .xp-pin-sheet-main .pin-shadow { display: none; }

html body .xp-pin-sheet-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

html body .xp-pin-sheet-row button {
    height: 46px;
    border: 1px solid color-mix(in srgb, var(--border-color) 80%, transparent);
    border-radius: 14px;
    background: transparent;
    color: var(--text-color);
    font: 600 0.92rem/1 var(--xp-font);
    cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
    html body .xp-ghost-hint svg { animation: none; }
    html body .xp-pin-sheet-card { transition: none; }
}

/* Volgorde verslepen */
@media (hover: hover) and (pointer: fine) {
    html body .xp-recent-grid a.tile.is-pinned {
        cursor: grab;
    }
}

html body .xp-recent-grid.is-reordering a.tile {
    transition: none;
}

/* Verplaatsen in de pagina start de inloopanimatie opnieuw: tijdens slepen uit */
html body .xp-recent-grid.is-reordering > .tile.is-dragging,
html body .xp-recent-grid.is-reordering > .tile:not(.is-pinned),
html body .xp-recent-grid.is-reordering > .xp-recent-ghost {
    animation: none !important;
    opacity: 1;
}

html body .xp-recent-grid a.tile.is-dragging {
    z-index: 30;
    cursor: grabbing;
    box-shadow:
        0 0 0 2px var(--accent-color),
        0 28px 50px -16px rgba(0, 0, 0, 0.75),
        0 0 30px -6px color-mix(in srgb, var(--accent-color) 70%, transparent);
    filter: none !important;
}

html body .xp-recent-grid.is-reordering a.tile.is-pinned:not(.is-dragging) {
    opacity: 1;
    animation: xpWiggle 0.5s ease-in-out infinite alternate;
}

html body .xp-recent-grid.is-reordering > a.tile:not(.is-pinned) {
    opacity: 0.45 !important;
}

@keyframes xpWiggle {
    from { rotate: -0.8deg; }
    to { rotate: 0.8deg; }
}

@media (prefers-reduced-motion: reduce) {
    html body .xp-recent-grid.is-reordering a.tile.is-pinned:not(.is-dragging) { animation: none; }
}

/* "(prik)bord" in de rubriekbalk, met een kleine punaise */
html body nav .xp-nav-yours a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

html body nav .xp-nav-yours svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    overflow: visible;
}

html body nav .xp-nav-yours .pin-head { fill: #e8322b; }
html body nav .xp-nav-yours .pin-body { fill: #c21d18; }
html body nav .xp-nav-yours .pin-shine { fill: rgba(255, 255, 255, 0.75); }
html body nav .xp-nav-yours .pin-needle { stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
html body nav .xp-nav-yours .pin-shadow { display: none; }

/* Merknaam (prik)bord: kleine letters zoals de XASI-producten, "(prik)" in themakleur */
html body .xp-brand {
    text-transform: none;
    white-space: nowrap;
}

html body .xp-brand em {
    font-style: normal;
    color: var(--accent-color);
}

html body .xp-recent-title .xp-brand {
    color: var(--text-color);
    font-size: 1.32rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

html body nav .xp-nav-yours .xp-brand {
    letter-spacing: 0.02em;
}

html body .xp-recent-off-label .xp-brand {
    letter-spacing: 0.02em;
}

@media (max-width: 599px) {
    html body .xp-recent-title .xp-brand {
        font-size: 1.12rem;
    }
}

/* Recent-deel van de balk: schuift weg zodra het (prik)bord vol is */
html body .xp-recent-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 320px;
    overflow: hidden;
    opacity: 1;
    transition: max-width 0.45s var(--xp-ease), opacity 0.3s var(--xp-ease), margin 0.45s var(--xp-ease);
}

html body .xp-recent.is-full .xp-recent-group {
    max-width: 0;
    margin: 0 -6px 0 0;
    opacity: 0;
    pointer-events: none;
}

html body .xp-recent-sep {
    width: 1px;
    height: 18px;
    margin: 0 4px;
    background: color-mix(in srgb, var(--text-color) 18%, transparent);
}

html body .xp-recent-switch-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

html body .xp-recent-switch-label svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

html body .xp-recent-full {
    padding: 4px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent-color) 16%, transparent);
    color: var(--accent-color);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    animation: xpGhostIn 0.5s var(--xp-ease) backwards;
}

/* (prik)bord uit: een duidelijke pil bovenaan de inhoud, onder de header */
html body .xp-board-off {
    display: flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    margin: 26px auto 8px;
    padding: 8px 10px 8px 14px;
    border: 1px dashed color-mix(in srgb, var(--accent-color) 45%, var(--border-color));
    border-radius: 999px;
    background: color-mix(in srgb, var(--card-bg) 70%, transparent);
    -webkit-backdrop-filter: blur(10px) saturate(1.3);
    backdrop-filter: blur(10px) saturate(1.3);
    box-shadow: 0 10px 28px -18px var(--xp-lift-shadow);
    animation: xpGhostIn 0.5s var(--xp-ease) backwards;
}

html body .xp-board-off-pin svg {
    width: 24px;
    height: 24px;
    display: block;
    overflow: visible;
    opacity: 0.7;
    filter: grayscale(0.6);
}

html body .xp-board-off .pin-head { fill: #e8322b; }
html body .xp-board-off .pin-body { fill: #c21d18; }
html body .xp-board-off .pin-shine { fill: rgba(255, 255, 255, 0.75); }
html body .xp-board-off .pin-needle { stroke: #d6dbe0; stroke-width: 1.6; stroke-linecap: round; }
html body .xp-board-off .pin-shadow { display: none; }

html body .xp-board-off-text {
    display: grid;
    gap: 1px;
    line-height: 1.1;
}

html body .xp-board-off-text .xp-brand {
    color: var(--text-color);
    font-family: var(--xp-display);
    font-size: 1.02rem;
    font-weight: 600;
}

html body .xp-board-off-text small {
    color: var(--nav-text);
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

html body .xp-board-off .xp-switch {
    margin-left: 6px;
}

/* Paneel: knop uitgeschakeld als het bord vol of uit staat */
html body .xp-pin-sheet-main:disabled {
    background: color-mix(in srgb, var(--text-color) 12%, transparent);
    color: var(--nav-text);
    box-shadow: none;
    cursor: not-allowed;
}

html body .xp-pin-sheet-main:disabled svg {
    filter: grayscale(1);
    opacity: 0.6;
}

@media (max-width: 599px) {
    html body .xp-recent-switch-label span {
        display: none;
    }

    html body .xp-recent-switch-label {
        display: inline-flex;
        color: var(--nav-text);
    }

    html body .xp-recent-group {
        gap: 5px;
    }

    html body .xp-recent-sep {
        margin: 0 2px;
    }
}

/* Neon op desktop: levende rasterlaag (premium.js) achter de hele pagina.
   body wordt een eigen laag, zodat de laag met z-index -1 boven de achtergrond
   van body valt maar onder alle inhoud. */
html.xp-neon-live body:is(.neon-mode, .green-mode) {
    isolation: isolate;
}

html body .xp-neon-fx {
    position: fixed;
    inset: 0;
    z-index: -1;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    mix-blend-mode: screen;
}

/* Footer half doorzichtig, met hetzelfde raster als de pagina erboven
   (positie zet premium.js), zodat de stroompulsen erin doorlopen. */
html.xp-neon-live body:is(.neon-mode, .green-mode) .cyber-footer {
    background:
        radial-gradient(circle, var(--grid-dot) 1.25px, transparent 1.9px) var(--xp-fgrid, 0 0) / 32px 32px,
        linear-gradient(var(--grid-line) 1px, transparent 1px) var(--xp-fgrid, 0 0) / 32px 32px,
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) var(--xp-fgrid, 0 0) / 32px 32px,
        radial-gradient(ellipse at 12% 24%, color-mix(in srgb, var(--footer-fog-main) 14%, transparent) 0%, transparent 46%),
        radial-gradient(ellipse at 88% 74%, color-mix(in srgb, var(--footer-fog-main) 12%, transparent) 0%, transparent 52%),
        linear-gradient(180deg, rgba(5, 7, 11, 0.42) 0%, rgba(1, 2, 4, 0.62) 100%) !important;
}

html.xp-neon-live body:is(.neon-mode, .green-mode) .cyber-footer::before {
    opacity: 0.55;
}

html.xp-neon-live body:is(.neon-mode, .green-mode) .footer-module {
    -webkit-backdrop-filter: blur(6px) saturate(1.2);
    backdrop-filter: blur(6px) saturate(1.2);
}

/* Matrix op desktop: filmregen (premium.js) achter de hele pagina; de oude DOM-regen
   en de zwarte achtergrond van main gaan uit, zodat de regen overal doorloopt. */
html.xp-matrix-live body.matrix-mode {
    isolation: isolate;
}

html body .xp-matrix-fx {
    position: fixed;
    inset: 0;
    z-index: -1;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    animation: xpMatrixIn 0.7s ease-out both;
}

@keyframes xpMatrixIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Bubbels op desktop: WebGL-zeepbellen (premium.js) achter de hele pagina; de
   DOM-bubbels gaan meteen uit. Lukt WebGL niet, dan komt xp-bubbles-nogl. */
html body .xp-bubbles-fx {
    position: fixed;
    inset: 0;
    z-index: -1;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    animation: xpMatrixIn 0.7s ease-out both;
}

@media (min-width: 1025px) and (not (pointer: coarse)) {
    html:not(.xp-bubbles-nogl) body.bubbles-mode {
        isolation: isolate;
        background:
            radial-gradient(ellipse 60% 50% at 25% 30%, rgba(255, 176, 0, 0.08), transparent 70%),
            radial-gradient(ellipse 60% 50% at 78% 70%, rgba(255, 86, 202, 0.07), transparent 70%),
            #080407 !important;
    }

    html:not(.xp-bubbles-nogl) body.bubbles-mode main {
        background: transparent;
    }

    html:not(.xp-bubbles-nogl) body.bubbles-mode .bubble-field {
        display: none;
    }

    html.xp-bubbles-live body.bubbles-mode .cyber-footer {
        background-color: rgba(8, 4, 7, 0.5) !important;
    }

    html.xp-bubbles-live body.bubbles-mode .footer-module {
        -webkit-backdrop-filter: blur(5px);
        backdrop-filter: blur(5px);
    }
}

/* Hearts op desktop: WebGL-mist (premium.js) achter de hele pagina; de originele
   hartjesregen uit dynamisch.js valt er transparant overheen. Lukt WebGL niet,
   dan komt xp-hearts-nogl en blijft alles zoals het was. */
html body .xp-hearts-fx {
    position: fixed;
    inset: 0;
    z-index: -1;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    animation: xpMatrixIn 0.7s ease-out both;
}

@media (min-width: 1025px) and (not (pointer: coarse)) {
    html:not(.xp-hearts-nogl) body.dark-hearts-mode {
        isolation: isolate;
        background:
            radial-gradient(ellipse 60% 50% at 30% 35%, rgba(230, 10, 25, 0.10), transparent 70%),
            #0c0103 !important;
    }

    html:not(.xp-hearts-nogl) body.dark-hearts-mode main {
        background: transparent !important;
        background-image: none !important;
    }

    html:not(.xp-hearts-nogl) body.dark-hearts-mode #dyn-hearts {
        background: transparent !important;
    }

    html:not(.xp-hearts-nogl) body.dark-hearts-mode #dyn-hearts::before,
    html:not(.xp-hearts-nogl) body.dark-hearts-mode #dyn-hearts::after {
        display: none;
    }

    html.xp-hearts-live body.dark-hearts-mode .cyber-footer {
        background: rgba(12, 1, 3, 0.5) !important;
    }

    html.xp-hearts-live body.dark-hearts-mode .footer-module {
        -webkit-backdrop-filter: blur(5px);
        backdrop-filter: blur(5px);
    }
}

/* Voorkom dat de oude DOM-regen even zichtbaar is voordat premium.js de filmregen
   start: op desktop meteen uit, met een passende groene gloed als voorgrond. Lukt
   WebGL niet, dan zet premium.js xp-matrix-nogl en komt de oude regen terug. */
@media (min-width: 1025px) and (not (pointer: coarse)) {
    html:not(.xp-matrix-nogl) body.matrix-mode {
        isolation: isolate;
        background:
            radial-gradient(ellipse 70% 60% at 50% 40%, rgba(var(--matrix-rgb), 0.12), transparent 72%),
            #010301 !important;
    }

    html:not(.xp-matrix-nogl) body.matrix-mode main {
        background-color: transparent;
    }

    html:not(.xp-matrix-nogl) body.matrix-mode .matrix-rain {
        display: none;
    }
}

html.xp-matrix-live body.matrix-mode main {
    background-color: transparent;
}

html.xp-matrix-live body.matrix-mode .matrix-rain {
    display: none;
}

html.xp-matrix-live body.matrix-mode .cyber-footer {
    background-color: rgba(0, 0, 0, 0.5) !important;
}

html.xp-matrix-live body.matrix-mode .footer-module {
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

/* XASI-softwaretegels: zelfde kader als alle tegels, label goed leesbaar in elk thema */
html body .tile-featured::before {
    top: 7px;
    left: 50%;
    right: auto;
    width: max-content;
    max-width: calc(100% - 12px);
    padding: 3px 9px;
    transform: translateX(-50%);
    border: 0;
    border-radius: 999px;
    /* Pil in de eigen themakleur, met een glanzende bovenrand */
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0) 55%),
        linear-gradient(135deg, color-mix(in srgb, var(--accent-color) 92%, #fff 8%), color-mix(in srgb, var(--accent-color) 72%, #000 28%));
    color: #05070c;
    font-family: var(--xp-font);
    font-size: 0.5rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    white-space: nowrap;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.28),
        0 3px 10px -3px rgba(0, 0, 0, 0.6),
        0 0 14px -2px color-mix(in srgb, var(--accent-color) 70%, transparent);
}

/* Lichte thema's hebben een donker accent: daar witte tekst */
html body.light-mode .tile-featured::before {
    color: #fff;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.22),
        0 3px 10px -4px color-mix(in srgb, var(--accent-color) 60%, rgba(0, 0, 0, 0.4));
}

/* --- Tijdrail: alleen op brede schermen --- */
html body .xp-rail {
    display: none;
}

@media (min-width: 1500px) and (hover: hover) and (pointer: fine) {
    html body .xp-rail {
        position: fixed;
        left: 0;
        top: var(--xp-header-h, 140px);
        bottom: 0;
        z-index: 900;
        width: var(--xp-rail-w);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 18px;
        padding: 28px 0 24px;
        border-right: 1px solid color-mix(in srgb, var(--accent-color) 16%, transparent);
        /* Glas: licht getint en zacht vervaagd, zodat de themalichten erdoorheen spelen */
        background: linear-gradient(90deg, color-mix(in srgb, var(--bg-color) 32%, transparent), color-mix(in srgb, var(--bg-color) 6%, transparent));
        -webkit-backdrop-filter: blur(3px) saturate(1.35);
        backdrop-filter: blur(3px) saturate(1.35);
        color: var(--text-color);
        font-family: var(--xp-font);
        pointer-events: none;
        user-select: none;
    }

    /* De Facebook-rij staat in main en krijgt deze ruimte dus al mee. */
    html.xp-has-rail body main,
    html.xp-has-rail body .xp-motto {
        padding-left: var(--xp-rail-w);
    }

    /* Links de klokbalk plus dezelfde marge als rechts: zo staat alles op één midden. */
    html.xp-has-rail body .cyber-footer {
        padding-left: calc(var(--xp-rail-w) + var(--xp-gutter));
    }

    html body .xp-rail-time,
    html body .xp-rail-date {
        writing-mode: vertical-rl;
        white-space: nowrap;
        font-variant-numeric: tabular-nums;
    }

    html body .xp-rail-time {
        font-family: var(--xp-display);
        font-size: 2rem;
        font-weight: 300;
        letter-spacing: 0.04em;
        line-height: 1;
        text-shadow: 0 0 22px color-mix(in srgb, var(--accent-color) 45%, transparent);
    }

    html body .xp-rail-time b {
        color: var(--accent-color);
        font-weight: 300;
        animation: xpRailBlink 2s steps(1) infinite;
    }

    html body .xp-rail-sec {
        color: var(--accent-color);
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: 0.1em;
        font-variant-numeric: tabular-nums;
    }

    html body .xp-rail-date {
        color: color-mix(in srgb, var(--text-color) 70%, transparent);
        font-size: 0.7rem;
        font-weight: 600;
        letter-spacing: 0.24em;
        text-transform: uppercase;
    }

    html body .xp-rail-date em {
        color: var(--accent-color);
        font-style: normal;
    }

    /* Dagverloop: een dunne lijn die over de dag volloopt, met een lichtpuntje op "nu" */
    html body .xp-rail-day {
        position: relative;
        flex: 1 1 auto;
        width: 2px;
        min-height: 60px;
        border-radius: 2px;
        background: color-mix(in srgb, var(--text-color) 10%, transparent);
    }

    html body .xp-rail-day::before {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        height: var(--xp-day, 0%);
        border-radius: inherit;
        background: linear-gradient(180deg, color-mix(in srgb, var(--accent-color) 20%, transparent), var(--accent-color));
        transition: height 1s linear;
    }

    html body .xp-rail-day::after {
        content: "";
        position: absolute;
        left: 50%;
        top: var(--xp-day, 0%);
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--accent-color);
        box-shadow: 0 0 12px 2px var(--accent-color);
        transform: translate(-50%, -50%);
        transition: top 1s linear;
    }

    html body .xp-rail-week {
        display: grid;
        place-items: center;
        gap: 2px;
        color: color-mix(in srgb, var(--text-color) 60%, transparent);
        font-size: 0.56rem;
        font-weight: 600;
        letter-spacing: 0.2em;
        text-transform: uppercase;
    }

    html body .xp-rail-week strong {
        color: var(--text-color);
        font-family: var(--xp-display);
        font-size: 1.15rem;
        font-weight: 400;
        letter-spacing: 0;
    }
}

@keyframes xpRailBlink {
    50% { opacity: 0.25; }
}

@media (prefers-reduced-motion: reduce) {
    html body .xp-rail-time b { animation: none; }
}

/* Altijd één rij: premium.js verbergt de tegels die niet meer passen.
   Bij een update geen onthulling, alleen de nieuwste tegel springt erin. */
html.xp-reveal body .xp-recent-grid.xp-static > .tile {
    animation: none;
}

html body .xp-recent-grid > .tile.xp-recent-new,
html.xp-reveal body .xp-recent-grid.xp-static > .tile.xp-recent-new {
    animation: xpRecentPop 0.55s var(--xp-ease-spring) backwards;
}

@keyframes xpRecentPop {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 599px) {
    html body .xp-recent-title {
        font-size: 1rem;
    }
}

/* --- 11. ONTHULLING BIJ SCROLLEN (alleen als premium.js draait) --- */
html.xp-reveal body .grid-container:not(.xp-in) > .tile {
    opacity: 0;
}

html.xp-reveal body .grid-container.xp-in > .tile {
    /* backwards: na afloop laat de animatie transform los, zodat hover blijft werken */
    animation: xpTileIn 0.55s var(--xp-ease) backwards;
    animation-delay: calc(min(var(--xp-i, 0), 18) * 16ms);
}

@keyframes xpTileIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* Featured tegels houden hun eigen ballon-uitlijning: alleen faden */
html.xp-reveal body .grid-container.xp-in > .tile-featured {
    animation-name: xpFadeIn;
}

@keyframes xpFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- 12. FOOTER ---
   Zelfde opbouw als de statistiektegels: label linksboven, één groot getal,
   onderaan achter een haarlijn een rustige tweede regel. Kleuren, randen en
   gloed blijven per thema uit style.css komen. */
/* De betekenis van XASI in de bovenlijn van de footer: de lijn breekt ervoor open. De
   eigen rand van de footer (per thema anders) wordt onzichtbaar, zonder dat er iets verspringt. */
html body .cyber-footer.cyber-footer.cyber-footer {
    border-top-color: transparent !important;
}

html body .xp-motto {
    position: relative;
    /* Boven de footer (sommige thema's geven die een eigen laag), onder de vaste header. */
    z-index: 900;
    display: flex;
    align-items: center;
    height: 0;
    margin: 0;
    pointer-events: none;
}

/* De lijn wordt heter naar de tekst toe en barst daar open (de boogjes zitten in de svg). */
html body .xp-motto::before,
html body .xp-motto::after {
    content: "";
    flex: 1;
    height: 1.5px;
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--accent-color) 45%, transparent) 0%,
        var(--accent-color) 72%,
        color-mix(in srgb, var(--accent-color) 45%, #fff) 100%);
    box-shadow: 0 0 7px -1px var(--accent-color);
}

html body .xp-motto::after { transform: scaleX(-1); }

.xp-burst-stop { stop-color: var(--accent-color); }

.xp-burst path {
    fill: none;
    stroke-width: 6.5;
    stroke-linecap: round;
    filter: drop-shadow(0 0 5px var(--accent-color));
}

.xp-burst-flare {
    fill: var(--accent-color);
    animation: xpBurstFlare 4.2s ease-in-out infinite;
}

@keyframes xpBurstFlare {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}

.xp-burst-core { fill: color-mix(in srgb, var(--accent-color) 30%, #fff); }

/* Dezelfde titel als de oude intro, maar klein: regenboog door X, A, S, I en neongloed. */
html body .xp-motto svg {
    flex: none;
    /* Iets breder dan de tekst: de boogjes aan weerszijden horen erbij. */
    width: clamp(281px, 29.8vw, 512px);
    height: auto;
    overflow: visible;
}

html body .xp-motto text {
    fill: var(--text-color);
    font-family: var(--xp-display);
    font-weight: 700;
    letter-spacing: -0.01em;
}

html body .xp-motto .layer-glow text {
    fill: url(#global-flow);
}

html body .cyber-footer {
    font-family: var(--xp-font);
    padding: 40px var(--xp-gutter);
}

html body .footer-grid {
    gap: 18px;
    text-align: left;
}

html body .footer-module {
    position: relative;
    min-height: 150px;
    padding: 20px 22px 18px;
    border-radius: 18px;
    gap: 6px;
    align-items: stretch;
    justify-content: flex-start;
    text-align: left;
    -webkit-backdrop-filter: blur(8px) saturate(1.25);
    backdrop-filter: blur(8px) saturate(1.25);
}

/* Klikbare panelen: een klein pijltje in plaats van het hoekhaakje */
html body .footer-module.swatch-module-link::before,
html body .footer-module.visitor-module::before {
    content: "\2197";
    top: 16px;
    right: 18px;
    width: auto;
    height: auto;
    border: 0;
    filter: none;
    color: var(--accent-color);
    font: 600 0.95rem/1 var(--xp-font);
    opacity: 0.45;
    transition: opacity 0.25s var(--xp-ease), transform 0.3s var(--xp-ease);
}

html body .footer-module.swatch-module-link:hover::before,
html body .footer-module.visitor-module:hover::before {
    opacity: 1;
    transform: translate(2px, -2px);
}

html body .visitor-link {
    align-items: stretch;
    gap: 6px;
}

/* Label linksboven */
html body .module-label {
    font-family: var(--xp-font);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-align: left;
    padding-right: 24px;
}

/* Het grote getal */
html body .digital-text {
    justify-content: flex-start;
    font-family: var(--xp-font);
    font-size: clamp(1.55rem, 1.9vw, 2rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum", "cv11";
}

html body .visitor-total {
    min-width: 0;
    justify-content: flex-start;
    letter-spacing: -0.02em;
}

html body #newyear-content small {
    /* Flex slikt de spatie in de tekst: ruimte na de "d" komt van hier */
    margin: 0 0.4em 0 0.06em;
    font-size: 0.55em;
    font-weight: 600;
    opacity: 0.6;
}

/* Klok verzetten: datums zonder vaste cijferbreedte, anders krijgen de streepjes lucht */
html body #dst-content,
html body #dst-other {
    font-variant-numeric: normal;
    font-feature-settings: "cv11";
}

/* style.css zette dit veld als kolom (oude tweeregelige opbouw): links uitlijnen zoals de rest */
html body #dst-content {
    flex-direction: row;
}

/* De tweede regel onderin: haarlijn, label links, waarde rechts */
html body .swatch-line,
html body .footer-subgrid,
html body .visitor-today-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin: auto 0 0;
    padding: 12px 0 0 !important;
    border: 0 !important;
    border-top: 1px solid color-mix(in srgb, var(--text-color) 10%, transparent) !important;
    border-radius: 0 !important;
    background: none !important;
    box-shadow: none !important;
    transform: none;
}

html body .visitor-today-row::before,
html body .visitor-today-row::after {
    content: none;
}

html body .swatch-label {
    flex-direction: row;
    align-items: baseline;
    gap: 0.35em;
    text-align: left;
}

html body .swatch-label,
html body .footer-subgrid em,
html body .visitor-today-row span {
    font-family: var(--xp-font);
    font-size: 0.66rem;
    font-style: normal;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

html body .footer-subgrid span {
    gap: 8px;
}

html body #swatch-content,
html body .calendar-metric,
html body .visitor-today-row strong {
    font-family: var(--xp-font);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum", "cv11";
}

html body .copyright-text,
html body .facebook-pulse-link {
    letter-spacing: 0.08em;
    font-weight: 700;
}

/* --- 13. TOEGANKELIJKHEID & PRINT --- */
@media (prefers-reduced-motion: reduce) {
    html body .tile,
    html body .tile::after,
    html body nav a::after {
        transition: none !important;
        animation: none !important;
    }

    html.xp-reveal body .grid-container > .tile {
        opacity: 1 !important;
    }
}

@media print {
    html.xp-reveal body .grid-container > .tile {
        opacity: 1 !important;
        animation: none !important;
    }
}

/* --- Zoekbalk: één balk met een glijdend lichtblok, en "Meer" voor de extra zoekmachines --- */
html body .search-tools {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 3px;
    border: 1px solid color-mix(in srgb, var(--accent-color) 50%, transparent);
    border-radius: calc(var(--xp-radius-ctrl) + 3px);
    background: color-mix(in srgb, var(--card-bg) 62%, transparent);
    box-sizing: border-box;
}

body.neon-rgb-mode.neon-rgb-mode .search-tools {
    border-color: transparent;
    background:
        linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
        conic-gradient(from var(--rgb-spin), #00f0ff, #ff1744, #ff8a00, #ffe600, #39ff88, #9b5cff, #ff3bd5, #00f0ff) border-box;
    animation: neonRgbBorderSpin 7s linear infinite;
}

html body .search-slider {
    position: absolute;
    left: 0;
    top: 3px;
    bottom: 3px;
    width: 0;
    border-radius: var(--xp-radius-ctrl);
    background: color-mix(in srgb, var(--accent-color) 24%, transparent);
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--accent-color) 72%, transparent),
        0 0 12px -4px var(--accent-color);
    pointer-events: none;
}

html body .search-slider.is-ready {
    transition: transform 0.34s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.34s cubic-bezier(0.2, 0.8, 0.2, 1);
}

html body .search-more,
html body .search-first {
    position: relative;
    display: flex;
}

/* De eerste plek: links zoeken met de gekozen zoekmachine, rechts het pijltje voor het menu. */
html body .search-first-caret {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    padding: 0 9px 0 3px;
    border: 0;
    border-radius: var(--xp-radius-ctrl);
    background: none;
    color: var(--text-color);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

html body .search-first-caret svg {
    opacity: 0.75;
    transition: transform 0.2s ease;
}

html body .search-first-caret[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

html body .search-more-panel.search-first-panel {
    left: 0;
    right: auto;
    width: 230px;
    grid-template-columns: 1fr;
}

html body .search-tools > .search-engine,
html body .search-more-btn,
html body .search-first-main,
html body .search-more-panel .search-engine {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 10px;
    border: 0 !important;
    border-radius: var(--xp-radius-ctrl);
    background: none !important;
    box-shadow: none !important;
    color: var(--text-color);
    font: 600 0.84rem / 1 var(--xp-font);
    letter-spacing: 0.01em;
    text-shadow: none;
    white-space: nowrap;
    cursor: pointer;
    animation: none !important;
    transition: color 0.2s ease, background-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

/* Het lichtblok toont de keuze; de tekst blijft in alle thema's goed leesbaar. */
html body .search-tools > .search-engine,
html body .search-tools > .search-engine.is-active,
html body .search-tools > .search-engine:hover,
html body .search-more-btn,
html body .search-first-main,
html body .search-more-panel .search-engine,
html body .search-more-panel .search-engine.is-active {
    color: var(--text-color) !important;
    text-shadow: none !important;
}

html body .search-tools img,
html body .search-more-panel img {
    flex: none;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    object-fit: cover;
}

html body .search-more-btn svg {
    flex: none;
    opacity: 0.75;
    transition: transform 0.2s ease;
}

html body .search-more-btn[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

@media (hover: hover) and (pointer: fine) {
    html body .search-tools > .search-engine:hover,
    html body .search-more-btn:hover,
    html body .search-first-main:hover,
    html body .search-first-caret:hover,
    html body .search-more-panel .search-engine:hover {
        background: color-mix(in srgb, var(--accent-color) 12%, transparent) !important;
        color: var(--text-color);
        transform: none;
    }
}

html body .search-more-panel {
    position: absolute;
    left: 0;
    top: calc(100% + 9px);
    z-index: 40;
    width: 490px;
    max-height: calc(100vh - 165px);
    max-height: calc(100dvh - 165px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 6px 8px 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    column-gap: 8px;
    border: 1.5px solid var(--accent-color);
    border-radius: 16px;
    background: var(--bg-color);
    box-shadow: 0 18px 44px -12px rgba(0, 0, 0, 0.6);
    animation: xpMoreIn 0.18s ease-out;
}

html body .search-more-panel[hidden] {
    display: none;
}

@keyframes xpMoreIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}

html body .search-more-panel p {
    margin: 10px 8px 5px;
    color: color-mix(in srgb, var(--text-color) 72%, transparent);
    font: 600 0.62rem / 1.2 var(--xp-font);
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

html body .search-more-panel .search-engine {
    width: 100%;
    min-height: 40px;
    gap: 10px;
    padding: 0 8px;
    font-size: 0.88rem;
    text-align: left;
}

html body .search-more-panel .search-engine img {
    width: 22px;
    height: 22px;
}

html body .search-more-panel .search-engine.is-active {
    background: color-mix(in srgb, var(--accent-color) 22%, transparent) !important;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-color) 72%, transparent) !important;
    color: var(--text-color);
}

/* Strak raster van twee bij twee, kolom voor kolom gevuld (op een telefoon één kolom). */
@media (min-width: 641px) {
    html body .search-more > .search-more-panel {
        grid-template-rows: auto auto;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
    }
}

/* Over de volle breedte: de knoppen delen de balk gelijk. */
@media (max-width: 1200px), (hover: none), (pointer: coarse) {
    html body .search-tools > .search-engine,
    html body .search-first,
    html body .search-more {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
    }

    html body .search-tools > .search-engine,
    html body .search-first-main,
    html body .search-more-btn {
        justify-content: center;
    }

    html body .search-first-main {
        flex: 1;
    }

    html body .search-more-btn {
        width: 100%;
    }

    /* "Meer" staat hier helemaal rechts: het paneel klapt vanaf de rechterkant uit. */
    html body .search-more {
        position: static;
    }

    html body .search-more-panel {
        left: auto;
        right: 0;
        width: min(490px, 100%);
    }
}

/* Smal: het paneel over de volle breedte, in één kolom. */
@media (max-width: 640px) {
    html body .search-more-panel {
        left: 0;
        right: 0;
        width: auto;
        grid-template-columns: 1fr;
    }
}

/* Telefoon: de drie knoppen delen de balk naar inhoud, en lange namen passen altijd. */
@media (max-width: 640px) {
    html body .search-tools > .search-engine,
    html body .search-first,
    html body .search-more {
        flex: 1 1 auto;
    }

    html body .search-tools > .search-engine,
    html body .search-first-main,
    html body .search-more-btn {
        gap: 5px;
        padding: 0 6px;
        font-size: 0.78rem;
    }

    html body .search-first-caret {
        padding: 0 8px 0 2px;
    }

    html body .search-first-main span,
    html body .search-more-btn span {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    html body .search-first,
    html body .search-more,
    html body .search-first-main,
    html body .search-more-btn {
        min-width: 0;
    }

    html body .search-more-btn {
        justify-content: center;
    }
}
