:root {
  color-scheme: light;
  --bg: #f2f0ea;
  --surface: #ffffff;
  --surface-2: #f4f1ea;
  --ink: #171717;
  --muted: #5f5c57;
  --line: #ded6ca;
  --line-strong: #b9ab98;
  --gold: #e4a72d;
  --gold-soft: #ffe09a;
  --green: #2f7d57;
  --green-soft: #dff0e7;
  --blue: #2a5664;
  --blue-soft: #d8e8ec;
  --red: #c5161d;
  --red-dark: #8f1015;
  --red-soft: #f7d9d9;
  --amber: #c57912;
  --amber-soft: #f6e7d0;
  --black: #111111;
  --charcoal: #202020;
  --shadow: 0 18px 38px rgba(17, 17, 17, 0.14);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 22px;
  background: rgba(17, 17, 17, 0.96);
  border-bottom: 4px solid var(--red);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.brand strong {
  display: block;
  font-size: 24px;
  line-height: 1;
  text-transform: uppercase;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: #e9d8aa;
  font-weight: 700;
}

.nav-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.nav-actions a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: var(--radius);
  color: #f6f2ea;
  text-decoration: none;
  font-weight: 800;
}

.nav-actions .call-link {
  background: var(--gold);
  color: #151515;
}

.hero {
  position: relative;
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 420px);
  align-items: center;
  gap: 30px;
  padding: 38px 22px 46px;
  background:
    linear-gradient(115deg, rgba(14, 14, 14, 0.97), rgba(17, 17, 17, 0.84) 48%, rgba(74, 13, 14, 0.78)),
    url("/assets/urgent-roof-help-hero.png");
  background-size: cover;
  background-position: center;
  color: #fff;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(0, 0, 0, 0.2), transparent 36%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 36px);
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.alert-banner {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-bottom: 4px solid var(--gold);
  background: linear-gradient(180deg, #c9151c, #8f1015);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3);
}

.alert-banner svg {
  width: 52px;
  height: 52px;
  color: #fff;
}

.alert-banner strong {
  display: block;
  font-size: 40px;
  line-height: 1;
  text-transform: uppercase;
}

.alert-banner span {
  display: block;
  margin-top: 4px;
  color: var(--gold-soft);
  font-size: 20px;
  font-weight: 800;
}

.eyebrow {
  color: var(--gold-soft);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.hero h1 {
  margin-top: 18px;
  max-width: 780px;
  font-size: 68px;
  line-height: 1;
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
}

.hero-text {
  margin-top: 18px;
  max-width: 680px;
  color: #f7f2e7;
  font-size: 21px;
  line-height: 1.45;
}

.hero-actions,
.trust-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}

.secondary-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: var(--radius);
  color: #fff;
  text-decoration: none;
  font-weight: 850;
}

.phone-button {
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: var(--radius);
  background: var(--gold);
  color: #151515;
  text-decoration: none;
  font-size: 22px;
  font-weight: 950;
}

.trust-row span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(255, 224, 154, 0.5);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.34);
  font-weight: 800;
}

.triage-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  border-top: 8px solid var(--red);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.triage-card h2 {
  font-size: 30px;
  line-height: 1.08;
}

.form-alert {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.triage-card label,
.search-form label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.triage-card input,
.triage-card select,
.search-form input,
.search-form select {
  min-height: 46px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

.form-note {
  color: var(--muted);
  line-height: 1.35;
}

.owner-mode .hero,
.owner-mode .purpose-band,
.owner-mode .relief-section {
  display: none;
}

.purpose-band,
.relief-section,
.owner-gate,
.office-shell {
  padding: 46px 22px;
}

.purpose-band {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 24px;
  background: #f8f4ec;
  border-block: 1px solid var(--line);
}

.purpose-band h2,
.relief-section h2,
.office-intro h2 {
  font-size: 46px;
  line-height: 1.05;
}

.purpose-band p,
.office-intro p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.purpose-grid,
.relief-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.purpose-grid article,
.relief-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.purpose-grid article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 12px;
}

.notice-icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: var(--charcoal);
  color: var(--gold-soft);
  font-size: 20px;
  font-weight: 950;
}

.purpose-grid strong,
.relief-card h3 {
  font-size: 20px;
}

.purpose-grid p,
.relief-card p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.relief-card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-top: 7px solid var(--red);
}

.relief-card span {
  color: var(--red-dark);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 12px;
}

.relief-card h3 {
  margin: 18px 0 0;
  font-size: 28px;
  line-height: 1.05;
}

.relief-card.urgent {
  border-top: 6px solid var(--red);
}

.relief-card.storm {
  border-top: 6px solid var(--blue);
}

.relief-card.insurance {
  border-top: 6px solid var(--gold);
}

.call-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 22px;
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.98), rgba(34, 34, 34, 0.96)),
    url("/assets/urgent-roof-help-hero.png");
  background-size: cover;
  background-position: center;
  border-block: 5px solid var(--gold);
  color: #fff;
}

.call-strip h2 {
  margin-top: 4px;
  font-size: 40px;
}

.call-strip a {
  flex: 0 0 auto;
  color: var(--gold-soft);
  text-decoration: none;
  font-size: 58px;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.office-shell {
  background: var(--bg);
}

.owner-gate {
  min-height: calc(100vh - 73px);
  display: grid;
  place-items: center;
  background:
    linear-gradient(rgba(242, 240, 234, 0.84), rgba(242, 240, 234, 0.94)),
    url("/assets/urgent-roof-help-hero.png");
  background-size: cover;
  background-position: center;
}

.owner-gate-panel {
  width: min(560px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.owner-gate-panel h1 {
  margin-top: 8px;
  font-size: 40px;
  line-height: 1.05;
}

.owner-gate-panel p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.owner-login-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.owner-login-form label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.owner-login-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink);
  padding: 0 12px;
}

.office-intro {
  max-width: 900px;
  margin-bottom: 22px;
}

.office-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.secondary-action {
  min-height: 42px;
  flex: 0 0 auto;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
}

.office-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 18px;
  align-items: start;
}

.office-grid .status-band {
  grid-column: 1 / -1;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  min-height: 100vh;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0 18px;
}

.brand-block,
.top-actions,
.section-head,
.filters,
.status-band,
.status-metrics,
.lead-card-head,
.lead-actions,
.drawer-head {
  display: flex;
  align-items: center;
}

.brand-block {
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border: 2px solid var(--gold);
  background: var(--red);
  color: #fff;
}

.brand-mark::before {
  content: "!";
  font-size: 28px;
  font-weight: 950;
  line-height: 1;
}

.brand-mark span {
  width: 22px;
  height: 22px;
  border: 3px solid var(--gold);
  border-top-color: #fff;
  transform: rotate(45deg);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
}

.brand-block p,
.section-head p,
.status-copy p,
.lead-meta,
.metric-label,
.county-meta,
.empty-state,
.blocker-body {
  color: var(--muted);
}

.top-actions {
  gap: 10px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(48px, 1fr));
  min-height: 40px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.segment {
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.segment.is-active {
  background: var(--ink);
  color: #fff;
}

.icon-button,
.primary-button,
.mini-button,
.icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: var(--radius);
  gap: 8px;
  font-weight: 750;
}

.icon-button {
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
}

.primary-button {
  min-height: 48px;
  padding: 0 16px;
  background: var(--red);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(197, 22, 29, 0.26);
}

.primary-button.full {
  width: 100%;
}

.mini-button {
  min-height: 36px;
  padding: 0 10px;
  background: var(--surface-2);
  color: var(--ink);
}

.icon-only {
  width: 38px;
  height: 38px;
  background: var(--surface-2);
  color: var(--ink);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 18px;
  align-items: start;
}

.status-band {
  grid-column: 1 / -1;
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--gold);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  gap: 18px;
}

.status-score {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--gold) 0deg, var(--gold) var(--score-angle, 0deg), var(--surface-2) var(--score-angle, 0deg));
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
  position: relative;
}

.status-score::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--surface);
}

.status-score span {
  position: relative;
  z-index: 1;
}

.status-copy {
  min-width: 0;
  flex: 1;
}

.status-copy p {
  margin-top: 6px;
  max-width: 760px;
  line-height: 1.4;
}

.status-metrics {
  gap: 10px;
}

.status-metrics div {
  min-width: 92px;
  padding: 10px 12px;
  border-left: 1px solid var(--line);
}

.metric-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
}

.status-metrics strong {
  display: block;
  margin-top: 2px;
  font-size: 24px;
}

.lead-workbench,
.operator-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.lead-workbench {
  min-height: 650px;
  padding: 18px;
}

.section-head {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.section-head.compact {
  margin-bottom: 12px;
}

.filters {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.search-field {
  display: flex;
  align-items: center;
  min-height: 42px;
  min-width: min(280px, 100%);
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.toggle {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  font-weight: 700;
}

.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.lead-list {
  display: grid;
  gap: 12px;
}

.lead-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.lead-card.is-hot {
  border-left: 5px solid var(--red);
}

.lead-card.is-warm {
  border-left: 5px solid var(--amber);
}

.lead-card-head {
  justify-content: space-between;
  gap: 12px;
}

.lead-title {
  min-width: 0;
  font-size: 17px;
  font-weight: 850;
  line-height: 1.25;
}

.lead-meta {
  margin-top: 4px;
  font-size: 13px;
}

.score-pill,
.tone-pill,
.state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 850;
}

.score-pill {
  background: var(--green-soft);
  color: var(--green);
}

.tone-pill {
  background: var(--blue-soft);
  color: var(--blue);
}

.state-pill {
  background: var(--surface-2);
  color: var(--muted);
}

.lead-reason {
  margin-top: 12px;
  line-height: 1.45;
}

.lead-actions {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.side-rail {
  display: grid;
  gap: 14px;
}

.operator-panel {
  padding: 16px;
}

.search-form {
  display: grid;
  gap: 12px;
}

.search-form label {
  display: grid;
  gap: 6px;
  font-weight: 750;
}

.search-form input,
.search-form select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink);
  padding: 0 12px;
}

.service-map {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.county-list,
.blocker-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.county-row,
.blocker-row {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.county-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 800;
}

.county-status {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--line-strong);
}

.county-status.active {
  background: var(--green);
}

.county-status.shadow {
  background: var(--amber);
}

.blocker-row {
  border-left: 4px solid var(--amber);
}

.blocker-title {
  font-weight: 800;
}

.blocker-body {
  line-height: 1.35;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 360px;
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
  line-height: 1.45;
}

.drawer {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: min(620px, calc(100vw - 36px));
  max-height: min(520px, calc(100vh - 36px));
  display: none;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #101418;
  color: #f3f5f6;
  box-shadow: 0 20px 60px rgba(12, 18, 22, 0.35);
  overflow: hidden;
  z-index: 20;
}

.drawer.is-open {
  display: grid;
}

.drawer-head {
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.drawer pre {
  margin: 0;
  padding: 12px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.is-loading {
  opacity: 0.64;
  pointer-events: none;
}

@media (max-width: 980px) {
  .hero,
  .purpose-band,
  .office-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 50px;
  }

  .purpose-band h2,
  .relief-section h2,
  .office-intro h2 {
    font-size: 40px;
  }

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

  .side-rail .operator-panel:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .site-header {
    align-items: stretch;
    flex-direction: column;
    padding: 12px;
  }

  .nav-actions {
    justify-content: flex-start;
  }

  .hero {
    min-height: 0;
    padding: 24px 14px 34px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .alert-banner {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .alert-banner svg {
    width: 42px;
    height: 42px;
  }

  .alert-banner strong {
    font-size: 30px;
  }

  .alert-banner span {
    font-size: 16px;
  }

  .purpose-band h2,
  .relief-section h2,
  .office-intro h2 {
    font-size: 34px;
  }

  .purpose-band,
  .relief-section,
  .owner-gate,
  .office-shell,
  .call-strip {
    padding: 34px 14px;
  }

  .call-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .call-strip h2 {
    font-size: 30px;
  }

  .call-strip a {
    font-size: 40px;
  }

  .call-strip a,
  .phone-button {
    width: 100%;
    text-align: center;
  }

  .owner-gate-panel h1 {
    font-size: 32px;
  }

  .topbar,
  .status-band,
  .section-head,
  .lead-card-head,
  .office-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions,
  .filters,
  .status-metrics,
  .lead-actions {
    justify-content: stretch;
  }

  .icon-button,
  .primary-button,
  .mini-button,
  .secondary-action,
  .search-field,
  .toggle {
    width: 100%;
  }

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

  .status-metrics div {
    min-width: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .side-rail {
    grid-template-columns: 1fr;
  }
}
