:root {
  --bg: #0f172a;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #17202a;
  --muted: #64748b;
  --line: #d9e2ec;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --source: #dc2626;
  --receiver: #2563eb;
  --barrier: #f59e0b;
  --danger: #b42318;
  --success: #16794c;
  --warning: #9a6700;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.10);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
#app { display: flex; height: 100vh; width: 100vw; overflow: hidden; }
#sidebar { width: 485px; overflow-y: auto; background: linear-gradient(180deg, #0f172a 0%, #172033 100%); border-right: 1px solid rgba(255,255,255,0.12); padding: 16px; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; color: white; }
.brand-mark { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, #2563eb, #22c55e); font-weight: 800; box-shadow: var(--shadow); }
.brand h1 { margin: 0; font-size: 24px; }
.brand p { margin: 3px 0 0 0; color: #cbd5e1; font-size: 13px; }
.workflow { display: grid; gap: 8px; margin-bottom: 14px; }
.step { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid rgba(255,255,255,0.14); border-radius: 14px; background: rgba(255,255,255,0.06); color: #cbd5e1; }
.step span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,0.14); color: white; font-weight: 700; }
.step small { display: block; color: #94a3b8; margin-top: 2px; }
.step.active { background: rgba(37, 99, 235, 0.22); border-color: rgba(96, 165, 250, 0.6); }
.step.complete span { background: #16a34a; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 10px 0; font-size: 16px; }
.card h3 { margin: 12px 0 6px 0; font-size: 14px; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.intro ol { padding-left: 20px; margin: 0 0 12px 0; font-size: 13px; }
.hint, .status { color: var(--muted); font-size: 12px; margin: 8px 0 0 0; line-height: 1.35; }
.status.good { color: var(--success); }
.status.warn { color: var(--warning); }
.status.bad { color: var(--danger); }
button, .button-link, select { border: none; border-radius: 10px; background: #e8eef6; color: var(--text); padding: 10px 11px; font-size: 13px; font-weight: 650; }
button, .button-link { cursor: pointer; text-decoration: none; text-align: center; display: inline-block; }
button:hover, .button-link:hover { filter: brightness(0.96); }
button.primary, .button-link.primary { background: var(--accent); color: white; }
button.primary:hover { background: var(--accent-dark); }
button.secondary { background: #eef2f7; }
button.danger, .mini.danger { background: #fde7e5; color: var(--danger); }
button.mini { padding: 6px 9px; font-size: 11px; }
.button-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.button-grid.compact button, .button-grid.compact .button-link { padding: 8px 9px; }
.run-card { position: sticky; bottom: 0; z-index: 10; }
.run-card .primary, .run-card .button-link { width: 100%; margin-bottom: 8px; }
.button-link.disabled { pointer-events: none; opacity: 0.45; }
.upload-row { display: grid; grid-template-columns: 1fr 90px; gap: 8px; align-items: center; margin-top: 10px; }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; margin-top: 10px; }
.preset-row.wide-actions button { width: 100%; }
input[type="file"] { width: 100%; }
label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); margin-top: 8px; }
input, select { width: 100%; padding: 8px 9px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; color: var(--text); background: white; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dem-card { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid #dbeafe; border-radius: 14px; background: #eff6ff; }
.dem-card.ready { border-color: #bbf7d0; background: #f0fdf4; }
.dem-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: white; background: var(--accent); font-weight: 800; font-size: 12px; }
.dem-card.ready .dem-icon { background: #16a34a; }
.dem-card p { margin: 3px 0 0 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.dem-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.dem-grid div { padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-soft); min-width: 0; }
.dem-grid span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 3px; }
.dem-grid strong { display: block; font-size: 11px; overflow-wrap: anywhere; }
.library-info { margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); font-size: 12px; color: var(--muted); }
.library-info strong { color: var(--text); }
.feature-card { border: 1px solid var(--line); border-radius: 13px; padding: 11px; margin-bottom: 10px; background: #fbfcfe; }
.source-card { border-left: 5px solid var(--source); }
.receiver-card { border-left: 5px solid var(--receiver); }
.barrier-card { border-left: 5px solid var(--barrier); }
.feature-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.feature-title { font-size: 13px; }
.feature-subtitle, .library-note, .coords { font-size: 11px; color: var(--muted); margin-top: 4px; }
.empty { color: var(--muted); font-size: 12px; }
.hidden { display: none !important; }
.math { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 8px; }
.math p { font-size: 12px; color: var(--muted); line-height: 1.35; }
code { display: block; background: #f1f5f9; border: 1px solid var(--line); border-radius: 9px; padding: 9px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12px; white-space: normal; }
.pill { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 24px; border-radius: 999px; background: #e2e8f0; color: #334155; font-size: 12px; font-weight: 800; padding: 0 8px; }
.pill.soft { background: #eff6ff; color: #1d4ed8; }
#main { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; background: white; }
#reportHeader { background: white; border-bottom: 1px solid var(--line); padding: 14px 18px; }
#reportHeader h2 { margin: 0; font-size: 20px; }
#reportHeader p { margin: 3px 0 10px 0; color: var(--muted); font-size: 12px; }
.report-meta-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.report-meta-grid div { padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-soft); }
.report-meta-grid span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 3px; }
.report-meta-grid strong { font-size: 12px; display: block; }
#map { height: 430px; }
#mapToolbar { position: absolute; left: 18px; top: 118px; z-index: 600; background: rgba(15, 23, 42, 0.82); color: white; border: 1px solid rgba(255,255,255,0.22); border-radius: 14px; padding: 10px 12px; backdrop-filter: blur(8px); box-shadow: var(--shadow); }
.toolbar-title { font-size: 14px; font-weight: 800; }
.toolbar-subtitle { font-size: 12px; color: #cbd5e1; margin-top: 2px; }
.map-legend { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 18px 12px 18px; border-bottom: 1px solid var(--line); font-size: 12px; background: white; }
.legend-title { font-weight: 800; }
.legend-items { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); }
.legend-items span { display: inline-flex; align-items: center; gap: 6px; }
.legend-icon { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.legend-icon.source { background: var(--source); }
.legend-icon.receiver { background: var(--receiver); }
.legend-line { width: 18px; height: 0; border-top: 3px solid #2563eb; display: inline-block; }
.legend-line.barrier { border-top-color: var(--barrier); }
.legend-box { width: 14px; height: 10px; border: 2px solid #22c55e; display: inline-block; background: rgba(34, 197, 94, 0.10); }
#resultsPanel { flex: 1; min-height: 350px; overflow-y: auto; background: white; padding: 14px 18px; }
.results-header { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 10px; }
#resultsPanel h2 { margin: 0; font-size: 18px; }
.results-header p { margin: 3px 0 0 0; color: var(--muted); font-size: 12px; }
#resultBadges { display: flex; flex-wrap: wrap; justify-content: end; gap: 6px; }
.qa-panel { border: 1px solid #fde68a; background: #fffbeb; border-radius: 14px; padding: 12px; margin-bottom: 12px; }
.qa-panel h3 { margin: 0 0 8px 0; color: #92400e; }
.qa-panel ul { margin: 0; padding-left: 20px; color: #78350f; font-size: 12px; }
.result-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 12px; background: #fbfcfe; }
.result-title-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.result-card h3 { margin: 0 0 8px 0; }
.result-summary { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.metric { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; min-width: 160px; background: white; }
.metric .label { display: block; font-size: 11px; color: var(--muted); }
.metric .value { display: block; font-size: 20px; font-weight: 800; }
.result-badge { display: inline-flex; align-items: center; border-radius: 999px; background: #e2e8f0; color: #334155; padding: 6px 10px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.result-badge.low { background: #dcfce7; color: #166534; }
.result-badge.moderate { background: #fef3c7; color: #92400e; }
.result-badge.high { background: #fee2e2; color: #991b1b; }
.compliance-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: white; margin-bottom: 10px; }
.compliance-banner.pass { border-color: #bbf7d0; background: #f0fdf4; }
.compliance-banner.fail { border-color: #fecaca; background: #fef2f2; }
.compliance-banner .big { font-size: 18px; font-weight: 800; }
.compliance-banner .small { font-size: 12px; color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { border-bottom: 1px solid var(--line); padding: 7px 8px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 700; background: #f8fafc; }
.export-table-wrap { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: white; margin-top: 12px; }
.export-table-wrap h3 { margin: 0 0 8px 0; }
.export-table th { background: #0f172a; color: white; }
.profile-block { margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; background: white; padding: 12px; }
.profile-block h4 { margin: 0 0 8px 0; }
.profile-block canvas { width: 100%; height: 280px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.map-label { background: rgba(255,255,255,0.94); border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; font-size: 11px; font-weight: 700; }
.custom-marker { border: none; background: transparent; }
.custom-marker span { width: 30px; height: 30px; border-radius: 50% 50% 50% 8px; transform: rotate(-45deg); display: grid; place-items: center; color: white; font-weight: 900; border: 2px solid white; box-shadow: 0 4px 12px rgba(0,0,0,0.35); line-height: 30px; font-size: 0; }
.source-marker span { background: var(--source); }
.receiver-marker span { background: var(--receiver); }
.receiver-marker.pass span { background: #16a34a; }
.receiver-marker.near span { background: #f59e0b; }
.receiver-marker.exceeds span { background: #dc2626; }
.source-marker span::after, .receiver-marker span::after { transform: rotate(45deg); display: block; font-size: 13px; }
.source-marker span::after { content: "S"; }
.receiver-marker span::after { content: "R"; }
.leaflet-control-layers { border-radius: 12px; box-shadow: var(--shadow); border: 1px solid rgba(15,23,42,0.12); }
.leaflet-control-layers-expanded { padding: 10px 12px; }
@media print {
  body { background: white; }
  #sidebar, #mapToolbar, .leaflet-control-container { display: none !important; }
  #app, #main, #resultsPanel { display: block; height: auto; overflow: visible; }
  #main { width: 100%; }
  #reportHeader { padding: 0 0 12px 0; border: none; }
  #map { display: block !important; height: 420px; margin-bottom: 10px; border: 1px solid var(--line); }
  .map-legend { padding: 0 0 12px 0; border-bottom: none; }
  #resultsPanel { padding: 0; }
  .result-card, .export-table-wrap, .qa-panel, .profile-block, #map, #reportHeader { break-inside: avoid; }
}
@media (max-width: 1080px) {
  #app { flex-direction: column; }
  #sidebar { width: 100%; height: 52vh; border-right: none; border-bottom: 1px solid var(--line); }
  #main { height: 48vh; }
  .report-meta-grid { grid-template-columns: 1fr 1fr; }
  #mapToolbar { display: none; }
}


/* v6.2 UI/report refinements */
#sidebarToggle {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 1200;
  width: 38px;
  height: 38px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 11px;
  background: #0f172a;
  color: white;
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: var(--shadow);
}

.report-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.report-print-button {
  white-space: nowrap;
  min-width: 150px;
}

#resultsPanel {
  position: relative;
  flex: 0 0 360px;
  min-height: 175px;
  max-height: 72vh;
}

#resultsResizeHandle {
  position: sticky;
  top: 0;
  height: 10px;
  margin: -14px -18px 10px -18px;
  cursor: ns-resize;
  background: linear-gradient(to bottom, rgba(148,163,184,0.28), rgba(148,163,184,0.06));
  border-bottom: 1px solid rgba(148,163,184,0.35);
  z-index: 5;
}

#resultsResizeHandle::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  border-radius: 999px;
  background: #94a3b8;
  opacity: 0.8;
  margin: 3px auto;
}

body.sidebar-collapsed #sidebar { display: none; }
body.sidebar-collapsed #sidebarToggle { display: flex; }
body:not(.sidebar-collapsed) #sidebarToggle {
  display: flex;
  left: 430px;
  background: #ffffff;
  color: #0f172a;
}
body.sidebar-collapsed #main { width: 100vw; }
body.resizing-results { cursor: ns-resize; user-select: none; }
body.resizing-results * { user-select: none !important; }

@media print {
  @page { margin: 0.35in; }
  #sidebarToggle, .report-print-button, #resultsResizeHandle { display: none !important; }
  #resultsPanel { flex: none; min-height: 0; max-height: none; height: auto !important; }
  #map { height: 4.8in !important; }
  #reportHeader h2 { margin-top: 0 !important; }
}


/* v6.3 units + disclaimer + print-map improvements */
#sidebarToggle {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 1200;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 11px;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(15,23,42,0.22);
  box-shadow: var(--shadow);
}

body:not(.sidebar-collapsed) #sidebarToggle {
  left: 438px;
}

body.sidebar-collapsed #sidebar {
  display: none;
}

body.sidebar-collapsed #main {
  width: 100vw;
}

.report-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.report-print-button {
  white-space: nowrap;
  min-width: 160px;
}

#resultsPanel {
  position: relative;
  flex: 0 0 360px;
  min-height: 175px;
  max-height: 72vh;
}

#resultsResizeHandle {
  position: sticky;
  top: 0;
  height: 10px;
  margin: -14px -18px 10px -18px;
  cursor: ns-resize;
  background: linear-gradient(to bottom, rgba(148,163,184,0.28), rgba(148,163,184,0.06));
  border-bottom: 1px solid rgba(148,163,184,0.35);
  z-index: 5;
}

#resultsResizeHandle::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  border-radius: 999px;
  background: #94a3b8;
  opacity: 0.8;
  margin: 3px auto;
}

body.resizing-results {
  cursor: ns-resize;
  user-select: none;
}

body.resizing-results * {
  user-select: none !important;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(15, 23, 42, 0.76);
  backdrop-filter: blur(4px);
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-card {
  width: min(760px, 96vw);
  max-height: min(780px, 92vh);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.35);
  border: 1px solid #e2e8f0;
  padding: 20px;
}

.modal-card h2 {
  margin: 0 0 12px 0;
  font-size: 21px;
  color: #0f172a;
}

.modal-scroll {
  overflow-y: auto;
  max-height: 56vh;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f8fafc;
}

.modal-scroll p {
  margin: 0 0 12px 0;
  color: #334155;
  line-height: 1.45;
  font-size: 13px;
}

.ack-row {
  display: flex;
  grid-template-columns: none;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  margin: 14px 0 12px 0;
  color: #0f172a;
  font-weight: 650;
}

.ack-row input {
  width: 18px;
  height: 18px;
}

#disclaimerContinue:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#unitWarning {
  padding: 8px 10px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
}

@media print {
  @page {
    margin: 0.35in;
  }

  #sidebarToggle,
  .report-print-button,
  #resultsResizeHandle,
  .modal-overlay {
    display: none !important;
  }

  #resultsPanel {
    flex: none;
    min-height: 0;
    max-height: none;
    height: auto !important;
  }

  #map {
    height: 5.15in !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  #reportHeader h2 {
    margin-top: 0 !important;
  }
}


/* v6.3.2 focused PDF map export */
body.print-map-focused .leaflet-tooltip {
  display: none !important;
}

@media print {
  body.print-map-focused .leaflet-tooltip {
    display: none !important;
  }

  /* Remove Leaflet controls and tooltips from export map. */
  .leaflet-control-container,
  .leaflet-tooltip {
    display: none !important;
  }

  /* Give the focused project map more vertical room in the report. */
  #map {
    height: 5.45in !important;
  }
}


/* Firebase Auth / subscription gate */
#authRoot {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.30), transparent 35%),
    linear-gradient(135deg, #0f172a 0%, #111827 55%, #0b1220 100%);
}
body.auth-locked #app {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}
.auth-card {
  width: min(520px, 100%);
  background: white;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.35);
  padding: 24px;
}
.auth-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}
.auth-brand h1 {
  margin: 0;
  font-size: 24px;
  color: var(--text);
}
.auth-brand p, .auth-note {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.auth-form {
  display: grid;
  gap: 10px;
}
.auth-form label {
  color: var(--muted);
  font-size: 12px;
}
.auth-form button,
.auth-google,
.auth-button {
  width: 100%;
  margin-top: 8px;
}
.auth-google {
  background: #ffffff;
  border: 1px solid var(--line);
}
.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.auth-links button {
  background: transparent;
  color: var(--accent);
  padding: 6px 0;
}
.auth-message {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 13px;
  line-height: 1.4;
}
.auth-actions {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}
.auth-button {
  text-decoration: none;
  text-align: center;
  border-radius: 10px;
  background: #e8eef6;
  color: var(--text);
  padding: 11px;
  font-size: 13px;
  font-weight: 650;
  border: none;
  cursor: pointer;
}
.auth-button.primary {
  background: var(--accent);
  color: white;
}
.account-card {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  padding: 12px;
  color: white;
  margin-bottom: 14px;
}
.account-card strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}
.account-card span {
  display: block;
  color: #cbd5e1;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.account-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.account-actions button {
  padding: 8px 9px;
  font-size: 12px;
}

/* Stripe plan selector */
.plan-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin:20px 0; }
.plan-card { position:relative; border:1px solid #d9e2ec; border-radius:16px; padding:22px; background:#fff; }
.plan-card.recommended { border:2px solid #2563eb; }
.plan-badge { position:absolute; top:-12px; right:14px; background:#2563eb; color:#fff; border-radius:999px; padding:4px 10px; font-size:12px; font-weight:700; }
.plan-card h2 { margin:0 0 8px; }
.plan-price { font-size:30px; font-weight:800; margin:8px 0; }
.plan-price span { font-size:15px; font-weight:500; color:#64748b; }
.plan-savings { color:#047857; font-weight:700; margin-bottom:10px; }
.plan-card button { width:100%; margin-top:12px; }
@media (max-width: 680px) { .plan-grid { grid-template-columns:1fr; } }


/* ==========================================================
   NoiseGIS WEBSITE BRAND THEME — BRAND 6.4
   This block intentionally uses high-specificity overrides so
   the legacy blue/navy theme cannot remain active.
   ========================================================== */
:root {
  --ng-bg: #f6f8f7;
  --ng-surface: #ffffff;
  --ng-ink: #12201d;
  --ng-muted: #61716c;
  --ng-line: #d9e4df;
  --ng-primary: #126b5a;
  --ng-primary-dark: #0a493e;
  --ng-mint: #d7f3e8;
  --ng-soft: #f0f6f3;
  --ng-shadow: 0 14px 38px rgba(18,32,29,.08);
}
html, body { background: var(--ng-bg) !important; color: var(--ng-ink) !important; }
body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important; }
#sidebar {
  background: var(--ng-bg) !important;
  border-right: 1px solid var(--ng-line) !important;
  padding: 18px !important;
}
.brand { color: var(--ng-ink) !important; padding: 4px 4px 14px !important; }
.brand h1 { color: var(--ng-primary-dark) !important; letter-spacing: -.025em !important; }
.brand p { color: var(--ng-muted) !important; }
.brand-mark {
  background: linear-gradient(135deg, var(--ng-primary), #28a189) !important;
  border-radius: 14px !important;
  color: white !important;
  box-shadow: 0 10px 26px rgba(18,107,90,.24) !important;
}
.brand-mark svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.account-card, .step, .card, .feature-card, .result-card, .metric, .export-table-wrap, .profile-block, .qa-panel, .dem-card, .dem-grid div, .library-info {
  background: var(--ng-surface) !important;
  border: 1px solid var(--ng-line) !important;
  color: var(--ng-ink) !important;
  box-shadow: none !important;
}
.account-card, .step { border-radius: 18px !important; }
.card { border-radius: 24px !important; box-shadow: var(--ng-shadow) !important; }
.step { color: var(--ng-ink) !important; }
.step small { color: var(--ng-muted) !important; }
.step span { background: var(--ng-mint) !important; color: var(--ng-primary-dark) !important; }
.step.active { background: var(--ng-mint) !important; border-color: #acd8ca !important; color: var(--ng-primary-dark) !important; }
.step.active span, .step.complete span { background: var(--ng-primary) !important; color: white !important; }
label, .hint, .status, .coords, .feature-subtitle, .library-note { color: var(--ng-muted) !important; }
input, select, textarea {
  background: white !important;
  color: var(--ng-ink) !important;
  border: 1px solid var(--ng-line) !important;
  border-radius: 14px !important;
}
input:focus, select:focus, textarea:focus { outline: none !important; border-color: #72b9a7 !important; box-shadow: 0 0 0 3px rgba(18,107,90,.12) !important; }
button, .button-link { border-radius: 999px !important; }
button.primary, .button-link.primary, #runModel, #topPrintReportBtn, #disclaimerContinue {
  background: var(--ng-primary) !important;
  color: white !important;
  box-shadow: 0 10px 28px rgba(18,107,90,.22) !important;
}
button.primary:hover, .button-link.primary:hover, #runModel:hover, #topPrintReportBtn:hover, #disclaimerContinue:hover { background: var(--ng-primary-dark) !important; }
button.secondary, .account-card button, .button-link:not(.primary) { background: var(--ng-soft) !important; color: var(--ng-primary-dark) !important; }
#main, #reportHeader, #resultsPanel, .map-legend { background: var(--ng-bg) !important; }
#reportHeader { border-bottom: 1px solid var(--ng-line) !important; }
#reportHeader h2, #resultsPanel h2, .card h2, .card h3 { color: var(--ng-primary-dark) !important; }
.report-meta-grid div { background: white !important; border: 1px solid var(--ng-line) !important; border-radius: 16px !important; }
.report-meta-grid span, #reportHeader p, .results-header p { color: var(--ng-muted) !important; }
.map-legend { border-color: var(--ng-line) !important; }
.result-card, .export-table-wrap, .profile-block { border-radius: 22px !important; box-shadow: var(--ng-shadow) !important; }
.metric { background: var(--ng-soft) !important; border-radius: 16px !important; }
.export-table th { background: var(--ng-primary-dark) !important; color: white !important; }
.pill, .brand-version { background: var(--ng-mint) !important; color: var(--ng-primary-dark) !important; }
.run-card { background: rgba(246,248,247,.97) !important; border-color: var(--ng-line) !important; box-shadow: 0 -10px 30px rgba(18,32,29,.08) !important; }
#sidebarToggle { background: white !important; color: var(--ng-primary-dark) !important; border: 1px solid var(--ng-line) !important; }
.modal-overlay { background: rgba(10,73,62,.58) !important; }
.modal-card { background: white !important; border: 1px solid var(--ng-line) !important; border-radius: 28px !important; box-shadow: 0 24px 80px rgba(18,32,29,.2) !important; }
.modal-scroll { background: var(--ng-bg) !important; border-color: var(--ng-line) !important; }
.leaflet-control-layers, .leaflet-bar a { border-color: var(--ng-line) !important; }
#authRoot { background: radial-gradient(circle at top left, rgba(215,243,232,.85), transparent 40%), linear-gradient(135deg, #f6f8f7, #e7f2ed) !important; }
.auth-card { border-color: var(--ng-line) !important; border-radius: 28px !important; box-shadow: 0 24px 80px rgba(18,32,29,.16) !important; }
.auth-brand h1 { color: var(--ng-primary-dark) !important; }
