/*
 * Befehls- und Suchpalette (Strg+K, Paket 15a): zentrierter Dialog oben, ein Feld, Treffer in Gruppen.
 */

.palette {
    width: min(700px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100vh - 12vh - 32px);
    margin: 12vh auto auto;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 10px;
    background: var(--c-white, #fff);
    box-shadow: 0 18px 48px rgba(10, 20, 50, 0.35);
    color: var(--c-text-strong, #242424);
}

.palette::backdrop {
    background: rgba(20, 28, 54, 0.5);
}

.palette__field {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    border-bottom: 1px solid var(--c-line, #e5e8ee);
}

.palette__field > .icon {
    flex: none;
    width: 22px;
    height: 22px;
    color: var(--c-blue, #3c57a7);
}

.palette__input {
    flex: 1;
    min-width: 0;
    height: 60px;
    border: 0;
    background: transparent;
    color: var(--c-text-strong, #242424);
    font: inherit;
    font-size: 19px;
}

.palette__input:focus {
    outline: none;
}

.palette__field:focus-within {
    box-shadow: inset 0 -3px 0 var(--c-blue, #3c57a7);
}

.palette__list {
    max-height: min(56vh, 520px);
    overflow: auto;
    padding: 6px 0;
}

.palette__group-label {
    padding: 10px 16px 4px;
    color: var(--c-muted, #566070);
    font-size: 13px;
    font-weight: 500;
}

.palette__item {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 2px 12px;
    min-height: 44px;
    padding: 8px 16px;
    color: var(--c-text-strong, #242424);
    text-decoration: none;
    cursor: pointer;
}

.palette__item:hover {
    text-decoration: none;
}

.palette__item > .icon,
.palette__item > svg,
.palette__icon-gap {
    grid-row: span 2;
    width: 20px;
    height: 20px;
    color: var(--c-blue, #3c57a7);
}

.palette__label {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    font-weight: 500;
}

.palette__label .status {
    font-weight: 400;
}

.palette__hint {
    grid-row: span 2;
}

.palette__detail {
    grid-column: 2 / 4;
    color: var(--c-muted, #566070);
    font-size: 13px;
}

.palette__item[aria-selected="true"] {
    background: var(--c-blue-light, #e8edf8);
    box-shadow: inset 3px 0 var(--c-blue, #3c57a7);
}

.palette__empty {
    margin: 0;
    padding: 24px 16px;
    color: var(--c-text, #1b1f24);
    text-align: center;
}

.palette__foot {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 0;
    padding: 10px 16px;
    border-top: 1px solid var(--c-line, #e5e8ee);
    background: #fafbfc;
    color: var(--c-muted, #566070);
    font-size: 13px;
}

/* Tastenkappe – nur, solange die Grundlage (Paket 15b) sie noch nicht mitbringt */
.palette .kbd,
.undo .kbd {
    display: inline-block;
    min-width: 1.7em;
    padding: 0 6px;
    border: 1px solid var(--c-border, #b2b9c4);
    border-bottom-width: 2px;
    border-radius: 4px;
    background: var(--c-white, #fff);
    color: var(--c-text-strong, #242424);
    font: 500 12px/1.6 var(--font, inherit);
    text-align: center;
}

@media (max-width: 640px) {
    .palette {
        width: calc(100vw - 16px);
        margin-top: 8px;
        max-height: calc(100vh - 16px);
    }

    .palette__foot span:last-child {
        flex-basis: 100%;
    }
}

@media (forced-colors: active) {
    .palette__item[aria-selected="true"] {
        outline: 2px solid Highlight;
        outline-offset: -2px;
    }
}
