:root {
  --ink: #172321;
  --muted: #61706d;
  --line: #d7dfdc;
  --surface: #ffffff;
  --soft: #f3f6f4;
  --ocean: #e7efed;
  --teal: #087f73;
  --teal-dark: #075e56;
  --lime: #d8e75b;
  --no-data: #d9dedc;
  --header-h: 64px;
  --radius: 6px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--surface);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--surface); letter-spacing: 0; }
button, select, input { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }

.site-header {
  position: fixed;
  z-index: 2000;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 32px;
  border-bottom: 1px solid rgba(255,255,255,.18);
  background: rgba(19, 31, 29, .96);
  color: #fff;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.brand-mark { width: 16px; height: 16px; border: 4px solid var(--lime); border-radius: 50%; box-shadow: inset 0 0 0 2px #172321; }
.main-nav { margin-left: auto; display: flex; align-items: stretch; align-self: stretch; gap: 8px; }
.main-nav a { display: flex; align-items: center; padding: 0 14px; color: #dce7e4; font-size: 14px; text-decoration: none; border-bottom: 3px solid transparent; }
.main-nav a:hover, .main-nav a.active { color: #fff; border-bottom-color: var(--lime); }
.mobile-menu { display: none !important; margin-left: auto; color: #fff !important; border-color: rgba(255,255,255,.36) !important; background: transparent !important; }
.mobile-menu:hover { border-color: var(--lime) !important; color: var(--lime) !important; }

main { padding-top: var(--header-h); }
.page { min-height: calc(100vh - var(--header-h)); }
.eyebrow { margin: 0 0 8px; color: var(--teal); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.eyebrow.light { color: var(--lime); }
h1, h2, p { overflow-wrap: anywhere; }
h1, h2 { margin: 0; letter-spacing: 0; }

.home-page { position: relative; min-height: calc(100vh - var(--header-h)); overflow: hidden; background: #263532; color: #fff; }
#home-map { position: absolute; z-index: 0; inset: 0; background: #263532; }
.home-scrim { position: absolute; z-index: 1; inset: 0; background: rgba(13, 28, 25, .54); pointer-events: none; }
.home-content { position: relative; z-index: 2; width: min(760px, calc(100% - 48px)); padding-top: clamp(70px, 13vh, 145px); margin-left: clamp(24px, 8vw, 128px); }
.home-content h1 { max-width: 700px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(44px, 6.5vw, 84px); line-height: .98; font-weight: 500; }
.home-intro { max-width: 650px; margin: 24px 0 0; color: #e5ecea; font-size: 18px; line-height: 1.65; }
.home-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.home-stats { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid rgba(255,255,255,.26); background: rgba(13, 28, 25, .78); }
.home-stats div { min-height: 100px; padding: 20px clamp(18px, 4vw, 56px); border-right: 1px solid rgba(255,255,255,.18); }
.home-stats div:last-child { border-right: 0; }
.home-stats strong { display: block; color: var(--lime); font-size: 28px; line-height: 1.1; }
.home-stats span { display: block; margin-top: 6px; color: #dce7e4; font-size: 13px; }

.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--radius); font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer; }
.button svg { width: 17px; height: 17px; }
.button.primary { background: var(--lime); color: #172321; }
.button.primary:hover { background: #e4ee84; }
.button.secondary-light { border-color: rgba(255,255,255,.48); background: rgba(18,35,32,.4); color: #fff; }
.button.secondary-light:hover { border-color: #fff; background: rgba(18,35,32,.7); }
.icon-button { width: 38px; height: 38px; flex: 0 0 38px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; }
.icon-button:hover { border-color: var(--teal); color: var(--teal); }
.icon-button:disabled { opacity: .4; cursor: default; }
.icon-button svg { width: 17px; height: 17px; }

.observed-page { background: var(--soft); }
.page-heading { min-height: 116px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; max-width: 1540px; margin: 0 auto; padding: 26px 28px 22px; }
.page-heading h1 { font-size: 28px; }
.text-link { display: inline-flex; align-items: center; gap: 6px; color: var(--teal-dark); font-size: 14px; font-weight: 700; }
.text-link svg { width: 15px; }

.workspace { max-width: 1540px; min-height: 650px; margin: 0 auto; padding: 0 28px 28px; display: grid; grid-template-columns: 300px minmax(0, 1fr); }
.filters { background: #fff; border: 1px solid var(--line); border-right: 0; padding: 20px; overflow-y: auto; }
.filter-header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.filter-header h2 { font-size: 18px; }
.filter-header span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.filter-header .build-stamp { margin-top: 3px; color: #788580; font-size: 10px; }
.filters fieldset { min-width: 0; margin: 20px 0 0; padding: 0; border: 0; }
.filters legend, .field > span { display: block; width: 100%; margin-bottom: 8px; color: var(--ink); font-size: 12px; font-weight: 800; }
.field { display: block; margin-top: 20px; }
.year-range-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.year-range-fields .field { margin-top: 20px; }
select, input[type="number"] { width: 100%; height: 40px; padding: 0 11px; border: 1px solid #bfcac6; border-radius: 4px; background: #fff; color: var(--ink); }
.locked-value { width: 100%; height: 40px; display: flex; align-items: center; gap: 9px; padding: 0 11px; border: 1px solid #bfcac6; border-radius: 4px; background: #eef2f0; color: var(--ink); }
.locked-value svg { width: 16px; height: 16px; color: var(--teal); }
select:focus, input:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(8,127,115,.22); outline-offset: 2px; }
.segmented { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid #bfcac6; border-radius: 4px; overflow: hidden; }
.segmented button { min-width: 0; min-height: 38px; padding: 6px 8px; border: 0; border-right: 1px solid #bfcac6; background: #fff; color: var(--muted); font-size: 12px; cursor: pointer; overflow-wrap: anywhere; }
.segmented button:last-child { border-right: 0; }
.segmented button.active { background: var(--teal-dark); color: #fff; }
.segmented button:disabled { background: #eef2f0; color: #9aa5a1; cursor: default; }
.check-list { max-height: 196px; overflow-y: auto; border: 1px solid #bfcac6; border-radius: 4px; padding: 6px 8px; }
.check-list label { display: flex; align-items: center; gap: 8px; min-height: 30px; font-size: 13px; }
.check-list input { accent-color: var(--teal); }
.field-note { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.download-button { width: 100%; margin-top: 22px; border-color: var(--teal); background: #fff; color: var(--teal-dark); }
.download-button:hover { background: #edf8f5; }

.map-panel { position: relative; min-width: 0; border: 1px solid var(--line); background: var(--ocean); overflow: hidden; }
.map-toolbar { position: absolute; z-index: 500; top: 16px; left: 16px; right: 16px; display: flex; align-items: flex-start; justify-content: space-between; pointer-events: none; }
.map-toolbar > div { max-width: min(520px, calc(100% - 56px)); padding: 12px 14px; border: 1px solid rgba(23,35,33,.14); border-radius: 4px; background: rgba(255,255,255,.94); box-shadow: 0 5px 16px rgba(29,50,45,.12); }
.map-toolbar h2 { font-size: 17px; }
.map-toolbar span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.map-kicker { margin: 0 0 4px; color: var(--teal); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.map-toolbar .map-reset { pointer-events: auto; }
#observed-map, #prediction-map { width: 100%; height: 650px; background: var(--ocean); }
#observed-map .leaflet-top.leaflet-left, #prediction-map .leaflet-top.leaflet-left { top: 86px; }
#observed-map .leaflet-bottom.leaflet-right, #prediction-map .leaflet-bottom.leaflet-right { right: auto; bottom: 42px; left: 0; }
.map-loading { position: absolute; z-index: 650; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(231,239,237,.88); color: var(--teal-dark); font-weight: 700; }
.legend { position: absolute; z-index: 500; right: 16px; bottom: 56px; width: 230px; padding: 11px 12px; border: 1px solid rgba(23,35,33,.16); border-radius: 4px; background: rgba(255,255,255,.95); box-shadow: 0 5px 16px rgba(29,50,45,.12); font-size: 11px; }
.legend-title { margin-bottom: 8px; font-weight: 800; }
.legend-ramp { height: 10px; display: grid; grid-template-columns: repeat(6, 1fr); overflow: hidden; border-radius: 2px; }
.legend-ramp span:nth-child(1) { background: #FFF7E6; }.legend-ramp span:nth-child(2) { background: #FFE0B3; }.legend-ramp span:nth-child(3) { background: #FFC085; }.legend-ramp span:nth-child(4) { background: #FF9F50; }.legend-ramp span:nth-child(5) { background: #E65C00; }.legend-ramp span:nth-child(6) { background: #D14233; }
.legend-axis { position: relative; height: 17px; margin-top: 2px; color: var(--muted); }
.legend-axis span { position: absolute; top: 4px; font-size: 9px; font-variant-numeric: tabular-nums; transform: translateX(-50%); white-space: nowrap; }
.legend-axis span::before { position: absolute; top: -5px; left: 50%; width: 1px; height: 4px; background: #667570; content: ""; }
.legend-axis span.start { transform: none; }
.legend-axis span.start::before { left: 0; }
.legend-axis span.end { transform: translateX(-100%); }
.legend-axis span.end::before { right: 0; left: auto; }
.legend-no-data { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--muted); }
.no-data-swatch { width: 13px; height: 13px; display: inline-block; flex: 0 0 13px; background: var(--no-data); border: 1px solid #b9c1be; }
.map-status { position: absolute; z-index: 500; left: 0; right: 0; bottom: 0; min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 16px; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.no-data-note { display: inline-flex; align-items: center; gap: 7px; text-align: right; }
.leaflet-container { font-family: inherit; }
.leaflet-tooltip.pfas-tooltip { width: min(320px, calc(100vw - 32px)); min-width: 210px; padding: 11px 12px; border: 0; border-radius: 4px; box-shadow: 0 8px 28px rgba(20,39,35,.24); color: var(--ink); white-space: normal; overflow-wrap: anywhere; }
.tooltip-title { font-weight: 800; font-size: 14px; }
.tooltip-country { margin-top: 2px; color: var(--muted); font-size: 11px; }
.tooltip-grid { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; margin-top: 10px; font-size: 11px; }
.tooltip-grid span:nth-child(odd) { color: var(--muted); }
.tooltip-grid span:nth-child(even) { text-align: right; font-weight: 700; }
.tooltip-detail { margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; }

.results-section { max-width: 1540px; margin: 0 auto; padding: 28px; background: #fff; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.section-heading.compact { margin-bottom: 16px; }
.section-heading h2 { font-size: 22px; }
.section-heading > span { color: var(--muted); font-size: 13px; }
.table-wrap { width: 100%; overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 11px 12px; background: var(--soft); color: #43524f; font-weight: 800; text-align: left; white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid #e5eae8; white-space: nowrap; }
tbody tr:hover { background: #f6faf8; }
td.numeric, th.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.empty-state { padding: 48px 20px; text-align: center; color: var(--muted); }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.pagination span { color: var(--muted); font-size: 12px; }

.predictions-page { background: var(--soft); }
.placeholder-inner { width: min(780px, 100%); text-align: center; }
.placeholder-inner > svg { width: 44px; height: 44px; margin-bottom: 26px; color: var(--teal); }
.placeholder-inner h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(36px, 5vw, 62px); font-weight: 500; }
.placeholder-inner p:not(.eyebrow) { max-width: 610px; margin: 20px auto 28px; color: var(--muted); line-height: 1.7; }

.methods-page { background: #fff; }
.methods-hero { padding: 64px max(28px, calc((100% - 1120px) / 2)); background: #19312d; color: #fff; }
.methods-hero h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(46px, 6vw, 72px); font-weight: 500; }
.methods-hero > p:last-child { max-width: 720px; margin: 16px 0 0; color: #d8e4e1; font-size: 17px; line-height: 1.65; }
.methods-nav { position: sticky; z-index: 20; top: var(--header-h); display: flex; gap: 22px; padding: 0 max(28px, calc((100% - 1120px) / 2)); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); overflow-x: auto; }
.methods-nav a { padding: 16px 0 13px; color: var(--muted); font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; }
.methods-nav a:hover { color: var(--teal); border-bottom-color: var(--teal); }
.methods-content { max-width: 1120px; margin: 0 auto; }
.methods-content > section { position: relative; padding: 58px 0 58px 150px; border-bottom: 1px solid var(--line); scroll-margin-top: 120px; }
.methods-content h2 { margin-bottom: 18px; font-family: Georgia, "Times New Roman", serif; font-size: 34px; font-weight: 500; }
.methods-content p, .methods-content li { max-width: 790px; color: #43524f; font-size: 15px; line-height: 1.8; }
.section-number { position: absolute; left: 0; top: 60px; color: var(--teal) !important; font-weight: 800; }
.scope-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 28px 0; background: var(--line); border: 1px solid var(--line); }
.scope-grid div { padding: 18px; background: #fff; }
.scope-grid dt { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.scope-grid dd { margin: 5px 0 0; font-size: 20px; font-weight: 800; }
.compound-list { padding: 14px 16px; background: var(--soft); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px !important; }
.compound-list strong { color: var(--ink); }
.screening-flow { max-width: 940px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr) 24px) minmax(0, 1fr); align-items: stretch; gap: 10px; margin-top: 30px; }
.screening-step { min-width: 0; padding: 16px 14px; border: 1px solid var(--line); border-top: 3px solid var(--teal); background: #fff; }
.screening-stage { display: block; margin-bottom: 7px; color: var(--teal); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.screening-step > strong { display: block; color: var(--ink); font-size: 17px; line-height: 1.25; }
.screening-step p { margin: 8px 0 0; font-size: 11px; line-height: 1.5; }
.screening-arrow { display: flex; align-items: center; justify-content: center; color: var(--teal); }
.screening-arrow svg { width: 18px; height: 18px; }
.method-callout { max-width: 790px; margin-top: 24px; padding: 18px 20px; border-left: 4px solid var(--teal); background: #eef7f4; }
.method-callout p { margin: 7px 0 0; font-size: 13px; }
code { padding: 2px 5px; border-radius: 3px; background: var(--soft); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9em; }
blockquote { max-width: 790px; margin: 24px 0 0; padding: 20px 24px; border-left: 4px solid var(--lime); background: #19312d; color: #fff; font-family: Georgia, "Times New Roman", serif; font-size: 22px; }
.studies-empty { max-width: 790px; min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; margin-top: 24px; border: 1px dashed #aab8b4; background: var(--soft); color: var(--muted); text-align: center; }
.studies-empty svg { width: 24px; color: var(--teal); }
.studies-empty strong { color: var(--ink); }
.studies-empty span { font-size: 12px; }

footer { min-height: 96px; display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 24px 32px; border-top: 3px solid var(--lime); background: #13211f; color: #bfcac7; font-size: 12px; }
.footer-summary, .review-note { display: flex; flex-direction: column; line-height: 1.5; }
.footer-summary > span { color: #f3f7f5; font-family: Georgia, "Times New Roman", serif; font-size: 15px; font-weight: 700; }
.review-note { flex: 0 0 auto; align-items: flex-end; gap: 3px; padding-left: 24px; border-left: 1px solid #425551; color: #dce4e1; text-align: right; }
.review-note span:first-child { color: #ffffff; font-size: 13px; font-weight: 700; }
.review-note span:nth-child(2) { color: #aebbb7; font-size: 11px; }
.review-note span:last-child { color: var(--lime); font-size: 11px; font-weight: 700; }

@media (max-width: 980px) {
  .workspace { grid-template-columns: 260px minmax(0, 1fr); padding-left: 18px; padding-right: 18px; }
  .page-heading, .results-section { padding-left: 18px; padding-right: 18px; }
  .methods-content { padding: 0 28px; }
  .methods-content > section { padding-left: 95px; }
  .scope-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .screening-flow { grid-template-columns: 1fr; gap: 8px; }
  .screening-arrow { transform: rotate(90deg); }
}

@media (max-width: 760px) {
  :root { --header-h: 58px; }
  .site-header { height: var(--header-h); padding: 0 16px; }
  .mobile-menu { display: inline-flex !important; }
  .main-nav { position: absolute; top: var(--header-h); left: 0; right: 0; height: auto; display: none; padding: 8px 16px 14px; background: #13211f; border-bottom: 1px solid #41524f; }
  .main-nav.open { display: block; }
  .main-nav a { min-height: 44px; padding: 0; border-bottom-width: 1px; }
  .home-content { width: calc(100% - 36px); margin-left: 18px; padding-top: 55px; }
  .home-content h1 { font-size: 42px; line-height: 1.02; }
  .home-intro { font-size: 15px; line-height: 1.55; }
  .home-actions { margin-top: 20px; }
  .home-stats { grid-template-columns: repeat(2, 1fr); }
  .home-stats div { min-height: 72px; padding: 12px 18px; }
  .home-stats div:nth-child(2) { border-right: 0; }
  .home-stats div:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.18); }
  .home-stats strong { font-size: 20px; }
  .home-stats span { margin-top: 3px; font-size: 10px; }
  .page-heading { min-height: 105px; align-items: flex-start; padding-top: 22px; }
  .page-heading h1 { font-size: 24px; }
  .text-link { display: none; }
  .workspace { display: block; padding: 0 12px 20px; }
  .filters { border-right: 1px solid var(--line); padding: 16px; }
  .check-list { max-height: 188px; }
  .map-panel { margin-top: 12px; }
  #observed-map, #prediction-map { height: 500px; }
  .map-toolbar { top: 10px; left: 10px; right: 10px; }
  .map-toolbar > div { padding: 9px 10px; }
  .map-toolbar h2 { font-size: 14px; }
  .legend { right: 10px; bottom: 82px; width: 185px; }
  .map-status { min-height: 68px; align-items: flex-start; flex-direction: column; justify-content: center; gap: 4px; }
  #observed-map .leaflet-bottom.leaflet-right, #prediction-map .leaflet-bottom.leaflet-right { bottom: 68px; }
  .no-data-note { text-align: left; }
  .results-section { padding: 24px 12px; }
  .methods-hero { padding: 44px 22px; }
  .methods-hero h1 { font-size: 44px; }
  .methods-nav { padding: 0 20px; }
  .methods-content { padding: 0 20px; }
  .methods-content > section { padding: 52px 0; }
  .section-number { position: static; margin: 0 0 8px !important; }
  .scope-grid { grid-template-columns: 1fr 1fr; }
  footer { align-items: flex-start; flex-direction: column; gap: 16px; padding: 22px 18px; }
  .review-note { width: 100%; align-items: flex-start; padding: 14px 0 0; border-top: 1px solid #425551; border-left: 0; text-align: left; }
}

@media (max-width: 420px) {
  .home-content h1 { font-size: 36px; }
  .home-actions { align-items: stretch; flex-direction: column; }
  .home-actions .button { width: 100%; }
  .scope-grid { grid-template-columns: 1fr; }
  .map-toolbar > div { max-width: calc(100% - 48px); }
  .legend { width: 180px; }
}
