:root {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", sans-serif;
  color: #1e3328;
  background: #faf8f2;
  --ink: #183c2d;
  --green: #235240;
  --muted: #56665d;
  --line: #dedfd5;
  --paper: #fcfbf7;
}
* { box-sizing: border-box }
[hidden] { display: none !important }
body { margin: 0; height: 100dvh; display: flex; flex-direction: column; overflow: hidden }
input, button, select { font: inherit; color: inherit }
button, select { cursor: pointer }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #57977a; outline-offset: 3px }
.top { height: 68px; flex: none; display: flex; justify-content: space-between; align-items: center; padding: 0 26px; background: var(--paper); border-bottom: 1px solid var(--line); position: relative; z-index: 5 }
.brand { display: flex; gap: 12px; align-items: center }
.mark { background: var(--green); color: white; width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-size: 26px }
h1, h2, p { margin: 0 }
h1 { color: var(--ink); font-size: 23px; font-weight: 850; letter-spacing: .075em; line-height: 1.18 }
.byline, .back { color: var(--muted); font-weight: 650; font-size: 13px }
.back { text-decoration: none }
.back:hover, .detail a:hover { text-decoration: underline }
.layout { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: 328px 1fr }
.directory { overflow: auto; overscroll-behavior: contain; background: var(--paper); border-right: 1px solid var(--line); z-index: 3 }
.filters { padding: 22px 18px 17px; border-bottom: 1px solid var(--line) }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px }
.filters h2 { font-size: 23px; color: var(--ink) }
.plain { border: 0; background: transparent; color: var(--muted); font-size: 14px; padding: 5px }
.search { display: flex; margin: 13px 0 17px; min-height: 43px; border: 1px solid #c9d2c9; border-radius: 9px; background: #fff; align-items: stretch }
.search input { padding: 0 10px; width: 100%; min-width: 0; border: 0; border-radius: 9px; background: transparent; font-size: 14px }
.search button { flex: none; padding: 0 11px; border: 0; border-left: 1px solid var(--line); border-radius: 0 8px 8px 0; background: #eef2ea; color: var(--green); font-weight: 700; font-size: 14px }
fieldset { margin: 0 0 12px; padding: 0; border: 0; min-width: 0 }
legend { margin-bottom: 6px; padding: 0; color: var(--muted); font-size: 13px; font-weight: 700 }
.chips { display: flex; flex-wrap: wrap; gap: 6px }
.chips button { background: #fffefa; border: 1px solid #cdd4c9; padding: 6px 11px; border-radius: 7px; font-weight: 650; font-size: 14px; min-height: 35px; }
.chips button[aria-pressed=true] { background: var(--green); color: #fff; border-color: var(--green) }
.chips .with-swatch { display: inline-flex; align-items: center; gap: 6px }
.chips .with-swatch::before { content: ""; width: 10px; height: 10px; flex: none; border-radius: 50%;
  background: var(--tone); border: 1px solid #fff }
.chips .with-swatch[data-filter="presale"]::before { width: 12px; height: 12px }
.options { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 14px }
.options label { display: flex; align-items: center; gap: 5px }
.options input, .map-text-setting input { accent-color: var(--green); width: 17px; height: 17px; margin: 0 }
.map-text-setting { display: flex; align-items: center; gap: 5px; min-height: 35px; margin-top: 5px; font-size: 14px }
.options select { border: 1px solid #cdd4c9; background: white; padding: 5px 3px; border-radius: 7px; max-width: 120px }
.location-filters { border-block-end: 1px solid var(--line); padding-block-end: 11px }
.location-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px }
.location-fields label { display: grid; gap: 5px; font-weight: 700; color: var(--ink); font-size: 14px }
.location-fields select { width: 100%; min-height: 39px; border: 1px solid #cdd4c9; border-radius: 7px; background: white; padding: 5px 7px }
.location-filters p { margin-top: 6px; font-size: 12px; line-height: 1.5; color: var(--muted) }
.location-filters a { color: var(--green); text-underline-offset: 2px }
.show-filtered-map { display: none }
.list-area { padding: 15px 12px; }
.list-area .section-title, .list-note { margin-inline: 6px }
.list-area h2 { font-size: 17px }
#count, .list-note { font-size: 13px; color: var(--muted) }
.list-note { margin-top: 5px; line-height: 1.5 }
#results { padding: 0; margin: 8px 0; list-style: none }
#results li + li { border-top: 1px solid #e9e9df }
.result { width: 100%; display: grid; grid-template-columns: 9px 1fr auto; align-items: start; gap: 9px; text-align: left; padding: 10px 9px; border: 0; border-radius: 7px; background: none }
.result:hover, .result[aria-current=true] { background: #eaf0e3 }
.result b, .result small { display: block }
.result b { font-size: 15px; line-height: 1.35 }
.result small { margin-top: 3px; font-size: 12px; color: var(--muted) }
.result em { text-align: right; font-size: 13px; font-style: normal; font-weight: 750; align-self: center; max-width: 82px }
.dot { width: 8px; height: 8px; background: var(--tone); border-radius: 50%; margin-top: 5px }
.map-area { position: relative; min-width: 0; isolation: isolate; background: #e8ece2 }
#map { position: absolute; inset: 0 }
.mobile-toolbar { display: none }
.map-pin { display: grid; grid-auto-flow: column; gap: 6px; align-items: center; border: 1px solid #fff; border-radius: 8px; padding: 4px 7px; background: #fffef8; color: #203628; box-shadow: 0 1px 6px #25352a48; line-height: 1; white-space: nowrap; font-weight: 750; font-size: 12px }
.map-pin::before { content: ""; display: block; width: 8px; height: 8px; border-radius: 50%; background: var(--tone) }
.map-pin em { font-size: 11px; font-style: normal; color: #425248 }
.map-pin.current { background: var(--paper); color: var(--ink); border-color: var(--tone); z-index: 1 }
.detail { position: absolute; z-index: 3; right: 15px; top: 14px; width: min(295px, calc(100% - 30px)); padding: 15px; background: var(--paper); border: 1px solid #d5d9cd; border-radius: 13px; box-shadow: 0 5px 20px #24312625 }
.detail { max-height: min(70dvh, 700px); overflow: auto; overscroll-behavior: contain }
.history-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px }
.history-actions button { min-height: 37px }
.history-actions [aria-expanded="true"] { background: var(--green); color: white }
.record-remarks { margin-top: 12px; padding: 9px; background: #fff4d9; border: 1px solid #e9ca86; border-radius: 7px }
.record-remarks summary { color: #663d00; cursor: pointer; font-size: 14px; font-weight: 750 }
.record-remarks p { margin-top: 6px }
.result .result-remark { color: #734500; font-weight: 700 }
.detail h2 { color: var(--ink); font-size: 20px; margin: 5px 30px 4px 0 }
.detail .kind, .detail small, .detail p { color: var(--muted); font-size: 13px; line-height: 1.55 }
.detail dl { display: grid; grid-template-columns: 70px 1fr; gap: 6px; margin: 12px 0; font-size: 14px }
.detail dt { color: var(--muted) }
.detail dd { margin: 0; font-weight: 650 }
.detail .close { position: absolute; right: 8px; top: 7px; width: 32px; height: 32px; border: 0; background: transparent; font-size: 23px }
.detail a { display: inline-block; color: #1d5e45; margin-top: 8px; font-size: 13px; font-weight: 750 }
.related-projects { margin: 11px 0 4px; }
.door-evidence { margin-top: 10px; font-size: 13px; color: var(--muted); }
.door-evidence summary { cursor: pointer; font-weight: 700; }
.door-evidence p { padding: 3px 0 0 12px; }
.map-guide { position: absolute; z-index: 1; bottom: 33px; left: 12px; width: min(405px,calc(100% - 138px)); display: grid; gap: 6px }
.legend { background: var(--paper); border: 1px solid var(--line); box-shadow: 0 3px 14px #24312618; border-radius: 9px; padding: 9px 12px }
.legend { display: flex; flex-wrap: wrap; gap: 8px 13px; align-items: center; font-size: 12px; color: var(--muted) }
.legend span { display: flex; align-items: center; gap: 4px; }
.legend span[hidden] { display: none; }
.legend i { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--tone) }
.legend [data-type="presale"] { color: var(--ink); font-weight: 800 }
.legend [data-type="presale"] i { width: 12px; height: 12px }
.dot.has-history, .map-pin.has-history::before { outline: 1px solid #1f2937; outline-offset: 1px }
.type-legend, .sale-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 12px }
.sale-legend { flex-basis: 100%; padding-top: 6px; border-top: 1px solid var(--line);
  color: var(--ink); font-size: 13px; font-weight: 650 }
.sale-legend[hidden] { display: none }
.sale-legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap }
.sale-legend .legend-history { outline: 1.5px solid #1f2937; background: #007c86; border: 1px solid #fff }
.sale-legend .legend-remark { display: grid; place-items: center; width: 12px; height: 12px;
  background: #ef9700; color: #301900; border: 1px solid #633900; font-size: 9px; font-style: normal }
#map-status { position: absolute; z-index: 2; bottom: 83px; left: 12px; right: 12px; max-width: 310px; padding: 8px 11px; background: var(--paper); border-radius: 8px; font-size: 13px }
@media (max-width: 740px) {
 .show-filtered-map { display: block; margin-top: 8px; min-height: 36px }
 .top { height: 56px; padding: 0 12px }
 h1 { font-size: 19px }
 .mark { width: 34px; height: 34px; font-size: 21px }
 .back, .byline { font-size: 11px }
 .layout { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr) }
 .mobile-toolbar { display: flex; padding: 5px 10px; background: var(--paper); border-bottom: 1px solid var(--line); min-height: 47px }
 .mobile-toolbar button { min-height: 36px }
 .map-area { grid-row: 2 }
 .directory { position: absolute; inset: 51px 10px 10px; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 5px 30px #24312630; visibility: hidden }
 .directory.open { visibility: visible }
 .detail { top: auto; bottom: 74px; right: 8px; width: min(320px, calc(100% - 16px)); padding: 12px }
 .detail h2 { font-size: 18px }
 .detail dl { margin: 7px 0; gap: 3px 6px }
 .map-guide { bottom: 49px; left: 8px; width: min(300px,calc(100% - 124px)); }
 .legend { padding: 6px 8px }
 .legend { gap: 5px 8px; font-size: 11px }
 .filters { padding-top: 14px }
}
.levels { display: flex; gap: 5px; margin: 0 0 8px }
.levels span { background: #edf0e7; color: var(--green); border: 1px solid #dbe2d5; border-radius: 4px; padding: 2px 5px; font-size: 12px; font-weight: 700 }
@media(max-width: 740px) {
  .layout:has(.directory.open) .map-area { isolation: auto }
}
.street-button { font-size: 13px; font-weight: 750; border: 1px solid #c9d2c9; background: #edf2e8; color: var(--green); border-radius: 7px; padding: 7px 10px; }
#more-results { width: 100%; margin-top: 6px; }
.detail.with-sales { width: min(488px, calc(100% - 30px)); max-height: min(75vh, 760px); overflow: auto; overscroll-behavior: contain; }
.transactions { padding-top: 10px; margin-top: 10px; border-top: 1px solid var(--line); }
.transactions h3 { margin: 0 0 7px; font-size: 16px; }
.sales-tools { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; margin: 0 0 6px; }
.sales-tools select { padding: 5px; border: 1px solid #c9d2c9; background: white; border-radius: 6px; font-size: 13px; }
.sales-tools label { display: flex; align-items: center; font-size: 13px; }
.sales-tools input { accent-color: var(--green); }
.sales-summary { margin: 6px 0; font-weight: 750; }
.sales-table { overflow: auto; max-height: min(38vh, 310px); border: 1px solid var(--line); border-radius: 7px; margin-bottom: 8px; }
.sales-table table { width: 100%; min-width: 396px; border-collapse: collapse; font-size: 12px; }
.sales-table th { position: sticky; top: 0; background: #eaf0e3; z-index: 1; white-space: nowrap; }
.sales-table td,.sales-table th { text-align: right; padding: 5px; border-bottom: 1px solid var(--line); }
.sales-table td:first-child,.sales-table th:first-child { text-align: left; white-space: nowrap; }
.sales-table td small { display: block; font-size: 11px; }
.sales-table td.transaction-address { text-align: left; min-width: 115px; max-width: 215px; overflow-wrap: anywhere }
.transactions > button { margin-bottom: 7px; }
@media (max-width: 740px) {
  .detail.with-sales { width: calc(100% - 16px); max-height: min(64dvh, 605px); bottom: 67px; }
  .sales-table { max-height: 26vh; }
}
.header-links { display:flex; gap:16px; align-items:center; }
.district-options { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px }
.district-choices { display: flex; flex-wrap: wrap; gap: 6px }
.district-choices label { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 5px 8px;
  border: 1px solid #cdd4c9; border-radius: 7px; cursor: pointer; font-size: 14px; font-weight: 650 }
.district-choices label:has(input:checked) { background: #e9f0e8; border-color: #80a58c; color: var(--green) }
.district-choices input { accent-color: var(--green); width: 16px; height: 16px; margin: 0 }
.data-update { margin-top: 5px; font-size: 12px; color: var(--muted); line-height: 1.45 }
#overview:disabled { opacity: .55; cursor: default }
@media(max-width:740px) {
 .header-links { gap:8px; text-align:right; }
 .header-links .back { font-size:10px; white-space:nowrap; }
 h1 { font-size:17px; }
 .brand { gap:6px; }
}
.map-pin { min-height:25px; padding:5px 7px; }
.map-pin span { max-width:130px; overflow:hidden; text-overflow:ellipsis; }
.map-pin em { background:#e9efe5; color:#214736; border-radius:4px; padding:2px 4px; font-weight:800; }
.map-pin.current em { background:#f3f8ee; color:#204c38; }
