/* ── Selected city session picker ───────────────────────── */

body.b4b-city-session-locked {
    overflow: hidden;
}

.b4b-city-session-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.b4b-city-session-overlay.is-hidden,
.b4b-city-session-overlay[hidden] {
    display: none !important;
}

.b4b-city-session-modal {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
    padding: 28px 26px 24px;
}

.b4b-city-session-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: none;
    background: transparent;
    color: #667085;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}

.b4b-city-session-close:hover {
    color: #1a1a2e;
}

.b4b-city-session-title {
    margin: 0 0 6px;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
}

.b4b-city-session-sub {
    margin: 0 0 18px;
    font-size: 0.92rem;
    color: #667085;
    line-height: 1.45;
}

.b4b-city-session-field {
    margin-bottom: 14px;
}

.b4b-city-session-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #344054;
}

.b4b-city-session-select {
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid #d0d5dd;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 1rem;
    color: #1a1a2e;
    background: #fff;
    outline: none;
    appearance: auto;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.b4b-city-session-select:focus {
    border-color: #5458ea;
    box-shadow: 0 0 0 3px rgba(84, 88, 234, 0.18);
}

.b4b-city-session-select:disabled {
    background: #f9fafb;
    color: #98a2b3;
    cursor: not-allowed;
}

.b4b-city-session-select.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

.b4b-city-session-error {
    margin: 10px 0 0;
    font-size: 0.85rem;
    color: #dc3545;
    font-weight: 500;
}

.b4b-city-session-error[hidden] {
    display: none !important;
}

.b4b-city-session-submit {
    display: block;
    width: 100%;
    margin-top: 18px;
    border: none;
    border-radius: 10px;
    background: #5458ea;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.b4b-city-session-submit:hover {
    background: #3f43d4;
}

.b4b-city-session-submit:disabled {
    opacity: 0.65;
    cursor: wait;
}

/* ── Topbar / badge display ─────────────────────────────── */

.b4b-selected-city-display {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    max-width: 260px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #f4f5f7;
    border: 1px solid #e4e7ec;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    font: inherit;
    color: inherit;
    text-align: left;
}

.b4b-selected-city-display:hover {
    border-color: #5458ea;
    background: #f0f2ff;
}

.b4b-selected-city-display__prefix {
    font-size: 0.72rem;
    font-weight: 500;
    color: #667085;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.b4b-selected-city-display__value {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1a1a2e;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Fallback badge for non-GPT layouts */
.b4b-selected-city-badge {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 99990;
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    max-width: min(280px, calc(100vw - 24px));
    padding: 8px 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e4e7ec;
    box-shadow: 0 4px 16px rgba(16, 24, 40, 0.1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    font: inherit;
    color: inherit;
    text-align: left;
}

.b4b-selected-city-badge:hover {
    border-color: #5458ea;
}

.b4b-selected-city-badge__prefix {
    font-size: 0.7rem;
    font-weight: 500;
    color: #667085;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.b4b-selected-city-badge__value {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1a1a2e;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hide floating badge when GPT topbar is present (label lives there) */
.dcs-layout ~ #b4b-selected-city-badge,
body.b4b-has-selected-city:has(.dcs-topbar) #b4b-selected-city-badge {
    display: none;
}

body.b4b-gpt-layout #b4b-selected-city-badge {
    display: none;
}

@media (max-width: 768px) {
    .b4b-selected-city-display {
        max-width: 150px;
    }

    .b4b-selected-city-display__prefix {
        display: none;
    }

    .b4b-city-session-modal {
        padding: 22px 18px 18px;
    }
}
