.browser-command-overlay {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: min(92px, 14vh);
    background: color-mix(in srgb, var(--bg-primary) 34%, transparent);
    backdrop-filter: blur(8px);
    animation: browser-command-overlay-in var(--duration-enter) var(--ease-out-expo) both;
}

.browser-command-overlay.closing {
    animation: browser-command-overlay-out 160ms var(--ease-in-out) both;
}

.browser-command-overlay.closing .browser-command-palette {
    animation: browser-command-palette-out 160ms var(--ease-in-out) both;
}

.browser-command-palette {
    width: min(640px, calc(100vw - 28px));
    max-height: min(560px, calc(100vh - 120px));
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, var(--glass-gradient-start), var(--glass-gradient-end));
    box-shadow:
        0 18px 70px var(--shadow-color-strong),
        0 2px 12px var(--shadow-color);
    overflow: hidden;
    animation: browser-command-palette-in var(--duration-enter) var(--ease-out-expo) both;
}

.browser-command-search {
    height: 58px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-muted);
}

.browser-command-search input {
    min-width: 0;
    flex: 1;
    color: var(--text-primary);
    font-size: 15px;
}

.browser-command-search input::placeholder {
    color: var(--text-muted);
}

.browser-command-search kbd,
.browser-command-shortcut {
    min-width: max-content;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 7px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--surface-glass);
    color: var(--text-muted);
    font-size: 10px;
    font-family: inherit;
}

.browser-command-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px;
    overflow: auto;
}

.browser-command-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    text-align: left;
    transition:
        background var(--duration-fast) var(--ease-in-out),
        color var(--duration-fast) var(--ease-in-out);
}

.browser-command-item:hover,
.browser-command-item.selected {
    background: var(--surface-hover);
}

.browser-command-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
    color: var(--accent-primary);
}

.browser-command-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.browser-command-label {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
}

.browser-command-hint {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 11.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.browser-command-empty {
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

@keyframes browser-command-overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes browser-command-overlay-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes browser-command-palette-in {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes browser-command-palette-out {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
}
