.gs-dialog {
    --gs-navy: #081638;
    --gs-green: #7eb280;
    --gs-soft: #edf4ee;

    position: fixed;
    inset: 0;
    margin: 7vh auto auto;
    width: min(850px,calc(100% - 32px));
    max-width: 100%;
    max-height: 86dvh;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    background: #fff;
    color: var(--gs-navy);
    box-shadow: 0 35px 120px rgba(0,0,0,.3);
    overflow: hidden;
}

.gs-dialog[open] {
    animation: gsAppear .25s ease both;
}

.gs-dialog::backdrop {
    background: rgba(5,15,38,.72);
    backdrop-filter: blur(7px);
}

.gs-dialog [hidden] {
    display: none !important;
}

.gs-panel {
    display: flex;
    flex-direction: column;
    max-height: 86dvh;
}

.gs-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 32px 35px 25px;
    gap: 20px;
}

.gs-eyebrow {
    color: #537d58;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 2px;
}

.gs-header h2 {
    font-size: clamp(24px,3vw,34px);
    letter-spacing: -1px;
    line-height: 1.15;
    margin: 10px 0 0;
}

.gs-close {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: none;
    background: #eef2f5;
    color: var(--gs-navy);
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
}

.gs-close:hover {
    background: #dfe9e0;
}

.gs-input-wrap {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 16px;
    margin: 0 35px 20px;
    padding: 12px 20px;
    border: 2px solid #c9decc;
    border-radius: 13px;
    background: #f6f9f7;
}

.gs-input-wrap:focus-within {
    border-color: #7eb280;
    box-shadow: 0 0 0 4px rgba(126,178,128,.15);
}

.gs-input-wrap > svg {
    flex-shrink: 0;
    color: #537d58;
}

.gs-input-wrap input {
    width: 100%;
    min-width: 0;
    padding: 8px 0;
    border: none;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 16px;
    color: var(--gs-navy);
}

.gs-input-wrap kbd {
    padding: 5px 8px;
    font-size: 10px;
    border: 1px solid #d8e0e4;
    border-radius: 5px;
    color: #64748b;
}

.gs-body {
    overflow-y: auto;
    min-height: 0;
    padding: 8px 35px 28px;
    overscroll-behavior: contain;
}

.gs-label {
    margin: 20px 0 15px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.4px;
}

.gs-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 35px;
}

.gs-suggestions button {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 1px solid #dfe8e0;
    background: var(--gs-soft);
    color: var(--gs-navy);
    border-radius: 30px;
    padding: 10px 17px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.gs-suggestions button:hover {
    background: #d5e7d7;
}

.gs-shortcuts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.gs-shortcuts a {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid #e1e8ec;
    border-radius: 12px;
    padding: 20px 15px;
    text-decoration: none;
    color: var(--gs-navy);
    font-size: 14px;
    font-weight: 500;
}

.gs-shortcuts a:hover {
    background: var(--gs-soft);
}

.gs-shortcuts a > svg:first-child {
    color: #537d58;
    flex-shrink: 0;
}

.gs-shortcuts a > svg:last-child {
    margin-left: auto;
    flex-shrink: 0;
}

.gs-status {
    color: #64748b;
    font-size: 13px;
    padding: 10px 0 15px;
}

.gs-group {
    margin-bottom: 25px;
}

.gs-group-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #537d58;
    padding: 12px 14px;
    margin: 0 0 5px;
    background: #edf4ee;
    border-radius: 7px;
}

.gs-result {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    border-radius: 10px;
    color: var(--gs-navy);
    text-decoration: none;
    border-bottom: 1px solid #eef1f3;
}

.gs-result:hover,
.gs-result:focus-visible {
    background: #f1f6f2;
    outline: 2px solid #7eb280;
    outline-offset: -2px;
}

.gs-result-image {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    flex-shrink: 0;
    overflow: hidden;
    background: #edf4ee;
    border-radius: 10px;
    color: #537d58;
    font-size: 22px;
    font-weight: 700;
}

.gs-result-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: white;
}

.gs-group[data-category="medicos"] .gs-result-image img {
    object-fit: cover;
    object-position: center top;
}

.gs-result-text {
    flex: 1;
    min-width: 0;
}

.gs-result-text strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 5px;
    overflow-wrap: anywhere;
}

.gs-result-text small {
    display: block;
    font-size: 12px;
    color: #64748b;
}

.gs-result-arrow {
    font-size: 19px;
    color: #64748b;
}

.gs-all-results {
    display: block;
    padding: 16px;
    margin-top: 16px;
    border-radius: 10px;
    background: #081638;
    color: white !important;
    font-size: 14px;
    text-align: center;
    font-weight: 600;
    text-decoration: none;
}

.gs-footer {
    display: flex;
    flex-shrink: 0;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 17px 35px;
    background: #f6f8f9;
    border-top: 1px solid #e2e8f0;
    font-size: 11px;
    color: #64748b;
}

.gs-footer span:first-child {
    display: flex;
    align-items: center;
    gap: 8px;
}

body.gs-open {
    overflow: hidden;
}

@keyframes gsAppear {
    from {
        opacity: 0;
        transform: translateY(-15px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media(max-width:600px) {

    .gs-dialog {
        margin-top: 3dvh;
        max-height: 92dvh;
        border-radius: 18px;
    }

    .gs-panel {
        max-height: 92dvh;
    }

    .gs-header {
        padding: 24px 20px 18px;
    }

    .gs-input-wrap {
        margin: 0 20px 15px;
        padding: 10px 13px;
    }

    .gs-input-wrap kbd {
        display: none;
    }

    .gs-body {
        padding: 5px 20px 20px;
    }

    .gs-shortcuts {
        grid-template-columns: 1fr;
    }

    .gs-footer {
        padding: 15px 20px;
    }

    .gs-result-image {
        width: 48px;
        height: 48px;
    }
}

@media(prefers-reduced-motion:reduce) {
    .gs-dialog[open] {
        animation: none;
    }
}