:root {
  --bg: #f4f0e7;
  --panel: rgba(255, 252, 247, 0.92);
  --panel-strong: #fffaf2;
  --ink: #1d2a34;
  --muted: #5a6a74;
  --line: rgba(29, 42, 52, 0.12);
  --accent: #27566b;
  --accent-soft: rgba(39, 86, 107, 0.12);
  --shadow: 0 18px 40px rgba(29, 42, 52, 0.12);
  --radius: 22px;
  --sidewalk-gap: #b85b3e;
  --unsafe-crossing: #9e3a35;
  --visibility-issue: #7c5d32;
  --speeding-concern: #85564b;
  --accessibility-barrier: #4f7077;
  --general-hotspot: #5f6573;
  --destination: #274c5e;
  --sidewalks: #8ca76f;
  --trails: #4d7b68;
  --crosswalks: #cf8a45;
  --border: #4b5d78;
  --review: #6b7a8a;
  --review-soft: rgba(107, 122, 138, 0.12);
  --workspace-height: 760px;
}

:root[data-theme="dark"] {
  --bg: #172026;
  --panel: rgba(23, 30, 36, 0.9);
  --panel-strong: #1e2930;
  --ink: #edf2f0;
  --muted: #aebac0;
  --line: rgba(226, 235, 240, 0.14);
  --accent: #8eb6cb;
  --accent-soft: rgba(142, 182, 203, 0.16);
  --shadow: 0 18px 40px rgba(7, 11, 14, 0.36);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Public Sans", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(39, 86, 107, 0.12), transparent 30%),
    radial-gradient(circle at bottom right, rgba(184, 91, 62, 0.1), transparent 32%),
    linear-gradient(180deg, #f7f2e8 0%, var(--bg) 100%);
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(142, 182, 203, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(184, 91, 62, 0.12), transparent 30%),
    linear-gradient(180deg, #11181d 0%, var(--bg) 100%);
}

button,
input,
label,
select,
textarea,
a {
  font: inherit;
}

.page-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 32px;
}

.page-header {
  padding: 8px 6px 26px;
}

.notes-strip {
  display: grid;
  gap: 12px;
  margin: 0 6px 24px;
  padding: 16px 18px;
  border-color: rgba(29, 42, 52, 0.08);
}

.notes-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}

.notes-copy {
  display: grid;
  gap: 6px;
}

.notes-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
  align-self: start;
}

.process-eyebrow {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.process-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: start;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(39, 86, 107, 0.16);
  color: var(--accent);
  background: rgba(255, 255, 255, 0.68);
  font-weight: 700;
  text-decoration: none;
}

.process-link:hover,
.process-link:focus-visible {
  text-decoration: underline;
  outline: none;
}

.process-link-secondary {
  min-height: 38px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.38);
  color: var(--muted);
  font-size: 0.92rem;
}

.theme-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(29, 42, 52, 0.1);
  background: rgba(255, 255, 255, 0.46);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--accent);
  border-color: rgba(39, 86, 107, 0.18);
  outline: none;
}

.project-notes-title {
  font-size: 1.05rem;
}

.notes-details {
  border-top: 1px solid rgba(29, 42, 52, 0.08);
  padding-top: 10px;
}

.notes-toggle {
  cursor: pointer;
  list-style: none;
  color: var(--muted);
  font-weight: 600;
}

.notes-toggle::-webkit-details-marker {
  display: none;
}

.notes-grid {
  display: grid;
  gap: 14px;
  padding-top: 12px;
}

.notes-block {
  display: grid;
  gap: 6px;
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr);
  gap: 32px;
  align-items: start;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

h1,
h2,
.detail-title {
  font-family: "Fraunces", serif;
  letter-spacing: -0.02em;
}

h1 {
  margin: 0;
  font-size: clamp(2.3rem, 4vw, 4rem);
  line-height: 0.95;
  font-weight: 600;
}

h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.lede,
.masthead-note,
.panel p,
.detail-body,
.detail-empty,
.hotspot-list-empty,
.subdued {
  color: var(--muted);
  line-height: 1.55;
}

.lede {
  max-width: 44rem;
  margin: 18px 0 0;
  font-size: 1.08rem;
}

.masthead-copy {
  max-width: 52rem;
}

.masthead-note {
  max-width: 43rem;
  margin: 14px 0 0;
  font-size: 0.97rem;
}

.app-shell {
  display: grid;
  gap: 24px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 22px;
  align-items: stretch;
}

.inspection-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  gap: 22px;
  align-items: start;
  margin-top: -2px;
}

.sidebar {
  min-width: 0;
}

.sidebar-workflow {
  align-self: stretch;
}

.sidebar-scroll {
  height: 100%;
  max-height: var(--workspace-height);
  overflow: auto;
  display: grid;
  gap: 16px;
  padding-right: 4px;
}

.panel,
.map-card {
  background: var(--panel);
  border: 1px solid rgba(29, 42, 52, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.panel {
  padding: 18px 18px 16px;
}

.panel-header,
.map-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.panel-header {
  margin-bottom: 14px;
}

.panel-subtitle {
  margin: 6px 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.panel-tools {
  display: grid;
  gap: 16px;
}

.tool-group {
  display: grid;
  gap: 10px;
}

.tool-group-accordion {
  gap: 0;
}

.tool-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  padding: 0;
}

.tool-group-header h3 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.tool-group-header::-webkit-details-marker {
  display: none;
}

.tool-group-header::after {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 120ms ease;
  margin-left: auto;
  flex: 0 0 auto;
}

.tool-group-accordion[open] > .tool-group-header::after {
  transform: rotate(-135deg);
}

.tool-group-body {
  padding-top: 10px;
}

.control-list {
  display: grid;
  gap: 10px;
}

.control-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(29, 42, 52, 0.07);
}

.control-item:hover {
  border-color: rgba(39, 86, 107, 0.24);
}

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

.control-main input {
  margin: 0;
  accent-color: var(--accent);
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 0 1px rgba(29, 42, 52, 0.14);
}

.swatch-line {
  width: 22px;
  height: 0;
  border-top-width: 3px;
  border-top-style: solid;
  border-radius: 999px;
  flex: 0 0 auto;
}

.control-text {
  min-width: 0;
}

.control-label {
  display: block;
  font-weight: 600;
  color: var(--ink);
}

.control-hint {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.9rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.inspection-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 320px;
  min-height: 0;
  padding: 16px 18px;
}

.inspection-panel .panel-header {
  margin-bottom: 10px;
}

.inspection-panel .panel-subtitle {
  margin-top: 0;
}

.inspection-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-top: 14px;
  padding-right: 4px;
}

.inspection-panel-body-list {
  scrollbar-gutter: stable;
}

.inspection-panel-body-detail {
  scrollbar-gutter: stable;
}

.reference-section {
  display: grid;
  gap: 12px;
  margin-top: -4px;
  padding-top: 16px;
  padding-bottom: 16px;
  border-color: rgba(29, 42, 52, 0.06);
  box-shadow: 0 12px 28px rgba(29, 42, 52, 0.08);
}

.reference-header {
  margin-bottom: 0;
}

.reference-flow {
  display: grid;
  gap: 12px;
  max-width: 54rem;
}

.reference-summary {
  display: grid;
  gap: 6px;
  padding-bottom: 4px;
}

.reference-summary-line {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.94rem;
}

.reference-details {
  border-top: 1px solid rgba(29, 42, 52, 0.08);
  padding-top: 10px;
}

.reference-details[open] {
  padding-bottom: 4px;
}

.reference-toggle {
  cursor: pointer;
  list-style: none;
  font-family: "Fraunces", serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.reference-toggle::-webkit-details-marker {
  display: none;
}

.legend-section {
  display: grid;
  gap: 8px;
  padding-top: 10px;
}

.legend-group-title {
  margin: 0 0 8px;
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.legend-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.94rem;
}

.legend-items {
  display: grid;
  gap: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.summary-group {
  display: grid;
  gap: 8px;
}

.summary-title {
  margin: 0;
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.summary-items {
  display: grid;
  gap: 6px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.94rem;
}

.hotspot-list {
  display: grid;
  gap: 10px;
  max-height: none;
  overflow: visible;
  align-content: start;
}

.hotspot-card {
  appearance: none;
  width: 100%;
  border: 1px solid rgba(29, 42, 52, 0.09);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  padding: 14px 15px;
  text-align: left;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.hotspot-card:hover,
.hotspot-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(39, 86, 107, 0.28);
  outline: none;
}

.hotspot-card.is-active {
  background: rgba(39, 86, 107, 0.1);
  border-color: rgba(39, 86, 107, 0.34);
}

.hotspot-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.hotspot-card-title {
  margin: 0;
  font-weight: 700;
  color: var(--ink);
}

.hotspot-card p {
  margin: 8px 0 0;
  font-size: 0.93rem;
}

.mini-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.77rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.detail-panel {
  min-height: 180px;
  min-width: 0;
}

.detail-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.detail-title {
  margin: 0;
  font-size: 1.35rem;
}

.detail-body {
  margin: 0 0 14px;
  overflow-wrap: anywhere;
}

.detail-meta {
  display: grid;
  gap: 8px;
}

.detail-meta-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  font-size: 0.94rem;
}

.detail-meta-label {
  color: var(--muted);
  font-weight: 600;
}

.future-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  padding: 13px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #27566b, #476d7d);
  color: #f9f3ec;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0.5;
  text-decoration: none;
}

.future-button-live {
  opacity: 1;
  cursor: pointer;
}

.future-button-live:hover,
.future-button-live:focus-visible {
  filter: brightness(1.03);
  outline: none;
}

.future-button-live:disabled {
  opacity: 0.7;
  cursor: wait;
  filter: none;
}

.text-button {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}

.text-button:hover,
.text-button:focus-visible {
  text-decoration: underline;
  outline: none;
}

.text-button:disabled {
  color: var(--muted);
  cursor: not-allowed;
  text-decoration: none;
}

.capture-banner {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: min(640px, calc(100% - 32px));
  padding: 14px 16px;
  border: 1px solid rgba(29, 42, 52, 0.14);
  border-radius: 18px;
  background: rgba(255, 252, 247, 0.96);
  box-shadow: 0 18px 40px rgba(29, 42, 52, 0.16);
  z-index: 1001;
}

.capture-banner[hidden] {
  display: none;
}

.capture-banner-copy {
  margin: 0;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.45;
}

.map-capture-active #map,
.map-capture-active #survey-map {
  cursor: crosshair;
}

.drawer-close {
  appearance: none;
  border: 1px solid rgba(29, 42, 52, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}

.report-form {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.fieldset-reset {
  border: 0;
  padding: 0;
  margin: 0;
  min-inline-size: 0;
}

.field-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
}

.field[hidden] {
  display: none;
}

.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
.field textarea {
  width: 100%;
  border: 1px solid rgba(29, 42, 52, 0.12);
  border-radius: 14px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  min-width: 0;
}

.field textarea {
  resize: vertical;
  min-height: 88px;
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field-help {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.field-error {
  color: #9e3a35;
}

.coordinate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.checkbox-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--ink);
  border: 1px solid rgba(29, 42, 52, 0.1);
  background: rgba(255, 255, 255, 0.68);
  border-radius: 14px;
  padding: 11px 12px;
  cursor: pointer;
}

.checkbox-card input {
  margin: 0;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.checkbox-card span {
  min-width: 0;
  font-weight: 500;
  line-height: 1.3;
}

.drawer-footer {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.map-column {
  min-width: 0;
}

.survey-page .page-header {
  padding-bottom: 22px;
}

.survey-intro {
  display: grid;
  gap: 14px;
}

.survey-guidance {
  display: grid;
  gap: 18px;
  margin: 0 6px 24px;
}

.survey-guidance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.survey-list,
.survey-example-list {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 10px;
  color: var(--muted);
  line-height: 1.55;
}

.survey-example-list strong {
  color: var(--ink);
  font-weight: 600;
}

.survey-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  gap: 22px;
  align-items: stretch;
}

.review-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  gap: 22px;
  align-items: start;
}

.survey-map-card,
.survey-form-panel {
  min-width: 0;
}

.review-map-card,
.review-rail {
  min-width: 0;
  align-self: start;
}

.survey-map-card {
  padding: 18px;
  position: sticky;
  top: 0;
}

.survey-map-card .map-stage {
  height: calc(100vh - 36px);
  min-height: 500px;
}

#survey-map {
  width: 100%;
  min-height: 720px;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(29, 42, 52, 0.1);
}

#review-map {
  width: 100%;
  min-height: 0;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(29, 42, 52, 0.1);
}

.survey-form-panel {
  display: grid;
  align-content: start;
  gap: 18px;
}

.survey-form {
  display: grid;
  gap: 18px;
}

.survey-helper {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.survey-confirmation {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(39, 86, 107, 0.16);
  background: rgba(39, 86, 107, 0.08);
}

.survey-confirmation[data-state="warning"] {
  border-color: rgba(124, 93, 50, 0.18);
  background: rgba(124, 93, 50, 0.08);
}

.survey-confirmation[data-state="error"] {
  border-color: rgba(158, 58, 53, 0.18);
  background: rgba(158, 58, 53, 0.08);
}

.survey-confirmation[hidden] {
  display: none;
}

.survey-under-review {
  display: grid;
  gap: 10px;
}

.review-snapshot {
  display: grid;
  gap: 12px;
  margin: 0 6px 20px;
}

.review-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.review-metric {
  display: grid;
  gap: 6px;
  padding: 11px 13px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(29, 42, 52, 0.07);
}

.review-metric-label {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.review-metric-value {
  font-family: "Fraunces", serif;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink);
}

.review-metric-text {
  font-size: 1.08rem;
  line-height: 1.25;
}

.review-map-card {
  height: var(--workspace-height);
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 18px;
}

.review-map-card .map-stage {
  min-height: 0;
}

.review-rail {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 12px;
  height: var(--workspace-height);
  min-height: 0;
  padding-bottom: 14px;
  overflow: hidden;
}

.review-filters {
  display: grid;
  gap: 10px;
}

.review-inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.review-inline-toggle input {
  margin: 0;
  accent-color: var(--accent);
}

.review-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.review-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 4px;
  align-content: start;
}

.review-card {
  display: grid;
  gap: 0;
}

.review-card-meta,
.review-item-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.review-item {
  padding: 0;
  overflow: hidden;
}

.review-item[open] {
  border-color: rgba(39, 86, 107, 0.18);
}

.review-item-summary {
  list-style: none;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  cursor: pointer;
}

.review-item-summary::-webkit-details-marker {
  display: none;
}

.review-item-summary-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.review-item-summary .hotspot-card-title {
  margin: 0;
}

.review-item-body {
  display: grid;
  gap: 8px;
  padding: 0 14px 12px;
  border-top: 1px solid rgba(29, 42, 52, 0.08);
}

.review-item-location {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.review-card-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-pill {
  font-size: 0.75rem;
}

.review-detail {
  display: grid;
  gap: 10px;
  margin-top: 2px;
}

.review-photo-block {
  display: grid;
  gap: 10px;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid rgba(29, 42, 52, 0.08);
}

.review-photo {
  display: block;
  max-width: min(100%, 560px);
  border-radius: 18px;
  border: 1px solid rgba(29, 42, 52, 0.1);
  box-shadow: var(--shadow);
}

.map-card {
  height: 100%;
  padding: 18px;
  min-height: var(--workspace-height);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.map-card-header {
  margin-bottom: 14px;
}

.map-card-header h2 {
  margin-top: 2px;
  font-size: 1.55rem;
}

.map-stage {
  position: relative;
  height: 100%;
  min-height: 680px;
}

#map {
  width: 100%;
  min-height: 680px;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(29, 42, 52, 0.1);
}

.map-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  border-radius: 18px;
  border: 1px solid rgba(29, 42, 52, 0.1);
  background:
    linear-gradient(180deg, rgba(247, 242, 232, 0.96), rgba(244, 240, 231, 0.98)),
    rgba(244, 240, 231, 0.98);
  text-align: center;
}

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

.map-status-copy {
  max-width: 28rem;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 1rem;
}

.leaflet-container {
  font: inherit;
  background: #dfe6e7;
}

.map-popup h3 {
  margin: 0 0 6px;
  font-family: "Fraunces", serif;
  font-size: 1.05rem;
}

.map-popup p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.leaflet-popup-content-wrapper {
  border-radius: 16px;
}

.leaflet-popup-content {
  margin: 14px 16px;
  min-width: 220px;
}

.noscript-banner {
  width: min(880px, calc(100% - 32px));
  margin: 12px auto 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff5df;
  color: #7d4c18;
  border: 1px solid rgba(125, 76, 24, 0.2);
  font-weight: 600;
}

@media (max-width: 1040px) {
  .masthead,
  .notes-summary,
  .workspace,
  .inspection-strip,
  .survey-guidance-grid,
  .survey-workspace,
  .review-workspace {
    grid-template-columns: 1fr;
  }

  .page-shell {
    width: min(100%, calc(100% - 22px));
  }

  .map-card-header {
    flex-direction: column;
  }

  .notes-actions {
    justify-items: start;
  }

  .process-link,
  .theme-toggle {
    justify-self: start;
  }

  .sidebar-scroll {
    max-height: none;
    height: auto;
    overflow: visible;
    padding-right: 0;
  }

  .inspection-strip {
    margin-top: 4px;
  }

  .inspection-panel {
    max-height: none;
    height: auto;
  }

  .inspection-panel-body {
    overflow: visible;
    padding-right: 0;
  }

  #map {
    min-height: 520px;
  }

  .map-stage {
    min-height: 520px;
  }

  #survey-map,
  .survey-map-card .map-stage,
  #review-map,
  .review-map-card .map-stage {
    min-height: 540px;
  }

  .review-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-map-card,
  .review-rail {
    height: auto;
  }

  .review-list {
    overflow: visible;
    padding-right: 0;
  }
}

:root[data-theme="dark"] .process-link,
:root[data-theme="dark"] .theme-toggle,
:root[data-theme="dark"] .control-item,
:root[data-theme="dark"] .hotspot-card,
:root[data-theme="dark"] .capture-banner,
:root[data-theme="dark"] .drawer-close,
:root[data-theme="dark"] .field input:not([type="checkbox"]):not([type="radio"]),
:root[data-theme="dark"] .field select,
:root[data-theme="dark"] .field textarea,
:root[data-theme="dark"] .checkbox-card {
  background: rgba(31, 41, 48, 0.82);
  border-color: rgba(226, 235, 240, 0.12);
  color: var(--ink);
}

:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .map-card {
  border-color: rgba(226, 235, 240, 0.1);
}

:root[data-theme="dark"] .swatch {
  border-color: rgba(20, 25, 30, 0.9);
  box-shadow: 0 0 0 1px rgba(226, 235, 240, 0.18);
}

:root[data-theme="dark"] .hotspot-card.is-active,
:root[data-theme="dark"] .survey-confirmation,
:root[data-theme="dark"] .review-metric {
  background: rgba(47, 79, 96, 0.28);
}

:root[data-theme="dark"] .survey-confirmation[data-state="warning"] {
  background: rgba(124, 93, 50, 0.18);
}

:root[data-theme="dark"] .survey-confirmation[data-state="error"] {
  background: rgba(158, 58, 53, 0.18);
}

:root[data-theme="dark"] .future-button-live {
  color: #f3f7f6;
}

:root[data-theme="dark"] .map-status {
  background: rgba(17, 24, 29, 0.86);
}

:root[data-theme="dark"] .leaflet-popup-content-wrapper,
:root[data-theme="dark"] .leaflet-popup-tip {
  background: #1c262d;
  color: var(--ink);
}

:root[data-theme="dark"] .leaflet-popup-close-button {
  color: var(--muted);
}

@media (max-width: 720px) {
  .page-shell {
    padding-top: 16px;
  }

  .panel,
  .map-card {
    border-radius: 18px;
  }

  .panel {
    padding: 16px;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .coordinate-grid,
  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .field-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .capture-banner {
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: auto;
    transform: none;
    flex-direction: column;
    align-items: stretch;
  }

  .hotspot-list {
    max-height: none;
  }

  #map {
    min-height: 430px;
  }

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

  #survey-map,
  .survey-map-card .map-stage,
  #review-map,
  .review-map-card .map-stage {
    min-height: 420px;
  }

  .detail-meta-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

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

/* =====================================================
   SURVEY PAGE — Gateway layout
   Narrow shell (header + CTA) → full-width map → narrow footer
   ===================================================== */

/* --- Narrow shell --- */

.survey-shell {
  max-width: 900px;
}

/* --- Header --- */

.survey-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 28px;
}

.survey-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.95;
}

.survey-header-text {
  flex: 1 1 auto;
  min-width: 0;
}

.survey-header .eyebrow {
  margin-bottom: 12px;
}

.survey-header .theme-toggle {
  flex: 0 0 auto;
  margin-top: 6px;
}

/* --- CTA block --- */

.survey-cta-block {
  padding: 32px 36px 36px;
}

.survey-cta-body {
  max-width: 600px;
}

.survey-cta-block h2 {
  font-family: "Fraunces", serif;
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  line-height: 1.15;
}

.survey-cta-desc {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.survey-cta-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.survey-meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* =====================================================
   CTA BUTTON — Animated, coral, with shimmer sweep
   ===================================================== */

/* Entrance: slides up with a slight spring overshoot */
@keyframes survey-btn-enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Shimmer: diagonal highlight sweeps across in first 15% of cycle,
   then nothing for the remaining 85% — effect fires every ~5s */
@keyframes survey-btn-shimmer {
  0%   { transform: skewX(-20deg) translateX(-140%); }
  15%  { transform: skewX(-20deg) translateX(260%); }
  100% { transform: skewX(-20deg) translateX(260%); }
}

.survey-cta-button {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, #d4603a 0%, #bf4f2d 100%);
  color: #fff8f4;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.025em;
  text-decoration: none;
  /* Ambient glow — static, always visible */
  box-shadow:
    0 6px 28px rgba(191, 79, 45, 0.38),
    0 2px 8px  rgba(191, 79, 45, 0.22);
  /* Entrance fires once on load after 300ms delay */
  animation: survey-btn-enter 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
  transition:
    transform       160ms ease,
    box-shadow      160ms ease,
    filter          160ms ease;
  will-change: transform;
}

/* Shimmer pseudo-element */
.survey-cta-button::after {
  content: "";
  position: absolute;
  top: -50%;
  left: 0;
  width: 40%;
  height: 200%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0)    0%,
    rgba(255, 255, 255, 0.22) 50%,
    rgba(255, 255, 255, 0)    100%
  );
  animation: survey-btn-shimmer 5s ease-in-out 1.2s infinite;
  pointer-events: none;
}

.survey-cta-button svg {
  flex: 0 0 auto;
  opacity: 0.85;
  transition: transform 160ms ease;
}

/* Hover: lift, stronger glow, arrow nudges right */
.survey-cta-button:hover,
.survey-cta-button:focus-visible {
  transform: translateY(-2px);
  box-shadow:
    0 12px 36px rgba(191, 79, 45, 0.50),
    0 4px  12px rgba(191, 79, 45, 0.28);
  filter: brightness(1.05);
  outline: none;
}

.survey-cta-button:hover svg,
.survey-cta-button:focus-visible svg {
  transform: translate(2px, -2px);
}

/* Pause shimmer on hover so it doesn't feel frantic */
.survey-cta-button:hover::after,
.survey-cta-button:focus-visible::after {
  animation-play-state: paused;
}

/* Active/press: sink slightly */
.survey-cta-button:active {
  transform: translateY(0px);
  filter: brightness(0.97);
}

/* Accessibility: no animation for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .survey-cta-button {
    animation: none;
  }
  .survey-cta-button::after {
    display: none;
  }
}

/* --- Section divider --- */

.survey-section-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 44px 0 0;
}

.survey-section-divider::before,
.survey-section-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.survey-section-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* =====================================================
   MAP BREAKOUT — full viewport width, own centering
   ===================================================== */

.survey-map-breakout {
  width: 100%;
  padding: 36px 0 48px;
  border-top: none;
}

.survey-map-inner {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
}

.map-section-intro {
  margin-bottom: 22px;
}

.map-section-intro h2 {
  font-family: "Fraunces", serif;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.map-section-intro .panel-subtitle {
  margin: 0;
  max-width: 44rem;
}

/* --- Footer --- */

.survey-footer {
  padding: 20px 0 24px;
  border-top: 1px solid var(--line);
}

.survey-footer p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
}

/* =====================================================
   MOBILE
   ===================================================== */

@media (max-width: 600px) {
  .survey-header {
    flex-direction: column;
    gap: 10px;
    padding-bottom: 20px;
  }

  .survey-header .theme-toggle {
    margin-top: 0;
    align-self: flex-start;
  }

  .survey-cta-block {
    padding: 24px 22px 28px;
  }

  .survey-section-divider {
    margin: 28px 0 0;
  }

  .survey-section-label {
    font-size: 0.72rem;
  }

  .survey-map-breakout {
    padding: 28px 0 36px;
  }

  .survey-map-inner {
    width: min(100%, calc(100% - 24px));
  }
}

/* =====================================================
   DARK MODE
   ===================================================== */

:root[data-theme="dark"] .survey-cta-button {
  background: linear-gradient(135deg, #c85a35 0%, #ad4828 100%);
  color: #fff5f0;
  box-shadow:
    0 6px 28px rgba(200, 90, 53, 0.42),
    0 2px 8px  rgba(200, 90, 53, 0.24);
}

:root[data-theme="dark"] .survey-cta-button:hover,
:root[data-theme="dark"] .survey-cta-button:focus-visible {
  box-shadow:
    0 12px 36px rgba(200, 90, 53, 0.56),
    0 4px  12px rgba(200, 90, 53, 0.30);
}
