/* Command palette (phase3-slice1-plan.md D12; workspace-nav-architecture.md "Command palette
   (r5)"). A full-viewport overlay opened by Ctrl+K / Cmd+K or the top-bar opener button. Not a
   Bootstrap .modal; positioned top-center by design. No hardcoded theme colors: every color
   comes from the theme-v2.css custom properties already used by the sidebar and rail. */

.aw-palette {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    justify-content: center;
}

.aw-palette.d-none {
    display: none;
}

.aw-palette-backdrop {
    position: absolute;
    inset: 0;
    background: var(--aw-overlay-backdrop);
}

.aw-palette-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 640px;
    margin-top: 12vh;
    height: fit-content;
    max-height: 70vh;
    background: var(--aw-white);
    border-radius: 12px;
    box-shadow: var(--aw-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.aw-palette-input {
    border: none;
    border-bottom: 1px solid var(--aw-hairline);
    padding: 1rem 1.25rem;
    font-size: 1.05rem;
    color: var(--aw-ink);
    outline: none;
    width: 100%;
}

    .aw-palette-input:focus {
        outline: none;
        box-shadow: none;
    }

.aw-palette-results {
    list-style: none;
    margin: 0;
    padding: .5rem;
    overflow-y: auto;
}

    .aw-palette-results:empty {
        display: none;
    }

    .aw-palette-results li {
        margin: 0;
        padding: 0;
    }

.aw-palette-result {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .6rem .75rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--aw-ink);
}

    .aw-palette-result i {
        width: 18px;
        text-align: center;
        color: var(--aw-sidebar);
    }

    .aw-palette-result .aw-palette-label {
        font-weight: 500;
    }

    .aw-palette-result .aw-palette-meta {
        margin-left: auto;
        font-size: .8rem;
        color: var(--aw-meta);
        white-space: nowrap;
    }

    .aw-palette-result:hover,
    .aw-palette-result.is-active {
        background: var(--aw-gold-500);
        color: var(--aw-on-gold);
    }

        .aw-palette-result:hover i,
        .aw-palette-result.is-active i,
        .aw-palette-result:hover .aw-palette-meta,
        .aw-palette-result.is-active .aw-palette-meta {
            color: var(--aw-on-gold);
        }

/* Top-bar opener button, sized like the #sidebarCollapse hamburger it sits beside. */
.aw-palette-open {
    background: transparent;
    border: 1px solid var(--aw-border-subtle);
    color: var(--aw-topbar);
    border-radius: 8px;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: .5rem;
}

    .aw-palette-open:hover {
        background: var(--aw-surface-hover);
    }

@media (max-width: 767.98px) {
    .aw-palette-panel {
        max-width: 100%;
        margin: 0;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .aw-palette {
        align-items: stretch;
    }
}
