.spaces {
    background:
        radial-gradient(circle at 12% 0%, rgba(186, 148, 54, 0.08), transparent 42%),
        linear-gradient(180deg, #f4efe4 0%, #ece6d8 48%, #f7f3ea 100%);
    padding-block: 2.2rem 4.2rem;
}

.spaces__intro {
    display: grid;
    gap: 0.7rem;
    margin-block-end: 1.3rem;
    max-width: 46rem;
}

.spaces__intro h2 {
    margin: 0;
    color: var(--color-green-dark);
    font-size: clamp(1.7rem, 2.4vw, 2.35rem);
}

.spaces__intro p {
    margin: 0;
    color: var(--color-muted);
}

.spaces__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-block-end: 1.3rem;
}

.spaces__stage[hidden],
.spaces-group[hidden],
[data-spaces-overview][hidden],
.spaces-detail[hidden] {
    display: none !important;
}

.spaces-group {
    margin-block-end: 2rem;
}

.spaces-group h3 {
    margin: 0 0 0.85rem;
    color: var(--color-green);
    font-size: 1.15rem;
}

.zone-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.zone-card {
    display: grid;
    gap: 0.2rem;
    padding: 1.15rem 1.2rem 1.2rem;
    border: 1px solid rgba(27, 87, 15, 0.12);
    border-radius: 1rem;
    background: #fffdf8;
    color: inherit;
    text-align: start;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(27, 87, 15, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.zone-card:hover,
.zone-card:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 16px 32px rgba(27, 87, 15, 0.14);
    outline: none;
}

.zone-card__code {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--color-gold);
}

.zone-card strong {
    color: var(--color-green-dark);
    font-size: 1.02rem;
}

.zone-card b {
    color: var(--color-muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.zone-mini,
.zone-map--mini {
    display: none !important;
}

.zone-map {
    display: block;
    width: 100%;
    height: auto;
}

html.is-spaces-detail,
body.is-spaces-detail,
html.is-spaces-detail main,
body.is-spaces-detail main {
    background: #f4efe4;
}

html.is-spaces-detail .page-hero,
body.is-spaces-detail .page-hero {
    display: none;
}

html.is-spaces-detail main,
body.is-spaces-detail main {
    display: flex;
    flex-direction: column;
}

html.is-spaces-detail .spaces,
body.is-spaces-detail .spaces {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    justify-content: safe center;
    padding-block: calc(var(--header-h) + 2.4rem) 2.8rem;
    background: #f4efe4;
}

.spaces-sheet {
    display: grid;
    gap: 0.9rem;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.sheet-band {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    overflow-x: auto;
    border-radius: 0.55rem;
    border: 1px solid rgba(27, 87, 15, 0.1);
    background: #fffdf8;
}

.sheet-band--gold .sheet-label { background: #c4a15a; color: #fff; }
.sheet-band--gold .sheet-cell { background: #f7f1e4; }
.sheet-band--green .sheet-label { background: #1b570f; color: #fff; }
.sheet-band--green .sheet-cell { background: #eef3ea; }

.sheet-labels,
.sheet-cols {
    display: grid;
}

.sheet-label,
.sheet-row {
    min-height: 2.4rem;
}

.sheet-label {
    display: grid;
    min-width: 8.6rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 800;
    place-content: center;
    text-align: center;
    position: sticky;
    inset-inline-start: 0;
    z-index: 2;
}

.sheet-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(5.2rem, 1fr);
}

.sheet-cell {
    border-inline-start: 1px solid rgba(255,255,255,0.55);
    min-height: 2.4rem;
    padding: 0.3rem 0.2rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-green-dark);
    white-space: nowrap;
    display: grid;
    place-items: center;
}

.sheet-totals {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
}

.sheet-totals--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sheet-total {
    background: #163512;
    color: #fff;
    border-radius: 0.7rem;
    padding: 0.75rem 1rem 0.85rem;
}

.sheet-total span {
    display: block;
    font-size: 0.78rem;
    color: #d9c48a;
}

.sheet-total b {
    display: block;
    margin-top: 0.25rem;
    font-size: clamp(1.3rem, 2vw, 1.75rem);
}

.unit-sheet {
    display: grid;
    gap: 0.45rem;
    max-width: 16rem;
    padding: 0.9rem 1rem;
    border-radius: 0.7rem;
    background: #fff;
    box-shadow: 0 8px 24px rgba(27, 87, 15, 0.1);
}

.unit-sheet--inline {
    max-width: none;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 1.6rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(27, 87, 15, 0.1);
    box-shadow: none;
}

.unit-sheet--inline ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.4rem;
}

.unit-sheet--inline li {
    min-width: 8.5rem;
}

.unit-sheet p {
    margin: 0;
    color: var(--color-gold);
    font-weight: 800;
    font-size: 0.85rem;
}

.unit-sheet h3 {
    margin: 0;
    color: var(--color-green-dark);
}

.unit-sheet ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.25rem;
}

.unit-sheet li {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    font-size: 0.88rem;
}

.unit-sheet li span { color: var(--color-muted); }
.unit-sheet li b { color: var(--color-green-dark); }

.zone-detail-map {
    width: 100%;
    margin-inline: auto;
    padding: 0.75rem;
    border-radius: 0.9rem;
    background: #f7f3ea;
    border: 1px solid rgba(186, 148, 54, 0.22);
    box-shadow: 0 12px 30px rgba(27, 87, 15, 0.08);
    overflow-x: auto;
}

.zone-detail-map .zone-map {
    display: block;
    direction: ltr;
    width: 100%;
    min-width: 46rem;
    max-width: none;
    height: auto;
}

.spaces-pane[data-spaces-pane="map"] {
    width: 100%;
}

.plan-asphalt {
    fill: #2c2f33;
}

.plan-plot {
    fill: #f2efe7;
}

.plan-lane {
    fill: #3a3e43;
}

.plan-seam {
    fill: #e6e1d4;
}

.plan-seam--road {
    fill: #3a3e43;
}

.plan-rule {
    stroke: #8d9298;
    stroke-width: 1.1;
}

.plan-street {
    fill: #f0ead9;
    font-size: 15px;
    font-family: Cairo, sans-serif;
    font-weight: 700;
    letter-spacing: 0.02em;
    direction: ltr;
    unicode-bidi: isolate;
}

.plan-unit {
    cursor: pointer;
}

.plan-unit__body {
    stroke: #b08958;
    stroke-width: 1.1;
    transition: fill 0.18s ease;
}

.plan-unit__cap {
    fill: #f6ecdb;
    stroke: #c9b48f;
    stroke-width: 0.8;
    pointer-events: none;
}

.plan-dock {
    fill: #f7f3ea;
    stroke: #a9835a;
    stroke-width: 0.7;
    pointer-events: none;
}

.plan-code,
.plan-area {
    fill: #40382a;
    font-family: Cairo, "Segoe UI", sans-serif;
    font-weight: 700;
    pointer-events: none;
}

.plan-area {
    fill: #6a5c46;
    font-weight: 600;
}

.plan-unit:hover .plan-unit__body,
.plan-unit:focus-visible .plan-unit__body {
    fill: #ba9436;
}

.plan-unit:focus-visible {
    outline: none;
}

.plan-unit.is-active .plan-unit__body,
.plan-unit.is-active:hover .plan-unit__body {
    fill: #1b570f;
}

.plan-unit:hover .plan-code,
.plan-unit:hover .plan-area,
.plan-unit:focus-visible .plan-code,
.plan-unit:focus-visible .plan-area,
.plan-unit.is-active .plan-code,
.plan-unit.is-active .plan-area {
    fill: #fff;
}

.spaces-detail {
    display: grid;
    gap: 0.85rem;
}

.spaces-detail__bar {
    position: sticky;
    top: var(--header-h);
    z-index: 30;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.7rem 0 0.8rem;
    background: #f4efe4;
    border-bottom: 1px solid rgba(27, 87, 15, 0.08);
}

.spaces-detail__bar h2 {
    margin: 0.1rem 0 0;
    color: var(--color-green-dark);
    font-size: clamp(1.15rem, 1.8vw, 1.45rem);
}

.spaces-detail__total {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    padding-inline: 1.15rem;
    border-radius: 0.65rem;
    background: #163512;
    white-space: nowrap;
}

.spaces-detail__total span {
    font-size: 0.82rem;
    font-weight: 700;
    color: #d9c48a;
}

.spaces-detail__total b {
    color: #fff;
    font-size: 1rem;
    line-height: 1;
}

.spaces-detail__toolbar {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 0.55rem;
}

.spaces-detail__actions {
    display: flex;
    align-items: stretch;
    gap: 0.45rem;
}

.spaces-back {
    appearance: none;
    flex: 0 0 auto;
    border: 1px solid rgba(27, 87, 15, 0.1);
    background: #fff;
    padding-inline: 1.15rem;
    border-radius: 0.65rem;
    color: var(--color-green-dark);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

html.is-spaces-detail [data-spaces-cta],
body.is-spaces-detail [data-spaces-cta] {
    display: none;
}

.unit-sheet--modal .btn {
    margin-block-start: 1.1rem;
    width: 100%;
}

.spaces-detail__code {
    margin: 0;
    color: var(--color-gold);
    font-weight: 700;
    font-size: 0.92rem;
}

.spaces-tabs {
    display: flex;
    width: fit-content;
    gap: 0.2rem;
    padding: 0.22rem;
    border-radius: 0.65rem;
    background: #fff;
    border: 1px solid rgba(27, 87, 15, 0.1);
}

.spaces-tab {
    appearance: none;
    border: 0;
    background: transparent;
    min-height: 2.35rem;
    padding-inline: 1.15rem;
    border-radius: 0.65rem;
    color: var(--color-green-dark);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.spaces-tab.is-active {
    background: var(--color-green);
    color: #fff;
}

.spaces-pane[hidden] {
    display: none !important;
}

.spaces-pane {
    display: grid;
    gap: 0.85rem;
}

.spaces-hint {
    margin: 0;
    font-size: 0.92rem;
    color: var(--color-muted);
}

.interest-modal.is-open {
    align-items: start;
    padding-block-start: min(16vh, 7.5rem);
}

.interest-modal .modal__dialog {
    max-width: 22rem;
    padding: 2.6rem 1.4rem 1.5rem;
}

.unit-sheet--modal {
    max-width: none;
    margin: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
}

.unit-sheet--modal li {
    padding-block: 0.4rem;
    border-bottom: 1px solid rgba(27, 87, 15, 0.08);
}

.unit-sheet--modal li:last-child {
    border-bottom: 0;
    font-weight: 700;
}

.interest-modal .form[hidden] {
    display: none !important;
}

.interest-modal .form {
    box-shadow: none;
    padding: 0;
}

.interest-lead {
    margin: 0 0 0.8rem;
    color: var(--color-muted);
}

.interest-lead b {
    color: var(--color-green);
}

@media (max-width: 1100px) {
    .zone-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 720px) {
    .zone-grid {
        grid-template-columns: 1fr;
    }

    .sheet-totals {
        grid-template-columns: 1fr;
    }

    .unit-sheet--inline,
    .unit-sheet--inline ul {
        display: grid;
        gap: 0.45rem;
    }

    .spaces-detail__bar {
        position: static;
        top: auto;
    }

    .spaces-detail__toolbar {
        flex-wrap: wrap;
    }

    .spaces-detail__actions {
        width: 100%;
        justify-content: flex-start;
    }

    .spaces-detail__total {
        flex: 1;
        justify-content: center;
    }

    .spaces-tabs {
        flex: 1;
        width: auto;
        min-width: 0;
    }

    .spaces-tab {
        flex: 1;
        text-align: center;
    }

    .sheet-label {
        min-width: 6.4rem;
        font-size: 0.72rem;
    }
}
