:root {
    --space-bg: #f5f7fb;
    --space-surface: #ffffff;
    --space-surface-strong: #f9fafb;
    --space-text: #111827;
    --space-muted: #6b7280;
    --space-line: #e5e7eb;
    --space-primary: #14532d;
    --space-primary-weak: #dcfce7;
    --space-accent: #356fb8;
    --space-warn: #92400e;
    --space-shadow: 0 18px 48px rgba(15, 23, 42, .08);
}

@media (prefers-color-scheme: dark) {
    :root {
        --space-bg: #0b0f14;
        --space-surface: #111827;
        --space-surface-strong: #151f2f;
        --space-text: #f8fafc;
        --space-muted: #9ca3af;
        --space-line: #263244;
        --space-primary: #4ade80;
        --space-primary-weak: rgba(74, 222, 128, .14);
        --space-accent: #8fd3ff;
        --space-warn: #fbbf24;
        --space-shadow: 0 18px 48px rgba(0, 0, 0, .35);
    }
}

body.space-property-page {
    margin: 0;
    color: var(--space-text);
    background: var(--space-bg);
    font-family:var(--bc-font-sans);
}

body.space-property-page a {
    color: inherit;
    text-decoration: none;
}

.space-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: color-mix(in srgb, var(--space-surface) 92%, transparent);
    border-bottom: 1px solid var(--space-line);
    backdrop-filter: blur(18px);
}

.space-header-inner {
    max-width: 1180px;
    margin: 0 auto;
    min-height: 64px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 22px;
}

.space-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight:600;
    white-space: nowrap;
}

.space-logo span {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    color: #fff;
    background: var(--space-primary);
}

.space-nav {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 14px;
    color: var(--space-muted);
    overflow-x: auto;
}

.space-nav a.active,
.space-nav a:hover {
    color: var(--space-text);
    font-weight:600;
}

.space-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.space-header-actions a {
    min-height: 36px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--space-line);
    border-radius: 10px;
    background: var(--space-surface-strong);
}

.space-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 20px 96px;
}

.space-hero,
.space-detail-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, .7fr);
    gap: 20px;
    align-items: stretch;
}

.space-hero-copy,
.space-hero-panel,
.space-detail-copy,
.space-detail-visual,
.space-detail-card,
.space-contact-card,
.space-guide-card,
.space-search-card,
.space-listing-card,
.space-metrics article {
    background: var(--space-surface);
    border: 1px solid var(--space-line);
    border-radius: 18px;
    box-shadow: var(--space-shadow);
}

.space-hero-copy {
    padding: 34px;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        radial-gradient(circle at 78% 14%, var(--space-primary-weak), transparent 34%),
        var(--space-surface);
}

.space-hero-copy span,
.space-section-head span {
    color: var(--space-primary);
    font-size: 12px;
    font-weight:600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.space-hero-copy h1,
.space-detail-copy h1 {
    margin: 10px 0 12px;
    font-size: clamp(30px, 4vw, 52px);
    line-height: 1.08;
    letter-spacing: -.04em;
}

.space-hero-copy p,
.space-detail-copy p,
.space-hero-panel p,
.space-guide-card p {
    margin: 0;
    color: var(--space-muted);
    line-height: 1.7;
}

.space-hero-actions,
.space-detail-actions {
    margin-top: 22px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.space-hero-actions a,
.space-detail-actions a,
.space-detail-actions button,
.space-contact-card a,
.space-guide-card.accent a {
    min-height: 44px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--space-primary);
    background: var(--space-primary);
    color: #fff;
    font-weight:600;
}

.space-hero-actions a + a,
.space-detail-actions a + a,
.space-detail-actions button,
.space-contact-card a + a {
    color: var(--space-text);
    background: var(--space-surface-strong);
    border-color: var(--space-line);
}

.space-hero-panel {
    padding: 26px;
}

.space-hero-panel strong,
.space-guide-card h2,
.space-detail-card h2,
.space-contact-card h2 {
    display: block;
    margin: 0 0 12px;
    font-size: 20px;
}

.space-hero-panel ul,
.space-guide-card ol,
.space-trust-list {
    margin: 18px 0 0;
    padding-left: 18px;
    color: var(--space-muted);
    line-height: 1.8;
}

.space-metrics {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.space-metrics article {
    padding: 18px;
    box-shadow: none;
}

.space-metrics span,
.space-spec-grid span,
.space-nearby-grid span {
    display: block;
    color: var(--space-muted);
    font-size: 12px;
    font-weight:600;
}

.space-metrics strong {
    display: block;
    margin-top: 6px;
    font-size: 24px;
}

.space-metrics p {
    margin: 4px 0 0;
    color: var(--space-muted);
    font-size: 13px;
}

.space-search-card {
    margin-top: 18px;
    padding: 20px;
    box-shadow: none;
}

.space-search-form label,
.space-filter-grid span {
    color: var(--space-muted);
    font-size: 13px;
    font-weight:600;
}

.space-search-row {
    margin-top: 8px;
    min-height: 54px;
    padding: 0 8px 0 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--space-line);
    border-radius: 14px;
    background: var(--space-surface-strong);
}

.space-search-row input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--space-text);
    font-size: 16px;
}

.space-search-row button {
    height: 40px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: var(--space-primary);
    color: #fff;
    font-weight:600;
}

.space-filter-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.space-chip-row {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.space-chip-row a,
.space-tags span,
.space-feature-row span {
    min-height: 32px;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    border-radius: 9px;
    border: 1px solid var(--space-line);
    background: var(--space-surface-strong);
    color: var(--space-muted);
    font-size: 13px;
    font-weight:600;
}

.space-chip-row a.is-active,
.space-tags span.primary {
    color: var(--space-primary);
    border-color: color-mix(in srgb, var(--space-primary) 28%, var(--space-line));
    background: var(--space-primary-weak);
}

.space-layout,
.space-detail-grid {
    margin-top: 22px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
}

.space-section-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: end;
    margin-bottom: 12px;
}

.space-section-head h2 {
    margin: 4px 0 0;
    font-size: 24px;
}

.space-view-toggle {
    display: flex;
    gap: 8px;
}

.space-view-toggle button,
.space-listing-actions button {
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--space-line);
    border-radius: 10px;
    background: var(--space-surface);
    color: var(--space-text);
    font-weight:600;
}

.space-view-toggle button.is-active {
    color: #fff;
    border-color: var(--space-primary);
    background: var(--space-primary);
}

.space-list {
    display: grid;
    gap: 12px;
}

.space-listing-card {
    padding: 14px;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 140px;
    gap: 16px;
    align-items: stretch;
    box-shadow: none;
}

.space-listing-visual,
.space-detail-visual {
    min-height: 150px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    color: #fff;
    background: linear-gradient(135deg, #14532d, #356fb8);
}

.space-listing-visual.building,
.space-detail-visual.building {
    background: linear-gradient(135deg, #1e3a8a, #356fb8);
}

.space-listing-visual i,
.space-detail-visual i {
    font-size: 36px;
}

.space-listing-visual span,
.space-detail-visual span {
    font-weight:700;
}

.space-tags,
.space-feature-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.space-listing-body h3 {
    margin: 10px 0 8px;
    font-size: 20px;
    letter-spacing: -.02em;
}

.space-listing-body p {
    margin: 0;
    color: var(--space-muted);
    line-height: 1.6;
}

.space-meta-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.space-meta-grid span {
    display: flex;
    gap: 6px;
    align-items: center;
    min-width: 0;
    color: var(--space-muted);
    font-size: 13px;
}

.space-meta-grid b {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--space-text);
}

.space-feature-row {
    margin-top: 12px;
}

.space-listing-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    justify-content: center;
}

.space-listing-actions strong {
    color: var(--space-primary);
    font-size: 13px;
    text-align: center;
}

.space-listing-actions a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #fff;
    background: var(--space-primary);
    font-weight:600;
}

.space-side-panel,
.space-detail-side {
    display: grid;
    gap: 12px;
}

.space-guide-card,
.space-contact-card {
    padding: 20px;
    box-shadow: none;
}

.space-guide-card a {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 12px;
    border: 1px solid var(--space-line);
    border-radius: 10px;
    background: var(--space-surface-strong);
    margin-top: 8px;
    color: var(--space-text);
    font-weight:600;
}

.space-guide-card.accent {
    border-color: color-mix(in srgb, var(--space-primary) 26%, var(--space-line));
    background: linear-gradient(180deg, var(--space-primary-weak), var(--space-surface));
}

.space-map-preview,
.space-map-canvas {
    min-height: 360px;
    border: 1px solid var(--space-line);
    border-radius: 18px;
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--space-line) 50%, transparent) 1px, transparent 1px),
        linear-gradient(color-mix(in srgb, var(--space-line) 50%, transparent) 1px, transparent 1px),
        var(--space-surface);
    background-size: 42px 42px;
    position: relative;
    display: grid;
    place-items: center;
    color: var(--space-muted);
}

.space-map-canvas.detail {
    min-height: 260px;
}

.pin {
    position: absolute;
    padding: 8px 10px;
    border-radius: 9px;
    background: var(--space-primary);
    color: #fff;
    font-size: 12px;
    font-weight:700;
}

.pin-one { left: 18%; top: 24%; }
.pin-two { right: 18%; top: 42%; }
.pin-three { left: 42%; bottom: 22%; }

.space-empty {
    padding: 44px;
    border: 1px dashed var(--space-line);
    border-radius: 16px;
    color: var(--space-muted);
    text-align: center;
    background: var(--space-surface);
}

.space-breadcrumb {
    margin-bottom: 16px;
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--space-muted);
    font-size: 14px;
}

.space-detail-visual {
    min-height: 320px;
}

.space-detail-copy {
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.space-detail-main {
    display: grid;
    gap: 14px;
}

.space-detail-card {
    padding: 22px;
    box-shadow: none;
}

.space-spec-grid,
.space-nearby-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.space-spec-grid div,
.space-nearby-grid div {
    padding: 14px;
    border: 1px solid var(--space-line);
    border-radius: 12px;
    background: var(--space-surface-strong);
}

.space-spec-grid strong,
.space-nearby-grid strong {
    display: block;
    margin-top: 6px;
}

.space-nearby-grid p {
    margin: 6px 0 0;
    color: var(--space-muted);
    font-size: 13px;
    line-height: 1.6;
}

.space-check-list {
    display: grid;
    gap: 10px;
}

.space-check-list > div {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--space-line);
    border-radius: 12px;
    background: var(--space-surface-strong);
}

.space-check-list i {
    color: var(--space-primary);
    font-size: 22px;
}

.space-check-list span {
    display: block;
    margin-top: 4px;
    color: var(--space-primary);
    font-weight:600;
}

.space-check-list p {
    margin: 4px 0 0;
    color: var(--space-muted);
    line-height: 1.6;
}

.space-feature-row.large span {
    min-height: 38px;
    padding: 0 13px;
}

.space-detail-card h3 {
    margin: 22px 0 0;
    font-size: 16px;
}

.space-contact-card {
    background: linear-gradient(180deg, var(--space-primary-weak), var(--space-surface));
}

.space-contact-card > span {
    color: var(--space-primary);
    font-weight:700;
}

.space-contact-card a {
    width: 100%;
    margin-top: 10px;
}

.space-mobile-bottom {
    display: none;
}

@media (max-width: 980px) {
    .space-nav { display: none; }
    .space-hero,
    .space-detail-hero,
    .space-layout,
    .space-detail-grid {
        grid-template-columns: 1fr;
    }
    .space-filter-grid,
    .space-metrics {
        grid-template-columns: 1fr;
    }
    .space-listing-card {
        grid-template-columns: 110px minmax(0, 1fr);
    }
    .space-listing-actions {
        grid-column: 1 / -1;
        flex-direction: row;
    }
    .space-listing-actions a,
    .space-listing-actions button {
        flex: 1;
    }
}

@media (max-width: 640px) {
    .space-header-inner,
    .space-shell {
        padding-left: 14px;
        padding-right: 14px;
    }
    .space-header-actions a:first-child { display: none; }
    .space-hero-copy,
    .space-hero-panel,
    .space-detail-copy,
    .space-detail-card,
    .space-contact-card,
    .space-guide-card {
        border-radius: 14px;
        padding: 18px;
    }
    .space-hero-copy h1,
    .space-detail-copy h1 {
        font-size: 30px;
    }
    .space-listing-card {
        grid-template-columns: 1fr;
    }
    .space-listing-visual {
        min-height: 120px;
    }
    .space-meta-grid,
    .space-spec-grid,
    .space-nearby-grid {
        grid-template-columns: 1fr;
    }
    .space-section-head {
        align-items: stretch;
        flex-direction: column;
    }
    .space-mobile-bottom {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 40;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        border-top: 1px solid var(--space-line);
        background: color-mix(in srgb, var(--space-surface) 94%, transparent);
        backdrop-filter: blur(18px);
    }
    .space-mobile-bottom a {
        min-height: 58px;
        display: grid;
        place-items: center;
        align-content: center;
        gap: 2px;
        color: var(--space-muted);
        font-size: 11px;
    }
    .space-mobile-bottom a.active {
        color: var(--space-primary);
        font-weight:600;
    }
}
