/*
 * Qaz.pet visual finish – 2026-08-02
 *
 * This is the last public cascade layer. The repository still contains a
 * large legacy style bridge, so the selectors below intentionally use the
 * page surface as an anchor: they restore the shared AV DS geometry without
 * rewriting domain markup or competing with the public data contracts.
 */

:root {
  --finish-radius-sm: 10px;
  --finish-radius-md: 14px;
  --finish-radius-lg: 18px;
  --finish-line: color-mix(in srgb, var(--border-light) 82%, var(--accent-light));
  --finish-surface-soft: color-mix(in srgb, var(--surface) 94%, var(--accent-light));
  --finish-surface-raised: color-mix(in srgb, var(--surface) 98%, var(--accent-light));
}

/* Home task frame: a direct adoption task plus a compact list of real routes. */
.catalog-page .home-task-intro {
  display: grid;
  grid-template-areas:
    "copy visual"
    "metrics metrics";
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: var(--qpet-space-task-section);
  align-items: center;
  padding: var(--qpet-space-task-section);
}

.catalog-page .home-task-copy {
  display: grid;
  grid-area: copy;
  gap: var(--qpet-space-task-inline);
  align-content: center;
  min-width: 0;
}

.catalog-page .home-task-copy .avds-copy {
  margin: 0;
}

.catalog-page .home-task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--qpet-space-task-inline);
  padding-top: 4px;
}

.catalog-page .home-task-intro .home-hero-visual {
  grid-area: visual;
  min-height: 0;
  margin: 0;
}

.catalog-page .home-task-intro .avds-metric-strip {
  grid-area: metrics;
}

.catalog-page .home-route-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: var(--qpet-space-task-block);
  border-block: 1px solid var(--border-light);
}

.catalog-page .home-route-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--qpet-space-task-inline);
  align-items: start;
  min-height: 108px;
  padding: var(--qpet-space-task-block);
  color: var(--product-ink);
  text-decoration: none;
}

.catalog-page .home-route-link + .home-route-link {
  border-inline-start: 1px solid var(--border-light);
}

.catalog-page .home-route-link:hover,
.catalog-page .home-route-link:focus-visible {
  background: var(--accent-light);
}

.catalog-page .home-route-link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.catalog-page .home-route-icon {
  display: inline-flex;
  color: var(--accent);
}

.catalog-page .home-route-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.catalog-page .home-route-copy strong {
  font-size: 0.96rem;
  line-height: 1.25;
}

.catalog-page .home-route-copy span {
  color: var(--muted-foreground);
  font-size: 0.82rem;
  line-height: 1.45;
}

.catalog-page .catalog-empty-state .product-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--qpet-space-task-inline);
}

@media (max-width: 760px) {
  .catalog-page .home-task-intro {
    grid-template-areas:
      "copy"
      "visual"
      "metrics";
    grid-template-columns: minmax(0, 1fr);
    gap: var(--qpet-space-task-block);
    padding: var(--qpet-space-task-block) var(--qpet-space-task-inline);
  }

  .catalog-page .home-task-intro .avds-title {
    font-size: 1.82rem;
    line-height: 1.08;
  }

  .catalog-page .home-route-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .catalog-page .home-route-link {
    min-height: 0;
    padding: var(--qpet-space-task-inline) 0;
  }

  .catalog-page .home-route-link + .home-route-link {
    border-top: 1px solid var(--border-light);
    border-inline-start: 0;
  }

  .catalog-page .home-route-link:hover,
  .catalog-page .home-route-link:focus-visible {
    background: transparent;
  }
}

html {
  color-scheme: light;
}

body {
  color: var(--product-ink);
  background:
    radial-gradient(circle at 50% -12%, hsl(38 42% 100% / 0.9), transparent 38%),
    linear-gradient(180deg, hsl(38 38% 98%) 0, hsl(var(--background)) 440px),
    hsl(var(--background));
}

::selection {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  color: var(--text);
}

/* The page-level hero was being flattened by the historical style bridge.
   Keep the home hero media-led, but give every other SSR hero one reliable
   reading surface and enough air around its first line. */
.avds-page-band .avds-hero:not(.avds-hero--home) {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  padding: 32px 36px;
  overflow: hidden;
  border: 1px solid var(--finish-line);
  border-radius: var(--finish-radius-lg);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 96%, var(--accent-light)), var(--surface) 72%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}

.avds-page-band .avds-hero:not(.avds-hero--home):has(.avds-metric-strip) {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 388px);
}

.avds-page-band .avds-hero:not(.avds-hero--home):has(> .badge) {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.avds-page-band .avds-hero:not(.avds-hero--home)::before {
  width: 4px;
  border-radius: 0 var(--finish-radius-sm) var(--finish-radius-sm) 0;
}

.avds-page-band .avds-hero:not(.avds-hero--home) .avds-hero-copy {
  align-self: center;
  min-width: 0;
  padding: 0;
}

.avds-page-band .avds-hero:not(.avds-hero--home) .avds-title {
  max-width: 22ch;
  color: var(--product-ink);
  font-size: clamp(2.25rem, 3.4vw, 3rem);
  font-weight: 780;
  letter-spacing: -0.035em;
  line-height: 1.02;
  text-wrap: balance;
}

.avds-page-band .avds-hero:not(.avds-hero--home) .avds-copy {
  max-width: 64ch;
  color: var(--text-secondary);
  line-height: 1.6;
}

.avds-page-band .avds-hero:not(.avds-hero--home) .avds-actions {
  gap: 10px;
  margin-top: 2px;
}

.avds-page-band .avds-hero:not(.avds-hero--home) .avds-metric-strip {
  width: 100%;
  /* Status rails should follow their content, not create a tall empty column. */
  align-self: start;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--finish-line);
  border-radius: 12px;
  background: var(--finish-line);
}

.avds-page-band .avds-hero:not(.avds-hero--home) .avds-metric {
  min-height: 86px;
  padding: 16px 18px;
  background: var(--finish-surface-raised);
}

.avds-page-band .avds-hero:not(.avds-hero--home) .avds-metric-value {
  color: var(--product-ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.avds-page-band .avds-hero:not(.avds-hero--home) .avds-metric-label {
  color: var(--text-secondary);
  line-height: 1.35;
}

.catalog-page .avds-hero--home {
  overflow: hidden;
  border: 1px solid var(--finish-line);
  border-radius: var(--finish-radius-lg);
  box-shadow: var(--shadow-md);
}

.catalog-page .avds-hero--home .home-hero-visual {
  background: color-mix(in srgb, var(--accent-light) 54%, var(--surface));
}

.catalog-page .avds-hero--home .avds-metric-value {
  font-variant-numeric: tabular-nums;
}

/* The shared media placeholder now uses the AV DS icon adapter. Keep the
   animal detail visual legible without letting a fallback become a large
   decorative illustration or create a new empty vertical band. */
.animal-page .gallery-placeholder .ui-icon {
  width: 84px;
  height: 84px;
  color: hsl(30 15% 56%);
  opacity: 0.68;
}

/* Small semantic accents keep the page family legible without introducing a
   second design system. */
.lostfound-page .avds-page-band .avds-hero::before,
.lostfound-page .avds-page-band .avds-hero:not(.avds-hero--home)::before {
  background: linear-gradient(180deg, var(--product-sky), hsl(202 50% 62%));
}

.shelters-page .avds-page-band .avds-hero::before,
.rehoming-page .avds-page-band .avds-hero::before {
  background: linear-gradient(180deg, var(--product-sage), hsl(151 35% 55%));
}

.partners-page .avds-page-band .avds-hero::before {
  background: linear-gradient(180deg, var(--product-violet), hsl(257 48% 68%));
}

.tools-page .avds-page-band .avds-hero::before {
  background: linear-gradient(180deg, var(--product-sky), hsl(202 54% 66%));
}

.urgent-page .avds-page-band .avds-hero::before {
  background: var(--danger);
}

/* Shared interaction finish. */
.btn {
  min-height: 42px;
  border-radius: var(--finish-radius-sm);
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.btn--sm {
  min-height: 38px;
}

.btn:not(:disabled):active,
.chip:not(:disabled):active,
.nav-link:active,
.mobile-nav-link:active {
  transform: translateY(1px);
}

.btn--outline,
.btn--ghost {
  border-color: color-mix(in srgb, var(--accent) 24%, var(--border-light));
}

.btn--outline:hover,
.btn--ghost:hover {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--border-light));
  box-shadow: 0 5px 16px hsl(32 90% 32% / 0.08);
}

.chip {
  min-height: 36px;
  border-radius: 999px;
  font-weight: 650;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.chip:hover:not(.chip--active) {
  background: color-mix(in srgb, var(--accent-light) 54%, var(--surface));
  box-shadow: 0 4px 12px hsl(32 90% 32% / 0.06);
}

.badge {
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  line-height: 1.15;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid hsl(var(--ring) / 0.52);
  outline-offset: 3px;
}

@media (max-width: 768px) {
  /* Keep the rotating filter chevron inside the 390px edge during motion. */
  .filters-toggle {
    padding-right: 4px;
  }
}

/* Content surfaces: enough depth to orient the eye, while long editorial
   sections remain open and avoid a stack of nested cards. */
.catalog-page .avds-utility-card,
.shelter-trust-strip,
.lostfound-first-steps,
.report-form-section > .avds-shell,
.partners-lead-section .avds-section-shell,
.tools-page .tools-workflow.avds-section-shell,
.tools-page .tools-source-panel,
.tools-page .tools-lab-stage,
.rehoming-content .rehoming-guidance.avds-section-shell,
.animal-page > .avds-section-shell,
.request-status-card,
.auth-card,
.lostfound-manage-card {
  border-radius: var(--finish-radius-md);
  box-shadow: var(--shadow-sm);
}

.catalog-page .avds-utility-card,
.shelter-trust-item,
.lostfound-step-card,
.partners-page .guide-req-card,
.tools-page .tools-grid .avds-utility-card,
.guide-page .guide-req-card,
.guide-page .guide-chip-card,
.guide-page .guide-health-card,
.guide-page .guide-event-card,
.shelter-card,
.lostfound-card,
.animal-card {
  border-radius: var(--finish-radius-md);
}

.catalog-page .avds-utility-card,
.shelter-trust-item,
.lostfound-step-card,
.partners-page .guide-req-card,
.tools-page .tools-grid .avds-utility-card,
.guide-page .guide-req-card,
.guide-page .guide-chip-card,
.guide-page .guide-health-card,
.guide-page .guide-event-card,
.shelter-card,
.lostfound-card {
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.catalog-page .avds-utility-card:hover,
.shelter-trust-item:hover,
.lostfound-step-card:hover,
.partners-page .guide-req-card:hover,
.tools-page .tools-grid .avds-utility-card:hover,
.guide-page .guide-req-card:hover,
.guide-page .guide-chip-card:hover,
.guide-page .guide-health-card:hover,
.guide-page .guide-event-card:hover,
.shelter-card:hover,
.lostfound-card:hover {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border-light));
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.animal-card:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border-light));
  box-shadow: var(--shadow-md);
}

.empty-state.avds-state-panel,
.lostfound-empty-workflow,
.catalog-readiness-note,
.form-status[data-state],
.report-form-summary {
  border-radius: var(--finish-radius-md);
}

/* The private rehoming management view is intentionally content-light, but
   its status and actions still need one clear surface to read as a product
   screen rather than loose text on the page background. */
.rehoming-manage-card {
  max-width: 920px;
  margin: 24px auto 56px;
  padding: 24px 28px 28px;
  border: 1px solid var(--finish-line);
  border-radius: var(--finish-radius-md);
  background: var(--finish-surface-raised);
  box-shadow: var(--shadow-sm);
}

.rehoming-manage-card .section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--finish-line);
}

.rehoming-manage-card .section-title,
.rehoming-manage-card .section-subtitle {
  margin: 0;
}

.rehoming-manage-card .section-subtitle {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border-light));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-light) 58%, var(--surface));
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 720;
  line-height: 1.2;
}

.rehoming-manage-card > .form-hint {
  margin: 16px 0 0;
}

.rehoming-manage-card .avds-actions {
  gap: 10px;
  margin-top: 18px;
}

.rehoming-manage-card .form-status {
  min-height: 0;
  margin-top: 14px;
}

.section-title {
  letter-spacing: -0.02em;
}

.section-subtitle,
.section-subtitle--catalog {
  color: var(--text-secondary);
}

/* Shelter names and direct contacts are real actions, not decorative inline
   text. Preserve the dense list while meeting the 24px minimum target size. */
.shelters-page .shelter-name-link,
.shelters-page .shelter-contact-link {
  min-height: 24px;
}

.shelters-page .shelter-name-link {
  display: inline-flex;
  align-items: center;
}

/* The verified status is a single semantic label, not a paragraph. Keep it
   intact inside the four-column shelter profile metric strip. */
.shelter-profile-metrics .avds-metric-value--label {
  max-width: 100%;
  font-size: clamp(1.0625rem, 1.4vw, 1.125rem);
  line-height: 1.08;
  overflow-wrap: normal;
  word-break: normal;
  white-space: nowrap;
  hyphens: none;
}

/* Form rhythm is shared by adoption, lost/found, QR and partner intake. */
.form-group {
  gap: 7px;
  margin-bottom: 18px;
}

.form-label {
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 720;
  letter-spacing: 0.01em;
}

.form-input,
.form-select,
.form-textarea,
.input,
.input--select {
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--border-light) 86%, var(--accent-light));
  border-radius: var(--finish-radius-sm);
  background: var(--surface);
  color: var(--text);
  box-shadow: inset 0 1px 1px hsl(216 19% 14% / 0.025);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover,
.input:hover,
.input--select:hover {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border-light));
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.input:focus,
.input--select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px hsl(32 90% 37% / 0.12), inset 0 1px 1px hsl(216 19% 14% / 0.025);
  outline: 0;
}

.radio-card-inner {
  border-radius: var(--finish-radius-md);
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.radio-card:hover .radio-card-inner {
  box-shadow: 0 6px 18px hsl(32 90% 32% / 0.08);
  transform: translateY(-1px);
}

.radio-card input:checked + .radio-card-inner {
  box-shadow: 0 0 0 3px hsl(32 90% 37% / 0.10), var(--shadow-sm);
}

.guide-content {
  max-width: 960px;
  margin-inline: auto;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--finish-line);
  border-radius: var(--finish-radius-md);
  background: var(--finish-surface-raised);
  box-shadow: var(--shadow-sm);
}

.guide-content h2 {
  margin-top: 28px;
  color: var(--product-ink);
  letter-spacing: -0.02em;
}

.guide-content h2:first-child {
  margin-top: 0;
}

.guide-content p {
  max-width: 72ch;
  color: var(--text-secondary);
  line-height: 1.72;
}

.guide-content a {
  color: var(--accent);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 32%, transparent);
  text-underline-offset: 3px;
}

.site-footer {
  border-top: 1px solid hsl(0 0% 100% / 0.06);
}

/* Dark mode used to inherit the light product ink and make metrics disappear
   on the dark card. Re-map the product tokens once, then let every component
   reuse the same readable values. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --product-ink: hsl(32 18% 91%);
  --product-sage: hsl(148 48% 62%);
  --product-sage-soft: hsl(148 24% 16%);
  --product-sky: hsl(202 60% 70%);
  --product-sky-soft: hsl(202 30% 16%);
  --product-coral: hsl(8 74% 70%);
  --product-coral-soft: hsl(8 26% 17%);
  --product-violet: hsl(257 68% 76%);
  --product-violet-soft: hsl(257 26% 17%);
  --finish-line: color-mix(in srgb, var(--border-light) 82%, var(--accent-light));
  --finish-surface-soft: color-mix(in srgb, var(--surface) 92%, var(--accent-light));
  --finish-surface-raised: color-mix(in srgb, var(--surface) 98%, var(--accent-light));
}

:root[data-theme="dark"] body {
  color: var(--product-ink);
  background:
    radial-gradient(circle at 50% -12%, hsl(39 28% 20% / 0.34), transparent 42%),
    linear-gradient(180deg, hsl(28 13% 10%) 0, hsl(var(--background)) 420px),
    hsl(var(--background));
}

:root[data-theme="dark"] .site-header .nav-link:not(.nav-link--urgent):not(.active),
:root[data-theme="dark"] .site-header .nav-more-btn:not(.active) {
  color: var(--text-secondary);
}

:root[data-theme="dark"] .site-header .nav-link:not(.nav-link--urgent):not(.active):hover,
:root[data-theme="dark"] .site-header .nav-more-btn:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 86%, var(--accent-light));
}

:root[data-theme="dark"] .site-header .nav-link.active:not(.nav-link--urgent),
:root[data-theme="dark"] .site-header .nav-more.open .nav-more-btn {
  color: var(--accent);
  background: var(--accent-light);
}

:root[data-theme="dark"] .avds-copy,
:root[data-theme="dark"] .section-subtitle,
:root[data-theme="dark"] .section-subtitle--catalog,
:root[data-theme="dark"] .avds-metric-label,
:root[data-theme="dark"] .form-label,
:root[data-theme="dark"] .guide-content p {
  color: var(--text-secondary);
}

:root[data-theme="dark"] .avds-page-band .avds-hero:not(.avds-hero--home),
:root[data-theme="dark"] .catalog-page .avds-hero--home,
:root[data-theme="dark"] .guide-content {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 94%, var(--accent-light)), var(--surface) 72%),
    var(--surface);
}

:root[data-theme="dark"] .avds-page-band .avds-hero:not(.avds-hero--home) .avds-metric,
:root[data-theme="dark"] .catalog-page .avds-hero--home .avds-metric {
  background: color-mix(in srgb, var(--surface) 98%, var(--accent-light));
}

:root[data-theme="dark"] .form-input,
:root[data-theme="dark"] .form-select,
:root[data-theme="dark"] .form-textarea,
:root[data-theme="dark"] .input,
:root[data-theme="dark"] .input--select {
  background: var(--surface);
  color: var(--text);
}

/* The tablet rail leaves a narrow content column at 720–900px. Keep the
   existing hero content order, but stack its reading surface and metrics so
   titles and actions never compete with a fixed 388px side panel. */
@media (min-width: 720px) and (max-width: 1040px) {
  .catalog-page .avds-hero--home {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 0;
    padding: 0;
  }

  .catalog-page .avds-hero--home .avds-hero-copy {
    grid-column: 1;
    grid-row: auto;
    padding: 34px 34px 30px;
  }

  .catalog-page .avds-hero--home .home-hero-visual {
    grid-column: 1;
    grid-row: auto;
    aspect-ratio: 16 / 9;
    min-height: 0;
    border-top: 1px solid var(--border-light);
  }

  .catalog-page .avds-hero--home .avds-metric-strip {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
  }

  .avds-page-band .avds-hero:not(.avds-hero--home),
  .avds-page-band .avds-hero:not(.avds-hero--home):has(.avds-metric-strip),
  .avds-page-band .avds-hero:not(.avds-hero--home):has(> .badge) {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .avds-page-band .avds-hero:not(.avds-hero--home) .avds-metric-strip {
    grid-column: 1;
  }

  .avds-page-band .avds-hero:not(.avds-hero--home) .avds-actions {
    flex-wrap: wrap;
  }

  /* Long ru/kk passport labels must use the tablet rail width instead of
     leaving the last tab clipped outside the reading column. Keep the
     mobile tab strip scrollable; only the wider tablet surface wraps. */
  .animal-page .passport-tabs {
    flex-wrap: wrap;
    overflow-x: visible;
    row-gap: 8px;
  }

  .animal-page .passport-tab {
    flex: 0 1 auto;
  }
}

/* Tablet/mobile shell: same geometry, less chrome. */
@media (max-width: 760px) {
  .avds-page-band {
    padding: 16px 0 10px;
  }

  .avds-page-band .avds-hero:not(.avds-hero--home),
  .avds-page-band .avds-hero:not(.avds-hero--home):has(.avds-metric-strip),
  .avds-page-band .avds-hero:not(.avds-hero--home):has(> .badge) {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
    border-radius: 16px;
  }

  .avds-page-band .avds-hero:not(.avds-hero--home) .avds-hero-copy {
    padding: 24px 20px 22px;
  }

  .avds-page-band .avds-hero:not(.avds-hero--home) .avds-title {
    max-width: none;
    font-size: clamp(1.84rem, 7.2vw, 2.15rem);
    line-height: 1.06;
  }

  .avds-page-band .avds-hero:not(.avds-hero--home) .avds-copy {
    font-size: 0.94rem;
  }

  .avds-page-band .avds-hero:not(.avds-hero--home) .avds-metric-strip {
    border: 0;
    border-top: 1px solid var(--finish-line);
    border-radius: 0;
  }

  .avds-page-band .avds-hero:not(.avds-hero--home) .avds-metric {
    min-height: 74px;
    padding: 13px 14px;
  }

  .catalog-page .avds-hero--home {
    border-radius: 16px;
  }

  .catalog-page .avds-utility-card,
  .shelter-trust-item,
  .lostfound-step-card,
  .partners-page .guide-req-card,
  .tools-page .tools-grid .avds-utility-card,
  .guide-page .guide-req-card,
  .guide-page .guide-chip-card,
  .guide-page .guide-health-card,
  .guide-page .guide-event-card,
  .shelter-card,
  .lostfound-card,
  .animal-card {
    transform: none;
  }

  .guide-content {
    padding: 22px 18px;
    border-radius: 14px;
  }

  .rehoming-manage-card {
    margin-block: 14px 40px;
    padding: 20px;
  }

  .rehoming-manage-card .section-heading {
    display: grid;
    gap: 10px;
  }

  .rehoming-manage-card .section-subtitle {
    justify-self: start;
  }

  .rehoming-manage-card .avds-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .site-footer {
    margin-top: 48px;
  }
}

@media (max-width: 420px) {
  .avds-page-band .avds-hero:not(.avds-hero--home) .avds-hero-copy {
    padding: 22px 16px 20px;
  }

  .catalog-page .avds-hero--home .avds-hero-copy {
    padding-inline: 16px;
  }
}

/* AV DS map/list composition: city-level, privacy-safe and keyboard-first. */
.shelter-map-list {
  margin-top: 28px;
}

.shelter-map-heading {
  align-items: flex-start;
}

.shelter-map-list-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 16px;
  align-items: stretch;
}

.shelter-map-panel,
.shelter-map-list-panel {
  min-width: 0;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.shelter-map-panel {
  padding: 14px;
}

.shelter-map-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 600;
}

.shelter-map-legend-item {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.shelter-map-legend-dot,
.shelter-map-item-status {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--map-pin);
}

.shelter-map-legend-dot--verified,
.shelter-map-item-status--verified {
  background: var(--success);
}

.shelter-map-canvas {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--map-route) 22%, var(--border-light));
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--map-water), hsl(var(--muted)));
}

.shelter-map-grid-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.shelter-map-pin {
  position: absolute;
  left: var(--map-pin-x);
  top: var(--map-pin-y);
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 2px solid var(--surface);
  border-radius: 50% 50% 50% 0;
  background: var(--map-pin);
  color: var(--surface);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  rotate: -45deg;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.shelter-map-pin span {
  transform: rotate(45deg);
  font-size: 0.7rem;
  font-weight: 800;
}

.shelter-map-pin--verified {
  background: var(--success);
}

.shelter-map-pin:hover,
.shelter-map-pin:focus-visible,
.shelter-map-pin.is-selected {
  transform: translate(-50%, -50%) scale(1.12);
  box-shadow: var(--shadow-lg);
}

.shelter-map-pin:focus-visible,
.shelter-map-item-button:focus-visible,
.shelter-map-item-link:focus-visible {
  outline: 3px solid hsl(var(--ring) / 0.82);
  outline-offset: 3px;
}

.shelter-map-disclaimer,
.shelter-map-unmapped {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.shelter-map-list-panel {
  display: flex;
  flex-direction: column;
  padding: 14px;
}

.shelter-map-list-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.shelter-map-list-heading h3 {
  margin: 0;
  font-size: 1rem;
}

.shelter-map-items {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.shelter-map-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: hsl(var(--muted));
}

.shelter-map-item.is-selected {
  border-color: var(--map-route);
  background: color-mix(in srgb, var(--map-water) 45%, var(--surface));
}

.shelter-map-item-button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 9px;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.shelter-map-item-index {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--map-route);
  color: var(--surface);
  font-size: 0.7rem;
  font-weight: 800;
}

.shelter-map-item-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.shelter-map-item-copy strong,
.shelter-map-item-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shelter-map-item-copy strong {
  font-size: 0.82rem;
}

.shelter-map-item-copy span {
  color: var(--text-secondary);
  font-size: 0.72rem;
}

.shelter-map-item-link {
  grid-column: 2;
  justify-self: end;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
}

.shelter-map-empty {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 22px;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-lg);
  background: hsl(var(--muted));
}

.shelter-map-empty h3,
.shelter-map-empty p {
  margin: 0;
}

.shelter-map-empty p {
  max-width: 68ch;
  color: var(--text-secondary);
}

@media (max-width: 900px) {
  .shelter-map-list-grid {
    grid-template-columns: 1fr;
  }

  .shelter-map-canvas {
    min-height: 300px;
  }
}

@media (max-width: 560px) {
  .shelter-map-panel,
  .shelter-map-list-panel {
    padding: 11px;
  }

  .shelter-map-canvas {
    min-height: 230px;
  }

  .shelter-map-pin {
    width: 25px;
    height: 25px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shelter-map-pin {
    transition: none;
  }
}

@media (max-width: 480px) {
  /* style.css used -14px against a 12px mobile gutter, producing a 2px
     horizontal overflow on the public animal detail route. Keep the image
     edge-to-edge while matching the actual gutter. */
  .animal-page .gallery-main {
    width: calc(100% + 24px);
    margin-inline: -12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .chip,
  .catalog-page .avds-utility-card,
  .shelter-trust-item,
  .lostfound-step-card,
  .partners-page .guide-req-card,
  .tools-page .tools-grid .avds-utility-card,
  .guide-page .guide-req-card,
  .guide-page .guide-chip-card,
  .guide-page .guide-health-card,
  .guide-page .guide-event-card,
  .shelter-card,
  .lostfound-card,
  .animal-card,
  .radio-card-inner {
    transition: none;
  }
}

/* Composition density pass: keep the finished surfaces, but remove the
   accidental breathing room that made short pages and empty states feel
   detached from the rest of the product. */
.avds-page-band .avds-hero:not(.avds-hero--home) {
  gap: 24px;
  padding: 24px 28px;
}

main > .avds-page-band,
.catalog-page .avds-page-band,
.lostfound-page .avds-page-band,
.shelters-page .avds-page-band,
.rehoming-page .avds-page-band,
.guide-page .avds-page-band,
.partners-page .avds-page-band,
.tools-page .avds-page-band,
.urgent-page .avds-page-band,
.avds-page-band.favorites-page {
  padding-block: 20px 16px;
}

.site-footer {
  margin-top: 32px;
}

.swipe-page--empty .swipe-arena {
  align-items: start;
  min-height: 0;
  padding-bottom: 24px;
}

.swipe-page--empty .swipe-empty-shell.avds-section-shell {
  height: auto;
}

.favorites-results-shell.favorites-results--empty {
  min-height: 220px;
}

@media (max-width: 760px) {
  main > .avds-page-band,
  .catalog-page .avds-page-band,
  .lostfound-page .avds-page-band,
  .shelters-page .avds-page-band,
  .rehoming-page .avds-page-band,
  .guide-page .avds-page-band,
  .partners-page .avds-page-band,
  .tools-page .avds-page-band,
  .urgent-page .avds-page-band,
  .avds-page-band.favorites-page {
    padding-block: 16px 10px;
  }

  .avds-page-band .avds-hero:not(.avds-hero--home) {
    gap: 0;
    padding: 0;
  }

  .site-footer {
    margin-top: 24px;
  }

  .swipe-page--empty .swipe-arena {
    padding-bottom: 20px;
  }

  .favorites-results-shell.favorites-results--empty {
    min-height: 200px;
  }
}

/* The full route audit found three remaining composition outliers: the
   adoption grid stretched its compact unavailable state to the preview
   height, the first veterinary message sat in a 360px empty well, and the
   animal detail kept two columns after the application rail had already
   narrowed the working area to tablet width. */
.adopt-layout {
  align-items: start;
}

.chat-messages {
  min-height: 240px;
}

@media (max-width: 900px) {
  .animal-detail {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .animal-gallery {
    position: static;
  }
}

@media (max-width: 768px) {
  .chat-messages {
    min-height: 220px;
  }
}

/* Homepage density pass: keep the AV DS hero, metrics, filters and cards
   information-rich without reserving decorative empty height. */
.catalog-page .avds-hero--home {
  gap: 0;
  grid-template-rows: minmax(220px, auto) auto;
  padding: 0;
}

.catalog-page .avds-hero--home .avds-metric-strip {
  align-self: stretch;
}

.catalog-page .avds-hero--home .avds-hero-copy {
  padding: 36px;
}

.catalog-page .avds-hero--home .avds-title {
  font-size: 2.7rem;
}

.catalog-page .avds-hero--home .home-hero-visual {
  min-height: 260px;
  aspect-ratio: 2.1 / 1;
}

.catalog-page .avds-hero--home .avds-metric {
  min-height: 68px;
  padding: 10px 14px;
}

.catalog-page .avds-hero--home .avds-metric-value {
  line-height: 1;
}

.catalog-page .avds-utility-card {
  grid-template-columns: 36px minmax(0, 1fr);
  min-height: 0;
  padding: 14px;
}

.catalog-page .avds-utility-card h2 {
  font-size: 0.95rem;
}

.catalog-page .avds-utility-card p {
  margin: 8px 0 10px;
  font-size: 0.82rem;
  line-height: 1.42;
}

.catalog-page .avds-utility-card .btn {
  min-height: 34px;
  padding: 5px 10px;
  font-size: 0.78rem;
}

.catalog-page .home-utility-icon {
  width: 36px;
  height: 36px;
}

.catalog-page .filters-section {
  padding: 8px 0;
}

.catalog-page .filters-form {
  gap: 8px 18px;
}

.catalog-page .filter-label {
  line-height: 1.2;
}

.catalog-page .filters-section .chip,
.catalog-page .filters-section .filter-select {
  min-height: 32px;
  padding: 5px 10px;
}

.catalog-page .animals-section {
  padding: 24px 0 40px;
}

.catalog-page .animals-section .section-header {
  padding-top: 16px;
}

.catalog-page .catalog-readiness-note {
  gap: 10px;
  margin-bottom: 18px;
  padding: 10px 14px;
}

.catalog-page .catalog-readiness-note__icon {
  width: 30px;
  height: 30px;
}

.catalog-page .catalog-readiness-note__copy strong {
  font-size: 0.87rem;
}

.catalog-page .catalog-readiness-note__copy span {
  font-size: 0.8rem;
  line-height: 1.35;
}

.catalog-page .catalog-readiness-note .btn {
  min-height: 34px;
}

.catalog-page .animals-grid {
  gap: 14px;
}

.catalog-page .pagination {
  margin-top: 16px;
  padding-top: 20px;
}

@media (min-width: 720px) and (max-width: 1040px) {
  .catalog-page .avds-hero--home .avds-hero-copy {
    padding: 30px 30px 26px;
  }

  .catalog-page .avds-hero--home .home-hero-visual {
    min-height: 0;
    aspect-ratio: 2.05 / 1;
  }
}

@media (max-width: 760px) {
  .catalog-page .avds-hero--home .avds-hero-copy {
    padding: 22px 16px 20px;
  }

  .catalog-page .avds-hero--home .avds-title {
    font-size: 1.82rem;
    line-height: 1.08;
  }

  .catalog-page .avds-hero--home .home-hero-visual {
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .catalog-page .avds-hero--home .avds-metric {
    min-height: 64px;
    padding: 10px 12px;
  }

  .catalog-page .avds-utility-card {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    padding: 11px 12px;
  }

  .catalog-page .home-utility-icon {
    width: 34px;
    height: 34px;
  }

  .catalog-page .avds-utility-card p {
    margin: 4px 0 0;
    font-size: 0.78rem;
    line-height: 1.35;
  }

  .catalog-page .avds-utility-card .btn {
    min-height: 32px;
  }

  .catalog-page .animals-section {
    padding: 20px 0 32px;
  }

  .catalog-page .animals-section .section-header {
    padding-top: 14px;
  }

  .catalog-page .section-title {
    font-size: 1.45rem;
  }
}

@media (max-width: 420px) {
  .catalog-page .avds-utility-card {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .catalog-page .avds-utility-card .btn {
    min-height: 32px;
    margin-top: 6px;
  }
}
