/* GeoPlaceInput — @{place} mention UI. Teal accent to distinguish from asset [tags].
   Highlight-only: every picked place colours an area, so there is a single chip style and a
   single swatch — no role badge, no pin variant, no switch control. See geo-place-input.js. */

/* The colour we promise: the same teal on the typeahead row, the chip and the "Highlight a
   place" pill, so the swatch alone reads as "this area gets filled in". */
.gpi-swatch {
    flex-shrink: 0;
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 3px;
    background: #5eead4;         /* teal-300 */
    border: 1px solid #0d9488;   /* teal-600 */
}

.gpi-chip-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.5rem;
    width: 100%;
}

/* Align the geo chip strip with the asset-tag row in each layout context.
   The strip lives INSIDE .ati-container (block flow, below the textarea + asset chips),
   so its horizontal inset must match the asset-tag row of the surrounding card. */
.prompt-card .gpi-chip-strip {
    padding: 0 12px;
}

.prompt-input-section .gpi-chip-strip,
.prompt-input-wrapper .gpi-chip-strip,
.detail-modal-prompt-box .gpi-chip-strip {
    padding: 0;
}

.gpi-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    line-height: 1.2;
    border: 1px solid transparent;
    white-space: nowrap;
}

.gpi-chip-fill {
    background: #ccfbf1;          /* teal-100 */
    color: #115e59;              /* teal-800 */
    border-color: #5eead4;       /* teal-300 */
}

.gpi-chip-unresolved {
    background: #fef3c7;          /* amber-100 */
    color: #92400e;             /* amber-800 */
    border-color: #fcd34d;       /* amber-300 */
}

/* ============================================================================
   The place picker (approved E-studio design) — "@" opens it. #gpiAutocomplete keeps its id and the
   .gpi-autocomplete / .gpi-autocomplete-visible classes (pages guard Enter-to-submit on them).
   Desktop: a panel under the prompt — grouped results on the left, a one-tile map preview on the right.
   Phone (< 900px): a full-height bottom sheet with its own search field. Colours are local, so it looks
   the same on every page that mounts it (Projects, landing, Video).
   ============================================================================ */
.gpi-autocomplete.gpi-pp {
    --pp-ink: #16161a;
    --pp-ink-2: #55565e;
    --pp-ink-3: #686973;
    --pp-line: #e7e7ea;
    --pp-bg: #f6f6f7;
    --pp-soft: #f0f1ff;
    --pp-place: #4338ca;
    --pp-ease: cubic-bezier(.16, 1, .3, 1);
    position: fixed;
    z-index: 9999;
    display: none;
    flex-direction: column;
    max-height: 440px;
    padding: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--pp-line);
    border-radius: 16px;
    box-shadow: 0 30px 70px -28px rgba(22, 22, 26, .30), 0 6px 16px rgba(22, 22, 26, .06);
    color: var(--pp-ink);
    font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .16s var(--pp-ease), transform .16s var(--pp-ease);
}

    .gpi-autocomplete.gpi-pp.gpi-autocomplete-visible {
        display: flex;
    }

    .gpi-autocomplete.gpi-pp.gpi-pp-open {
        opacity: 1;
        transform: none;
    }

/* search field — the phone sheet only (on desktop the typing stays in the prompt) */
.gpi-pp-search {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 10px 10px 14px;
    border-bottom: 1px solid var(--pp-line);
    color: var(--pp-ink-3);
}

.gpi-pp.gpi-pp-field .gpi-pp-search {
    display: flex;
}

.gpi-pp-q {
    flex: 1;
    min-width: 0;
    height: 40px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--pp-ink);
    font-size: 16px;
    font-family: inherit;
}

    .gpi-pp-q::-webkit-search-cancel-button {
        display: none;
    }

.gpi-pp-close {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--pp-ink-2);
    cursor: pointer;
}

    .gpi-pp-close:hover {
        background: #f2f2f4;
        color: var(--pp-ink);
    }

/* body: list | preview */
.gpi-pp-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    flex: 1;
    min-height: 0;
}

.gpi-pp-list {
    overflow-y: auto;
    min-height: 0;
    padding: 6px;
}

.gpi-pp-g {
    padding: 9px 10px 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--pp-ink-3);
}

.gpi-autocomplete .gpi-ac-item {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    column-gap: 10px;
    row-gap: 1px;
    align-items: center;
    padding: 7px 10px;
    border-radius: 9px;
    cursor: pointer;
    color: var(--pp-ink);
    font-size: 14px;
}

    .gpi-autocomplete .gpi-ac-item:hover,
    .gpi-autocomplete .gpi-ac-item.gpi-ac-active {
        background: var(--pp-soft);
    }

.gpi-ic {
    grid-row: 1 / 3;
    display: grid;
    place-items: center;
    color: var(--pp-ink-3);
}

.gpi-ac-item.gpi-ac-active .gpi-ic {
    color: var(--pp-place);
}

.gpi-autocomplete .gpi-ac-name {
    font-size: 14px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    .gpi-autocomplete .gpi-ac-name b {
        font-weight: 700;
    }

.gpi-autocomplete .gpi-ac-kind {
    font-size: 12px;
    line-height: 1.35;
    color: var(--pp-ink-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gpi-pp-wait {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    font-size: 12.5px;
    color: var(--pp-ink-3);
}

.gpi-spin {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1.5px solid #c9c9d1;
    border-top-color: transparent;
    animation: gpiSpin .8s linear infinite;
}

@keyframes gpiSpin {
    to { transform: rotate(360deg); }
}

.gpi-autocomplete .gpi-ac-empty {
    display: block;
    margin: 0;
    padding: 12px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--pp-ink-2);
}

/* preview: one NASA-mirror tile, a pin at the exact point, name · kind · coordinates */
.gpi-pp-prev {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    padding: 12px;
    border-left: 1px solid var(--pp-line);
    background: var(--pp-bg);
}

.gpi-pp-map {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    background: #151a20;
    display: grid;
    place-items: center;
    color: #9aa1ad;
}

.gpi-pp-tile {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    aspect-ratio: 1 / 1;
}

    .gpi-pp-tile img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
        animation: gpiFade .3s var(--pp-ease);
    }

.gpi-pp-pin {
    position: absolute;
    z-index: 2;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 0 rgba(220, 38, 38, .7);
    animation: gpiPulse 1.6s ease-out infinite;
}

@keyframes gpiPulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .7); }
    100% { box-shadow: 0 0 0 16px rgba(220, 38, 38, 0); }
}

@keyframes gpiFade {
    from { opacity: 0; }
}

.gpi-pp-meta b {
    display: block;
    font-size: 14px;
    font-weight: 650;
}

.gpi-pp-meta span {
    display: block;
    font-size: 12px;
    line-height: 1.45;
    color: var(--pp-ink-2);
}

.gpi-num {
    font-variant-numeric: tabular-nums;
}

.gpi-pp-pv-empty {
    margin: 0;
    font-size: 12.5px;
    color: var(--pp-ink-3);
}

.gpi-pp-foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 14px;
    border-top: 1px solid var(--pp-line);
    font-size: 12px;
    color: var(--pp-ink-3);
}

    .gpi-pp-foot kbd {
        display: inline-block;
        min-width: 18px;
        padding: 0 4px;
        border: 1px solid var(--pp-line);
        border-radius: 4px;
        background: #fff;
        font-size: 11px;
        font-weight: 600;
        line-height: 16px;
        font-family: inherit;
        text-align: center;
        color: var(--pp-ink-2);
    }

.gpi-pp-scrim {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(16, 17, 20, .4);
    animation: gpiFade .2s;
}

    .gpi-pp-scrim[hidden] {
        display: none;
    }

/* Phone: a full-height bottom sheet */
.gpi-autocomplete.gpi-pp.gpi-pp-sheet {
    left: 0 !important;
    right: 0;
    bottom: 0 !important;
    top: max(10px, env(safe-area-inset-top)) !important;
    width: auto !important;
    max-height: none !important;
    border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    transform: translateY(100%);
    transition: transform .3s var(--pp-ease), opacity .2s;
}

    .gpi-autocomplete.gpi-pp.gpi-pp-sheet.gpi-pp-open {
        transform: none;
    }

.gpi-pp-sheet .gpi-pp-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
}

.gpi-pp-sheet .gpi-pp-prev {
    flex-direction: row;
    align-items: center;
    border-left: 0;
    border-top: 1px solid var(--pp-line);
}

.gpi-pp-sheet .gpi-pp-map {
    width: 150px;
    flex: none;
}

.gpi-pp-sheet .gpi-ac-item {
    min-height: 48px;
    padding: 10px;
}

.gpi-pp-sheet .gpi-pp-foot span:first-child {
    display: none;
}

@media (max-width: 899px) {
    .gpi-pp-foot span:first-child {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gpi-autocomplete.gpi-pp,
    .gpi-autocomplete.gpi-pp.gpi-pp-sheet {
        transition: opacity .15s;
        transform: none;
    }

    .gpi-pp-pin,
    .gpi-spin {
        animation: none;
    }
}
