:root {
  --bg: #f5f5f2;
  --panel: #ffffff;
  --panel-strong: #fafaf8;
  --line: #e4e4df;
  --text: #1f2328;
  --muted: #66707a;
  --accent: #0d6b61;
  --accent-soft: #e6f4f1;
  --accent-strong: #0b564f;
  --warm: #a95a2a;
  --warm-soft: #f5ebe5;
  --shadow: 0 8px 28px rgba(18, 28, 45, 0.08);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: "Noto Sans TC", sans-serif;
  background: var(--bg);
}

body {
  padding: 14px;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

.app-tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  box-shadow: 0 5px 18px rgba(18, 28, 45, 0.06);
}

.app-tab {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: transparent;
  color: var(--muted);
  font: 700 0.88rem "Space Grotesk", sans-serif;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.app-tab:hover {
  color: var(--text);
}

.app-tab.active {
  background: var(--text);
  color: #fff;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 18px;
}

.sidebar,
.map-panel,
.detail-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-lg);
  height: calc(100vh - 56px);
  overflow: hidden;
}

.brand-block h1,
.map-header h2,
.detail-card h2,
.detail-empty h2,
.section-head h2 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.brand-block h1 {
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  line-height: 0.96;
}

.lede {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stat-card {
  padding: 14px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-card strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.5rem;
}

.controls-panel,
.legend-panel,
.list-panel,
.map-panel,
.detail-panel {
  border-radius: var(--radius-lg);
}

.controls-panel,
.legend-panel {
  padding: 14px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.search-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--muted);
}

.search-field input {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 13px 16px;
  font: inherit;
  color: var(--text);
  background: #fffdf7;
}

.search-field input:focus {
  outline: 2px solid rgba(15, 109, 100, 0.25);
  outline-offset: 2px;
}

.filter-block + .filter-block {
  margin-top: 14px;
}

.filter-head,
.section-head,
.detail-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.filter-head {
  margin-bottom: 10px;
  font-size: 0.92rem;
  color: var(--muted);
}

.ghost-button {
  border: none;
  padding: 0;
  background: none;
  color: var(--accent-strong);
  font: inherit;
  cursor: pointer;
}

.chip-row,
.tag-row,
.link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fffdf7;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}

.chip:hover,
.chip.active {
  color: var(--accent-strong);
  border-color: rgba(15, 109, 100, 0.22);
  background: var(--accent-soft);
}

.legend-panel {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.house-dot {
  background: var(--accent);
}

.station-dot {
  background: var(--warm);
}

.selected-dot {
  background: #fff;
  border: 3px solid #111;
}

.list-panel {
  padding: 14px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.section-head {
  margin-bottom: 12px;
}

.section-head > div:first-child {
  min-width: 0;
}

.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.update-status {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.update-button {
  border: 1px solid rgba(15, 109, 100, 0.22);
  border-radius: 999px;
  padding: 7px 11px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font: 700 0.78rem "Noto Sans TC", sans-serif;
  cursor: pointer;
  white-space: nowrap;
}

.update-button:hover {
  border-color: var(--accent);
  background: #d9efeb;
}

.update-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.status-badge,
.group-pill,
.price-badge,
.link-pill,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  font-size: 0.82rem;
}

.status-badge {
  background: var(--warm-soft);
  color: var(--warm);
  padding: 6px 10px;
}

.house-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.house-list::-webkit-scrollbar {
  width: 10px;
}

.house-list::-webkit-scrollbar-track {
  background: transparent;
}

.house-list::-webkit-scrollbar-thumb {
  background: #cfd5d9;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.house-list::-webkit-scrollbar-thumb:hover {
  background: #b8c0c6;
  background-clip: content-box;
}

.house-card {
  width: 100%;
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: var(--radius-md);
  background: #fff;
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: left;
  appearance: none;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.house-card:hover,
.house-card.active {
  transform: translateY(-1px);
  border-color: rgba(15, 109, 100, 0.26);
  box-shadow: 0 8px 18px rgba(15, 109, 100, 0.08);
}

.house-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.house-card h3 {
  margin: 0;
  font-size: 1rem;
}

.house-card p {
  margin: 0;
}

.house-meta {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.house-walkability {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px !important;
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
}

.house-walkability span {
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--accent-soft);
  font-size: 0.72rem;
}

.group-pill {
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 7px 12px;
}

.price-badge {
  background: rgba(35, 24, 15, 0.08);
  color: var(--text);
  padding: 7px 12px;
}

.main-stage {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
  gap: 18px;
  height: calc(100vh - 56px);
}

.map-panel,
.detail-panel {
  padding: 16px;
  min-height: 0;
}

.map-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 10px;
}

.map-note {
  max-width: 220px;
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
  font-size: 0.92rem;
}

.map-canvas {
  width: 100%;
  height: calc(100% - 60px);
  min-height: 620px;
  border-radius: 16px;
  overflow: hidden;
}

.detail-panel {
  background: var(--panel);
  display: flex;
  overflow: hidden;
}

.detail-empty,
.detail-card {
  width: 100%;
  height: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  overflow-y: auto;
}

.detail-empty {
  display: grid;
  place-content: center;
  min-height: 230px;
}

.detail-empty p:last-child {
  max-width: 460px;
  color: var(--muted);
  line-height: 1.5;
}

.detail-card.hidden {
  display: none;
}

.detail-address,
.detail-price-note,
.detail-analysis {
  color: var(--muted);
  line-height: 1.55;
}

.detail-walkability {
  margin: 12px 0;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 10px 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.45;
}

.detail-section + .detail-section {
  margin-top: 18px;
}

.detail-section h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.tag {
  padding: 7px 12px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
}

.link-pill {
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
  color: var(--accent-strong);
}

.link-pill:hover {
  background: var(--accent-soft);
}

.observation-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.5;
}

.page-footer {
  margin-top: 12px;
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 10px 22px rgba(18, 28, 45, 0.12) !important;
}

.leaflet-top.leaflet-right {
  top: 14px;
  right: 14px;
}

.leaflet-control-zoom a {
  width: 46px !important;
  height: 46px !important;
  line-height: 42px !important;
  font-size: 1.5rem !important;
  border: 1px solid var(--line) !important;
  color: var(--text) !important;
}

.leaflet-control-zoom a:first-child {
  border-top-left-radius: 14px !important;
  border-top-right-radius: 14px !important;
}

.leaflet-control-zoom a:last-child {
  border-bottom-left-radius: 14px !important;
  border-bottom-right-radius: 14px !important;
}

.leaflet-control-zoom a:hover {
  background: var(--accent-soft) !important;
}

.status-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 14px;
  padding: 22px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.98), rgba(236, 244, 241, 0.96)),
    repeating-linear-gradient(90deg, transparent 0 36px, rgba(13, 107, 97, 0.03) 36px 37px);
  box-shadow: var(--shadow);
}

.status-hero h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3.5vw, 3.1rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.status-intro {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.status-date {
  flex: none;
  padding-left: 22px;
  border-left: 1px solid var(--line);
  text-align: right;
}

.status-date span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font: 500 0.78rem "Space Grotesk", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-date strong {
  font: 700 1.35rem "Space Grotesk", sans-serif;
}

.status-shell {
  display: grid;
  grid-template-columns: minmax(300px, 355px) minmax(0, 1fr);
  gap: 18px;
  min-height: 680px;
  height: calc(100vh - 236px);
}

.status-sidebar,
.status-map-panel,
.status-detail-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.status-sidebar {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  overflow: hidden;
}

.reading-guide,
.status-filter-panel,
.status-list-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-strong);
}

.reading-guide {
  padding: 14px;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.guide-grid article {
  min-width: 0;
  padding: 10px;
  border-radius: 10px;
  background: #fff;
}

.guide-number {
  display: block;
  margin-bottom: 7px;
  color: var(--accent);
  font: 700 0.72rem "Space Grotesk", sans-serif;
}

.guide-grid strong {
  display: block;
  font-size: 0.82rem;
}

.guide-grid p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.status-filter-panel {
  padding: 13px;
}

.status-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  font-size: 0.8rem;
}

.status-filter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-list-panel {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  padding: 13px;
  overflow: hidden;
}

.status-list {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 7px;
  padding-right: 4px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.status-list::-webkit-scrollbar,
.status-detail::-webkit-scrollbar {
  width: 9px;
}

.status-list::-webkit-scrollbar-thumb,
.status-detail::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #cfd5d9;
  background-clip: content-box;
}

.status-list-item {
  position: relative;
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.status-list-item:hover,
.status-list-item.active {
  border-color: #aeb7bd;
  box-shadow: 0 7px 16px rgba(18, 28, 45, 0.07);
}

.status-list-bar {
  align-self: stretch;
  border-radius: 999px;
}

.status-list-copy {
  min-width: 0;
}

.status-list-copy strong,
.status-list-copy span {
  display: block;
}

.status-list-copy strong {
  overflow: hidden;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-list-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.75rem;
}

.status-mini-badge,
.status-progress {
  border-radius: 999px;
  font-size: 0.7rem;
  line-height: 1.2;
}

.status-mini-badge {
  max-width: 92px;
  padding: 5px 7px;
  text-align: center;
}

.live {
  background: #e6f4ee;
  color: #186743;
}

.building {
  background: #fff0dc;
  color: #8d4f13;
}

.planning {
  background: #e8edf5;
  color: #435a78;
}

.status-stage {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(270px, 0.9fr);
  gap: 18px;
  min-height: 0;
}

.status-map-panel,
.status-detail-panel {
  min-height: 0;
  padding: 16px;
}

.status-map-panel {
  display: flex;
  flex-direction: column;
}

.status-map-panel .map-header h2 {
  font-size: 1.45rem;
  line-height: 1.15;
  white-space: nowrap;
}

.status-map {
  min-height: 520px;
  flex: 1;
  border-radius: 16px;
  overflow: hidden;
}

.status-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 12px;
}

.status-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.75rem;
}

.status-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-detail-panel {
  display: flex;
  overflow: hidden;
}

.status-detail {
  width: 100%;
  overflow-y: auto;
}

.status-detail-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.status-category-pill,
.status-progress {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 700;
}

.status-detail-area {
  margin: 22px 0 5px;
  color: var(--muted);
  font-size: 0.82rem;
}

.status-detail h2 {
  margin: 0;
  font-size: clamp(1.55rem, 2.3vw, 2.3rem);
  line-height: 1.1;
}

.status-detail-summary {
  margin: 13px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.value-signal {
  margin: 20px 0;
  padding: 15px;
  border-left: 4px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: var(--accent-soft);
}

.value-signal span,
.value-signal strong {
  display: block;
}

.value-signal span {
  margin-bottom: 4px;
  color: var(--accent-strong);
  font: 500 0.72rem "Space Grotesk", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-detail section + section {
  margin-top: 20px;
}

.status-detail section h3 {
  margin: 0 0 7px;
  font-size: 0.9rem;
}

.status-detail section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
}

.status-footer {
  max-width: 900px;
}

@media (max-width: 900px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .main-stage {
    min-height: auto;
  }

  .sidebar {
    height: auto;
  }

  .main-stage {
    height: auto;
  }

  .list-panel {
    max-height: 42vh;
  }

  .status-shell {
    grid-template-columns: 1fr;
    height: auto;
  }

  .status-sidebar {
    max-height: 560px;
  }

  .status-stage {
    min-height: 650px;
  }
}

@media (max-width: 560px) {
  body {
    padding: 10px;
  }

  .sidebar,
  .map-panel,
  .detail-panel {
    padding: 16px;
  }

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

  .map-header {
    flex-direction: column;
  }

  .map-note {
    max-width: none;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .list-panel .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-actions {
    justify-content: flex-start;
  }

  .map-canvas {
    min-height: 460px;
  }

  .app-tabs {
    display: flex;
    width: 100%;
  }

  .app-tab {
    flex: 1;
    padding-inline: 10px;
  }

  .status-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px;
  }

  .status-date {
    padding: 0;
    border: 0;
    text-align: left;
  }

  .status-stage {
    grid-template-columns: 1fr;
  }

  .status-map {
    min-height: 480px;
  }

  .status-detail-panel {
    min-height: 480px;
  }

  .status-legend {
    justify-content: flex-start;
  }
}
