.petmatch-page {
  --pm-bg: #f4fbf7;
  --pm-card: #ffffff;
  --pm-ink: #15392f;
  --pm-muted: #60756e;
  --pm-brand: #26a66b;
  --pm-brand-2: #82d6aa;
  --pm-brand-dark: #0d7550;
  --pm-shadow: 0 24px 70px rgba(21, 57, 47, .14);
  --pm-radius: 1.6rem;
  color: var(--pm-ink);
}

.petmatch-page button {
  font: inherit;
  cursor: pointer;
}

.petmatch-hero {
  position: relative;
  text-align: center;
  padding: 2.4rem 1.5rem 1.75rem;
  border: 1px solid #dff2e7;
  border-radius: var(--pm-radius);
  background: radial-gradient(circle at top left, #e2fff0, transparent 36%), linear-gradient(180deg, #f4fbf7, #fff);
}

.petmatch-method-btn {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  border: 0;
  background: var(--pm-ink);
  color: white;
  border-radius: 999px;
  padding: .7rem 1.25rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .16);
}

.petmatch-badge {
  display: inline-flex;
  margin-top: 2.35rem;
  background: #fff;
  border: 1px solid #d9f4e4;
  padding: .6rem 1rem;
  border-radius: 999px;
  color: var(--pm-brand-dark);
  font-weight: 800;
}

.petmatch-hero h1 {
  font-size: clamp(2.35rem, 6vw, 4.8rem);
  line-height: 1;
  margin: 1.1rem 0 .75rem;
  font-weight: 900;
}

.petmatch-hero p {
  font-size: 1.15rem;
  color: var(--pm-muted);
  max-width: 760px;
  margin: 0 auto;
  line-height: 1.65;
}

.petmatch-animals {
  font-size: 2.2rem;
  margin-top: 1.25rem;
  letter-spacing: .3rem;
}

.petmatch-card,
.petmatch-sources-panel {
  background: rgba(255, 255, 255, .92);
  border: 1px solid #dff2e7;
  border-radius: var(--pm-radius);
  box-shadow: var(--pm-shadow);
  padding: 1.75rem;
  backdrop-filter: blur(12px);
  margin-top: 1.5rem;
}

.petmatch-progress-wrap {
  margin-bottom: 1.35rem;
}

.petmatch-progress-meta {
  display: flex;
  justify-content: space-between;
  color: var(--pm-muted);
  font-weight: 800;
  font-size: .95rem;
}

.petmatch-progress {
  height: 12px;
  background: #e7f5ee;
  border-radius: 999px;
  overflow: hidden;
  margin-top: .6rem;
}

.petmatch-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--pm-brand), var(--pm-brand-2));
  border-radius: inherit;
  transition: width .45s ease;
}

.petmatch-screen {
  display: none;
  animation: petmatch-slide-in .34s ease both;
}

.petmatch-screen.is-active {
  display: block;
}

@keyframes petmatch-slide-in {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: none; }
}

.petmatch-screen h2,
.petmatch-sources-panel h2 {
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  margin: 0 0 .85rem;
  font-weight: 800;
}

.petmatch-help,
.petmatch-screen p {
  color: var(--pm-muted);
  line-height: 1.7;
}

.petmatch-question-icon {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background: #ecfff4;
  display: grid;
  place-items: center;
  font-size: 2.3rem;
  margin-bottom: 1rem;
}

.petmatch-answers {
  display: grid;
  gap: .9rem;
  margin-top: 1.35rem;
}

.petmatch-answer {
  border: 2px solid #def1e7;
  background: #fff;
  border-radius: 1.2rem;
  padding: 1rem;
  text-align: left;
  transition: .2s ease;
  display: flex;
  gap: .85rem;
  align-items: center;
  color: var(--pm-ink);
}

.petmatch-answer:hover {
  border-color: var(--pm-brand);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(38, 166, 107, .12);
}

.petmatch-answer .petmatch-bubble {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e9f8f0;
  color: var(--pm-brand-dark);
  font-weight: 900;
  flex: 0 0 auto;
}

.petmatch-primary,
.petmatch-ghost {
  border: 0;
  border-radius: 1rem;
  padding: .85rem 1.3rem;
  font-weight: 900;
}

.petmatch-primary {
  background: linear-gradient(135deg, var(--pm-brand), var(--pm-brand-dark));
  color: #fff;
  box-shadow: 0 14px 28px rgba(38, 166, 107, .25);
}

.petmatch-ghost {
  background: #eef8f2;
  color: var(--pm-brand-dark);
}

.petmatch-nav-row,
.petmatch-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: 1.35rem;
}

.petmatch-result-top {
  background: linear-gradient(135deg, #e8fff2, #fff);
  border: 1px solid #d8f2e4;
  border-radius: 1.4rem;
  padding: 1.5rem;
  margin: 1.1rem 0;
}

.petmatch-pet-title {
  display: flex;
  align-items: center;
  gap: .85rem;
  font-size: 1.6rem;
  font-weight: 950;
}

.petmatch-pet-icon {
  font-size: 2.8rem;
}

.petmatch-score {
  display: inline-flex;
  margin-top: .85rem;
  padding: .5rem .8rem;
  border-radius: 999px;
  background: #143a2f;
  color: #fff;
  font-weight: 900;
}

.petmatch-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin-top: 1.1rem;
}

.petmatch-info-box {
  background: #fff;
  border: 1px solid #e4f1ea;
  border-radius: 1rem;
  padding: .9rem;
}

.petmatch-info-box b {
  display: block;
  margin-bottom: .35rem;
}

.petmatch-result-list {
  display: grid;
  gap: .75rem;
}

.petmatch-result-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  background: #fff;
  border: 1px solid #e4f1ea;
  border-radius: 1rem;
  padding: .85rem 1rem;
}

.petmatch-bar {
  height: 10px;
  background: #edf5f0;
  border-radius: 999px;
  overflow: hidden;
  min-width: 160px;
}

.petmatch-bar span {
  display: block;
  height: 100%;
  background: var(--pm-brand);
  border-radius: inherit;
}

.petmatch-source {
  padding: .75rem 0;
  border-bottom: 1px solid #e5f1ea;
}

.petmatch-source:last-child {
  border-bottom: 0;
}

.petmatch-modal {
  border: 0;
  border-radius: 1.6rem;
  width: min(860px, 92vw);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .25);
  padding: 0;
}

.petmatch-modal::backdrop {
  background: rgba(10, 30, 24, .55);
  backdrop-filter: blur(4px);
}

.petmatch-modal-body {
  padding: 1.9rem;
  position: relative;
}

.petmatch-modal-close {
  position: absolute;
  right: 1rem;
  top: .8rem;
  border: 0;
  background: #eef8f2;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 1.5rem;
}

.petmatch-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.petmatch-chip {
  padding: .5rem .75rem;
  background: #ecfff4;
  border: 1px solid #d5f2e2;
  border-radius: 999px;
  font-weight: 800;
  color: var(--pm-brand-dark);
}

.theme-dark .petmatch-page {
  --pm-card: #111827;
  --pm-ink: #e2e8f0;
  --pm-muted: #cbd5e1;
}

.theme-dark .petmatch-hero,
.theme-dark .petmatch-card,
.theme-dark .petmatch-sources-panel {
  background: linear-gradient(135deg, #10252d, #111827);
  border-color: #334155;
}

.theme-dark .petmatch-badge,
.theme-dark .petmatch-answer,
.theme-dark .petmatch-result-top,
.theme-dark .petmatch-info-box,
.theme-dark .petmatch-result-item {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

.theme-dark .petmatch-question-icon,
.theme-dark .petmatch-ghost,
.theme-dark .petmatch-answer .petmatch-bubble,
.theme-dark .petmatch-chip {
  background: #164e63;
  color: #e2e8f0;
  border-color: #334155;
}

@media (max-width: 760px) {
  .petmatch-card,
  .petmatch-sources-panel {
    padding: 1.25rem;
    border-radius: 1.35rem;
  }

  .petmatch-method-btn {
    position: static;
    transform: none;
    margin-bottom: 1rem;
  }

  .petmatch-badge {
    margin-top: 0;
  }

  .petmatch-result-grid {
    grid-template-columns: 1fr;
  }

  .petmatch-result-item {
    display: block;
  }

  .petmatch-bar {
    margin-top: .6rem;
    min-width: 0;
  }
}

@media print {
  .navbar,
  .site-footer,
  .petmatch-method-btn,
  .petmatch-actions,
  .petmatch-nav-row,
  .petmatch-progress-wrap {
    display: none !important;
  }

  .petmatch-card,
  .petmatch-sources-panel {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
