*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: #1a2e2a;
  background: #fff;
}

.mq-page {
  min-height: 100dvh;
  padding:
    max(1rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    max(1.25rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
}

.mq-card {
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
}

.mq-status,
.mq-error {
  margin: 0;
  color: #5a6470;
  text-align: center;
}

.mq-error {
  color: #a33;
}

.mq-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2.5rem 1rem;
  text-align: center;
}

.mq-loading-media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 220px;
  min-height: 140px;
}

.mq-loading-gif,
.mq-loading-video {
  width: 100%;
  max-width: 220px;
  height: auto;
  border-radius: 12px;
  display: block;
}

.mq-loading-spinner {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 6px solid #e8eeec;
  border-top-color: #ff8040;
  animation: mq-loading-spin 0.9s linear infinite;
}

@keyframes mq-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.mq-loading-text {
  margin: 0;
  color: #5a6470;
  font-weight: 600;
  animation: mq-loading-pulse 1.6s ease-in-out infinite;
}

@keyframes mq-loading-pulse {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mq-loading-spinner,
  .mq-loading-text {
    animation: none;
  }
}

.mq-intro h1 {
  margin: 0 0 0.65rem;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
}

.mq-intro p {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  color: #5a6470;
}

.mq-step {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #5a6470;
}

.mq-progress {
  height: 4px;
  margin-bottom: 1.25rem;
  background: #e8eeec;
  border-radius: 999px;
  overflow: hidden;
}

.mq-progress-bar {
  height: 100%;
  width: 0;
  background: #008080;
  transition: width 0.25s ease;
}

.mq-question {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
}

.mq-options {
  display: grid;
  gap: 0.6rem;
}

.mq-option {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: 0.85rem 1rem;
  border: 3px solid #d0d8d4;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mq-option:active {
  background: #f3f6f5;
  border-color: #008080;
}

.mq-free-text {
  display: grid;
  gap: 0.75rem;
}

.mq-input {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid #d0d8d4;
  border-radius: 8px;
  font: inherit;
  font-size: 1rem;
  color: inherit;
  background: #fff;
}

.mq-input:focus {
  outline: 2px solid #008080;
  outline-offset: 1px;
  border-color: #008080;
}

.mq-btn {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 8px;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mq-btn-primary {
  background: #ff8040;
  color: #fff;
}

.mq-btn-primary:active {
  background: #e86f32;
}

.mq-btn-secondary {
  background: #f3f6f5;
  color: #1a2e2a;
}

.mq-btn-secondary:active {
  background: #e8eeec;
}

.mq-result {
  text-align: center;
}

.mq-result-title {
  margin: 0 0 0.95rem;
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
  width: 100%;
  text-wrap: balance;
}

.mq-result-list > .mq-result-title {
  margin-bottom: 0.95rem;
}

.mq-result-intro {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #5a6470;
  text-align: center;
}

.mq-result-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
  text-align: left;
}

#quiz-root.mq-card {
  padding: 1.75rem 1.4rem;
}

.mq-card {
  padding: 0;
  border: 1px solid #e8eeec;
  border-radius: 10px;
  background: #fff;
  text-align: left;
  overflow: hidden;
}

.mq-card-content {
  padding: 0.9rem;
}

.mq-card-layout {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.mq-card-photo {
  flex-shrink: 0;
  width: 88px;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: #e8eeec;
}

.mq-card-photo img,
.mq-card-photo .dog-image,
.mq-card-photo .dog-image-full {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mq-card-photo.dog-photo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.mq-card-body {
  flex: 1;
  min-width: 0;
}

.mq-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.mq-card h2,
.mq-card .mq-card-name {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
  text-align: left;
}

.mq-card-aid {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ff8040;
  white-space: nowrap;
}

.mq-card .mq-slide-meta {
  margin-bottom: 0.55rem;
  text-align: left;
}

.mq-card .mq-slide-summary,
.mq-card .mq-slide-blurb {
  margin-bottom: 0;
  text-align: left;
}

.mq-card-kennel-bar {
  width: 100%;
  margin: 0;
  padding: 0.65rem 0.9rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: #32897d;
}

.mq-carousel {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) 2.5rem;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 1rem;
}

.mq-carousel-btn {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid #d0d8d4;
  border-radius: 50%;
  background: #fff;
  color: #1a2e2a;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.mq-carousel-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.mq-carousel-viewport {
  overflow: hidden;
}

.mq-carousel-track {
  display: flex;
  transition: transform 0.3s ease;
}

.mq-slide {
  flex: 0 0 100%;
  min-width: 100%;
  text-align: center;
}

.mq-slide-rank {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ff8040;
}

.mq-slide h2 {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
  line-height: 1.2;
}

.mq-slide-meta {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #008080;
}

.mq-slide-summary,
.mq-slide-blurb {
  margin: 0 0 1rem;
  padding: 0;
  font-size: 0.94rem;
  font-weight: 400;
  line-height: 1.55;
  color: #2c3338;
  text-align: left;
}

.mq-photo,
.mq-photo.dog-photo-fallback {
  width: min(100%, 220px);
  aspect-ratio: 1 / 1;
  margin: 0 auto 0.85rem;
  border-radius: 8px;
  overflow: hidden;
  background: #e8eeec;
}

.mq-photo .dog-image,
.mq-photo .dog-image-full {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mq-alignment {
  margin: 0 0 1rem;
  padding: 0.85rem;
  border: 1px solid #e8eeec;
  border-radius: 8px;
  text-align: left;
}

.mq-alignment h3 {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5a6470;
}

.mq-alignment ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mq-alignment li {
  position: relative;
  margin: 0 0 0.45rem;
  padding-left: 0.9rem;
  font-size: 0.88rem;
  line-height: 1.4;
}

.mq-alignment li:last-child {
  margin-bottom: 0;
}

.mq-alignment li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #008080;
}

@media (max-width: 480px) {
  .mq-slide-summary,
  .mq-slide-blurb {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.85rem;
  }

  .mq-slide-meta {
    font-size: 0.8rem;
    margin-bottom: 0.45rem;
  }
}

.mq-actions {
  display: grid;
  gap: 0.6rem;
}

.mq-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.mq-download-btn svg {
  width: 1.05em;
  height: 1.05em;
}

.mq-download-btn:disabled,
.mq-download-btn.is-busy {
  opacity: 0.55;
  cursor: wait;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
