:root {
  --blue: #008cff;
  --blue-strong: #0077cc;
  --blue-soft: #ddf1ff;
  --navy: #02324f;
  --charcoal: #17202a;
  --muted: #627487;
  --line: #d9e8f4;
  --surface: #f6fbff;
  --white: #ffffff;
  --green: #1c9b6f;
  --amber: #c57900;
  --shadow: 0 20px 50px rgba(2, 50, 79, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--charcoal);
  background: var(--white);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(1160px, calc(100% - 32px));
  margin-inline: auto;
}

.app-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  color: var(--navy);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand strong {
  display: block;
  font-size: 1.25rem;
  letter-spacing: 0;
}

.brand small {
  color: var(--muted);
  display: block;
  font-weight: 650;
  font-size: 0.78rem;
}

.logo-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.top-nav a {
  color: var(--navy);
  text-decoration: none;
  font-weight: 750;
  padding: 10px 12px;
  border-radius: 8px;
}

.top-nav a:hover {
  background: var(--blue-soft);
}

.hero {
  background:
    linear-gradient(120deg, rgba(0, 140, 255, 0.96), rgba(0, 119, 204, 0.9)),
    url("https://images.unsplash.com/photo-1560518883-ce09059eeffa?auto=format&fit=crop&w=1800&q=80") center/cover;
  color: var(--white);
  min-height: calc(100vh - 76px);
  display: flex;
  align-items: center;
  padding: 48px 0 72px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  color: var(--blue-strong);
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 850;
  margin: 0 0 8px;
}

.hero .eyebrow {
  color: var(--blue-soft);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(3rem, 8vw, 6.3rem);
  line-height: 0.95;
  margin-bottom: 22px;
  letter-spacing: 0;
  max-width: 760px;
}

h2 {
  color: var(--navy);
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
  margin-bottom: 0;
  letter-spacing: 0;
}

h3 {
  color: var(--navy);
  font-size: 1.05rem;
  line-height: 1.25;
  margin-bottom: 8px;
}

.hero-text {
  max-width: 650px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.18rem;
}

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

.button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 11px 16px;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button.primary {
  color: var(--white);
  background: var(--navy);
}

.button.secondary {
  color: var(--navy);
  background: var(--blue-soft);
}

.button.compact {
  min-height: 40px;
}

.phone-preview {
  min-height: 620px;
  border: 12px solid #02263c;
  border-radius: 36px;
  background: var(--white);
  color: var(--charcoal);
  padding: 22px;
  box-shadow: var(--shadow);
  display: grid;
  align-content: start;
  gap: 16px;
}

.phone-top {
  width: 92px;
  height: 7px;
  border-radius: 99px;
  background: #b5c7d6;
  justify-self: center;
  margin-bottom: 10px;
}

.mini-card {
  min-height: 310px;
  border-radius: 18px;
  padding: 18px;
  background:
    linear-gradient(to bottom, rgba(2, 50, 79, 0.03), rgba(2, 50, 79, 0.7)),
    url("https://images.unsplash.com/photo-1568605114967-8130f3a36994?auto=format&fit=crop&w=900&q=80") center/cover;
  color: var(--white);
  display: grid;
  align-content: end;
  position: relative;
}

.mini-card h2 {
  color: var(--white);
  font-size: 1.55rem;
}

.status-pill,
.rank-badge {
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 850;
  padding: 7px 10px;
}

.status-pill {
  position: absolute;
  top: 16px;
  left: 16px;
}

.score-ring {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--blue);
  display: grid;
  place-items: center;
  font-weight: 900;
  border: 3px solid rgba(255, 255, 255, 0.7);
}

.mini-list,
.mini-note {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--surface);
}

.mini-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
  color: var(--navy);
  font-weight: 850;
}

.mini-note {
  color: var(--muted);
  font-weight: 650;
}

.workspace,
.agent-dashboard {
  padding: 76px 0;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 28px;
}

.buyer-select {
  display: grid;
  gap: 6px;
  color: var(--navy);
  font-weight: 850;
  min-width: 250px;
}

select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--charcoal);
}

select {
  min-height: 42px;
  padding: 0 12px;
}

input {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  width: 100%;
  padding: 12px;
  resize: vertical;
}

.buyer-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.lookup-bar {
  display: grid;
  gap: 8px;
  color: var(--navy);
  font-weight: 850;
  margin-bottom: 22px;
}

.lookup-bar div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.preference-panel,
.activity-panel,
.metric-card,
.home-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 10px 28px rgba(2, 50, 79, 0.06);
  min-width: 0;
}

.preference-panel {
  padding: 22px;
  position: sticky;
  top: 16px;
}

.preference-panel dl {
  margin: 0;
  display: grid;
  gap: 18px;
}

.preference-panel dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
  text-transform: uppercase;
}

.preference-panel dd {
  color: var(--navy);
  font-weight: 800;
  margin: 4px 0 0;
}

.tag-list,
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag,
.fact {
  background: var(--blue-soft);
  color: var(--navy);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.chip {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--navy);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 850;
  cursor: pointer;
}

.chip.active {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

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

.home-card {
  overflow: hidden;
}

.listing-card .match-score {
  background: var(--green);
}

.listing-remarks {
  color: var(--muted);
  font-weight: 650;
  margin: 14px 0;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.image-wrap {
  aspect-ratio: 16 / 10;
  position: relative;
  overflow: hidden;
}

.image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rank-badge {
  position: absolute;
  top: 12px;
  left: 12px;
}

.home-content {
  padding: 18px;
}

.home-title-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.match-score {
  background: var(--navy);
  color: var(--white);
  border-radius: 8px;
  padding: 7px 9px;
  font-weight: 900;
  min-width: 54px;
  text-align: center;
}

.meta {
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 12px;
}

.fact {
  background: var(--surface);
}

.rating-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}

.rating-control {
  display: grid;
  gap: 6px;
  font-weight: 850;
  color: var(--navy);
}

.compact-label {
  display: grid;
  gap: 6px;
  color: var(--navy);
  font-weight: 850;
  margin-bottom: 14px;
}

.compare-band {
  background: var(--surface);
  padding: 72px 0;
  border-block: 1px solid var(--line);
}

.maps-panel {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 18px;
  align-items: stretch;
}

.map-status,
.map-card,
.route-stop {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 10px 28px rgba(2, 50, 79, 0.06);
}

.map-card {
  overflow: hidden;
  min-height: 320px;
}

.google-map {
  min-height: 260px;
  width: 100%;
  background: linear-gradient(135deg, var(--blue-soft), #ffffff);
}

.map-placeholder {
  min-height: 260px;
  display: grid;
  place-items: center;
  color: var(--navy);
  font-weight: 900;
  text-align: center;
  padding: 18px;
}

.map-status {
  padding: 22px;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: start;
}

.map-status strong,
.route-stop strong {
  color: var(--navy);
}

.map-status p,
.route-stop p,
.map-helper,
.helper-text {
  color: var(--muted);
  margin: 6px 0 0;
  font-weight: 650;
}

.map-helper {
  padding: 14px 16px 16px;
}

.map-pin {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: var(--white);
  font-weight: 950;
}

.route-list {
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
}

.route-stop {
  padding: 14px;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
}

.route-stop span {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--navy);
  display: grid;
  place-items: center;
  font-weight: 950;
}

.comparison-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.comparison-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.comparison-table th {
  color: var(--navy);
  background: var(--blue-soft);
}

.comparison-table tr:last-child td {
  border-bottom: 0;
}

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

.metric-card {
  padding: 18px;
}

.metric-card span {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.82rem;
}

.metric-card strong {
  display: block;
  color: var(--navy);
  font-size: 2rem;
  line-height: 1;
  margin-top: 10px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.agent-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-bottom: 22px;
}

.activity-panel {
  padding: 22px;
}

.stacked-form,
.action-stack {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.stacked-form input,
.stacked-form textarea,
.stacked-form select,
.action-stack select {
  width: 100%;
  min-width: 0;
}

.stacked-form label,
.action-stack label {
  display: grid;
  gap: 6px;
  color: var(--navy);
  font-weight: 850;
}

.pipeline-item,
.feedback-item {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}

.pipeline-item:first-child,
.feedback-item:first-child {
  border-top: 0;
}

.pipeline-item p,
.feedback-item p {
  color: var(--muted);
  margin-bottom: 10px;
}

.service-links {
  display: grid;
  gap: 12px;
}

.service-link {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.service-link:first-child {
  border-top: 0;
  padding-top: 0;
}

.service-link strong {
  color: var(--navy);
}

.service-link p,
.itinerary-copy {
  color: var(--muted);
  margin: 4px 0 0;
  font-weight: 650;
}

.signal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

dialog {
  border: 0;
  padding: 0;
  border-radius: 12px;
  width: min(560px, calc(100% - 28px));
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(2, 50, 79, 0.42);
}

.dialog-card {
  padding: 24px;
  display: grid;
  gap: 16px;
  position: relative;
}

.dialog-card label {
  display: grid;
  gap: 8px;
  font-weight: 850;
  color: var(--navy);
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--navy);
  font-size: 1.5rem;
  cursor: pointer;
}

.close-dialog {
  position: absolute;
  right: 14px;
  top: 14px;
}

@media (max-width: 900px) {
  .app-header,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav {
    width: 100%;
  }

  .top-nav a {
    padding-inline: 8px;
  }

  .hero {
    min-height: auto;
    padding-top: 36px;
  }

  .hero-grid,
  .buyer-layout,
  .maps-panel,
  .agent-tools,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .phone-preview {
    min-height: 520px;
    max-width: 380px;
    width: 100%;
    justify-self: center;
  }

  .preference-panel {
    position: static;
  }

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

  .buyer-select {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: min(100% - 20px, 1160px);
  }

  .brand strong {
    font-size: 1.1rem;
  }

  .logo-mark {
    width: 42px;
    height: 42px;
  }

  .hero-actions,
  .card-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .lookup-bar div {
    grid-template-columns: 1fr;
  }

  .service-link {
    grid-template-columns: 1fr;
  }

  .mini-list,
  .rating-row {
    grid-template-columns: 1fr;
  }

  .comparison-table {
    min-width: 0;
    display: block;
  }

  .comparison-table thead,
  .comparison-table tbody,
  .comparison-table tr,
  .comparison-table th,
  .comparison-table td {
    display: block;
    width: 100%;
  }

  .comparison-table thead {
    display: none;
  }

  .comparison-table tr {
    border-bottom: 1px solid var(--line);
  }

  .comparison-table td {
    border-bottom: 0;
    padding: 12px 14px;
  }

  .comparison-table td:first-child {
    background: var(--blue-soft);
    color: var(--navy);
  }

  .workspace,
  .agent-dashboard {
    padding: 54px 0;
  }
}
