* {
    box-sizing: border-box;
}

:root {
    --main-red: #ce1126;
    --main-dark: #111827;
    --main-gray: #6b7280;
    --line: #e5e7eb;
    --panel-width: 400px;
    --panel-pad: 14px;
    --header-offset: 105px;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    min-height: 100%;
    font-family: Arial, sans-serif;
    background: #f4f6f9;
    color: #111827;
}

body.modal-open {
    overflow: hidden;
}

button,
input {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}


.api-authbar {
    background: #0f172a;
    color: #e5e7eb;
    min-height: 32px;
    font-size: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.api-authbar__inner {
    max-width: 1900px;
    margin: 0 auto;
    min-height: 32px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.api-authbar__left,
.api-authbar__right {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.api-authbar__dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.api-authbar[data-state="login"] .api-authbar__dot {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.api-authbar[data-state="guest"] .api-authbar__dot {
    background: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.18);
}

.api-authbar[data-state="error"] .api-authbar__dot {
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

.api-authbar__pill {
    min-width: 54px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}

.api-authbar__user {
    color: #cbd5e1;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-topbar {
    background: #1f1f1f;
    color: #fff;
    height: 34px;
}

.site-topbar__inner {
    max-width: 1900px;
    margin: 0 auto;
    height: 100%;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.site-topbar__flags {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.flag-pill {
    min-width: 22px;
    height: 16px;
    border-radius: 2px;
    background: #f7f7f7;
    color: #111;
    font-size: 9px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.flag-pill--id {
    background: linear-gradient(180deg, #e11d2f 0 50%, #ffffff 50% 100%);
    color: transparent;
}

.site-header {
    height: 70px;
    background: #fff;
    border-bottom: 1px solid #eceef2;
    position: relative;
    z-index: 20;
}

.header-inner {
    max-width: 1900px;
    width: 100%;
    margin: 0 auto;
    height: 100%;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header-inner--plain {
    min-height: 68px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
}

.brand-text {
    display: inline-block;
}

.brand--plain {
    letter-spacing: 0;
}

.brand-text--main {
    color: var(--main-red);
    font-size: 20px;
    letter-spacing: -0.03em;
}

.actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 22px;
    border-radius: 999px;
    border: 1px solid #d9dee7;
    background: #fff;
    color: #2d3748;
    font-size: 15px;
    font-weight: 700;
}

.ghost-btn--soft {
    border-color: #d8dbe1;
    color: #1f2937;
}

.ghost-btn--solid {
    background: var(--main-red);
    color: #fff;
    border-color: var(--main-red);
}

.map-page {
    display: flex;
    width: 100%;
    height: calc(100vh - var(--header-offset));
    position: relative;
    overflow: hidden;
    background: #f4f6f9;
}

.auth-page-footer {
    margin-top: 0;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

.auth-page-footer__inner {
    max-width: 1900px;
    margin: 0 auto;
    padding: 58px 22px 50px;
    text-align: center;
}

.auth-page-footer__title {
    margin: 0 0 14px;
    color: var(--main-red);
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.auth-page-footer__text {
    margin: 0 0 10px;
    color: #94a3b8;
    font-size: 14px;
}

.auth-page-footer__social {
    margin-top: 26px;
    display: flex;
    justify-content: center;
    gap: 18px;
    color: #cbd5e1;
    font-size: 26px;
}

.property-panel {
    width: var(--panel-width);
    height: 100%;
    background: #fff;
    border-right: 1px solid var(--line);
    position: relative;
    z-index: 10;
    transition: margin-left 0.3s ease;
    box-shadow: 18px 0 40px rgba(15, 23, 42, 0.04);
}

.property-panel.is-closed {
    margin-left: calc(var(--panel-width) * -1);
}

.toggle-side {
    position: absolute;
    left: var(--panel-width);
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 58px;
    border: 1px solid var(--line);
    border-left: none;
    border-radius: 0 8px 8px 0;
    background: #fff;
    color: #444;
    cursor: pointer;
    z-index: 15;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.08);
    transition: left 0.3s ease;
}

.property-panel.is-closed + .toggle-side {
    left: 0;
}

.list-scroll {
    height: 100%;
    overflow-y: auto;
    background: #f7f8fa;
}

.panel-head.compact {
    padding: 14px 12px 12px;
    border-bottom: 1px solid #e7ebf0;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 2;
}

.panel-heading-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.panel-head.compact h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 900;
    color: #111827;
}

.panel-count {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    flex: none;
    white-space: nowrap;
}

.panel-count strong {
    color: #111827;
    font-size: 16px;
}

.panel-count-label {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.panel-subcopy,
.panel-hint {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

.panel-subcopy {
    display: none;
}

.panel-hint {
    color: #94a3b8;
}

.property-list {
    display: grid;
    gap: 10px;
    padding: 10px;
}

/* ── Property Card (design reference) ── */
.property-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    min-height: 130px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.property-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.property-card.active {
    border-color: var(--main-red);
    box-shadow: 0 0 0 2px rgba(206,17,38,0.12);
}

.property-card-image {
    width: 120px;
    min-width: 120px;
    position: relative;
    background: #edf2f7;
    flex-shrink: 0;
}

.property-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.property-card-heart {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 0;
    background: rgba(255,255,255,0.9);
    color: var(--main-red);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: 0.2s;
}

.property-card-heart:hover { background: #fff; }

.property-card-body {
    flex: 1;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.property-card-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: flex-start;
}

.property-card-title-area { min-width: 0; }

.property-card-title-area h3 {
    margin: 0 0 5px;
    font-size: 0.9rem;
    font-weight: 850;
    color: #1a202c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.property-card-location {
    color: #718096;
    font-size: 0.75rem;
}

.property-card-location i { color: #cbd5e0; margin-right: 3px; }

.property-card-price {
    color: var(--main-red);
    font-size: 0.9rem;
    font-weight: 850;
    white-space: nowrap;
    flex-shrink: 0;
}

.property-card-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.property-card-specs span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 7px;
    border-radius: 5px;
    background: #f7fafc;
    border: 1px solid #edf2f7;
    color: #4a5568;
    font-size: 0.72rem;
    font-weight: 700;
}

.property-card-specs i { color: #a0aec0; font-size: 0.7rem; }

.map-area {
    position: relative;
    flex: 1;
    height: 100%;
    overflow: hidden;
    background: #eef2f5;
}

.leaflet-map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: #eef2f5;
}

.maplibregl-map,
.maplibregl-canvas-container,
.maplibregl-canvas {
    width: 100% !important;
    height: 100% !important;
}

.map-info-panel {
    position: absolute;
    right: 20px;
    top: 24px;
    z-index: 2;
    width: auto;
    max-width: min(360px, calc(100% - 40px));
    padding: 0;
    border-radius: 14px;
    background: transparent;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.map-info-block {
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(226, 232, 240, 0.96);
}

.map-overlay-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--main-red);
}

.map-overlay-copy {
    margin-top: 6px;
    color: #475569;
    font-size: 12px;
    line-height: 1.6;
}

.mobile-sheet-head {
    display: none;
}

.map-debug-card {
    position: absolute;
    right: 20px;
    bottom: 20px;
    z-index: 3;
    display: none;
    max-width: 220px;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.7);
    color: #f8fafc;
    font-size: 11px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.24);
}

.property-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(6px);
}

.property-modal {
    position: fixed;
    top: 102px;
    left: 50%;
    z-index: 70;
    width: min(680px, calc(100vw - 48px));
    max-height: calc(100vh - 122px);
    transform: translateX(-50%);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.32);
    overflow: hidden;
}

.property-modal-close {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.78);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}

.property-modal-scroll {
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    padding: 0;
}

.property-modal-head {
    padding-right: 48px;
}

.property-modal-head.compact {
    padding: 22px 22px 0;
}

.property-modal-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border: 1px solid #fb923c;
    border-radius: 999px;
    color: #f97316;
    font-size: 14px;
}

.property-modal-head h2 {
    margin: 12px 0 8px;
    font-size: 30px;
    line-height: 1.05;
    letter-spacing: -0.05em;
}

.modal-main-title {
    display: block;
    margin-top: 8px;
    font-size: 20px;
    line-height: 1.4;
}

.modal-location {
    margin: 8px 0 0;
    color: #8a94a6;
    font-size: 14px;
}

.property-modal-hero {
    margin: 0;
}

.property-modal-hero img {
    width: 100%;
    display: block;
    object-fit: cover;
    aspect-ratio: 16 / 9;
    background: #f3f4f6;
}

.property-modal-body {
    padding: 0 22px 22px;
}

.property-modal-gallery {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 14px 0 6px;
}

.gallery-thumb {
    width: 84px;
    height: 68px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
    flex: none;
}

.gallery-thumb.is-active {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.property-detail-facts {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.modal-facts {
    margin-top: 14px;
}

.fact-row,
.detail-copy-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid #eef2f7;
}

.fact-row span,
.detail-copy-item span {
    color: #64748b;
    font-size: 13px;
}

.fact-row strong,
.detail-copy-item strong {
    text-align: right;
    font-size: 14px;
}

.detail-copy-list {
    margin-top: 14px;
}

.detail-copy-list.compact {
    display: grid;
    gap: 0;
}

.detail-description {
    margin: 16px 0 0;
    color: #334155;
    line-height: 1.65;
    font-size: 13px;
}

.detail-description.secondary {
    color: #64748b;
}

.modal-contact-btn {
    width: 100%;
    margin-top: 16px;
    min-height: 48px;
    border: 0;
    border-radius: 12px;
    background: var(--main-red);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}

@media (max-width: 900px) {
    :root {
        --panel-width: 340px;
    }

    .property-panel {
        width: var(--panel-width);
    }

    .property-panel.is-closed {
        margin-left: calc(var(--panel-width) * -1);
    }

    .toggle-side {
        left: var(--panel-width);
    }

    .property-panel.is-closed + .toggle-side {
        left: 0;
    }
}

@media (max-width: 760px) {
    :root {
        --header-offset: 95px;
    }

    .site-header {
        height: 64px;
    }

    .site-topbar__inner,
    .header-inner {
        padding: 0 16px;
    }

    .brand-text--main {
        font-size: 18px;
    }

    .actions {
        gap: 8px;
    }

    .ghost-btn {
        min-height: 36px;
        padding: 8px 16px;
        font-size: 13px;
    }

    .auth-page-footer__inner {
        padding: 44px 16px 40px;
    }

    .map-page {
        display: grid;
        grid-template-columns: 100%;
        grid-template-areas:
            "map"
            "list";
        height: auto;
    }

    .property-panel,
    .property-panel.is-closed {
        grid-area: list;
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        top: auto;
        width: 100%;
        height: auto;
        margin-left: 0;
        border-right: 0;
        border-top: 1px solid var(--line);
        border-bottom: 0;
        border-radius: 0;
        box-shadow: none;
        background: #fff;
        backdrop-filter: none;
        overflow: hidden;
    }

    .toggle-side {
        display: none;
    }

    .map-area {
        grid-area: map;
        height: 58vh;
        min-height: 58vh;
    }

    .map-info-panel {
        right: 12px;
        top: 14px;
        width: auto;
        max-width: calc(100% - 24px);
    }

    .mobile-sheet-head {
        display: none;
    }

    .mobile-sheet-handle {
        width: 36px;
        height: 4px;
        border-radius: 999px;
        background: #cbd5e1;
        flex: none;
    }

    .mobile-sheet-copy {
        display: grid;
        gap: 4px;
        font-size: 12px;
        color: #64748b;
    }

    .mobile-sheet-copy strong {
        color: #0f172a;
        font-size: 14px;
    }

    .mobile-sheet-copy b {
        color: #111827;
    }

    .list-scroll {
        overflow: visible;
        padding: 12px;
        background: #fff;
    }

    .panel-head.compact {
        display: block;
        position: static;
        padding: 14px 12px 10px;
    }

    .panel-heading-row {
        align-items: center;
        flex-wrap: wrap;
    }

    .panel-count {
        margin-left: auto;
        padding: 4px 8px;
        border-radius: 999px;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
    }

    .property-list-scroller {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
    }

    .property-list {
        display: flex;
        gap: 10px;
        padding: 0;
        min-height: auto;
    }

    .property-card {
        width: min(78vw, 286px);
        min-width: min(78vw, 286px);
        min-height: 108px;
        padding: 0;
        border-radius: 14px;
        box-shadow: 0 10px 22px rgba(15, 23, 42, 0.07);
    }

    .map-debug-card {
        right: 12px;
        left: 12px;
        bottom: 12px;
        max-width: none;
    }

    .property-modal {
        top: 0;
        left: 0;
        bottom: 0;
        width: 100vw;
        max-height: 100vh;
        height: 100vh;
        transform: none;
        border-radius: 0;
    }

    .property-modal-close {
        top: max(12px, env(safe-area-inset-top));
    }

    .property-modal-head h2 {
        font-size: 26px;
    }

    .modal-main-title {
        font-size: 18px;
    }

    .property-card-image {
        width: 90px;
        min-width: 90px;
    }

    .property-card-title-area h3 {
        font-size: 0.82rem;
    }

    .property-card-price {
        font-size: 0.8rem;
    }

    .property-card-specs span {
        font-size: 0.68rem;
        padding: 3px 6px;
    }

    .property-modal-close {
        top: 12px;
        left: 12px;
    }

    .property-modal-scroll {
        max-height: 100vh;
    }

    .property-modal-hero img {
        aspect-ratio: 4 / 3;
    }
}


.auth-sn-result {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

/* === Design ZIP sync: map left listing card === */
.property-panel {
    width: 400px;
    min-width: 400px;
    border-right: 1px solid #ddd;
    background: #fff;
    box-shadow: none;
}
.property-panel.is-closed { margin-left: -400px; }
.property-panel.is-closed + .toggle-side { left: 0; }
.toggle-side { left: 400px; width: 25px; height: 60px; border-radius: 0 8px 8px 0; }
.property-panel .list-scroll { padding: 10px; }
.property-panel .panel-head.compact {
    margin: 0 0 10px;
    padding: 12px 12px 10px;
    border: 1px solid #edf2f7;
    border-radius: 10px;
    background: #fafafa;
}
.property-panel .panel-heading-row h2 { font-size: 17px; color: #222; }
.property-panel .panel-count { font-size: 12px; color: #718096; }
.property-panel .panel-hint { margin-top: 5px; font-size: 12px; color: #94a3b8; }
.property-list { display: block; padding: 0; }
.property-card {
    display: flex;
    gap: 0;
    min-height: 118px;
    margin-bottom: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    box-shadow: none;
}
.property-card:hover { transform: translateY(-2px); background: #fff8f8; box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.property-card.active { border-color: #ce1126; background: #fff8f8; box-shadow: 0 0 0 1px rgba(206,17,38,0.08); }
.thumb-wrap { width: 120px; min-width: 120px; align-self: stretch; }
.thumb { border-radius: 0; }
.info { padding: 13px 12px; justify-content: flex-start; }
.card-topline { gap: 10px; }
.card-topline strong { font-size: 0.92rem; font-weight: 850; color: #1a202c; line-height: 1.35; }
.price { color: #222; font-size: 1rem; font-weight: 850; white-space: nowrap; }
.card-location { margin-top: 5px; font-size: 0.8rem; color: #718096; }
.meta { margin-top: 8px; gap: 6px; }
.meta small { padding: 5px 8px; border-radius: 6px; background: #f7fafc; color: #4a5568; font-size: 0.76rem; }
.card-heart { top: 8px; right: 8px; }
@media (max-width: 980px) {
    .property-panel,
    .property-panel.is-closed { width: 360px; min-width: 360px; }
    .property-panel.is-closed { margin-left: -360px; }
    .toggle-side { left: 360px; }
}
@media (max-width: 768px) {
    .property-panel,
    .property-panel.is-closed,
    .toggle-side { display: none; }
}
