/* Every value from design-system/vicaya-pets/MASTER.md. Change the look there first, then here. */
:root {
  --color-primary: #0d9488;
  --color-secondary: #14b8a6;
  --color-accent: #be123c;
  --color-background: #f0fdfa;
  --color-foreground: #134e4a;
  --color-card: #ffffff;
  --color-card-foreground: #134e4a;
  --color-muted: #e8f1f4;
  --color-muted-foreground: #475569;
  --color-border: #99f6e4;
  --color-destructive: #dc2626;
  --color-on-destructive: #ffffff;
  --color-ring: #0d9488;
  --color-cta: #0f766e;
  --color-cta-hover: #115e59;
  --color-on-cta: #ffffff;
  --font-heading: 'Varela Round', 'Nunito Sans', sans-serif;
  --font-body: 'Nunito Sans', system-ui, sans-serif;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --radius-card: 16px;
  --radius-button: 12px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  font-size: 16px;
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-foreground);
  background: var(--color-background);
}
h1,
h2,
h3 {
  font-family: var(--font-heading);
  line-height: 1.2;
  margin: 0 0 var(--space-sm);
}
h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}
h2 {
  font-size: 1.375rem;
}
a {
  color: var(--color-cta);
}
/* Hidden above the viewport, never to the left: the mobile gate reads horizontal overflow. */
.skip-link {
  position: absolute;
  left: var(--space-md);
  top: -4rem;
  z-index: 100;
  background: var(--color-card);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-button);
}
.skip-link:focus {
  top: var(--space-md);
  outline: 3px solid var(--color-ring);
}
/* One header row on every width (UX audit 2026-10-19, C-3 / UX05): brand, then the subject links on
   wide screens or a "More subjects" menu on narrow ones, then site search. Same geometry as the host
   header: a single 3.5rem row on phones, 4rem on wider screens, 2px focus outline offset 2px. */
.pets-header {
  position: relative;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-card);
}
.pets-header-inner,
.pets-main,
.pets-footer-inner {
  max-width: 60rem;
  margin: 0 auto;
  padding: var(--space-md);
}
.pets-header-inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-sm) var(--space-md);
  min-height: 4rem;
  padding-block: 0;
}
.pets-brand {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--color-foreground);
}
.pets-brand-mark {
  color: var(--color-primary);
  display: inline-flex;
}
.pets-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-md);
  min-width: 0;
}
.pets-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--color-foreground);
  border-bottom: 2px solid transparent;
}
.pets-nav a[aria-current='page'] {
  border-bottom-color: var(--color-primary);
}
.pets-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-left: auto;
  flex-shrink: 0;
}
.pets-search-toggle,
.pets-more > summary {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0 var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  background: var(--color-card);
  color: var(--color-foreground);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.pets-search-toggle[hidden] {
  display: none;
}
.pets-search-toggle[aria-expanded='true'],
.pets-more[open] > summary {
  border-color: var(--color-primary);
  color: var(--color-cta);
}
.pets-search-toggle:focus-visible,
.pets-more > summary:focus-visible,
.pets-more a:focus-visible,
.pets-site-search input:focus-visible {
  outline: 2px solid var(--color-ring);
  outline-offset: 2px;
}
/* Two classes deep so the FAQ disclosure rules in components.css (borders, padding) never reach it. */
.pets-header .pets-more {
  display: none;
  border: 0;
  padding: 0;
}
.pets-more > summary {
  list-style: none;
  white-space: nowrap;
}
.pets-more > summary::-webkit-details-marker {
  display: none;
}
.pets-more > summary::after {
  content: '';
  width: 0.45em;
  height: 0.45em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-0.15em) rotate(45deg);
  margin-left: var(--space-xs);
}
.pets-more[open] > summary::after {
  transform: translateY(0.1em) rotate(-135deg);
}
.pets-more nav {
  position: absolute;
  z-index: 20;
  top: 100%;
  right: var(--space-md);
  left: var(--space-md);
  margin-top: 1px;
  padding: var(--space-xs);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  background: var(--color-card);
  box-shadow: var(--shadow-md);
}
.pets-more ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.pets-more a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-sm);
  border-radius: var(--radius-button);
  color: var(--color-foreground);
  text-decoration: none;
}
.pets-more a[aria-current='page'] {
  background: var(--color-background);
  color: var(--color-cta);
  font-weight: 700;
}
.pets-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.pets-site-search {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 var(--space-md) var(--space-md);
  position: relative;
}
.pets-site-search[hidden] {
  display: none;
}
.pets-site-search label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}
.pets-site-search input {
  width: 100%;
  min-height: 44px;
  padding: 0 var(--space-sm);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-button);
  font: inherit;
  color: var(--color-foreground);
  background: var(--color-card);
}
.pets-site-search ul {
  list-style: none;
  margin: var(--space-xs) 0 0;
  padding: var(--space-xs);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  background: var(--color-card);
}
.pets-site-search li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 var(--space-sm);
  min-height: 44px;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-button);
  cursor: pointer;
}
.pets-site-search li[aria-selected='true'],
.pets-site-search li:hover {
  background: var(--color-background);
}
.pets-site-search li a {
  color: var(--color-foreground);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.pets-site-search li span {
  font-size: 0.875rem;
  color: var(--color-muted-foreground);
}
.pets-site-search-status {
  margin: var(--space-xs) 0 0;
  color: var(--color-muted-foreground);
}
@media (max-width: 48rem) {
  .pets-header-inner {
    min-height: 3.5rem;
    gap: var(--space-sm);
  }
}
/* The subject links need about 60rem on one row; below that the menu takes their place. */
@media (max-width: 64rem) {
  .pets-nav {
    display: none;
  }
  .pets-header .pets-more {
    display: block;
  }
}
@media (max-width: 22rem) {
  .pets-more ul {
    grid-template-columns: minmax(0, 1fr);
  }
}
.pets-lede {
  max-width: 44rem;
  font-size: 1.125rem;
}
/* UX04: Dogs / Cats / All shortcuts sit under the lede so a phone reaches a tool in one screen. */
.pets-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: 0 0 var(--space-md);
}
.pets-shortcuts a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  background: var(--color-card);
  color: var(--color-foreground);
  text-decoration: none;
  font-weight: 600;
}
.pets-shortcuts a:hover {
  border-color: var(--color-primary);
}
.pets-intro-more {
  max-width: 44rem;
}
.card {
  background: var(--color-card);
  color: var(--color-card-foreground);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}
a.card-link {
  display: block;
  text-decoration: none;
  cursor: pointer;
}
a.card-link p {
  color: var(--color-muted-foreground);
  margin: 0;
}
.card-icon {
  color: var(--color-primary);
  display: inline-flex;
  margin-bottom: var(--space-sm);
}
.card-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  margin-bottom: var(--space-xl);
}
.btn-primary {
  background: var(--color-cta);
  color: var(--color-on-cta);
  border: 0;
  min-height: 44px;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-button);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover {
  background: var(--color-cta-hover);
}
.btn-primary:focus-visible,
a:focus-visible {
  outline: 3px solid var(--color-ring);
  outline-offset: 2px;
}
.result-figure {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  line-height: 1.1;
  color: var(--color-accent);
}
.result-figure small {
  font-size: 1rem;
  color: var(--color-muted-foreground);
}
/* Phone answer strip (UX audit 2026-10-19, item 9): the live figure right under the heading, so
   the answer is on the first screen; it links down to the full result card. A flat mint band with
   a teal rule, not a card. Wide screens show the result beside the form and do not need it. */
.pets-answer-strip {
  display: none;
}
#pets-result {
  scroll-margin-top: 1rem;
}
@media (max-width: 48rem) {
  .pets-answer-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.5rem;
    margin: 0 0 var(--space-md);
    padding: 0.6rem 0.9rem;
    border-left: 4px solid var(--color-primary);
    background: var(--color-muted);
    color: var(--color-foreground);
    text-decoration: none;
  }
  .pets-answer-strip-figure {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    line-height: 1.1;
    font-weight: 700;
    color: var(--color-accent);
  }
  .pets-answer-strip-unit {
    color: var(--color-muted-foreground);
  }
  .pets-answer-strip-more {
    margin-left: auto;
    color: var(--color-cta);
    font-weight: 600;
    text-decoration: underline;
  }
}
.pets-updated {
  color: var(--color-muted-foreground);
  font-size: 0.9rem;
}
.pets-footer {
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-2xl);
  font-size: 0.9rem;
}
.pets-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
}
.pets-footer nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
@media (prefers-reduced-motion: no-preference) {
  a.card-link,
  .btn-primary {
    transition:
      box-shadow 200ms ease,
      background-color 200ms ease,
      transform 200ms ease;
  }
  a.card-link:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
  }
}

/* Calculator page components, from design-system/vicaya-pets/MASTER.md. */
.pets-crumbs {
  font-size: 0.9rem;
  color: var(--color-muted-foreground);
  margin-bottom: var(--space-sm);
}
.pets-crumbs a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.species-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs);
  margin: var(--space-md) 0 var(--space-lg);
  background: var(--color-muted);
  border-radius: var(--radius-pill);
}
.species-switch .species-current,
.species-switch .species-other {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 44px;
  padding: 0 var(--space-md);
  border-radius: var(--radius-pill);
  font-weight: 600;
  text-decoration: none;
  color: var(--color-foreground);
}
.species-switch .species-current {
  background: var(--color-card);
  border: 2px solid var(--color-primary);
  color: var(--color-cta);
}
.species-switch .species-other {
  border: 2px solid transparent;
  color: var(--color-cta);
}
.species-switch svg {
  width: 24px;
  height: 24px;
}
.calc-layout {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
  margin-bottom: var(--space-lg);
}
@media (min-width: 48rem) {
  .calc-layout {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    align-items: start;
  }
}
.calc-form {
  display: grid;
  gap: var(--space-md);
}
.field {
  display: grid;
  gap: var(--space-xs);
}
.field label,
.field-hint,
.field-error {
  margin: 0;
}
.field label {
  font-weight: 600;
}
.field-hint {
  font-size: 0.9rem;
  color: var(--color-muted-foreground);
}
.field-error {
  font-size: 0.9rem;
  color: var(--color-destructive);
  font-weight: 600;
}
.input {
  width: 100%;
  padding: 12px 16px;
  min-height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  font: inherit;
  font-size: 16px; /* never smaller: iOS zooms inputs under 16px */
  color: var(--color-foreground);
  background: var(--color-card);
}
/* Focus is a crisp primary edge (border plus a 1px inset line), never a glow around the box. */
.input:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: inset 0 0 0 1px var(--color-primary);
}
.input:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1px var(--color-primary);
}
.input[aria-invalid='true'] {
  border-color: var(--color-destructive);
}
.input-with-unit {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.input-with-unit .input {
  flex: 1 1 auto;
  min-width: 0;
}
.unit-label {
  font-weight: 600;
  color: var(--color-muted-foreground);
  min-width: 2rem;
}
.unit-toggle,
.share-line {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm) var(--space-md);
}
.share-status {
  font-size: 0.9rem;
  color: var(--color-muted-foreground);
}
.btn-secondary {
  background: transparent;
  color: var(--color-cta);
  border: 2px solid var(--color-cta);
  min-height: 44px;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-button);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn-secondary:hover {
  background: var(--color-muted);
}
.btn-secondary:focus-visible {
  outline: 3px solid var(--color-ring);
  outline-offset: 2px;
}
.result-card {
  border-color: var(--color-primary);
}
.result-caption {
  margin: 0 0 var(--space-md);
}
.result-rows {
  margin: 0;
  display: grid;
  gap: var(--space-sm);
}
.result-rows > div {
  display: grid;
  gap: var(--space-xs);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border);
}
.result-rows dt {
  font-size: 0.9rem;
  color: var(--color-muted-foreground);
}
.result-rows dd {
  margin: 0;
  font-weight: 600;
}
.vet-card {
  border-left: 4px solid var(--color-primary);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.vet-card ul,
.sources-list {
  margin: 0;
  padding-left: 1.25rem;
}
.vet-card li,
.sources-list li {
  margin-bottom: var(--space-sm);
}
.source-figure {
  font-weight: 600;
}
main > .card {
  margin-bottom: var(--space-md);
}
details {
  border-top: 1px solid var(--color-border);
  padding: var(--space-sm) 0;
}
details:last-of-type {
  border-bottom: 1px solid var(--color-border);
}
summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 44px;
  display: flex;
  align-items: center;
}
summary:focus-visible {
  outline: 3px solid var(--color-ring);
  outline-offset: 2px;
  border-radius: var(--radius-button);
}
details p {
  margin: var(--space-sm) 0 0;
}
@media (prefers-reduced-motion: no-preference) {
  .result-card {
    transition: opacity 200ms ease;
  }
  .result-card.result-updated {
    opacity: 0.6;
  }
  .input,
  .btn-secondary {
    transition:
      border-color 200ms ease,
      background-color 200ms ease;
  }
}

/* ---- breed match: chips, stepper, list, breakdown (SPEC-PETS-02 §4; MASTER.md pill radius) */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-card);
  color: var(--color-foreground);
  cursor: pointer;
  font-size: 16px;
}
.chip input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.chip:has(input:checked) {
  background: var(--color-cta);
  color: var(--color-on-cta);
  border-color: var(--color-cta);
}
.chip:has(input:focus-visible) {
  outline: 3px solid var(--color-ring);
  outline-offset: 2px;
}
.chip.chip-static {
  cursor: default;
  min-height: 32px;
  padding: 4px 12px;
  background: var(--color-muted);
  color: var(--color-muted-foreground);
  font-size: 0.875rem;
}
.question {
  border: 0;
  padding: 0;
  margin: 0 0 var(--space-lg);
  min-width: 0;
}
.question legend {
  font-weight: 600;
  margin-bottom: var(--space-sm);
}
.step {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.step-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: var(--space-md);
}
.step-title:focus {
  /* Focus moved here by Next/Back; the step heading itself is the cue, no ring box. */
  outline: none;
}
.step-title:focus-visible {
  outline: 2px solid var(--color-ring);
  outline-offset: 4px;
}
.step-count {
  color: var(--color-muted-foreground);
}
.stepper-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}
.match-form[data-stepping] .step:not([data-step-active]) {
  display: none;
}
.market-field {
  margin-top: var(--space-lg);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: end;
}
.count-line {
  font-weight: 600;
  color: var(--color-foreground);
}
.match-list {
  list-style: none;
  padding: 0;
  margin: var(--space-md) 0 0;
  display: grid;
  gap: var(--space-md);
}
.match-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: var(--space-md);
  background: var(--color-card);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.match-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.match-head h3 {
  margin: 0;
  font-size: 1.125rem;
  flex: 1;
}
.match-rank {
  color: var(--color-muted-foreground);
  font-variant-numeric: tabular-nums;
}
.tier {
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--color-muted);
  color: var(--color-muted-foreground);
}
.tier-fits {
  background: var(--color-cta);
  color: var(--color-on-cta);
}
.score-bar {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--color-muted);
  overflow: hidden;
  margin: var(--space-sm) 0 var(--space-xs);
}
.score-bar > span {
  display: block;
  height: 100%;
  background: var(--color-primary);
}
.match-score {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.25rem;
}
.match-score small {
  color: var(--color-muted-foreground);
  font-size: 0.875rem;
}
.match-facts,
.match-flags {
  list-style: none;
  padding: 0;
  margin: var(--space-sm) 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  color: var(--color-muted-foreground);
  font-size: 0.9375rem;
}
.why-toggle {
  margin-top: var(--space-sm);
  padding: 8px 16px;
  font-size: 0.9375rem;
}
.why-body[hidden],
[data-excluded-reasons][hidden],
[data-refine-body][hidden] {
  display: none;
}
.breakdown {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-top: var(--space-sm);
}
.breakdown th,
.breakdown td {
  text-align: left;
  padding: 6px 4px;
  border-top: 1px solid var(--color-border);
  vertical-align: top;
}
.evidence {
  border-radius: var(--radius-pill);
  padding: 1px 8px;
  background: var(--color-muted);
  color: var(--color-muted-foreground);
  white-space: nowrap;
}
.evidence-study {
  background: var(--color-border);
  color: var(--color-foreground);
}
.evidence-no-data {
  border: 1px dashed var(--color-border);
  background: transparent;
}
.excluded,
.refine {
  margin-top: var(--space-md);
}
@media (prefers-reduced-motion: no-preference) {
  .chip,
  .score-bar > span {
    transition:
      background-color 200ms ease,
      color 200ms ease,
      width 200ms ease;
  }
}
.table-scroll {
  overflow-x: auto;
}

/* Byline under each calculator's heading (PETS-0009). */
.byline {
  margin: -0.25rem 0 1rem;
  color: var(--color-muted-foreground);
  font-size: 0.875rem;
}
.byline a {
  color: inherit;
}
