#id_kit_btn {
    position: fixed;
    bottom: 0.5rem;
    right: 0.5rem;

    // In landscape, centre the 3rem-wide btn within the var(--sidebar-w)
    // footer sidebar — matches the bud-btn (bottom-left) + gear-btn (above
    // kit-btn) formula. The clamp on the root rem means the sidebar scales
    // fluidly, so this single rule covers all viewports without a per-
    // breakpoint override.
    @media (orientation: landscape) {
        right: calc((var(--sidebar-w) - 3rem) / 2);
        bottom: 0.5rem;
        top: auto;
    }

    z-index: 318;
    font-size: 1.75rem;
    cursor: pointer;
    color: rgba(var(--secUser), 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: rgba(var(--priUser), 1);
    border: 0.15rem solid rgba(var(--secUser), 1);

    &.active {
        color: rgba(var(--quaUser), 1);
        border-color: rgba(var(--quaUser), 1);
    }
}

#id_kit_bag_dialog {
    // Override dialog's native display:none so we can drive visibility via max-height
    display: block !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border: none;
    border-top: 0.1rem solid rgba(var(--quaUser), 1);
    background: rgba(var(--priUser), 0.97);
    z-index: 316;
    overflow: hidden;

    @media (orientation: landscape) {
        $sidebar-w: 4rem;
        // left: $sidebar-w;
        right: $sidebar-w;
        z-index: 316;
    }
    // Closed state
    max-height: 0;
    visibility: hidden;
    transition: max-height 0.25s ease-out, visibility 0s 0.25s;

    &[open] {
        max-height: 5rem;
        visibility: visible;
        transition: max-height 0.25s ease-out, visibility 0s;
        display: flex !important;
        flex-direction: row;
        gap: 1.5rem;
        align-items: center;
        padding: 0.4rem 1rem;
    }
}

.kit-bag-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.kit-bag-label {
    font-size: 0.55rem;
    text-transform: uppercase;
    text-decoration: underline;
    letter-spacing: 0.12em;
    color: rgba(var(--quaUser), 0.75);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    padding: 0 0.25rem 0 0.5rem;
}

.kit-bag-row {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
}

#id_kit_bag_dialog {
    .token {
        font-size: 1.5rem;
        cursor: pointer;
        transition: filter 0.15s;
        padding: 0 0.125rem;

        &:hover .token-tooltip,
        &:hover .tt { display: none; } // JS positions these as fixed
    }

    .token-tooltip,
    .tt {
        z-index: 9999;

        @extend %tt-token-fields;

        // Buttons positioned on left edge of the fixed inline tooltip
        .tt-equip-btns {
            position: absolute;
            left: -1rem;
            top: 0;
            display: flex;
            flex-direction: column;
            gap: 1.25rem;
            z-index: 1;

            .btn { margin: 0; }
        }
    }

    .kit-bag-deck {
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0 0.125rem;
        color: rgba(var(--terUser), 1);
    }

    .kit-bag-placeholder {
        font-size: 1.5rem;
        padding: 0 0.125rem;
        color: rgba(var(--quaUser), 0.3);
    }
}

.kit-bag-section--tokens {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.kit-bag-row--scroll {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    &::-webkit-scrollbar { display: none; }
}

.kit-bag-empty {
    font-size: 0.7rem;
    color: rgba(var(--secUser), 0.4);
}

// ── Game Kit page ────────────────────────────────────────────────────────────

#id_game_kit_applets_container {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#id_game_kit_applets_container section {
    display: flex;
    flex-direction: column;

    h2 { flex-shrink: 0; }
    .gk-items { flex: 1; overflow-y: auto; }
}

.gk-items {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.gk-deck-card,
.gk-trinket-card,
.gk-token-card,
.gk-pronoun-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 0.1rem solid rgba(var(--secUser), 0.3);
    cursor: pointer;
    font-size: 1.5rem;
    min-width: 6rem;
    text-align: center;
    transition: border-color 0.15s;

    span { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; }
    small { font-size: 0.6rem; opacity: 0.5; }

    &:hover { border-color: rgba(var(--secUser), 0.8); }
}

.gk-pronoun-card {
    // Card shows the ideology slug (pluralism, bawlmorese, …) in italic;
    // the guard portal previews the actual slash trio above OK|NVM via JS.
    // Active card is filled with the secondary tint so the user can see at a
    // glance which preference is currently in effect.
    .gk-pronoun-label {
        font-size: 0.85rem;
        letter-spacing: 0.05em;
        text-transform: lowercase;
        font-style: italic;
    }
    &.active {
        border-color: rgba(var(--secUser), 1);
        background: rgba(var(--secUser), 0.18);
    }
}

#id_guard_portal .guard-pronoun-trio {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    opacity: 0.75;
    text-align: center;
}

.gk-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 0.1rem dashed rgba(var(--secUser), 0.2);
    font-size: 1.5rem;
    min-width: 6rem;
    text-align: center;
    opacity: 0.4;

    span { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; }
}

.gk-empty {
    font-size: 0.8rem;
    opacity: 0.45;
}

