:root {
  color-scheme: light;
  --bg: #f7f7f6;
  --surface: #ffffff;
  --surface-muted: #eeeeec;
  --text: #111111;
  --subtle: #5f5f5b;
  --muted: #a0a09b;
  --line: #deded9;
  --accent: #171717;
  --accent-soft: #f1f1ee;
  --accent-mid: #e4e4df;
  --danger: #8f2f2f;
  --shadow: 0 22px 60px rgba(17, 17, 17, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0d;
  --surface: #171717;
  --surface-muted: #252525;
  --text: #f4f4f2;
  --subtle: #b4b4ae;
  --muted: #767670;
  --line: #343434;
  --accent: #f4f4f2;
  --accent-soft: #242424;
  --accent-mid: #303030;
  --danger: #e17070;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100vh;
}

.report-stage {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  background: var(--bg);
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: max(14px, env(safe-area-inset-top)) 20px 12px;
}

.ghost-button,
.icon-button {
  border: 0;
  background: transparent;
  color: var(--subtle);
  min-height: 44px;
}

.ghost-button {
  text-align: left;
  visibility: hidden;
}

.ghost-button.visible {
  visibility: visible;
}

.icon-button {
  display: grid;
  place-items: center;
  justify-self: end;
  width: 44px;
  border-radius: 999px;
}

.icon-button:hover {
  background: var(--surface-muted);
}

.account-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.topbar-link:hover {
  background: var(--surface-muted);
}

.profile-link {
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}

.profile-link:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 34%, transparent);
  outline-offset: 2px;
}

.profile-icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.topbar-menu-shell {
  position: relative;
}

.vertical-dots {
  display: grid;
  gap: 3px;
  place-items: center;
}

.vertical-dots span {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
}

.topbar-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.16);
  padding: 6px;
}

.topbar-menu-item {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  padding: 0 12px;
  text-align: left;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
}

.topbar-menu-item:hover,
.topbar-menu-item:focus-visible {
  background: var(--surface-muted);
}

.progress-dots {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--line);
  transition: width 160ms ease, background 160ms ease;
}

.dot.active {
  width: 18px;
  background: var(--accent);
}

@media (max-width: 430px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .account-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

.screen {
  flex: 1;
  overflow: auto;
  padding: 12px 22px 28px;
}

.action-bar {
  padding: 12px 22px max(18px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, var(--bg) 24%);
}

.report-status {
  margin: 0 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--subtle);
  padding: 12px 14px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.primary-button,
.secondary-button,
.option-card,
.chip,
.detect-button {
  border-radius: 14px;
  border: 1.5px solid transparent;
}

.primary-button,
.secondary-button,
.detect-button {
  min-height: 50px;
}

.primary-button {
  width: 100%;
  border: 0;
  background: var(--accent);
  color: var(--surface);
  font-weight: 750;
}

.primary-button:disabled {
  background: var(--surface-muted);
  color: var(--muted);
  cursor: default;
}

.secondary-button {
  width: 100%;
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
}

.screen h2 {
  margin: 0 0 8px;
  font-size: clamp(1.85rem, 8vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.lede {
  margin: 0 0 24px;
  color: var(--subtle);
  line-height: 1.45;
}

.two-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 26px;
}

.option-card {
  background: var(--surface);
  color: var(--text);
  padding: 18px 14px;
  min-height: 128px;
  text-align: left;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}

.option-card strong,
.category-row strong {
  display: block;
  font-size: 0.98rem;
}

.option-card span:not(.tile-icon),
.category-row span:not(.tile-icon):not(.checkmark) {
  display: block;
  margin-top: 5px;
  color: var(--subtle);
  font-size: 0.82rem;
  line-height: 1.35;
}

.option-card.selected,
.category-row.selected,
.chip.selected,
.segmented button.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.field-label {
  margin: 28px 0 11px;
  color: var(--subtle);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.category-list {
  display: grid;
  gap: 9px;
}

.category-row {
  display: grid;
  grid-template-columns: 40px 1fr 22px;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1.5px solid transparent;
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.category-row.inactive {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.72;
}

.category-row.inactive .tile-icon {
  color: var(--muted);
}

.tile-icon,
.checkmark {
  display: grid;
  place-items: center;
  border-radius: 11px;
}

.option-card > .tile-icon,
.category-row > .tile-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0 0 10px;
  background: var(--surface-muted);
  color: var(--accent);
  font-weight: 900;
}

.category-row > .tile-icon {
  margin: 0;
}

.checkmark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.75px solid var(--muted);
  border-radius: 6px;
  background: var(--surface);
  color: transparent;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1;
}

.category-row.selected > .checkmark {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--surface);
}

.category-row.inactive > .checkmark {
  border-color: var(--line);
  background: var(--surface-muted);
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.symptom-grid,
.badge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.chip {
  min-height: 42px;
  padding: 9px 14px;
  background: var(--surface-muted);
  color: var(--subtle);
  font-weight: 700;
}

.chip.selected {
  color: var(--text);
}

.exposure-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.exposure-question,
.exposure-follow-up {
  display: grid;
  gap: 10px;
}

.symptom-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 112px;
  max-width: 100%;
  min-width: 0;
  padding: 10px 4px;
  text-align: center;
  white-space: normal;
  width: 100%;
}

.symptom-badge {
  width: clamp(56px, 18vw, 72px);
  height: clamp(56px, 18vw, 72px);
  flex: 0 0 clamp(56px, 18vw, 72px);
  object-fit: contain;
}

.symptom-chip span {
  min-width: 0;
  font-size: 0.72rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.input-row,
.text-area {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.location-autocomplete {
  position: relative;
  display: grid;
  gap: 8px;
}

.location-autocomplete-input {
  min-height: 54px;
}

.location-autocomplete-list {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.location-autocomplete-option {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-weight: 700;
  text-align: left;
}

.location-autocomplete-option:last-child {
  border-bottom: 0;
}

.location-autocomplete-option:hover,
.location-autocomplete-option:focus-visible {
  background: var(--surface-muted);
}

.autocomplete-status {
  padding: 0 2px;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 54px;
  border-radius: 13px;
  overflow: hidden;
}

.input-row input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 15px 14px;
  outline: 0;
  font-weight: 700;
}

.date-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 14px;
  text-align: left;
}

.date-field:hover,
.date-field:focus-visible {
  border-color: var(--accent);
  outline: 0;
}

.date-field.has-value {
  color: var(--text);
}

.date-field-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  color: var(--subtle);
}

.date-field-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.date-field-caret,
.calendar-chevron {
  display: inline-block;
  width: 8px;
  height: 8px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
}

.date-field-caret {
  color: var(--subtle);
  transform: rotate(45deg);
}

.detect-button {
  margin-right: 4px;
  border: 0;
  background: transparent;
  color: var(--subtle);
  padding: 0 12px;
}

.detect-button:disabled {
  opacity: 0.6;
}

.text-area {
  min-height: 92px;
  resize: vertical;
  border-radius: 13px;
  padding: 14px;
  outline: 0;
}

.photo-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  padding: 0 16px;
  color: var(--subtle);
  font-weight: 700;
}

.photo-button:hover,
.photo-button:focus-visible {
  background: var(--accent-soft);
  color: var(--text);
  outline: 0;
}

.photo-button:disabled,
.photo-remove-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.photo-picker {
  display: grid;
  gap: 10px;
}

.photo-summary {
  margin: 0;
  color: var(--subtle);
  font-size: 0.82rem;
  line-height: 1.35;
}

.photo-list {
  display: grid;
  gap: 8px;
}

.photo-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  padding: 10px 12px;
}

.photo-name,
.photo-meta {
  min-width: 0;
}

.photo-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.photo-meta {
  color: var(--subtle);
  font-size: 0.78rem;
}

.photo-status {
  grid-column: 1 / -1;
  color: var(--subtle);
  font-size: 0.78rem;
  line-height: 1.35;
}

.photo-status.error {
  color: var(--danger);
}

.photo-remove-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text);
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 700;
}

.report-location-section {
  display: grid;
  gap: 14px;
}

.report-location-section .lede {
  margin-bottom: 4px;
}

.report-location-status {
  margin: 0;
}

.report-location-map {
  position: relative;
  width: 100%;
  height: clamp(280px, 62vw, 390px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(103, 169, 207, 0.22), rgba(239, 138, 98, 0.18)),
    var(--surface-muted);
}

.report-location-map .mapboxgl-ctrl-bottom-left,
.report-location-map .mapboxgl-ctrl-bottom-right {
  display: none;
}

.report-location-coordinates {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--subtle);
  font-size: 0.86rem;
  line-height: 1.35;
}

.report-location-coordinates strong {
  color: var(--text);
}

.report-location-actions {
  display: grid;
  gap: 10px;
}

.field-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.82rem;
  line-height: 1.35;
}

.field-status {
  margin: 0;
  color: var(--subtle);
  font-size: 0.82rem;
  line-height: 1.35;
}

.calendar-modal-open {
  overflow: hidden;
}

.calendar-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  align-items: end;
}

.calendar-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(0, 0, 0, 0.34);
}

.calendar-sheet {
  position: relative;
  width: 100%;
  max-height: calc(100vh - 28px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 24px 24px 0 0;
  background: var(--bg);
  padding: 16px 18px max(24px, env(safe-area-inset-bottom));
  box-shadow: var(--shadow);
}

.calendar-grabber {
  width: 44px;
  height: 4px;
  margin: 0 auto 16px;
  border-radius: 999px;
  background: var(--line);
}

.calendar-sheet-heading,
.calendar-month-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.calendar-sheet-heading {
  margin-bottom: 14px;
}

.calendar-sheet-heading .field-label {
  margin: 0 0 4px;
}

.calendar-sheet-heading h3 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.2;
}

.calendar-close,
.calendar-nav {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  background: var(--surface-muted);
  color: var(--text);
}

.calendar-close {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  font-weight: 800;
}

.calendar-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 12px;
}

.calendar-month-bar {
  margin-bottom: 12px;
}

.calendar-month-bar strong {
  min-width: 0;
  color: var(--text);
  font-size: 1rem;
  text-align: center;
}

.calendar-nav {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: var(--subtle);
}

.calendar-chevron.previous {
  transform: rotate(135deg);
}

.calendar-chevron.next {
  transform: rotate(-45deg);
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  margin-bottom: 4px;
}

.calendar-weekdays span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.calendar-grid {
  gap: 4px;
}

.calendar-day,
.calendar-day-placeholder {
  aspect-ratio: 1;
  min-width: 0;
}

.calendar-day {
  display: grid;
  place-items: center;
  min-height: 38px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
}

.calendar-day:not(:disabled):hover,
.calendar-day:not(:disabled):focus-visible,
.calendar-nav:hover,
.calendar-nav:focus-visible,
.calendar-close:hover,
.calendar-close:focus-visible {
  background: var(--accent-soft);
  outline: 0;
}

.calendar-day.today {
  border: 1.4px solid var(--accent-mid);
  background: var(--accent-soft);
}

.calendar-day.selected {
  background: var(--accent);
  color: var(--surface);
  font-weight: 850;
}

.calendar-day:disabled,
.calendar-day.future {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.42;
}

.done-view {
  min-height: 100%;
  display: grid;
  align-content: center;
  gap: 14px;
  text-align: center;
}

.done-icon {
  justify-self: center;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--surface);
  font-size: 2rem;
  font-weight: 900;
}

.nearby-card,
.summary-card,
.map-panel,
.front-door-map-panel,
.mobile-map-panel,
pre {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
}

.nearby-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.nearby-card .metric,
.summary-card .metric {
  display: block;
  font-size: 2rem;
  font-weight: 850;
}

.metric-pair {
  display: grid;
  gap: 3px;
}

.metric-pair + .metric-pair {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-items: end;
  background: rgba(0, 0, 0, 0.34);
  padding-top: 30px;
}

.settings-sheet {
  width: 100%;
  max-height: calc(100vh - 30px);
  overflow: auto;
  border-radius: 28px 28px 0 0;
  background: var(--surface);
  padding: 26px 22px max(34px, env(safe-area-inset-bottom));
}

.sheet-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sheet-heading h2 {
  margin: 0;
}

.option-list {
  display: grid;
  gap: 8px;
}

.language-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 64px;
  border: 1.5px solid transparent;
  border-radius: 16px;
  background: var(--surface-muted);
  color: var(--text);
  padding: 12px 16px;
  text-align: left;
}

.language-option span {
  display: block;
  color: var(--subtle);
  font-size: 0.78rem;
}

.language-option.selected {
  border-color: var(--text);
}

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

.segmented button {
  min-height: 50px;
  border: 1.5px solid transparent;
  border-radius: 14px;
  background: var(--surface-muted);
  color: var(--subtle);
  font-weight: 750;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-card {
  padding: 18px;
}

.map-panel,
.front-door-map-panel,
.mobile-map-panel {
  overflow: hidden;
}

.front-door-map-panel {
  width: 100%;
  margin: 18px 0 0;
}

.map-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 14px 10px;
  text-align: left;
}

.map-heading > div {
  min-width: 0;
}

.map-heading h2,
.map-heading h3 {
  margin: 4px 0 0;
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.front-door-map .mapboxgl-ctrl-bottom-left,
.front-door-map .mapboxgl-ctrl-bottom-right {
  display: none;
}

.map-count {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  padding: 6px 9px;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
}

.report-map {
  position: relative;
  width: 100%;
  min-height: clamp(280px, 44vw, 390px);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(103, 169, 207, 0.22), rgba(239, 138, 98, 0.18)),
    var(--surface-muted);
}

.report-map.compact {
  min-height: 0;
  height: clamp(210px, 62vw, 250px);
}

/* PREVIEW (Map Lab): roomy front-door map so the dataset is easy to eyeball. */
.front-door-map.compact {
  height: clamp(380px, 56vh, 760px);
}

.map-lab-section {
  padding: 12px 0 4px;
  border-top: 1px solid var(--line);
}

.map-lab-section:first-of-type {
  border-top: none;
}

.map-lab-section-title {
  margin: 0 0 4px;
  padding: 0 14px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
}

.map-lab-section-hint {
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--subtle);
}

.map-lab-section-note {
  margin: 0 0 10px;
  padding: 0 14px;
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--subtle);
}

.map-lab-shading-options:empty {
  display: none;
}

.map-lab-shading-options {
  margin: 4px 0 0 14px;
  padding-top: 10px;
  border-left: 2px solid var(--line);
}

.map-lab-shading-options .map-lab-toggle {
  padding-left: 12px;
}

.map-lab-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 0 14px 12px;
  min-width: 0;
}

/* display:flex above beats the UA [hidden] rule, so hide the style row explicitly. */
.map-lab-toggle[hidden] {
  display: none;
}

.map-lab-toggle-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--subtle);
  margin-right: 2px;
}

.map-lab-toggle button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  min-height: 36px;
}

.map-lab-toggle button.active {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}

/* Healthy on/off rendered as an iOS-style sliding switch: track + knob that
   slides to the "on" side. Higher specificity than .map-lab-toggle button so
   the pill styling above is fully overridden. */
.map-lab-toggle button.map-lab-switch {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  min-width: 46px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--muted);
  transition: background 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
}

.map-lab-toggle button.map-lab-switch.active {
  background: var(--text);
  border-color: var(--text);
}

.map-lab-switch-knob {
  position: absolute;
  top: 50%;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  transform: translateY(-50%);
  transition: transform 0.18s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.map-lab-switch.active .map-lab-switch-knob {
  transform: translate(18px, -50%);
}

.map-lab-toggle button.map-lab-switch:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  .map-lab-toggle button.map-lab-switch,
  .map-lab-switch-knob {
    transition: none;
  }
}

/* Style pie/single rendered as one segmented control: connected segments
   sharing a single pill border, only the active segment filled. */
.map-lab-segmented {
  display: inline-flex;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.map-lab-toggle .map-lab-segmented button {
  border: 0;
  border-radius: 0;
  min-height: 34px;
}

.map-lab-toggle .map-lab-segmented button + button {
  box-shadow: inset 1px 0 0 var(--line);
}

.map-lab-symptom-select {
  flex: 0 1 auto;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  min-height: 36px;
  cursor: pointer;
}

.map-lab-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.map-lab-emoji {
  margin-right: 6px;
  font-size: 0.95rem;
  line-height: 1;
  vertical-align: middle;
}

.map-lab-breadcrumb-slot:empty {
  display: none;
}

.map-lab-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 14px 12px;
  padding: 7px 10px 7px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.8rem;
}

.map-lab-breadcrumb-home {
  border: none;
  background: none;
  color: var(--accent, #2563eb);
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}

.map-lab-breadcrumb-sep {
  color: var(--subtle);
}

.map-lab-breadcrumb-current {
  font-weight: 700;
  color: var(--text);
}

.map-lab-breadcrumb-close {
  margin-left: auto;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  width: 26px;
  height: 26px;
  line-height: 1;
  font-size: 0.95rem;
  cursor: pointer;
}

.report-time-controls {
  display: grid;
  gap: 10px;
  padding: 0 14px 12px;
}

.report-time-mode {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-time-mode button,
.report-playback-controls button {
  flex: 0 0 auto;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 800;
}

.report-time-mode button {
  width: 100%;
}

.report-time-mode button.selected {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}

.report-playback-controls button {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.report-playback-controls button[aria-pressed="true"] {
  border-color: var(--text);
  background: var(--text);
}

.report-date-slider {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.report-date-slider-summary {
  justify-self: end;
  margin: 0;
  padding: 0;
  text-align: right;
}

.report-date-slider-heading,
.report-date-slider-range {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--subtle);
  font-size: 0.78rem;
  line-height: 1.25;
}

.report-date-slider-heading > span {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
}

.report-date-slider-heading.single {
  justify-content: space-between;
}

.report-date-slider-heading strong {
  color: var(--text);
  font-size: 0.9rem;
}

.report-date-slider input[type="range"] {
  width: 100%;
  min-width: 0;
  accent-color: var(--accent);
}

.report-date-slider input.single-date-slider {
  height: 34px;
  margin: 0;
  appearance: none;
  background: transparent;
  accent-color: auto;
}

.report-date-slider input.single-date-slider::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: var(--line);
}

.report-date-slider input.single-date-slider::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -6.5px;
  appearance: none;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.28);
}

.report-date-slider input.single-date-slider::-moz-range-track,
.report-date-slider input.single-date-slider::-moz-range-progress {
  height: 5px;
  border-radius: 999px;
  background: var(--line);
}

.report-date-slider input.single-date-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.28);
}

.report-date-range-control {
  position: relative;
  height: 34px;
  min-width: 0;
  --range-start: 0%;
  --range-end: 100%;
}

.report-date-range-control::before,
.report-date-range-control::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 5px;
  border-radius: 999px;
  transform: translateY(-50%);
}

.report-date-range-control::before {
  background: var(--line);
}

.report-date-range-control::after {
  left: var(--range-start);
  right: calc(100% - var(--range-end));
  background: var(--accent);
}

.report-date-range-control input[type="range"] {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 34px;
  margin: 0;
  appearance: none;
  background: transparent;
  pointer-events: none;
}

.report-date-range-control input.range-end {
  z-index: 3;
}

.report-date-range-control input[type="range"]::-webkit-slider-runnable-track {
  height: 5px;
  background: transparent;
}

.report-date-range-control input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -6.5px;
  appearance: none;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.28);
  pointer-events: auto;
}

.report-date-range-control input[type="range"]::-moz-range-track {
  height: 5px;
  background: transparent;
}

.report-date-range-control input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.28);
  pointer-events: auto;
}

.zip-popup {
  font-size: 0.82rem;
  line-height: 1.4;
}

.zip-popup strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.zip-popup-sick {
  color: #E31A1C;
  font-weight: 700;
}

.zip-popup-healthy {
  color: #1F78B4;
  font-weight: 700;
}

.zip-popup-sub {
  color: var(--subtle);
  margin-top: 2px;
}

.zip-popup-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.zip-popup-head strong {
  display: inline;
  margin-bottom: 0;
}

.zip-popup-pop {
  color: var(--subtle);
  font-size: 0.74rem;
  white-space: nowrap;
}

.zip-popup-share {
  display: flex;
  align-items: center;
  font-weight: 700;
}

.zip-popup-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.zip-popup-split {
  margin-top: 1px;
}

.zip-popup-total {
  margin-top: 1px;
}

.zip-popup-note {
  color: var(--subtle);
  font-size: 0.74rem;
  font-style: italic;
  margin-top: 2px;
}

.zip-popup-divider {
  height: 1px;
  background: var(--border, rgba(0, 0, 0, 0.12));
  margin: 6px 0;
}

.zip-popup-cross {
  color: var(--ink, inherit);
}

.map-note {
  margin: 0;
  padding: 10px 14px 14px;
  color: var(--subtle);
  font-size: 0.82rem;
  line-height: 1.35;
  text-align: left;
}

.community-pulse-slot {
  margin-top: 10px;
}

.community-pulse {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  text-align: left;
}

.community-pulse-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.community-pulse-heading h3 {
  margin: 3px 0 0;
  font-size: 1rem;
}

.community-pulse-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  border-radius: 999px;
  background: var(--surface-muted);
  padding: 3px;
}

.community-pulse-toggle button {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--subtle);
  padding: 5px 9px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.community-pulse-toggle button.selected {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.community-pulse-toggle button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.community-pulse-status {
  height: 1.08rem;
  overflow: hidden;
  margin: 12px 0 2px;
  color: var(--subtle);
  font-size: 0.8rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-pulse-list {
  display: grid;
  max-height: 320px;
  overflow-y: auto;
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  scrollbar-gutter: stable;
}

.community-pulse-list[hidden] {
  display: none;
}

.community-pulse-item {
  position: relative;
  min-width: 0;
  border-top: 1px solid var(--line);
}

.community-pulse-item:first-child {
  border-top: 0;
}

.community-pulse-row {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: default;
  padding: 8px 2px;
  text-align: left;
  white-space: nowrap;
}

.community-pulse-row.has-tooltip {
  cursor: pointer;
}

.community-pulse-row.has-tooltip:hover,
.community-pulse-row.has-tooltip:focus-visible,
.community-pulse-item.open .community-pulse-row.has-tooltip {
  background: var(--surface-muted);
}

.community-pulse-desktop-line {
  display: contents;
}

.community-pulse-mobile-lines {
  display: none;
}

.community-pulse-icons,
.community-pulse-time,
.community-pulse-own,
.community-pulse-separator {
  flex: 0 0 auto;
}

.community-pulse-icons {
  flex: 0 0 5.25rem;
  width: 5.25rem;
  overflow: hidden;
  margin-right: 5px;
  text-align: right;
  white-space: nowrap;
}

.community-pulse-text {
  min-width: 0;
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 750;
  text-overflow: ellipsis;
}

.community-pulse-time,
.community-pulse-separator {
  color: var(--subtle);
  font-size: 0.76rem;
}

.community-pulse-separator {
  margin: 0 6px;
}

.community-pulse-own {
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  padding: 3px 6px;
  font-size: 0.68rem;
  font-weight: 850;
}

.community-pulse-tooltip {
  display: none;
  position: fixed;
  z-index: 30;
  top: var(--community-pulse-tooltip-top, 12px);
  left: var(--community-pulse-tooltip-left, 12px);
  width: min(320px, calc(100vw - 24px));
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text);
  padding: 10px 12px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
  font-size: 0.78rem;
  line-height: 1.45;
  pointer-events: none;
}

.community-pulse-item:hover .community-pulse-tooltip,
.community-pulse-row:focus-visible + .community-pulse-tooltip,
.community-pulse-item.open .community-pulse-tooltip {
  display: grid;
  gap: 8px;
}

.community-pulse-tooltip-section {
  display: grid;
  gap: 1px;
}

.community-pulse-tooltip-section strong {
  margin-bottom: 2px;
}

@media (max-width: 759px) {
  .community-pulse-row {
    display: block;
    min-height: 0;
    padding: 9px 2px 10px;
    white-space: normal;
  }

  .community-pulse-desktop-line {
    display: none;
  }

  .community-pulse-mobile-lines {
    display: grid;
    gap: 3px;
    justify-items: center;
    min-width: 0;
    text-align: center;
  }

  .community-pulse-mobile-top,
  .community-pulse-mobile-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
  }

  .community-pulse-mobile-top {
    gap: 0;
    white-space: nowrap;
  }

  .community-pulse-mobile-bottom {
    flex-wrap: wrap;
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 750;
    line-height: 1.35;
  }

  .community-pulse-mobile-icons {
    flex: 0 0 auto;
    overflow: hidden;
    margin-right: 6px;
    white-space: nowrap;
  }

  .community-pulse-mobile-time {
    flex: 0 0 auto;
    color: var(--subtle);
    font-size: 0.76rem;
  }

  .community-pulse-mobile-summary,
  .community-pulse-mobile-location {
    min-width: 0;
  }
}

.report-dot-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  padding: 12px 14px 0;
  color: var(--subtle);
  font-size: 0.95rem;
  font-weight: 750;
  line-height: 1.3;
  text-align: left;
}

.report-dot-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.report-dot {
  width: 10px;
  height: 10px;
  border: 1.5px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(23, 23, 23, 0.18);
}

.report-dot.sick {
  background: #E31A1C;
}

.report-dot.healthy {
  background: #1F78B4;
}

.report-dot.mixed {
  background: #6A3D9A;
}

.legend-gradient-wrap {
  gap: 6px;
}

.legend-gradient {
  display: inline-block;
  width: 100px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #fecc5c, #fd8d3c, #bd0026);
  box-shadow: 0 0 0 1px rgba(23, 23, 23, 0.18);
}

/* "3 bands" color mode: hard-edged 25/50/25 swatch matching the discrete choropleth. */
.legend-gradient.banded {
  background: linear-gradient(
    90deg,
    #fecc5c 0 25%,
    #fd8d3c 25% 75%,
    #bd0026 75% 100%
  );
}

.legend-size {
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: #b1362f;
  border: 1.5px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(23, 23, 23, 0.18);
}

.legend-opacity {
  display: inline-block;
  width: 48px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(177, 54, 47, 0.12), rgba(177, 54, 47, 0.9));
  box-shadow: 0 0 0 1px rgba(23, 23, 23, 0.18);
}

/* Mirrors the map's "no ZIP code" diagonal hatch (see diagonalHatchImageData). */
.legend-nonzip {
  display: inline-block;
  width: 15px;
  height: 15px;
  border-radius: 3px;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 5px,
    rgba(100, 116, 139, 0.85) 5px,
    rgba(100, 116, 139, 0.85) 6.5px
  );
  box-shadow: 0 0 0 1px rgba(23, 23, 23, 0.18);
}

.map-fallback {
  display: grid;
  place-content: center;
  min-height: inherit;
  padding: 22px;
  color: var(--subtle);
  text-align: center;
}

.map-fallback strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}

.map-fallback span {
  display: block;
  max-width: 34ch;
  line-height: 1.4;
}

.map-debug {
  border-top: 1px solid var(--line);
  padding: 10px 14px 14px;
  color: var(--subtle);
  text-align: left;
}

.map-zoom-debug {
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.78rem;
  line-height: 1.35;
}

.map-zoom-debug strong {
  color: var(--text);
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map-debug summary {
  color: var(--text);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map-debug dl {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
}

.map-debug div {
  display: grid;
  gap: 2px;
}

.map-debug dt,
.map-debug dd {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
}

.map-debug dt {
  color: var(--text);
  font-weight: 750;
}

pre {
  overflow: auto;
  max-height: 320px;
  margin: 0;
  padding: 16px;
  color: var(--subtle);
  font-size: 0.78rem;
  line-height: 1.45;
}

.submit-status {
  margin: 0;
  color: var(--subtle);
  font-size: 0.9rem;
  line-height: 1.45;
}

.debug-trigger {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 20;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: var(--shadow);
  color: var(--surface);
  padding: 0 18px;
  font-weight: 800;
}

.debug-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.42);
}

.debug-panel {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 31;
  width: min(480px, 100vw);
  overflow: auto;
  border-left: 1px solid var(--line);
  background: var(--bg);
  box-shadow: -20px 0 60px rgba(17, 17, 17, 0.2);
  padding: max(22px, env(safe-area-inset-top)) 20px max(30px, env(safe-area-inset-bottom));
}

.debug-panel-open {
  overflow: hidden;
}

.debug-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.debug-heading h2 {
  margin: 4px 0 0;
  font-size: 1.65rem;
}

.debug-intro {
  margin: 10px 0 20px;
  color: var(--subtle);
  line-height: 1.5;
}

.debug-content {
  display: grid;
  gap: 18px;
}

.debug-content .field-label {
  margin: 8px 0 -8px;
}

.debug-content .report-map {
  min-height: 300px;
}

@media (min-width: 760px) {
  .app-shell {
    display: block;
    min-height: 0;
    padding: clamp(32px, 6vw, 72px) clamp(24px, 5vw, 72px);
  }

  .report-stage {
    display: block;
    width: min(100%, 960px);
    min-height: 0;
    margin: 0 auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  .front-door-map-panel {
    width: 100%;
  }

  .report-time-controls {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    column-gap: 14px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    border: 0;
    padding: 0 0 clamp(28px, 4vw, 42px);
  }

  .topbar .ghost-button {
    grid-column: 1;
    grid-row: 1;
    width: fit-content;
  }

  .topbar .progress-dots {
    display: none;
  }

  .topbar .account-actions {
    grid-column: 2;
    grid-row: 1;
  }

  #settingsButton {
    width: 44px;
  }

  .screen {
    overflow: visible;
    padding: 0;
  }

  .calendar-modal {
    align-items: center;
    justify-items: center;
    padding: 28px;
  }

  .calendar-sheet {
    width: min(460px, 100%);
    border-radius: 24px;
    padding: 18px;
  }

  .screen h2 {
    max-width: 20ch;
    font-size: clamp(2.35rem, 5vw, 3.15rem);
  }

  .lede {
    max-width: 58ch;
    font-size: 1.05rem;
  }

  .category-list {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
  }

  .category-row {
    min-height: 124px;
    border-color: var(--line);
    background: var(--surface);
    padding: 18px;
  }

  .two-choice {
    gap: 14px;
  }

  .symptom-grid,
  .badge-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .symptom-chip {
    gap: 7px;
    min-height: 124px;
    padding: 12px 10px;
  }

  .symptom-chip span {
    font-size: 0.78rem;
  }

  .option-card {
    min-height: 150px;
    border-color: var(--line);
    background: var(--surface);
    padding: 22px 20px;
  }

  .done-view h2 {
    justify-self: center;
    width: 100%;
    max-width: none;
  }

  .report-status {
    width: 100%;
    max-width: none;
    margin: 28px 0 0;
  }

  .action-bar {
    display: flex;
    justify-content: flex-start;
    border: 0;
    background: transparent;
    padding: 30px 0 0;
  }

  .action-bar .primary-button {
    width: 100%;
  }

  .settings-sheet {
    justify-self: center;
    width: min(460px, calc(100vw - 32px));
    border-radius: 28px;
    margin-bottom: 30px;
  }
}

@media (max-width: 360px) {
  .screen {
    padding-inline: 16px;
  }

  .action-bar {
    padding-inline: 16px;
  }

  .two-choice {
    grid-template-columns: 1fr;
  }

  .report-date-slider-heading,
  .report-date-slider-range {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .report-date-slider-heading strong {
    justify-self: start;
  }
}
