:root {
  color-scheme: light;
  --ink: #182c39;
  --sub: #495e6b;
  --muted: #596d78;
  --blue: #154f9f;
  --navy: #173958;
  --mint: #c8e5ff;
  --wash: #f2f5f7;
  --line: #dce3e6;
  --paper: #f7f8f6;
  --radius: 12px;
  --shadow: 0 3px 15px #26395c14;
  --gutter: clamp(18px, 2vw, 30px);
  font-family: Pretendard, Inter, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  word-break: keep-all;
}
@font-face {
  font-family: Pretendard;
  src: url('./assets/PretendardVariable.woff2') format('woff2');
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
}
* { box-sizing: border-box; }
body { margin: 0; display: flex; flex-direction: column; height: 100vh; height: 100dvh; background: white; }
button, input, select, summary { font: inherit; color: inherit; }
button, select, summary { cursor: pointer; }
button { border: 0; background: none; }
button, select, summary { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); text-underline-offset: 3px; }
h1, h2, h3, p, dl, dd, ul { margin: 0; }
h1, h2, h3, strong { letter-spacing: -.045em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #466de9; outline-offset: -3px; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; z-index: 2000; transform: translateY(-150%); background: white; padding: 10px; }
.skip:focus { transform: none; }
.topbar {
  flex: none; position: relative; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  gap: 24px; padding: 0 var(--gutter); height: 66px; background: white; color: var(--ink); border-bottom: 1px solid var(--line);
}
.topbar h1, .top-meta { display: flex; align-items: center; gap: 12px; }
.topbar h1, .brand-link { font-size: 21px; font-weight: 800; letter-spacing: -.065em; white-space: nowrap; }
.brand-link { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { display: block; flex: none; width: 36px; height: 36px; }
.main-nav { display: flex; align-self: stretch; gap: 6px; margin-right: auto; }
.main-nav a { display: grid; place-items: center; padding: 2px 14px 0; border-bottom: 3px solid transparent; color: var(--sub); font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.main-nav a[aria-current] { border-color: var(--blue); color: var(--blue); }
.main-nav a:hover { background: var(--wash); }
.top-meta { gap: 20px; }
.updated { color: var(--muted); font-size: 12px; }
.updated time { margin-left: 5px; color: var(--ink); }
#guide-open { display: flex; align-items: center; gap: 7px; min-height: 44px; font-size: 13px; font-weight: 650; }
#guide-open::before { content: 'i'; color: var(--blue); font: 700 11px Georgia,serif; border: 1px solid currentColor; border-radius: 50%; width: 16px; height: 16px; text-align: center; line-height: 16px; }
.legend ul { border: 1px solid var(--line); background: white; color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); }
.workspace { display: grid; grid-template-columns: clamp(320px, 29vw, 410px) minmax(0, 1fr); flex: 1; min-height: 0; }
#explorer { min-height: 0; min-width: 0; display: flex; flex-direction: column; background: white; border-right: 1px solid #cfd9e3; }
#panel-content, #list-view, #detail-view { display: flex; min-height: 0; flex: 1; flex-direction: column; }
.sheet-tools { display: none; }
.area-cover, .news-masthead { color: white; background: var(--navy) linear-gradient(100deg,#0c283fe8 0%,#0f2d46a8 44%,#0f293848 100%); position: relative; isolation: isolate; overflow: hidden; }
.area-cover::before, .news-masthead::before { position: absolute; inset: 0; content: ''; z-index: -2; background: url('./assets/seoul-panorama.webp?v=a75f093bfeac') center 58% / cover no-repeat; }
.area-cover::after, .news-masthead::after { position: absolute; inset: 0; content: ''; z-index: -1; background: linear-gradient(93deg,#0b243ae8,#18364e9c 55%,#30435536); }
.area-cover { flex: none; display: flex; align-items: end; min-height: clamp(100px,16vh,155px); }
.cover-copy { padding: 22px var(--gutter); }
.cover-copy h2 { font-size: clamp(25px,2.25vw,34px); line-height: 1.2; letter-spacing: -.065em; }
.cover-copy p { margin-top: 6px; font-size: 13px; color: #f2f6f9; font-weight: 600; }
.search-block { padding: 15px var(--gutter) 9px; }
.search-box { display: flex; align-items: center; gap: 12px; background: var(--wash); border: 1px solid #cdd7e5; padding: 0 13px; border-radius: 10px; }
.search-box:focus-within { outline: 2px solid var(--blue); outline-offset: -1px; background: white; }
.tool-icon { width: 17px; height: 17px; flex: none; vertical-align: -.2em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.source-link .tool-icon { width: 13px; height: 13px; margin-inline-start: .25em; }
.term-emoji { display: inline-block; margin-inline-end: .32em; font-weight: normal; }
.stage-badge.has-term-icon::before { display: none; }
.stage-badge.has-term-icon .term-emoji { margin: 0; }
.search-box .tool-icon { color: var(--sub); }
#measure .tool-icon,#address-open .tool-icon,.pilot-entry .tool-icon,.pilot-text-button .tool-icon { margin-inline-end: .35em; }
.search-box input { width: 100%; min-width: 0; height: 44px; background: none; border: none; font-size: 14px; outline: none; }
.search-box input::placeholder { color: var(--muted); }
.filter-row, .results-head { display: flex; align-items: center; justify-content: space-between; }
.filter-row { margin-top: 8px; font-size: 13px; color: var(--sub); }
.filter-row select { min-height: 40px; padding: 4px 8px; font-weight: 650; border: 0; background-color: white; color: var(--ink); }
.results-head { flex: none; padding: 10px var(--gutter); background: var(--wash); border-block: 1px solid var(--line); font-size: 13px; }
.results-head h3 { font-size: inherit; }
.filter-row { position: relative; justify-content: flex-start; gap: 8px; }
.filter-row select,.stage-filters summary { border: 1px solid var(--line); border-radius: 8px; background: white; min-height: 40px; padding: 7px 12px; font-size: 14px; font-weight: 650; }
.stage-filters summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stage-filters summary::after { content: ''; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); margin-top: -3px; }
.stage-filters[open] summary,.stage-filters:has([aria-pressed=true]:not([value=""])) summary { color: var(--blue); border-color: var(--blue); }
.filter-menu { position: absolute; z-index: 6; left: 0; right: 0; top: calc(100% + 5px); min-width: 240px; max-height: 55dvh; overflow: auto; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 6px 24px #172f5526; }
.filter-menu fieldset { margin: 0 0 12px; padding: 0; border: 0; }
.filter-menu legend { padding: 0; margin-bottom: 6px; font-weight: 750; font-size: 13px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.filter-chips button { min-height: 34px; border: 1px solid var(--line); border-radius: 7px; padding: 5px 9px; font-size: 13px; }
.filter-chips button[aria-pressed=true] { color: white; background: var(--navy); border-color: var(--navy); }
.filter-chips button[aria-pressed=true] .stage-badge { color: white; --stage-ink: white !important; }
#apply-stage { width: 100%; min-height: 38px; color: white; background: var(--blue); border-radius: 7px; font-weight: 700; }
#clear-filters { color: var(--blue); margin-left: auto; margin-right: 9px; font-size: 12px; text-decoration: underline; }
.archive-item { display: grid; gap: 4px; padding: 14px var(--gutter); border-bottom: 1px solid var(--line); }
.archive-item small { color: #91472a; }
.archive-detail { justify-self: start; padding: 3px 0; text-align: left; font-size: 15px; font-weight: 750; color: var(--ink); }
.archive-item a { font-size: 13px; justify-self: start; }
.skeleton { margin: 12px var(--gutter); height: 180px; background: repeating-linear-gradient(0deg,transparent 0 15px,#ebeff1 15px 26px,transparent 26px 36px,#e2e8eb 36px 49px,transparent 49px 60px); border-radius: 5px; }
.map-loading { display: none; }
dialog { width: min(440px,calc(100vw - 28px)); max-height: 86dvh; overflow-y: auto; padding: 22px; border-radius: 16px; border: 1px solid var(--line); color: var(--ink); box-shadow: 0 16px 60px #16344b40; }
dialog::backdrop { background: #132d40a6; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.dialog-head h2 { font-size: 21px; }
.dialog-head button { min-height: 40px; padding: 4px 10px; color: var(--blue); font-weight: 650; }
.decision-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; margin: 6px 0; }
.decision-metrics button { display: grid; gap: 2px; min-height: 44px; padding: 6px 10px; text-align: left; border: 1px solid #cfdfdc; border-radius: 9px; background: #f3f8f6; color: #234d46; }
.decision-metrics small { font-size: 11px; }
.decision-metrics strong { font-size: 14px; }
dialog p,dialog small { color: var(--sub); font-size: 14px; margin-block: 12px; }
dialog nav, .official-docs { display: flex; flex-wrap: wrap; gap: 10px; }
#address-form label { display: block; font-weight: 650; margin-bottom: 5px; }
#address-form > div { display: flex; gap: 6px; }
#address-lot { flex: 1; min-width: 0; border: 1px solid #aebecb; border-radius: 8px; padding: 8px 10px; }
#address-form button,#locate-lot { border-radius: 8px; color: white; background: var(--blue); min-height: 42px; padding: 8px 15px; font-weight: 650; }
#address-road { color: var(--blue); padding: 6px 0; min-height: 40px; }
#address-picker:not(:empty) { height: min(360px,45dvh); }
#address-answer:not(:empty) { padding: 10px; background: var(--wash); color: var(--ink); border-radius: 8px; }
#address-dialog small { display: block; font-size: 12px; margin-bottom: 0; }
.interval-card { margin: 16px 0; padding: 14px; background: var(--wash); border-radius: 10px; }
#town-detail .interval-card h3 { margin: 0 0 5px; font-size: 14px; }
.interval-card > strong { margin-right: 8px; font-size: 19px; }
.interval-card > span { background: #e5e9ea; font-weight: 700; font-size: 12px; border-radius: 5px; padding: 4px 6px; }
.interval-card .shorter { color: #075c4c; background: #d3ebe1; }
.interval-card .longer { color: #88440f; background: #fce4cf; }
.interval-card p { font-size: 12px; margin-top: 5px; color: var(--sub); }
.cancel-notice,.cutoff { display: block; margin: 8px 0; padding: 8px 12px; background: #fce3d9; color: #822f15; border-radius: 8px; font-weight: 700; }
body[data-loading=true] .map-loading { display: block; position: absolute; top: 48%; left: 48%; z-index: 1; width: 30px; height: 30px; border: 3px solid #c7d4da; border-top-color: var(--blue); border-radius: 50%; animation: map-spin .8s linear infinite; }
@keyframes map-spin { to { transform: rotate(1turn); } }
@media(prefers-reduced-motion: reduce) { body[data-loading=true] .map-loading { animation: none; } }
#result-count { font-weight: 700; color: var(--blue); }
#town-list, #town-detail { overflow-y: auto; min-height: 0; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #bdc9d9 transparent; }
.town-item, .zone-item { display: grid; width: 100%; align-items: center; text-align: left; }
.town-item { position: relative; gap: 5px; padding: 16px calc(var(--gutter) + 18px) 16px var(--gutter); }
.town-item + .town-item::before { content: ''; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); height: 1px; background: var(--line); }
.town-item::after, .zone-item::after, .chevron { content: ''; width: 7px; height: 7px; border: solid #79899e; border-width: 1.6px 1.6px 0 0; transform: rotate(45deg); }
.town-item::after { position: absolute; right: var(--gutter); }
.town-item:hover, .zone-item:hover, .back:hover { background: #f0f4ff; }
a.town-item { color: inherit; text-decoration: none; }
.published-project { padding: 20px; overflow: auto; }
.published-project h3 { margin: 16px 0 5px; font-size: 15px; }
.published-project ul { padding-left: 1.2em; }
.published-project li + li { margin-top: 4px; }
.town-item strong { font-size: 17px; line-height: 1.45; overflow-wrap: anywhere; }
.row-meta { font-size: 12.5px; color: var(--sub); }
.row-meta .district-name { color: var(--blue); font-weight: 650; }
.row-news { font-weight: 700; color: var(--blue); }
#recent-filter { flex: none; min-height: 40px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-weight: 650; background: white; }
#recent-filter[aria-pressed=true] { color: #fff; background: #166653; border-color: #166653; }
.recent-badge { display: inline-block; width: fit-content; margin-inline-start: 5px; padding: 1px 6px; color: #155c4a; background: #e4f3eb; border-radius: 5px; font-size: 11px; font-weight: 700; }
.row-meta span.recent-badge::before { content: none; }
.filter-row { flex-wrap: wrap; }
.detail-sources .report-link { display: inline-flex; align-items: center; min-height: 40px; margin-top: 10px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; font-weight: 650; }
.row-meta span + span::before { content: '·'; margin: 0 6px; color: #8090a4; }
.location-note, .notice { font-size: 13px; color: var(--sub); }
.empty { margin: 24px var(--gutter); color: var(--sub); line-height: 1.7; }
.empty button { display: block; margin-top: 10px; min-height: 40px; color: var(--blue); font-weight: 650; }
.back { flex: none; display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 8px var(--gutter); border-bottom: 1px solid var(--line); color: var(--blue); font-size: 14px; font-weight: 650; text-align: left; }
.back span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#town-detail { padding: 23px var(--gutter) 32px; overflow-wrap: anywhere; }
.detail-district { display: inline-block; color: var(--blue); background: #edf1ff; border-radius: 6px; font-size: 12px; font-weight: 700; padding: 3px 8px; }
#town-detail h2 { font-size: clamp(24px, 2vw, 31px); line-height: 1.25; margin: 9px 0 6px; }
.address { font-size: 14px; color: var(--sub); }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; background: var(--wash); border: 1px solid var(--line); padding: 14px 15px; border-radius: var(--radius); margin: 18px 0; }
.metrics dt { font-size: 12px; color: var(--sub); }
.metrics dd { font-size: 17px; font-weight: 700; letter-spacing: -.04em; margin-top: 4px; }
#town-detail h3 { font-size: 17px; margin: 20px 0 8px; }
.zone-item { grid-template-columns: 1fr auto; gap: 12px; min-height: 46px; padding: 9px 12px; margin-top: 6px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-weight: 650; }
.facts { margin: 12px 0; }
.facts > div { display: grid; grid-template-columns: minmax(76px,.85fr) 1.35fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.facts dt { color: var(--sub); }
.plan-notice { display: grid; gap: 3px; margin: 6px 0; padding: 10px 12px; border-left: 3px solid var(--blue); background: var(--wash); font-size: 13px; }
.plan-notice a { justify-self: start; }
.housing-table { margin-top: 14px; }
.housing-table summary { padding: 11px 0; color: var(--blue); font-size: 14px; font-weight: 700; }
.housing-table summary::after { content: ' ＋'; }
.housing-table[open] summary::after { content: ' −'; }
.housing-table table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.housing-table :is(th,td) { padding: 6px; text-align: right; border-bottom: 1px solid var(--line); }
.housing-table :is(th,td):first-child { text-align: left; }
.housing-table thead { background: var(--wash); }
.stage-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1.5; font-weight: 700; color: var(--stage-ink); white-space: nowrap; }
.stage-badge::before { content: ''; flex: none; width: 9px; height: 9px; background: var(--stage-ink); border-radius: 50%; }
.stage-badge[data-shape=diamond]::before { border-radius: 1px; transform: rotate(45deg); }
.stage-badge[data-shape=triangle]::before { border-radius: 0; clip-path: polygon(50% 0,100% 100%,0 100%); }
.stage-badge[data-shape=square]::before { border-radius: 2px; }
.stage-badge[data-shape=ring]::before { box-sizing: border-box; border: 2px solid; background: none; }
#stage-definitions > div { display: grid; gap: 2px; padding: 5px 0; }
.zone-item { grid-template-columns: minmax(0,1fr) auto auto; gap: 8px; }
.zone-status { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.zone-status .stage-badge { padding: 4px 9px; border-radius: 6px; background: color-mix(in srgb,var(--stage-ink) 9%,white); }
.zone-status small, .project-timeline small { color: var(--sub); font-size: 12px; }
.project-timeline ol { padding: 0; margin: 12px 0; list-style: none; }
.project-timeline li { position: relative; display: grid; grid-template-columns: 60px 1fr; column-gap: 10px; padding: 5px 0 9px 13px; margin-left: 4px; border-left: 2px solid #cbd9d9; font-size: 13px; }
.project-timeline li::before { content: ''; position: absolute; left: -4px; top: 11px; width: 6px; height: 6px; border-radius: 50%; background: #33645f; }
.project-timeline time { color: var(--sub); }
.project-timeline small { grid-column: 2; }
.project-timeline a { font-size: 13px; }
.provenance { margin-top: 20px; border-top: 1px solid var(--line); }
.provenance summary, .legend summary { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.provenance summary { min-height: 46px; font-size: 14px; font-weight: 700; }
.provenance summary::after, .legend summary::after { content: '+'; font-size: 16px; }
.provenance[open] summary::after, .legend[open] summary::after { content: '−'; }
.evidence-row { padding: 8px 0; font-size: 13px; }
.evidence-row small { display: block; color: var(--sub); font-size: 12px; margin-top: 3px; }

.map-stage { position: relative; isolation: isolate; min-width: 0; min-height: 0; overflow: hidden; background: #e8eeec; }
#map { position: relative; width: 100%; height: 100%; z-index: 0; background: #eaf0ee; }
#map:not(.show-totals) .district-label b { display: none; }
.map-style-picker, #reset-map, .legend { position: absolute; z-index: 1; border: 1px solid #ccd6dd; border-radius: 10px; background: white; box-shadow: var(--shadow); }
.map-style-picker { display: flex; top: 17px; left: 18px; padding: 3px; }
.map-style-picker button { padding: 7px 13px; min-height: 36px; border-radius: 7px; font-weight: 650; font-size: 13px; color: var(--sub); }
.map-style-picker button[aria-pressed=true] { background: var(--navy); color: white; }
#reset-map { top: 17px; right: 16px; min-height: 44px; padding: 8px 12px; font-size: 13px; font-weight: 650; }
.legend { right: 16px; bottom: 27px; }
#address-open { position: absolute; z-index: 1; left: 18px; bottom: 27px; min-height: 42px; border: 1px solid #ccd6dd; border-radius: 10px; background: white; box-shadow: var(--shadow); padding: 8px 11px; font-size: 13px; font-weight: 650; }
.legend summary { min-height: 40px; padding: 8px 13px; font-size: 13px; font-weight: 650; }
.legend ul { list-style: none; position: absolute; right: 0; bottom: calc(100% + 5px); width: max-content; padding: 12px 14px; }
.legend li { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 3px; }
.key { width: 14px; height: 10px; border-radius: 3px; }
.key.town { border: 1.5px dashed #50677c; background: #dce6e7; }
.key.zone { border: 1px solid #7f8b90; background: linear-gradient(110deg,#aa8bd9 33%,#edac56 33% 66%,#4bb8a1 66%); }
.key.district, .key.point { width: 18px; height: 18px; background: url('./assets/neighborhood.webp?v=2227b89fada5') center/contain no-repeat; }
.key.point { border: 2px solid #174a48; border-radius: 50% 50% 3px 50%; }
.key.cluster { width: 18px; height: 18px; border-radius: 50%; background: #174f58; color: white; text-align: center; font: 700 11px/18px sans-serif; }
.marker-measurements { position: absolute; top: 0; left: 0; width: 0; height: 0; visibility: hidden; pointer-events: none; }
.map-cluster { width: 48px; height: 48px; display: grid; place-content: center; gap: 1px; padding: 0; border-radius: 50%; border: 2px solid white; background: #174f58; color: white; box-shadow: 0 0 0 2px #23777c55,0 3px 8px #16363c40; font-family: Pretendard,sans-serif; text-align: center; }
.map-cluster strong { font-size: 17px; line-height: 18px; }
.map-cluster span { font-size: 10px; line-height: 11px; font-weight: 600; }
.map-cluster.has-selection,.map-cluster:focus-visible { outline: 3px solid #2478ce; outline-offset: 2px; }
.map-cluster:hover { background: #0c4149; }
#cluster-dialog { width: min(380px,calc(100vw - 28px)); padding: 18px; }
#cluster-dialog[open] { display: flex; flex-direction: column; }
#cluster-members { overflow-y: auto; overscroll-behavior: contain; min-height: 0; margin: 10px 0; padding: 0; list-style: none; }
#cluster-members li+li { border-top: 1px solid var(--line); }
#cluster-members button { width: 100%; min-height: 54px; display: grid; text-align: left; gap: 2px; padding: 8px 10px; border-radius: 7px; }
#cluster-members button:hover,#cluster-members button:focus-visible,#cluster-members button[aria-current] { background: #eaf4f4; }
#cluster-members small { margin: 0; font-size: 12px; }
#cluster-zoom { flex-shrink: 0; width: 100%; border-radius: 8px; min-height: 42px; background: #174f58; color: white; font-weight: 650; }
@media(max-width:760px){
  #cluster-dialog { margin: auto auto 0; width: 100%; max-height: 70dvh; border-radius: 18px 18px 0 0; padding-bottom: max(18px,env(safe-area-inset-bottom)); }
}
#map-status, .map-note { position: absolute; z-index: 1; top: 70px; left: 18px; right: 18px; width: fit-content; max-width: 90%; background: white; border-radius: 8px; padding: 8px 12px; box-shadow: var(--shadow); font-size: 13px; }
#map-status:empty { display: none; }
.district-label { position: absolute; transform: translate(-50%,-50%); display: grid; justify-items: center; white-space: nowrap; font-size: 12px; font-weight: 750; color: #253d41; text-shadow: 0 1px 2px white; }
.district-nameplate { display: flex; align-items: center; gap: 4px; line-height: 17px; }
.district-overview .district-label::before { content: ''; width: 34px; height: 32px; background: url('./assets/neighborhood.webp?v=2227b89fada5') center/contain no-repeat; filter: drop-shadow(0 2px 1px #233b381a); }
.district-overview .empty-district::before { display: none; }
.district-overview .district-nameplate { background: #fffffffa; border: 1px solid #c6d5d9; border-radius: 9px; box-shadow: 0 2px 6px #173a471b; padding: 1px 3px 1px 7px; }
.district-label b { color: var(--blue); background: #e8eff9; padding: 0 4px; border-radius: 5px; font-weight: 800; font-size: 11px; }
.stage-mix { display: none; }
.district-overview .stage-mix { display: flex; width: 36px; height: 4px; overflow: hidden; border-radius: 0 0 4px 4px; }
.boundary-caption { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.boundary-caption small { color: var(--sub); font-size: 11px; }
.photo-credit { font-size: 11px; }
#map-brief { position: absolute; z-index: 1; bottom: 27px; right: 126px; width: min(320px,40%); background: #fff; border: 1px solid #cbd8db; border-radius: 12px; padding: 12px 15px; box-shadow: var(--shadow); }
.map-stage:has(#map:not(.district-overview)) #map-brief { display: none; }
.brief-head,.related-head,.reader-list-head,.reader-tools,.site-scope { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brief-head strong { font-size: 12px; color: var(--blue); }
.brief-head span { font-size: 11px; color: var(--muted); }
#map-brief a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 5px; font-size: 14px; font-weight: 750; line-height: 1.5; color: var(--ink); text-decoration: none; }
#map-brief a:hover,.news-card h3 a:hover { color: var(--blue); text-decoration: underline; }
.related-news { margin: 18px 0; padding: 0 13px 2px; border: 1px solid var(--line); border-radius: 12px; }
#town-detail .related-head h3 { margin: 14px 0 10px; font-size: 15px; }
.related-head a { flex: none; font-size: 12px; font-weight: 650; }
.reader-page { display: block; height: auto; min-height: 100vh; background: var(--paper); }
.reader-page .topbar { position: sticky; top: 0; }
.reader { width: min(1120px, 100%); margin: auto; padding: 28px clamp(18px,3vw,40px); }
.news-masthead { display: flex; align-items: end; min-height: clamp(160px,19vw,210px); border-radius: 16px; }
.news-masthead::before { background-position: center 48%; }
.masthead-copy { padding: clamp(22px,3vw,38px); }
.masthead-copy h1 { font-size: clamp(30px,3.3vw,46px); line-height: 1.15; letter-spacing: -.065em; }
.masthead-copy p { margin-top: 9px; color: #f6f9fc; font-size: 15px; }
.reader-content { margin-top: 22px; }
.reader-tools { flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 15px; }
.news-switch { display: flex; gap: 3px; padding: 3px; background: #e7eced; border-radius: 10px; }
.news-switch button { display: flex; align-items: center; justify-content: center; gap: 5px; color: var(--sub); padding: 8px 13px; min-height: 39px; border-radius: 8px; font-size: 14px; font-weight: 700; }
.news-switch button[aria-pressed=true] { color: white; background: var(--navy); }
.news-switch b { font-size: 11px; font-variant-numeric: tabular-nums; }
.news-area select { border: 1px solid #c8d3d8; border-radius: 8px; background: white; min-height: 42px; padding: 5px 10px; font-size: 14px; }
.reader-list-head { padding: 16px 1px 10px; }
.reader-list-head h2 { font-size: 15px; }
#news-count { color: var(--sub); font-size: 13px; }
#news-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.news-card { min-width: 0; background: white; border: 1px solid var(--line); border-radius: 12px; padding: clamp(16px,2.2vw,25px); scroll-margin-top: 80px; }
.news-card:target { border-color: var(--blue); }
.news-card:focus-within { border-color: var(--blue); }
.story-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--sub); }
.story-meta time { font-variant-numeric: tabular-nums; }
.source-tag { font-size: 11px; line-height: 1.4; padding: 3px 7px; border-radius: 4px; font-weight: 750; }
.source-tag.official { background: #e4edf9; color: #214f85; }
.source-tag.media { background: #f7ebdb; color: #794810; }
.scope-tag { font-size: 11px; }
.news-card h3 { margin: 12px 0 6px; font-size: clamp(17px,1.6vw,21px); letter-spacing: -.045em; line-height: 1.55; overflow-wrap: anywhere; }
.news-card h3 a { color: var(--ink); text-decoration: none; }
.outbound { font-size: .79em; color: var(--muted); margin-left: .25em; }
.publisher { color: var(--sub); font-size: 13px; }
.story-sites { border-top: 1px solid var(--line); margin-top: 15px; padding-top: 9px; display: flex; flex-wrap: wrap; gap: 4px 7px; }
.site-label { width: 100%; color: var(--muted); font-size: 11px; font-weight: 650; }
.story-sites a { padding: 4px 7px; border: 1px solid #d9e3e8; border-radius: 6px; font-size: 12px; text-decoration: none; overflow-wrap: anywhere; }
.story-sites a:hover { border-color: var(--blue); background: var(--wash); }
.news-card.compact { padding: 10px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
#town-detail .compact h3 { font-size: 14px; line-height: 1.55; margin: 5px 0 3px; }
.compact .publisher { font-size: 12px; }
.site-scope,#news-warning,.news-empty { padding: 12px 16px; margin-bottom: 12px; background: #e7eef7; border-radius: 8px; overflow-wrap: anywhere; font-size: 14px; }
.site-scope button,#news-warning button,.news-empty button { color: var(--blue); text-decoration: underline; font-weight: 650; }
.news-empty { grid-column: 1/-1; }
.news-empty button { display: block; padding: 10px 0; }
.reader-footer { margin-top: 24px; color: var(--muted); font-size: 11px; }
.qa-reader { width: min(100%, 780px); margin: auto; padding: clamp(28px, 5vw, 60px) clamp(16px, 4vw, 34px); }
.qa-reader > header { margin-bottom: 24px; }
.qa-reader h1 { font-size: clamp(27px, 5vw, 38px); }
.qa-reader header p { margin-top: 6px; color: var(--sub); }
.qa-group { margin: 26px 0 6px; font-size: 20px; }
.qa-flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 14px; margin: 14px 0; }
.qa-flow > div { padding: 14px 16px; border-radius: 9px; background: var(--wash); }
.qa-flow h3 { font-size: 15px; color: var(--navy); }
.qa-flow ol { padding-inline-start: 1.4em; margin: 8px 0 0; }
.qa-flow li + li { margin-top: 6px; }
.qa-reader details { margin-block: 10px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.qa-reader details[open] { border-color: #a7c7bc; }
.qa-reader summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; border-radius: 14px; font-size: clamp(16px, 2vw, 18px); font-weight: 700; }
.qa-reader summary::after { content: ''; flex: none; width: 8px; height: 8px; margin: 0 3px 4px 0; border: solid #4c7068; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.qa-reader details[open] summary::after { transform: rotate(225deg); margin-bottom: -4px; }
.qa-answer { padding: 0 20px 16px; line-height: 1.65; }
.qa-guide { margin: 14px 0 8px; padding: 14px 16px; border-radius: 9px; background: #edf5f1; }
.qa-guide h3 { margin: 0; font-size: 15px; color: #245a4d; }
.qa-guide p { margin: 4px 0 8px; }
.qa-guide a { display: inline-flex; align-items: center; min-height: 40px; padding-inline: 13px; border-radius: 8px; background: #195d50; color: white; font-size: 14px; font-weight: 650; text-decoration: none; }
.qa-guide a:hover { background: #104c40; }
.qa-source, .qa-reader footer { color: var(--sub); font-size: 13px; }
.qa-reader footer { margin-top: 18px; }
@media (max-width: 430px) {
  .reader-page .topbar { flex-wrap: wrap; height: auto; }
  .reader-page .topbar .brand-link { min-height: 44px; }
  .reader-page .main-nav { margin-left: 0; min-height: 42px; }
}

@media (max-width: 768px) {
  :root { --gutter: 17px; }
  .district-overview .district-label::before { height: 26px; width: 29px; }
  .topbar { height: 52px; padding: env(safe-area-inset-top) 12px 0; box-sizing: content-box; gap: 8px; }
  .topbar h1,.brand-link { font-size: 16px; gap: 6px; }
  .brand-mark { width: 29px; height: 29px; }
  .main-nav { gap: 0; margin-left: auto; margin-right: 0; }
  .main-nav a { padding-inline: 7px; font-size: 13px; }
  .reader-page .top-meta { display: none; }
  #guide-open { width: 36px; justify-content: center; font-size: 0; gap: 0; }
  .area-cover,#map-brief { display: none; }
  .reader { padding: 14px 13px 26px; }
  .news-masthead { min-height: 145px; }
  .masthead-copy { padding: 18px; }
  .masthead-copy p { font-size: 13px; }
  .reader-content { margin-top: 14px; }
  .reader-tools { gap: 7px; }
  .news-switch button { padding-inline: 8px; font-size: 13px; }
  .news-area select { max-width: 112px; font-size: 13px; }
  #news-list { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .updated { display: none; }
  .workspace { display: flex; flex-direction: column-reverse; }
  .map-stage { flex: 1; }
  #explorer { flex: none; height: min(42%, 335px); border: 0; border-top: 1px solid #c1cedb; padding-bottom: env(safe-area-inset-bottom); }
  #explorer:has(:where(#detail-view:not([hidden]))) { height: min(55%, 510px); }
  #explorer.tall:not(.collapsed) { height: min(78%,calc(100% - 158px)); }
  #explorer.collapsed, #explorer.collapsed:has(#detail-view:not([hidden])) { height: auto; }
  #explorer.collapsed #panel-content { display: none; }
  .sheet-tools { display: flex; align-items: center; flex: none; padding: 0 var(--gutter); gap: 10px; }
  #sheet-toggle { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0; font-weight: 750; text-align: left; touch-action: none; user-select: none; cursor: ns-resize; }
  #sheet-toggle::before { content: ''; width: 23px; height: 4px; border-radius: 4px; background: #9badb7; }
  #sheet-size { color: var(--blue); font-size: 13px; min-height: 44px; padding-inline: 6px; font-weight: 650; }
  .collapsed #sheet-size { display: none; }
  .chevron { transform: rotate(135deg); margin-right: 4px; }
  .collapsed .chevron { transform: rotate(-45deg); }
  .search-block { padding: 0 var(--gutter) 8px; display: grid; grid-template-columns: minmax(0,1fr); gap: 5px; }
  #explorer { position: relative; z-index: 2; }
  .filter-menu { top: auto; bottom: calc(100% + 4px); }
  .filter-row .stage-filters summary { min-height: 36px; padding-block: 5px; }
  .search-block h2 { display: none; }
  .filter-row { margin: 0; }
  .filter-row label { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .filter-row select { border: 1px solid var(--line); border-radius: 9px; min-height: 44px; max-width: 102px; }
  .search-box { padding: 0 9px; gap: 8px; }
  .search-box input { font-size: 16px; height: 42px; }
  .results-head { padding-block: 6px; }
  .town-item { padding-block: 12px; }
  #town-detail { padding-top: 12px; }
  .back { min-height: 40px; border-block: 1px solid var(--line); }
  .map-style-picker { top: 10px; left: 10px; }
  #reset-map { top: 10px; right: 10px; }
  .legend { right: 10px; bottom: 20px; }
  #address-open { left: 10px; bottom: 20px; }
}
@media(max-width: 370px) {
  .topbar { padding-inline: 8px; gap: 4px; }
  .main-nav a { padding-inline: 5px; }
  .reader-tools { align-items: stretch; }
  .news-switch { flex: 1; }
  .news-switch button { flex: 1; white-space: nowrap; }
  .news-area select { max-width: 92px; }
}

.guide-stages { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.guide-stages h3 { margin: 0 0 8px; font-size: 15px; }
#guide-dialog { width: min(540px,calc(100vw - 28px)); padding: 0 22px 18px; }
.guide-banner { position: relative; margin-inline: -22px; }
.guide-banner img { display: block; width: 100%; height: auto; }
#guide-close { position: absolute; top: 10px; right: 10px; min-height: 38px; padding: 0 12px; border-radius: 20px; background: #fff; color: #254c50; box-shadow: 0 2px 8px #243f4026; font-weight: 650; }
#guide-heading { margin: 20px 0 6px; font-size: clamp(21px,4vw,26px); color: #163f42; line-height: 1.3; letter-spacing: -.035em; }
#guide-dialog .guide-intro { color: #354f51; font-size: 15px; margin-top: 6px; }
#guide-dialog h3 { font-size: 16px; margin: 20px 0 4px; }
.guide-disclaimer { display: block; padding-top: 12px; border-top: 1px solid var(--line); }
#guide-dialog .guide-disclaimer { font-size: 12px; margin-bottom: 0; }
.guide-stages summary,.stage-walkthrough summary { cursor: pointer; color: #245e56; font-weight: 650; padding: 8px 0; }
.guide-stages summary::after,.stage-walkthrough summary::after { content: '+'; float: right; }
.guide-stages[open] summary::after,.stage-walkthrough[open] summary::after { content: '−'; }
.stage-walkthrough { margin-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.stage-walkthrough img { display: block; width: 100%; height: auto; margin: 5px 0; }
.stage-walkthrough p { color: var(--sub); font-size: 12px; }
.metric-description .term-lead { color: #244f46; font-weight: 650; }
.stage-explainer { width: 100%; display: flex; align-items: baseline; gap: 7px; text-align: left; font-size: 13px; line-height: 1.45; background: #edf5f1; color: #214a43; border-radius: 7px; padding: 7px 9px; }
.stage-explainer strong { flex: none; font-size: 11px; color: #216454; }
.stage-explainer::after { content: '›'; margin-left: auto; align-self: center; }
.glossary-help { min-height: 32px; color: #275e54; font-weight: 650; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.missing-help { margin-bottom: 6px; }
.empty-search { display: grid; justify-items: center; text-align: center; gap: 5px; }
.empty-search strong { color: var(--ink); font-size: 15px; }
.empty-search p { margin: 0; font-size: 13px; }
.empty-search button { margin-top: 1px; }
.detail-skeleton { background: linear-gradient(#dfe6ed 0 0) 0 0/60% 24px no-repeat,linear-gradient(#eef2f5 0 0) 0 47px/100% 104px no-repeat,linear-gradient(#e6ebef 0 0) 0 172px/75% 14px no-repeat; }
.metrics:empty { display: none; }
.metrics > div { min-width: 0; overflow-wrap: anywhere; }
.metrics small { font-weight: 500; font-size: 12px; color: var(--sub); }
.aging-meter { position: relative; margin-top: 4px; line-height: 0; }
.aging-meter progress { width: 100%; height: 7px; accent-color: #087763; }
.aging-meter::after { content: ''; position: absolute; left: 50%; top: -2px; height: 11px; width: 2px; background: #354958; }
.official-docs a { padding: 8px 11px; border: 1px solid var(--line); border-radius: 7px; text-decoration: none; }
.cutoff { background: #fff0ce; color: #71470c; }
.map-tools { position: absolute; top: 16px; right: 14px; z-index: 1; display: grid; justify-items: end; gap: 6px; }
.map-tools button,#cadastral { background: white; border: 1px solid #c9d5de; box-shadow: var(--shadow); border-radius: 8px; min-height: 38px; padding: 6px 10px; font-weight: 650; font-size: 13px; }
.map-tools #reset-map { position: static; min-height: 38px; }
.map-zoom { display: grid; }
.map-zoom button { font-size: 20px; padding: 0; width: 38px; }
#cadastral { position: absolute; top: 69px; left: 18px; display: flex; align-items: center; gap: 6px; z-index: 1; }
#cadastral .layer-switch { display: inline-flex; align-items: center; width: 24px; height: 14px; background: #98a6b3; border-radius: 9px; padding: 2px; }
#cadastral .layer-switch::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: white; }
#cadastral[aria-checked=true] .layer-switch { background: var(--blue); justify-content: flex-end; }
#measure[aria-pressed=true] { color: white; background: var(--blue); }
#measure-status,#map-status { top: auto; bottom: 72px; left: 12px; font-size: 12px; max-width: calc(100% - 24px); }
#measure-status { position: absolute; z-index: 2; padding: 7px 10px; border-radius: 8px; background: #183652; color: white; pointer-events: none; }
#measure-status:empty { display: none; }
.map-caption { display: block; position: absolute; transform: translate(-50%,-100%); width: max-content; max-width: min(155px,45vw); white-space: normal; overflow-wrap: anywhere; word-break: keep-all; border-radius: 6px; background: #fffffff2; border: 1px solid #b5c5d3; padding: 3px 6px; box-shadow: 0 2px 5px #1e37481c; color: #233e51; font: 650 12px/1.35 Pretendard,sans-serif; }
.map-caption small { display: block; color: var(--stage-ink,var(--sub)); font-size: 10px; }
.map-caption.selected-caption { color: white; background: var(--stage-ink,#205975); border-color: white; box-shadow: 0 0 0 2px var(--stage-ink,#205975),0 3px 8px #23364144; }
.map-caption.selected-caption small { color: white; }
.zone-caption { border-left: 3px solid var(--stage-ink); }
.zone-point-caption { border: 1px solid var(--stage-ink); border-radius: 8px; text-align: center; padding: 3px 7px; transform: translate(-50%,calc(-100% - 5px)); }
.zone-point-caption::after { content: ''; position: absolute; left: 50%; bottom: -5px; width: 7px; height: 7px; border: 1px solid var(--stage-ink); border-width: 0 1px 1px 0; background: white; transform: translateX(-50%) rotate(45deg); }
.sub-area-jump { display: inline-block; margin: 0 0 8px; padding-block: 4px; font-size: 13px; color: var(--blue); text-underline-offset: 3px; }
.detail-section { margin: 14px 0 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
#town-detail .detail-section > h3 { margin: 0 0 12px; font-size: 17px; line-height: 1.4; }
.detail-section h4 { margin: 12px 0 8px; font-size: 14px; }
.detail-section .facts { margin: 0; }
.detail-section .facts > div:last-child { border-bottom: none; }
.detail-section .metrics { margin: 0; border: none; padding: 0; border-radius: 0; background: none; gap: 0 12px; }
.detail-section .metrics > div { padding: 10px 0; border-top: 1px solid var(--line); }
.detail-section .metrics dd { font-size: 15px; }
.detail-section .metrics small { display: block; margin-top: 2px; }
.detail-section .unverified { font-weight: 500; color: #657486; }
.detail-section .status-note { font-weight: 500; color: #4a5b6d; font-style: normal; opacity: .82; }
.status-tag { justify-self: start; border-radius: 5px; padding: 2px 7px; background: #ebf2fa; color: #245584; font-weight: 650; }
.status-tag.unverified { background: #f1f3f5; }
.detail-extra { margin-top: 8px; }
.detail-extra summary, .detail-sources summary { cursor: pointer; font-size: 13px; color: var(--blue); padding: 7px 0; }
.detail-caption, .milestone-list small { display: block; color: var(--sub); font-size: 12px; }
.milestone-list, .sub-area-cards { padding: 0; margin: 0; list-style: none; }
.milestone-list li { position: relative; padding: 0 0 14px 16px; border-left: 2px solid #ced9e4; margin-left: 3px; }
.milestone-list li:last-child { padding-bottom: 5px; }
.milestone-list li::before { content: ''; position: absolute; left: -5px; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: #476c94; }
.milestone-head, .sub-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 10px; font-size: 14px; }
.milestone-head time { color: var(--sub); font-size: 12px; }
.duration { display: inline-block; margin-top: 5px; padding: 3px 7px; border-radius: 5px; font-size: 12px; background: #eff3f7; color: #334c65; }
.duration.in-progress { color: #0a6554; background: #e3f3ed; }
.sub-area-cards { display: grid; gap: 6px; }
.sub-area-cards button { display: grid; width: 100%; gap: 4px; padding: 10px 12px; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; text-align: left; }
.sub-area-cards button:hover, .sub-area-cards button[aria-current] { border-color: #7697c1; background: #eef4fe; }
.sub-area-cards small, .sub-card-metrics { color: var(--sub); font-size: 12px; }
.sub-card-contractor { color: var(--ink); font-size: 13px; font-weight: 650; }
.metrics .source-link { display: block; margin-top: 4px; font-size: 12px; }
.detail-sources { margin-top: 18px; padding-top: 7px; border-top: 1px solid var(--line); }
.detail-section .notice { margin: 8px 0; line-height: 1.55; }
.address-caption,.point-caption,.ruler-caption { border-color: var(--blue); margin-top: -7px; }
.address-caption::after,.point-caption::after,.ruler-caption::after { content: ''; position: absolute; bottom: -12px; left: calc(50% - 5px); width: 10px; height: 10px; border: 2px solid white; border-radius: 50%; background: var(--blue); }
#map.measuring { cursor: crosshair; }
.regulatory { margin-block: 1rem; padding: 0 1rem 1rem; border: 1px solid #d9e3df; border-radius: 12px; background: #f7faf8; }
.regulatory h3 { margin: 1rem 0 .4rem; }
.regulatory p { margin: .45rem 0; line-height: 1.55; overflow-wrap: anywhere; }
.regulatory small, .regulatory p a { display: block; }
.regulatory small { color: #425652; }
.city-road-rule { margin-top: .8rem; font-size: .85rem; }
.city-road-rule summary { cursor: pointer; line-height: 1.5; }
@media(max-width:760px) { .map-tools { top: 10px; right: 10px; } #cadastral { top: 59px; left: 10px; } }

/* The panel header stays in the sheet. Each tab owns its scroll position. */
#town-detail { display: flex; flex-direction: column; flex: 1; overflow: hidden; padding: 0; }
.project-summary { flex: none; padding: 14px 17px 11px; }
.summary-identity { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.summary-identity > div { min-width: 0; }
#town-detail .summary-identity h2 { margin: 2px 0 0; font-size: 22px; line-height: 1.22; }
.detail-district { font-size: 12px; }
.copy-link { flex: none; position: relative; width: 40px; height: 40px; border: 1px solid #d4dfe4; border-radius: 10px; color: var(--blue); background: white; }
.copy-link:hover { background: #eff5fa; }
.copy-link::before, .copy-link::after { content: ''; position: absolute; width: 13px; height: 7px; border: 2px solid currentColor; border-radius: 6px; transform: rotate(-42deg); }
.copy-link::before { left: 9px; top: 20px; }
.copy-link::after { left: 16px; top: 13px; }
.summary-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 8px 0; }
.summary-badges > span { padding: 3px 6px; font-size: 11px; line-height: 1.35; border-radius: 5px; }
.regulation-chip { color: #145a51; background: #e7f4ef; }
.regulation-chip b { font-weight: 700; }
.regulation-chip.unverified,.summary-badges .status-tag.unverified { color: #536571; background: #f0f3f5; }
.summary-kpis { margin: 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); border: 1px solid #dce6eb; overflow: hidden; background: #f5f8fa; border-radius: 10px; }
.summary-kpis > div { padding: 7px 9px; }
.summary-kpis > div + div { border-left: 1px solid #dce6eb; }
.summary-kpis dt,.summary-kpis small { display: block; color: var(--sub); font-size: 11px; }
.summary-kpis dd { margin: 2px 0 0; color: #183e54; font-size: 15px; font-weight: 750; line-height: 1.25; }
#town-detail .unverified { color: #65727b; font-weight: 500; }
.project-summary .cancel-notice { margin: 5px 0; padding: 5px 8px; font-size: 12px; }
.detail-tabs { flex: none; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); padding-inline: 10px; border-bottom: 1px solid var(--line); background: white; }
.detail-tabs button { min-height: 43px; padding: 5px 2px; font-size: 13px; font-weight: 650; color: var(--muted); border-bottom: 3px solid transparent; }
.detail-tabs button[aria-selected=true] { border-color: #1b6384; color: #174c67; }
.permit-dot { display: inline-block; width: 6px; height: 6px; margin-left: 4px; vertical-align: super; border-radius: 50%; background: #b35712; }
.detail-pane { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 12px; background: #f4f7f8; }
.detail-pane .detail-section { margin: 0 0 10px; }
.detail-pane .detail-section:last-child { margin-bottom: 0; }
.detail-sources { margin: 0; border: 0; padding: 0; }
.detail-pane .related-news { margin: 0; border: 0; padding: 0; }
.benchmark { display: block; width: fit-content; padding: 2px 6px; margin-top: 4px; border-radius: 5px; color: #405668; background: #eef3f6; font-size: 12px; }
.benchmark.faster { color: #155f49; background: #e6f4eb; }
.benchmark.slower { color: #8a4816; background: #fff1dd; }
.sub-area-cards { gap: 9px; }
.sub-area-cards button { background: white; padding: 12px 14px; }
.sub-area-cards button[aria-current=true] { background: #eff7fb; border: 2px solid #317298; padding: 11px 13px; }
.sub-card-head { align-items: center; padding-bottom: 4px; }
.sub-card-field { display: grid; grid-template-columns: 66px 1fr; gap: 6px; font-size: 12px; }
.sub-card-field > :first-child { color: var(--sub); }
.compare-areas { grid-column: 1 / -1; display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 6px; margin-top: 7px; padding: 9px 10px; border-radius: 8px; background: #eaf4f1; color: #165849; text-align: left; font-size: 13px; }
.compare-areas span { margin-left: auto; font-size: 12px; }
.pilot-entry { flex: none; margin-left: auto; padding: 8px 11px; min-height: 40px; border-radius: 10px; font-size: 13px; font-weight: 700; color: white; background: #176755; }
.pilot-entry:hover { background: #104c40; }
.pilot-list-label { font-size: 11px; font-weight: 650; color: #176755; }
#pilot-viewer { width: min(1240px,96vw); height: min(850px,90dvh); max-width: none; max-height: none; border: 0; border-radius: 20px; padding: 0; overflow: hidden; background: #f8faf8; color: #18382f; }
#pilot-viewer[open] { display: flex; flex-direction: column; }
#pilot-frame { display: flex; flex-direction: column; flex: 1; min-height: 0; background: #f8faf8; }
#pilot-viewer.is-expanded { position: fixed; inset: 0; width: 100%; height: 100dvh; margin: 0; border-radius: 0; }
#pilot-viewer.is-expanded #pilot-frame { padding-inline: env(safe-area-inset-left) env(safe-area-inset-right); padding-bottom: env(safe-area-inset-bottom); }
#pilot-viewer.is-expanded .pilot-layout:has(.pilot-info[hidden]) { grid-template-columns: minmax(0,1fr); }
#pilot-viewer.is-expanded #pilot-illustration img { max-height: max(160px,calc(100dvh - 170px)); }
#pilot-viewer::backdrop { background: rgb(15 39 34 / .62); }
.pilot-heading { flex: none; display: flex; align-items: center; gap: 18px; padding: 14px 20px; background: white; border-bottom: 1px solid #dae5df; }
.pilot-heading > div:first-of-type { min-width: 0; margin-right: auto; overflow-wrap: anywhere; }
.pilot-heading h2,.pilot-info h3 { margin: 0; line-height: 1.3; }
.pilot-heading h2 { font-size: clamp(17px,2.5vw,23px); }
.pilot-heading small { display: block; color: #537064; font-weight: 600; }
#pilot-viewer .pilot-world-label small,.pilot-heading small { margin: 0; }
#pilot-back,#pilot-tools button,#pilot-fullscreen,#pilot-info-toggle { border: 1px solid #c7d6cd; border-radius: 9px; background: #fff; min-height: 40px; padding: 5px 11px; font-weight: 650; }
#pilot-fullscreen,#pilot-info-toggle { flex: none; color: #195d50; white-space: nowrap; }
#pilot-fullscreen { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
#pilot-fullscreen .restore-icon,.is-expanded #pilot-fullscreen .expand-icon { display: none; }
.is-expanded #pilot-fullscreen .restore-icon { display: block; }
#pilot-info-toggle[aria-expanded=true] { background: #e3efea; }
.pilot-modes { display: flex; gap: 3px; background: #edf2ef; padding: 3px; border-radius: 12px; }
.pilot-modes button { min-height: 38px; padding: 5px 16px; font-size: 14px; border-radius: 9px; font-weight: 650; }
.pilot-modes button[aria-pressed=true] { background: #195d50; color: white; }
#pilot-simulation-notice { flex: none; margin: 0; padding: 8px 20px; color: #604318; background: #fff6df; border-bottom: 1px solid #e9d9b3; font-size: 13px; line-height: 1.5; }
#pilot-illustration { position: absolute; inset: 0; display: grid; align-content: center; justify-items: stretch; gap: 12px; margin: 0; padding: clamp(12px,2vw,28px); overflow: auto; background: #eff3ef; }
#pilot-illustration a { display: flex; min-height: 0; justify-content: center; }
#pilot-illustration img { width: 100%; height: auto; max-height: min(58dvh,590px); object-fit: contain; }
#pilot-illustration figcaption { color: #435d51; font-size: 12px; text-align: center; }
.pilot-visual-source { margin: 14px 0; padding-top: 12px; border-top: 1px solid #dce6e0; }
.pilot-visual-source h4 { margin: 0; font-size: 14px; }
.pilot-visual-source p { margin: 4px 0; }
.pilot-scenario { border-left: 3px solid #7fb5a2; padding-left: 12px; margin-bottom: 18px; }
.pilot-scenario p { margin: 5px 0; }
.pilot-scenario .pilot-plan-program { color:#1b5949; font-weight:650; }
.pilot-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) minmax(230px,27%); }
.pilot-stage { position: relative; min-height: 0; min-width: 0; background: #e6eee8; isolation: isolate; }
#pilot-scene { position: absolute; inset: 0; overflow: hidden; }
.pilot-display-switch { position:absolute; top:12px; left:12px; display:flex; padding:3px; gap:2px; background:#fffffff5; border:1px solid #c4d3c9; border-radius:12px; box-shadow:0 3px 12px #1c422b18; }
.pilot-display-switch button { min-height:35px; border-radius:8px; padding:5px 11px; font-size:12px; font-weight:650; color:#4a6158; }
.pilot-display-switch button[aria-pressed=true] { color:#fff; background:#275d50; }
#pilot-placement { max-width:calc(100% - 75px); flex-wrap:wrap; }
#pilot-reference { margin:0 0 12px; padding-bottom:8px; border-bottom:1px solid #dce6e0; }
#pilot-reference summary { font-size:13px; font-weight:700; padding:5px 0; }
#pilot-reference img { display:block; width:100%; height:auto; margin-top:6px; }
#pilot-reference a { font-size:11px; }
#pilot-reference a:has(img) { display:block; padding:0; }
#pilot-reference p { margin:4px 0; font-size:11px; }
.pilot-source-card { margin:12px 0; padding:10px 12px; background:#f3f7f3; border-radius:10px; }
.pilot-source-card h4 { margin:0; font-size:14px; }
.pilot-source-card .pilot-facts { margin:3px 0; }
.pilot-source-card summary { font-size:13px; }
.pilot-plan-links { display:grid; gap:4px; margin:10px 0 16px; }
.pilot-plan-links button { padding:8px 10px; text-align:left; background:#eef4ef; color:#1b5949; border-radius:7px; font-size:13px; font-weight:650; }
#pilot-tools { position: absolute; z-index: 2; top: 12px; right: 12px; display: grid; gap: 3px; }
#pilot-tools button { box-shadow: 0 2px 8px #254c3217; color: #254c40; font-size: 19px; min-width: 42px; padding: 1px 8px; }
#pilot-tools button:last-child { font-size: 12px; }
#pilot-viewer [disabled] { opacity: .45; }
#pilot-loading { position: absolute; z-index: 3; top: 50%; left: 50%; transform: translate(-50%,-50%); background: #fff; border-radius: 12px; padding: 12px 18px; text-align: center; font-size: 14px; box-shadow: var(--shadow); }
#pilot-loading button,.pilot-text-button { color: #176755; text-decoration: underline; padding: 6px; }
.pilot-info { min-height: 0; overflow-y: auto; background: #fff; padding: 18px; border-left: 1px solid #d8e4dd; }
.pilot-select { display: grid; gap: 6px; color: #46645b; font-size: 13px; font-weight: 650; margin-bottom: 18px; }
.pilot-select select { width: 100%; max-width: 100%; min-height: 40px; background: white; border: 1px solid #bdcfc4; border-radius: 9px; padding: 5px 9px; color: #193a30; font: inherit; }
.pilot-info h3 { font-size: 17px; }
.pilot-stat { display: block; color: #1c6051; font-size: 34px; line-height: 1.15; margin-top: 8px; }
.pilot-denominator,.pilot-meta,.pilot-note { margin: 6px 0; }
.pilot-info a { display: inline-block; font-size: 13px; color: #13614e; padding-block: 5px; text-underline-offset: 3px; }
.pilot-meta,.pilot-note { font-size: 12px; line-height: 1.5; color: #536a60; display: block; }
.pilot-note { padding: 9px 10px; border-radius: 8px; background: #f0f5f2; }
.pilot-evidence { margin-top: 6px; font-size: 13px; }
.pilot-evidence summary { padding-block: 5px; cursor: pointer; }
.pilot-evidence a { display: block; }
.pilot-key { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; list-style: none; padding: 12px 0; margin: 8px 0; border-block: 1px solid #e0e9e2; font-size: 12px; }
.pilot-key li::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; background: #adb9bf; }
.pilot-key [data-tier=under_20]::before { background: #82ac98; }
.pilot-key [data-tier="20_to_29"]::before { background: #d4aa64; }
.pilot-key [data-tier="30_plus"]::before { background: #ce815e; }
.pilot-facts { display: grid; margin: 10px 0; }
.pilot-facts div { display: flex; justify-content: space-between; gap: 8px; padding-block: 7px; border-bottom: 1px solid #e3eae5; }
.pilot-facts dt { color: #51695d; font-size: 13px; }
.pilot-facts dd { margin: 0; text-align: right; font-weight: 650; }
@media(max-width:900px) {
  .pilot-heading { gap: 8px; }
  #pilot-fullscreen { width: 44px; min-height: 44px; }
  #pilot-fullscreen span { display: none; }
}
@media(max-width:700px) and (orientation:portrait), (max-width:540px) {
  #pilot-viewer { width: 100%; height: 100dvh; border-radius: 0; }
  .pilot-heading { padding: max(9px,env(safe-area-inset-top)) 12px 9px; gap: 8px; flex-wrap: wrap; }
  .pilot-heading div:not(.pilot-modes) { flex: 1; }
  .pilot-modes { order: 1; flex: 1 0 100%; }
  .pilot-modes button { flex: 1 1 auto; padding-inline: 8px; }
  #pilot-simulation-notice { padding: 6px 12px; font-size: 12px; }
  #pilot-illustration img { max-height: 40dvh; }
  .pilot-layout { display: flex; flex-direction: column; }
  .pilot-stage { flex: 1 1 auto; }
  .pilot-info { flex: 0 0 clamp(145px,30dvh,270px); border: 0; border-top: 1px solid #c4d4ca; padding: 10px 16px max(12px,env(safe-area-inset-bottom)); }
  .pilot-select { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; white-space: nowrap; }
  .pilot-select select { min-width: 0; }
  .pilot-stat { display: inline-block; margin: 2px 8px 0 0; font-size: 25px; }
  .pilot-denominator { display: inline; font-size: 13px; }
  .pilot-key { display: flex; flex-wrap: wrap; padding-block: 6px; margin-block: 4px; column-gap: 12px; }
  #pilot-tools { right: 8px; top: 8px; }
}
.compare-areas::after { content: '›'; font-size: 17px; line-height: 1; }
.zone-comparison { width: 100%; margin: 0 0 14px; border-collapse: collapse; table-layout: fixed; background: white; font-size: 12px; overflow-wrap: anywhere; }
.zone-comparison caption { padding: 3px 0 8px; text-align: left; color: var(--ink); font-size: 15px; font-weight: 700; }
.zone-comparison th, .zone-comparison td { border-bottom: 1px solid var(--line); padding: 6px 4px; text-align: left; }
.zone-comparison th { font-weight: 650; background: #eef3f3; }
.zone-comparison th:first-child { width: 18%; }
.zone-comparison th:last-child { width: 29%; }
.zone-comparison th:last-child, .zone-comparison td:last-child { text-align: right; }
.zone-comparison button { min-height: 34px; width: 100%; text-align: left; font-weight: 700; color: var(--blue); }
.zone-comparison .stage-badge { white-space: normal; line-height: 1.4; gap: 3px; }
.zone-comparison small { display: block; color: var(--sub); font-size: 11px; }
.zone-comparison tbody tr { cursor: pointer; }
.zone-comparison tbody tr:hover, .zone-comparison tr:focus-within, .zone-comparison tr.is-current { background: #edf6fa; }
#share-status:not(:empty) { position: fixed; z-index: 1000; bottom: max(20px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); padding: 10px 16px; border-radius: 9px; background: #183742; color: white; font-size: 14px; box-shadow: var(--shadow); }
@media (max-width:760px) {
  .project-summary { padding: 5px 13px 6px; }
  #town-detail .summary-identity h2 { font-size: 18px; }
  .project-summary .detail-district { font-size: 11px; }
  .summary-kpis > div { padding: 5px 7px; }
  .summary-badges { margin: 5px 0; }
  .detail-pane { padding: 8px 10px; }
}
#map-options { display: contents; }
#map-search-dock, #layer-open { display: none; }

@media (max-width:768px) {
  body:has(.workspace) .topbar { height: 42px; padding-inline: 15px; border: 0; }
  body:has(.workspace) .main-nav a[aria-current] { display: none; }
  body:has(.workspace) .brand-mark { width: 25px; height: 25px; }
  .workspace { position: relative; display: block; isolation: isolate; }
  .workspace > .map-stage { position: absolute; inset: 0; }
  #map-search-dock { display: block; position: absolute; z-index: 4; inset: 10px 12px auto auto; pointer-events: none; }
  #map-search-dock #layer-open { pointer-events: auto; border-radius: 22px; background: white; border: 1px solid #d2dfe3; padding: 0 14px; min-height: 42px; box-shadow: var(--shadow); }
  #explorer > #project-search { flex: none; padding: 0 12px 9px; }
  #explorer.collapsed > #project-search .filter-row,#explorer:has(#detail-view:not([hidden])) > #project-search { display: none; }
  #project-search { padding: 0; gap: 8px; background: none; }
  .search-line, .filter-row > * { pointer-events: auto; }
  .search-line { display: flex; align-items: center; padding-right: 5px; background: white; border: 1px solid #cad9df; border-radius: 17px; box-shadow: 0 3px 14px #163c5226; }
  .search-line:focus-within { border-color: #286d91; }
  .search-line .search-box { flex: 1; min-width: 0; border: 0; background: none; outline: none; padding: 0 13px; gap: 11px; }
  .search-line input { height: 48px; font-weight: 550; }
  .search-line #address-open { position: static; flex: none; min-height: 38px; padding: 4px 10px; border: 0; border-radius: 12px; box-shadow: none; background: #eef6f4; color: #145e54; font-size: 12px; }
  .filter-row { flex-wrap: nowrap; align-items: stretch; gap: 5px; }
  .filter-row select, .filter-row .stage-filters summary, #recent-filter, #layer-open {
    box-sizing: border-box; min-height: 38px; border: 1px solid #d2dfe3; border-radius: 20px;
    padding: 6px 10px; background-color: white; color: #254352; font-size: 12px; font-weight: 650; box-shadow: 0 2px 5px #163c5214;
  }
  .filter-row select { max-width: 90px; }
  .stage-filters { min-width: 0; }
  .filter-row .stage-filters summary { gap: 6px; }
  #filter-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22vw; }
  .filter-row select:has(option:checked:not([value=""])), .stage-filters[open] summary { color: #145e54; border-color: #579584; }
  #layer-open { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; white-space: nowrap; }
  .filter-menu { top: calc(100% + 6px); bottom: auto; max-height: min(56dvh,440px); }
  #explorer, #explorer:has(#detail-view:not([hidden])) {
    position: absolute; z-index: 3; inset: auto 8px calc(23px + env(safe-area-inset-bottom)); height: min(36%,340px);
    padding: 0; border: 1px solid #d7e2e7; border-radius: 21px; background: white; overflow: hidden;
    box-shadow: 0 5px 25px #183d5233;
  }
  #explorer.tall:not(.collapsed), #explorer.tall:has(#detail-view:not([hidden])) {
    height: 100%; inset: 0; border-radius: 18px 18px 0 0; z-index: 5;
  }
  #explorer.collapsed, #explorer.collapsed:has(#detail-view:not([hidden])) { height: auto; }
  #explorer.collapsed #panel-content { display: none; }
  #explorer.collapsed:has(#detail-view:not([hidden])) #panel-content { display: flex; flex: none; }
  #explorer.collapsed .detail-tabs, #explorer.collapsed .detail-pane { display: none; }
  #explorer.collapsed .decision-metrics { display: none; }
  #explorer:not(.collapsed):not(.tall) #town-detail { display: block; overflow-y: auto; }
  #explorer:not(.collapsed):not(.tall) .detail-tabs { position: sticky; top: 0; z-index: 1; background: white; }
  #explorer:not(.collapsed):not(.tall) .detail-pane { overflow: visible; }
  #explorer.tall .filter-menu { max-height: 55dvh; overflow: auto; }
  .sheet-tools { position: relative; gap: 4px; padding: 7px 13px 0; min-height: 43px; touch-action: none; }
  .sheet-tools::before { content: ''; position: absolute; width: 31px; height: 4px; border-radius: 4px; background: #becdd3; top: 5px; left: calc(50% - 15.5px); pointer-events: none; }
  #sheet-toggle { min-height: 39px; font-size: 14px; justify-content: space-between; }
  #sheet-toggle::before { display: none; }
  #sheet-toggle .chevron { margin-left: 6px; }
  #explorer:has(#detail-view:not([hidden])) #sheet-toggle { justify-content: flex-end; font-size: 13px; color: #246280; }
  #explorer.collapsed:has(#detail-view:not([hidden])) #sheet-size { display: none; }
  .sheet-tools .back { flex: initial; max-width: 60%; min-height: 36px; padding: 0 3px; border: 0; font-size: 12px; color: #486171; }
  #explorer.collapsed .project-summary { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 7px 10px; padding: 0 16px 14px; touch-action: none; }
  #explorer.collapsed .summary-identity { grid-column: 1 / -1; }
  #explorer.collapsed .summary-identity h2 { font-size: 21px; }
  #explorer.collapsed .summary-badges { margin: 0; }
  #explorer.collapsed .stage-explainer { grid-column: 1 / -1; grid-row: 4; }
  #explorer.collapsed .summary-badges .regulation-chip { display: none; }
  #explorer.collapsed .summary-badges > span { font-size: 12px; }
  #explorer.collapsed .summary-kpis { display: block; background: none; border: 0; }
  #explorer.collapsed .summary-kpis > div { display: none; }
  #explorer.collapsed .summary-kpis > div:nth-child(2) { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px; padding: 0; border: 0; }
  #explorer.collapsed .summary-kpis dt { font-size: 12px; }
  #explorer.collapsed .summary-kpis small { display: none; }
  #explorer.collapsed .cancel-notice { grid-column: 1 / -1; grid-row: 3; }
  #explorer.collapsed #town-detail { flex: none; }
  .map-stage #map-status, .map-stage #measure-status { top: 112px; bottom: auto; }
  #layer-dialog { margin: auto auto 0; width: min(100%,520px); max-height: 83dvh; border-radius: 22px 22px 0 0; padding: 19px 20px calc(20px + env(safe-area-inset-bottom)); }
  #layer-dialog #map-options { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; }
  #layer-dialog #address-open { position: static; display: block; width: 100%; min-height: 44px; }
  #layer-dialog .map-style-picker, #layer-dialog #cadastral, #layer-dialog .map-tools, #layer-dialog .legend, #layer-dialog .legend ul { position: static; box-shadow: none; }
  #layer-dialog .map-style-picker { display: flex; border-radius: 12px; background: #eff4f6; }
  #layer-dialog .map-style-picker button { flex: 1; min-height: 42px; }
  #layer-dialog #cadastral { justify-content: flex-start; min-height: 44px; }
  #layer-dialog .layer-switch { margin-left: auto; }
  #layer-dialog .map-tools { display: flex; flex-wrap: wrap; gap: 7px; }
  #layer-dialog .map-zoom { display: flex; gap: 4px; margin-left: auto; }
  #layer-dialog .map-tools button { min-height: 42px; }
  #layer-dialog .legend ul { width: auto; border: 0; border-top: 1px solid var(--line); }
}
@media(max-width:355px) {
  #map-search-dock { padding-inline: 7px; }
  .filter-row { gap: 3px; }
  #layer-open, #recent-filter, .filter-row .stage-filters summary { padding-inline: 8px; }
}
