:root {
  color-scheme: light;
  --ink: #172522;
  --muted: #5f6f6a;
  --line: #dfe7e4;
  --surface: #ffffff;
  --soft: #f5f8f3;
  --brand: #1b5b61;
  --brand-2: #f16f45;
  --accent: #f4bf4f;
  --ok: #2f7f55;
  --shadow: 0 18px 50px rgba(23, 37, 34, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

button,
a.primary-action,
a.secondary-action {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(16px, 4vw, 52px);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: #fff;
  background: var(--brand);
  border-radius: 8px;
  font-weight: 900;
}

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

h1 {
  margin-bottom: 2px;
  font-size: 1.1rem;
}

.brand p,
.note,
.form-message,
.import-box p,
.map-shell,
.pet-meta,
.transporter-card p {
  color: var(--muted);
}

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

.top-nav a {
  color: var(--ink);
  padding: 9px 12px;
  text-decoration: none;
  border-radius: 8px;
}

.top-nav a:hover {
  background: #edf3f1;
}

.hero {
  min-height: 570px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: end;
  gap: 28px;
  padding: 74px clamp(16px, 4vw, 52px) 34px;
  background:
    linear-gradient(90deg, rgba(14, 29, 27, 0.88), rgba(14, 29, 27, 0.35)),
    url("https://images.unsplash.com/photo-1601758124510-52d02ddb7cbd?auto=format&fit=crop&w=1800&q=82") center 34% / cover;
  color: #fff;
}

.hero-copy {
  max-width: 790px;
  padding-bottom: 24px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--brand-2);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.hero h2 {
  margin-bottom: 16px;
  font-size: clamp(2.5rem, 7vw, 5.7rem);
  line-height: 0.96;
  max-width: 920px;
}

.hero-copy p:not(.eyebrow) {
  max-width: 650px;
  font-size: 1.12rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 18px;
}

.primary-action {
  color: #fff;
  background: var(--brand-2);
}

.secondary-action {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.hero-panel {
  display: grid;
  gap: 12px;
  padding-bottom: 24px;
}

.hero-panel div {
  padding: 18px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  backdrop-filter: blur(14px);
}

.hero-panel span {
  display: block;
  margin-bottom: 5px;
  opacity: 0.82;
}

.badge-guide {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  padding: 24px clamp(16px, 4vw, 52px);
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.badge-guide h3 {
  margin-bottom: 0;
  font-size: 1.45rem;
}

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

.badge-guide-grid article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfa;
}

.badge-guide-grid strong {
  display: block;
  margin: 10px 0 5px;
}

.badge-guide-grid p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.loyalty-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.loyalty-badge.none {
  color: var(--muted);
  background: #eef3f1;
  border-color: #d9e3df;
}

.loyalty-badge.silver {
  color: #35414b;
  background: #edf1f4;
  border-color: #b9c2c9;
}

.loyalty-badge.gold {
  color: #6b4a05;
  background: #fff1bc;
  border-color: #e4bf42;
}

.loyalty-badge.platinum {
  color: #214c5a;
  background: #e4f5f8;
  border-color: #8ecad6;
}

.workspace {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 20px;
  padding: 22px clamp(16px, 4vw, 52px) 52px;
}

.sidebar {
  display: grid;
  align-content: start;
  gap: 18px;
}

.profile-card,
.notification-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.profile-card,
.notification-card {
  padding: 18px;
}

.profile-card img {
  width: 86px;
  height: 86px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
}

label,
legend {
  display: grid;
  gap: 7px;
  font-size: 0.9rem;
  font-weight: 800;
}

fieldset {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

fieldset label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cad8d4;
  border-radius: 8px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.note {
  margin: 12px 0 0;
  font-size: 0.84rem;
  line-height: 1.5;
}

.content {
  display: grid;
  gap: 20px;
}

.panel {
  padding: 20px;
  scroll-margin-top: 88px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading h3 {
  margin-bottom: 0;
  font-size: 1.45rem;
}

.section-heading span,
#distanceBadge {
  padding: 7px 10px;
  color: var(--brand);
  background: #e8f2ef;
  border-radius: 8px;
  font-weight: 900;
  white-space: nowrap;
}

.filters {
  display: flex;
  gap: 10px;
  width: min(420px, 100%);
}

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

.pet-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.pet-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.pet-body {
  padding: 14px;
}

.pet-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.pet-title h4 {
  margin: 0;
  font-size: 1.02rem;
}

.pet-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.pet-detail-grid div {
  min-width: 0;
  padding: 9px;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.pet-detail-grid span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.pet-detail-grid strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 0.88rem;
}

.price {
  color: var(--brand);
  font-weight: 950;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.badge {
  padding: 5px 8px;
  background: #f2f5f4;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 850;
}

.badge.payout-ready {
  color: #1d6040;
  background: #e7f6ec;
}

.badge.payout-needed {
  color: #8a3a21;
  background: #fff0e8;
}

.pet-actions,
.transporter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.pet-actions button,
.transporter-actions button,
.listing-form button,
#registerProfile,
#connectStripe,
#requestTransport,
#importDemo,
#confirmPurchase {
  min-height: 42px;
  padding: 0 12px;
  color: #fff;
  background: var(--brand);
}

.pet-actions button:first-child,
#confirmPurchase,
#requestTransport,
#connectStripe {
  background: var(--brand-2);
}

.map-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.map-shell svg {
  width: 100%;
  display: block;
  background: #eef4f1;
}

.map-shell text {
  fill: var(--ink);
  font-size: 20px;
  font-weight: 900;
}

#mapDetails {
  padding: 14px;
  background: #fff;
}

.listing-form {
  display: grid;
  gap: 14px;
}

.subsection-title {
  padding-top: 2px;
  color: var(--brand);
  font-size: 0.9rem;
  font-weight: 950;
}

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

.form-row.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.registry-box {
  display: grid;
  grid-template-columns: auto auto minmax(220px, 1fr);
  align-items: end;
  gap: 12px;
  margin: 0;
}

.registry-box label {
  margin-top: 0;
}

.form-message {
  min-height: 22px;
  margin-bottom: 0;
  font-weight: 750;
}

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

.transporter-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 13px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.transporter-card img {
  width: 86px;
  height: 86px;
  object-fit: cover;
  border-radius: 8px;
}

.transporter-card h4,
.transporter-card p {
  margin: 0 0 6px;
}

#notifications,
#registeredProfiles,
#importQueue {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

#notifications li,
#registeredProfiles li,
#importQueue li {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafcfb;
  font-size: 0.88rem;
  line-height: 1.45;
}

.quote-box {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.quote-route {
  padding: 8px 10px;
  color: var(--ink);
  background: #fff8eb;
  border: 1px solid #f5dba4;
  border-radius: 8px;
}

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

.quote-metric {
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.quote-metric span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.quote-metric strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.import-box {
  display: grid;
  gap: 14px;
}

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

.policy-grid article {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfa;
}

.policy-grid h4 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.policy-grid p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

dialog {
  width: min(520px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(12, 22, 21, 0.55);
}

.checkout {
  position: relative;
  display: grid;
  gap: 13px;
  padding: 22px;
}

.checkout-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.icon-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  color: var(--ink);
  background: #edf3f1;
}

@media (max-width: 1040px) {
  .hero,
  .badge-guide,
  .workspace {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 640px;
  }

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

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

  .badge-guide-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    min-height: 680px;
    padding-top: 52px;
  }

  .hero h2 {
    font-size: 2.55rem;
  }

  .sidebar,
  .pet-grid,
  .transporter-list,
  .policy-grid,
  .form-row,
  .form-row.two-col,
  .pet-detail-grid,
  .quote-grid,
  .registry-box {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .filters,
  .pet-actions {
    width: 100%;
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}
