/* Path: src/FindMyEdge.Web/wwwroot/css/terminal/terminal-primitives.css */
/* Terminal Primitives — MUST stay token-only and MUST be scoped to .t-shell to avoid legacy impact */

.t-shell {
    /* Nothing here that overrides tokens — just a safe anchor for scoping. */
}

    /* =========================
   Typography helpers
   ========================= */
    .t-shell .t-muted {
        color: var(--fme-text-faint);
    }

    .t-shell .t-strong {
        font-weight: var(--fme-weight-semibold);
    }

    .t-shell .t-mono {
        font-family: var(--fme-font-mono);
        letter-spacing: .2px;
    }

    .t-shell .t-mini {
        font-size: var(--fme-text-xs);
        line-height: var(--fme-leading-tight);
    }

    .t-shell .t-mini-sep {
        margin: 0 var(--fme-space-2);
        color: var(--fme-border);
    }

    /* =========================
   Panel / Card
   ========================= */
    .t-shell .t-panel {
        background: var(--fme-card-surface-body);
        border: 1px solid var(--fme-card-border);
        border-radius: var(--fme-radius-md);
        box-shadow: var(--fme-shadow-sm);
        overflow: hidden;
    }

    .t-shell .t-panel-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: var(--fme-space-4);
        padding: var(--fme-card-header-pad-y) var(--fme-card-header-pad-x);
        border-bottom: 1px solid var(--fme-card-border);
        background: var(--fme-card-surface-header);
    }

        .t-shell .t-panel-head > :first-child {
            min-width: 0;
            display: grid;
            gap: var(--fme-space-1);
        }

    .t-shell .t-panel-body {
        padding: var(--fme-card-body-pad-y) var(--fme-card-body-pad-x);
        background: var(--fme-card-surface-body);
    }

    .t-shell .t-h {
        font-size: var(--fme-card-title-size);
        line-height: var(--fme-leading-tight);
        font-weight: var(--fme-weight-semibold);
        margin: 0;
    }

    .t-shell .t-sub {
        margin: 0;
        color: var(--fme-text-muted);
        font-size: var(--fme-card-subtitle-size);
        line-height: var(--fme-leading-normal);
    }

    .t-shell .t-card-stat,
    .t-shell .t-card-metric {
        display: grid;
        gap: var(--fme-space-2);
        min-height: calc(var(--fme-control-h) + var(--fme-space-8));
        padding: var(--fme-card-compact-pad);
        border: 1px solid var(--fme-card-border);
        border-radius: var(--fme-radius-md);
        background: var(--fme-card-surface-compact);
        box-shadow: var(--fme-shadow-sm);
    }

    .t-shell .t-card-stat-label,
    .t-shell .t-card-metric-label {
        color: var(--fme-text-muted);
        font-family: var(--fme-font-mono);
        font-size: var(--fme-text-xs);
        letter-spacing: 0.2px;
        text-transform: uppercase;
        margin: 0;
    }

    .t-shell .t-card-stat-value,
    .t-shell .t-card-metric-value {
        color: var(--fme-text);
        font-size: var(--fme-card-metric-size);
        line-height: var(--fme-leading-tight);
        font-weight: var(--fme-weight-semibold);
        margin: 0;
    }

    .t-shell .t-card-stat-sub,
    .t-shell .t-card-metric-sub {
        color: var(--fme-text-muted);
        font-size: var(--fme-text-sm);
        line-height: var(--fme-leading-normal);
        margin: 0;
    }

    /* =========================
   Alerts
   ========================= */
    .t-shell .t-alert {
        padding: var(--fme-space-3) calc(var(--fme-space-2) + var(--fme-space-1));
        border: 1px solid var(--fme-border);
        border-radius: var(--fme-radius-sm);
        margin: 0 0 var(--fme-space-3) 0;
        background: color-mix(in oklab, var(--fme-surface-2) 55%, black 45%);
    }

    .t-shell .t-alert-danger {
        color: var(--fme-danger);
    }

    .t-shell .t-alert-info {
        color: var(--fme-brand);
    }

    .t-shell .t-alert-warn {
        color: var(--fme-warning);
    }

    /* =========================
   Pills / Status
   ========================= */
    .t-shell .t-pill {
        height: var(--fme-control-h-sm);
        padding: 0 var(--fme-space-3);
        border-radius: var(--fme-radius-pill);
        border: 1px solid var(--fme-border);
        display: inline-flex;
        align-items: center;
        font-size: var(--fme-text-xs);
        color: var(--fme-text-muted);
        background: color-mix(in oklab, var(--fme-surface-2) 55%, transparent);
        user-select: none;
    }

    .t-shell .t-pill-ok {
        color: var(--fme-success);
        border-color: color-mix(in oklab, var(--fme-success) 35%, var(--fme-border));
        background: color-mix(in oklab, var(--fme-success) 10%, var(--fme-surface-2));
    }

    .t-shell .t-pill-warn {
        color: var(--fme-warning);
        border-color: color-mix(in oklab, var(--fme-warning) 35%, var(--fme-border));
        background: color-mix(in oklab, var(--fme-warning) 10%, var(--fme-surface-2));
    }

    .t-shell .t-pill-danger {
        color: var(--fme-danger);
        border-color: color-mix(in oklab, var(--fme-danger) 35%, var(--fme-border));
        background: color-mix(in oklab, var(--fme-danger) 10%, var(--fme-surface-2));
    }

    /* =========================
   Controls (inputs/select/search) + placeholder consistency
   ========================= */
    .t-shell :where(.t-input, .t-select, .t-search) {
        height: var(--fme-control-h);
        border-radius: var(--fme-radius-sm);
        border: 1px solid var(--fme-border);
        background: color-mix(in oklab, var(--fme-surface-2) 60%, black 40%);
        color: var(--fme-text);
        padding: 0 var(--fme-space-3);
        font-size: var(--fme-text-sm);
        font-family: var(--fme-font-sans);
    }

    .t-shell :where(.t-input, .t-search)::placeholder {
        color: var(--fme-text-faint);
        font-family: var(--fme-font-sans);
    }

    /* select normalization */
    .t-shell .t-select {
        appearance: none;
    }

    /* Labels */
    .t-shell .t-label {
        font-size: var(--fme-text-sm);
        color: var(--fme-text-muted);
    }

    /* ADD this below */
    .t-shell .t-row {
        display: grid;
        gap: var(--fme-space-2);
    }

        .t-shell .t-row + .t-row {
            margin-top: var(--fme-space-4);
        }

    /* =========================
   Buttons
   ========================= */
    .t-shell .t-btn {
        height: var(--fme-control-h);
        padding: 0 var(--fme-space-4);
        border-radius: var(--fme-radius-sm);
        border: 1px solid var(--fme-border);
        background: transparent;
        color: var(--fme-text);
        font-size: var(--fme-text-sm);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: var(--fme-leading-tight);
        white-space: nowrap;
    }

        .t-shell .t-btn:disabled {
            opacity: var(--fme-disabled-opacity);
            cursor: not-allowed;
        }

    .t-shell .t-btn-primary {
        border-color: color-mix(in oklab, var(--fme-brand) 45%, var(--fme-border));
        background: color-mix(in oklab, var(--fme-brand) 14%, var(--fme-surface-2));
        box-shadow: var(--fme-glow);
    }

    .t-shell .t-btn-cta {
        border-color: color-mix(in oklab, var(--fme-brand) 45%, var(--fme-border));
        background: color-mix(in oklab, var(--fme-brand) 18%, var(--fme-surface-2));
        box-shadow: var(--fme-glow);
    }

    .t-shell .t-btn-danger {
        border-color: color-mix(in oklab, var(--fme-danger) 35%, var(--fme-border));
        background: color-mix(in oklab, var(--fme-danger) 18%, var(--fme-surface-2));
    }

    /* Compact link-ish button */
    .t-shell .t-btn-link {
        height: var(--fme-control-h-sm);
        padding: 0 var(--fme-space-3);
    }

    /* Icon buttons */
    .t-shell .t-iconbtn {
        height: var(--fme-control-h-sm);
        width: var(--fme-control-h-sm);
        border-radius: var(--fme-radius-sm);
        border: 1px solid var(--fme-border);
        background: transparent;
        color: var(--fme-text);
        display: inline-grid;
        place-items: center;
    }

        .t-shell .t-iconbtn:disabled {
            opacity: var(--fme-disabled-opacity);
            cursor: not-allowed;
        }

    .t-shell .t-iconbtn-danger {
        color: var(--fme-danger);
        border-color: color-mix(in oklab, var(--fme-danger) 35%, var(--fme-border));
        background: color-mix(in oklab, var(--fme-danger) 8%, transparent);
    }

    .t-shell .t-iconbtn-warn {
        color: var(--fme-warning);
        border-color: color-mix(in oklab, var(--fme-warning) 35%, var(--fme-border));
        background: color-mix(in oklab, var(--fme-warning) 8%, transparent);
    }

    .t-shell .t-iconbtn-ok {
        color: var(--fme-success);
        border-color: color-mix(in oklab, var(--fme-success) 35%, var(--fme-border));
        background: color-mix(in oklab, var(--fme-success) 8%, transparent);
    }

    /* =========================
   Tables
   ========================= */
    .t-shell .t-tablewrap {
        --fme-table-scrollbar-size: 0.75rem;
        position: relative;
        min-width: 0;
        min-height: 0;
        border: 1px solid var(--fme-border);
        border-radius: var(--fme-radius-sm);
        background: color-mix(in oklab, var(--fme-surface-2) 40%, transparent);
    }

        /*
       Keep scroll behavior universal for terminal tables.

       Some page-scoped styles also set overflow on .t-tablewrap. This intentionally
       uses repeated class specificity so the shared primitive wins without having to
       touch every page-level table wrapper.
    */
        .t-shell .t-tablewrap.t-tablewrap.t-tablewrap.t-tablewrap {
            overflow-x: auto;
            overflow-y: auto;
            /*
               Allow vertical scroll chaining so wheel scrolling over a non-scrollable
               table continues scrolling the page, and scrolling over a scrollable
               table returns to the page after the table reaches the top/bottom.
               Horizontal overflow stays local to the table so wide column selections
               expose a horizontal scrollbar only when needed.
            */
            overscroll-behavior-x: contain;
            overscroll-behavior-y: auto;
        }

    .t-shell .t-table-scrollshell {
        --fme-table-scrollbar-size: 0.75rem;
        --fme-table-scrollbar-button-size: 0.75rem;
        --fme-table-scrollbar-gap: 0.125rem;
        --fme-table-header-height: 0px;
        --fme-table-horizontal-scrollbar-height: 0px;
        --fme-table-vertical-scrollbar-reserved: 0px;
        --fme-table-scrollbar-track-color: color-mix(in oklab, var(--fme-surface-1) 88%, black);
        --fme-table-scrollbar-thumb-color: color-mix(in oklab, var(--fme-brand) 42%, var(--fme-border));
        --fme-table-scrollbar-thumb-hover-color: color-mix(in oklab, var(--fme-brand) 68%, var(--fme-border));

        position: relative;
        min-width: 0;
        min-height: 0;
        flex: 1 1 auto;
        block-size: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        border-radius: var(--fme-radius-sm);
    }

        .t-shell .t-table-scrollshell > .t-tablewrap {
            flex: 1 1 auto;
            min-block-size: 0;
            block-size: 100%;
            box-sizing: border-box;
            padding-block-end: var(--fme-table-horizontal-scrollbar-height);
        }

        /*
           The custom table scrollbar is overlaid on the right edge so it can start
           below sticky headers. Give the final column breathing room so action
           buttons/status text do not sit directly against the scrollbar.
        */
        .t-shell .t-table-scrollshell > .t-tablewrap > .t-table th:last-child,
        .t-shell .t-table-scrollshell > .t-tablewrap > .t-table td:last-child {
            padding-inline-end: calc(var(--fme-space-5) + var(--fme-table-scrollbar-size));
        }

    .t-shell .t-tablewrap.t-tablewrap--custom-scrollbar {
        /*
           Native vertical scrollbars cannot be offset below sticky headers, so this
           primitive renders custom header-aware scrollbars and keeps the native ones
           visually hidden while preserving normal scroll behavior.
        */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

        .t-shell .t-tablewrap.t-tablewrap--custom-scrollbar::-webkit-scrollbar {
            width: 0;
            height: 0;
        }

    .t-shell .t-table-scrollbar {
        position: absolute;
        inset-block-start: var(--fme-table-header-height);
        inset-block-end: var(--fme-table-horizontal-scrollbar-height);
        inset-inline-end: 0;
        inline-size: var(--fme-table-scrollbar-size);
        z-index: 30;
        pointer-events: none;
    }

    .t-shell .t-table-scrollbar.is-hidden {
        display: none;
    }

    .t-shell .t-table-scrollbar__button {
        position: absolute;
        inset-inline: 0;
        inline-size: var(--fme-table-scrollbar-size);
        block-size: var(--fme-table-scrollbar-button-size);
        display: grid;
        place-items: center;
        padding: 0;
        border: 0;
        border-radius: var(--fme-radius-pill);
        background: var(--fme-table-scrollbar-track-color);
        cursor: pointer;
        pointer-events: auto;
    }

        .t-shell .t-table-scrollbar__button:disabled {
            cursor: default;
            opacity: 0.45;
        }

            .t-shell .t-table-scrollbar__button:disabled::before {
                opacity: 0.45;
            }

        .t-shell .t-table-scrollbar__button::before {
            content: "";
            inline-size: 0;
            block-size: 0;
            border-inline: 0.2rem solid transparent;
            opacity: 0.8;
        }

    .t-shell .t-table-scrollbar__button--up {
        top: 0;
    }

        .t-shell .t-table-scrollbar__button--up::before {
            border-block-end: 0.26rem solid var(--fme-table-scrollbar-thumb-color);
        }

    .t-shell .t-table-scrollbar__button--down {
        bottom: 0;
    }

        .t-shell .t-table-scrollbar__button--down::before {
            border-block-start: 0.26rem solid var(--fme-table-scrollbar-thumb-color);
        }

    .t-shell .t-table-scrollbar__track {
        position: absolute;
        inline-size: var(--fme-table-scrollbar-size);
        top: calc(var(--fme-table-scrollbar-button-size) + var(--fme-table-scrollbar-gap));
        bottom: calc(var(--fme-table-scrollbar-button-size) + var(--fme-table-scrollbar-gap));
        inset-inline-start: 50%;
        transform: translateX(-50%);
        border-radius: var(--fme-radius-pill);
        background: var(--fme-table-scrollbar-track-color);
        pointer-events: auto;
    }

    .t-shell .t-table-scrollbar__thumb {
        position: absolute;
        inset-inline: 0;
        top: 0;
        min-block-size: 28px;
        border: 3px solid var(--fme-table-scrollbar-track-color);
        border-radius: var(--fme-radius-pill);
        background: var(--fme-table-scrollbar-thumb-color);
        cursor: grab;
        pointer-events: auto;
    }

        .t-shell .t-table-scrollbar__thumb:hover,
        .t-shell .t-table-scrollbar__thumb.is-dragging {
            background: var(--fme-table-scrollbar-thumb-hover-color);
        }

        .t-shell .t-table-scrollbar__thumb.is-dragging {
            cursor: grabbing;
        }

    .t-shell .t-table-hscrollbar {
        position: absolute;
        inset-inline-start: 0;
        inset-inline-end: var(--fme-table-vertical-scrollbar-reserved);
        inset-block-end: 0;
        block-size: var(--fme-table-scrollbar-size);
        z-index: 31;
        display: flex;
        align-items: center;
        padding-inline: var(--fme-table-scrollbar-gap);
        pointer-events: none;
    }

    .t-shell .t-table-hscrollbar.is-hidden {
        display: none;
    }

    .t-shell .t-table-hscrollbar__track {
        position: relative;
        inline-size: 100%;
        block-size: var(--fme-table-scrollbar-size);
        border-radius: var(--fme-radius-pill);
        background: var(--fme-table-scrollbar-track-color);
        pointer-events: auto;
    }

    .t-shell .t-table-hscrollbar__thumb {
        position: absolute;
        inset-block: 0;
        inset-inline-start: 0;
        min-inline-size: 28px;
        border: 3px solid var(--fme-table-scrollbar-track-color);
        border-radius: var(--fme-radius-pill);
        background: var(--fme-table-scrollbar-thumb-color);
        cursor: grab;
        pointer-events: auto;
    }

        .t-shell .t-table-hscrollbar__thumb:hover,
        .t-shell .t-table-hscrollbar__thumb.is-dragging {
            background: var(--fme-table-scrollbar-thumb-hover-color);
        }

        .t-shell .t-table-hscrollbar__thumb.is-dragging {
            cursor: grabbing;
        }

    .t-shell .t-table {
        width: max-content;
        min-width: 100%;
        border-collapse: separate;
        border-spacing: 0;
    }

        .t-shell .t-table thead {
            position: relative;
            z-index: 5;
        }

            .t-shell .t-table thead th {
                position: sticky;
                top: 0;
                z-index: 6;
                background: var(--fme-surface-2);
                color: var(--fme-text-muted);
                font-weight: var(--fme-weight-semibold);
                text-align: left;
                border-bottom: 1px solid var(--fme-border);
                /*box-shadow: 0 1px 0 var(--fme-border), 0 8px 14px color-mix(in oklab, var(--fme-bg) 55%, transparent);*/
                padding: var(--fme-space-3);
                white-space: nowrap;
            }

        .t-shell .t-table tbody td {
            border-bottom: 1px solid var(--fme-border);
            padding: var(--fme-space-3);
            vertical-align: middle;
            white-space: nowrap;
        }

    .t-shell .t-num {
        text-align: left;
    }

    .t-shell .t-act {
        text-align: center;
        width: 1%;
        white-space: nowrap;
    }

    /* =========================
   Inline warning block
   ========================= */
    .t-shell .t-inlinewarn {
        border: 1px solid color-mix(in oklab, var(--fme-warning) 40%, var(--fme-border));
        background: color-mix(in oklab, var(--fme-warning) 10%, transparent);
        border-radius: var(--fme-radius-sm);
        padding: var(--fme-space-3);
        display: grid;
        gap: var(--fme-space-3);
        margin: 0 0 var(--fme-space-4) 0;
    }

    .t-shell .t-inlinewarn-actions {
        display: flex;
        gap: var(--fme-space-3);
        flex-wrap: wrap;
    }

    /* =========================
   Skeleton
   ========================= */
    .t-shell .t-skel {
        height: var(--fme-control-h);
        border-radius: var(--fme-radius-sm);
        border: 1px solid var(--fme-border);
        background: linear-gradient( 90deg, color-mix(in oklab, var(--fme-surface-2) 55%, transparent), color-mix(in oklab, var(--fme-brand) 10%, var(--fme-surface-2)), color-mix(in oklab, var(--fme-surface-2) 55%, transparent) );
        background-size: 200% 100%;
        animation: t-sweep 1.1s linear infinite;
        opacity: .65;
    }

@keyframes t-sweep {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

/* =========================
   Terminal scrollbars
   ========================= */
.t-shell {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in oklab, var(--fme-brand) 55%, var(--fme-border)) color-mix(in oklab, var(--fme-surface-1) 85%, black);
}

    .t-shell * {
        scrollbar-width: thin;
        scrollbar-color: color-mix(in oklab, var(--fme-brand) 55%, var(--fme-border)) color-mix(in oklab, var(--fme-surface-1) 85%, black);
    }

    .t-shell ::-webkit-scrollbar {
        width: 0.75rem;
        height: 0.75rem;
    }

    .t-shell ::-webkit-scrollbar-track {
        background: color-mix(in oklab, var(--fme-surface-1) 88%, black);
        border-radius: var(--fme-radius-pill);
    }

    .t-shell ::-webkit-scrollbar-thumb {
        background: color-mix(in oklab, var(--fme-brand) 42%, var(--fme-border));
        border: 3px solid color-mix(in oklab, var(--fme-surface-1) 88%, black);
        border-radius: var(--fme-radius-pill);
    }

        .t-shell ::-webkit-scrollbar-thumb:hover {
            background: color-mix(in oklab, var(--fme-brand) 68%, var(--fme-border));
        }

    .t-shell ::-webkit-scrollbar-corner {
        background: color-mix(in oklab, var(--fme-surface-1) 88%, black);
    }

    /* =========================
   Modal
   ========================= */
    .t-shell .t-modal-backdrop {
        position: fixed;
        inset: 0;
        background: var(--fme-overlay);
        display: grid;
        place-items: center;
        z-index: 2000;
    }

    .t-shell .t-modal {
        width: min(calc(var(--fme-space-9) * 14), 92vw);
        border-radius: var(--fme-radius-md);
        border: 1px solid var(--fme-border);
        background: var(--fme-surface-1);
        box-shadow: var(--fme-shadow-lg);
        overflow: hidden;
    }

    .t-shell .t-modal-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: calc(var(--fme-space-2) + var(--fme-space-1)) var(--fme-space-4);
        border-bottom: 1px solid var(--fme-border);
        background: color-mix(in oklab, var(--fme-surface-2) 55%, transparent);
    }

    .t-shell .t-modal-title {
        font-weight: var(--fme-weight-semibold);
    }

    .t-shell .t-modal-body {
        padding: var(--fme-space-4);
    }

    .t-shell .t-modal-footer {
        display: flex;
        justify-content: flex-end;
        gap: var(--fme-space-3);
        padding: calc(var(--fme-space-2) + var(--fme-space-1)) var(--fme-space-4);
        border-top: 1px solid var(--fme-border);
    }

    /* =========================
   Search action dropdown
   ========================= */
.t-shell .t-search-action {
    position: relative;
    min-inline-size: 0;
}

.t-shell .t-search-action__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(5.75rem, auto);
    gap: var(--fme-space-2);
    align-items: center;
}

.t-shell .t-search-action__control {
    min-inline-size: 0;
    inline-size: 100%;
    min-block-size: var(--fme-control-h);
    padding-inline: var(--fme-space-3);
    border-radius: var(--fme-radius-sm);
    border: var(--bs-border-width) solid var(--fme-border);
    background: color-mix(in oklab, var(--fme-surface-1) 82%, var(--fme-surface-2));
    color: var(--fme-text);
    font-size: var(--fme-text-sm);
    box-shadow: var(--fme-shadow-sm);
    box-sizing: border-box;
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.t-shell .t-search-action__control::placeholder {
    color: var(--fme-text-faint);
}

.t-shell .t-search-action__control:focus {
    outline: none;
    border-color: color-mix(in oklab, var(--fme-brand) 52%, var(--fme-border));
    background: color-mix(in oklab, var(--fme-surface-2) 90%, var(--fme-surface-1));
    box-shadow: var(--fme-shadow-sm), var(--fme-glow);
}

.t-shell .t-search-action__control:disabled {
    cursor: not-allowed;
    opacity: .62;
}

.t-shell .t-search-action__button {
    min-block-size: var(--fme-control-h);
    padding-inline: var(--fme-space-4);
    border-radius: var(--fme-radius-sm);
    border: var(--bs-border-width) solid var(--fme-border);
    background: color-mix(in oklab, var(--fme-surface-2) 82%, var(--fme-surface-1));
    color: var(--fme-text);
    font-size: var(--fme-text-sm);
    font-weight: var(--fme-weight-medium);
    box-shadow: var(--fme-shadow-sm);
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.t-shell .t-search-action__button:hover:not(:disabled),
.t-shell .t-search-action__button:focus-visible:not(:disabled) {
    border-color: color-mix(in oklab, var(--fme-brand) 45%, var(--fme-border));
    background: color-mix(in oklab, var(--fme-brand) 10%, var(--fme-surface-2));
}

.t-shell .t-search-action__button:focus-visible {
    outline: none;
    box-shadow: var(--fme-shadow-sm), var(--fme-glow);
}

.t-shell .t-search-action__button:disabled {
    cursor: not-allowed;
    opacity: .58;
}

.t-shell .t-search-action__menu {
    position: absolute;
    inset-block-start: calc(100% + var(--fme-space-2));
    inset-inline: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--fme-space-2);
    max-block-size: calc((var(--fme-control-h-sm) * 6) + (var(--fme-space-2) * 5) + (var(--fme-space-3) * 2));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--fme-space-2);
    border: var(--bs-border-width) solid color-mix(in oklab, var(--fme-brand) 30%, var(--fme-border));
    border-radius: var(--fme-radius-sm);
    background: var(--fme-surface-2);
    background: color-mix(in oklab, var(--fme-surface-2) 94%, var(--fme-surface-1));
    box-shadow: var(--fme-shadow-lg), 0 0 0 var(--bs-border-width) color-mix(in oklab, var(--fme-brand) 12%, transparent);
    scrollbar-width: thin;
    scrollbar-color: color-mix(in oklab, var(--fme-brand) 52%, var(--fme-border)) color-mix(in oklab, var(--fme-surface-1) 88%, black);
}

.t-shell .t-search-action__menu::-webkit-scrollbar {
    inline-size: 0.75rem;
}

.t-shell .t-search-action__menu::-webkit-scrollbar-track {
    background: color-mix(in oklab, var(--fme-surface-1) 88%, black);
    border-radius: var(--fme-radius-pill);
}

.t-shell .t-search-action__menu::-webkit-scrollbar-thumb {
    background: color-mix(in oklab, var(--fme-brand) 52%, var(--fme-border));
    border-radius: var(--fme-radius-pill);
    border: 0.125rem solid color-mix(in oklab, var(--fme-surface-1) 88%, black);
}

.t-shell .t-search-action__menu::-webkit-scrollbar-thumb:hover {
    background: color-mix(in oklab, var(--fme-brand) 70%, var(--fme-border));
}

.t-shell .t-search-action__option {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    align-self: stretch;
    inline-size: 100%;
    block-size: auto;
    min-block-size: var(--fme-control-h-sm);
    padding-block: var(--fme-space-2);
    padding-inline: var(--fme-space-3);
    border-radius: var(--fme-radius-sm);
    border: var(--bs-border-width) solid color-mix(in oklab, var(--fme-border) 84%, transparent);
    background: color-mix(in oklab, var(--fme-surface-1) 64%, var(--fme-surface-2));
    color: var(--fme-text);
    cursor: pointer;
    text-align: start;
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.t-shell .t-search-action__option:hover,
.t-shell .t-search-action__option.is-highlighted {
    border-color: color-mix(in oklab, var(--fme-brand) 30%, var(--fme-border));
    background: color-mix(in oklab, var(--fme-surface-2) 80%, var(--fme-surface-1));
}

.t-shell .t-search-action__option.is-selected {
    border-color: color-mix(in oklab, var(--fme-brand) 55%, var(--fme-border));
    background: color-mix(in oklab, var(--fme-brand) 10%, var(--fme-surface-2));
    box-shadow: var(--fme-shadow-sm);
}

.t-shell .t-search-action__option-label {
    min-width: 0;
    color: var(--fme-text);
    font-size: var(--fme-text-sm);
    line-height: var(--fme-leading-normal);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.t-shell .t-search-action__empty {
    padding: var(--fme-space-3);
    border-radius: var(--fme-radius-sm);
    border: var(--bs-border-width) dashed color-mix(in oklab, var(--fme-border) 72%, var(--fme-text-faint));
    background: color-mix(in oklab, var(--fme-surface-1) 70%, var(--fme-surface-2));
    color: var(--fme-text-muted);
    font-size: var(--fme-text-sm);
    line-height: var(--fme-leading-normal);
}

@media (max-width: 640px) {
    .t-shell .t-search-action__row {
        grid-template-columns: 1fr;
    }
}
