:root {
  --temo-blue: #31b7e0;
  --temo-blue-dark: #108bb1;
  --ink: #16202a;
  --muted: #687582;
  --line: #d8e1e8;
  --panel: #ffffff;
  --page: #eef4f7;
  --shadow: 0 20px 60px rgba(22, 32, 42, 0.18);
  --radius: 8px;
  font-family: Inter, "Lato", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

.landing {
  min-height: 100%;
  background:
    linear-gradient(rgba(16, 45, 60, 0.76), rgba(16, 45, 60, 0.64)),
    url("https://images.unsplash.com/photo-1524661135-423995f22d0b?auto=format&fit=crop&w=1800&q=80") center / cover;
}

.landing-shell {
  width: min(1160px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 64px 0;
  display: grid;
  align-content: center;
  gap: 28px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 36px;
  align-items: end;
  color: #fff;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--temo-blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
}

.hero-panel h1 {
  max-width: 850px;
  font-size: clamp(42px, 7vw, 78px);
}

.hero-copy {
  max-width: 720px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 19px;
  line-height: 1.6;
}

.hero-stats {
  display: grid;
  gap: 12px;
}

.hero-stats div,
.screen-card,
.intelligence-panel,
.hover-panel,
.map-toolbar {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-stats div {
  padding: 20px;
}

.hero-stats strong {
  display: block;
  color: #40bbe2!important;
  font-size: 34px;
}


.hero-stats span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

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

.screen-card {
  min-height: 230px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.screen-card:hover {
  transform: translateY(-3px);
}

.screen-card.primary {
  background: #fff;
}

.card-kicker {
  color: var(--temo-blue-dark);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.screen-card h2 {
  margin-top: 12px;
  font-size: 30px;
}

.screen-card p {
  margin: 16px 0 26px;
  color: var(--muted);
  line-height: 1.55;
}

.card-action,
.primary-button {
  width: fit-content;
  border: 0;
  border-radius: 6px;
  background: var(--temo-blue);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  padding: 13px 17px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  height: 68px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: relative;
  z-index: 10;
}

.brand {
  font-weight: 900;
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-links a {
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  padding: 10px 12px;
}

.nav-links a.active,
.nav-links a:hover {
  border-color: var(--line);
  color: var(--ink);
}

.map-layout,
.territory-layout {
  min-height: 0;
}

.national-layout {
  padding: 18px;
}

.territory-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  padding: 18px;
}

.map-stage {
  min-height: 0;
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
}

.map-canvas {
  min-height: 0;
  position: relative;
}

.map-canvas .google-map {
  height: 100%;
}

.map-toolbar {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  box-shadow: none;
}

.map-toolbar h1 {
  font-size: 25px;
}

.toolbar-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.toolbar-metrics span {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  padding: 10px 12px;
  white-space: nowrap;
}

.toolbar-metrics strong {
  color: var(--ink);
}

.layer-toggle-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.layer-toggle {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  padding: 11px 13px;
  white-space: nowrap;
}

.layer-toggle[aria-pressed="true"] {
  border-color: #7c3aed;
  background: #7c3aed;
  color: #fff;
}

.layer-toggle-unmatched[aria-pressed="true"] {
  border-color: #f97316;
  background: #f97316;
}

.google-map {
  min-height: 740px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #dfe8ed;
  overflow: hidden;
}

.map-error {
  height: 100%;
  min-height: inherit;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
  padding: 24px;
  text-align: center;
}

.territory-layout .google-map {
  min-height: calc(100vh - 170px);
}

.dealer-select-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.dealer-select-label select {
  width: min(340px, 45vw);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  text-transform: none;
}

.intelligence-panel {
  align-self: start;
  padding: 22px;
  position: sticky;
  top: 86px;
  box-shadow: none;
}

.intelligence-panel h2 {
  font-size: 30px;
}

.permit-callout {
  margin: 18px 0 16px;
  border: 1px solid rgba(49, 183, 224, 0.34);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(49, 183, 224, 0.16), rgba(255, 255, 255, 0.96));
  padding: 16px;
}

.permit-callout span,
.permit-callout small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.35;
  text-transform: uppercase;
}

.permit-callout strong {
  display: block;
  color: #d92828;
  font-size: 38px;
  line-height: 1;
  margin: 7px 0;
}

.dealer-tier-badge {
  width: fit-content;
  margin: 0 0 12px;
  border: 1px solid #c9d4dc;
  border-radius: 999px;
  background: #f6f9fb;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  padding: 7px 10px;
  text-transform: uppercase;
}

.dealer-tier-badge.is-premier {
  border-color: #d9a535;
  background: #fff4cf;
}

.dealer-tier-badge.is-authorized {
  border-color: #b7c0c8;
  background: #f1f3f5;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.metric-grid div {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 13px;
}

.metric-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-grid strong {
  display: block;
  margin-top: 7px;
  font-size: 20px;
}

.metric-grid small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.source-note {
  margin: -6px 0 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.dealer-contact {
  display: grid;
  gap: 9px;
  margin-bottom: 22px;
  color: var(--muted);
  line-height: 1.35;
}

.primary-button {
  width: 100%;
  font-size: 15px;
}

.hover-panel {
  width: min(340px, calc(100% - 24px));
  padding: 14px 16px;
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 5;
  box-shadow: 0 12px 36px rgba(22, 32, 42, 0.18);
}

.map-legend {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 36px rgba(22, 32, 42, 0.15);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  padding: 10px 12px;
  text-transform: uppercase;
}

.map-legend i {
  width: 16px;
  height: 16px;
  display: inline-block;
  border: 1px solid rgba(22, 32, 42, 0.12);
  border-radius: 4px;
}

.map-legend b {
  color: var(--ink);
  font-weight: 900;
}

.legend-zero {
  background: #eef4f7;
}

.legend-low {
  background: #93c5fd;
}

.legend-mid {
  background: #31b7e0;
}

.legend-high {
  background: #7c3aed;
}

.hover-panel strong,
.hover-panel span {
  display: block;
}

.panel-label {
  color: var(--temo-blue-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hover-panel dl {
  margin: 10px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

.hover-panel dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.hover-panel dd {
  margin: 2px 0 0;
  font-weight: 800;
}

.info-window {
  min-width: 230px;
  color: var(--ink);
}

.info-window h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.info-window p {
  margin: 4px 0;
  color: #4f5f6e;
}

.info-window a {
  display: inline-block;
  margin-top: 12px;
  border-radius: 5px;
  background: var(--temo-blue);
  color: #fff;
  font-weight: 800;
  padding: 9px 11px;
}

.gm-style .gm-style-iw-c {
  border-radius: 12px;
  max-height: calc(100vh - 92px) !important;
  padding: 0;
}

.gm-style .gm-style-iw-d {
  max-height: min(74vh, 700px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  padding: 16px;
}

.dealer-info-card {
  width: min(390px, calc(100vw - 84px));
  max-width: 390px;
  color: var(--ink);
  font-family: Inter, "Lato", Arial, sans-serif;
}

.unmatched-warranty-card {
  width: min(300px, calc(100vw - 84px));
  color: var(--ink);
  font-family: Inter, "Lato", Arial, sans-serif;
}

.unmatched-warranty-card h3 {
  margin: 8px 0 4px;
  font-size: 20px;
}

.unmatched-warranty-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.unmatched-warranty-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 14px 0 0;
}

.unmatched-warranty-card dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.unmatched-warranty-card dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.unmatched-warranty-card .unmatched-note {
  margin-top: 12px;
  border-radius: 6px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  padding: 9px 10px;
}

.dealer-info-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.dealer-info-header h3 {
  margin: 7px 0 4px;
  font-size: 20px;
  line-height: 1.15;
}

.dealer-info-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.dealer-tier-pill {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: rgba(49, 183, 224, 0.14);
  color: var(--temo-blue-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  padding: 6px 9px;
  text-transform: uppercase;
}

.dealer-status {
  border-radius: 999px;
  background: #eef7f0;
  color: #1f7a3d;
  font-size: 11px;
  font-weight: 900;
  padding: 6px 9px;
  white-space: nowrap;
  text-transform: uppercase;
}

.dealer-status.is-inactive {
  background: #f4f4f4;
  color: #687582;
}

.dealer-status.is-credit-hold {
  background: #fff2d6;
  color: #9a6200;
}

.dealer-info-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.dealer-info-kpis div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
  padding: 10px;
}

.dealer-info-kpis span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.dealer-info-kpis strong {
  display: block;
  margin-top: 5px;
  font-size: 17px;
  line-height: 1.1;
}

.dealer-info-section {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}

.dealer-info-section h4 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dealer-info-section p {
  margin: 0;
  color: #4f5f6e;
  font-size: 13px;
  line-height: 1.45;
}

.dealer-info-section dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 0;
}

.dealer-info-section dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.dealer-info-section dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.product-mix-list {
  display: grid;
  gap: 6px;
}

.product-mix-list span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-radius: 6px;
  background: #f6f9fb;
  color: #4f5f6e;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 9px;
}

.product-mix-list b,
.product-mix-list em {
  font-style: normal;
}

.dealer-ai-insight {
  margin-top: 12px;
  border-radius: 7px;
  background: rgba(49, 183, 224, 0.1);
  color: #34505c;
  font-size: 12px;
  line-height: 1.45;
  padding: 10px;
}

.dealer-ai-insight strong {
  color: var(--temo-blue-dark);
}

.dealer-info-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.dealer-info-actions a,
.dealer-info-actions button {
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  padding: 10px 11px;
  text-align: center;
}

.dealer-info-actions .dealer-icon-action {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  background: var(--temo-blue);
  color: #fff;
  flex: 0 0 auto;
  padding: 0;
}

.dealer-icon-action svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.dealer-info-actions button {
  background: #eef4f7;
  color: var(--ink);
}

@media (max-width: 900px) {
  .hero-panel,
  .screen-grid,
  .territory-layout {
    grid-template-columns: 1fr;
  }

  .territory-layout {
    padding: 12px;
  }

  .intelligence-panel {
    position: static;
  }

  .map-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .dealer-select-label select {
    width: 100%;
  }

  .territory-layout .google-map,
  .google-map {
    min-height: 560px;
  }
}

@media (max-width: 640px) {
  .topbar {
    height: auto;
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
  }

  .nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .landing-shell {
    width: min(100% - 24px, 1160px);
    padding: 32px 0;
  }

  .hero-panel h1 {
    font-size: 40px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }
}
