:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fb;
    --bg-tertiary: #eef2f6;
    --bg-card: #ffffff;
    --bg-soft: #f9fbfd;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #8e97a3;
    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.12);
    --accent: #2f8c99;
    --accent-strong: #26818f;
    --accent-soft: rgba(47,140,153, 0.14);
    --accent-border: rgba(47,140,153, 0.35);
    --warm: #2f8c99;
    --warm-strong: #226d78;
    --warm-soft: rgba(47,140,153, 0.14);
    --success: #2f8f68;
    --error: #d85c4a;
    --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 18px 38px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 28px 60px rgba(15, 23, 42, 0.12);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 26px;
    --radius-full: 999px;
    --layout-gutter: clamp(10px, 1.2vw, 18px);
    --main-gap: clamp(10px, 1vw, 14px);
    --map-overlay-gap: clamp(8px, 0.85vw, 12px);
    --carousel-overlay-height: clamp(300px, 34vh, 340px);
    --map-google-blue: #1a73e8;
    --map-google-blue-soft: rgba(26, 115, 232, 0.12);
    --map-google-gray: #5f6368;
    --map-google-surface: rgba(255, 255, 255, 0.96);
    --map-google-shadow: 0 1px 2px rgba(60, 64, 67, 0.18), 0 2px 6px 2px rgba(60, 64, 67, 0.12);
    --map-water: #8ecdf4;
    --map-park: #a9d9b0;
    --map-sand: #f7e2a7;
    --map-coral: #f2b39b;
    --glass-bg: linear-gradient(140deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.2));
    --glass-border: rgba(255, 255, 255, 0.48);
    --glass-shadow: 0 18px 45px rgba(31, 41, 55, 0.16);
    --glass-highlight: rgba(255, 255, 255, 0.7);
}

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

html,
body {
    height: 100%;
    min-height: 100%;
    margin: 0;
    overflow: hidden;
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text-primary);
    background:
        radial-gradient(circle at top left, rgba(47,140,153, 0.16), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #f5f8fb 100%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* El header del sitio (.site-header) vive fuera del shell, así que el body se
   organiza como columna flex: header arriba y el mapa ocupando el resto. */
body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
}

.site-header {
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    z-index: 200;
    padding: 14px 0;
    background: transparent;
}

.site-header .brand {
    grid-area: auto;
    justify-self: auto;
    display: flex;
    gap: 0;
    min-width: auto;
    color: inherit;
}

.site-header .header__menu {
    min-width: 0;
}

.site-header .nav {
    min-width: 0;
    flex-wrap: nowrap;
}

.site-header .nav a {
    white-space: nowrap;
}

.site-header .header__auth {
    flex: 0 0 auto;
}

button,
input,
select {
    font: inherit;
}

button {
    border: 0;
}

a {
    color: inherit;
}

.redesign-shell {
    flex: 1 1 auto;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    height: auto;
}

body.ai-chat-layout-constrained .redesign-shell {
    width: calc(100vw - var(--ai-chat-docked-width, 50vw));
    max-width: calc(100vw - var(--ai-chat-docked-width, 50vw));
}

.filters-shell {
    position: relative;
    z-index: 30;
    margin: 0;
    padding: 0;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid rgba(219, 229, 236, 0.92);
    box-shadow: 0 16px 36px -34px rgba(15, 23, 42, 0.34);
}

.filters-shell__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    min-height: 42px;
    padding: 7px max(var(--layout-gutter), 18px);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 253, 0.96));
    border-bottom: 1px solid rgba(219, 229, 236, 0.78);
    color: #172033;
    cursor: pointer;
    text-align: left;
    transition: background 160ms ease, border-color 160ms ease;
}

.filters-shell__toggle:hover {
    background: #fbfdfe;
}

.filters-shell__toggle:focus-visible {
    outline: 0;
    box-shadow: inset 0 0 0 3px rgba(47,140,153, 0.14);
}

.filters-shell__summary {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.filters-shell__eyebrow {
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
    color: #8a97a3;
}

.filters-shell__title {
    min-width: 0;
    overflow: hidden;
    color: #172033;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filters-shell__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    gap: 7px;
    min-height: 30px;
    padding: 0 12px;
    border: 1px solid rgba(47, 140, 153, 0.22);
    border-radius: 999px;
    background: rgba(239, 248, 250, 0.92);
    color: var(--accent-strong);
    font-size: 0.68rem;
    font-weight: 800;
}

.filters-shell__chevron {
    transition: transform 180ms ease;
}

.filters-shell__panel {
    max-height: 560px;
    opacity: 1;
    overflow: visible;
    transform: translateY(0);
    transition: max-height 260ms ease, opacity 180ms ease, transform 220ms ease;
}

.filters-shell.is-collapsed .filters-shell__panel {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(-6px);
}

.filters-shell.is-collapsed .filters-shell__toggle {
    border-bottom-color: transparent;
}

.filters-shell.is-collapsed .filters-shell__chevron {
    transform: rotate(180deg);
}

.redesign-header {
    position: relative;
    z-index: 20;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.92));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 22px 42px -36px rgba(15, 23, 42, 0.28);
}

.redesign-header__inner {
    display: grid;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
        "brand nav auth"
        "search search search";
    align-items: center;
    gap: clamp(8px, 1vw, 14px);
    padding: 10px var(--layout-gutter);
}

.brand {
    grid-area: brand;
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.82));
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 14px 30px -26px rgba(15, 23, 42, 0.32);
}

.brand__logo {
    width: auto;
    height: 40px;
    max-width: 152px;
    display: block;
    object-fit: contain;
    padding: 0;
    border-radius: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.brand__title {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    white-space: nowrap;
}

.search-bar-wrap {
    grid-area: search;
    position: relative;
    justify-self: center;
    width: min(100%, 760px);
}

.search-bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    min-width: 0;
    background: rgba(255, 255, 255, 0.96);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.search-bar:focus-within {
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 4px rgba(47,140,153, 0.18), var(--shadow-sm);
    transform: translateY(-1px);
}

.search-bar__ops {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 6px;
    padding-right: 6px;
    border-right: 1px solid var(--border);
}

.search-bar__op {
    min-width: 76px;
    height: 34px;
    padding: 0 10px;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease;
}

.search-bar__op.active {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.search-bar__input {
    width: 100%;
    min-width: 0;
    height: 44px;
    padding: 0 14px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.8rem;
}

.search-bar__input::placeholder {
    color: var(--text-muted);
}

.search-bar__submit {
    height: 44px;
    padding: 0 16px;
    background: linear-gradient(135deg, var(--warm), var(--warm-strong));
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    white-space: nowrap;
    cursor: pointer;
    transition: filter 160ms ease, transform 160ms ease;
}

.search-bar__submit:hover {
    filter: brightness(1.02);
}

.search-bar__submit:active {
    transform: translateY(1px);
}

.search-suggestions {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 40;
    display: grid;
    gap: 6px;
    max-height: 320px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--accent-border);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
}

.search-suggestions[hidden] {
    display: none !important;
}

.search-suggestions__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease;
}

.search-suggestions__item:hover,
.search-suggestions__item.is-active {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.search-suggestions__meta {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.header-actions {
    display: contents;
}

.redesign-header .header__nav {
    grid-area: nav;
    justify-self: center;
    margin: 0 auto;
}

.redesign-header .header__auth {
    grid-area: auth;
    justify-self: end;
}

.header__nav,
.header-sections {
    display: flex;
    align-items: center;
    gap: clamp(12px, 1.2vw, 20px);
    min-width: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow-x: auto;
    scrollbar-width: none;
}

.header__nav::-webkit-scrollbar,
.header-sections::-webkit-scrollbar {
    display: none;
}

.nav__link,
.header-sections__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 1px;
    border-radius: 0;
    border: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 720;
    line-height: 1.6;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease, text-shadow 0.2s ease, transform 0.2s ease;
    position: relative;
}

.nav__link::after,
.header-sections__link::after {
    content: none;
}

.nav__link--wp {
    gap: 0;
}

.nav__link:hover,
.header-sections__link:hover {
    transform: translateY(-1px);
    color: var(--text-primary);
}

.nav__link--active,
.header-sections__link--active {
    color: var(--accent);
    text-shadow: 0 0 16px rgba(47,140,153, 0.18);
}

.nav__link:hover::after,
.header-sections__link:hover::after,
.nav__link--active::after,
.header-sections__link--active::after {
    content: none;
}

.header-link,
.header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.88));
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 16px 30px -28px rgba(15, 23, 42, 0.28);
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.header-link:hover,
.header-btn:hover {
    transform: translateY(-1px);
    border-color: var(--accent-border);
    background: var(--accent-soft);
    box-shadow: 0 18px 34px -26px rgba(68, 108, 119, 0.28);
}

.header-btn {
    cursor: pointer;
}

.redesign-header .header__auth {
    margin-left: 0;
    flex: 0 0 auto;
}

.redesign-header .btn--login,
.redesign-header .user-profile {
    min-height: 40px;
    white-space: nowrap;
}

.redesign-header .header-user-tools {
    gap: 8px;
}

.redesign-header .user-profile__dropdown,
.redesign-header .notifications-dropdown {
    z-index: 5400;
}

.header-btn--scrape {
    background: linear-gradient(135deg, var(--warm), var(--warm-strong));
    border-color: rgba(180, 149, 48, 0.3);
    color: #ffffff;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(47,140,153, 0.3);
}

.header-btn--scrape:hover {
    background: linear-gradient(135deg, #cfb24f, #226d78);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(47,140,153, 0.4);
}

.redesign-filters {
    position: relative;
    z-index: 18;
    display: grid;
    grid-template-columns:
        minmax(156px, 0.86fr)
        minmax(170px, 0.94fr)
        minmax(188px, 1fr)
        minmax(188px, 1fr)
        minmax(176px, 0.9fr);
    align-items: end;
    gap: 12px;
    padding: 12px max(var(--layout-gutter), 18px);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 253, 0.96));
    border-bottom: 1px solid rgba(219, 229, 236, 0.92);
    box-shadow: 0 16px 36px -34px rgba(15, 23, 42, 0.34);
    overflow: visible;
    scrollbar-width: none;
}

.redesign-filters::-webkit-scrollbar {
    display: none;
}

.filter-ctrl {
    display: grid;
    align-content: end;
    gap: 6px;
    min-width: 0;
}

.filter-ctrl__label {
    padding-left: 2px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
    color: #8a97a3;
}

.filter-ctrl select,
.filter-ctrl input {
    width: 100%;
    height: 46px;
    min-width: 0;
    padding: 0 14px;
    border: 1px solid #dbe5ec;
    border-radius: 12px;
    background: #ffffff;
    color: #172033;
    outline: 0;
    box-shadow: 0 12px 26px -24px rgba(15, 23, 42, 0.42);
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.2;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.filter-ctrl select {
    appearance: none;
    padding-right: 38px;
    background-image:
        linear-gradient(45deg, transparent 50%, #667085 50%),
        linear-gradient(135deg, #667085 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 21px,
        calc(100% - 13px) 21px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.filter-ctrl input::placeholder {
    color: #7f8793;
    opacity: 1;
}

.filter-ctrl select:hover,
.filter-ctrl input:hover {
    border-color: #c8d6df;
    background: #fbfdfe;
}

.filter-ctrl select:focus,
.filter-ctrl input:focus {
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 3px rgba(47,140,153, 0.14), 0 12px 26px -24px rgba(15, 23, 42, 0.42);
}

.filter-ctrl select.filter-native-select {
    position: absolute;
    width: 1px;
    height: 1px;
    min-width: 0;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
}

.filter-choice {
    position: relative;
    min-width: 0;
}

.filter-choice__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    height: 46px;
    min-width: 0;
    padding: 0 14px;
    border: 1px solid #dbe5ec;
    border-radius: 12px;
    background: #ffffff;
    color: #172033;
    cursor: pointer;
    box-shadow: 0 12px 26px -24px rgba(15, 23, 42, 0.42);
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: left;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.filter-choice__toggle:hover {
    border-color: #c8d6df;
    background: #fbfdfe;
}

.filter-choice__toggle:focus-visible,
.filter-choice.open .filter-choice__toggle {
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 3px rgba(47,140,153, 0.14), 0 12px 26px -24px rgba(15, 23, 42, 0.42);
}

.filter-choice__label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-choice__chevron {
    flex: 0 0 auto;
    color: #667085;
    transition: transform 160ms ease;
}

.filter-choice.open .filter-choice__chevron {
    transform: rotate(180deg);
}

.filter-choice__menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 80;
    display: none;
    width: max(100%, 214px);
    max-height: min(360px, 62vh);
    padding: 10px;
    border: 1px solid rgba(47, 140, 153, 0.34);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 22px 54px -34px rgba(15, 23, 42, 0.58);
    overflow-y: auto;
}

.filter-choice.open .filter-choice__menu {
    display: grid;
    gap: 2px;
}

.filter-choice__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 40px;
    padding: 5px 4px;
    border-radius: 9px;
    background: transparent;
    color: #81909a;
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.035em;
    line-height: 1.2;
    text-align: left;
    text-transform: uppercase;
    transition: background 140ms ease, color 140ms ease;
}

.filter-choice__item:hover,
.filter-choice__item:focus-visible {
    background: rgba(47, 140, 153, 0.08);
    color: #51616c;
    outline: 0;
}

.filter-choice__marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 30px;
    height: 22px;
    border: 1px solid #d7e5ea;
    border-radius: 999px;
    background: #eef5f7;
    transition: background 140ms ease, border-color 140ms ease;
}

.filter-choice__marker::after {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: transparent;
    transition: background 140ms ease;
}

.filter-choice__item.is-selected {
    color: var(--accent-strong);
}

.filter-choice__item.is-selected .filter-choice__marker {
    border-color: rgba(47, 140, 153, 0.4);
    background: rgba(47, 140, 153, 0.13);
}

.filter-choice__item.is-selected .filter-choice__marker::after {
    background: var(--accent-strong);
}

.filter-choice__text {
    min-width: 0;
}

.filter-sep {
    display: none;
}

.zone-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    grid-column: 1 / -1;
    min-width: 0;
    padding-top: 1px;
    overflow-x: auto;
    scrollbar-width: none;
}

.zone-chips:empty {
    display: none;
}

.zone-chips::-webkit-scrollbar {
    display: none;
}

.zone-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: min(280px, 100%);
    padding: 6px 9px 6px 10px;
    border-radius: var(--radius-full);
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    color: var(--accent-strong);
    font-size: 0.68rem;
    font-weight: 700;
    box-shadow: var(--shadow-xs);
    animation: chip-enter 240ms cubic-bezier(.4,0,.2,1) both;
}

.zone-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zone-chip__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.zone-chip__remove:hover {
    background: var(--error);
    color: #ffffff;
    transform: scale(1.15);
}

.redesign-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--main-gap);
    min-height: 0;
    height: 100%;
    padding: clamp(8px, 0.9vw, 14px);
}

.chat-panel,
.map-panel-redesign,
.carousel-panel {
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.chat-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.chat-panel__header {
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border);
    background:
        radial-gradient(circle at top right, rgba(47,140,153, 0.16), transparent 38%),
        linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
}

.chat-panel__eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-strong);
}

.chat-panel__headline {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: start;
    margin-top: 10px;
}

.chat-panel__title-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 800;
    box-shadow: var(--shadow-sm);
}

.chat-panel__title {
    margin: 0;
    font-size: 0.96rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.chat-panel__subtitle {
    margin: 6px 0 0;
    font-size: 0.74rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.chat-panel__status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 6px 10px;
    border-radius: var(--radius-full);
    background: rgba(47, 143, 104, 0.1);
    color: var(--success);
    font-size: 0.64rem;
    font-weight: 700;
}

.chat-panel__status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 5px rgba(47, 143, 104, 0.1);
}

.chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 18px 10px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(248, 250, 252, 0.96));
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.12) transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.14);
    border-radius: var(--radius-full);
}

.chat-msg {
    max-width: 92%;
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 0.84rem;
    line-height: 1.6;
    box-shadow: var(--shadow-xs);
    animation: message-in 180ms ease;
}

.chat-msg--ai {
    align-self: flex-start;
    background: #ffffff;
    border: 1px solid var(--border);
    border-bottom-left-radius: 6px;
}

.chat-msg--user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--warm), var(--warm-strong));
    color: #ffffff;
    border-bottom-right-radius: 6px;
}

.chat-msg__sender {
    display: block;
    margin-bottom: 4px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.7;
}

.chat-msg__time {
    display: block;
    margin-top: 6px;
    font-size: 0.62rem;
    opacity: 0.65;
    text-align: right;
}

.chat-typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: #ffffff;
    border-bottom-left-radius: 6px;
    box-shadow: var(--shadow-xs);
}

.chat-typing__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typing-bounce 1.1s ease-in-out infinite;
}

.chat-typing__dot:nth-child(2) {
    animation-delay: 0.15s;
}

.chat-typing__dot:nth-child(3) {
    animation-delay: 0.3s;
}

.chat-welcome {
    padding: 22px 18px;
    border-radius: 18px;
    background:
        radial-gradient(circle at top right, rgba(47,140,153, 0.18), transparent 36%),
        linear-gradient(180deg, #ffffff, #f8fbfd);
    border: 1px solid var(--accent-border);
    box-shadow: var(--shadow-xs);
    text-align: left;
}

.chat-welcome__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 1rem;
    font-weight: 800;
}

.chat-welcome__title {
    margin-top: 14px;
    font-size: 1rem;
    font-weight: 800;
}

.chat-welcome__text {
    margin-top: 8px;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.chat-suggestion-btn {
    padding: 8px 12px;
    border-radius: var(--radius-full);
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.73rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.chat-suggestion-btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent-border);
    color: var(--accent-strong);
    transform: translateY(-1px);
}

.chat-input-area {
    display: block;
    padding: 8px 12px 12px;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid var(--border);
}

.chat-history-panel {
    margin: 6px 12px 0;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 14px;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.62), transparent 45%),
        linear-gradient(140deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.24));
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(12px) saturate(1.1);
    -webkit-backdrop-filter: blur(12px) saturate(1.1);
}

.chat-history-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 2px 6px;
    font-size: 0.68rem;
    color: var(--text-secondary);
}

.chat-history-panel__clear {
    padding: 4px 7px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-secondary);
    font-size: 0.62rem;
    font-weight: 700;
    cursor: pointer;
}

.chat-history-panel__clear:hover {
    border-color: var(--accent-border);
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.chat-history-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    min-height: 46px;
    padding: 2px;
    scrollbar-width: thin;
}

.chat-history-empty {
    padding: 12px 8px;
    font-size: 0.66rem;
    text-align: left;
    color: var(--text-muted);
}

.chat-history-item {
    flex: 0 0 164px;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.chat-history-item:hover {
    border-color: var(--accent-border);
    background: var(--accent-soft);
}

.chat-history-item__text {
    display: block;
    font-size: 0.66rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    line-height: 1.35;
    max-height: 2.7em;
}

.chat-history-item__time {
    display: block;
    margin-top: 4px;
    font-size: 0.58rem;
    color: var(--text-muted);
}

.chat-msg.is-highlighted {
    outline: 2px solid rgba(47,140,153, 0.5);
    outline-offset: 1px;
}

.chat-input-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    padding: 4px 4px 4px 12px;
    border-radius: 14px;
    border: 1.5px solid var(--border-strong);
    background: #ffffff;
    box-shadow: var(--shadow-xs);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.chat-input-wrap:focus-within {
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 4px rgba(47,140,153, 0.18);
}

.chat-input {
    width: 100%;
    min-width: 0;
    padding: 7px 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.76rem;
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-send-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--warm), var(--warm-strong));
    color: #ffffff;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 160ms ease, filter 160ms ease;
}

.chat-send-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.02);
}

.chat-send-btn svg {
    width: 16px;
    height: 16px;
}

.map-results-panel {
    min-height: 0;
    display: flex;
}

.map-panel-redesign {
    --map-bottom-overlay-offset: calc(var(--map-overlay-gap) * 2);
    position: relative;
    min-width: 0;
    min-height: 0;
    flex: 1;
    height: 100%;
    padding: 0;
    overflow: hidden;
    border-radius: var(--radius-xl);
    isolation: isolate;
    background:
        radial-gradient(circle at 14% 16%, rgba(142, 205, 244, 0.22), transparent 24%),
        radial-gradient(circle at 84% 18%, rgba(169, 217, 176, 0.18), transparent 24%),
        radial-gradient(circle at 75% 82%, rgba(247, 226, 167, 0.16), transparent 22%),
        linear-gradient(135deg, #f4f8fd 0%, #f8fbff 44%, #f2f8f2 100%);
    box-shadow: inset 0 0 0 1px rgba(95, 99, 104, 0.08);
}

.map-panel-redesign::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(66, 133, 244, 0.05), rgba(66, 133, 244, 0.03)),
        radial-gradient(circle at 28% 42%, rgba(66, 133, 244, 0.08), transparent 36%);
    mix-blend-mode: multiply;
}

.map-canvas,
#map-canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
}
/* Ocultar capas vectoriales durante animacion de zoom - evita desajuste con los tiles */
.leaflet-layer--zooming {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: none !important;
}

/* Optimizacion de renderizado de panes Leaflet */
.leaflet-overlay-pane,
.leaflet-shadow-pane,
.leaflet-marker-pane {
    will-change: transform;
}


.map-overlay-top {
    position: absolute;
    top: var(--map-overlay-gap);
    left: var(--map-overlay-gap);
    right: var(--map-overlay-gap);
    z-index: 900;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    pointer-events: none;
    transition: opacity 240ms ease, transform 240ms ease;
}

.map-mode-card,
.map-action-btn,
.map-kpi,
.map-toast {
    background: var(--glass-bg);
}

.map-mode-card {
    pointer-events: auto;
    min-width: min(198px, 100%);
    max-width: min(278px, 100%);
    padding: 10px 12px;
    border: 1px solid rgba(47, 140, 153, 0.18);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(239, 249, 252, 0.82));
    box-shadow: 0 18px 42px -28px rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(14px) saturate(1.15);
    -webkit-backdrop-filter: blur(14px) saturate(1.15);
    display: grid;
    gap: 6px;
}

.map-mode-card__label {
    font-size: 0.54rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    line-height: 1;
    text-transform: uppercase;
    color: #7d8b98;
}

.map-mode-card__title {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #172033;
}

.map-mode-btns {
    display: flex;
    gap: 5px;
}

.map-mode-btn {
    flex: 1;
    min-height: 34px;
    padding: 0 9px;
    border-radius: 10px;
    border: 1px solid rgba(218, 220, 224, 1);
    background: rgba(255, 255, 255, 0.98);
    color: var(--map-google-gray);
    font-size: 0.66rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.map-mode-btn.active {
    background: linear-gradient(135deg, var(--warm), var(--warm-strong));
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(47, 140, 153, 0.28);
}

.map-mode-btn:hover:not(.active) {
    background: rgba(47, 140, 153, 0.1);
    border-color: rgba(189, 193, 198, 1);
    color: #202124;
}

.map-action-btns {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 0 1 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: min(100%, 360px);
}

.map-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    color: #3c4043;
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(12px) saturate(1.12);
    -webkit-backdrop-filter: blur(12px) saturate(1.12);
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
    white-space: nowrap;
}

.map-action-btn:hover {
    transform: translateY(-1px);
    background: rgba(47, 140, 153, 0.1);
}

.map-action-btn--accent {
    background:
        radial-gradient(circle at 15% 18%, rgba(255, 255, 255, 0.46), transparent 35%),
        linear-gradient(135deg, var(--warm), var(--warm-strong));
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(47, 140, 153, 0.28);
    border-color: rgba(255, 255, 255, 0.44);
}

.map-action-btn--accent:hover {
    background: linear-gradient(135deg, #3f9caa, var(--warm-strong));
}

.map-overlay-bottom-actions {
    position: absolute;
    left: 50%;
    bottom: var(--map-bottom-overlay-offset);
    z-index: 950;
    display: flex;
    justify-content: center;
    gap: 8px;
    pointer-events: none;
    transform: translateX(-50%);
    transition: opacity 220ms ease, transform 220ms ease;
}

.map-overlay-bottom-actions .map-action-btn {
    pointer-events: auto;
}

.map-action-btn--reset {
    gap: 7px;
    background: rgba(255, 255, 255, 0.92);
}

.map-action-btn--reset svg {
    flex: 0 0 auto;
}

.carousel-peek-toggle {
    position: absolute;
    left: 50%;
    bottom: calc(var(--map-bottom-overlay-offset) + 46px);
    z-index: 954;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--warm), var(--warm-strong));
    color: #ffffff;
    box-shadow: 0 16px 34px rgba(47, 140, 153, 0.3);
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 800;
    white-space: nowrap;
    pointer-events: auto;
    transform: translateX(-50%);
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.carousel-peek-toggle:hover {
    filter: brightness(1.03);
    box-shadow: 0 18px 40px rgba(47, 140, 153, 0.36);
    transform: translateX(-50%) translateY(-1px);
}

.carousel-peek-toggle:focus-visible {
    outline: 3px solid rgba(47,140,153, 0.22);
    outline-offset: 3px;
}

.carousel-peek-toggle[hidden] {
    display: none;
}

.carousel-peek-toggle span {
    opacity: 0.9;
}

.map-kpis {
    position: absolute;
    left: var(--map-overlay-gap);
    right: var(--map-overlay-gap);
    bottom: var(--map-bottom-overlay-offset);
    z-index: 900;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    max-width: min(calc(100% - (var(--map-overlay-gap) * 2)), 460px);
    transition: opacity 240ms ease, transform 240ms ease;
}

.map-panel-redesign:not(.has-spatial-search-results) .map-kpis {
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px) scale(0.98);
}

.map-panel-redesign:not(.has-spatial-search-results) .map-overlay-bottom-actions {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(8px) scale(0.98);
}

.map-panel-redesign.has-listing-popup-open .map-kpis,
.map-panel-redesign.has-listing-popup-open .map-overlay-bottom-actions,
.map-panel-redesign.has-listing-popup-open .carousel-peek-toggle {
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px) scale(0.98);
}

.map-panel-redesign.has-listing-popup-open .map-overlay-bottom-actions {
    transform: translateX(-50%) translateY(8px) scale(0.98);
}

.map-kpi {
    min-width: 92px;
    max-width: 136px;
    flex: 1 1 98px;
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 12px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(10px) saturate(1.06);
    -webkit-backdrop-filter: blur(10px) saturate(1.06);
    position: relative;
    overflow: hidden;
}

.map-kpi:nth-child(1) {
    background:
        radial-gradient(circle at 14% 10%, rgba(255, 255, 255, 0.56), transparent 40%),
        linear-gradient(180deg, rgba(236, 245, 255, 0.9), rgba(255, 255, 255, 0.76));
}

.map-kpi:nth-child(2) {
    background:
        radial-gradient(circle at 14% 10%, rgba(255, 255, 255, 0.54), transparent 40%),
        linear-gradient(180deg, rgba(239, 251, 243, 0.9), rgba(255, 255, 255, 0.76));
}

.map-kpi:nth-child(3) {
    background:
        radial-gradient(circle at 14% 10%, rgba(255, 255, 255, 0.54), transparent 40%),
        linear-gradient(180deg, rgba(255, 248, 231, 0.92), rgba(255, 255, 255, 0.8));
}

.map-kpi::before {
    content: "";
    position: absolute;
    top: 0;
    left: 12%;
    width: 70%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.86), transparent);
    pointer-events: none;
}

.map-kpi__label {
    display: block;
    font-size: 0.48rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(60, 72, 88, 0.96);
}

.map-kpi__value {
    display: block;
    margin-top: 3px;
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #1a73e8;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
    transition: transform 280ms cubic-bezier(.4,0,.2,1), color 280ms ease;
}

.map-kpi:hover .map-kpi__value {
    transform: scale(1.08);
}

.carousel-card--no-location {
    border-color: rgba(241, 184, 54, 0.45);
}

.carousel-card__location-alert {
    display: inline-flex;
    align-items: center;
    margin-top: 1px;
    max-width: 100%;
    min-height: 24px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.28);
    color: #9a5c00;
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.map-kpi:nth-child(2) .map-kpi__value {
    color: #0f9d58;
}

.map-kpi:nth-child(3) .map-kpi__value {
    color: #ea8600;
}

.map-toast-stack {
    position: absolute;
    right: var(--map-overlay-gap);
    bottom: var(--map-bottom-overlay-offset);
    z-index: 940;
    display: grid;
    gap: 10px;
    pointer-events: none;
}

.map-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 340px;
    padding: 12px 16px;
    border: 0;
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 0.78rem;
    font-weight: 600;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
    opacity: 0;
    transform: translateX(24px);
    transition: opacity 280ms cubic-bezier(.4,0,.2,1), transform 280ms cubic-bezier(.4,0,.2,1);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

.map-toast.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.map-toast.is-leaving {
    opacity: 0;
    transform: translateX(24px) scale(0.95);
}

.map-toast__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
}

.map-toast__icon svg {
    display: block;
}

.map-toast__text {
    min-width: 0;
    line-height: 1.4;
}

.map-toast--info {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(240, 245, 250, 0.88));
    border: 1px solid rgba(47,140,153, 0.3);
    color: var(--text-primary);
}

.map-toast--info .map-toast__icon {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.map-toast--success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.94), rgba(5, 150, 105, 0.94));
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.map-toast--success .map-toast__icon {
    background: rgba(255, 255, 255, 0.18);
}

.map-toast--error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.94), rgba(220, 38, 38, 0.94));
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.map-toast--error .map-toast__icon {
    background: rgba(255, 255, 255, 0.18);
}

.carousel-panel {
    position: absolute;
    left: var(--map-overlay-gap);
    right: var(--map-overlay-gap);
    bottom: var(--map-overlay-gap);
    z-index: 925;
    display: flex;
    flex-direction: column;
    height: min(var(--carousel-overlay-height), calc(100% - (var(--map-overlay-gap) * 2)));
    min-height: min(var(--carousel-overlay-height), calc(100% - (var(--map-overlay-gap) * 2)));
    max-height: calc(100% - (var(--map-overlay-gap) * 2));
    padding: 14px 14px 16px;
    background:
        radial-gradient(circle at 8% 0%, rgba(255, 255, 255, 0.72), transparent 36%),
        radial-gradient(circle at 90% 20%, rgba(47,140,153, 0.24), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.74) 0%, rgba(247, 250, 253, 0.58) 100%);
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: var(--radius-xl);
    box-shadow: 0 26px 50px rgba(15, 23, 42, 0.22);
    backdrop-filter: blur(28px) saturate(1.2);
    -webkit-backdrop-filter: blur(28px) saturate(1.2);
    overflow: hidden;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    transform-origin: bottom center;
    transition:
        left 460ms cubic-bezier(.16, 1, .3, 1),
        right 460ms cubic-bezier(.16, 1, .3, 1),
        bottom 460ms cubic-bezier(.16, 1, .3, 1),
        height 460ms cubic-bezier(.16, 1, .3, 1),
        min-height 460ms cubic-bezier(.16, 1, .3, 1),
        max-height 460ms cubic-bezier(.16, 1, .3, 1),
        padding 360ms ease,
        border-radius 460ms cubic-bezier(.16, 1, .3, 1),
        background 360ms ease,
        box-shadow 360ms ease,
        opacity 240ms ease,
        transform 420ms cubic-bezier(.16, 1, .3, 1);
    will-change: left, right, bottom, height, border-radius, opacity, transform;
}

.carousel-panel.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + 32px)) scale(0.98);
}

.carousel-panel.is-expanded {
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    min-height: 100%;
    max-height: 100%;
    padding: clamp(14px, 1.35vw, 20px);
    border-radius: inherit;
    background:
        radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 0.62), transparent 34%),
        radial-gradient(circle at 88% 8%, rgba(47,140,153, 0.22), transparent 32%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(247, 250, 253, 0.9) 100%);
    box-shadow: 0 38px 80px rgba(15, 23, 42, 0.28);
}

.map-panel-redesign.is-carousel-expanded .map-overlay-top,
.map-panel-redesign.is-carousel-expanded .map-kpis,
.map-panel-redesign.is-carousel-expanded .map-overlay-bottom-actions,
.map-panel-redesign.is-carousel-expanded .map-progress-overlay {
    opacity: 0;
    pointer-events: none;
}

.map-panel-redesign.is-carousel-expanded .map-overlay-top {
    transform: translateY(-8px);
}

.map-panel-redesign.is-carousel-expanded .map-kpis,
.map-panel-redesign.is-carousel-expanded .map-overlay-bottom-actions,
.map-panel-redesign.is-carousel-expanded .map-progress-overlay {
    transform: translateY(8px) scale(0.98);
}

.map-panel-redesign.is-carousel-expanded .map-overlay-bottom-actions {
    transform: translateX(-50%) translateY(8px) scale(0.98);
}

.carousel-expand-toggle {
    position: absolute;
    top: 7px;
    left: 50%;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--radius-full);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(236, 245, 247, 0.84));
    color: #517d88;
    cursor: pointer;
    box-shadow:
        0 12px 26px rgba(15, 23, 42, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    transform: translateX(-50%);
    transition:
        transform 220ms cubic-bezier(.16, 1, .3, 1),
        color 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease,
        background 180ms ease;
}

.carousel-expand-toggle:hover {
    color: #1a73e8;
    border-color: rgba(47,140,153, 0.62);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(229, 241, 246, 0.94));
    box-shadow:
        0 16px 32px rgba(26, 115, 232, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    transform: translateX(-50%) translateY(-2px) scale(1.04);
}

.carousel-expand-toggle:focus-visible {
    outline: 3px solid rgba(26, 115, 232, 0.22);
    outline-offset: 3px;
}

.carousel-hide-toggle {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.9);
    color: #4c6670;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    transition: transform 160ms ease, color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.carousel-hide-toggle:hover {
    transform: translateY(-1px);
    border-color: rgba(47,140,153, 0.44);
    background: #ffffff;
    color: var(--accent-strong);
}

.carousel-hide-toggle:focus-visible {
    outline: 3px solid rgba(47,140,153, 0.22);
    outline-offset: 3px;
}

.carousel-expand-toggle__ring {
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    background:
        linear-gradient(135deg, rgba(47,140,153, 0.22), rgba(47,140,153, 0.14));
    opacity: 0;
    transform: scale(0.86);
    transition: opacity 220ms ease, transform 220ms cubic-bezier(.16, 1, .3, 1);
}

.carousel-expand-toggle:hover .carousel-expand-toggle__ring {
    opacity: 1;
    transform: scale(1);
    animation: carousel-toggle-glow 1.2s ease-in-out infinite;
}

.carousel-expand-toggle__icon {
    position: relative;
    display: block;
    width: 18px;
    height: 14px;
    transition: transform 360ms cubic-bezier(.16, 1, .3, 1);
}

.carousel-expand-toggle__icon::before,
.carousel-expand-toggle__icon::after {
    content: "";
    position: absolute;
    left: 50%;
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateX(-50%) rotate(-135deg);
}

.carousel-expand-toggle__icon::before {
    top: 5px;
    opacity: 0.62;
}

.carousel-expand-toggle__icon::after {
    top: 0;
}

.carousel-panel.is-expanded .carousel-expand-toggle {
    top: 12px;
}

.carousel-panel.is-expanded .carousel-expand-toggle__icon {
    transform: rotate(180deg);
}

.carousel-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 8px;
    padding: 2px 6px 9px;
}

.carousel-panel__meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.carousel-panel__title {
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--text-secondary);
    line-height: 1.1;
}

.carousel-panel__title strong {
    color: var(--text-primary);
}

.carousel-panel__subtitle {
    font-size: 0.72rem;
    color: rgba(51, 51, 51, 0.76);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.carousel-stage {
    position: relative;
    display: flex;
    flex: 1;
    min-height: 0;
}

.carousel-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.58);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.carousel-nav-btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent-border);
    color: var(--accent-strong);
    transform: translateY(-1px);
}

.carousel-nav-btn span {
    font-size: 1.9rem;
    line-height: 1;
}

.carousel-nav-btn--floating {
    position: absolute;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
}

.carousel-nav-btn--floating:hover {
    transform: translateY(-51%);
}

.carousel-nav-btn--prev {
    left: 0;
}

.carousel-nav-btn--next {
    right: 0;
}

.carousel-track {
    flex: 1;
    min-height: 0;
    height: 100%;
    display: flex;
    align-items: stretch;
    gap: 12px;
    padding: 0 30px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-card {
    flex: 0 0 clamp(480px, 36vw, 560px);
    height: 100%;
    min-height: 0;
    max-height: none;
    display: grid;
    grid-template-columns: minmax(210px, 44%) minmax(0, 1fr);
    gap: 14px;
    padding: 12px;
    border: 1px solid rgba(201, 218, 228, 0.9);
    border-radius: 20px;
    background:
        radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.9), transparent 36%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.99) 0%, rgba(245, 250, 252, 0.96) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    cursor: pointer;
    box-shadow:
        0 18px 38px rgba(15, 23, 42, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.86);
    transition: transform 200ms cubic-bezier(.4,0,.2,1), border-color 200ms ease, box-shadow 200ms cubic-bezier(.4,0,.2,1), background 200ms ease;
    animation: card-enter 320ms cubic-bezier(.4,0,.2,1) both;
    scroll-snap-align: start;
}

.carousel-card:hover,
.carousel-card.is-active {
    transform: translateY(-4px) scale(1.01);
    border-color: rgba(47,140,153, 0.68);
    background:
        radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.88), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, rgba(249, 252, 253, 0.98) 100%);
    box-shadow:
        0 26px 52px rgba(15, 23, 42, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.carousel-card__img {
    height: 100%;
    min-height: 0;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(135deg, #f1f4f7, #e7edf2);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.34),
        0 12px 22px rgba(15, 23, 42, 0.1);
}

.carousel-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.01);
    transition: transform 280ms cubic-bezier(.4,0,.2,1);
}

.carousel-card:hover .carousel-card__img img,
.carousel-card.is-active .carousel-card__img img {
    transform: scale(1.045);
}

.carousel-card__img--placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.carousel-card__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    min-height: 0;
    overflow: visible;
    padding: 3px 3px 3px 0;
}

.carousel-card__price {
    font-size: clamp(1.12rem, 1.22vw, 1.36rem);
    font-weight: 800;
    letter-spacing: 0;
    color: #7a6111;
    line-height: 1.02;
}

.carousel-card__price small {
    font-size: 0.7rem;
    margin-left: 2px;
    color: rgba(80, 67, 21, 0.72);
}

.carousel-card__title {
    font-size: clamp(0.86rem, 0.92vw, 1rem);
    font-weight: 800;
    line-height: 1.24;
    color: #111827;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.carousel-card__location {
    position: relative;
    padding-left: 13px;
    font-size: 0.74rem;
    line-height: 1.35;
    color: #657386;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.carousel-card__location::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.38em;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(47, 140, 153, 0.58);
}

.carousel-card__specs {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 3px;
}

.carousel-card__spec {
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(239, 248, 250, 0.98);
    border: 1px solid rgba(47,140,153, 0.28);
    color: #365160;
    font-size: 0.66rem;
    font-weight: 800;
}

.carousel-card__source {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    font-size: 0.68rem;
    font-weight: 800;
    color: #5e94a1;
}

.carousel-card__platform {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 8px;
}

.carousel-card__cta {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(47, 140, 153, 0.1);
    color: var(--accent-strong);
    font-size: 0.66rem;
    font-weight: 800;
}

.carousel-panel.is-expanded .carousel-panel__header {
    padding: 44px clamp(4px, 0.8vw, 10px) 12px;
}

.carousel-panel.is-expanded .carousel-panel__title {
    font-size: clamp(0.88rem, 1.1vw, 1.05rem);
}

.carousel-panel.is-expanded .carousel-panel__subtitle {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.carousel-panel.is-expanded .carousel-stage {
    min-height: 0;
}

.carousel-panel.is-expanded .carousel-track {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 470px), 1fr));
    align-content: start;
    align-items: stretch;
    gap: 16px;
    padding: 2px clamp(4px, 0.8vw, 10px) 12px;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-snap-type: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(47,140,153, 0.55) rgba(255, 255, 255, 0.36);
}

.carousel-panel.is-expanded .carousel-track::-webkit-scrollbar {
    display: block;
    width: 10px;
}

.carousel-panel.is-expanded .carousel-track::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.36);
    border-radius: 999px;
}

.carousel-panel.is-expanded .carousel-track::-webkit-scrollbar-thumb {
    background: rgba(47,140,153, 0.55);
    border-radius: 999px;
}

.carousel-panel.is-expanded .carousel-card {
    flex: none;
    height: auto;
    min-height: 218px;
    grid-template-columns: clamp(196px, 16vw, 238px) minmax(0, 1fr);
    animation-name: card-enter-expanded;
}

.carousel-panel.is-expanded .carousel-card__price {
    font-size: clamp(1.2rem, 1.34vw, 1.5rem);
}

.carousel-panel.is-expanded .carousel-card__title,
.carousel-panel.is-expanded .carousel-card__location {
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.carousel-panel.is-expanded .carousel-nav-btn--floating {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) scale(0.86);
}

.carousel-panel.is-expanded .carousel-empty,
.carousel-panel.is-expanded .carousel-loading,
.carousel-panel.is-expanded .carousel-loading-card {
    grid-column: 1 / -1;
    min-height: min(360px, 56vh);
}

.carousel-empty,
.carousel-loading,
.carousel-loading-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100%;
    padding: 10px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.72rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.58);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.carousel-empty {
    flex-direction: column;
    gap: 5px;
    padding: 14px 12px;
}

.carousel-empty__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-soft), rgba(47,140,153, 0.22));
    color: var(--accent-strong);
    margin-bottom: 4px;
}

.carousel-empty__title {
    font-size: 0.76rem;
    font-weight: 800;
    color: var(--text-primary);
}

.carousel-empty__text {
    font-size: 0.64rem;
    color: var(--text-secondary);
    line-height: 1.4;
    max-width: 360px;
}

.carousel-empty--loading .carousel-empty__icon {
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.12), rgba(88, 184, 203, 0.18));
}

.carousel-empty__icon--loading .spinner-sm {
    width: 22px;
    height: 22px;
}

.carousel-title-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(88, 184, 203, 0.14), rgba(30, 64, 175, 0.1));
    color: var(--accent-strong);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    animation: badge-pulse 1.6s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.carousel-loading-card {
    align-items: stretch;
    justify-content: stretch;
    position: relative;
    padding: 16px 18px;
    text-align: left;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.42);
    background:
        radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.4), transparent 40%),
        var(--glass-bg);
    box-shadow: 
        0 10px 30px -5px rgba(0, 0, 0, 0.05),
        var(--glass-shadow);
    backdrop-filter: blur(28px) saturate(1.8);
    -webkit-backdrop-filter: blur(28px) saturate(1.8);
    overflow: visible;
}

.carousel-loading-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 10%;
    width: 68%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-highlight), transparent);
    pointer-events: none;
}

.carousel-loading-card::after {
    display: none;
}

.carousel-loading-card__hero::after {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 80%;
    height: 100%;
    background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.32) 48%, transparent 100%);
    pointer-events: none;
    animation: loading-shimmer 2.5s ease-in-out infinite;
}

.carousel-loading-card__hero {
    position: relative;
    display: grid;
    gap: 8px;
}

.carousel-loading-card__topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.carousel-loading-card__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1e40af;
}

.carousel-loading-card__pct-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.carousel-loading-card__found {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--success);
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(47, 143, 104, 0.1);
}

.carousel-loading-card__pct {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(30, 64, 175, 0.08);
    color: #1e40af;
    font-size: 0.74rem;
    font-weight: 800;
}

.carousel-loading-progress {
    position: relative;
    width: 100%;
    height: 9px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(237, 244, 248, 0.82));
    border: 1px solid rgba(255, 255, 255, 0.6);
    overflow: hidden;
}

.carousel-loading-progress__bar {
    display: block;
    height: 100%;
    border-radius: inherit;
    background:
        linear-gradient(90deg, #58b8cb 0%, #4a95df 45%, #6ccf9d 100%);
    box-shadow: 0 4px 12px rgba(58, 145, 197, 0.35);
    transition: width 380ms ease;
}

.carousel-loading-progress__bar::after {
    content: "";
    display: block;
    width: 38%;
    height: 100%;
    margin-left: auto;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.52), transparent);
    animation: progress-glint 1.4s linear infinite;
}

.carousel-loading-card__text {
    max-width: 920px;
    font-size: 0.76rem;
    line-height: 1.5;
    color: #465465;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.scrape-progress__zones,
.scrape-progress__targets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.scrape-progress__chip,
.scrape-target {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.scrape-progress__chip {
    color: var(--accent-strong);
    font-size: 0.7rem;
    font-weight: 700;
}

.scrape-target {
    color: var(--text-secondary);
    font-size: 0.64rem;
    font-weight: 700;
}

.scrape-target__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}

.scrape-target--running .scrape-target__dot {
    background: var(--accent-strong);
    animation: target-dot-pulse 1s ease-in-out infinite;
}

.scrape-target--completed .scrape-target__dot {
    background: var(--success);
}

.scrape-target--failed .scrape-target__dot {
    background: var(--error);
}

.scrape-target__city {
    color: var(--text-primary);
}

.scrape-target__status {
    color: var(--accent-strong);
}

.scrape-target--completed .scrape-target__status {
    color: var(--success);
}

.scrape-target--failed .scrape-target__status {
    color: var(--error);
}

.scrape-inline-platforms {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.scrape-inline-platform {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0;
}

.scrape-inline-platform .platform-logo {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.scrape-inline-platform .platform-label {
    display: none;
}

.scrape-inline-platform--running {
    background: transparent;
}

.scrape-inline-platform--running .platform-logo {
    animation: platform-pulse 1.1s ease-in-out infinite;
}

.scrape-inline-platform--completed {
    background: transparent;
}

.scrape-inline-platform--failed {
    background: transparent;
}

.scrape-inline-platform__count {
    position: absolute;
    top: -5px;
    right: -7px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 6px;
    background: #1e293b;
    color: #ffffff;
    font-size: 0.62rem;
    font-weight: 900;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.scrape-inline-platform--pending .platform-logo {
    opacity: 0.3;
    filter: grayscale(1);
}

.scrape-inline-platform--pending .scrape-inline-platform__count {
    display: none;
}
.scrape-inline-platform--completed .scrape-inline-platform__count {
    background: #059669;
}

.platform-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 6px;
    background: #cbd5e1;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 900;
    border: none !important;
    box-shadow: none !important;
    text-shadow: none;
}

.platform-logo span {
    display: block;
    line-height: 1;
    transform: translateY(0.5px);
}

.platform-logo--pisos {
    background: #ff5a39;
    font-family: system-ui, sans-serif;
}

.platform-logo--fotocasa {
    background: #ff6d00;
    border-radius: 8px;
}

.platform-logo--idealista {
    background: #cddc39;
    color: #1d1d1d;
    font-weight: 900;
    border-radius: 50%;
}

.platform-logo--habitaclia {
    background: #ff6d00;
}

.platform-logo--yaencontre {
    background: #1e3a8a;
}

.platform-logo--milanuncios {
    background: #2cbc6b;
}

.platform-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: inherit;
    font-size: 0.66rem;
    font-weight: 700;
}

.spinner-sm {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 0, 0, 0.12);
    border-top-color: var(--accent-strong);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.price-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    padding: 8px 12px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(218, 220, 224, 1);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(244, 248, 255, 0.98));
    color: #202124;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    box-shadow: var(--map-google-shadow);
    white-space: nowrap;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.price-marker.is-active,
.price-marker:hover {
    background: linear-gradient(135deg, #4c8bf5, #1a73e8);
    border-color: transparent;
    color: #ffffff;
    transform: scale(1.06);
}

/* Highlight pin dropped when arriving from "Ver en el mapa" so the targeted
   property is always visible, even before its result marker loads. */
.map-focus-pin {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent, #2f8c99);
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 4px rgba(47, 140, 153, 0.28), 0 6px 16px rgba(0, 0, 0, 0.28);
    animation: map-focus-pin-pulse 1.6s ease-out infinite;
}

@keyframes map-focus-pin-pulse {
    0% { box-shadow: 0 0 0 0 rgba(47, 140, 153, 0.45), 0 6px 16px rgba(0, 0, 0, 0.28); }
    70% { box-shadow: 0 0 0 14px rgba(47, 140, 153, 0), 0 6px 16px rgba(0, 0, 0, 0.28); }
    100% { box-shadow: 0 0 0 0 rgba(47, 140, 153, 0), 0 6px 16px rgba(0, 0, 0, 0.28); }
}

.cluster-badge {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4c8bf5, #1a73e8 62%, #1765cc);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 800;
    border: 3px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 6px 14px rgba(26, 115, 232, 0.28);
}

.popup-card {
    width: min(260px, calc(100vw - 72px));
    overflow: hidden;
    color: #172033;
}

.popup-card__media {
    height: 126px;
    margin: 0;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(135deg, #eef3f7, #e3ebf1);
}

.popup-card__media--empty {
    display: grid;
    place-items: center;
    color: #7b8794;
    font-size: 0.74rem;
    font-weight: 800;
}

.popup-card__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popup-card__body {
    padding: 10px 2px 1px;
}

.popup-card__price {
    color: #167080;
    font-size: 1.08rem;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.05;
}

.popup-card__price small {
    margin-left: 2px;
    color: rgba(22, 112, 128, 0.72);
    font-size: 0.68rem;
}

.popup-card__title {
    margin-top: 7px;
    color: #263241;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.32;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popup-card__location {
    margin-top: 5px;
    color: #718095;
    font-size: 0.68rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.popup-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
    color: #45606f;
    font-size: 0.64rem;
    font-weight: 800;
}

.popup-card__meta span {
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(239, 248, 250, 0.96);
    border: 1px solid rgba(47, 140, 153, 0.18);
}

.popup-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
}

.popup-card__source {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 6px;
    color: #5e94a1;
    font-size: 0.66rem;
    font-weight: 800;
}

.popup-card__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(47, 140, 153, 0.12);
    color: var(--accent-strong);
    font-size: 0.66rem;
    font-weight: 900;
    text-decoration: none;
}

.popup-card__link:hover {
    background: rgba(47, 140, 153, 0.18);
}

.leaflet-container {
    font-family: "Montserrat", sans-serif;
    background: linear-gradient(180deg, #dcefff, #eef7ff 44%, #eef7ef 100%);
}

.leaflet-tile {
    filter: saturate(1.16) contrast(1.03) brightness(1.04) hue-rotate(6deg);
}

.leaflet-control-zoom {
    border: 0 !important;
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: var(--map-google-shadow) !important;
}

.map-panel-redesign .leaflet-top.leaflet-left {
    top: calc(var(--map-overlay-gap) + 116px);
    left: var(--map-overlay-gap);
}

.map-panel-redesign .leaflet-left .leaflet-control {
    margin-left: 0;
}

.map-panel-redesign .leaflet-top .leaflet-control {
    margin-top: 0;
}

.leaflet-control-zoom a,
.leaflet-draw-toolbar a,
.leaflet-draw-actions a {
    background: rgba(255, 255, 255, 0.98) !important;
    color: #3c4043 !important;
    border-color: rgba(218, 220, 224, 1) !important;
}

.leaflet-control-zoom a:hover,
.leaflet-draw-toolbar a:hover,
.leaflet-draw-actions a:hover {
    background: rgba(66, 133, 244, 0.08) !important;
    color: var(--map-google-blue) !important;
}

.leaflet-popup-content-wrapper {
    border: 0 !important;
    border-radius: 20px !important;
    box-shadow: 0 22px 52px rgba(15, 23, 42, 0.24) !important;
    background:
        radial-gradient(circle at 16% 0%, rgba(255, 255, 255, 0.96), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 252, 0.96)) !important;
    backdrop-filter: blur(18px) saturate(1.16);
    -webkit-backdrop-filter: blur(18px) saturate(1.16);
}

.leaflet-popup-content {
    margin: 12px !important;
}

.leaflet-popup-tip {
    background: rgba(255, 255, 255, 0.98) !important;
}

.map-popup .leaflet-popup-close-button {
    top: 8px !important;
    right: 8px !important;
    width: 26px !important;
    height: 26px !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.88) !important;
    color: #566579 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 24px !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.map-popup .leaflet-popup-close-button:hover {
    background: #ffffff !important;
    color: var(--accent-strong) !important;
}

/* Map Progress Overlay */
.map-progress-overlay {
    position: absolute;
    right: var(--map-overlay-gap);
    bottom: var(--map-bottom-overlay-offset);
    z-index: 920;
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px) scale(0.95);
    transition: opacity 320ms cubic-bezier(.4,0,.2,1), transform 320ms cubic-bezier(.4,0,.2,1);
}

.map-progress-overlay.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.map-progress-card {
    min-width: 240px;
    max-width: 320px;
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    background:
        radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.5), transparent 40%),
        linear-gradient(140deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.18));
    box-shadow:
        0 20px 44px rgba(15, 23, 42, 0.16),
        0 0 0 1px rgba(255, 255, 255, 0.3) inset;
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    animation: progress-overlay-in 360ms cubic-bezier(.4,0,.2,1) both;
}

.map-progress-card--steady {
    animation: none;
}

.map-progress-card__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.map-progress-card__spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(30, 64, 175, 0.15);
    border-top-color: #1e40af;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

.map-progress-card__header-text {
    min-width: 0;
}

.map-progress-card__title {
    font-size: 0.82rem;
    font-weight: 800;
    color: #1f2937;
    letter-spacing: -0.01em;
}

.map-progress-card__subtitle {
    font-size: 0.66rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 1px;
    line-height: 1.3;
}

.map-progress-card__bar-wrap {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin-bottom: 12px;
}

.map-progress-card__bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #58b8cb, #4a95df, #6ccf9d);
    background-size: 200% 100%;
    animation: progress-bar-shimmer 2s ease infinite;
    transition: width 400ms ease;
}

.map-progress-card__bar--done {
    background: linear-gradient(90deg, #34d399, #059669);
    background-size: 100% 100%;
    animation: none;
}

.map-progress-card--completed {
    border-color: rgba(5, 150, 105, 0.25);
    background:
        radial-gradient(circle at 10% 10%, rgba(236, 253, 245, 0.6), transparent 40%),
        linear-gradient(140deg, rgba(255, 255, 255, 0.5), rgba(236, 253, 245, 0.25));
}

.map-progress-card__check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(5, 150, 105, 0.1);
    flex-shrink: 0;
}

.map-progress-card--completed .map-progress-card__title {
    color: #059669;
}

.map-progress-card__stats {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.map-progress-stat {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.map-progress-stat__value {
    font-size: 0.88rem;
    font-weight: 800;
    color: #1e40af;
    letter-spacing: -0.02em;
}

.map-progress-stat__label {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.map-progress-card__platforms {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.map-progress-platform {
    position: relative;
    display: flex;
    align-items: center;
}

.map-progress-platform .platform-label {
    display: none;
}

.map-progress-platform--pending .platform-logo {
    opacity: 0.3;
    filter: grayscale(1);
}

.map-progress-platform--running .platform-logo {
    animation: platform-pulse 1.1s ease-in-out infinite;
}

.map-progress-card__targets {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.map-progress-target {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.64rem;
    font-weight: 600;
}

.map-progress-target__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #cbd5e1;
    flex-shrink: 0;
}

.map-progress-target--running .map-progress-target__dot {
    background: #3b82f6;
    animation: target-dot-pulse 1s ease-in-out infinite;
}

.map-progress-target--completed .map-progress-target__dot,
.map-progress-target--completed-empty .map-progress-target__dot {
    background: #059669;
}

.map-progress-target--failed .map-progress-target__dot {
    background: #dc2626;
}

.map-progress-target__name {
    color: var(--text-primary);
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.map-progress-target__status {
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Platform Status Icons */
.platform-status-icon {
    position: absolute;
    top: -3px;
    right: -3px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    font-size: 0.5rem;
    font-weight: 900;
    border: 1.5px solid #fff;
    z-index: 2;
}

.platform-status-icon--pending {
    background: #cbd5e1;
}

.platform-status-icon--running {
    background: #3b82f6;
}

.platform-status-icon--running .platform-status-icon__pulse {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid #3b82f6;
    animation: status-pulse 1.2s ease-in-out infinite;
}

.platform-status-icon--completed {
    background: #059669;
    color: #fff;
}

.platform-status-icon--failed {
    background: #dc2626;
    color: #fff;
}

@keyframes progress-bar-shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

@keyframes loading-shimmer {
    0% { left: -120%; }
    55% { left: 130%; }
    100% { left: 130%; }
}

@keyframes progress-glint {
    0% { transform: translateX(100%); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: translateX(-220%); opacity: 0; }
}

@keyframes platform-pulse {
    0%, 100% { transform: scale(1); filter: saturate(1); }
    50% { transform: scale(1.06); filter: saturate(1.18); }
}

@keyframes message-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

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

@keyframes card-enter {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes card-enter-expanded {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes carousel-toggle-glow {
    0%, 100% {
        opacity: 0.72;
        transform: scale(0.96);
    }
    50% {
        opacity: 1;
        transform: scale(1.08);
    }
}

@keyframes chip-enter {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes target-dot-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.6); }
}

@keyframes progress-overlay-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes status-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(47,140,153, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(47,140,153, 0); }
}

@keyframes typing-bounce {
    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.35;
    }

    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

@media (max-width: 1480px) {
    .search-bar-wrap {
        width: min(100%, clamp(380px, 45vw, 620px));
    }

    .redesign-filters {
        grid-template-columns:
            minmax(150px, 0.86fr)
            minmax(160px, 0.94fr)
            minmax(176px, 1fr)
            minmax(176px, 1fr)
            minmax(164px, 0.88fr);
    }
}

@media (max-width: 1100px) {
    .redesign-header__inner {
        grid-template-columns: 1fr;
        grid-template-areas:
            "brand"
            "actions"
            "search";
    }

    .header-actions {
        grid-area: actions;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        min-width: 0;
    }

    .header__nav,
    .header-sections {
        flex: 1 1 auto;
        justify-content: flex-start;
    }

    .redesign-header .header__nav,
    .redesign-header .header__auth {
        grid-area: auto;
    }

    .brand__title {
        display: none;
    }

    .search-bar-wrap {
        width: 100%;
    }

    .redesign-filters {
        grid-template-columns: repeat(3, minmax(180px, 1fr));
    }
}

@media (max-width: 1024px) {
    html,
    body {
        overflow: auto;
    }

    body {
        display: block;
        height: auto;
    }

    .redesign-shell {
        flex: none;
        grid-template-rows: auto auto;
        min-height: auto;
        height: auto;
    }

    .redesign-header__inner {
        grid-template-columns: 1fr;
        grid-template-areas:
            "brand"
            "search"
            "actions";
        align-items: stretch;
        height: auto;
        padding: 16px;
    }

    .brand {
        justify-self: start;
    }

    .search-bar-wrap {
        width: 100%;
        justify-self: stretch;
    }

    .header-actions {
        display: flex;
        justify-content: flex-start;
        grid-column: auto;
        width: 100%;
    }

    .header__nav,
    .header-sections {
        width: 100%;
    }

    .redesign-main {
        grid-template-columns: 1fr;
        padding: 16px;
        height: auto;
    }

    .map-results-panel {
        min-height: min(78vh, 860px);
    }

    .map-panel-redesign {
        min-height: clamp(520px, 78vh, 860px);
    }

}

@media (max-width: 720px) {
    :root {
        --carousel-overlay-height: clamp(214px, 29vh, 248px);
    }

    .filters-shell__toggle {
        min-height: 46px;
        padding: 8px 14px;
    }

    .filters-shell__panel {
        max-height: 760px;
    }

    .filters-shell__action {
        padding: 0 10px;
    }

    .filters-shell__action-text {
        display: none;
    }

    .chat-history-list {
        min-height: 48px;
    }

    .search-bar {
        grid-template-columns: 1fr;
        border-radius: 20px;
    }

    .search-bar__ops {
        margin: 8px 8px 0;
        padding: 0 0 8px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
        justify-content: flex-start;
    }

    .search-bar__submit {
        width: 100%;
        border-radius: 0;
    }

    .redesign-filters {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: end;
        padding: 12px 14px;
        gap: 10px;
    }

    .filter-ctrl {
        min-width: 0;
        gap: 6px;
    }

    .filter-ctrl__label {
        width: 100%;
    }

    .filter-ctrl select,
    .filter-ctrl input {
        width: 100%;
        height: 44px;
        min-width: 0;
    }

    .filter-choice__toggle {
        height: 44px;
    }

    .filter-sep {
        display: none;
    }

    .map-overlay-top {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
        gap: 6px;
        right: var(--map-overlay-gap);
        width: auto;
        max-width: calc(100% - (var(--map-overlay-gap) * 2));
    }

    .map-mode-card {
        flex: 0 0 auto;
        width: auto;
        min-width: 0;
        max-width: none;
        padding: 4px;
        border-radius: 12px;
        gap: 0;
        display: flex;
        align-items: center;
        background: rgba(255, 255, 255, 0.9);
        border-color: rgba(47, 140, 153, 0.16);
        box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
    }

    .map-mode-card__label {
        display: none;
    }

    .map-mode-card__title {
        display: none;
    }

    .map-mode-btns {
        gap: 4px;
    }

    .map-mode-btn {
        min-width: 62px;
        min-height: 27px;
        padding: 0 6px;
        border-radius: 9px;
        font-size: 0.52rem;
        box-shadow: none;
    }

    .map-action-btns {
        display: grid;
        grid-template-columns: 1fr;
        flex: none;
        justify-self: end;
        width: min(148px, calc(100vw - 168px));
        min-width: 0;
        align-content: start;
        gap: 3px;
    }

    .map-action-btn {
        width: 100%;
        min-width: 0;
        min-height: 24px;
        padding: 0 8px;
        border-radius: 999px;
        font-size: 0.44rem;
        overflow: hidden;
        text-overflow: ellipsis;
        background: rgba(255, 255, 255, 0.92);
        box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
    }

    .map-action-btn--accent {
        min-height: 26px;
        color: #ffffff;
        border-color: rgba(255, 255, 255, 0.44);
        background:
            radial-gradient(circle at 16% 14%, rgba(255, 255, 255, 0.42), transparent 36%),
            linear-gradient(135deg, var(--warm), var(--warm-strong));
        box-shadow: 0 12px 24px rgba(47, 140, 153, 0.24);
    }

    .map-panel-redesign .leaflet-top.leaflet-left {
        top: calc(var(--map-overlay-gap) + 44px);
    }

    .map-panel-redesign .leaflet-control-zoom {
        display: none;
    }

    .map-overlay-bottom-actions {
        left: var(--map-overlay-gap);
        right: auto;
        width: min(246px, calc(100% - 86px - (var(--map-overlay-gap) * 2)));
        bottom: calc(var(--map-bottom-overlay-offset) + 2px);
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px;
        justify-content: stretch;
        transform: none;
    }

    .map-panel-redesign:not(.has-spatial-search-results) .map-overlay-bottom-actions,
    .map-panel-redesign.is-carousel-expanded .map-overlay-bottom-actions,
    .map-panel-redesign.has-listing-popup-open .map-overlay-bottom-actions {
        transform: translateY(8px) scale(0.98);
    }

    .map-overlay-bottom-actions .map-action-btn {
        width: 100%;
        min-width: 0;
        min-height: 26px;
        padding: 0 5px;
        gap: 3px;
        font-size: 0.48rem;
        white-space: nowrap;
    }

    .map-overlay-bottom-actions .map-action-btn svg {
        width: 11px;
        height: 11px;
    }

    .carousel-peek-toggle {
        left: var(--map-overlay-gap);
        right: auto;
        width: min(210px, calc(100% - 86px - (var(--map-overlay-gap) * 2)));
        min-height: 28px;
        padding: 0 10px;
        bottom: calc(var(--map-bottom-overlay-offset) + 62px);
        font-size: 0.56rem;
        transform: none;
    }

    .carousel-peek-toggle:hover {
        transform: translateY(-1px);
    }

    .map-kpis {
        left: var(--map-overlay-gap);
        right: var(--map-overlay-gap);
        bottom: calc(var(--map-bottom-overlay-offset) + 32px);
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        max-width: none;
        gap: 4px;
    }

    .map-kpi {
        min-width: 0;
        max-width: none;
        padding: 5px 6px;
        border-radius: 9px;
    }

    .map-kpi__label {
        font-size: 0.42rem;
    }

    .map-kpi__value {
        margin-top: 2px;
        font-size: 0.7rem;
    }

    .carousel-card {
        flex-basis: min(92vw, 390px);
        height: 100%;
        min-height: 0;
        max-height: none;
        grid-template-columns: minmax(130px, 42%) minmax(0, 1fr);
        gap: 9px;
        padding: 8px;
    }

    .carousel-panel {
        right: var(--map-overlay-gap);
        padding: 8px;
        border-radius: 20px;
    }

    .carousel-track {
        gap: 8px;
        padding: 0 18px;
    }

    .carousel-nav-btn {
        width: 32px;
        height: 32px;
    }

    body .ai-chat-widget {
        right: 8px !important;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    }

    body .ai-chat-widget .ai-chat-toggle {
        width: 48px !important;
        height: 48px !important;
    }

    body .ai-chat-widget .ai-chat-toggle__icon {
        width: 20px !important;
        height: 20px !important;
    }

    .carousel-loading-card__topline {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .scrape-inline-platforms {
        justify-content: flex-start;
    }

    .header-actions {
        gap: 10px;
    }

    .header__nav,
    .header-sections {
        width: 100%;
    }
}

@media (max-width: 560px) {
    :root {
        --carousel-overlay-height: clamp(208px, 28vh, 238px);
    }

    .brand__logo {
        height: 38px;
        max-width: 144px;
    }

    .chat-panel__headline {
        grid-template-columns: 1fr;
    }

    .chat-panel__title-icon {
        width: 38px;
        height: 38px;
    }

    .header-actions {
        width: 100%;
    }

    .header__nav,
    .header-sections {
        width: 100%;
        padding: 4px;
    }

    .nav__link,
    .header-sections__link {
        flex: 1 1 0;
        min-width: 0;
        min-height: 34px;
        padding: 0 10px;
        font-size: 0.68rem;
    }

    .header-btn {
        flex: 1 1 calc(50% - 5px);
        width: auto;
    }

    .carousel-card {
        flex: 0 0 min(92vw, 360px);
        height: 100%;
        min-height: 0;
        max-height: none;
        grid-template-columns: minmax(124px, 42%) minmax(0, 1fr);
        gap: 8px;
        padding: 8px;
        border-radius: 16px;
    }

    .carousel-card__img {
        min-height: 0;
        height: 100%;
    }

    .carousel-card__body {
        gap: 4px;
        padding: 2px 2px 2px 0;
    }

    .carousel-card__price {
        font-size: 0.96rem;
    }

    .carousel-card__title {
        font-size: 0.72rem;
        line-height: 1.22;
    }

    .carousel-card__location {
        font-size: 0.62rem;
    }

    .carousel-card__specs {
        gap: 5px;
        margin-top: 1px;
    }

    .carousel-card__spec {
        padding: 3px 6px;
        font-size: 0.54rem;
    }

    .carousel-card__source {
        gap: 6px;
    }

    .carousel-card__cta {
        padding: 4px 7px;
        font-size: 0.54rem;
    }

    .map-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .map-kpi:last-child {
        grid-column: auto;
    }

}

@media (max-width: 520px) {
    .redesign-filters {
        grid-template-columns: 1fr;
    }

    .filter-ctrl select,
    .filter-ctrl input {
        height: 46px;
    }

    .filter-choice__toggle {
        height: 46px;
    }
}

@media (max-height: 920px) and (min-width: 1025px) {
    :root {
        --carousel-overlay-height: clamp(292px, 36vh, 330px);
    }

    .redesign-main {
        grid-template-columns: minmax(0, 1fr);
    }

    .redesign-filters {
        padding-top: 5px;
        padding-bottom: 5px;
    }

    .chat-panel__header {
        padding: 16px 16px 12px;
    }

    .chat-history-panel {
        margin: 6px 12px 0;
    }

    .chat-history-list {
        min-height: 46px;
    }

    .map-mode-card {
        max-width: 264px;
        padding: 8px 10px;
    }

    .map-action-btn,
    .map-mode-btn {
        min-height: 34px;
    }

    .map-kpi {
        padding: 6px 8px;
    }
}

@media (max-height: 780px) and (min-width: 1025px) {
    :root {
        --carousel-overlay-height: clamp(286px, 38vh, 320px);
    }

    .chat-panel__subtitle {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .chat-history-panel__header {
        padding-bottom: 6px;
    }

    .chat-messages {
        padding-top: 10px;
    }

    .carousel-panel__header {
        padding-bottom: 5px;
    }

    .carousel-card {
        min-height: 0;
    }
}

@media (max-width: 720px) {
    .carousel-expand-toggle {
        width: 48px;
        height: 26px;
    }

    .carousel-panel.is-expanded {
        left: 0;
        right: 0;
        bottom: 0;
        height: 100%;
        min-height: 100%;
        max-height: 100%;
        padding: 10px;
        border-radius: inherit;
    }

    .carousel-panel.is-expanded .carousel-panel__header {
        padding: 34px 44px 8px 4px;
    }

    .carousel-panel.is-expanded .carousel-panel__title {
        font-size: 0.82rem;
    }

    .carousel-panel.is-expanded .carousel-panel__subtitle {
        font-size: 0.66rem;
        line-height: 1.25;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .carousel-panel.is-expanded .carousel-track {
        grid-template-columns: 1fr;
        gap: 9px;
        padding: 0 4px 10px;
    }

    .carousel-panel.is-expanded .carousel-card {
        grid-template-columns: minmax(116px, 40%) minmax(0, 1fr);
        min-height: 150px;
        padding: 8px;
        gap: 9px;
        border-radius: 16px;
    }

    .carousel-panel.is-expanded .carousel-card__img {
        height: 100%;
        min-height: 0;
        border-radius: 13px;
    }

    .carousel-panel.is-expanded .carousel-card__price {
        font-size: 1.02rem;
    }

    .carousel-panel.is-expanded .carousel-card__title {
        font-size: 0.76rem;
        line-height: 1.22;
    }

    .carousel-panel.is-expanded .carousel-card__location {
        font-size: 0.64rem;
    }

    .carousel-panel.is-expanded .carousel-card__spec {
        padding: 3px 6px;
        font-size: 0.54rem;
    }

    .carousel-panel.is-expanded .carousel-card__cta {
        display: none;
    }
}

@media (max-width: 560px) {
    .carousel-panel.is-expanded .carousel-card {
        grid-template-columns: minmax(108px, 40%) minmax(0, 1fr);
        min-height: 148px;
    }

    .carousel-panel.is-expanded .carousel-card__img {
        min-height: 0;
        height: 100%;
    }

    .carousel-panel.is-expanded .carousel-card__body {
        gap: 4px;
    }

    .carousel-panel.is-expanded .carousel-card__source {
        margin-top: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .carousel-panel,
    .carousel-expand-toggle,
    .carousel-expand-toggle__icon,
    .map-overlay-top,
    .map-kpis,
    .filters-shell__panel,
    .filters-shell__chevron {
        transition-duration: 1ms;
        animation-duration: 1ms;
    }

    .carousel-expand-toggle:hover .carousel-expand-toggle__ring {
        animation: none;
    }
}

/* ─── Sub-zone labels & tooltip ──────────────────────────────── */

.subzone-label-marker {
    background: transparent;
    border: 0;
    pointer-events: none;
}

.subzone-label {
    display: inline-block;
    max-width: 132px;
    padding: 3px 8px;
    border: 1px solid rgba(34, 51, 67, 0.18);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.92);
    color: #223343;
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    pointer-events: none;
    text-shadow: none;
    box-shadow: 0 1px 5px rgba(34, 51, 67, 0.16);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: opacity 150ms ease;
}

.subzone-tooltip {
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.96);
    color: #223343;
    border: 1px solid rgba(34, 51, 67, 0.14);
    box-shadow: 0 2px 8px rgba(34, 51, 67, 0.16);
}

.subzone-tooltip::before {
    border-top-color: rgba(255, 255, 255, 0.96) !important;
}
