:root {
  --forest: #234a3b;
  --forest-deep: #17362b;
  --leaf: #668b62;
  --sage: #a6c18b;
  --cream: #f7f6f1;
  --paper: #fff;
  --mist: #edf0eb;
  --stone: #d9ddd6;
  --ink: #26332e;
  --muted: #66716c;
  --clay: #a96b4f;
  --gold: #b99648;
  --danger: #a5483f;
  --shadow: 0 12px 36px rgba(28, 55, 45, .12);
  --radius: 8px;
  --header: 74px;
  font-family: Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--cream); line-height: 1.6; }
body.sheet-open { overflow: hidden; }
img { display: block; width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(102, 139, 98, .35); outline-offset: 2px; }
[hidden] { display: none !important; }

.site-header {
  position: sticky; top: 0; z-index: 1000; height: var(--header); padding: 0 clamp(20px, 4vw, 64px);
  display: flex; align-items: center; justify-content: space-between; gap: 28px;
  color: #fff; background: rgba(23, 54, 43, .97); border-bottom: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; font-weight: 760; font-size: 1.06rem; white-space: nowrap; }
.brand small { display: block; margin-top: -3px; color: #bfcfc5; font-size: .61rem; font-weight: 600; letter-spacing: .14em; }
.brand-mark { width: 25px; height: 34px; flex: 0 0 auto; border-radius: 70% 20% 70% 20%; background: var(--sage); transform: rotate(-8deg); position: relative; }
.brand-mark::after { content: ""; position: absolute; left: 11px; top: 7px; width: 2px; height: 24px; background: var(--forest); transform: rotate(20deg); }
nav { display: flex; align-items: center; height: 100%; gap: clamp(12px, 2vw, 28px); }
nav a { position: relative; display: grid; place-items: center; height: 100%; color: #e7eee9; text-decoration: none; font-size: .91rem; white-space: nowrap; }
nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--sage); transform: scaleX(0); transition: transform .2s ease; }
nav a:hover::after, nav a.active::after { transform: scaleX(1); }
.mobile-nav-toggle { display: none; color: #fff; border-color: rgba(255,255,255,.25) !important; }

.icon-button { width: 42px; height: 42px; display: inline-grid; place-items: center; border: 1px solid var(--stone); background: #fff; color: var(--forest); border-radius: var(--radius); cursor: pointer; }
.icon-button svg { width: 19px; height: 19px; }
.button { min-height: 44px; padding: 10px 17px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: var(--radius); text-decoration: none; font-weight: 720; cursor: pointer; transition: transform .2s, background .2s; }
.button:hover { transform: translateY(-2px); }
.button svg { width: 18px; height: 18px; }
.button.primary { background: var(--forest); color: #fff; }
.button.secondary { background: #fff; color: var(--forest); border-color: var(--stone); }
.button.ghost { color: #fff; border-color: rgba(255,255,255,.48); background: rgba(255,255,255,.08); }
.text-button { display: inline-flex; align-items: center; gap: 6px; color: var(--forest); border: 0; background: none; cursor: pointer; font-weight: 700; padding: 4px; }
.text-button svg { width: 16px; }

.loading-state { min-height: calc(100vh - var(--header)); display: grid; place-content: center; text-align: center; color: var(--forest); }
.loader { width: 42px; height: 42px; margin: auto; border: 3px solid var(--stone); border-top-color: var(--leaf); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.page { display: none; min-height: calc(100vh - var(--header)); }
.page.active { display: block; }
.content-band { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 88px 0; }
.kicker { margin: 0 0 8px; color: var(--leaf); font-size: .72rem; font-weight: 800; letter-spacing: .15em; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { letter-spacing: 0; }
h1 { margin: 0; color: var(--forest-deep); font-size: clamp(2.4rem, 5vw, 5rem); line-height: 1.04; }
h2 { margin: 0; color: var(--forest-deep); font-size: clamp(1.6rem, 3vw, 2.65rem); line-height: 1.16; }
h3 { margin: 0; color: var(--forest-deep); }
.section-heading { margin-bottom: 34px; }
.split-heading { display: grid; grid-template-columns: 1fr minmax(320px, .72fr); align-items: end; gap: 60px; }
.split-heading > p { margin: 0; color: var(--muted); }

.hero { min-height: min(720px, calc(100vh - var(--header))); position: relative; display: flex; align-items: end; overflow: hidden; padding: clamp(72px, 10vw, 130px) clamp(24px, 7vw, 104px) 70px; color: #fff; background: var(--forest-deep); }
.hero-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 42%; }
.hero::before { content: ""; position: absolute; z-index: 1; inset: 0; background: linear-gradient(90deg, rgba(12, 32, 25, .88) 0%, rgba(20, 52, 41, .56) 52%, rgba(20,52,41,.12) 100%); pointer-events: none; }
.hero::after { content: ""; position: absolute; z-index: 1; inset: 0; background: linear-gradient(0deg, rgba(10,26,20,.48), transparent 48%); pointer-events: none; }
.hero-content { position: relative; z-index: 2; max-width: 820px; }
.hero .kicker { color: #c7dbb5; }
.hero h1 { color: #fff; font-size: clamp(4rem, 10vw, 8.5rem); }
.hero-lead { margin: 18px 0 30px; font-size: clamp(1.12rem, 2vw, 1.45rem); color: #edf2ee; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-caption { position: absolute; z-index: 2; right: clamp(24px, 4vw, 64px); bottom: 28px; max-width: 300px; padding-left: 14px; border-left: 2px solid var(--sage); color: rgba(255,255,255,.82); font-size: .8rem; text-align: right; }
.stat-strip { display: grid; grid-template-columns: repeat(6, 1fr); background: var(--paper); border-bottom: 1px solid var(--stone); }
.stat-item { min-height: 136px; padding: 28px 24px; border-right: 1px solid var(--stone); display: flex; flex-direction: column; justify-content: center; }
.stat-item:last-child { border: 0; }
.stat-item strong { display: block; color: var(--forest); font-size: clamp(1.7rem, 3vw, 2.7rem); line-height: 1; font-variant-numeric: tabular-nums; }
.stat-item span { margin-top: 9px; color: var(--muted); font-size: .87rem; }
.home-map-shell { min-height: 520px; position: relative; overflow: hidden; border: 1px solid var(--stone); border-radius: var(--radius); background: #dbe4da; }
#homeMap { height: 520px; }
.floating-map-link { position: absolute; z-index: 500; right: 22px; bottom: 22px; box-shadow: var(--shadow); }
.highlights-band { border-top: 1px solid var(--stone); }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature-card { position: relative; min-height: 350px; overflow: hidden; border-radius: var(--radius); color: #fff; background: var(--forest); cursor: pointer; }
.feature-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.feature-card:hover img { transform: scale(1.04); }
.feature-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(12,30,23,.92), rgba(12,30,23,.05) 65%); }
.feature-card.textual { padding: 28px; background: var(--paper); color: var(--ink); border: 1px solid var(--stone); cursor: default; }
.feature-card.textual::after { display: none; }
.feature-card-content { position: absolute; z-index: 1; inset: auto 22px 22px; }
.feature-card .eyebrow { color: #d2dfca; font-size: .74rem; }
.feature-card h3 { color: inherit; font-size: 1.35rem; }
.feature-card p { margin: 8px 0 0; color: inherit; opacity: .84; font-size: .9rem; }
.big-number { color: var(--forest); font-size: 4.6rem; font-weight: 760; line-height: .95; }
.recommendation-band { display: grid; grid-template-columns: 1.2fr .8fr; gap: 0; padding-top: 32px; }
.recommendation-image img { height: 540px; object-fit: cover; }
.recommendation-copy { padding: clamp(34px, 6vw, 76px); display: flex; flex-direction: column; justify-content: center; background: var(--forest); color: #eaf0ec; }
.recommendation-copy h2 { color: #fff; }
.recommendation-copy .kicker { color: var(--sage); }
.recommendation-copy h3 { margin-top: 24px; color: #fff; font-size: 1.55rem; }
.recommendation-copy em { color: #bdcdc3; }
.recommendation-copy p { color: #dce6df; }

.page-heading { padding: 82px max(24px, calc((100vw - 1240px) / 2)); background: var(--paper); border-bottom: 1px solid var(--stone); }
.page-heading > p:last-child { max-width: 680px; margin: 16px 0 0; color: var(--muted); font-size: 1.05rem; }
.page-heading.compact { min-height: 154px; padding-top: 30px; padding-bottom: 30px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.page-heading.compact h1 { font-size: clamp(2rem, 4vw, 3.4rem); }
.page-heading.compact p { margin: 5px 0 0; }
.segmented { display: flex; padding: 4px; border: 1px solid var(--stone); border-radius: var(--radius); background: var(--mist); }
.segmented button { min-height: 38px; display: flex; align-items: center; gap: 7px; padding: 7px 13px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; cursor: pointer; }
.segmented button.active { color: var(--forest); background: #fff; box-shadow: 0 2px 10px rgba(20,50,40,.08); }
.segmented svg { width: 17px; }

.map-workspace { height: calc(100vh - var(--header) - 154px); min-height: 620px; display: grid; grid-template-columns: 292px minmax(420px, 1fr) 340px; background: #fff; }
.filter-panel, .tree-peek { min-width: 0; overflow-y: auto; background: var(--paper); }
.filter-panel { padding: 24px 20px; border-right: 1px solid var(--stone); }
.tree-peek { border-left: 1px solid var(--stone); }
.filter-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.filter-title h2 { font-size: 1.2rem; }
.filter-group { padding: 15px 0; border-top: 1px solid var(--stone); }
.filter-group:first-child { border-top: 0; padding-top: 0; }
.filter-group > label, .filter-group > span { display: block; margin-bottom: 8px; color: var(--forest-deep); font-size: .81rem; font-weight: 760; }
.filter-group select, .filter-group input { width: 100%; min-height: 43px; padding: 8px 10px; border: 1px solid var(--stone); border-radius: 6px; color: var(--ink); background: #fff; }
.check-list { display: grid; gap: 7px; max-height: 200px; overflow-y: auto; }
.check-item { display: flex; align-items: center; gap: 9px; font-size: .88rem; cursor: pointer; }
.check-item input { width: 17px; height: 17px; margin: 0; accent-color: var(--forest); }
.map-canvas-wrap { position: relative; min-width: 0; }
#mainMap { height: 100%; width: 100%; background: #dde5dc; }
.map-tools { position: absolute; z-index: 500; right: 14px; bottom: 22px; }
.map-filter-mobile { display: none; position: absolute; z-index: 500; left: 12px; bottom: 18px; box-shadow: var(--shadow); }
.heat-options { position: absolute; z-index: 500; left: 14px; top: 14px; padding: 10px 12px; border-radius: var(--radius); background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.heat-options label { margin-right: 8px; font-size: .8rem; font-weight: 750; }
.heat-options select { min-height: 34px; border: 1px solid var(--stone); border-radius: 5px; }
.tree-marker { width: 30px; height: 38px; position: relative; display: grid; place-items: center; color: #fff; background: var(--forest); border: 2px solid #fff; border-radius: 50% 50% 50% 8%; box-shadow: 0 3px 10px rgba(20,40,32,.36); transform: rotate(-45deg); }
.tree-marker span { width: 8px; height: 13px; border-radius: 80% 20% 80% 20%; background: var(--sage); transform: rotate(45deg); }
.marker-cluster div { color: #fff; background: var(--forest); font-weight: 800; }
.marker-cluster { background: rgba(102,139,98,.48); }
.peek-placeholder { min-height: 100%; padding: 40px 26px; display: grid; place-content: center; text-align: center; color: var(--muted); }
.peek-placeholder svg { width: 32px; height: 32px; margin: 0 auto 16px; color: var(--leaf); }
.peek-placeholder h2 { font-size: 1.3rem; }
.peek-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--mist); }
.peek-body { padding: 23px; }
.peek-body h2 { font-size: 1.55rem; }
.scientific { color: var(--muted); font-family: Georgia, serif; font-style: italic; }
.fact-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0; }
.chip { min-height: 29px; padding: 4px 9px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--stone); border-radius: 999px; color: var(--forest); background: #f8faf7; font-size: .8rem; font-weight: 700; }
.location-line { display: flex; gap: 8px; color: var(--muted); font-size: .9rem; }
.location-line svg { width: 17px; flex: 0 0 auto; }
.summary-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; color: var(--muted); font-size: .91rem; }

.catalog-layout { display: grid; grid-template-columns: 240px 1fr; gap: 40px; align-items: start; }
.catalog-sidebar { position: sticky; top: calc(var(--header) + 24px); }
.catalog-toolbar { display: grid; grid-template-columns: 1fr 220px; gap: 12px; }
.search-field { position: relative; }
.search-field svg { position: absolute; z-index: 1; left: 13px; top: 14px; width: 18px; color: var(--muted); }
.search-field input, .sort-field select { width: 100%; height: 48px; border: 1px solid var(--stone); border-radius: var(--radius); background: #fff; }
.search-field input { padding: 10px 13px 10px 42px; }
.sort-field { position: relative; }
.sort-field span { position: absolute; left: 12px; top: -8px; padding: 0 4px; color: var(--muted); background: var(--cream); font-size: .7rem; }
.sort-field select { padding: 10px 12px; }
.catalog-summary { margin: 17px 0; display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: .84rem; }
.catalog-summary b { color: var(--forest); }
.tree-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tree-card { position: relative; overflow: hidden; border: 1px solid var(--stone); border-radius: var(--radius); background: #fff; transition: transform .2s, box-shadow .2s; }
.tree-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.tree-card-image { position: relative; cursor: pointer; }
.tree-card-image img { aspect-ratio: 4/3; object-fit: cover; background: var(--mist); }
.tree-age { position: absolute; left: 12px; bottom: 12px; padding: 5px 9px; border-radius: 4px; color: #fff; background: rgba(23,54,43,.92); font-weight: 750; font-size: .8rem; }
.compare-toggle { position: absolute; right: 10px; top: 10px; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.65); border-radius: 50%; color: #fff; background: rgba(20,45,35,.75); cursor: pointer; }
.compare-toggle.selected { color: var(--forest); background: var(--sage); }
.tree-card-body { padding: 16px; cursor: pointer; }
.tree-card h3 { font-size: 1.14rem; }
.tree-card .scientific { margin: 1px 0 13px; font-size: .84rem; }
.tree-card-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .79rem; }
.load-more { margin: 30px auto 0; display: flex; }
.empty-state { padding: 70px 20px; text-align: center; color: var(--muted); }
.empty-state svg { width: 38px; height: 38px; color: var(--leaf); }
.empty-state h2 { margin-top: 14px; font-size: 1.35rem; }
.compare-bar { position: fixed; z-index: 900; left: 50%; bottom: 22px; translate: -50% 0; width: min(680px, calc(100% - 28px)); padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 18px; color: #fff; background: var(--forest-deep); border-radius: var(--radius); box-shadow: 0 14px 40px rgba(12,30,23,.3); }
.compare-bar b { display: block; }
.compare-bar span { color: #bdccc3; font-size: .8rem; }

.data-overview { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--stone); background: #fff; }
.overview-item { padding: 24px; border-right: 1px solid var(--stone); border-bottom: 1px solid var(--stone); }
.overview-item:nth-child(4n) { border-right: 0; }
.overview-item:nth-last-child(-n+4) { border-bottom: 0; }
.overview-item strong { display: block; color: var(--forest); font-size: 2rem; line-height: 1.15; }
.overview-item span { color: var(--muted); font-size: .82rem; }
.analysis-section { padding: 74px 0 0; }
.analysis-title { margin-bottom: 23px; display: flex; align-items: center; gap: 18px; }
.analysis-title > span { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid var(--leaf); border-radius: 50%; color: var(--leaf); font-weight: 800; }
.analysis-title h2 { font-size: 1.7rem; }
.analysis-title p { margin: 2px 0 0; color: var(--muted); }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-panel { min-width: 0; padding: 22px; border: 1px solid var(--stone); border-radius: var(--radius); background: #fff; }
.chart-panel.wide { grid-column: 1 / -1; }
.chart-panel h3 { font-size: 1rem; }
.chart { height: 330px; }
.chart.tall { height: 410px; }

.records-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.record-panel { padding: 24px; border: 1px solid var(--stone); border-radius: var(--radius); background: #fff; }
.record-panel.wide { grid-column: 1 / -1; }
.record-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.record-panel-head span { color: var(--leaf); font-size: .72rem; font-weight: 800; }
.record-list { display: grid; }
.record-item { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 12px; min-height: 63px; padding: 9px 0; border-top: 1px solid var(--stone); cursor: pointer; }
.record-item:first-child { border-top: 0; }
.record-rank { color: var(--leaf); font-weight: 800; font-variant-numeric: tabular-nums; }
.record-item strong { display: block; }
.record-item small { color: var(--muted); }
.record-value { color: var(--forest); font-weight: 760; text-align: right; }

.story-hero { min-height: 480px; display: flex; align-items: end; padding: 70px max(24px, calc((100vw - 1240px) / 2)); color: #fff; background-image: linear-gradient(90deg, rgba(16,42,32,.84), rgba(16,42,32,.22)), url("https://www.iam.gov.mo/nature/Content/OldTreesOnline/1004490.jpg"), url("tree-fallback.jpg"); background-position: center, center 44%, center; background-size: cover; }
.story-hero h1 { color: #fff; }
.story-hero .kicker { color: var(--sage); }
.story-hero p:last-child { font-size: 1.18rem; }
.story-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.story-card { overflow: hidden; border: 1px solid var(--stone); border-radius: var(--radius); background: #fff; cursor: pointer; }
.story-card.featured { grid-column: span 2; }
.story-card img { aspect-ratio: 16/10; object-fit: cover; }
.story-card-copy { padding: 22px; }
.story-card-copy h2 { font-size: 1.45rem; }
.story-card-copy p { color: var(--muted); }

.threat-layout { display: grid; grid-template-columns: .75fr 1.25fr; gap: 70px; align-items: start; }
.threat-layout > div:first-child { position: sticky; top: calc(var(--header) + 32px); }
.threat-layout > div:first-child > p:last-child { color: var(--muted); }
.threat-grid { display: grid; grid-template-columns: 1fr 1fr; }
.threat-item { min-height: 150px; padding: 22px; border-left: 1px solid var(--stone); border-bottom: 1px solid var(--stone); }
.threat-item svg { width: 22px; color: var(--clay); }
.threat-item h3 { margin-top: 15px; font-size: 1rem; }
.care-band { margin-top: 92px; padding: 65px 0; border-top: 1px solid var(--stone); border-bottom: 1px solid var(--stone); }
.care-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--stone); border: 1px solid var(--stone); }
.care-step { padding: 28px; background: #fff; }
.care-step > span { color: var(--sage); font-size: 2rem; font-weight: 800; }
.care-step p { color: var(--muted); font-size: .9rem; }
.video-section { padding-top: 88px; display: grid; grid-template-columns: 1.4fr .6fr; gap: 50px; align-items: center; }
.video-frame { aspect-ratio: 16/9; display: grid; place-items: center; color: #fff; background-image: linear-gradient(rgba(19,49,38,.68), rgba(19,49,38,.68)), url("https://www.iam.gov.mo/nature/Content/OldTreesOnline/1005098.jpg"), url("tree-fallback.jpg"); background-position: center; background-size: cover; }
.video-frame > div { display: grid; justify-items: center; gap: 10px; }
.video-frame svg { width: 58px; height: 58px; }
.video-frame small { color: #cfdcd4; letter-spacing: .12em; }

.detail-hero { min-height: 540px; position: relative; display: flex; align-items: end; padding: 66px max(24px, calc((100vw - 1240px) / 2)); color: #fff; background-position: center; background-size: cover; }
.detail-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(13,34,26,.92), rgba(13,34,26,.08) 70%); }
.detail-hero-content { position: relative; z-index: 1; }
.detail-hero h1 { color: #fff; }
.detail-hero .scientific { color: #d4dfd8; font-size: 1.2rem; }
.back-link { margin-bottom: 45px; display: inline-flex; align-items: center; gap: 7px; color: #fff; text-decoration: none; }
.back-link svg { width: 18px; }
.detail-content { width: min(1120px, calc(100% - 48px)); margin: 0 auto; padding: 70px 0; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; }
.detail-copy > p { color: var(--muted); font-size: 1.05rem; }
.fact-table { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--stone); }
.fact-row { padding: 15px 0; border-bottom: 1px solid var(--stone); }
.fact-row span { display: block; color: var(--muted); font-size: .75rem; }
.fact-row strong { display: block; margin-top: 3px; }
.detail-map { height: 360px; margin-top: 70px; border: 1px solid var(--stone); border-radius: var(--radius); }
.timeline { margin: 74px 0; padding: 42px; color: #fff; background: var(--forest); border-radius: var(--radius); }
.timeline h2 { color: #fff; }
.timeline-track { position: relative; height: 4px; margin: 50px 0 28px; background: #8ba79a; }
.timeline-track::before, .timeline-track::after { content: ""; position: absolute; top: -6px; width: 16px; height: 16px; border-radius: 50%; background: var(--sage); }
.timeline-track::before { left: 0; }.timeline-track::after { right: 0; }
.timeline-labels { display: flex; justify-content: space-between; }
.nearby-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.compare-dialog { width: min(1000px, calc(100% - 28px)); max-height: 88vh; padding: 34px; border: 0; border-radius: var(--radius); color: var(--ink); background: var(--cream); box-shadow: 0 30px 80px rgba(12,30,23,.32); }
.compare-dialog::backdrop { background: rgba(15,34,27,.68); }
.dialog-close { position: absolute; right: 14px; top: 14px; }
.compare-grid { display: grid; grid-template-columns: 120px repeat(3, 1fr); gap: 1px; background: var(--stone); border: 1px solid var(--stone); }
.compare-cell { min-width: 0; padding: 14px; background: #fff; }
.compare-cell img { aspect-ratio: 4/3; object-fit: cover; }
.compare-label { color: var(--muted); font-size: .8rem; font-weight: 760; }

.mobile-filter-sheet { position: fixed; z-index: 2000; inset: auto 0 0; max-height: 84vh; overflow: auto; padding: 20px; background: var(--cream); border-radius: 16px 16px 0 0; box-shadow: 0 -16px 50px rgba(14,38,29,.24); }
.mobile-filter-sheet::before { content: ""; position: fixed; z-index: -1; inset: 0; background: rgba(15,35,27,.5); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { font-size: 1.3rem; }
.mobile-filter-sheet > .button { width: 100%; margin-top: 10px; }

footer { padding: 40px max(24px, calc((100vw - 1240px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 30px; color: #d9e4dd; background: var(--forest-deep); }
footer p { margin: 3px 0 0; color: #aebfb4; font-size: .86rem; }
footer a { display: flex; align-items: center; gap: 7px; text-decoration: none; }
.brand-footer { color: #fff; font-size: 1.16rem; font-weight: 760; }

@media (max-width: 1120px) {
  nav { gap: 13px; } nav a { font-size: .84rem; }
  .stat-strip { grid-template-columns: repeat(3, 1fr); }
  .stat-item:nth-child(3) { border-right: 0; }.stat-item:nth-child(-n+3) { border-bottom: 1px solid var(--stone); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .map-workspace { grid-template-columns: 270px minmax(400px, 1fr); }
  .tree-peek { position: absolute; z-index: 700; right: 16px; top: 16px; bottom: 16px; width: 330px; box-shadow: var(--shadow); border: 0; }
  .tree-peek:has(.peek-placeholder) { display: none; }
  .tree-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  :root { --header: 66px; }
  .site-header { padding: 0 18px; }
  .mobile-nav-toggle { display: grid; }
  nav { position: absolute; left: 0; right: 0; top: var(--header); height: auto; padding: 12px 18px 18px; display: none; flex-direction: column; align-items: stretch; gap: 0; background: var(--forest-deep); border-top: 1px solid rgba(255,255,255,.12); }
  nav.open { display: flex; }
  nav a { height: 45px; justify-content: start; border-bottom: 1px solid rgba(255,255,255,.1); }
  nav a::after { display: none; }
  .content-band { width: min(100% - 30px, 1240px); padding: 62px 0; }
  .hero { min-height: 660px; padding: 100px 24px 48px; background-position: 58% center; }
  .hero h1 { font-size: clamp(3.7rem, 18vw, 6.5rem); }
  .hero-caption { left: 24px; right: auto; bottom: 16px; text-align: left; }
  .split-heading, .recommendation-band, .threat-layout, .video-section, .detail-grid { grid-template-columns: 1fr; }
  .split-heading { gap: 18px; }
  .recommendation-image img { height: 420px; }
  .page-heading { padding: 56px 24px; }
  .page-heading.compact { min-height: 134px; padding: 20px 18px; }
  .map-workspace { height: calc(100vh - var(--header) - 134px); min-height: 560px; display: block; }
  .filter-panel { display: none; }
  .map-canvas-wrap, #mainMap { height: 100%; }
  .map-filter-mobile { display: flex; }
  .tree-peek { top: auto; left: 10px; right: 10px; bottom: 10px; width: auto; max-height: 46%; border-radius: var(--radius); }
  .tree-peek .peek-card { display: grid; grid-template-columns: 145px 1fr; }
  .tree-peek .peek-card img { height: 100%; aspect-ratio: auto; }
  .peek-body { padding: 15px; }
  .peek-body .summary-text { display: none; }
  .catalog-layout { grid-template-columns: 1fr; }
  .catalog-sidebar { display: none; }
  .catalog-toolbar { grid-template-columns: 1fr 190px; }
  .data-overview { grid-template-columns: repeat(2, 1fr); }
  .overview-item:nth-child(2n) { border-right: 0; }.overview-item:nth-last-child(-n+4) { border-bottom: 1px solid var(--stone); }.overview-item:nth-last-child(-n+2) { border-bottom: 0; }
  .chart-grid { grid-template-columns: 1fr; }.chart-panel.wide { grid-column: auto; }
  .story-grid { grid-template-columns: 1fr 1fr; }.story-card.featured { grid-column: span 2; }
  .threat-layout > div:first-child { position: static; }.care-steps { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-item { min-height: 110px; padding: 20px 16px; }
  .stat-item:nth-child(2n) { border-right: 0; }.stat-item:nth-child(3) { border-right: 1px solid var(--stone); }.stat-item:nth-child(-n+4) { border-bottom: 1px solid var(--stone); }
  .home-map-shell, #homeMap { min-height: 430px; height: 430px; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-card { min-height: 310px; }
  .recommendation-image img { height: 320px; }
  .recommendation-copy { padding: 34px 24px; }
  .page-heading.compact { display: block; }
  .page-heading.compact .segmented { position: absolute; z-index: 800; right: 12px; top: calc(var(--header) + 10px); }
  .map-workspace { height: calc(100vh - var(--header) - 134px); }
  .tree-peek .peek-card { grid-template-columns: 110px 1fr; }
  .peek-body h2 { font-size: 1.1rem; }
  .peek-body .fact-chips { margin: 7px 0; }.peek-body .location-line { font-size: .76rem; }.peek-body .button { min-height: 38px; padding: 7px 10px; font-size: .8rem; }
  .catalog-toolbar { grid-template-columns: 1fr; }
  .tree-grid { grid-template-columns: 1fr; }
  .catalog-summary { display: block; }.catalog-summary span { display: block; }
  .compare-bar { bottom: 10px; }.compare-bar span { max-width: 190px; display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .records-grid, .story-grid, .threat-grid, .care-steps, .nearby-grid { grid-template-columns: 1fr; }
  .record-panel.wide, .story-card.featured { grid-column: auto; }
  .threat-item { border-left: 0; }
  .video-section { gap: 26px; }
  .detail-hero { min-height: 480px; padding-bottom: 46px; }.detail-content { width: min(100% - 30px, 1120px); }.fact-table { grid-template-columns: 1fr; }.timeline { padding: 28px 20px; }
  .compare-dialog { padding: 58px 14px 20px; overflow-x: auto; }.compare-grid { min-width: 720px; }
  footer { align-items: flex-start; flex-direction: column; }
}
