:root {
    --bg: #eef3f8;
    --surface: #ffffff;
    --line: #d6e1ee;
    --text: #11233b;
    --muted: #5d708d;
    --primary: #1460c9;
    --primary-soft: #e8f1ff;
    --danger: #a63434;
    --shadow: 0 12px 28px rgba(15, 35, 62, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body.real-estate-page {
    background: var(--bg);
    color: var(--text);
    font-family: 'IBM Plex Sans KR', 'Pretendard', sans-serif;
}

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

.is_blind {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.estate-topbar {
    border-bottom: 1px solid var(--line);
    background: #f8fbff;
}

.estate-topbar-inner {
    width: min(1280px, calc(100% - 24px));
    margin: 0 auto;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.estate-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.estate-brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #0f3f86 0%, #1460c9 100%);
}

.estate-brand-text {
    font-family: 'Space Grotesk', 'IBM Plex Sans KR', sans-serif;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.estate-topbar-desc {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.estate-main {
    width: min(1280px, calc(100% - 24px));
    margin: 0 auto;
    padding: 16px 0 24px;
    display: grid;
    gap: 12px;
}

.estate-detail-main {
    grid-template-columns: minmax(0, 1.5fr) minmax(340px, 1fr);
    align-items: start;
}

.estate-detail-left {
    display: grid;
    gap: 12px;
}

.estate-detail-map-pane {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
    position: sticky;
    top: 12px;
    overflow: hidden;
}

.estate-table-wrap {
    overflow: auto;
}

.estate-data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.estate-data-table th,
.estate-data-table td {
    border: 1px solid #e0eaf6;
    padding: 8px 9px;
    font-size: 0.77rem;
    text-align: left;
    color: #2f4f73;
    white-space: nowrap;
}

.estate-data-table th {
    background: #f4f9ff;
    color: #26456a;
    font-weight: 700;
}

.year-table-section {
    border: 1px solid #dce6f3;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    margin-top: 10px;
}

.year-table-section:first-child {
    margin-top: 0;
}

.year-table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid #e4edf8;
    background: #f8fbff;
}

.year-table-head h4 {
    margin: 0;
    color: #21466f;
    font-size: 0.84rem;
    font-weight: 700;
}

.year-table-head h4 span {
    color: #5d7291;
    font-size: 0.76rem;
    font-weight: 600;
    margin-left: 4px;
}

.year-more-btn {
    border: 1px solid #c6d8ef;
    border-radius: 7px;
    background: #f2f7ff;
    color: #285d99;
    font-size: 0.73rem;
    font-weight: 700;
    line-height: 1;
    padding: 6px 10px;
    cursor: pointer;
}

.year-more-btn:hover {
    border-color: #9dbde5;
    background: #eaf3ff;
}

.search-panel {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 14px;
}

.search-panel h1 {
    margin: 0;
    font-size: 1.3rem;
    letter-spacing: -0.01em;
}

.estate-search-form {
    margin-top: 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.estate-search-form input {
    height: 46px;
    border: 1px solid #cfddf1;
    border-radius: 10px;
    padding: 0 13px;
    font-size: 0.96rem;
    color: #0f2240;
    background: #fcfeff;
}

.estate-search-form input:focus {
    outline: none;
    border-color: #7eaef0;
    box-shadow: 0 0 0 3px rgba(126, 174, 240, 0.28);
}

.estate-search-form button {
    height: 46px;
    border: 0;
    border-radius: 10px;
    padding: 0 16px;
    background: var(--primary);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}

.search-feedback {
    margin: 8px 0 0;
    min-height: 18px;
    color: #325684;
    font-size: 0.86rem;
}

.estate-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr);
    gap: 12px;
    align-items: start;
}

.map-pane,
.list-pane,
.detail-pane {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.map-pane {
    display: grid;
    grid-template-rows: auto auto;
    align-content: start;
}

.side-pane {
    display: grid;
    grid-template-rows: auto minmax(320px, 1fr);
    gap: 12px;
    min-height: 0;
}

.pane-head {
    border-bottom: 1px solid #e3eaf4;
    padding: 10px 12px;
}

.pane-head h2 {
    margin: 0;
    font-size: 1rem;
    color: #173a64;
}

.search-result-meta,
.map-status {
    margin: 4px 0 0;
    color: #5b7090;
    font-size: 0.8rem;
}

.estate-map {
    width: min(100%, 760px);
    aspect-ratio: 1 / 1;
    height: auto !important;
    min-height: 0;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #edf5ff 0%, #e2eeff 100%);
}

#estate-detail-map {
    width: calc(100% - 24px);
    max-width: 100%;
    margin: 10px 12px 12px;
    border: 1px solid #dce6f3;
    border-radius: 12px;
    max-height: min(56vh, 520px);
    min-height: 280px;
}

.estate-detail-image-panel {
    margin: 8px 0 10px;
    border: 1px solid #dce6f3;
    border-radius: 12px;
    background: #f8fbff;
    overflow: hidden;
}

.estate-detail-image-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.estate-detail-image {
    width: 100%;
    display: block;
    max-height: 220px;
    object-fit: cover;
    background: #e8f0fd;
}

.estate-detail-image-meta {
    display: grid;
    gap: 3px;
    padding: 8px 9px;
}

.estate-detail-image-title {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    color: #1d3f68;
    line-height: 1.35;
    display: none;
}

.estate-detail-image-source {
    margin: 0;
    font-size: 0.74rem;
    color: #59708f;
    display: none;
}

.estate-detail-image-loading {
    margin: 0;
    font-size: 0.74rem;
    color: #59708f;
}

#estate-map .ol-viewport,
#estate-map .ol-overlaycontainer-stopevent,
#estate-map .ol-overlaycontainer,
#estate-detail-map .ol-viewport,
#estate-detail-map .ol-overlaycontainer-stopevent,
#estate-detail-map .ol-overlaycontainer {
    width: 100% !important;
    height: 100% !important;
}

.list-pane {
    display: grid;
    grid-template-rows: auto auto auto auto;
    min-height: 0;
}

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

.result-state {
    border: 1px solid #dbe6f5;
    border-radius: 10px;
    background: #f7fbff;
    padding: 10px 11px;
    color: #4b6488;
    font-size: 0.85rem;
    margin: 8px 12px 0;
}

.result-state-error {
    border-color: #efcfcf;
    background: #fff5f5;
    color: var(--danger);
}

.global-loading-overlay[hidden] {
    display: none !important;
}

.global-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    background: rgba(8, 18, 33, 0.36);
    backdrop-filter: blur(1.5px);
    display: grid;
    place-items: center;
    padding: 18px;
}

.global-loading-overlay__panel {
    width: min(92vw, 360px);
    border: 1px solid #d4e3f8;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 16px 36px rgba(9, 31, 60, 0.24);
    padding: 18px 16px;
    display: grid;
    justify-items: center;
    gap: 10px;
    text-align: center;
}

.global-loading-overlay__blocks {
    display: grid;
    grid-template-columns: repeat(2, 12px);
    grid-template-rows: repeat(2, 12px);
    gap: 6px;
}

.global-loading-overlay__blocks span {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: #d3e3f8;
    animation: overlay-blocks 1s ease-in-out infinite;
}

.global-loading-overlay__blocks span:nth-child(1) {
    animation-delay: 0s;
}

.global-loading-overlay__blocks span:nth-child(2) {
    animation-delay: 0.16s;
}

.global-loading-overlay__blocks span:nth-child(3) {
    animation-delay: 0.32s;
}

.global-loading-overlay__blocks span:nth-child(4) {
    animation-delay: 0.48s;
}

.global-loading-overlay__message {
    margin: 0;
    color: #23466d;
    font-size: 0.88rem;
    line-height: 1.45;
    white-space: pre-line;
}

@keyframes overlay-blocks {
    0%, 100% {
        background: #d3e3f8;
        transform: scale(1);
    }
    50% {
        background: #1c63be;
        transform: scale(1.08);
    }
}

.result-list {
    padding: 8px 12px 12px;
    display: grid;
    gap: 8px;
    overflow: visible;
    min-height: 0;
}

.result-card {
    border: 1px solid #dce6f3;
    border-radius: 10px;
    background: #fff;
    padding: 10px;
    display: grid;
    gap: 6px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.result-card:hover {
    border-color: #99bcea;
    box-shadow: 0 8px 16px rgba(16, 55, 104, 0.1);
}

.result-card.is-selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(20, 96, 201, 0.13);
}

.result-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.result-card-header h3 {
    margin: 0;
    font-size: 0.95rem;
    color: #183862;
}

.result-card-dong {
    margin-left: 6px;
    color: #2e5f9b;
    font-size: 0.78rem;
    font-weight: 600;
}

.result-detail-link {
    border: 1px solid #0f4ea8;
    border-radius: 999px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #0f58bd 0%, #2a84ec 100%);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 6px 14px rgba(20, 96, 201, 0.26);
    transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}

.result-detail-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 9px 18px rgba(20, 96, 201, 0.33);
    filter: brightness(1.03);
}

.result-address,
.result-road,
.result-zipcode,
.result-card-cta {
    margin: 0;
    color: #516683;
    font-size: 0.8rem;
}

.result-card-cta {
    color: #2e5f9b;
    font-weight: 600;
}

.result-actions {
    padding: 0 12px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.result-page-btn {
    height: 34px;
    min-width: 64px;
    border-radius: 8px;
    border: 1px solid #c4d7f2;
    background: #f2f7ff;
    color: #1f4f95;
    padding: 0 12px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.result-page-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.result-page-indicator {
    min-width: 58px;
    text-align: center;
    color: #516886;
    font-size: 0.82rem;
    font-weight: 700;
}

.detail-pane {
    grid-template-rows: auto auto auto minmax(0, 1fr);
}

.detail-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 8px 12px;
}

.detail-summary-card {
    border: 1px solid #dce6f3;
    border-radius: 8px;
    background: #f7fbff;
    padding: 8px;
}

.detail-summary-card span {
    display: block;
    font-size: 0.7rem;
    color: #617392;
}

.detail-summary-card strong {
    display: block;
    margin-top: 2px;
    font-size: 0.8rem;
    color: #1c3e68;
}

.detail-summary-card a {
    display: inline-block;
    border: 1px solid #0f4ea8;
    border-radius: 999px;
    padding: 5px 11px;
    background: #f0f7ff;
    color: #0f4ea8;
    font-weight: 700;
    text-decoration: none;
}

.detail-data-grid {
    padding: 8px 12px 12px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    overflow: auto;
    min-height: 0;
}

.detail-panel {
    border: 1px solid #dce6f3;
    border-radius: 10px;
    background: #fff;
    padding: 9px;
}

.detail-panel h3 {
    margin: 0 0 7px;
    color: #183a64;
    font-size: 0.9rem;
}

.detail-panel-meta {
    margin: 0 0 8px;
    color: #567094;
    font-size: 0.78rem;
}

.detail-kv-list {
    border: 1px solid #e2eaf6;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.detail-kv-row {
    display: grid;
    grid-template-columns: minmax(110px, 0.9fr) minmax(0, 1.6fr);
    border-bottom: 1px solid #edf2fa;
}

.detail-kv-row:last-child {
    border-bottom: 0;
}

.detail-kv-key {
    padding: 8px 9px;
    background: #f7fbff;
    color: #38587f;
    font-size: 0.76rem;
    font-weight: 700;
}

.detail-kv-value {
    padding: 8px 9px;
    color: #345375;
    font-size: 0.76rem;
    line-height: 1.5;
    word-break: break-word;
}

.detail-chart {
    border: 1px solid #e1eaf7;
    border-radius: 10px;
    background: #fbfdff;
    padding: 9px 9px 6px;
    margin-bottom: 8px;
    min-height: 250px;
}

.detail-chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.detail-chart-head strong {
    color: #21486f;
    font-size: 0.78rem;
    letter-spacing: -0.01em;
}

.detail-chart-legend {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-chart-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #5d7291;
    font-size: 0.7rem;
}

.detail-chart-legend-item i {
    width: 12px;
    height: 3px;
    border-radius: 999px;
    display: inline-block;
}

.detail-chart-svg {
    width: 100%;
    height: auto;
    display: block;
}

.detail-chart-canvas {
    width: 100% !important;
    height: 230px !important;
    display: block;
}

.detail-chart-empty {
    border: 1px dashed #d5e2f1;
    border-radius: 8px;
    background: #f9fcff;
    padding: 12px;
    color: #60779a;
    font-size: 0.8rem;
}

.detail-list {
    display: grid;
    gap: 6px;
}

.detail-item {
    border: 1px solid #e3eaf5;
    border-radius: 8px;
    background: #f8fbff;
    padding: 8px;
}

.detail-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #5d7190;
    font-size: 0.75rem;
}

.detail-item-price {
    margin-top: 3px;
    color: #1b3f6a;
    font-size: 0.83rem;
    font-weight: 700;
}

.detail-item-meta {
    margin-top: 2px;
    color: #5b6f8d;
    font-size: 0.74rem;
}

.detail-item-actions {
    margin-top: 7px;
    display: flex;
    justify-content: flex-end;
}

.trade-dev-detail-btn {
    border: 1px solid #c5d7ef;
    border-radius: 7px;
    background: #f2f7ff;
    color: #275a98;
    font-size: 0.73rem;
    font-weight: 700;
    line-height: 1;
    padding: 6px 9px;
    cursor: pointer;
    white-space: nowrap;
}

.trade-dev-detail-btn:hover {
    border-color: #9dbce3;
    background: #e9f2ff;
}

.trade-dev-detail-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

.detail-empty {
    border: 1px dashed #cfdced;
    border-radius: 8px;
    background: #f8fbff;
    padding: 12px;
    color: #5b7090;
    font-size: 0.82rem;
}

.estate-map-popup {
    font-family: 'IBM Plex Sans KR', sans-serif;
}

body.trade-dev-modal-open {
    overflow: hidden;
}

.trade-dev-modal {
    position: fixed;
    inset: 0;
    background: rgba(16, 29, 46, 0.44);
    z-index: 9999;
    padding: 24px 12px;
    display: grid;
    place-items: center;
}

.trade-dev-modal[hidden] {
    display: none !important;
}

.trade-dev-modal__panel {
    width: min(860px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    border: 1px solid #d4e1f1;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(13, 28, 49, 0.28);
}

.trade-dev-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid #e4edf7;
    padding: 12px 14px;
}

.trade-dev-modal__head strong {
    color: #203f66;
    font-size: 0.95rem;
}

.trade-dev-modal__close {
    border: 1px solid #c7d8ef;
    border-radius: 8px;
    background: #f4f8ff;
    color: #2e5c98;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px 10px;
    cursor: pointer;
}

.trade-dev-modal__body {
    padding: 12px 14px 14px;
}

.trade-dev-modal__summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 9px;
}

.trade-dev-kv-list {
    max-height: 58vh;
    overflow: auto;
}

.reveal-item {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.reveal-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1100px) {
    .estate-workspace {
        grid-template-columns: 1fr;
    }

    .estate-detail-main {
        grid-template-columns: 1fr;
    }

    .map-pane,
    .side-pane {
        min-height: 0;
    }

    .estate-detail-map-pane {
        position: static;
    }

    #estate-detail-map {
        max-height: min(68vw, 520px);
    }

    .side-pane {
        grid-template-rows: auto auto;
    }

    .list-pane {
        min-height: 0;
    }

    .detail-pane {
        min-height: 320px;
    }
}

@media (max-width: 720px) {
    .estate-main,
    .estate-topbar-inner {
        width: min(1280px, calc(100% - 14px));
    }

    .estate-topbar-inner {
        min-height: 58px;
        flex-wrap: wrap;
        justify-content: flex-start;
        padding: 7px 0;
    }

    .estate-topbar-desc {
        font-size: 0.78rem;
    }

    .search-panel,
    .map-pane,
    .list-pane,
    .detail-pane,
    .estate-detail-map-pane {
        border-radius: 10px;
    }

    #estate-detail-map {
        width: calc(100% - 16px);
        margin: 8px 8px 10px;
        min-height: 240px;
        max-height: min(78vw, 430px);
        border-radius: 10px;
    }

    .estate-detail-image-panel {
        margin: 8px 0 10px;
    }

    .estate-search-form {
        grid-template-columns: 1fr;
    }

    .estate-search-form button {
        width: 100%;
    }

    .detail-summary-grid {
        grid-template-columns: 1fr;
    }

    .detail-chart-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .detail-kv-row {
        grid-template-columns: 1fr;
    }

    .trade-dev-modal {
        padding: 12px 8px;
    }

    .trade-dev-modal__summary {
        grid-template-columns: 1fr;
    }

}
