@font-face {
  font-family: "Tung Thien Sans";
  src: url("/fonts/tung-thien-sans-regular.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Tung Thien Sans";
  src: url("/fonts/tung-thien-sans-bold.woff") format("woff");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Tung Thien Serif";
  src: url("/fonts/tung-thien-serif-regular.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Tung Thien Serif";
  src: url("/fonts/tung-thien-serif-bold.woff") format("woff");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --forest-950: #063c2f;
  --forest-900: #00583f;
  --forest-800: #006f4e;
  --forest-700: #0a825d;
  --forest-100: #e9f4ee;
  --water: #117ea8;
  --red: #d93d43;
  --gold: #d5a94d;
  --gold-dark: #9e7117;
  --cream: #f4e6cb;
  --paper: #f8faf7;
  --mist: #edf4ef;
  --ink: #153a31;
  --muted: #63766f;
  --line: #d7e3db;
  --white: #ffffff;
  --shadow: 0 24px 65px rgba(5, 52, 40, 0.14);
  --soft-shadow: 0 11px 30px rgba(5, 52, 40, 0.09);
  --font-sans: "Tung Thien Sans", "Segoe UI", Arial, sans-serif;
  --font-serif: "Tung Thien Serif", "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

img {
  display: block;
  max-width: 100%;
}

fieldset {
  min-width: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: 10px;
  color: var(--forest-950);
  background: var(--white);
  font-weight: 750;
}

.skip-link:focus {
  top: 16px;
}

.data-ribbon {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 5px 16px;
  color: #fff8e9;
  background: var(--forest-950);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.data-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(213, 169, 77, 0.16);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 800;
  border-bottom: 1px solid rgba(0, 111, 78, 0.12);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(1460px, calc(100% - 40px));
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 5px 8px rgba(7, 62, 49, 0.12));
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy small {
  color: var(--forest-800);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.055em;
  white-space: nowrap;
}

.brand-copy strong {
  color: var(--forest-950);
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.15;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav > a {
  position: relative;
  padding: 10px 13px;
  color: #405e55;
  font-size: 14px;
  font-weight: 750;
}

.main-nav > a::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.main-nav > a:hover,
.main-nav > a.active {
  color: var(--forest-800);
}

.main-nav > a:hover::after,
.main-nav > a.active::after {
  transform: scaleX(1);
}

.menu-toggle {
  display: none;
  width: 43px;
  height: 43px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  cursor: pointer;
}

.menu-toggle > span:not(.sr-only) {
  display: block;
  width: 19px;
  height: 2px;
  margin: 4px auto;
  border-radius: 2px;
  background: var(--forest-900);
}

.hero {
  position: relative;
  overflow: hidden;
  color: var(--white);
  background: linear-gradient(115deg, var(--forest-950) 0%, var(--forest-800) 67%, #0c755c 100%);
}

.hero-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image: radial-gradient(circle at 2px 2px, #fff 1px, transparent 0);
  background-size: 26px 26px;
  mask-image: linear-gradient(90deg, #000, transparent 90%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: min(1460px, calc(100% - 40px));
  min-height: 226px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 220px;
  align-items: center;
  gap: 45px;
  padding: 34px 0;
}

.hero-copy {
  max-width: 1080px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 9px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f2cf7f;
}

.eyebrow span {
  width: 30px;
  height: 1px;
  background: currentColor;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.hero h1 em {
  color: #f2cc75;
  font-style: normal;
}

@media (min-width: 1081px) {
  .hero h1 {
    font-size: clamp(40px, 4.2vw, 64px);
    white-space: nowrap;
  }
}

.hero-copy > p:last-child {
  max-width: 720px;
  margin: 15px 0 0;
  color: rgba(255, 255, 255, 0.83);
  font-size: 17px;
}

.hero-logo {
  justify-self: end;
  width: 170px;
}

.hero-logo img {
  filter: drop-shadow(0 18px 25px rgba(0, 0, 0, 0.2));
}

.explorer,
.featured {
  width: min(1460px, calc(100% - 40px));
  margin: 0 auto;
  padding-top: 58px;
  scroll-margin-top: 92px;
}

.section-intro {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 48px;
  margin-bottom: 22px;
}

.section-intro h2,
.about-copy h2 {
  margin: 0;
  color: var(--forest-950);
  font-family: var(--font-serif);
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.section-intro > p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.section-kicker {
  color: var(--forest-700);
}

.map-workspace {
  min-height: 760px;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.filter-panel {
  min-width: 0;
  max-height: 760px;
  display: flex;
  flex-direction: column;
  padding: 22px 18px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #fff 0%, #f7faf8 100%);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.panel-heading h3 {
  margin: 1px 0 0;
  color: var(--forest-950);
  font-family: var(--font-serif);
  font-size: 22px;
}

.panel-kicker {
  color: var(--forest-700);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.record-total {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--forest-800);
  background: var(--forest-100);
  font-size: 11px;
  font-weight: 850;
}

.search-box {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid #cbdad1;
  border-radius: 12px;
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box:focus-within {
  border-color: var(--forest-700);
  box-shadow: 0 0 0 4px rgba(7, 130, 91, 0.1);
}

.search-box svg {
  width: 20px;
  fill: none;
  stroke: var(--forest-700);
  stroke-width: 2;
  stroke-linecap: round;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
}

.search-box input::placeholder {
  color: #84968f;
}

.filter-scroll {
  min-height: 0;
  overflow-y: auto;
  padding: 2px 5px 0 0;
  scrollbar-width: thin;
  scrollbar-color: #b7c9bf transparent;
}

.filter-group {
  margin: 17px 0 0;
  padding: 0 0 15px;
  border: 0;
  border-bottom: 1px solid #e4ece7;
}

.filter-group legend {
  width: 100%;
  margin-bottom: 7px;
  color: var(--forest-950);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.filter-group label {
  min-height: 34px;
  display: grid;
  grid-template-columns: 20px 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 4px 2px;
  color: #294a40;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.filter-group label:hover {
  color: var(--forest-800);
}

.filter-group input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-mark {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border: 1px solid #8fa59b;
  border-radius: 4px;
  background: var(--white);
}

.filter-group input:checked + .check-mark {
  border-color: var(--forest-800);
  background: var(--forest-800);
}

.filter-group input:checked + .check-mark::after {
  content: "✓";
  color: var(--white);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.filter-group input:focus-visible + .check-mark {
  outline: 3px solid rgba(14, 127, 169, 0.2);
  outline-offset: 2px;
}

.filter-group small {
  color: #879991;
  font-size: 11px;
  font-weight: 750;
}

.rank-dot {
  width: 10px;
  height: 10px;
  justify-self: center;
  border-radius: 50%;
  background: #7f918a;
}

.rank-dot.national {
  background: var(--red);
}

.rank-dot.city {
  background: var(--water);
}

.type-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  justify-self: center;
  border-radius: 7px;
  color: var(--white);
  background: var(--forest-800);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.type-icon.chua {
  background: var(--gold-dark);
}

.type-icon.den {
  background: var(--red);
}

.type-icon.mieu {
  background: var(--water);
}

.type-icon.complex {
  background: #76519f;
}

.type-icon.van_chi {
  background: #8b5f2b;
}

.reset-button {
  width: 100%;
  min-height: 39px;
  margin-top: 14px;
  border: 1px solid var(--forest-800);
  border-radius: 10px;
  color: var(--forest-800);
  background: var(--white);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.reset-button:hover {
  color: var(--white);
  background: var(--forest-800);
}

.filter-count {
  display: grid;
  justify-items: center;
  margin: 14px 0;
  padding: 12px;
  border-radius: 12px;
  color: var(--forest-950);
  background: #eaf4fb;
}

.filter-count strong {
  font-family: var(--font-serif);
  font-size: 25px;
  line-height: 1;
}

.filter-count span {
  margin-top: 3px;
  font-size: 11px;
}

.filter-count small {
  margin-top: 2px;
  color: var(--water);
  font-size: 10px;
  font-weight: 750;
}

.list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 1px 9px;
}

.list-heading strong {
  font-size: 13px;
}

.list-heading span {
  color: var(--muted);
  font-size: 11px;
}

.heritage-list {
  display: grid;
  gap: 7px;
}

.place-card {
  width: 100%;
  display: grid;
  grid-template-columns: 41px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s, border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.place-card:hover {
  transform: translateY(-1px);
  border-color: var(--line);
  background: var(--white);
}

.place-card.active {
  border-color: rgba(0, 111, 78, 0.25);
  background: var(--white);
  box-shadow: var(--soft-shadow);
}

.place-card.unmapped .place-symbol {
  filter: grayscale(0.72);
  opacity: 0.72;
}

.place-symbol {
  width: 41px;
  height: 41px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--white);
  background: var(--forest-800);
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 900;
}

.type-icon-svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.place-symbol .type-icon-svg {
  width: 24px;
  height: 24px;
}

.place-symbol.chua {
  background: var(--gold-dark);
}

.place-symbol.den {
  background: var(--red);
}

.place-symbol.mieu {
  background: var(--water);
}

.place-symbol.complex {
  background: #76519f;
}

.place-symbol.van_chi {
  background: #8b5f2b;
}

.place-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.place-copy strong,
.place-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-copy strong {
  font-size: 13px;
}

.place-copy span {
  color: var(--muted);
  font-size: 11px;
}

.place-location-state {
  color: #8ba097;
  font-size: 18px;
}

.place-location-state.missing {
  color: var(--red);
  font-size: 15px;
}

.empty-state {
  padding: 28px 12px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.map-panel {
  min-width: 0;
  min-height: 760px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 17px;
  background: #f3f7f4;
}

.map-toolbar {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 4px 14px;
}

.map-heading {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.map-toolbar-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 15px;
}

.map-toolbar strong {
  overflow: hidden;
  font-family: var(--font-serif);
  font-size: 21px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.live-label i {
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 4px;
  border-radius: 50%;
  background: #29a96b;
  box-shadow: 0 0 0 4px rgba(41, 169, 107, 0.12);
}

.map-link {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--forest-800);
  font-size: 13px;
  font-weight: 850;
}

.map-link:hover {
  color: var(--forest-950);
}

.map-link[aria-disabled="true"] {
  color: #9ca9a4;
  pointer-events: none;
}

.map-link svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-boundary-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid rgba(191, 51, 51, 0.34);
  border-radius: 10px;
  color: #a72525;
  background: #fff8f7;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.map-boundary-button:hover {
  border-color: #d84545;
  background: #fff0ee;
  transform: translateY(-1px);
}

.map-boundary-button:focus-visible {
  outline: 3px solid rgba(216, 69, 69, 0.2);
  outline-offset: 2px;
}

.map-boundary-button svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-stage {
  position: relative;
  min-height: 570px;
  overflow: hidden;
  border: 1px solid #c7d8ce;
  border-radius: 18px;
  background: #e4eee8;
}

#heritage-map {
  width: 100%;
  height: 100%;
  min-height: 570px;
  z-index: 1;
  font-family: var(--font-sans);
}

.map-error {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  padding: 30px;
  color: var(--forest-950);
  background: var(--mist);
  text-align: center;
}

.map-error[hidden] {
  display: none;
}

.map-error span {
  color: var(--muted);
  font-size: 13px;
}

.map-legend {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 450;
  display: flex;
  flex-wrap: wrap;
  gap: 9px 13px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 7px 20px rgba(7, 62, 49, 0.14);
  font-size: 10px;
  font-weight: 800;
}

.map-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-pin {
  width: 23px;
  height: 23px;
  display: grid;
  flex: 0 0 23px;
  place-items: center;
  border-radius: 7px;
  color: var(--white);
  background: var(--forest-800);
  box-shadow: 0 2px 7px rgba(8, 61, 46, 0.2);
  font-style: normal;
}

.legend-pin .type-icon-svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.45;
}

.legend-pin.chua {
  background: var(--gold-dark);
}

.legend-pin.den {
  background: var(--red);
}

.legend-pin.mieu {
  background: var(--water);
}

.legend-pin.complex {
  background: #76519f;
}

.legend-pin.van_chi {
  background: #8b5f2b;
}

.legend-boundary {
  width: 22px;
  height: 0;
  display: inline-block;
  border-top: 3px dashed #e13d3d;
}

.boundary-tooltip {
  border: 1px solid rgba(225, 61, 61, 0.35);
  border-radius: 8px;
  color: #8f2222;
  box-shadow: 0 7px 18px rgba(80, 24, 24, 0.13);
  font-size: 12px;
  font-weight: 850;
}

.boundary-popup {
  display: grid;
  gap: 3px;
  min-width: 210px;
  color: var(--ink);
}

.boundary-popup span {
  color: #b52e2e;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.boundary-popup strong {
  color: var(--forest-950);
  font-family: var(--font-serif);
  font-size: 18px;
}

.boundary-popup small {
  color: var(--muted);
  font-size: 11px;
}

.data-stamp {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 450;
  padding: 5px 8px;
  border-radius: 7px;
  color: #684b0e;
  background: rgba(255, 239, 201, 0.96);
  box-shadow: 0 5px 15px rgba(50, 40, 16, 0.12);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.selected-summary {
  min-height: 98px;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 4px 0;
}

.selected-symbol {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--white);
  background: var(--forest-800);
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 900;
}

.selected-symbol .type-icon-svg {
  width: 29px;
  height: 29px;
  stroke-width: 1.9;
}

.selected-symbol.chua {
  background: var(--gold-dark);
}

.selected-symbol.den {
  background: var(--red);
}

.selected-symbol.mieu {
  background: var(--water);
}

.selected-symbol.complex {
  background: #76519f;
}

.selected-symbol.van_chi {
  background: #8b5f2b;
}

.selected-copy {
  min-width: 0;
}

.selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 5px;
}

.selected-tags span,
.dialog-tags span,
.popup-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--forest-900);
  background: var(--forest-100);
  font-size: 10px;
  font-weight: 850;
}

.selected-tags span:nth-child(2),
.dialog-tags span:nth-child(2),
.popup-tags span:nth-child(2) {
  color: #73520f;
  background: #fff1c9;
}

.selected-tags .location-tag,
.dialog-tags span:last-child,
.popup-tags span:last-child {
  color: #087043;
  background: #ddf5e8;
}

.selected-tags .location-tag.missing,
.dialog-tags span:last-child.missing,
.popup-tags span:last-child.missing {
  color: #a22f34;
  background: #fde5e6;
}

.selected-copy > strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-actions {
  display: flex;
  gap: 8px;
}

.primary-button,
.secondary-button {
  min-height: 41px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.primary-button {
  border: 0;
  color: var(--white);
  background: var(--forest-800);
  box-shadow: 0 8px 20px rgba(0, 111, 78, 0.2);
}

.primary-button:hover {
  background: var(--forest-950);
}

.secondary-button {
  border: 1px solid var(--gold);
  color: var(--gold-dark);
  background: var(--white);
}

.secondary-button:hover {
  background: #fff9e9;
}

.secondary-button[aria-disabled="true"] {
  border-color: #d5ddd8;
  color: #9ca9a4;
  background: #f2f5f3;
  pointer-events: none;
}

.source-note {
  margin: 13px 3px 0;
  color: var(--muted);
  font-size: 12px;
}

.metrics {
  width: min(1340px, calc(100% - 70px));
  margin: -1px auto 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  border-radius: 0 0 20px 20px;
  background: var(--white);
  box-shadow: var(--soft-shadow);
}

.metrics article {
  display: grid;
  gap: 2px;
  padding: 20px 28px;
  border-right: 1px solid var(--line);
}

.metrics article:last-child {
  border-right: 0;
}

.metrics strong {
  color: var(--forest-800);
  font-family: var(--font-serif);
  font-size: 27px;
}

.metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.featured {
  padding-top: 82px;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 17px;
}

.section-action {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.section-action .primary-button {
  min-width: 255px;
}

.feature-card {
  position: relative;
  min-height: 285px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 23px;
  border: 1px solid rgba(0, 111, 78, 0.22);
  border-radius: 20px;
  background: linear-gradient(145deg, #006f4e, #003e33);
  box-shadow: var(--soft-shadow);
  isolation: isolate;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 38px rgba(0, 63, 48, 0.2);
}

.feature-card::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 34, 28, 0.18) 0%, rgba(0, 34, 28, 0.2) 35%, rgba(0, 30, 25, 0.92) 100%),
    linear-gradient(90deg, rgba(0, 41, 33, 0.28), transparent 64%);
  pointer-events: none;
}

.feature-card::after {
  content: attr(data-letter);
  position: absolute;
  z-index: 1;
  right: -4px;
  bottom: -46px;
  color: rgba(255, 255, 255, 0.08);
  font-family: var(--font-serif);
  font-size: 170px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.feature-card.has-photo::after {
  display: none;
}

.feature-media {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
}

.feature-media > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.feature-card:hover .feature-media > img {
  transform: scale(1.04);
}

.feature-media-fallback {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.8);
  background:
    radial-gradient(circle at 78% 20%, rgba(213, 169, 77, 0.38), transparent 25%),
    linear-gradient(145deg, #087650, #004439);
}

.feature-media-fallback::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.11;
  background-image:
    linear-gradient(30deg, transparent 48%, rgba(255, 255, 255, 0.55) 49%, transparent 51%),
    linear-gradient(150deg, transparent 48%, rgba(255, 255, 255, 0.55) 49%, transparent 51%);
  background-size: 42px 70px;
}

.feature-media-fallback > img {
  width: 92px;
  height: 92px;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 33, 27, 0.25));
}

.feature-media-fallback > span {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 800;
}

.feature-top,
.feature-content {
  position: relative;
  z-index: 2;
}

.feature-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.feature-category,
.feature-rank {
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.feature-category {
  color: var(--forest-950);
  background: rgba(239, 248, 244, 0.94);
}

.feature-rank {
  color: #775718;
  background: rgba(255, 241, 201, 0.96);
}

.feature-content h3 {
  margin: 0 0 6px;
  color: var(--white);
  font-family: var(--font-serif);
  font-size: 23px;
  line-height: 1.2;
  text-shadow: 0 2px 12px rgba(0, 28, 23, 0.7);
}

.feature-content p {
  margin: 0 0 17px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  line-height: 1.55;
  text-shadow: 0 1px 8px rgba(0, 28, 23, 0.72);
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  padding: 8px 13px;
  color: var(--forest-950);
  background: rgba(255, 255, 255, 0.94);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 5px 16px rgba(0, 35, 28, 0.16);
}

.text-button:hover {
  color: var(--forest-950);
  background: var(--white);
}

.text-button::after {
  content: "→";
  font-size: 17px;
  transition: transform 0.2s;
}

.text-button:hover::after {
  transform: translateX(4px);
}

.about {
  width: min(1180px, calc(100% - 40px));
  margin: 88px auto 76px;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  overflow: hidden;
  border-radius: 26px;
  background: var(--cream);
  box-shadow: var(--soft-shadow);
  scroll-margin-top: 96px;
}

.about-identity {
  position: relative;
  min-height: 430px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 22px;
  overflow: hidden;
  color: var(--white);
  background: linear-gradient(145deg, var(--forest-950), var(--forest-800));
}

.about-identity::before,
.about-identity::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
}

.about-identity::before {
  width: 410px;
  height: 410px;
}

.about-identity::after {
  width: 300px;
  height: 300px;
}

.logo-halo {
  position: relative;
  z-index: 2;
  width: 220px;
  padding: 17px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.about-identity > span {
  position: relative;
  z-index: 2;
  color: #f2d38c;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.about-copy {
  padding: 52px 58px;
}

.about-copy > p:not(.section-kicker) {
  margin: 19px 0 25px;
  color: #586d65;
}

.about-copy ul {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.about-copy li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #38564d;
  font-size: 14px;
  font-weight: 650;
}

.about-copy li span {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--white);
  background: var(--forest-800);
  font-size: 11px;
  font-weight: 900;
}

.site-footer {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 27px max(40px, calc((100% - 1180px) / 2));
  color: rgba(255, 255, 255, 0.72);
  background: var(--forest-950);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.footer-brand img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.footer-brand div {
  display: grid;
  gap: 2px;
}

.footer-brand strong {
  color: var(--white);
  font-family: var(--font-serif);
  font-size: 17px;
}

.footer-brand span,
.site-footer p {
  margin: 0;
  font-size: 12px;
}

.detail-dialog {
  width: min(650px, calc(100% - 30px));
  max-height: min(900px, calc(100vh - 28px));
  overflow-y: auto;
  padding: 0 31px 29px;
  border: 0;
  border-top: 6px solid var(--gold);
  border-radius: 20px;
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 35px 90px rgba(0, 35, 26, 0.34);
}

.detail-dialog::backdrop {
  background: rgba(4, 39, 30, 0.7);
  backdrop-filter: blur(4px);
}

.dialog-close {
  position: absolute;
  right: 15px;
  top: 14px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--forest-900);
  background: rgba(255, 255, 255, 0.96);
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.dialog-media {
  min-height: 180px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  margin: 0 -31px 21px;
  border-radius: 13px 13px 18px 18px;
  color: var(--forest-800);
  background-color: #e9f1ec;
  background-image: radial-gradient(circle at 2px 2px, rgba(0, 111, 78, 0.13) 1px, transparent 0);
  background-size: 20px 20px;
}

.dialog-media img {
  width: 98px;
  filter: drop-shadow(0 8px 14px rgba(0, 50, 37, 0.15));
}

.dialog-media span {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.87);
  font-size: 11px;
  font-weight: 800;
}

.dialog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-dialog h2 {
  margin: 13px 42px 4px 0;
  font-family: var(--font-serif);
  font-size: 32px;
  line-height: 1.1;
}

.dialog-location {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.dialog-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 21px 0 0;
}

.dialog-meta > div {
  padding: 13px;
  border-radius: 12px;
  background: #f2f6f3;
}

.dialog-meta > .wide {
  grid-column: 1 / -1;
}

.dialog-meta dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.dialog-meta dd {
  margin: 3px 0 0;
  font-size: 13px;
  font-weight: 750;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 19px;
}

.dialog-note {
  margin: 18px 0 0;
  padding: 11px 13px;
  border-left: 3px solid var(--gold);
  color: #735b28;
  background: #fff9ec;
  font-size: 11px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1200;
  max-width: min(430px, calc(100% - 32px));
  padding: 11px 16px;
  border-radius: 11px;
  color: var(--white);
  background: var(--forest-950);
  box-shadow: 0 16px 42px rgba(0, 35, 26, 0.3);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
  transition: opacity 0.2s, transform 0.2s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.heritage-marker {
  border: 0;
  background: transparent;
}

.heritage-pin {
  --pin-color: var(--forest-800);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 3px solid var(--white);
  border-radius: 50% 50% 50% 0;
  color: var(--white);
  background: var(--pin-color);
  box-shadow: 0 6px 16px rgba(12, 50, 39, 0.38);
  transform: rotate(-45deg);
}

.heritage-pin span {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--pin-color);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: inset 0 0 0 1px rgba(4, 63, 46, 0.1);
  transform: rotate(45deg);
}

.heritage-pin .type-icon-svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.5;
}

.heritage-pin.chua {
  --pin-color: var(--gold-dark);
}

.heritage-pin.den {
  --pin-color: var(--red);
}

.heritage-pin.mieu {
  --pin-color: var(--water);
}

.heritage-pin.complex {
  --pin-color: #76519f;
}

.heritage-pin.van_chi {
  --pin-color: #8b5f2b;
}

.heritage-pin.national {
  border-color: #ffe9a5;
  box-shadow: 0 0 0 3px rgba(217, 61, 67, 0.75), 0 6px 16px rgba(12, 50, 39, 0.36);
}

.heritage-marker-tooltip {
  display: grid;
  gap: 1px;
  min-width: 104px;
  padding: 7px 10px;
  border: 0;
  border-radius: 9px;
  color: var(--forest-950);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 8px 22px rgba(6, 48, 37, 0.22);
  font-family: var(--font-sans);
  line-height: 1.25;
}

.heritage-marker-tooltip::before {
  border-top-color: rgba(255, 255, 255, 0.97);
}

.heritage-marker-tooltip span {
  color: var(--gold-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.heritage-marker-tooltip strong {
  font-size: 12px;
  font-weight: 850;
}

.leaflet-control-zoom a {
  color: var(--forest-900);
}

.leaflet-popup-content-wrapper {
  overflow: hidden;
  border-radius: 15px;
  box-shadow: 0 16px 44px rgba(0, 49, 36, 0.24);
}

.leaflet-popup-content {
  width: 294px !important;
  margin: 0;
}

.heritage-popup {
  color: var(--ink);
}

.popup-media {
  min-height: 112px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  padding: 11px;
  color: var(--forest-800);
  background-color: #e9f1ec;
  background-image: radial-gradient(circle at 2px 2px, rgba(0, 111, 78, 0.13) 1px, transparent 0);
  background-size: 18px 18px;
}

.popup-media img {
  width: 62px;
  height: 62px;
  object-fit: contain;
}

.popup-media.has-image {
  min-height: 145px;
  padding: 0;
  background: #dfe9e4;
}

.popup-media.has-image img {
  width: 100%;
  height: 145px;
  object-fit: cover;
}

.popup-media span {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  font-size: 9px;
  font-weight: 800;
}

.popup-body {
  padding: 13px 14px 14px;
}

.popup-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.popup-body h3 {
  margin: 8px 0 3px;
  color: var(--forest-950);
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.15;
}

.popup-address,
.popup-decision {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.popup-decision {
  margin-top: 6px;
}

.popup-actions {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 7px;
  margin-top: 11px;
}

.popup-actions a,
.popup-actions button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.popup-actions a {
  border: 1px solid var(--gold);
  color: var(--gold-dark);
  background: var(--white);
}

.popup-actions button {
  border: 0;
  color: var(--white);
  background: var(--forest-800);
}

.popup-actions .profile-link {
  border-color: var(--forest-800);
  color: var(--white);
  background: var(--forest-800);
}

.popup-actions .profile-link:hover {
  background: var(--forest-950);
}

@media (max-width: 1080px) {
  .brand-copy small {
    white-space: normal;
  }

  .main-nav > a {
    padding-inline: 8px;
  }

  .map-workspace {
    grid-template-columns: 330px minmax(0, 1fr);
  }

  .featured-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-card:last-child {
    grid-column: auto;
  }

  .about-copy {
    padding: 45px 37px;
  }
}

@media (max-width: 820px) {
  .header-inner {
    width: min(100% - 28px, 1460px);
    min-height: 70px;
  }

  .brand img {
    width: 50px;
    height: 50px;
  }

  .brand-copy small {
    max-width: 215px;
    font-size: 9px;
  }

  .brand-copy strong {
    font-size: 18px;
  }

  .menu-toggle {
    display: block;
  }

  .main-nav {
    position: absolute;
    left: 14px;
    right: 14px;
    top: calc(100% + 8px);
    display: none;
    align-items: stretch;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--white);
    box-shadow: var(--shadow);
  }

  .main-nav.open {
    display: grid;
  }

  .main-nav > a {
    padding: 11px 12px;
  }

  .main-nav > a::after {
    display: none;
  }

  .hero-inner {
    width: min(100% - 32px, 1460px);
    min-height: 210px;
    grid-template-columns: 1fr;
  }

  .hero-logo {
    display: none;
  }

  .explorer,
  .featured {
    width: min(100% - 28px, 1460px);
    padding-top: 45px;
  }

  .section-intro {
    align-items: start;
    flex-direction: column;
    gap: 10px;
  }

  .map-workspace {
    grid-template-columns: 1fr;
    border-radius: 21px;
  }

  .filter-panel {
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .filter-scroll {
    overflow: visible;
  }

  .heritage-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 4px;
  }

  .map-panel {
    min-height: 660px;
  }

  .map-stage,
  #heritage-map {
    min-height: 500px;
  }

  .metrics {
    width: min(100% - 48px, 1340px);
    grid-template-columns: 1fr 1fr;
  }

  .metrics article {
    border-bottom: 1px solid var(--line);
  }

  .metrics article:nth-child(2) {
    border-right: 0;
  }

  .metrics article:nth-child(3),
  .metrics article:nth-child(4) {
    border-bottom: 0;
  }

  .about {
    width: min(100% - 28px, 1180px);
    grid-template-columns: 1fr;
    margin-top: 66px;
  }

  .about-identity {
    min-height: 340px;
  }

  .about-copy {
    padding: 37px 27px 41px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 27px 24px;
  }
}

@media (max-width: 560px) {
  .data-ribbon {
    font-size: 11px;
  }

  .brand-copy small {
    max-width: 180px;
  }

  .brand-copy strong {
    font-size: 16px;
  }

  .hero h1 {
    font-size: clamp(38px, 13vw, 54px);
  }

  .hero-copy > p:last-child {
    font-size: 15px;
  }

  .filter-panel,
  .map-panel {
    padding: 14px;
  }

  .map-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .map-toolbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .map-boundary-button {
    flex: 1;
  }

  .map-panel {
    min-height: 650px;
  }

  .map-stage,
  #heritage-map {
    min-height: 430px;
  }

  .map-legend {
    right: 9px;
    left: 9px;
    justify-content: center;
  }

  .data-stamp {
    display: none;
  }

  .selected-summary {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .selected-symbol {
    width: 44px;
    height: 44px;
  }

  .selected-actions {
    grid-column: 1 / -1;
  }

  .selected-actions > * {
    flex: 1;
  }

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

  .metrics article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metrics article:nth-child(3) {
    border-bottom: 1px solid var(--line);
  }

  .metrics article:last-child {
    border-bottom: 0;
  }

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

  .feature-card:last-child {
    grid-column: auto;
  }

  .dialog-meta {
    grid-template-columns: 1fr;
  }

  .dialog-meta > .wide {
    grid-column: auto;
  }

  .detail-dialog {
    padding: 0 20px 23px;
  }

  .dialog-media {
    margin-inline: -20px;
  }

  .dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .leaflet-popup-content {
    width: 250px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
