:root {
  --paper: #f5f2eb;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --ink: #18333c;
  --muted: #667780;
  --subtle: #8a989f;
  --line: #d9ddd9;
  --line-strong: #c8cfcb;
  --brand: #087f78;
  --brand-dark: #065e59;
  --brand-soft: #dff2ef;
  --science: #7358c7;
  --science-soft: #eee9fb;
  --infrastructure: #dd6f39;
  --infrastructure-soft: #fae8df;
  --target: #d49b29;
  --target-soft: #f8edcf;
  --danger: #a74250;
  --danger-soft: #fae7e9;
  --success: #2f8057;
  --success-soft: #e6f3ea;
  --shadow-sm: 0 1px 2px rgba(24, 51, 60, .08), 0 5px 18px rgba(24, 51, 60, .06);
  --shadow-lg: 0 18px 55px rgba(24, 51, 60, .22);
  --topbar: 72px;
  --sidebar: 390px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  overflow: hidden;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: var(--brand-dark); }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 99999;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  text-decoration: none;
}
.skip-link:focus { top: 10px; }

.app { height: 100%; display: grid; grid-template-rows: var(--topbar) minmax(0, 1fr); }
.topbar {
  position: relative;
  z-index: 3000;
  display: grid;
  grid-template-columns: minmax(250px, 360px) minmax(280px, 680px) auto;
  align-items: center;
  gap: 22px;
  padding: 10px 18px;
  background: rgba(255, 253, 248, .96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(24, 51, 60, .02);
  backdrop-filter: blur(14px);
}
.brand-block { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
  width: 43px;
  height: 43px;
  flex: 0 0 43px;
  border: 0;
  border-radius: 14px;
  background: var(--brand);
  color: white;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -.04em;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(8, 127, 120, .22);
}
.brand-mark:hover { background: var(--brand-dark); }
.brand-copy { min-width: 0; }
.brand-copy h1 { margin: 0; font-size: 17px; line-height: 1.2; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-copy p { margin: 3px 0 0; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.search-wrap { position: relative; }
.top-search { width: 100%; justify-self: center; }
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-54%);
  color: var(--muted);
  font-size: 23px;
  pointer-events: none;
}
.search-input {
  width: 100%;
  height: 46px;
  padding: 0 54px 0 44px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  color: var(--ink);
  background: white;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
  transition: border-color .18s, box-shadow .18s;
}
.search-input::placeholder { color: #87959b; }
.search-input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(8,127,120,.12); }
.search-shortcut {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 24px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  border-radius: 6px;
  background: var(--paper);
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}
.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  max-height: min(64vh, 520px);
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 6000;
}
.search-results.active { display: block; }
.search-item {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.search-item:hover, .search-item:focus { background: var(--brand-soft); outline: none; }
.search-item strong { font-size: 13px; }
.search-item span { color: var(--muted); font-size: 11px; }

.top-actions { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.top-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.top-action:hover { background: #edf1ef; color: var(--ink); }
.top-action-icon {
  display: inline-grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink);
  font-size: 11px;
}
.admin-action { color: var(--brand-dark); background: var(--brand-soft); }
.admin-action strong {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--brand);
  color: white;
  font-size: 10px;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }

.shell { min-height: 0; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar {
  position: relative;
  z-index: 1400;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  box-shadow: 4px 0 20px rgba(24,51,60,.05);
}
.sidebar-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 20px 13px;
}
.eyebrow { display: block; color: var(--brand-dark); font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.sidebar-head h2 { margin: 5px 0 0; font-size: 20px; line-height: 1.2; letter-spacing: -.025em; }
.view-picker { display: grid; gap: 8px; padding: 0 14px 12px; }
.view-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s, background .16s, transform .16s, box-shadow .16s;
}
.view-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.view-card.active { border-color: var(--brand); background: #f7fffd; box-shadow: 0 0 0 3px rgba(8,127,120,.09); }
.view-card[data-view="science"].active { border-color: var(--science); background: #fbf9ff; box-shadow: 0 0 0 3px rgba(115,88,199,.10); }
.view-card[data-view="infrastructure"].active { border-color: var(--infrastructure); background: #fffaf7; box-shadow: 0 0 0 3px rgba(221,111,57,.10); }
.view-card > span:last-child { min-width: 0; display: grid; gap: 2px; }
.view-card strong { font-size: 13px; }
.view-card small { color: var(--muted); font-size: 10.5px; line-height: 1.35; }
.view-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; font-weight: 800; }
.view-icon-opportunities { background: var(--brand-soft); color: var(--brand-dark); }
.view-icon-science { background: var(--science-soft); color: var(--science); }
.view-icon-infrastructure { background: var(--infrastructure-soft); color: var(--infrastructure); }
.friendly-summary {
  margin: 0 14px 12px;
  padding: 11px 12px;
  border-radius: 12px;
  background: #f0f4f2;
  color: var(--muted);
  display: grid;
  gap: 2px;
  font-size: 11px;
  line-height: 1.4;
}
.friendly-summary strong { color: var(--ink); }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 14px 14px; }

.accordion-stack { flex: 1; min-height: 0; overflow: auto; padding: 0 14px 18px; scrollbar-width: thin; }
.control-group { border-top: 1px solid var(--line); }
.control-group:last-child { border-bottom: 1px solid var(--line); }
.control-group summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 2px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-size: 12px;
  font-weight: 750;
}
.control-group summary::-webkit-details-marker { display: none; }
.control-group summary::after { content: "+"; color: var(--muted); font-size: 18px; font-weight: 400; order: 3; }
.control-group[open] summary::after { content: "−"; }
.control-group summary small { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 10px; }
.control-body { padding: 0 1px 15px; display: grid; gap: 10px; }
.control-body > label, .filter-grid label, .review-toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
}
select, .review-toolbar input, .review-note {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: white;
  color: var(--ink);
  outline: none;
}
select:focus, .review-toolbar input:focus, .review-note:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(8,127,120,.10); }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.filter-grid .wide { grid-column: 1 / -1; }
.filter-divider { grid-column: 1 / -1; padding-top: 6px; color: var(--ink); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.check-row { display: flex !important; align-items: flex-start; gap: 8px !important; color: var(--ink) !important; font-weight: 600 !important; line-height: 1.35; cursor: pointer; }
.check-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.range-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.range-row input { accent-color: var(--brand); }
.range-row output { min-width: 48px; text-align: right; color: var(--ink); font-weight: 750; }

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  transition: transform .15s, background .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: white; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { border-color: var(--line-strong); background: white; color: var(--ink); }
.btn-secondary:hover { border-color: var(--brand); }
.btn-quiet { background: transparent; color: var(--muted); border-color: transparent; }
.btn-block { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 7px; }
.button-row.compact .btn { flex: 1 1 30%; padding-inline: 8px; }
.text-button { padding: 4px 0; border: 0; background: transparent; color: var(--brand-dark); cursor: pointer; font-size: 11px; font-weight: 700; text-align: left; }
.text-button:hover { text-decoration: underline; }
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  cursor: pointer;
  font-size: 21px;
  line-height: 1;
}
.icon-button:hover { border-color: var(--brand); color: var(--brand-dark); }

.layer-list { display: grid; gap: 7px; }
.layer-toggle {
  display: grid;
  grid-template-columns: 18px 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px 8px;
  border-radius: 9px;
  cursor: pointer;
}
.layer-toggle:hover { background: #f1f4f2; }
.layer-toggle input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.layer-toggle > span:nth-of-type(2) { min-width: 0; display: grid; gap: 1px; }
.layer-toggle strong { font-size: 11px; }
.layer-toggle small { color: var(--muted); font-size: 9.5px; line-height: 1.3; }
.layer-toggle b { font-size: 10px; color: var(--muted); }
.layer-swatch, .legend-dot { display: block; width: 11px; height: 11px; border-radius: 50%; }
.swatch-atlas { background: #0d9f92; }
.swatch-science { background: var(--science); }
.swatch-target { background: var(--target); }
.swatch-well { background: #397eb6; }
.swatch-official { background: var(--infrastructure); }
.legend-diamond { width: 11px; height: 11px; transform: rotate(45deg); background: var(--target); border: 1px solid #8b6b27; }

.official-role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 4px 0; }
.official-status { padding: 9px 10px; border-radius: 9px; background: #eef2f0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.official-status[data-kind="success"] { background: var(--success-soft); color: #276c4a; }
.official-status[data-kind="warning"] { background: var(--target-soft); color: #795c1e; }
.review-summary-box { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.review-summary-box div { display: grid; gap: 2px; padding: 8px; border-radius: 9px; background: #f1f4f2; text-align: center; }
.review-summary-box strong { font-size: 16px; }
.review-summary-box span { color: var(--muted); font-size: 9px; }
.public-review-summary { grid-template-columns: 1fr; }
.highlights { gap: 8px; }
.highlights article { display: grid; gap: 3px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.highlights strong { font-size: 11px; }
.highlights p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.highlight-tag { width: max-content; padding: 2px 6px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-dark); font-size: 8.5px; font-weight: 800; text-transform: uppercase; }
.legend { gap: 9px; }
.legend-row { display: grid; grid-template-columns: 13px minmax(0, 1fr); align-items: center; gap: 9px; }
.legend-row > span:last-child { display: grid; gap: 1px; }
.legend-row strong { font-size: 10.5px; }
.legend-row small { color: var(--muted); font-size: 9.5px; }
.sidebar-footer { padding: 10px 14px 14px; border-top: 1px solid var(--line); background: var(--surface); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.result-count { color: var(--muted); font-size: 10px; text-align: right; }

.map-wrap { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
#map { position: absolute; inset: 0; background: #dfe8e5; }
.leaflet-control-zoom a { color: var(--ink) !important; }
.leaflet-control-layers, .leaflet-bar { border: 0 !important; box-shadow: var(--shadow-sm) !important; }
.leaflet-control-layers-toggle, .leaflet-bar a { background-color: white !important; }
.leaflet-control-attribution { font-size: 8px !important; background: rgba(255,255,255,.78) !important; }
.map-floating-bar {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 8px;
}
.map-fab, .map-context {
  min-height: 42px;
  border: 1px solid rgba(200,207,203,.9);
  border-radius: 12px;
  background: rgba(255,253,248,.94);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}
.map-fab { display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; cursor: pointer; font-size: 11px; font-weight: 750; }
.map-context { display: grid; gap: 1px; min-width: 210px; padding: 7px 12px; }
.map-context strong { font-size: 11px; }
.map-context span { color: var(--muted); font-size: 9.5px; }
.map-counts {
  position: absolute;
  left: 14px;
  bottom: 28px;
  z-index: 850;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: calc(100% - 90px);
}
.map-counts span { padding: 5px 8px; border: 1px solid rgba(200,207,203,.85); border-radius: 99px; background: rgba(255,253,248,.92); color: var(--muted); box-shadow: var(--shadow-sm); font-size: 9px; backdrop-filter: blur(10px); }
.map-counts strong { color: var(--ink); }
.loading { position: absolute; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; gap: 10px; background: rgba(245,242,235,.72); color: var(--ink); font-size: 12px; backdrop-filter: blur(3px); transition: opacity .2s; }
.loading.hidden { opacity: 0; pointer-events: none; }
.spinner { width: 20px; height: 20px; border: 3px solid #cad8d4; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.drawer {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 1400;
  width: min(470px, calc(100% - 24px));
  display: flex;
  flex-direction: column;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  transform: translateX(calc(100% + 30px));
  opacity: 0;
  transition: transform .24s ease, opacity .24s ease;
  overflow: hidden;
}
.drawer.open { transform: translateX(0); opacity: 1; }
.drawer-head, .modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: #fbfcfa; }
.drawer-title { min-width: 0; }
.drawer-title h2, .modal-head h2 { margin: 4px 0 0; font-size: 21px; line-height: 1.2; letter-spacing: -.025em; }
.drawer-title p, .modal-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.drawer-body { flex: 1; min-height: 0; overflow: auto; padding: 16px 20px 28px; }
.plain-language-banner { display: grid; gap: 7px; margin-bottom: 14px; padding: 14px; border-radius: 13px; background: var(--brand-soft); border: 1px solid #c3e5e0; }
.plain-language-banner.science { background: var(--science-soft); border-color: #ddd3f5; }
.plain-language-banner.infrastructure { background: var(--infrastructure-soft); border-color: #f1cfbd; }
.plain-language-banner strong { font-size: 13px; }
.plain-language-banner p { margin: 0; color: #415961; font-size: 11px; line-height: 1.5; }
.technical-toggle { justify-self: start; padding: 0; border: 0; background: transparent; color: var(--brand-dark); font-size: 10px; font-weight: 800; cursor: pointer; }
.drawer-body.simple-profile .technical-section { display: none; }
.profile-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 99px; background: #eef2f0; color: #43565e; font-size: 9px; font-weight: 750; }
.badge-official { background: var(--infrastructure-soft); color: #975026; }
.match-badge-accepted { background: var(--success-soft); color: #256641; }
.match-badge-pending { background: var(--science-soft); color: #5b469b; }
.match-badge-rejected { background: var(--danger-soft); color: #8a3541; }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.kv { min-width: 0; padding: 9px 10px; border-radius: 9px; background: #f4f6f4; }
.k { color: var(--muted); font-size: 8.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.v { margin-top: 3px; color: var(--ink); font-size: 10.5px; line-height: 1.4; overflow-wrap: anywhere; }
.profile-section { margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--line); }
.profile-section h3 { margin: 0 0 9px; font-size: 12px; }
.profile-section p { color: #43565e; font-size: 11px; line-height: 1.55; }
.caveat, .internal-note, .plain-note { padding: 11px 12px; border-radius: 10px; background: var(--target-soft); color: #66511f; font-size: 10.5px; line-height: 1.5; }
.internal-note { background: var(--science-soft); color: #52417e; }
.source-link { display: inline-flex; align-items: center; min-height: 32px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: white; color: var(--brand-dark); text-decoration: none; font-size: 10px; font-weight: 750; }
.source-link:hover { border-color: var(--brand); }

.modal-panel {
  position: absolute;
  z-index: 1800;
  display: none;
  flex-direction: column;
  top: 50%;
  left: 50%;
  width: min(860px, calc(100% - 28px));
  max-height: min(780px, calc(100% - 28px));
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-panel.open { display: flex; }
.help-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 18px 20px; }
.help-grid article { position: relative; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfa; }
.help-number { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: white; font-weight: 800; }
.help-grid h3 { margin: 12px 0 5px; font-size: 13px; }
.help-grid p { margin: 0; color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.glossary { padding: 0 20px 20px; }
.glossary h3 { margin: 0 0 8px; font-size: 13px; }
.glossary dl { margin: 0; display: grid; gap: 6px; }
.glossary dl div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 9px 10px; border-radius: 9px; background: #f2f5f3; }
.glossary dt { font-size: 10px; font-weight: 800; }
.glossary dd { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.status-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 20px; }
.status-grid article { display: grid; gap: 5px; padding: 16px; border-radius: 12px; background: #f2f5f3; }
.status-grid strong { font-size: 24px; }
.status-grid span { color: var(--muted); font-size: 10px; line-height: 1.4; }
.status-modal .plain-note { margin: 0 20px 20px; }
.status-modal .plain-note p { margin: 5px 0 0; }
.modal-body { min-height: 0; overflow: auto; padding: 16px 20px 24px; }
.unmapped-list { display: grid; gap: 8px; }
.unmapped-item { padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfa; font-size: 11px; }

.review-modal { inset: 18px; width: auto; max-height: none; transform: none; top: 18px; left: 18px; }
.review-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.review-toolbar label { min-width: 220px; }
.review-list { flex: 1; min-height: 0; overflow: auto; padding: 14px 18px 24px; display: grid; gap: 10px; align-content: start; }
.review-card { display: grid; gap: 10px; padding: 13px; border: 1px solid var(--line); border-left: 5px solid var(--science); border-radius: 11px; background: white; }
.review-card.review-accepted { border-left-color: var(--success); }
.review-card.review-rejected { border-left-color: var(--danger); }
.review-card.review-needs_more_evidence { border-left-color: var(--target); }
.review-card-head { display: flex; justify-content: space-between; gap: 12px; }
.review-card h3 { margin: 0; font-size: 13px; }
.review-card small { color: var(--muted); }
.review-score { min-width: 58px; height: max-content; padding: 7px; border-radius: 8px; background: var(--science-soft); color: #5b469b; text-align: center; font-weight: 800; }
.review-evidence { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 6px; }
.review-note { min-height: 58px; resize: vertical; }
.review-decision-row { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.btn-accept { background: var(--success); color: white; }
.btn-reject { background: var(--danger); color: white; }
.btn-evidence { background: var(--target); color: white; }

.welcome-card {
  position: absolute;
  z-index: 1100;
  left: 50%;
  top: 50%;
  width: min(460px, calc(100% - 30px));
  transform: translate(-50%, -50%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,253,248,.97);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(14px);
}
.welcome-card.hidden { display: none; }
.welcome-card h2 { margin: 5px 0 8px; font-size: 24px; line-height: 1.18; letter-spacing: -.03em; }
.welcome-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.welcome-close { position: absolute; right: 12px; top: 12px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 22px; }
.welcome-actions { display: flex; gap: 8px; margin-top: 16px; }
.welcome-dismiss { display: flex; align-items: center; gap: 7px; margin-top: 13px; color: var(--muted); font-size: 10px; }
.welcome-dismiss input { accent-color: var(--brand); }

.helis-tooltip { border: 0 !important; border-radius: 10px !important; box-shadow: var(--shadow-sm) !important; padding: 9px 10px !important; color: var(--ink) !important; }
.tooltip-title { font-size: 11px; font-weight: 800; }
.tooltip-meta { margin-top: 2px; color: var(--muted); font-size: 9px; }
.tooltip-value { margin-top: 5px; color: var(--brand-dark); font-size: 10px; font-weight: 800; }
.isotope-cluster div { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(115,88,199,.88); color: white; border: 3px solid rgba(255,255,255,.85); box-shadow: 0 4px 12px rgba(62,43,122,.25); }
.isotope-cluster span { font-size: 11px; font-weight: 800; }

.mobile-only, .mobile-toggle { display: none; }
body[data-view="opportunities"] .science-only,
body[data-view="opportunities"] .infrastructure-only { display: none !important; }
body[data-view="science"] .infrastructure-only { display: none !important; }
body[data-view="infrastructure"] .science-only { display: none !important; }
body:not(.show-advanced) .advanced-only { display: none !important; }

@media (max-width: 1180px) {
  :root { --sidebar: 360px; }
  .topbar { grid-template-columns: minmax(230px, 300px) minmax(240px, 1fr) auto; gap: 12px; }
  .top-action > span:not(.top-action-icon):not(.status-dot) { display: none; }
  .top-action { padding-inline: 8px; }
}

@media (max-width: 840px) {
  :root { --topbar: 64px; --sidebar: min(92vw, 390px); }
  body { overflow: hidden; }
  .topbar { grid-template-columns: auto 1fr auto; padding: 8px 10px; gap: 8px; }
  .brand-copy { display: none; }
  .brand-mark { width: 40px; height: 40px; flex-basis: 40px; border-radius: 12px; }
  .top-search { min-width: 0; }
  .search-input { height: 42px; padding-right: 14px; font-size: 12px; }
  .search-shortcut { display: none; }
  .top-actions .top-action:not(.admin-action) { display: none; }
  .admin-action span:not(.top-action-icon) { display: none; }
  .shell { display: block; }
  .sidebar { position: fixed; top: var(--topbar); left: 0; bottom: 0; width: var(--sidebar); transform: translateX(-105%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .mobile-only, .mobile-toggle { display: inline-flex; }
  .map-wrap { position: absolute; top: var(--topbar); left: 0; right: 0; bottom: 0; }
  .map-floating-bar { left: 10px; right: 10px; top: 10px; justify-content: space-between; }
  .map-context { min-width: 0; flex: 1; }
  .desktop-label { display: none; }
  .map-counts { left: 10px; bottom: 24px; max-width: calc(100% - 20px); }
  .drawer { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; height: min(76vh, 680px); transform: translateY(calc(100% + 20px)); }
  .drawer.open { transform: translateY(0); }
  .help-grid { grid-template-columns: 1fr; overflow: auto; }
  .status-grid { grid-template-columns: 1fr 1fr; }
  .glossary dl div { grid-template-columns: 1fr; gap: 4px; }
  .review-modal { inset: 8px; }
  .review-toolbar { align-items: stretch; }
  .review-toolbar label { min-width: 0; width: 100%; }
  .welcome-card { top: 46%; padding: 20px; }
  .welcome-card h2 { font-size: 21px; }
}

@media (max-width: 520px) {
  .profile-grid { grid-template-columns: 1fr; }
  .status-grid { grid-template-columns: 1fr; }
  .welcome-actions { flex-direction: column; }
  .modal-panel { top: 8px; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: none; transform: none; }
  .review-modal { top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
.feedback-panel { margin: 0 20px 20px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.feedback-panel summary { padding: 12px 14px; cursor: pointer; font-size: 11px; font-weight: 800; background: #fbfcfa; }
.feedback-panel form { display: grid; gap: 10px; padding: 14px; border-top: 1px solid var(--line); }
.feedback-panel label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.feedback-panel input, .feedback-panel textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--ink); background: white; }
.feedback-panel textarea { resize: vertical; }

/* Guided starting points */
.featured-starts {
  margin: 0 14px 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, #ffffff, #f7faf8);
  box-shadow: var(--shadow-sm);
}
.featured-heading { margin-bottom: 10px; }
.featured-heading h3 { margin: 4px 0 0; font-size: 13px; letter-spacing: -.015em; }
.featured-list { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.featured-list button {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s, transform .16s, box-shadow .16s;
}
.featured-list button:hover,
.featured-list button:focus-visible {
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  outline: none;
}
.featured-list strong { overflow: hidden; color: var(--ink); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.featured-list small { color: var(--muted); font-size: 9px; line-height: 1.3; }

/* Loading states for deferred scientific and well layers */
.loading {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 210px;
  max-width: min(420px, calc(100% - 28px));
}
.loading.hidden { display: none; }
.loading span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* A quiet modal backdrop makes the reading hierarchy clearer. */
.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1700;
  display: none;
  background: rgba(24, 51, 60, .26);
  backdrop-filter: blur(2px);
}
.modal-backdrop.open { display: block; }

/* Make plain-language interpretation lead, while technical details remain available. */
.plain-language-banner {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: 12px;
  background: #f7fffd;
}
.plain-language-banner.science { border-left-color: var(--science); background: #fbf9ff; }
.plain-language-banner.infrastructure { border-left-color: var(--infrastructure); background: #fffaf7; }
.plain-language-banner > strong { font-size: 15px; }
.plain-language-banner p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.technical-toggle {
  justify-self: start;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand-dark);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}
.simple-profile .technical-section { display: none; }

@media (max-width: 840px) {
  .featured-starts { margin-bottom: 12px; }
}
