/* Map apartment explorer. Loaded after the map and shared client styles.
   Selection is cyan; availability remains a separate labelled state. */
.cj-map-page #building-panel,
.cj-map-page #floor-rail {
    --explorer-free: #17684B;
    --explorer-free-bg: #EDF6F0;
    --explorer-reserved: #815B12;
    --explorer-reserved-bg: #FCF2DC;
    --explorer-sold: #855149;
    --explorer-sold-bg: #F4E9E7;
    --explorer-selected: #0891B2;
    --explorer-selected-bg: #CFFAFE;
    background: var(--gp-card, #FDFBF7);
    color: var(--gp-ink, #1C2320);
    border: 1px solid var(--gp-line, #DED6C7);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 12px 40px rgba(28, 35, 32, .18), 0 2px 8px rgba(28, 35, 32, .08);
    font-family: var(--gp-font);
    font-size: 14px;
    line-height: 1.5;
    color-scheme: light;
}
.cj-map-page #building-panel {
    width: 360px;
    min-width: 0;
    max-width: calc(100vw - 120px);
    padding: 16px;
    border-radius: 20px;
    animation: none;
}
.cj-map-page #building-panel .bp-head {
    gap: 10px;
    margin: 0 0 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gp-line);
}
.cj-map-page #building-panel .bp-head-label {
    text-align: left;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    color: var(--gp-navy);
    white-space: normal;
    line-height: 1.4;
}
.cj-map-page #building-panel #bp-close,
.cj-map-page #building-panel .bp-back {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border: 1px solid var(--gp-line);
    border-radius: 12px;
    background: var(--gp-bg);
    color: var(--gp-navy);
    font-size: 22px;
    flex-shrink: 0;
}
.cj-map-page #building-panel #bp-close:hover,
.cj-map-page #building-panel .bp-back:hover {
    background: var(--gp-bg-alt);
    color: var(--gp-ink);
    border-color: var(--gp-muted);
}
.cj-map-page #building-panel .bp-title {
    font-size: 22px;
    line-height: 1.3;
    letter-spacing: -.025em;
    font-weight: 700;
    color: var(--gp-navy);
    margin-bottom: 8px;
}
.cj-map-page #building-panel .bp-price {
    font-size: 18px !important;
    line-height: 1.45;
    color: var(--gp-primary);
    margin-bottom: 16px;
}
.cj-map-page #building-panel .bp-context,
.cj-map-page #building-panel .bp-status,
.cj-map-page #building-panel .bp-units-head,
.cj-map-page #building-panel .bp-units-load,
.cj-map-page #building-panel .bp-loc-sub {
    font-size: 14px;
    line-height: 1.5;
    color: var(--gp-muted);
    opacity: 1;
}
.cj-map-page #building-panel .bp-context b,
.cj-map-page #building-panel .bp-units-head b { color: var(--gp-navy); }
.cj-map-page #building-panel .bp-status { flex-wrap: wrap; }
.cj-map-page #building-panel .bp-avail {
    color: var(--explorer-free);
    background: var(--explorer-free-bg);
    border-color: #BBD8C8;
    white-space: normal;
    font-size: 12px;
    padding: 4px 8px;
}
.cj-map-page #building-panel .gp-demo.on-dark {
    background: var(--explorer-reserved-bg);
    color: var(--explorer-reserved);
    border-color: #D8BC81;
}
.cj-map-page #building-panel .bp-body {
    padding: 0 3px 2px;
    scrollbar-width: thin;
    scrollbar-color: #B5B2A8 transparent;
}
/* Snap state owns visibility, independently of the current building/floor step. */
.cj-map-page #building-panel { box-sizing: border-box; }
.cj-map-page #building-panel .bp-head { flex: 0 0 auto; min-width: 0; }
.cj-map-page #building-panel .bp-head-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cj-map-page #bp-snap-toggle {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 8px;
    border: 0;
    border-radius: 8px;
    background: var(--gp-tint-2);
    color: var(--gp-primary-dark);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
}
.cj-map-page #building-panel[data-snap="peek"] {
    height: fit-content;
    max-height: min(160px, calc(100dvh - 24px)) !important;
}
.cj-map-page #building-panel[data-snap="peek"] > :not(.bp-head),
.cj-map-page #building-panel[data-snap="peek"] .bp-back { display: none !important; }
.cj-map-page #building-panel[data-snap="peek"] .bp-head {
    margin: 0;
    padding: 0;
    border: 0;
}
.cj-map-page #building-panel #bp-units {
    display: flex;
    flex-direction: column;
    margin-top: 0;
}
.cj-map-page #building-panel .bp-floor-stepper {
    order: 0;
    position: sticky;
    top: 0;
    z-index: 4;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 8px;
    padding: 8px 0;
    margin: 0;
    background: var(--gp-card);
}
.cj-map-page #building-panel .bp-floor-stepper button,
.cj-map-page #building-panel .bp-floor-stepper select,
.cj-map-page #building-panel .bp-unit-nav button {
    min-height: 44px;
    min-width: 44px;
    border: 1px solid #B9C4BC;
    border-radius: 10px;
    background: #fff;
    color: var(--gp-navy);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    touch-action: manipulation;
}
.cj-map-page #building-panel .bp-floor-stepper select {
    width: 100%;
    min-width: 0;
    padding: 8px 12px;
    background: var(--gp-tint-2);
}
.cj-map-page #building-panel .bp-floor-stepper button:hover:not(:disabled),
.cj-map-page #building-panel .bp-unit-nav button:hover:not(:disabled) {
    background: var(--gp-tint);
    border-color: var(--gp-primary);
}
.cj-map-page #building-panel .bp-floor-stepper button:disabled,
.cj-map-page #building-panel .bp-unit-nav button:disabled {
    opacity: .45;
    cursor: default;
}
.cj-map-page #building-panel .bp-unit-nav {
    order: 1;
    position: sticky;
    top: 60px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 0 10px;
    margin-bottom: 10px;
    background: var(--gp-card);
    border-bottom: 1px solid var(--gp-line);
}
.cj-map-page #building-panel .bp-unit-nav button {
    width: 44px;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    padding: 0;
}
.cj-map-page #building-panel .bp-unit-position {
    flex: 1;
    min-width: 0;
    color: var(--gp-navy);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
}
.cj-map-page #building-panel .bp-unit-position small,
.cj-map-page #building-panel .bp-unit-position > span {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--gp-muted);
}
.cj-map-page #building-panel .bp-availability-key {
    order: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 600;
}
.cj-map-page #building-panel .bp-availability-key > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.cj-map-page #building-panel .bp-availability-key > span::before,
.cj-map-page #building-panel .bp-unit-s::before {
    content: '';
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: currentColor;
}
.cj-map-page #building-panel .bp-availability-key .free { color: var(--explorer-free); }
.cj-map-page #building-panel .bp-availability-key .res { color: var(--explorer-reserved); }
.cj-map-page #building-panel .bp-availability-key .sold { color: var(--explorer-sold); }
.cj-map-page #building-panel .bp-units-head { order: 3; margin-bottom: 12px; }
.cj-map-page #building-panel #bp-units:has(.bp-unit-nav) .bp-units-head { display: none; }
.cj-map-page #building-panel .bp-units-grid {
    order: 4;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 14px;
}
.cj-map-page #building-panel .bp-unit {
    --unit-color: var(--explorer-free);
    --unit-bg: var(--explorer-free-bg);
    position: relative;
    min-height: 116px;
    min-width: 0;
    gap: 5px;
    padding: 12px;
    background: #fff;
    color: var(--gp-ink);
    border: 1px solid #CBD5CE;
    border-top: 3px solid var(--unit-color);
    border-radius: 12px;
    opacity: 1;
    transition: border-color .15s ease, background .15s ease;
}
.cj-map-page #building-panel .bp-unit.res,
.cj-map-page #building-panel .bp-unit[data-status="reserved"] {
    --unit-color: var(--explorer-reserved);
    --unit-bg: var(--explorer-reserved-bg);
}
.cj-map-page #building-panel .bp-unit.sold,
.cj-map-page #building-panel .bp-unit[data-status="sold"] {
    --unit-color: var(--explorer-sold);
    --unit-bg: var(--explorer-sold-bg);
}
.cj-map-page #building-panel .bp-unit:hover {
    background: var(--gp-tint-2);
    border-color: var(--gp-primary);
    border-top-color: var(--unit-color);
    filter: none;
}
.cj-map-page #building-panel .bp-unit .bp-unit-n {
    font-size: 20px;
    font-weight: 750;
    line-height: 1.2;
    color: var(--gp-navy);
    opacity: 1;
    font-variant-numeric: tabular-nums;
}
.cj-map-page #building-panel .bp-unit .bp-unit-m {
    color: var(--gp-muted);
    font-size: 14px;
    line-height: 1.45;
    opacity: 1;
    overflow-wrap: anywhere;
}
.cj-map-page #building-panel .bp-unit .bp-unit-s {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    margin-top: auto;
    padding: 3px 6px;
    border-radius: 6px;
    background: var(--unit-bg);
    color: var(--unit-color);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0;
    opacity: 1;
}
.cj-map-page #building-panel .bp-unit.sel {
    background: var(--explorer-selected-bg);
    border-color: var(--explorer-selected);
    box-shadow: inset 0 0 0 1px var(--explorer-selected);
}
.cj-map-page #building-panel .bp-unit-selected { display: none; }
.cj-map-page #building-panel .bp-unit.sel .bp-unit-selected,
.cj-map-page #building-panel .bp-unit.sel:not(:has(.bp-unit-selected))::after {
    display: block;
    color: #076579;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}
.cj-map-page #building-panel .bp-unit.sel:not(:has(.bp-unit-selected))::after { content: '✓ E zgjedhur'; }
.cj-map-page #building-panel #bp-inside-btn { order: 5; }
.cj-map-page #building-panel #bp-inside-note { order: 6; }
.cj-map-page #building-panel #bp-floor-model-status { order: 2; }
.cj-map-page #building-panel #bp-loc-wrap { order: 8; }
.cj-map-page #building-panel #bp-explore-btn,
.cj-map-page #building-panel #bp-detail-link,
.cj-map-page #building-panel .bp-retry,
.cj-map-page #building-panel .bp-inside {
    min-height: 44px;
    padding: 11px 14px;
    border: 1px solid var(--gp-primary);
    border-radius: 11px;
    background: var(--gp-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
    box-shadow: none;
    text-decoration: none;
    transform: none;
    filter: none;
    touch-action: manipulation;
}
.cj-map-page #building-panel #bp-detail-link { flex-shrink: 0; margin-top: 12px; }
.cj-map-page #building-panel #bp-detail-link:hover,
.cj-map-page #building-panel #bp-explore-btn:hover,
.cj-map-page #building-panel .bp-retry:hover { background: var(--gp-primary-dark); color: #fff; }
.cj-map-page #building-panel[data-step="building"] #bp-detail-link,
.cj-map-page #building-panel .bp-inside,
.cj-map-page #building-panel .bp-inside.on {
    background: var(--gp-tint-2);
    color: var(--gp-primary-dark);
    border-color: #B9C4BC;
}
.cj-map-page #building-panel .bp-note {
    padding: 10px 12px;
    margin: 0 0 12px;
    background: var(--explorer-selected-bg);
    color: #27535C;
    border: 1px solid #B5D8DF;
    font-size: 14px;
    line-height: 1.5;
}
.cj-map-page #building-panel .bp-alt {
    margin: 12px 0 4px;
    padding: 12px;
    background: var(--gp-bg);
    border: 1px solid var(--gp-line);
    border-radius: 12px;
}
.cj-map-page #building-panel .bp-alt:hover { background: var(--gp-bg-alt); border-color: #B9C4BC; }
.cj-map-page #building-panel .bp-alt-t,
.cj-map-page #building-panel .bp-alt-t i { color: var(--gp-primary); font-size: 14px; }
.cj-map-page #building-panel .bp-alt-s { color: var(--gp-muted); font-size: 14px; line-height: 1.5; }
.cj-map-page #building-panel .bp-loc { background: var(--gp-tint-2); border-color: #B5D8DF; padding: 12px; }
.cj-map-page #building-panel .bp-loc-svg { background: var(--gp-navy); padding: 8px; border-radius: 8px; }
.cj-map-page #building-panel .bp-loc-cap { color: var(--gp-navy); font-size: 14px; line-height: 1.5; }
.cj-map-page #building-panel .bp-loc-btn,
.cj-map-page #building-panel .bp-loc-btn.ghost {
    min-height: 44px;
    background: #fff;
    border-color: #B9C4BC;
    color: var(--gp-primary-dark);
    font-size: 14px;
}
.cj-map-page #building-panel .bp-loc-btn.on { background: var(--explorer-selected-bg); border-color: var(--explorer-selected); }
.cj-map-page #floor-rail {
    top: 144px;
    left: 16px;
    max-height: calc(100dvh - 168px);
    padding: 8px;
    gap: 6px;
    border-radius: 16px;
    scrollbar-width: thin;
    scrollbar-color: #B5B2A8 transparent;
}
.cj-map-page #floor-rail .fr-cap { color: var(--gp-muted); font-size: 12px; opacity: 1; }
.cj-map-page #floor-rail .fr-btn {
    min-width: 48px;
    min-height: 52px;
    gap: 3px;
    background: #fff;
    color: var(--gp-muted);
    border: 1px solid var(--gp-line);
    border-radius: 10px;
}
.cj-map-page #floor-rail .fr-btn.all,
.cj-map-page #floor-rail .fr-btn.some,
.cj-map-page #building-panel .bp-floor.all,
.cj-map-page #building-panel .bp-floor.some {
    background: var(--explorer-free-bg);
    color: var(--explorer-free);
    border-color: #BBD8C8;
}
.cj-map-page #floor-rail .fr-btn.sold,
.cj-map-page #building-panel .bp-floor.sold {
    background: var(--explorer-sold-bg);
    color: var(--explorer-sold);
    border-color: #DCC8C3;
}
.cj-map-page #floor-rail .fr-n { font-size: 16px; font-weight: 700; line-height: 1.2; }
.cj-map-page #floor-rail .fr-a { font-size: 12px; opacity: 1; line-height: 1.25; }
.cj-map-page #floor-rail .fr-btn.sel,
.cj-map-page #building-panel .bp-floor.sel {
    background: var(--explorer-selected-bg);
    color: #076579;
    border: 1px solid var(--explorer-selected);
    outline: 2px solid var(--explorer-selected);
    outline-offset: -2px;
}
.cj-map-page #building-panel :focus-visible,
.cj-map-page #floor-rail :focus-visible {
    outline: 3px solid var(--explorer-selected) !important;
    outline-offset: 2px;
}
.cj-map-page.bp-open #tile-toast-3d {
    left: calc(50% - 180px) !important;
    bottom: 24px !important;
    max-width: calc(100vw - 440px);
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 12px !important;
}
@media (min-width: 769px) {
    .cj-map-page #building-panel { top: 144px; right: 80px; max-height: calc(100dvh - 160px) !important; }
    .cj-map-page.bp-open #cam-heading,
    .cj-map-page.bp-open #cam-pitch { left: calc((100% - 440px) / 2); }
}
@media (max-width: 768px) {
    .cj-map-page #building-panel {
        top: auto;
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        max-height: var(--bp-snap, 56dvh);
        padding: 0 14px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
        border-radius: 22px 22px 0 0;
        border-bottom: 0;
        transition: max-height .2s ease, height .2s ease;
    }
    .cj-map-page #building-panel.tall { --bp-snap: 84dvh; }
    /* The floor's unit list arrives after the sheet is already open: measured on
       a phone against production, #floor-strip goes 33 -> 1092 px about 0.8 s after
       the camera lands, the sheet grows 269 -> 470 px, and a bottom sheet grows
       upward - taking its own content with it, 0.62 of the 0.74 layout shift on
       that journey. The units step is the one step that fills the sheet anyway, so
       it takes the snap height up front; shorter steps stay content-sized. */
    .cj-map-page #building-panel[data-step="units"]:not(.peek) { height: var(--bp-snap, 56dvh); }
    /* The unit grid replaces this loader about 0.8 s later with ~1092 px of cards.
       Without a reserve, whatever follows it - the "Hap interierin" link - is
       visible first and then pushed out of sight: 0.10 of the layout shift on that
       journey, measured on a phone. One body height is enough, and the grid replaces
       the loader outright, so nothing stays reserved afterwards. Only the loader:
       it is the one div with this class (the "no apartments" and "could not load"
       messages are p, and a screenful under one line of text is the very thing this
       sheet avoids). */
    .cj-map-page #building-panel[data-step="units"] #bp-units > div.bp-units-load { min-height: 40dvh; }
    .cj-map-page #building-panel.peek { padding-block: 6px calc(6px + env(safe-area-inset-bottom, 0px)) !important; }
    .cj-map-page #building-panel #bp-grab { min-height: 44px; padding: 10px 0; }
    .cj-map-page #building-panel #bp-grab::before { background: #A7AAA1; width: 36px; }
    .cj-map-page #building-panel .bp-head { margin-bottom: 6px; padding-bottom: 8px; }
    .cj-map-page #building-panel.peek .bp-head { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
    .cj-map-page #building-panel.peek #bp-grab { min-height: 44px; padding: 6px 0 4px; }
    .cj-map-page #building-panel .bp-unit { min-height: 110px; padding: 10px; }
    .cj-map-page #building-panel .bp-units-grid { gap: 8px; }
    .cj-map-page:has(#building-panel[data-step="units"]) #floor-rail { display: none !important; }
    .cj-map-page.bp-open #tile-toast-3d {
        top: 68px !important;
        right: 12px !important;
        bottom: auto !important;
        left: auto !important;
        transform: none !important;
        max-width: calc(100vw - 24px);
    }
}
@media (max-width: 768px) and (max-height: 500px) {
    .cj-map-page #building-panel { --bp-snap: 72dvh; }
    .cj-map-page #building-panel.tall { --bp-snap: 90dvh; }
}
@media (prefers-reduced-motion: reduce) {
    .cj-map-page #building-panel,
    .cj-map-page #building-panel *,
    .cj-map-page #floor-rail * { transition: none !important; animation: none !important; }
}
/* A short viewport keeps one scrollable side panel and a clear map area. */
@media (min-width: 769px) and (max-height: 500px) {
    .cj-map-page.bp-open #building-panel {
        top: 16px !important;
        right: 12px !important;
        width: 340px !important;
        max-height: calc(100dvh - 32px) !important;
    }
    .cj-map-page.bp-open #view-toggle { display: none; }
    .cj-map-page #floor-rail { top: 16px; max-height: calc(100dvh - 32px); }
}
@media (max-height: 500px) {
    .cj-map-page #building-panel .bp-floor-stepper,
    .cj-map-page #building-panel .bp-unit-nav { position: static; }
}

.cj-map-page #building-panel .bp-unit.unknown {
    --unit-color: #5B635E;
    --unit-bg: #ECEFEB;
}

.cj-map-page #building-panel[data-step="units"] .bp-context { display: none; }
