:root {
  --blue: #061f86;
  --blue-dark: #041255;
  --ink: #102a43;
  --muted: #5b677a;
  --line: #d9e2ec;
  --soft-line: #edf2f7;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --green: #207a55;
  --green-soft: #e7f6ee;
  --gold: #9a6a00;
  --gold-soft: #fff4d7;
  --coral: #c2412d;
  --coral-soft: #ffe9e3;
  --purple: #6b3fb3;
  --purple-soft: #f0e9ff;
  --gray-soft: #eef1f5;
  --shadow: 0 18px 46px rgba(15, 36, 66, 0.12);
  --sheet-bottom-bleed: max(env(safe-area-inset-bottom), 28px);
  --mobile-bottom-occlusion: max(0px, calc(100dvh - 100svh));
  --mobile-toolbar-reserve: 0px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(6, 31, 134, 0.22);
  outline-offset: 2px;
}

a {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(210px, 0.72fr) minmax(260px, 1.2fr) minmax(320px, 0.86fr);
  align-items: center;
  gap: 22px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--blue);
  font-weight: 800;
}

.brand-lockup span {
  border: 1px solid rgba(6, 31, 134, 0.14);
  background: #f7f9ff;
  border-radius: 6px;
  padding: 6px 9px;
  line-height: 1;
}

.brand-lockup strong {
  color: var(--blue-dark);
  font-size: 1.02rem;
  line-height: 1;
}

.campaign-heading {
  min-width: 0;
}

.campaign-heading p,
.section-heading p,
.address-heading p {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 800;
  text-transform: uppercase;
}

.campaign-heading h1 {
  margin: 0;
  color: var(--blue-dark);
  font-size: 1.34rem;
  line-height: 1.12;
}

.topbar-stats {
  justify-self: end;
  display: grid;
  grid-template-columns: repeat(3, minmax(82px, 1fr));
  gap: 8px;
  width: min(100%, 390px);
}

.topbar-stats div,
.metric-grid div,
.signal-grid div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fbfdff;
}

.topbar-stats strong,
.metric-grid strong,
.signal-grid strong {
  display: block;
  color: var(--blue-dark);
  font-size: 1.05rem;
  line-height: 1.1;
  white-space: nowrap;
}

.topbar-stats span,
.metric-grid span,
.signal-grid span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 326px minmax(420px, 1fr) 374px;
  gap: 14px;
  padding: 14px;
}

@media (min-width: 881px) and (pointer: fine) {
  body[data-role="admin"] {
    overflow: hidden;
  }

  body[data-role="admin"] .topbar {
    grid-template-columns: minmax(420px, 1fr) minmax(320px, 0.72fr);
  }

  body[data-role="admin"] .brand-lockup,
  body[data-role="admin"] .campaign-heading p {
    display: none;
  }

  body[data-role="admin"] .app-shell {
    min-height: 0;
    height: 100vh;
  }

  body[data-role="admin"] .workspace {
    grid-template-columns: 326px minmax(0, 1fr);
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  body[data-role="admin"] .right-panel,
  body[data-role="admin"] .admin-response-workspace,
  body[data-role="admin"] .desktop-admin-hidden {
    display: none !important;
  }

  body[data-role="admin"] .left-panel {
    max-height: none;
  }

  body[data-role="admin"] .map-column {
    min-height: 0;
    height: 100%;
    grid-template-rows: minmax(0, 1fr);
  }

  body[data-role="admin"] .map-column .map-stage {
    min-height: 0;
    height: 100%;
  }
}

.left-panel,
.right-panel {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 12px;
}

.left-panel {
  max-height: calc(100vh - 104px);
  overflow: auto;
  padding-right: 2px;
}

.right-panel {
  max-height: calc(100vh - 104px);
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.sheet-content {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 12px;
}

.right-panel > * {
  flex: 0 0 auto;
}

.sheet-handle {
  display: none;
}

.panel-section,
.address-card,
.address-results {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(15, 36, 66, 0.06);
}

.panel-section,
.address-results {
  padding: 14px;
}

.section-heading {
  margin-bottom: 12px;
}

.section-heading h2,
.section-heading h3 {
  margin: 0;
  color: var(--blue-dark);
  font-size: 1rem;
  line-height: 1.18;
}

.role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.role-switch button,
.button-row button,
.action-strip button,
.location-button,
.theme-button,
.full-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 7px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
  font-size: 0.88rem;
  font-weight: 800;
}

.role-switch button.active,
.button-row button.primary,
.followup-form button.primary {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.role-switch svg,
.button-row svg,
.action-strip svg,
.search-box svg,
.theme-button svg,
.full-button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.admin-summary {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-summary > svg {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  padding: 8px;
  border-radius: 10px;
  color: #ffffff;
  background: var(--blue);
}

.admin-summary p {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-summary h2 {
  margin: 0;
  color: var(--blue-dark);
  font-size: 1rem;
  line-height: 1.16;
}

.response-filter-list {
  display: grid;
  gap: 8px;
}

.response-filter-list button {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  text-align: left;
  font-size: 0.86rem;
  font-weight: 850;
}

.response-filter-list button.active {
  border-color: rgba(6, 31, 134, 0.24);
  background: #f4f7ff;
  box-shadow: 0 0 0 3px rgba(6, 31, 134, 0.06);
}

.response-filter-list span:not(.response-filter-dot) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.response-filter-list strong {
  min-width: 26px;
  min-height: 24px;
  display: inline-grid;
  place-items: center;
  padding: 0 7px;
  border-radius: 999px;
  color: var(--blue-dark);
  background: #edf2ff;
  font-size: 0.76rem;
  line-height: 1;
}

.response-filter-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--dot-color);
  box-shadow: 0 0 0 3px rgba(15, 36, 66, 0.08);
}

.candidate-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.candidate-card strong,
.candidate-card span {
  display: block;
}

.candidate-card strong {
  color: var(--blue-dark);
}

.candidate-card span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 700;
}

.candidate-card a {
  flex: 0 0 auto;
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--blue);
  background: #eef3ff;
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
}

.issue-chips {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 10px;
}

.issue-chips button {
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border-radius: 6px;
  padding: 8px 10px;
  border: 1px solid transparent;
  color: #234;
  background: var(--gray-soft);
  text-align: left;
  font-size: 0.76rem;
  font-weight: 850;
}

.issue-chips button:nth-child(1) {
  background: #e8f0ff;
}

.issue-chips button:nth-child(2) {
  background: var(--green-soft);
}

.issue-chips button:nth-child(3) {
  background: var(--gold-soft);
}

.issue-chips button.active {
  border-color: rgba(6, 31, 134, 0.22);
  box-shadow: 0 0 0 3px rgba(6, 31, 134, 0.06);
}

.issue-chips span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.issue-chips strong {
  min-width: 26px;
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 0 7px;
  border-radius: 999px;
  color: var(--blue-dark);
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  line-height: 1;
}

.compact-field {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.compact-field span,
.followup-form label span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.compact-field select,
.compact-field input,
.followup-form input,
.followup-form textarea,
.search-box input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
}

.compact-field select,
.compact-field input,
.followup-form input {
  min-height: 38px;
  padding: 8px 10px;
}

.followup-form textarea {
  resize: vertical;
  padding: 10px;
}

.progress-stack {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.progress-stack div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.progress-stack strong {
  color: var(--blue-dark);
}

meter {
  width: 100%;
  height: 10px;
}

.draw-controls {
  display: grid;
  gap: 8px;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 7px;
}

.turf-list,
.door-plan ul {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.turf-list {
  display: grid;
  gap: 8px;
}

.turf-list li {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fbfdff;
}

.turf-list strong {
  color: var(--blue-dark);
  font-size: 0.88rem;
}

.turf-list span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
}

.metric-grid,
.signal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.full-button {
  width: 100%;
  margin-top: 12px;
}

.map-column {
  min-width: 0;
  min-height: calc(100vh - 104px);
  display: grid;
  grid-template-rows: auto minmax(420px, 1fr);
  gap: 12px;
}

.admin-response-workspace {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(15, 36, 66, 0.06);
}

.response-topline {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(150px, auto) 1fr;
  align-items: end;
  gap: 12px;
}

.response-topline p,
.response-table-head p,
.response-workflow p {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.response-topline h2,
.response-table-head h3,
.response-workflow h3 {
  margin: 0;
  color: var(--blue-dark);
  font-size: 1rem;
  line-height: 1.15;
}

.response-tabs {
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 1px;
  scrollbar-width: none;
}

.response-tabs::-webkit-scrollbar {
  display: none;
}

.response-tabs button {
  flex: 0 0 auto;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fbfdff;
  font-size: 0.78rem;
  font-weight: 850;
}

.response-tabs button.active {
  border-color: rgba(6, 31, 134, 0.22);
  color: var(--blue);
  background: #f4f7ff;
}

.response-tabs strong {
  min-width: 20px;
  min-height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(6, 31, 134, 0.08);
  color: var(--blue-dark);
  font-size: 0.72rem;
  line-height: 1;
}

.response-board {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 260px);
  gap: 10px;
}

.response-table-panel,
.response-workflow {
  min-width: 0;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #ffffff;
}

.response-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--soft-line);
}

.response-table-head > span {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--blue);
  background: #f4f7ff;
  font-size: 0.74rem;
  font-weight: 900;
}

.response-table-scroll {
  position: relative;
  max-height: 170px;
  overflow: auto;
}

.response-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.response-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 10px;
  color: var(--muted);
  background: #fbfdff;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.response-table td {
  min-width: 0;
  padding: 8px 10px;
  border-top: 1px solid var(--soft-line);
  color: var(--ink);
  font-weight: 750;
  vertical-align: top;
}

.response-table td:first-child {
  min-width: 150px;
}

.response-table td:last-child {
  width: 34%;
}

.response-table button {
  display: grid;
  gap: 2px;
  padding: 0;
  color: var(--blue-dark);
  background: transparent;
  text-align: left;
}

.response-table button strong,
.response-table td:last-child strong {
  display: block;
  color: var(--blue-dark);
  font-size: 0.82rem;
  line-height: 1.15;
}

.response-table button span,
.response-table td:last-child span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.25;
}

.response-empty {
  display: grid;
  gap: 4px;
  padding: 18px 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.response-empty strong {
  color: var(--blue-dark);
  font-size: 0.9rem;
}

.response-workflow {
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 12px;
}

.response-workflow span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.35;
}

.response-workflow button {
  width: max-content;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  padding: 0 11px;
  border: 1px solid rgba(6, 31, 134, 0.18);
  border-radius: 7px;
  color: #ffffff;
  background: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
}

.response-workflow svg {
  width: 15px;
  height: 15px;
}

.map-stage {
  min-width: 0;
  min-height: calc(100vh - 104px);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e8edf5;
  box-shadow: var(--shadow);
}

.map-column .map-stage {
  min-height: 0;
  height: auto;
}

.ward-map {
  position: absolute;
  inset: 0;
}

.map-toolbar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  pointer-events: none;
}

.search-shell,
.search-box,
.map-actions,
.location-button,
.theme-button {
  pointer-events: auto;
}

.search-shell {
  position: relative;
  width: min(560px, 100%);
  max-width: 560px;
  flex: 1 1 440px;
  min-width: 0;
}

.search-box {
  width: 100%;
  flex: 0 0 auto;
  max-width: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 13px;
  border: 1px solid rgba(15, 36, 66, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(15, 36, 66, 0.12);
}

.search-shell:focus-within .search-box {
  border-color: rgba(15, 118, 110, 0.32);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12), 0 14px 34px rgba(15, 36, 66, 0.14);
}

.search-box input {
  flex: 1 1 auto;
  border: 0;
  outline: 0;
  min-height: 38px;
  padding: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
}

.search-box input[type="search"]::-webkit-search-cancel-button,
.search-box input[type="search"]::-webkit-search-decoration {
  display: none;
  -webkit-appearance: none;
}

.search-clear {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--blue);
  background: transparent;
}

.search-clear:hover,
.search-clear:focus-visible {
  background: rgba(6, 31, 134, 0.08);
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 60;
  max-height: min(430px, calc(100vh - 112px));
  overflow: auto;
  border: 1px solid rgba(15, 36, 66, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 22px 54px rgba(15, 36, 66, 0.18);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.search-suggestions-heading {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--soft-line);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.search-suggestion {
  width: 100%;
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border-radius: 0;
  border-bottom: 1px solid var(--soft-line);
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.search-suggestion:last-child {
  border-bottom: 0;
}

.search-suggestion.is-active,
.search-suggestion:hover,
.search-suggestion:focus-visible {
  background: rgba(15, 118, 110, 0.08);
}

.search-suggestion strong {
  color: var(--blue-dark);
  font-size: 0.94rem;
  line-height: 1.18;
}

.search-suggestion span,
.search-no-results span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  line-height: 1.28;
}

.search-no-results {
  display: grid;
  gap: 4px;
  padding: 14px 16px 16px;
}

.search-no-results strong {
  color: var(--blue-dark);
  font-size: 0.9rem;
}

.map-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
}

.location-button,
.theme-button {
  min-height: 44px;
  flex: 0 0 auto;
  padding: 0 12px;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(15, 36, 66, 0.12);
}

.location-button.is-locating,
.theme-button[aria-pressed="true"] {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.location-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.location-button svg,
.theme-button svg {
  width: 16px;
  height: 16px;
}

.location-button span,
.theme-button span {
  white-space: nowrap;
}

.map-footer {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.map-footer span {
  max-width: 50%;
  border: 1px solid rgba(15, 36, 66, 0.12);
  border-radius: 7px;
  padding: 7px 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 22px rgba(15, 36, 66, 0.1);
  font-size: 0.75rem;
  font-weight: 800;
}

.map-status {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--muted);
  background: #fff;
  box-shadow: var(--shadow);
  font-weight: 800;
  z-index: 2;
}

.maplibregl-ctrl-attrib {
  display: none;
}

.maplibregl-ctrl-top-right {
  top: 72px;
  right: 14px;
}

.maplibregl-ctrl-group {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(15, 36, 66, 0.14);
}

.address-card {
  min-height: 330px;
}

.address-empty {
  min-height: 330px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 28px;
  text-align: center;
}

.address-empty svg {
  width: 42px;
  height: 42px;
  color: var(--blue);
}

.address-empty h2,
.address-empty p {
  margin: 0;
}

.address-empty h2 {
  color: var(--blue-dark);
}

.address-empty p {
  color: var(--muted);
  font-weight: 700;
}

.address-detail {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.address-heading {
  position: relative;
  padding-right: 42px;
}

.address-heading h2 {
  margin: 0;
  color: var(--blue-dark);
  font-size: 1.24rem;
  line-height: 1.14;
}

.address-heading button {
  position: absolute;
  top: 0;
  right: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
}

.address-heading svg {
  width: 17px;
  height: 17px;
}

.insight-band {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--soft-line);
  background: #f7f9ff;
}

.insight-band p {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.insight-band strong,
.insight-band span {
  display: block;
}

.insight-band strong {
  color: var(--blue-dark);
  font-size: 0.96rem;
}

.insight-band strong[hidden],
.insight-band span[hidden] {
  display: none;
}

.insight-band span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 750;
  line-height: 1.35;
}

.insight-band ul {
  display: grid;
  gap: 5px;
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
}

.insight-band li {
  position: relative;
  padding-left: 16px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.32;
}

.insight-band li::before {
  content: "";
  position: absolute;
  top: 0.52em;
  left: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
}

.signal-grid {
  margin-top: 0;
}

.door-plan {
  padding: 14px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fff;
}

.door-plan p {
  margin: 0;
  color: var(--ink);
  font-size: 0.91rem;
  font-weight: 650;
  line-height: 1.45;
}

.door-plan li {
  position: relative;
  margin-top: 8px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.35;
}

.door-plan li::before {
  content: "";
  position: absolute;
  top: 0.55em;
  left: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
}

.action-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 0;
}

.action-strip button {
  justify-content: flex-start;
  min-height: 42px;
  padding: 0 10px;
}

.action-strip button[data-action="supporter"] {
  background: var(--green-soft);
  border-color: #bbdfcd;
  color: var(--green);
}

.action-strip button[data-action="sign"] {
  background: var(--gold-soft);
  border-color: #f2d58d;
  color: var(--gold);
}

.tenure-strip button:disabled {
  cursor: default;
  opacity: 1;
}

.mobile-card-label {
  display: none;
}

.tenure-strip button[data-tenure="likely_renter"] {
  color: #b91c1c;
  background: #fee2e2;
  border-color: #fecaca;
}

.tenure-strip button[data-tenure="likely_owner"] {
  color: #1d4ed8;
  background: #dbeafe;
  border-color: #bfdbfe;
}

.tenure-strip button[data-confidence-badge] {
  color: #334155;
  background: #f1f5f9;
  border-color: #cbd5e1;
  text-transform: capitalize;
}

.insight-band[data-tenure="likely_renter"] {
  border-left: 4px solid #dc2626;
}

.insight-band[data-tenure="likely_owner"] {
  border-left: 4px solid #2563eb;
}

.action-strip button[data-action="followup"] {
  background: var(--coral-soft);
  border-color: #ffc4b5;
  color: var(--coral);
}

.action-strip button[data-action="postcard"] {
  background: var(--purple-soft);
  border-color: #d6c2ff;
  color: var(--purple);
}

.action-strip button[data-action="complete"] {
  background: var(--gray-soft);
  border-color: #d9e2ec;
  color: var(--muted);
}

.followup-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: var(--coral-soft);
}

.followup-form label {
  display: grid;
  gap: 6px;
}

.followup-form button {
  min-height: 40px;
  border-radius: 7px;
  font-weight: 850;
}

.history-list {
  display: grid;
  gap: 8px;
  margin-top: 0;
}

.history-item {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fbfdff;
}

.history-item strong {
  color: var(--blue-dark);
  font-size: 0.84rem;
}

.history-item span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.address-results [data-address-list] {
  display: grid;
  gap: 8px;
}

.result-button {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.result-button.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(6, 31, 134, 0.1);
}

.result-button strong {
  color: var(--blue-dark);
  font-size: 0.88rem;
}

.result-button span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
}

.hidden,
[hidden] {
  display: none !important;
}

body[data-theme="dark"] {
  --ink: #f8fafc;
  --muted: #aeb7c7;
  --line: rgba(255, 255, 255, 0.12);
  --soft-line: rgba(255, 255, 255, 0.09);
  --bg: #101217;
  --panel: #151922;
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
  color: #f8fafc;
  background: #101217;
}

body[data-theme="dark"] .topbar {
  border-bottom-color: rgba(255, 255, 255, 0.1);
  background: rgba(17, 19, 24, 0.96);
}

body[data-theme="dark"] .brand-lockup,
body[data-theme="dark"] .brand-lockup strong,
body[data-theme="dark"] .campaign-heading h1,
body[data-theme="dark"] .section-heading h2,
body[data-theme="dark"] .section-heading h3,
body[data-theme="dark"] .topbar-stats strong,
body[data-theme="dark"] .metric-grid strong,
body[data-theme="dark"] .signal-grid strong,
body[data-theme="dark"] .candidate-card strong,
body[data-theme="dark"] .turf-list strong,
body[data-theme="dark"] .address-empty h2,
body[data-theme="dark"] .address-heading h2,
body[data-theme="dark"] .insight-band strong,
body[data-theme="dark"] .history-item strong,
body[data-theme="dark"] .result-button strong,
body[data-theme="dark"] .progress-stack strong {
  color: #f8fafc;
}

body[data-theme="dark"] .brand-lockup span,
body[data-theme="dark"] .topbar-stats div,
body[data-theme="dark"] .metric-grid div,
body[data-theme="dark"] .signal-grid div,
body[data-theme="dark"] .panel-section,
body[data-theme="dark"] .address-card,
body[data-theme="dark"] .address-results,
body[data-theme="dark"] .candidate-card,
body[data-theme="dark"] .turf-list li,
body[data-theme="dark"] .door-plan,
body[data-theme="dark"] .history-item,
body[data-theme="dark"] .result-button {
  border-color: rgba(255, 255, 255, 0.1);
  background: #171a21;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

body[data-theme="dark"] .candidate-card {
  background: linear-gradient(180deg, #1c2028, #171a21);
}

body[data-theme="dark"] .map-stage,
body[data-theme="dark"] .ward-map {
  border-color: rgba(255, 255, 255, 0.1);
  background: #0e0e0e;
}

body[data-theme="dark"] .admin-summary h2,
body[data-theme="dark"] .response-filter-list strong,
body[data-theme="dark"] .issue-chips strong {
  color: #f8fafc;
}

body[data-theme="dark"] .admin-summary p {
  color: #aeb7c7;
}

body[data-theme="dark"] .response-filter-list button {
  border-color: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  background: #171a21;
}

body[data-theme="dark"] .issue-chips button {
  border-color: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

body[data-theme="dark"] .response-filter-list button.active {
  border-color: rgba(143, 162, 255, 0.28);
  background: rgba(59, 92, 255, 0.18);
}

body[data-theme="dark"] .issue-chips button.active {
  border-color: rgba(143, 162, 255, 0.28);
  box-shadow: 0 0 0 3px rgba(143, 162, 255, 0.1);
}

body[data-theme="dark"] .response-filter-list strong {
  background: rgba(143, 162, 255, 0.14);
}

body[data-theme="dark"] .issue-chips strong {
  background: rgba(15, 23, 42, 0.48);
}

body[data-theme="dark"] .admin-response-workspace {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(17, 19, 24, 0.96);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

body[data-theme="dark"] .response-table-panel,
body[data-theme="dark"] .response-workflow {
  border-color: rgba(255, 255, 255, 0.1);
  background: #171a21;
}

body[data-theme="dark"] .response-topline h2,
body[data-theme="dark"] .response-table-head h3,
body[data-theme="dark"] .response-workflow h3,
body[data-theme="dark"] .response-table button strong,
body[data-theme="dark"] .response-table td:last-child strong,
body[data-theme="dark"] .response-empty strong {
  color: #f8fafc;
}

body[data-theme="dark"] .response-topline p,
body[data-theme="dark"] .response-table-head p,
body[data-theme="dark"] .response-workflow p,
body[data-theme="dark"] .response-workflow span,
body[data-theme="dark"] .response-table button span,
body[data-theme="dark"] .response-table td:last-child span,
body[data-theme="dark"] .response-empty {
  color: #aeb7c7;
}

body[data-theme="dark"] .response-tabs button,
body[data-theme="dark"] .response-table th {
  border-color: rgba(255, 255, 255, 0.1);
  color: #c5ccda;
  background: #1a1d24;
}

body[data-theme="dark"] .response-tabs button.active {
  border-color: rgba(143, 162, 255, 0.28);
  color: #dfe7ff;
  background: rgba(59, 92, 255, 0.18);
}

body[data-theme="dark"] .response-tabs strong,
body[data-theme="dark"] .response-table-head > span {
  color: #dfe7ff;
  background: rgba(143, 162, 255, 0.14);
}

body[data-theme="dark"] .response-table-head,
body[data-theme="dark"] .response-table td {
  border-color: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .response-table td {
  color: #f8fafc;
}

body[data-theme="dark"] .search-box,
body[data-theme="dark"] .search-suggestions,
body[data-theme="dark"] .location-button,
body[data-theme="dark"] .theme-button,
body[data-theme="dark"] .role-switch button,
body[data-theme="dark"] .button-row button,
body[data-theme="dark"] .full-button,
body[data-theme="dark"] .action-strip button[data-action="not_home"],
body[data-theme="dark"] .action-strip button[data-action="complete"],
body[data-theme="dark"] .map-footer span,
body[data-theme="dark"] .map-status,
body[data-theme="dark"] .maplibregl-ctrl-group,
body[data-theme="dark"] .address-heading button,
body[data-theme="dark"] .compact-field select,
body[data-theme="dark"] .compact-field input,
body[data-theme="dark"] .followup-form input,
body[data-theme="dark"] .followup-form textarea {
  border-color: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  background: rgba(18, 21, 28, 0.94);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.26);
}

body[data-theme="dark"] .location-button.is-locating,
body[data-theme="dark"] .theme-button[aria-pressed="true"],
body[data-theme="dark"] .role-switch button.active,
body[data-theme="dark"] .button-row button.primary,
body[data-theme="dark"] .followup-form button.primary {
  color: #ffffff;
  border-color: #365ce8;
  background: #365ce8;
}

body[data-theme="dark"] .search-box input,
body[data-theme="dark"] .compact-field select,
body[data-theme="dark"] .compact-field input,
body[data-theme="dark"] .followup-form input,
body[data-theme="dark"] .followup-form textarea {
  color: #f8fafc;
}

body[data-theme="dark"] .search-box input::placeholder,
body[data-theme="dark"] .search-box svg,
body[data-theme="dark"] .search-clear,
body[data-theme="dark"] .search-suggestions-heading,
body[data-theme="dark"] .search-suggestion span,
body[data-theme="dark"] .search-no-results span,
body[data-theme="dark"] .map-footer span,
body[data-theme="dark"] .map-status,
body[data-theme="dark"] .role-switch button,
body[data-theme="dark"] .button-row button,
body[data-theme="dark"] .full-button,
body[data-theme="dark"] .address-heading button,
body[data-theme="dark"] .topbar-stats span,
body[data-theme="dark"] .metric-grid span,
body[data-theme="dark"] .signal-grid span,
body[data-theme="dark"] .candidate-card span,
body[data-theme="dark"] .turf-list span,
body[data-theme="dark"] .address-empty p,
body[data-theme="dark"] .insight-band p,
body[data-theme="dark"] .insight-band span,
body[data-theme="dark"] .insight-band li,
body[data-theme="dark"] .door-plan p,
body[data-theme="dark"] .door-plan li,
body[data-theme="dark"] .history-item span,
body[data-theme="dark"] .result-button span,
body[data-theme="dark"] .progress-stack div,
body[data-theme="dark"] .campaign-heading p,
body[data-theme="dark"] .section-heading p,
body[data-theme="dark"] .address-heading p,
body[data-theme="dark"] .compact-field span {
  color: #aeb7c7;
}

body[data-theme="dark"] .action-strip button[data-action="not_home"],
body[data-theme="dark"] .action-strip button[data-action="complete"] {
  color: #f8fafc;
}

body[data-theme="dark"] button:disabled {
  opacity: 0.56;
}

body[data-theme="dark"] .issue-chips button,
body[data-theme="dark"] .candidate-card a {
  color: #dbe5ff;
  background: #202638;
}

body[data-theme="dark"] .insight-band,
body[data-theme="dark"] .address-heading {
  border-color: rgba(255, 255, 255, 0.1);
  background: #1a1d24;
}

body[data-theme="dark"] .followup-form {
  background: #2b1917;
}

body[data-theme="dark"] .followup-form label span {
  color: #f2c4b9;
}

body[data-theme="dark"] .result-button.active {
  border-color: #8fa2ff;
  box-shadow: 0 0 0 3px rgba(143, 162, 255, 0.16);
}

body[data-theme="dark"] .search-shell:focus-within .search-box {
  border-color: rgba(143, 162, 255, 0.34);
  box-shadow: 0 0 0 4px rgba(143, 162, 255, 0.14), 0 14px 34px rgba(0, 0, 0, 0.3);
}

body[data-theme="dark"] .search-suggestions-heading,
body[data-theme="dark"] .search-suggestion {
  border-color: rgba(255, 255, 255, 0.09);
}

body[data-theme="dark"] .search-suggestion strong,
body[data-theme="dark"] .search-no-results strong {
  color: #f8fafc;
}

body[data-theme="dark"] .search-suggestion.is-active,
body[data-theme="dark"] .search-suggestion:hover,
body[data-theme="dark"] .search-suggestion:focus-visible,
body[data-theme="dark"] .search-clear:hover,
body[data-theme="dark"] .search-clear:focus-visible {
  background: rgba(143, 162, 255, 0.14);
}

body[data-theme="dark"] .maplibregl-ctrl-group button {
  background-color: transparent;
}

body[data-theme="dark"] .maplibregl-ctrl-group button + button {
  border-top-color: rgba(255, 255, 255, 0.12);
}

body[data-theme="dark"] .maplibregl-ctrl-icon {
  filter: invert(1);
}

@media (max-width: 1220px) {
  .topbar {
    grid-template-columns: 180px 1fr;
  }

  .topbar-stats {
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
  }

  .workspace {
    grid-template-columns: minmax(420px, 1fr) minmax(340px, 360px);
    grid-template-areas:
      "map detail"
      "controls controls";
    align-items: start;
  }

  .left-panel {
    grid-area: controls;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .map-column {
    grid-area: map;
    min-height: calc(100vh - 104px);
    grid-template-rows: auto minmax(360px, 1fr);
  }

  .response-topline {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .response-tabs {
    justify-content: flex-start;
  }

  .response-board {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
  }

  .response-table-scroll {
    max-height: 132px;
  }

  .map-stage {
    grid-area: map;
    height: calc(100vh - 104px);
  }

  .map-column .map-stage {
    grid-area: auto;
    height: auto;
    min-height: 360px;
  }

  .right-panel {
    grid-area: detail;
    grid-column: auto;
    max-height: calc(100vh - 104px);
  }
}

@media (min-width: 881px) and (max-width: 1220px) and (pointer: fine) {
  body[data-role="admin"] .workspace {
    grid-template-columns: 326px minmax(0, 1fr);
    grid-template-areas: none;
  }

  body[data-role="admin"] .left-panel,
  body[data-role="admin"] .map-column {
    grid-area: auto;
    grid-column: auto;
  }

  body[data-role="admin"] .left-panel {
    display: grid;
    grid-template-columns: 1fr;
    max-height: none;
    overflow: auto;
    padding-right: 2px;
  }

  body[data-role="admin"] .map-column {
    min-height: 0;
    height: 100%;
    grid-template-rows: minmax(0, 1fr);
  }

  body[data-role="admin"] .map-column .map-stage {
    min-height: 0;
    height: 100%;
  }
}

@media (max-width: 880px), (max-width: 1100px) and (pointer: coarse) {
  html,
  body {
    background: #ffffff;
    overflow: hidden;
  }

  .app-shell {
    display: block;
    min-height: 100dvh;
    background: #ffffff;
  }

  .topbar {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 0;
    padding: 12px;
    border: 0;
    background: linear-gradient(180deg, rgba(12, 14, 19, 0.68), rgba(12, 14, 19, 0));
    pointer-events: none;
  }

  .brand-lockup {
    width: max-content;
    min-height: 36px;
    pointer-events: auto;
    border: 1px solid rgba(15, 36, 66, 0.12);
    border-radius: 999px;
    padding: 6px 9px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  }

  .brand-lockup span,
  .brand-lockup strong,
  .campaign-heading,
  .topbar-stats {
    display: none;
  }

  .workspace {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
  }

  .map-column {
    display: block;
    min-height: 0;
  }

  .admin-response-workspace {
    display: none !important;
  }

  .map-stage {
    height: 100dvh;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
    background: #e8edf5;
    box-shadow: none;
    order: 0;
  }

  .map-column .map-stage {
    height: 100dvh;
    min-height: 100dvh;
  }

  .ward-map {
    background: #e8edf5;
  }

  .left-panel {
    display: none;
  }

  .right-panel {
    order: 1;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    height: var(--sheet-height, min(48svh, 420px));
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    padding: 0;
    color: var(--ink);
    background: #ffffff;
    border-top-left-radius: 26px;
    border-top-right-radius: 26px;
    box-shadow: 0 -20px 48px rgba(15, 23, 42, 0.18);
    overscroll-behavior: contain;
    scrollbar-width: none;
    transition: height 240ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 240ms ease, background-color 180ms ease;
    will-change: height;
  }

  body[data-ios-phone="true"] .right-panel {
    bottom: var(--mobile-toolbar-reserve, 96px);
    max-height: calc(100dvh - var(--mobile-toolbar-reserve, 96px));
  }

  .right-panel::-webkit-scrollbar {
    display: none;
  }

  .right-panel.is-dragging {
    transition: none;
    user-select: none;
  }

  .sheet-handle {
    width: 100%;
    min-height: 44px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    border: 0;
    border-bottom: 1px solid rgba(17, 24, 39, 0.04);
    padding: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.9));
    cursor: ns-resize;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
  }

  .sheet-handle span {
    width: 72px;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(15, 118, 110, 0.18), rgba(107, 64, 192, 0.18));
    box-shadow: inset 0 0 0 1px rgba(15, 36, 66, 0.06);
  }

  .sheet-content {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    align-content: start;
    gap: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 12px 12px 18px;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .sheet-content::-webkit-scrollbar {
    display: none;
  }

  body[data-has-selected="true"] .right-panel {
    height: var(--sheet-height, min(48svh, 420px));
    max-height: 100dvh;
    overflow: hidden;
    padding: 0;
    background: #ffffff;
  }

  body[data-ios-phone="true"][data-has-selected="true"] .right-panel {
    bottom: 0;
    max-height: 100dvh;
  }

  body[data-has-selected="true"][data-followup-open="true"] .right-panel {
    overflow: hidden;
  }

  body[data-has-selected="true"] .sheet-handle {
    display: flex;
  }

  body[data-has-selected="true"] .sheet-handle span {
    width: 72px;
    height: 6px;
  }

  body[data-has-selected="true"] .sheet-content {
    padding-bottom: 8px;
  }

  body[data-has-selected="true"][data-followup-open="true"] .sheet-content {
    padding-bottom: 10px;
  }

  .right-panel .address-card,
  .right-panel .address-results {
    border-color: rgba(15, 36, 66, 0.1);
    background: transparent;
    box-shadow: none;
  }

  .address-card {
    min-height: 0;
  }

  body[data-has-selected="true"] .right-panel .address-card {
    border: 0;
    border-radius: 0;
  }

  .right-panel .address-results {
    padding: 12px 0 0;
    border-width: 1px 0 0;
    border-radius: 0;
  }

  .right-panel .section-heading p,
  .right-panel .address-heading p,
  .right-panel .signal-grid span,
  .right-panel .history-item span,
  .right-panel .result-button span {
    color: var(--muted);
  }

  .right-panel .section-heading h2,
  .right-panel .section-heading h3,
  .right-panel .address-heading h2,
  .right-panel .history-item strong,
  .right-panel .result-button strong,
  .right-panel .signal-grid strong {
    color: var(--blue-dark);
  }

  .address-empty {
    min-height: 118px;
    padding: 8px 10px 14px;
    color: var(--ink);
  }

  .address-empty h2 {
    color: var(--blue-dark);
  }

  .address-empty p {
    color: var(--muted);
  }

  body[data-has-selected="false"] .right-panel {
    gap: 0;
  }

  body[data-has-selected="false"] .right-panel {
    bottom: 0;
    height: 0;
    max-height: 0;
    gap: 0;
    visibility: hidden;
    overflow: hidden;
    padding: 0;
    pointer-events: none;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    transform: translateY(100%);
  }

  body[data-has-selected="false"] .sheet-content {
    display: grid;
    overflow: hidden;
    padding: 0;
  }

  body[data-has-selected="false"] .right-panel .address-card {
    border-color: transparent;
  }

  body[data-has-selected="false"][data-has-query="true"] .right-panel .address-card {
    display: none;
  }

  body[data-has-selected="false"] .address-empty {
    min-height: 112px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 5px;
    padding: 4px;
    text-align: center;
  }

  body[data-has-selected="false"] .address-empty svg {
    display: block;
    width: 30px;
    height: 30px;
    color: var(--blue);
  }

  body[data-has-selected="false"] .address-empty h2 {
    font-size: 1.06rem;
    line-height: 1.15;
  }

  body[data-has-selected="false"][data-has-query="false"] .address-empty svg {
    width: 34px;
    height: 34px;
  }

  body[data-has-selected="false"][data-has-query="false"] .address-empty h2 {
    font-size: 1.16rem;
  }

  body[data-has-selected="false"] .address-empty p {
    max-width: 30ch;
    margin-top: 0;
    font-size: 0.82rem;
    line-height: 1.3;
  }

  body[data-has-selected="false"][data-has-query="false"] .address-empty p,
  body[data-has-selected="false"][data-has-query="false"] .right-panel .address-results {
    display: none;
  }

  .address-detail {
    padding: 0;
    gap: 10px;
  }

  body[data-has-selected="true"] .address-detail {
    gap: 7px;
  }

  .address-heading {
    padding: 14px 56px 14px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
  }

  body[data-has-selected="true"] .address-heading {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 8px 8px 12px;
  }

  body[data-has-selected="true"] .address-heading p {
    display: none;
  }

  body[data-has-selected="true"] .address-heading h2 {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: var(--blue-dark);
    font-size: clamp(0.96rem, 4.8vw, 1.08rem);
    line-height: 1.05;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-has-selected="true"] .address-heading h2 a {
    color: inherit;
    text-decoration: none;
  }

  .address-heading button {
    top: 12px;
    right: 12px;
    border-color: var(--line);
    color: var(--muted);
    background: #ffffff;
  }

  body[data-has-selected="true"] .address-heading button {
    position: static;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    margin-left: auto;
    border-radius: 10px;
  }

  body[data-has-selected="true"] .address-heading button svg {
    width: 16px;
    height: 16px;
  }

  .insight-band,
  .door-plan,
  .history-item,
  .result-button,
  .signal-grid div {
    border-color: var(--soft-line);
    background: #fbfdff;
  }

  .insight-band strong {
    color: var(--blue-dark);
  }

  .insight-band span,
  .insight-band li,
  .door-plan p,
  .door-plan li {
    color: var(--muted);
  }

  body[data-has-selected="true"] .insight-band {
    padding: 9px 11px;
  }

  body[data-has-selected="true"] .insight-band strong {
    font-size: 0.92rem;
    line-height: 1.12;
  }

  body[data-has-selected="true"] .insight-band span {
    margin-top: 3px;
    font-size: 0.78rem;
    line-height: 1.22;
  }

  body[data-has-selected="true"] .insight-band ul {
    gap: 3px;
    margin-top: 0;
  }

  body[data-has-selected="true"] .insight-band li {
    font-size: 0.78rem;
    line-height: 1.2;
  }

  body[data-has-selected="true"] .insight-band {
    display: none;
  }

  body[data-has-selected="true"] .tenure-strip .desktop-card-label {
    display: none;
  }

  body[data-has-selected="true"] .tenure-strip .mobile-card-label {
    display: inline;
  }

  body[data-has-selected="true"] .action-strip {
    gap: 6px;
  }

  body[data-has-selected="true"] .action-strip button {
    min-height: 38px;
    padding: 0 9px;
    font-size: 0.8rem;
  }

  body[data-has-selected="true"] .action-strip svg {
    width: 16px;
    height: 16px;
  }

  body[data-has-selected="true"] .action-strip.tenure-strip {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  body[data-has-selected="true"] .action-strip.tenure-strip button {
    justify-content: center;
    width: 100%;
    min-height: 68px;
    padding: 0 16px;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(15, 36, 66, 0.08);
  }

  .followup-form {
    background: var(--coral-soft);
  }

  .followup-form label span {
    color: var(--coral);
  }

  .map-toolbar {
    top: 14px;
    left: 12px;
    right: 12px;
    z-index: 50;
    flex-direction: row;
    align-items: center;
    gap: 7px;
  }

  .search-shell {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
    min-width: 0;
  }

  .search-box {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    border-color: rgba(15, 36, 66, 0.12);
    border-radius: 999px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 34px rgba(15, 36, 66, 0.14);
  }

  .search-suggestions {
    top: calc(100% + 8px);
    max-height: min(54svh, 430px);
    border-radius: 18px;
    box-shadow: 0 20px 48px rgba(15, 36, 66, 0.18);
  }

  .search-suggestions-heading {
    padding: 12px 14px 9px;
  }

  .search-suggestion {
    min-height: 74px;
    padding: 12px 14px;
  }

  .search-suggestion strong {
    font-size: 0.94rem;
  }

  .search-box input {
    color: var(--ink);
  }

  .search-box input::placeholder {
    color: var(--muted);
  }

  .search-box svg {
    color: var(--muted);
  }

  .map-actions {
    flex: 0 0 auto;
    justify-content: flex-start;
    width: auto;
    gap: 7px;
  }

  .location-button,
  .theme-button {
    min-width: 42px;
    min-height: 42px;
    padding: 0 11px;
    border-color: rgba(15, 36, 66, 0.12);
    border-radius: 999px;
    color: var(--blue);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 34px rgba(15, 36, 66, 0.14);
  }

  .map-footer {
    display: none;
  }

  .maplibregl-ctrl-top-right {
    top: 76px;
    right: 12px;
  }

  body[data-has-selected="true"] .right-panel .address-results,
  body[data-has-selected="true"] .right-panel .signal-grid,
  body[data-has-selected="true"] .right-panel .door-plan,
  body[data-has-selected="true"] .right-panel .history-list,
  body[data-has-selected="true"][data-sheet-state="peek"] .right-panel .address-results,
  body[data-has-selected="true"][data-sheet-state="peek"] .right-panel .signal-grid,
  body[data-has-selected="true"][data-sheet-state="peek"] .right-panel .door-plan,
  body[data-has-selected="true"][data-sheet-state="peek"] .right-panel .history-list,
  body[data-has-selected="true"][data-sheet-state="peek"] .right-panel .insight-band,
  body[data-has-selected="true"][data-sheet-state="peek"] .right-panel .action-strip,
  body[data-has-selected="true"][data-sheet-state="peek"] .right-panel .followup-form {
    display: none;
  }

  body[data-has-selected="true"][data-sheet-state="peek"] .right-panel {
    gap: 0;
  }

  body[data-has-selected="true"][data-sheet-state="peek"] .address-heading {
    min-height: 54px;
  }

  .map-stage {
    order: 0;
  }

  .maplibregl-ctrl-group {
    background: rgba(255, 255, 255, 0.94);
  }

  .maplibregl-ctrl-group button {
    background-color: transparent;
  }

  .maplibregl-ctrl-group button + button {
    border-top-color: rgba(15, 36, 66, 0.12);
  }

  .maplibregl-ctrl-icon {
    filter: none;
  }

  body[data-theme="dark"] {
    background: #101217;
  }

  body[data-theme="dark"] .map-stage,
  body[data-theme="dark"] .ward-map {
    background: #0e0e0e;
  }

  body[data-theme="dark"] .right-panel {
    color: #f8fafc;
    background: #111318;
    box-shadow: 0 -18px 48px rgba(0, 0, 0, 0.42);
  }

  body[data-theme="dark"] .sheet-handle span {
    background: rgba(255, 255, 255, 0.25);
  }

  body[data-theme="dark"] .right-panel .address-card,
  body[data-theme="dark"] .right-panel .address-results {
    border-color: rgba(255, 255, 255, 0.1);
  }

  body[data-theme="dark"][data-has-selected="false"] .right-panel .address-card {
    border-color: transparent;
  }

  body[data-theme="dark"] .right-panel .section-heading p,
  body[data-theme="dark"] .right-panel .address-heading p,
  body[data-theme="dark"] .right-panel .signal-grid span,
  body[data-theme="dark"] .right-panel .history-item span,
  body[data-theme="dark"] .right-panel .result-button span,
  body[data-theme="dark"] .address-empty p {
    color: #aeb7c7;
  }

  body[data-theme="dark"] .right-panel .section-heading h2,
  body[data-theme="dark"] .right-panel .section-heading h3,
  body[data-theme="dark"] .right-panel .address-heading h2,
  body[data-theme="dark"] .history-item strong,
  body[data-theme="dark"] .result-button strong,
  body[data-theme="dark"] .signal-grid strong,
  body[data-theme="dark"] .address-empty h2 {
    color: #f8fafc;
  }

  body[data-theme="dark"] .address-empty {
    color: #f8fafc;
  }

  body[data-theme="dark"] .address-heading {
    border-color: rgba(255, 255, 255, 0.1);
    background: #1a1d24;
  }

  body[data-theme="dark"] .address-heading button {
    border-color: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    background: #252832;
  }

  body[data-theme="dark"] .insight-band,
  body[data-theme="dark"] .door-plan,
  body[data-theme="dark"] .history-item,
  body[data-theme="dark"] .result-button,
  body[data-theme="dark"] .signal-grid div {
    border-color: rgba(255, 255, 255, 0.1);
    background: #171a21;
  }

  body[data-theme="dark"] .insight-band strong {
    color: #f8fafc;
  }

  body[data-theme="dark"] .insight-band p,
  body[data-theme="dark"] .insight-band span,
  body[data-theme="dark"] .insight-band li,
  body[data-theme="dark"] .door-plan p,
  body[data-theme="dark"] .door-plan li {
    color: #c5ccda;
  }

  body[data-theme="dark"] .followup-form {
    background: #2b1917;
  }

  body[data-theme="dark"] .followup-form label span {
    color: #f2c4b9;
  }

  body[data-theme="dark"] .search-box,
  body[data-theme="dark"] .location-button,
  body[data-theme="dark"] .theme-button {
    border-color: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    background: rgba(15, 18, 24, 0.9);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
  }

  body[data-theme="dark"] .search-box input {
    color: #f8fafc;
  }

  body[data-theme="dark"] .search-box input::placeholder,
  body[data-theme="dark"] .search-box svg {
    color: #d5dbe7;
  }

  body[data-theme="dark"] .maplibregl-ctrl-group {
    color: #f8fafc;
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(15, 18, 24, 0.9);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  }

  body[data-theme="dark"] .maplibregl-ctrl-group button + button {
    border-top-color: rgba(255, 255, 255, 0.12);
  }

  body[data-theme="dark"] .maplibregl-ctrl-icon {
    filter: invert(1);
  }

  .action-strip button {
    min-height: 46px;
  }

  body[data-has-selected="true"] .action-strip button {
    min-height: 38px;
  }

  .panel-section {
    box-shadow: none;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 12px;
  }

  .metric-grid,
  .signal-grid {
    grid-template-columns: 1fr;
  }

  .topbar-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .topbar-stats div {
    padding: 8px 7px;
  }

  .topbar-stats strong {
    font-size: 0.95rem;
  }

  .topbar-stats span {
    font-size: 0.67rem;
  }

  .button-row {
    grid-template-columns: 1fr;
  }

  .action-strip {
    grid-template-columns: 1fr 1fr;
  }

  .address-empty {
    min-height: 104px;
    padding: 6px 10px 12px;
  }

  .address-empty svg {
    width: 34px;
    height: 34px;
  }

  .map-stage {
    height: 100svh;
    min-height: 100svh;
  }

  .map-column .map-stage {
    height: 100svh;
    min-height: 100svh;
  }

  .location-button span,
  .theme-button span {
    display: none;
  }
}
