.fd-command,
.fd-command *,
.fd-command *::before,
.fd-command *::after {
    box-sizing: border-box;
}

.fd-command[hidden],
.fd-command [hidden] {
    display: none !important;
}

.fd-command {
    align-items: flex-start;
    display: flex;
    inset: 0;
    justify-content: center;
    padding: min(12vh, 112px) 24px 24px;
    position: fixed;
    z-index: 1200;
}

.fd-command__backdrop {
    background: rgba(15, 23, 42, 0.46);
    border: 0;
    cursor: default;
    inset: 0;
    padding: 0;
    position: absolute;
}

.fd-command__dialog {
    background: #ffffff;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
    display: flex;
    flex-direction: column;
    max-height: min(720px, calc(100vh - min(12vh, 112px) - 48px));
    max-width: 760px;
    min-height: 240px;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.fd-command__search {
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
    min-height: 68px;
    padding: 10px 14px 10px 18px;
}

.fd-command__search-icon {
    color: #64748b;
    flex: 0 0 24px;
    font-size: 24px;
}

.fd-command__input {
    appearance: none;
    background: transparent;
    border: 0;
    color: #0f172a;
    flex: 1 1 auto;
    font: inherit;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.4;
    min-width: 0;
    outline: 0;
    padding: 10px 2px;
}

.fd-command__input::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

.fd-command__input::-webkit-search-cancel-button {
    display: none;
}

.fd-command__icon-button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 38px;
    height: 38px;
    justify-content: center;
    padding: 0;
    width: 38px;
}

.fd-command__icon-button:hover,
.fd-command__icon-button:focus-visible {
    background: #f1f5f9;
    color: #1e293b;
}

.fd-command__icon-button:focus-visible,
.fd-command__result:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.fd-command__icon-button .material-symbols-outlined {
    font-size: 20px;
}

.fd-command__spinner {
    animation: fd-command-spin 0.8s linear infinite;
    color: #2563eb;
    display: none;
    flex: 0 0 20px;
    font-size: 20px;
}

.fd-command.is-loading .fd-command__spinner {
    display: inline-block;
}

.fd-command__results {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 10px;
}

.fd-command__content {
    display: grid;
    gap: 10px;
}

.fd-command__notice {
    align-items: flex-start;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    color: #92400e;
    display: flex;
    font-size: 13px;
    gap: 8px;
    line-height: 1.5;
    padding: 9px 12px;
}

.fd-command__notice .material-symbols-outlined {
    flex: 0 0 18px;
    font-size: 18px;
    margin-top: 1px;
}

.fd-command__group {
    min-width: 0;
}

.fd-command__group-title {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.4;
    margin: 0;
    padding: 8px 10px 6px;
}

.fd-command__group-results {
    display: grid;
    gap: 3px;
}

.fd-command__result {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 7px;
    color: #0f172a;
    display: grid;
    gap: 12px;
    grid-template-columns: 38px minmax(0, 1fr) auto 20px;
    min-height: 60px;
    padding: 9px 12px;
    text-decoration: none;
}

.fd-command__result:hover,
.fd-command__result.is-active {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #0f172a;
}

.fd-command__result-icon {
    align-items: center;
    background: #eef2ff;
    border-radius: 7px;
    color: #4f46e5;
    display: inline-flex;
    flex: 0 0 38px;
    font-size: 21px;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.fd-command__result-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.fd-command__result-copy strong {
    color: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.fd-command__result-copy > span {
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.fd-command__result-badge {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 5px 7px;
    white-space: nowrap;
}

.fd-command__result-arrow {
    color: #94a3b8;
    font-size: 18px;
}

.fd-command__empty,
.fd-command__loading {
    align-items: center;
    color: #64748b;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    min-height: 210px;
    padding: 30px 18px;
    text-align: center;
}

.fd-command__empty .material-symbols-outlined,
.fd-command__loading .material-symbols-outlined {
    color: #94a3b8;
    font-size: 30px;
}

.fd-command__loading .material-symbols-outlined {
    animation: fd-command-spin 0.8s linear infinite;
}

.fd-command__empty strong {
    color: #334155;
    font-size: 14px;
}

.fd-command__empty span:not(.material-symbols-outlined),
.fd-command__loading span:not(.material-symbols-outlined) {
    font-size: 13px;
    line-height: 1.55;
}

.fd-command__sr-only {
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.dark .fd-command__backdrop {
    background: rgba(2, 6, 23, 0.74);
}

.dark .fd-command__dialog {
    background: #111827;
    border-color: #334155;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.dark .fd-command__search {
    border-color: #334155;
}

.dark .fd-command__input,
.dark .fd-command__result,
.dark .fd-command__result:hover,
.dark .fd-command__result.is-active {
    color: #f8fafc;
}

.dark .fd-command__icon-button:hover,
.dark .fd-command__icon-button:focus-visible,
.dark .fd-command__result:hover,
.dark .fd-command__result.is-active {
    background: #1e293b;
}

.dark .fd-command__result:hover,
.dark .fd-command__result.is-active {
    border-color: #475569;
}

.dark .fd-command__result-icon {
    background: #312e81;
    color: #c7d2fe;
}

.dark .fd-command__result-badge {
    background: #1e293b;
    border-color: #475569;
    color: #cbd5e1;
}

.dark .fd-command__empty strong {
    color: #e2e8f0;
}

@keyframes fd-command-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 640px) {
    .fd-command {
        padding: 0;
    }

    .fd-command__dialog {
        border: 0;
        border-radius: 0;
        box-shadow: none;
        height: 100dvh;
        max-height: none;
        max-width: none;
    }

    .fd-command__search {
        min-height: 62px;
        padding: max(8px, env(safe-area-inset-top)) 10px 8px 14px;
    }

    .fd-command__input {
        font-size: 16px;
    }

    .fd-command__results {
        padding: 8px;
    }

    .fd-command__result {
        gap: 10px;
        grid-template-columns: 38px minmax(0, 1fr) 18px;
        padding: 9px 10px;
    }

    .fd-command__result-badge {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fd-command__spinner,
    .fd-command__loading .material-symbols-outlined {
        animation-duration: 1.6s;
    }
}
