:root {
  --ink: #142019;
  --muted: #5c6f63;
  --paper-deep: #edf5ef;
  --green: #0f8f1d;
  --green-deep: #0a5d14;
  --green-soft: rgba(15, 143, 29, 0.11);
  --sage: #dceedd;
  --line: rgba(20, 32, 25, 0.12);
  --shadow: 0 18px 50px rgba(18, 38, 22, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Sans 3", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 143, 29, 0.15), transparent 30%),
    radial-gradient(circle at right, rgba(13, 104, 31, 0.12), transparent 32%),
    linear-gradient(135deg, #f8fcf8 0%, #f2fbf4 48%, #ebf6ed 100%);
}

[hidden] {
  display: none !important;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.auth-card {
  width: min(460px, 100%);
  padding: 28px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(20, 32, 25, 0.1);
  box-shadow: var(--shadow);
}

.auth-copy {
  margin: 12px 0 18px;
  color: var(--muted);
  font-size: 1.02rem;
}

.auth-status {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(177, 44, 44, 0.08);
  color: #8a1c1c;
  font-weight: 700;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.auth-submit-btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(10, 93, 20, 0.98), rgba(15, 143, 29, 0.94));
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.auth-inline-actions {
  margin-top: 12px;
}

.auth-link-btn {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--green-deep);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.auth-reset-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.auth-reset-copy {
  margin: 0 0 12px;
}

.auth-reset-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-secondary-btn {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.admin-db-upload {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

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

.sidebar {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 22px;
  background: linear-gradient(180deg, rgba(8, 58, 17, 0.98), rgba(14, 95, 27, 0.98));
  color: white;
}

.brand-block {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
  padding: 18px;
  border-radius: 24px;
  background: white;
  color: #111111;
  border: 1px solid rgba(20, 32, 25, 0.08);
}

.brand-logo {
  width: 100%;
  max-width: 190px;
  display: block;
  background: white;
  padding: 0;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.03em;
}

h1 {
  font-size: 2rem;
  line-height: 1;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--green-deep);
}

.brand-block .eyebrow {
  color: var(--green);
}

.nav-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 28px;
}

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

.config-card .sidebar-heading {
  cursor: pointer;
  user-select: none;
  padding: 4px 2px;
  border-radius: 12px;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.config-card .sidebar-heading:hover {
  background: rgba(255, 255, 255, 0.08);
}

.config-card .sidebar-heading:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(234, 255, 234, 0.32);
}

.config-card .sidebar-heading::after {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1.05rem;
  font-weight: 700;
  flex: 0 0 auto;
}

.config-card.is-open .sidebar-heading::after {
  content: "−";
}

.sidebar-label {
  margin: 0;
  font-weight: 700;
}

.sidebar-count {
  display: inline-flex;
  min-width: 30px;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.84rem;
  font-weight: 700;
}

.nav-item {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  text-align: left;
  font: inherit;
  color: inherit;
  background: rgba(255, 255, 255, 0.04);
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.nav-item.active,
.nav-item.active:hover {
  background: rgba(255, 255, 255, 0.14);
  color: white;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18), 0 12px 24px rgba(6, 32, 10, 0.16);
  transform: translateX(2px);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

#lead-feed-section,
#imports-section,
#territories-section,
#liquor-import-section,
#permit-import-section,
#planning-import-section,
#erie-opengov-section,
#registration-import-section,
#lead-sources-section,
#zoho-import-section,
#zoho-leads-import-section,
#tims-import-section,
#apollo-export-section,
#competitors-section,
#competitor-landscape-section,
#product-lines-section,
#industries-section {
  scroll-margin-top: 18px;
}

.sidebar-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.09);
}

.config-card {
  margin-top: 18px;
}

.config-card.is-collapsed > :not(.sidebar-heading) {
  display: none;
}

.imports-master-card {
  display: grid;
  gap: 14px;
}

.import-subsection-stack {
  display: grid;
  gap: 12px;
}

.import-subsection {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.import-subsection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.import-subsection .mini-form {
  margin-top: 12px;
}

.import-subsection .import-help-copy,
.import-subsection .sidebar-note,
.import-subsection .helper-steps,
.import-subsection .helper-link-stack,
.import-subsection .source-mini-list {
  margin-top: 10px;
}

.auth-user-card {
  margin-bottom: 18px;
}

.auth-user-actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.sidebar-footer-actions {
  padding-top: 18px;
}

.county-manager {
  margin-bottom: 18px;
}

.county-form {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.mini-form {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: white;
  font-size: 0.95rem;
  flex-wrap: wrap;
}

.admin-checkbox-row {
  color: var(--ink);
}

.checkbox-row input {
  width: auto;
  margin: 0;
  flex: 0 0 auto;
}

.county-form input,
.mini-form input,
.mini-form select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font: inherit;
}

.county-form input::placeholder,
.mini-form input::placeholder {
  color: rgba(255, 255, 255, 0.68);
}

.sidebar-action-btn {
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  background: white;
  color: var(--green-deep);
  font: inherit;
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.secondary-sidebar-btn {
  width: 100%;
  margin-top: 10px;
}

.apollo-action-stack {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.sidebar-action-btn:hover,
.sidebar-action-btn.active-state {
  background: #e9ffe9;
  box-shadow: 0 10px 24px rgba(6, 32, 10, 0.18);
}

.sidebar-action-btn:disabled {
  opacity: 0.72;
  cursor: wait;
}

.watchlist {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  max-height: 300px;
  overflow: auto;
  padding-right: 4px;
}

.watchlist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
}

.watchlist-copy strong,
.watchlist-copy span {
  display: block;
}

.watchlist-copy span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.85rem;
}

.watchlist-remove {
  border: 0;
  border-radius: 999px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  font: inherit;
  font-weight: 700;
}

.sidebar-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.5;
  color: rgba(246, 240, 230, 0.84);
}

.sidebar-note,
.tiny-note.sidebar-note {
  margin: 12px 0 0;
  color: white;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.import-help-copy {
  line-height: 1.45;
}

.helper-link-stack {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.helper-link {
  color: white;
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.helper-link:hover {
  text-decoration: underline;
}

.helper-steps {
  margin: 14px 0 0;
  padding-left: 18px;
  color: rgba(246, 240, 230, 0.92);
  line-height: 1.5;
}

#competitor-status {
  line-height: 1.4;
}

.chip-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.config-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  font-size: 0.84rem;
  font-weight: 700;
  text-align: center;
}

.config-chip-label {
  border: 0;
  padding: 2px 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  cursor: pointer;
  text-align: left;
  border-radius: 999px;
  flex: 1 1 auto;
}

.config-chip-removable {
  justify-content: space-between;
  gap: 8px;
  padding-right: 8px;
}

.config-chip-editing {
  gap: 6px;
  padding: 6px 8px;
  flex-wrap: wrap;
  border-radius: 18px;
}

.config-chip-input {
  min-width: 140px;
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.92);
  color: #1d4018;
  font: inherit;
  font-weight: 700;
}

.config-chip-action {
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.18);
  color: white;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.config-chip-action:focus-visible,
.config-chip-input:focus-visible,
.config-chip-label:focus-visible,
.config-chip-remove:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}

.config-chip-remove {
  border: 0;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: white;
  font: inherit;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.config-chip-action:hover,
.config-chip-label:hover,
.config-chip-remove:hover {
  background: rgba(255, 255, 255, 0.28);
}

.source-mini-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.source-mini-item {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
}

.source-mini-item strong {
  font-size: 0.93rem;
}

.source-mini-item span {
  color: white;
  font-size: 0.8rem;
  line-height: 1.35;
}

.main-panel {
  padding: 28px;
  overflow-x: hidden;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  padding: 28px;
  border-radius: 28px;
  background: linear-gradient(125deg, rgba(10, 93, 20, 0.96), rgba(15, 143, 29, 0.92));
  color: #f6fff6;
  box-shadow: var(--shadow);
}

.hero-copy {
  max-width: 720px;
  color: rgba(248, 243, 232, 0.84);
  line-height: 1.55;
  margin: 14px 0 0;
}

.hero-eyebrow {
  color: rgba(248, 255, 248, 0.82);
  margin-bottom: 10px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.hero-intro {
  display: grid;
  gap: 14px;
  align-self: stretch;
}

.hero-side-actions {
  display: grid;
  gap: 12px;
  max-width: 280px;
}

.hero-side-btn {
  width: 100%;
}

.hero-process-grid {
  flex: 1 1 760px;
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.discovery-source-control {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.hero-source-control {
  align-items: stretch;
  min-width: 0;
}

.discovery-mode-toggle-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 220px;
}

.discovery-mode-toggle-label {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.discovery-mode-button-value {
  font-size: 0.96rem;
  line-height: 1.2;
}

.hero-source-toggle {
  min-height: 96px;
  justify-content: center;
  text-align: center;
  align-items: center;
}

.discovery-mode-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(320px, 82vw);
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 250, 244, 0.98);
  border: 1px solid rgba(20, 32, 25, 0.12);
  box-shadow: 0 16px 32px rgba(12, 33, 18, 0.18);
  display: grid;
  gap: 10px;
  z-index: 35;
}

.discovery-mode-options {
  display: grid;
  gap: 10px;
}

.discovery-mode-option-btn {
  border: 1px solid rgba(20, 32, 25, 0.12);
  border-radius: 14px;
  padding: 12px 14px;
  background: white;
  color: var(--green-deep);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.discovery-mode-option-btn:hover,
.discovery-mode-option-btn:focus-visible {
  border-color: rgba(20, 95, 34, 0.35);
  background: rgba(32, 111, 45, 0.08);
  outline: none;
}

.discovery-mode-option-btn.active {
  border-color: rgba(20, 95, 34, 0.55);
  background: rgba(32, 111, 45, 0.12);
}

.discovery-mode-panel[hidden] {
  display: none !important;
}

.discovery-mode-label {
  color: var(--green-deep);
  font-size: 0.9rem;
  font-weight: 700;
}

.discovery-mode-select {
  min-width: 100%;
  border: 1px solid rgba(20, 32, 25, 0.12);
  background: white;
  color: var(--ink);
}

.discovery-mode-select option {
  color: var(--ink);
}

.discovery-mode-note {
  margin: 0;
  max-width: 100%;
  color: #66716b;
}

.website-source-panel {
  min-width: 250px;
}

.website-source-option {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--green-deep);
  font-weight: 600;
}

.website-source-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--green-deep);
}

.hero-action-btn {
  position: relative;
}

.hero-action-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 12px);
  transform: translateX(-50%) translateY(-6px);
  width: 220px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 250, 244, 0.98);
  color: var(--ink);
  border: 1px solid rgba(20, 32, 25, 0.12);
  box-shadow: 0 16px 32px rgba(12, 33, 18, 0.22);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
  z-index: 30;
}

.hero-action-btn-right-tip::after {
  left: auto;
  right: 0;
  transform: translateY(-6px);
}

.hero-action-btn:hover::after,
.hero-action-btn:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.hero-action-btn-right-tip:hover::after,
.hero-action-btn-right-tip:focus-visible::after {
  transform: translateY(0);
}

.jump-strip {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(20, 32, 25, 0.08);
  box-shadow: 0 16px 34px rgba(18, 38, 22, 0.08);
}

.ai-assistant-panel {
  margin-top: 18px;
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 250, 244, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.52);
  box-shadow: 0 18px 36px rgba(18, 38, 22, 0.1);
  display: grid;
  gap: 16px;
}

.ai-assistant-panel[hidden] {
  display: none !important;
}

.ai-assistant-panel.ai-assistant-panel-open {
  animation: aiPanelDrop 180ms ease;
  transform-origin: top center;
}

@keyframes aiPanelDrop {
  from {
    opacity: 0;
    transform: translateY(-10px) scaleY(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scaleY(1);
  }
}

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

.ai-panel-header h3 {
  margin: 6px 0 0;
}

.ai-panel-close {
  border: 1px solid rgba(10, 93, 20, 0.12);
  background: rgba(10, 93, 20, 0.08);
  color: var(--green-deep);
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

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

.ai-message {
  max-width: 860px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(20, 32, 25, 0.08);
  background: rgba(255, 255, 255, 0.7);
}

.ai-message p {
  margin: 0;
  line-height: 1.55;
}

.ai-message-body {
  display: grid;
  gap: 10px;
}

.ai-message-body p {
  margin: 0;
}

.ai-message-body ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.ai-message-body li {
  line-height: 1.55;
}

.ai-message-role {
  margin-bottom: 6px !important;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
}

.ai-message-user {
  justify-self: end;
  background: linear-gradient(180deg, rgba(10, 93, 20, 0.98), rgba(15, 143, 29, 0.94));
  color: #f8fff6;
  border-color: transparent;
}

.ai-message-user .ai-message-role {
  color: rgba(248, 255, 248, 0.78);
}

.ai-message-assistant {
  justify-self: start;
}

.ai-suggestion-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ai-suggestion-chip {
  border: 1px solid rgba(10, 93, 20, 0.12);
  background: rgba(10, 93, 20, 0.08);
  color: var(--green-deep);
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

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

.ai-form textarea {
  min-height: 104px;
  resize: vertical;
  border-radius: 18px;
  border: 1px solid rgba(20, 32, 25, 0.12);
  padding: 14px 16px;
  font: inherit;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
}

.ai-form-actions {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.ai-form-actions .tiny-note {
  max-width: 560px;
}

.ai-research-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--green-deep);
  font-weight: 700;
  cursor: pointer;
}

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

.ai-message-sources {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(20, 32, 25, 0.08);
  display: grid;
  gap: 8px;
}

.ai-message-sources-label {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
}

.ai-source-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.ai-source-list a {
  color: var(--green-deep);
  font-weight: 700;
  text-decoration: none;
}

.ai-source-list a:hover,
.ai-source-list a:focus-visible {
  text-decoration: underline;
}

.ai-source-url {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.jump-strip-copy p:last-child {
  margin: 0;
  color: var(--muted);
}

.jump-strip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.jump-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  min-height: 64px;
  padding: 11px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  color: var(--green-deep);
  background: rgba(10, 93, 20, 0.08);
  border: 1px solid rgba(10, 93, 20, 0.12);
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.jump-chip:hover {
  background: rgba(10, 93, 20, 0.14);
  box-shadow: 0 10px 24px rgba(10, 44, 18, 0.12);
  transform: translateY(-1px);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 31, 11, 0.28);
  backdrop-filter: blur(4px);
  z-index: 50;
}

.admin-panel-shell {
  position: fixed;
  inset: 0;
  background: rgba(8, 20, 11, 0.32);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 60;
}

.admin-panel-card {
  width: min(680px, 100%);
  max-height: min(82vh, 860px);
  overflow: auto;
  padding: 24px;
  border-radius: 26px;
  background: rgba(255, 250, 244, 0.98);
  border: 1px solid rgba(20, 32, 25, 0.08);
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

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

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

.admin-user-row {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(20, 32, 25, 0.08);
}

.admin-user-row strong,
.admin-user-row span {
  display: block;
}

.admin-user-role {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-user-form {
  display: grid;
  gap: 10px;
}

.admin-user-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.loading-overlay.visible {
  display: flex;
}

.loading-overlay-card {
  min-width: 260px;
  padding: 28px 24px;
  border-radius: 22px;
  background: rgba(255, 250, 244, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 20px 48px rgba(6, 32, 10, 0.22);
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
}

.loading-overlay-card p {
  margin: 0;
  color: var(--green-deep);
  font-weight: 700;
}

.loading-spinner {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 4px solid rgba(15, 143, 29, 0.18);
  border-top-color: var(--green);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.primary-btn,
.secondary-btn,
select {
  border-radius: 14px;
  padding: 12px 16px;
  font: inherit;
}

.primary-btn {
  border: 0;
  background: white;
  color: var(--green-deep);
  font-weight: 700;
}

.secondary-btn {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  color: white;
}

.hero-action-btn {
  min-height: 96px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.35;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.hero-action-btn:hover,
.hero-action-btn.active {
  background: white;
  color: var(--green-deep);
  border-color: white;
  box-shadow: 0 12px 24px rgba(6, 32, 10, 0.18);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.competitor-link {
  display: inline-flex;
  color: var(--green-deep);
  font-weight: 700;
  text-decoration: none;
  word-break: break-word;
}

.competitor-card {
  height: 320px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.competitor-website-list {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  gap: 12px;
  margin-top: 14px;
  overflow-y: auto;
  padding-right: 6px;
}

.competitor-website-item {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(12, 96, 24, 0.08);
}

.competitor-website-item span {
  color: rgba(21, 43, 24, 0.72);
  font-size: 0.84rem;
  line-height: 1.4;
}

.competitor-empty-copy {
  margin-top: 14px;
}

.app-status {
  margin: 12px 6px 0;
  color: var(--green-deep);
  font-weight: 700;
}

.website-results-panel {
  margin-top: 18px;
  background: rgba(255, 250, 244, 0.84);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow);
  border-radius: 24px;
  padding: 20px;
}

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

.website-results-header h3 {
  margin: 4px 0 0;
}

.website-results-header .tiny-note {
  max-width: 420px;
  text-align: right;
}

.website-results-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.website-results-total {
  border-radius: 999px;
  background: rgba(83, 126, 84, 0.14);
  color: var(--green-deep);
  padding: 8px 14px;
  font-weight: 700;
}

.website-results-list {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.website-results-item {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(83, 126, 84, 0.16);
}

.website-results-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.website-results-company {
  font-weight: 700;
}

.website-results-source {
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(32, 111, 45, 0.12);
  color: var(--green-deep);
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.website-results-link {
  color: var(--green-deep);
  font-weight: 700;
  word-break: break-all;
}

.website-results-empty {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--green-mid);
}

.metrics-grid,
.journey-grid,
.competitor-grid {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

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

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

.metric-card,
.board-panel,
.detail-panel,
.journey-card {
  background: rgba(255, 250, 244, 0.84);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow);
}

.metric-card,
.board-panel,
.detail-panel,
.journey-card {
  border-radius: 24px;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.competitor-empty {
  grid-column: 1 / -1;
}

.metric-card {
  min-height: 132px;
  display: grid;
  gap: 10px;
}

.metric-card-action {
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.metric-card-action:hover,
.metric-card-action:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(15, 36, 22, 0.16);
  outline: none;
}

.metric-card-action.active {
  background: linear-gradient(180deg, rgba(10, 93, 20, 0.98), rgba(15, 143, 29, 0.96));
  color: white;
  border-color: rgba(10, 93, 20, 0.9);
  box-shadow: 0 20px 38px rgba(10, 44, 18, 0.26);
}

.metric-card-action.active .metric-label,
.metric-card-action.active .metric-value,
.metric-card-action.active .metric-subtext {
  color: white;
}

.metric-card-action.active .metric-subtext {
  opacity: 0.92;
}

.metric-value {
  font-size: 2.1rem;
  font-family: "Space Grotesk", sans-serif;
}

.accent-amber {
  border-top: 6px solid var(--green);
}

.accent-emerald {
  border-top: 6px solid var(--green-deep);
}

.accent-cobalt {
  border-top: 6px solid #1d7e2a;
}

.accent-rust {
  border-top: 6px solid #34a042;
}

.workspace-grid {
  margin-top: 20px;
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
  align-items: start;
}

.map-section {
  margin-top: 20px;
  display: grid;
  gap: 16px;
}

.map-control-instruction {
  margin: 0;
  color: var(--green-deep);
  font-weight: 900;
  font-size: 1rem;
}

.map-control-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  align-items: end;
  gap: 18px 24px;
  padding: 22px 24px;
  border-radius: 22px;
  background: rgba(255, 250, 244, 0.76);
  border: 1px solid rgba(20, 72, 27, 0.12);
}

.map-control-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-weight: 800;
  color: var(--green-deep);
}

.map-control-field-wide {
  grid-column: 1 / -1;
}

.map-control-field span {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.route-start-row {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(170px, auto);
  gap: 18px;
  align-items: stretch;
}

.route-start-row input {
  min-height: 56px;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 1rem;
}

.route-start-row .secondary-btn {
  min-height: 56px;
  min-width: 170px;
  justify-content: center;
}

.map-section .sidebar-note,
.map-section .tiny-note.sidebar-note,
.map-control-bar .sidebar-note,
.map-panel .sidebar-note,
.route-panel .sidebar-note {
  color: var(--muted);
}

.map-section .secondary-btn {
  border-color: rgba(14, 78, 22, 0.2);
  background: rgba(14, 78, 22, 0.08);
  color: var(--green-deep);
  font-weight: 800;
}

.map-section .secondary-btn:hover:not(:disabled) {
  background: rgba(14, 78, 22, 0.14);
}

.map-section .secondary-btn:disabled {
  color: rgba(14, 78, 22, 0.35);
  background: rgba(14, 78, 22, 0.04);
  border-color: rgba(14, 78, 22, 0.1);
}

.map-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.8fr);
  align-items: start;
}

.map-panel,
.route-panel {
  background: rgba(255, 250, 244, 0.84);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow);
  border-radius: 24px;
  padding: 20px;
}

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

.map-panel-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.route-action-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  min-width: 170px;
}

.route-action-row .secondary-btn {
  width: 100%;
  min-height: 56px;
}

.map-stat-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.map-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(14, 78, 22, 0.08);
  color: var(--green-deep);
  font-weight: 700;
}

.map-debug-output {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(16, 42, 20, 0.07);
  border: 1px solid rgba(20, 72, 27, 0.14);
  color: var(--green-deep);
  font: 700 0.78rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.lead-map-canvas {
  margin-top: 14px;
  min-height: 440px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(20, 72, 27, 0.14);
  background:
    radial-gradient(circle at top left, rgba(69, 163, 76, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(244, 252, 244, 0.98), rgba(227, 244, 228, 0.92));
  position: relative;
}

.lead-map-canvas.route-map-focus {
  box-shadow: 0 0 0 6px rgba(17, 126, 35, 0.22), 0 22px 50px rgba(11, 77, 24, 0.22);
}

.lead-map-empty {
  min-height: 440px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 28px;
  color: var(--muted);
}

.lead-map-empty strong {
  display: block;
  margin-bottom: 8px;
  color: var(--green-deep);
  font-size: 1.1rem;
}

.route-summary-card {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(14, 78, 22, 0.08);
  color: var(--green-deep);
  display: grid;
  gap: 6px;
}

.graphhopper-route-packet {
  margin-top: 14px;
}

.graphhopper-packet-card {
  padding: 16px;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(13, 107, 31, 0.12), rgba(255, 255, 255, 0.82));
  border: 1px solid rgba(12, 106, 31, 0.18);
  display: grid;
  gap: 14px;
}

.graphhopper-packet-heading {
  display: grid;
  gap: 5px;
  color: var(--green-deep);
}

.graphhopper-packet-heading strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.1rem;
}

.graphhopper-packet-heading span {
  color: var(--muted);
  line-height: 1.45;
}

.graphhopper-packet-stops {
  display: grid;
  gap: 10px;
}

.graphhopper-packet-stop {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(20, 72, 27, 0.1);
}

.route-list {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.route-stop-card {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(20, 72, 27, 0.08);
}

.route-stop-order {
  font-family: "Space Grotesk", sans-serif;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.route-stop-company {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-deep);
}

.route-stop-meta {
  color: var(--muted);
  font-size: 0.94rem;
}

.route-stop-drive-link {
  display: inline-flex;
  justify-content: center;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(16, 132, 38, 0.11);
  border: 1px solid rgba(12, 106, 31, 0.18);
  color: var(--green-deep);
  font-weight: 800;
  text-decoration: none;
}

.route-stop-drive-link:hover {
  background: rgba(16, 132, 38, 0.18);
}

.route-nearby-list,
.map-nearby-list {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(20, 72, 27, 0.12);
  color: var(--muted);
  font-size: 0.88rem;
}

.route-nearby-title,
.map-nearby-list b {
  color: var(--green-deep);
  font-weight: 800;
}

.route-open-link {
  margin-top: 14px;
  display: inline-flex;
}

.map-section .route-open-link,
.map-section .route-link-list .helper-link {
  color: var(--green-deep);
}

.route-link-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

@media (max-width: 760px) {
  .map-section {
    gap: 12px;
  }

  .map-section .section-heading h3 {
    font-size: 1.5rem;
    line-height: 1.15;
  }

  .map-control-instruction {
    font-size: 0.95rem;
    line-height: 1.35;
  }

  .map-control-bar {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
    border-radius: 20px;
  }

  .map-control-field span {
    font-size: 0.74rem;
  }

  .map-control-field select,
  .route-start-row input {
    width: 100%;
    min-width: 0;
    font-size: 1rem;
  }

  .route-start-row input {
    min-height: 58px;
  }

  .route-start-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .route-start-row .secondary-btn {
    width: 100%;
    min-width: 0;
  }

  .map-layout {
    gap: 14px;
  }

  .map-panel,
  .route-panel {
    padding: 16px;
    border-radius: 22px;
  }

  .map-panel-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .map-panel-actions {
    justify-items: stretch;
  }

  .map-stat-row {
    justify-content: stretch;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-stat-pill {
    justify-content: center;
    padding: 9px 10px;
    font-size: 0.95rem;
  }

  .lead-map-canvas,
  .lead-map-empty {
    min-height: min(68vh, 520px);
  }

  .lead-map-canvas {
    margin-top: 12px;
    border-radius: 18px;
  }

  .route-action-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
  }

  .route-action-row .secondary-btn {
    min-height: 52px;
    padding-inline: 10px;
    font-size: 0.95rem;
  }

  .route-panel h4 {
    font-size: 1.35rem;
  }

  .route-summary-card {
    padding: 14px;
  }

  .route-list {
    max-height: 58vh;
    overflow: auto;
    padding-right: 4px;
  }

  .route-stop-card,
  .graphhopper-packet-stop {
    padding: 13px 14px;
    border-radius: 16px;
  }

  .map-info-window {
    max-width: 230px;
  }
}

@media (max-width: 480px) {
  .route-action-row {
    grid-template-columns: 1fr;
  }

  .lead-map-canvas,
  .lead-map-empty {
    min-height: 62vh;
  }
}

.map-info-window {
  max-width: 280px;
  display: grid;
  gap: 6px;
}

.map-info-window strong {
  color: var(--green-deep);
}

.board-panel {
  min-width: 0;
}

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

  body {
    background: #fff;
  }

  .page-shell {
    display: block;
    min-height: 0;
  }

  .sidebar,
  .main-panel > :not(#map-view-section),
  #map-view-section > :not(.map-layout),
  .map-panel {
    display: none !important;
  }

  .main-panel {
    display: block;
    padding: 0;
    overflow: visible;
  }

  #map-view-section,
  .map-layout {
    display: block;
    margin: 0;
    padding: 0;
    gap: 0;
  }

  .route-panel {
    display: block;
    position: static;
    width: 100%;
    padding: 0;
    box-shadow: none;
    border: 0;
    background: #fff;
    color: #111;
    font-size: 10pt;
  }

  .route-action-row,
  .route-open-link,
  .route-link-list,
  #route-status {
    display: none !important;
  }

  .route-panel .eyebrow {
    color: #24582a;
    font-size: 9pt;
    letter-spacing: 0.08em;
  }

  .route-panel h4 {
    margin: 0 0 8px;
    font-size: 16pt;
    color: #111;
  }

  .route-summary-card {
    margin: 0 0 10px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    background: #f7f7f7;
    color: #111;
  }

  .route-summary-card strong,
  .route-summary-card .tiny-note {
    color: #111;
  }

  .route-list {
    gap: 4px;
    display: grid;
  }

  .route-stop-card {
    display: grid;
    grid-template-columns: 0.5in minmax(0, 1.2fr) minmax(0, 1.5fr);
    gap: 4px 8px;
    padding: 6px 8px;
    break-inside: avoid;
    border: 1px solid #ddd;
    background: #fff;
  }

  .route-stop-order,
  .route-stop-company,
  .route-stop-meta {
    color: #111;
    font-size: 9pt;
    line-height: 1.25;
  }

  .route-stop-order {
    grid-row: span 2;
    letter-spacing: 0;
  }

  .route-stop-company {
    font-size: 10pt;
  }

  .route-nearby-list {
    grid-column: 2 / -1;
    display: block;
    margin: 3px 0 0;
    padding-top: 3px;
    border-top: 1px solid #ddd;
    color: #333;
    font-size: 8pt;
    line-height: 1.25;
  }

  .route-nearby-title {
    display: inline;
    color: #24582a;
    font-size: 8pt;
    font-weight: 800;
  }

  .route-nearby-list span:not(.route-nearby-title) {
    display: inline;
    color: #333;
  }

  .route-nearby-list span:not(.route-nearby-title)::after {
    content: "  ";
  }
}

.detail-panel {
  width: auto;
  max-width: 100%;
}

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

.board-mode-label {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 600;
}

.filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

select {
  border: 1px solid var(--line);
  background: white;
}

.county-ribbon {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.county-pill,
.score-chip,
.need-chip,
.signal-chip,
.dupe-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.83rem;
  font-weight: 700;
  text-align: center;
}

.county-pill {
  background: var(--paper-deep);
  color: var(--green-deep);
}

.score-chip {
  background: var(--green-soft);
  color: var(--green-deep);
  min-width: 58px;
}

.need-chip {
  background: rgba(15, 143, 29, 0.1);
  color: var(--green-deep);
  min-width: 106px;
}

.signal-chip {
  background: rgba(15, 143, 29, 0.12);
  color: var(--green);
}

.dupe-chip {
  padding: 6px 10px;
}

.dupe-zoho {
  background: rgba(8, 118, 202, 0.12);
  color: #0c5f9d;
}

.dupe-tims {
  background: rgba(163, 92, 17, 0.14);
  color: #8a4b0f;
}

.table-wrap {
  margin-top: 18px;
  overflow-x: auto;
  overflow-y: visible;
  padding-right: 6px;
}

.lead-table {
  width: max(100%, 1160px);
  border-collapse: collapse;
  table-layout: fixed;
}

.lead-table th,
.lead-table td {
  padding: 14px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.lead-table .centered-column,
.lead-table .centered-cell {
  text-align: center;
}

.lead-table th:nth-child(1),
.lead-table td:nth-child(1) {
  width: 20%;
}

.lead-table th:nth-child(2),
.lead-table td:nth-child(2) {
  width: 13%;
}

.lead-table th:nth-child(3),
.lead-table td:nth-child(3) {
  width: 15%;
}

.lead-table th:nth-child(4),
.lead-table td:nth-child(4) {
  width: 12%;
}

.lead-table th:nth-child(5),
.lead-table td:nth-child(5) {
  width: 11%;
}

.lead-table th:nth-child(6),
.lead-table td:nth-child(6) {
  width: 13%;
}

.lead-table th:nth-child(7),
.lead-table td:nth-child(7) {
  width: 8%;
}

.lead-table th:nth-child(8),
.lead-table td:nth-child(8) {
  width: 8%;
}

.salesperson-select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.lead-table .signal-chip,
.lead-table .need-chip,
.lead-table .dupe-chip {
  max-width: 100%;
  padding: 8px 10px;
  line-height: 1.2;
  white-space: normal;
  word-break: break-word;
}

.dupe-cell {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.lead-table .score-chip {
  min-width: 0;
  width: 100%;
  max-width: 72px;
  padding: 8px 8px;
}

.lead-row {
  cursor: pointer;
}

.lead-row:hover,
.lead-row.active {
  background: rgba(15, 143, 29, 0.08);
}

.lead-empty-row td {
  padding: 24px 12px;
}

.lead-empty-state {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.lead-company {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tiny-note {
  color: #66716b;
  font-size: 0.88rem;
}

.meta-grid,
.score-grid {
  display: grid;
  gap: 10px;
}

.detail-panel {
  position: fixed;
  inset: 0;
  z-index: 80;
  padding: 24px;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  box-shadow: none;
}

.detail-panel-empty {
  display: none;
}

.detail-placeholder {
  display: grid;
  gap: 10px;
  align-content: start;
}

.detail-panel-open {
  display: grid;
}

.detail-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 25, 13, 0.4);
  backdrop-filter: blur(4px);
}

.detail-modal-card {
  position: relative;
  z-index: 1;
  overflow: auto;
  width: min(980px, calc(100vw - 48px));
  box-sizing: border-box;
  max-height: calc(100vh - 48px);
  border-radius: 24px;
  padding: 24px;
  background: rgba(255, 250, 244, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow);
}

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

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

.detail-close-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  background: white;
  color: var(--green-deep);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  flex: 0 0 auto;
}

.meta-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

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

.score-caption {
  margin: 8px 0 14px;
  color: var(--muted);
  line-height: 1.45;
}

.meta-item,
.score-box,
.contact-card,
.inspection-card {
  border-radius: 18px;
  padding: 14px;
  background: white;
  border: 1px solid var(--line);
}

.meta-item span,
.score-box span {
  display: block;
  color: #66716b;
  margin-bottom: 6px;
  font-size: 0.86rem;
}

.score-stack,
.reason-list,
.contact-card,
.inspection-card {
  margin-top: 18px;
}

.detail-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.detail-action-btn {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  font-family: "Space Grotesk", sans-serif;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.detail-action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.detail-action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.detail-action-btn-secondary {
  background: rgba(29, 56, 40, 0.12);
  color: var(--green-deep);
  border: 1px solid rgba(31, 77, 39, 0.18);
}

.inspection-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.inspection-link {
  display: inline-flex;
  margin-top: 12px;
  color: var(--green-deep);
  font-weight: 700;
  text-decoration: none;
}

.inspection-link:hover {
  text-decoration: underline;
}

.detail-header h3 {
  margin-bottom: 14px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.meta-item strong,
.contact-card strong,
.inspection-card strong {
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.score-box strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.2rem;
}

.source-section {
  margin-top: 20px;
  position: relative;
  z-index: 0;
}

.source-section-summary {
  padding: 22px 24px;
  border-radius: 26px;
  background: rgba(255, 250, 244, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.source-drawer-trigger {
  color: var(--green-deep);
  border-color: rgba(20, 32, 25, 0.12);
  background: rgba(10, 93, 20, 0.08);
}

.source-drawer-trigger:hover {
  background: rgba(10, 93, 20, 0.14);
}

.source-summary-copy {
  margin: 14px 0 0;
  max-width: 700px;
  color: var(--muted);
  line-height: 1.6;
}

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

.source-card {
  border-radius: 24px;
  padding: 18px;
  background: rgba(255, 250, 244, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow);
  position: relative;
  z-index: 1;
}

.source-card h4 {
  margin: 0 0 10px;
  font-family: "Space Grotesk", sans-serif;
}

.source-card p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.5;
}

.source-drawer-shell[hidden] {
  display: none;
}

.source-drawer-shell {
  position: fixed;
  inset: 0;
  z-index: 90;
}

.source-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 31, 11, 0.34);
  backdrop-filter: blur(4px);
}

.source-drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: min(980px, 92vw);
  height: 100vh;
  padding: 28px;
  overflow: auto;
  background: linear-gradient(180deg, rgba(247, 252, 247, 0.98), rgba(237, 245, 239, 0.98));
  box-shadow: -18px 0 48px rgba(18, 38, 22, 0.18);
}

.import-guide-drawer {
  width: min(760px, 92vw);
}

.source-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.source-drawer-close {
  border: 1px solid rgba(20, 32, 25, 0.12);
  border-radius: 999px;
  padding: 10px 14px;
  background: white;
  color: var(--green-deep);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.source-drawer-close:hover {
  background: rgba(10, 93, 20, 0.08);
}

.import-guide-body {
  display: grid;
  gap: 18px;
  color: var(--muted);
}

.import-guide-intro {
  margin: 0;
}

.import-guide-section h4 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1rem;
}

.import-guide-section p {
  margin: 0;
}

.import-guide-section ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.source-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-tag {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-size: 0.8rem;
  font-weight: 700;
}

.journey-list {
  margin: 16px 0 0;
  padding-left: 20px;
  line-height: 1.65;
}

.summary-columns {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.summary-column {
  display: grid;
  gap: 12px;
  align-content: start;
}

.summary-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(20, 32, 25, 0.08);
}

.summary-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.summary-tag {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--green);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
}

@media (max-width: 1180px) {
  .page-shell,
  .metrics-grid,
  .map-layout,
  .workspace-grid,
  .summary-columns,
  .source-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .main-panel {
    padding: 16px;
  }

  .hero,
  .panel-heading,
  .hero-actions {
    flex-direction: column;
  }

  .hero-process-grid {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .hero-side-actions {
    max-width: none;
  }

  .section-heading,
  .source-drawer-header {
    flex-direction: column;
  }

  .source-drawer {
    width: 100vw;
    padding: 20px 16px 32px;
  }

  .jump-strip-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .meta-grid,
  .score-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    padding: 16px;
  }

  .detail-modal-card {
    width: min(100%, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
  }
}
