.theme-toggle{display:inline-flex;gap:6px;flex-shrink:0;width:112px;height:36px;line-height:1;align-items:center;justify-content:center;min-height:36px;padding:6px 10px!important;border:1px solid var(--line)!important;border-radius:7px;background:var(--paper)!important;color:var(--muted);white-space:nowrap;font-size:13px;letter-spacing:0;cursor:pointer}
:root[data-theme=dark]{color-scheme:dark;--green:#aec5fa;--ink:#e3eaf7;--muted:#b1bdd1;--line:#354157;--paper:#1b2434;--accent:#dfb775;color:#e3eaf7;background:#111827}
[data-theme=dark] body{background:#111827;color:#e3eaf7}
[data-theme=dark] :is(.site-header,.header,.summary-strip,.map-panel,.detail-panel,.leader-section,.map-bottom,.reference-panel,.region-result,.region-candidates,.panel,.detail,.trade-dialog,.trade-panel,.trade-dialog-head){background:#1b2434;color:#e3eaf7;border-color:#354157}
[data-theme=dark] .map-stage{background:radial-gradient(ellipse at 50% 44%,#202c40 10%,#172131 85%)}
[data-theme=dark] :is(.area-pill,.preview-tag,.metric-chips span,.metric-chips button,.view-switch,.trade-close,.trade-pages button,.legend-bin,.map-hint,.map-zoom,.icon-button,.location-button,.theme-toggle,.map-status){background:#263247!important;color:#dce6f8;border-color:#46536a!important}
[data-theme=dark] :is(.view-switch button[aria-pressed=true],.legend-bin[aria-pressed=true],.local-region.active,.local-region:hover,.region-select:hover){background:#334462;color:#fff;border-color:#9ab8f1}
[data-theme=dark] :is(.summary-help,.gap-relative-note,.snapshot,.eyebrow,.detail-subtitle,.leader-caption,.period-range,.latest-trade,.top-list small,.detail-footnote,.map-subtitle,.map-caption,.map-hint,.section-heading a,.after-workspace,.site-footer,.summary-action,.legend-heading,.legend-bin,.legend-count-unit,.reference-grid p,.reference-note,.source-details p,.trend-details,.trade-note,.trade-row-meta,.trade-source-info,#trade-context,.trade-kind,.list-apartment,.region-select small,.region-content p){color:#b1bdd1}
[data-theme=dark] :is(.legend-bin strong,.rank-price strong,.trade-row-main strong,.brand,.region-select strong,.region-select b,#stat-mean){color:#e3eaf7}
[data-theme=dark] :is(#stat-top,#stat-gap,.big-price){color:color-mix(in srgb,var(--price-ink,var(--gap-ink,#aec5fa)),white 50%)}
[data-theme=dark] .price-trend{color:#b1bdd1}[data-theme=dark] .trend-up{color:#ff9ca8}[data-theme=dark] .trend-down{color:#99c7ff}
[data-theme=dark] .map-label .label-plate{fill:#172131;stroke:#7485a0;fill-opacity:.74}
[data-theme=dark] .map-label:is(.active,:hover,.hover) .label-plate{fill:#22334d;stroke:#b8cdf4}
[data-theme=dark] .map-label text{fill:#eef3fc}[data-theme=dark] .map-label .label-apartment{fill:#c2cfe3}
[data-theme=dark] .map-trend-up{fill:#ff9ca8}[data-theme=dark] .map-trend-down{fill:#99c7ff}[data-theme=dark] .map-trend-flat{fill:#b1bdd1}
[data-theme=dark] .district-path{stroke:#28374e}[data-theme=dark] .local-shape.active .district-path{stroke:#f1c778}[data-theme=dark] .district-path.no-price{fill:#39465b}
[data-theme=dark] :is(.trade-dialog th,.trade-dialog td.trade-apartment){background:#263247;color:#dce6f8}
[data-theme=dark] :is(.trade-dialog th,.trade-dialog td,.trade-inline-list>li,.ranking-column-head,.local-region){border-color:#354157}
[data-theme=dark] :is(.trade-count,.region-page-link,.region-map-link,.summary-label span){color:#b7ccf5}
[data-theme=dark] .rank-crown{color:#e6bd76}
[data-theme=dark] .summary-item:is(button):hover{background:#263247}
@media(max-width:760px){.header-links{gap:10px;flex-wrap:wrap;justify-content:flex-end}.theme-toggle{font-size:12px;width:104px;height:32px;min-height:32px}.header-inner{gap:12px}.theme-toggle{padding:5px 7px!important}}

[data-theme=dark] :is(.rank-name,.region-result h3,.region-candidates h3,.ranking-column-head){color:#e3eaf7}
[data-theme=dark] .region-children a:hover{background:#263247}
[data-theme=dark] .atlas-pages .region-content a:not(.brand){color:#b7ccf5}

.theme-toggle svg{width:16px;height:16px;flex:0 0 16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.header-links .theme-toggle span{margin:0;color:inherit}
:root[data-theme="dark"] .apartment-info,:root[data-theme="dark"] .apartment-info-source summary,:root[data-theme="dark"] .rank-apartment-info{color:#a9b9d1}
:root[data-theme="dark"] .apartment-info .apartment-address{color:#e1e9f6}
:root[data-theme="dark"] .rank-apartment-info>summary{color:#cad8ee;background:#283750;border-color:#455570}
:root[data-theme="dark"] .rank-apartment-info>summary:hover{background:#344660}
:root[data-theme="dark"] .rank-apartment-info .apartment-info{background:#172336;border-color:#394b67}

/* 밝은 화면은 흰색 바탕과 옅은 중립색 조작부를 사용한다. */
:root:not([data-theme=dark]){--page-bg:#fff;--paper:#fff;--soft-surface:#fdfdfd;--line:#ededed;background:var(--page-bg)}
:root:not([data-theme=dark]) body{background:var(--page-bg)}
:root:not([data-theme=dark]) :is(.site-header,.summary-strip,.map-panel,.map-bottom,.detail-panel,.detail-top,.leader-section,.detail-section,.reference-panel,.region-result,.region-candidates,.trade-dialog,.trade-panel,.trade-panel-body,.trade-dialog-head,.trade-panel .trade-dialog-head,.detail-section>.section-heading,.legend-bin){background:var(--paper)}
:root:not([data-theme=dark]) .map-stage{background:var(--page-bg)}
:root:not([data-theme=dark]) :is(.view-switch,.metric-chips span,.metric-chips button,.trade-close,.trade-pages button,.trade-dialog th,.trade-dialog td.trade-apartment,.map-hint,.map-zoom,.icon-button,.location-button,.theme-toggle,.map-status,.trade-inline){background:var(--soft-surface);border-color:var(--line)}
:root:not([data-theme=dark]) :is(.summary-item:is(button):hover,.legend-bin:hover,.local-region:hover){background:var(--soft-surface)}

:root .theme-toggle.theme-toggle{background:var(--paper)!important;border-color:var(--line)!important;color:var(--muted)}
:root:not([data-theme=dark]) .theme-toggle:hover{background:var(--soft-surface)!important;color:var(--ink)}
:root[data-theme=dark] .theme-toggle:hover{background:#263247!important;color:var(--ink)}
:root .detail-panel .section-heading>a{color:var(--muted)}
:root .detail-panel .region-page-link{color:#354f7d;text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px}
:root .detail-panel .region-page-link:hover{color:#354f7d;text-decoration-thickness:2px}
:root[data-theme=dark] .detail-panel .region-page-link{color:#b7ccf5}
:root[data-theme=dark] .detail-panel .region-page-link:hover{color:#b7ccf5}

:root{--detail-link-color:#354f7d}
:root[data-theme=dark]{--detail-link-color:#b7ccf5}
:root .detail-panel :is(a.region-page-link,.leader-facts .trade-count){color:var(--detail-link-color)}

/* 탐색 상태 안내는 본문보다 분명한 배경으로 구분한다. */
:root:not([data-theme=dark]) :is(.scope-coverage,#location-status,#data-status){background:#edf3fb!important;border:1px solid #cddbef!important;color:#354f73}
:root[data-theme=dark] :is(.scope-coverage,#location-status,#data-status){background:#283951!important;border:1px solid #4b6283!important;color:#d5e2f6}
:root :is(.scope-coverage,#location-status,#data-status){font-size:14px;line-height:1.6;font-weight:400}

/* 탐색 버튼: 주요 동작은 남색, 선택 상태와 보조 동작은 파란 계열. */
:root{--button-primary:#263c64;--button-primary-hover:#1c2f52;--button-primary-text:#fff;--button-soft:#edf3fb;--button-soft-hover:#dfeafa;--button-border:#c5d5ed;--button-text:#354f7d}
:root[data-theme=dark]{--button-primary:#42649a;--button-primary-hover:#4c73af;--button-primary-text:#fff;--button-soft:#283951;--button-soft-hover:#324967;--button-border:#4b6283;--button-text:#d5e2f6}
:root .local-navigation button{background:var(--button-primary);color:var(--button-primary-text)}
:root .local-navigation button:hover{background:var(--button-primary-hover)}
:root .scope-tabs button[aria-pressed=true]{background:var(--button-primary);border-color:var(--button-primary);color:var(--button-primary-text)}
:root .scope-tabs button[aria-pressed=true]:hover{background:var(--button-primary-hover);border-color:var(--button-primary-hover)}
:root .location-button{background:var(--paper)!important;border:1px solid var(--line)!important;color:var(--muted)}
:root .location-button:not(:disabled):hover{background:var(--soft-surface)!important;color:var(--ink)}
:root #clear-filter{background:var(--button-soft);border:1px solid var(--button-border);border-radius:5px;padding:3px 8px;color:var(--button-text)}
:root #clear-filter:hover{background:var(--button-soft-hover)}
:root .theme-toggle.theme-toggle{background:var(--paper)!important;border-color:var(--line)!important;color:var(--muted)}
:root .theme-toggle.theme-toggle:hover{background:var(--soft-surface)!important;color:var(--ink)}
:root[data-theme=dark] :is(.location-button:not(:disabled):hover,.theme-toggle.theme-toggle:hover){background:#263247!important}

/* 지도 도구는 같은 높이·테두리·중립색을 공유한다. */
:root .map-tools .view-switch{height:40px;padding:3px;gap:0;border:1px solid var(--line)!important;border-radius:6px;background:var(--paper)!important;color:var(--muted)}
:root .map-tools .view-switch button{height:32px;min-height:32px;padding:0 10px;border-radius:4px;font-size:13px;line-height:1;font-weight:600;background:transparent;color:var(--muted);box-shadow:none}
:root .map-tools .view-switch button[aria-pressed=true]{background:var(--button-primary);color:var(--button-primary-text)}
:root .map-tools .view-switch button[aria-pressed=true]:hover{background:var(--button-primary-hover)}
:root .map-tools .view-switch button[aria-pressed=false]:hover{background:var(--soft-surface);color:var(--ink)}
:root .map-tools .location-button{height:40px;min-height:40px;padding:0 12px;border-radius:6px;font-size:13px;line-height:1;font-weight:600}
:root[data-theme=dark] .map-tools .view-switch button[aria-pressed=false]:hover{background:#263247}

[data-theme=dark] .trend-flat{color:#b1bdd1}

[data-theme=dark] .map-flat-icon{stroke:#b1bdd1}
