/* ==========================================================================
   Canine Intelligence — Compatibility Assessment
   quiz.css — extends the parent site design tokens (assets/style.css).
   Link parent style.css FIRST, then this file. All tokens (--ink, --accent,
   --border, --radius, --shadow, fonts, .wrap, .nav, .foot, .btn) inherited.
   ========================================================================== */

/* ---- score-band palette (single source of truth for band colours) ------- */
:root {
  --band-exceptional: #16a34a;   /* green  90-100 */
  --band-strong:      #0d9488;   /* teal   80-89  */
  --band-good:        #2563eb;   /* blue   70-79  */
  --band-mixed:       #d97706;   /* amber  60-69  */
  --band-significant: #ea580c;   /* orange 50-59  */
  --band-poor:        #9ca3af;   /* gray   <50    */

  --band-exceptional-soft: #f0fdf4;
  --band-strong-soft:      #f0fdfa;
  --band-good-soft:        #eff6ff;
  --band-mixed-soft:       #fffbeb;
  --band-significant-soft: #fff7ed;
  --band-poor-soft:        #f3f4f6;
}

/* ==========================================================================
   Shared layout
   ========================================================================== */
.quiz-page-main { padding: 40px 0 72px; min-height: 60vh; }
.quiz-shell { max-width: 720px; margin: 0 auto; }

/* ==========================================================================
   Landing page (index.html)
   ========================================================================== */
.ca-hero { text-align: center; padding: 56px 0 40px; }
.ca-hero .eyebrow {
  text-transform: uppercase; letter-spacing: .12em; font-size: .72rem;
  font-weight: 700; color: var(--accent); margin-bottom: 14px;
}
.ca-hero h1 {
  font-family: "Fraunces", Georgia, serif; font-weight: 600;
  letter-spacing: -.01em; font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.08; margin: 0 auto 18px; max-width: 14ch; color: var(--ink);
}
.ca-hero .ca-sub {
  font-size: 1.08rem; color: var(--ink-2); line-height: 1.6;
  max-width: 46ch; margin: 0 auto 8px;
}
.ca-time { font-size: .9rem; color: var(--muted); margin-top: 18px; }

.ca-features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  margin: 40px auto; max-width: 680px;
}
.ca-feature {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 18px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  box-shadow: var(--shadow);
}
.ca-feature-ic {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
}
.ca-feature-ic svg { width: 22px; height: 22px; }
.ca-feature-lbl { font-weight: 600; font-size: .95rem; color: var(--ink); }

.ca-cta-row {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  margin: 8px auto 0;
}
.ca-cta-row .btn { font-size: 1rem; padding: 14px 28px; }
.ca-privacy {
  font-size: .82rem; color: var(--muted); text-align: center;
  margin-top: 22px; display: inline-flex; align-items: center; gap: 7px;
  justify-content: center;
}
.ca-privacy svg { width: 15px; height: 15px; flex: none; }
.ca-resume { display: none; }
.ca-resume.is-visible { display: inline-flex; }

/* ==========================================================================
   Progress header
   ========================================================================== */
.quiz-progress { margin-bottom: 28px; }
.quiz-progress-meta {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 8px;
}
.quiz-section {
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--accent);
}
.quiz-count { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.quiz-bar {
  height: 8px; background: var(--border); border-radius: 999px;
  overflow: hidden; width: 100%;
}
.quiz-bar-fill {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #6366f1);
  transition: width .45s cubic-bezier(.4, 0, .2, 1);
}

/* ==========================================================================
   Question screen
   ========================================================================== */
.quiz-screen { animation: quiz-fade .35s ease both; }
@keyframes quiz-fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.quiz-qhead { margin-bottom: 22px; }
.quiz-q-title,
.quiz-question {
  font-family: "Fraunces", Georgia, serif; font-weight: 600;
  letter-spacing: -.01em; font-size: clamp(1.4rem, 3vw, 1.9rem);
  line-height: 1.2; color: var(--ink); margin: 0 0 10px;
}
.quiz-helper { font-size: .95rem; color: var(--muted); line-height: 1.55; margin: 0; }
/* heading receives programmatic focus on each screen for a11y — no visible ring */
.quiz-question:focus, .quiz-q-title:focus,
.quiz-question:focus-visible, .quiz-q-title:focus-visible { outline: none; }
.quiz-comp { margin-top: 8px; }

.quiz-error {
  display: none; margin-top: 16px; padding: 11px 14px;
  background: var(--warn-soft); border: 1px solid #fcd9a5;
  color: #92400e; border-radius: var(--radius-sm); font-size: .88rem;
}
.quiz-error.is-visible { display: block; }
.q-error { color: var(--red); font-size: .85rem; margin-top: 8px; }

.quiz-required-note {
  font-size: .8rem; color: var(--muted-2); margin-top: 10px;
  display: inline-flex; align-items: center; gap: 6px;
}

/* ==========================================================================
   Controls (back / next / skip)
   ========================================================================== */
.quiz-controls {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-top: 34px;
}
.quiz-back {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: .9rem; font-weight: 600; padding: 11px 8px;
  display: inline-flex; align-items: center; gap: 6px;
}
.quiz-back:hover { color: var(--ink); }
.quiz-back[disabled] { opacity: 0; pointer-events: none; }
.quiz-next {
  background: var(--accent); color: #fff; border: 1px solid transparent;
  border-radius: 10px; padding: 12px 26px; font-size: .95rem;
  font-weight: 600; cursor: pointer; transition: background .2s;
}
.quiz-next:hover { background: #4338ca; }
.quiz-next[disabled] { opacity: .5; cursor: not-allowed; }
.quiz-skip-row { text-align: center; margin-top: 14px; }
.quiz-skip {
  background: none; border: none; color: var(--muted-2); cursor: pointer;
  font-size: .84rem; text-decoration: underline; text-underline-offset: 3px;
}
.quiz-skip:hover { color: var(--muted); }

/* ==========================================================================
   Computing / loading screen
   ========================================================================== */
.quiz-computing { text-align: center; padding: 72px 0; }
.quiz-spinner {
  width: 46px; height: 46px; margin: 0 auto 22px; border-radius: 50%;
  border: 4px solid var(--border); border-top-color: var(--accent);
  animation: quiz-spin .8s linear infinite;
}
@keyframes quiz-spin { to { transform: rotate(360deg); } }
.quiz-computing-text { font-size: 1.05rem; color: var(--ink-2); font-weight: 500; }

/* ==========================================================================
   Option components — shared cards
   ========================================================================== */
.q-options { display: grid; gap: 12px; }
.q-single { grid-template-columns: 1fr; }
.q-yesno { grid-template-columns: repeat(2, 1fr); }
.q-yesno:has(.q-yn-unsure) { grid-template-columns: repeat(3, 1fr); }

.q-card {
  display: flex; align-items: center; gap: 14px; width: 100%;
  text-align: left; background: var(--surface); cursor: pointer;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; font-size: .98rem; color: var(--ink);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.q-card:hover { border-color: var(--muted-2); }
.q-card.is-selected {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.q-card-ic {
  width: 38px; height: 38px; flex: none; border-radius: 10px;
  background: var(--surface-2); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
}
.q-card.is-selected .q-card-ic { background: #fff; }
.q-card-ic svg { width: 20px; height: 20px; }
.q-card-lbl { flex: 1; line-height: 1.4; }
.q-card-tick {
  width: 22px; height: 22px; flex: none; border-radius: 50%;
  border: 2px solid var(--border); display: inline-flex;
  align-items: center; justify-content: center; color: #fff;
}
.q-card.is-selected .q-card-tick { background: var(--accent); border-color: var(--accent); }
.q-card-tick svg { width: 13px; height: 13px; opacity: 0; }
.q-card.is-selected .q-card-tick svg { opacity: 1; }

/* yes / no cards — centred */
.q-yn { flex-direction: column; text-align: center; justify-content: center; gap: 8px; padding: 22px 14px; }
.q-yn .q-card-lbl { flex: none; font-weight: 600; }
.q-yn .q-card-tick { display: none; }

/* ==========================================================================
   Multi-select chips
   ========================================================================== */
.q-multi-wrap { display: block; }
.q-multi { grid-template-columns: 1fr; }
.q-chip {
  display: flex; align-items: center; gap: 12px; width: 100%;
  text-align: left; background: var(--surface); cursor: pointer;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; font-size: .96rem; color: var(--ink);
  transition: border-color .15s, background .15s;
}
.q-chip:hover { border-color: var(--muted-2); }
.q-chip.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.q-chip-box {
  width: 22px; height: 22px; flex: none; border-radius: 6px;
  border: 2px solid var(--border); background: #fff;
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
.q-chip.is-selected .q-chip-box { background: var(--accent); border-color: var(--accent); }
.q-chip-box svg { width: 13px; height: 13px; opacity: 0; }
.q-chip.is-selected .q-chip-box svg { opacity: 1; }
.q-chip-lbl { flex: 1; line-height: 1.4; }
.q-selected-count {
  font-size: .82rem; color: var(--muted); margin-top: 12px; text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Slider
   ========================================================================== */
.q-slider { padding: 8px 4px 2px; }
.q-slider-val {
  display: block; text-align: center; font-family: "Fraunces", Georgia, serif;
  font-weight: 600; font-size: 1.9rem; color: var(--accent); margin-bottom: 16px;
  font-variant-numeric: tabular-nums;
}
.q-slider-input {
  -webkit-appearance: none; appearance: none; width: 100%; height: 8px;
  border-radius: 999px; background: var(--border); outline: none; cursor: pointer;
}
.q-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 26px; height: 26px;
  border-radius: 50%; background: var(--accent); border: 3px solid #fff;
  box-shadow: var(--shadow); cursor: pointer;
}
.q-slider-input::-moz-range-thumb {
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent);
  border: 3px solid #fff; box-shadow: var(--shadow); cursor: pointer;
}
.q-slider-ends {
  display: flex; justify-content: space-between; margin-top: 12px;
  font-size: .8rem; color: var(--muted);
}

/* ==========================================================================
   Confidence pair
   ========================================================================== */
.q-confpair { display: grid; gap: 20px; }
.q-confpair-flags { display: grid; gap: 12px; }
.q-conf {
  border-top: 1px solid var(--border); padding-top: 18px;
}
.q-conf-lead { font-size: .9rem; color: var(--ink-2); font-weight: 600; margin-bottom: 12px; }
.q-conf-row { display: flex; flex-wrap: wrap; gap: 10px; }
.q-conf-chip {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 999px; padding: 9px 18px; font-size: .9rem; cursor: pointer;
  color: var(--ink-2); transition: border-color .15s, background .15s, color .15s;
}
.q-conf-chip:hover { border-color: var(--muted-2); }
.q-conf-chip.is-selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.q-conf-host { margin-top: 4px; }

/* ==========================================================================
   Results page
   ========================================================================== */
.res-wrap { max-width: 860px; margin: 0 auto; }
.res-shared-note {
  background: var(--accent-soft); border: 1px solid #c7d2fe; color: var(--accent);
  border-radius: var(--radius-sm); padding: 10px 14px; font-size: .86rem;
  margin-bottom: 20px; text-align: center;
}

/* featured top match */
.res-featured {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  overflow: hidden; margin-bottom: 34px; border-top: 5px solid var(--band-poor);
}
.res-featured.band-exceptional { border-top-color: var(--band-exceptional); }
.res-featured.band-strong      { border-top-color: var(--band-strong); }
.res-featured.band-good        { border-top-color: var(--band-good); }
.res-featured.band-mixed       { border-top-color: var(--band-mixed); }
.res-featured.band-significant { border-top-color: var(--band-significant); }
.res-featured.band-poor        { border-top-color: var(--band-poor); }

.res-featured-head {
  display: flex; gap: 20px; align-items: center; padding: 26px 28px 20px;
  flex-wrap: wrap;
}
.res-portrait {
  width: 96px; height: 96px; flex: none; border-radius: 18px; overflow: hidden;
  background: var(--portrait-tint, #f3f4fb); border: 1px solid var(--border);
}
.res-portrait-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.res-featured-meta { flex: 1; min-width: 180px; }
.res-rank-badge {
  display: inline-block; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; color: var(--accent);
  margin-bottom: 4px;
}
.res-featured-name {
  font-family: "Fraunces", Georgia, serif; font-weight: 600; letter-spacing: -.01em;
  font-size: 1.8rem; color: var(--ink); margin: 0 0 10px; line-height: 1.1;
}
.res-band-chip {
  display: inline-block; padding: 5px 13px; border-radius: 999px;
  font-size: .82rem; font-weight: 600; color: #fff; background: var(--band-poor);
}
.res-band-chip.sm { font-size: .72rem; padding: 3px 10px; }

/* big score */
.res-score-line { text-align: right; min-width: 110px; }
.res-score-big { display: flex; align-items: baseline; gap: 2px; justify-content: flex-end; }
.res-score-big-num {
  font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 3rem;
  line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums;
}
.res-score-big-of { font-size: 1rem; color: var(--muted-2); }

/* confidence */
.res-confidence { margin-top: 8px; }
.res-confidence-lbl { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.res-confidence-track {
  height: 6px; background: var(--border); border-radius: 999px; overflow: hidden;
  margin: 5px 0 3px;
}
.res-confidence-fill { height: 100%; background: var(--accent); border-radius: 999px; }
.res-confidence-num { font-size: .78rem; color: var(--muted); }

.res-featured-body {
  display: grid; grid-template-columns: 1fr 1fr; gap: 26px;
  padding: 6px 28px 28px;
}
.res-featured-col { min-width: 0; }
.res-subhead,
.res-section-title {
  font-size: .8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); margin: 0 0 14px;
}
.res-section-title { font-size: 1.15rem; text-transform: none; letter-spacing: -.01em;
  color: var(--ink); font-family: "Fraunces", Georgia, serif; margin: 40px 0 18px; }

/* category subscores */
.res-cats { display: grid; gap: 13px; }
.res-cat-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; }
.res-cat-lbl { font-size: .86rem; color: var(--ink-2); }
.res-cat-num { font-size: .84rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.res-cat-num.is-na { color: var(--muted-2); font-weight: 400; }
.res-cat-track {
  grid-column: 1 / -1; height: 6px; background: var(--border);
  border-radius: 999px; overflow: hidden;
}
.res-cat-fill { height: 100%; border-radius: 999px; background: var(--band-poor); transition: width .5s ease; }

/* reasons */
.res-reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.res-reason { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; line-height: 1.45; color: var(--ink-2); }
.res-reason.is-major { font-weight: 500; color: var(--ink); }
.res-reason-ic {
  width: 20px; height: 20px; flex: none; border-radius: 50%; margin-top: 1px;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
}
.res-reason-ic-positive { background: var(--good-soft); }
.res-reason-ic-positive::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good);
}
.res-reason-ic-concern { background: var(--warn-soft); }
.res-reason-ic-concern::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--amber);
}
.res-reason-txt { flex: 1; }

.res-featured-actions { padding: 0 28px 28px; display: flex; gap: 12px; flex-wrap: wrap; }
.res-profile-link { text-decoration: none; }

/* ranked grid (2..N) */
.res-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.res-compact {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; border-left: 4px solid var(--band-poor);
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px;
}
.res-compact.band-exceptional { border-left-color: var(--band-exceptional); }
.res-compact.band-strong      { border-left-color: var(--band-strong); }
.res-compact.band-good        { border-left-color: var(--band-good); }
.res-compact.band-mixed       { border-left-color: var(--band-mixed); }
.res-compact.band-significant { border-left-color: var(--band-significant); }
.res-compact.band-poor        { border-left-color: var(--band-poor); }
.res-compact-top { display: flex; align-items: center; gap: 10px; }
.res-compact-rank {
  width: 28px; height: 28px; flex: none; border-radius: 8px; background: var(--surface-2);
  color: var(--muted); font-weight: 700; font-size: .85rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.res-compact-meta { flex: 1; min-width: 0; }
.res-compact-name { font-weight: 600; font-size: 1.02rem; color: var(--ink); margin-bottom: 3px; }
.res-compact-reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.res-compact-reasons .res-reason { font-size: .84rem; }

/* score bar */
.res-bar { display: flex; align-items: center; gap: 10px; }
.res-bar-track { flex: 1; height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.res-bar-big .res-bar-track { height: 10px; }
.res-bar-fill { height: 100%; border-radius: 999px; background: var(--band-poor); transition: width .5s ease; }
.res-bar-num { font-size: .82rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; min-width: 30px; text-align: right; }

/* band fills — scoped to bar/category fills ONLY (never the container cards,
   which carry the same band-* class but should only get an accent border) */
.res-bar-fill.band-exceptional, .res-cat-fill.band-exceptional { background: var(--band-exceptional); }
.res-bar-fill.band-strong,      .res-cat-fill.band-strong      { background: var(--band-strong); }
.res-bar-fill.band-good,        .res-cat-fill.band-good        { background: var(--band-good); }
.res-bar-fill.band-mixed,       .res-cat-fill.band-mixed       { background: var(--band-mixed); }
.res-bar-fill.band-significant, .res-cat-fill.band-significant { background: var(--band-significant); }
.res-bar-fill.band-poor,        .res-cat-fill.band-poor        { background: var(--band-poor); }
/* band chips override background */
.res-band-chip.band-exceptional { background: var(--band-exceptional); }
.res-band-chip.band-strong      { background: var(--band-strong); }
.res-band-chip.band-good        { background: var(--band-good); }
.res-band-chip.band-mixed       { background: var(--band-mixed); }
.res-band-chip.band-significant { background: var(--band-significant); }
.res-band-chip.band-poor        { background: var(--band-poor); }

/* excluded accordion */
.res-excluded {
  margin-top: 34px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.res-excluded-summary {
  list-style: none; cursor: pointer; padding: 16px 20px; font-weight: 600;
  font-size: .92rem; color: var(--ink-2); display: flex; align-items: center;
  justify-content: space-between; gap: 10px;
}
.res-excluded-summary::-webkit-details-marker { display: none; }
.res-excluded-chev { transition: transform .25s; color: var(--muted); }
.res-excluded[open] .res-excluded-chev { transform: rotate(180deg); }
.res-excluded-list { list-style: none; margin: 0; padding: 0 20px 8px; display: grid; gap: 10px; }
.res-excluded-item { padding: 12px 0; border-top: 1px solid var(--border); }
.res-excluded-name { font-weight: 600; color: var(--ink); font-size: .92rem; }
.res-excluded-code {
  display: inline-block; margin-left: 8px; font-size: .72rem; color: var(--red);
  background: #fef2f2; padding: 2px 8px; border-radius: 999px; font-weight: 600;
}
.res-excluded-detail { font-size: .85rem; color: var(--muted); margin-top: 4px; line-height: 1.5; }

/* explanation + legend */
.res-explain {
  margin-top: 34px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px;
}
.res-explain-legend { display: flex; flex-wrap: wrap; gap: 12px 18px; margin: 16px 0; }
.res-legend-chip { display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; color: var(--ink-2); }
.res-legend-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--band-poor); }
.res-legend-dot.band-exceptional { background: var(--band-exceptional); }
.res-legend-dot.band-strong      { background: var(--band-strong); }
.res-legend-dot.band-good        { background: var(--band-good); }
.res-legend-dot.band-mixed       { background: var(--band-mixed); }
.res-legend-dot.band-significant { background: var(--band-significant); }
.res-legend-dot.band-poor        { background: var(--band-poor); }
.res-explain-foot { font-size: .84rem; color: var(--muted); line-height: 1.55; margin: 8px 0 0; }

/* actions + share */
.res-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 34px; }
.res-share { margin-top: 16px; }
.res-share-msg { font-size: .84rem; color: var(--good); margin-top: 8px; }

/* upgrade CTA */
.res-upgrade {
  margin-top: 40px; border-radius: var(--radius-lg); padding: 30px 32px;
  background: linear-gradient(135deg, var(--accent), #7c3aed); color: #fff;
  text-align: center;
}
.res-upgrade h3 { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 1.5rem; margin: 0 0 10px; }
.res-upgrade-body { font-size: .98rem; opacity: .92; line-height: 1.6; max-width: 48ch; margin: 0 auto 18px; }
.res-upgrade .btn-primary { background: #fff; color: var(--accent); }
.res-upgrade .btn-primary:hover { background: #f3f4f6; }

.res-empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.res-empty h2 { font-family: "Fraunces", Georgia, serif; color: var(--ink); margin-bottom: 12px; }

/* loading skeleton */
.res-skeleton { max-width: 860px; margin: 0 auto; }
.res-skeleton .sk {
  background: linear-gradient(90deg, var(--surface-2) 25%, #eef0f3 37%, var(--surface-2) 63%);
  background-size: 400% 100%; animation: sk-shimmer 1.4s ease infinite; border-radius: var(--radius);
}
@keyframes sk-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* noscript */
.quiz-noscript {
  max-width: 560px; margin: 60px auto; text-align: center; padding: 32px;
  background: var(--warn-soft); border: 1px solid #fcd9a5; border-radius: var(--radius);
  color: #92400e;
}

/* ==========================================================================
   Focus states — visible accent ring everywhere
   ========================================================================== */
.q-card:focus-visible,
.q-chip:focus-visible,
.q-conf-chip:focus-visible,
.q-slider-input:focus-visible,
.quiz-next:focus-visible,
.quiz-back:focus-visible,
.quiz-skip:focus-visible,
.res-excluded-summary:focus-visible,
.btn:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
  .ca-features { grid-template-columns: repeat(2, 1fr); }
  .res-featured-body { grid-template-columns: 1fr; gap: 20px; }
  .res-grid { grid-template-columns: 1fr; }
  .res-featured-head { flex-direction: column; align-items: flex-start; }
  .res-score-line { text-align: left; }
  .res-score-big { justify-content: flex-start; }
}

@media (max-width: 480px) {
  .quiz-page-main { padding: 28px 0 56px; }
  .ca-features { grid-template-columns: 1fr; }
  .q-yesno,
  .q-yesno:has(.q-yn-unsure) { grid-template-columns: 1fr; }
  .quiz-controls { gap: 8px; }
  .quiz-next { padding: 12px 18px; }
  .res-featured-head,
  .res-featured-body,
  .res-featured-actions { padding-left: 18px; padding-right: 18px; }
}

/* prevent any horizontal overflow at 320px */
* { min-width: 0; }
img, svg { max-width: 100%; }
.quiz-shell, .res-wrap { width: 100%; box-sizing: border-box; }

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .quiz-bar-fill,
  .res-cat-fill,
  .res-bar-fill,
  .q-card, .q-chip, .q-conf-chip,
  .quiz-next, .res-confidence-fill { transition: none !important; }
  .quiz-screen { animation: none !important; }
  .quiz-spinner { animation-duration: 1.6s; }
  .res-skeleton .sk { animation: none; }
}



/* ==========================================================================
   RESULTS EXPERIENCE — full results page additions
   ========================================================================== */

/* shared-snapshot banner */
.res-shared-note { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.res-shared-note a { color: var(--accent); font-weight: 600; }

/* deal-breaker / penalty banner (featured) */
.res-dealbreaker {
  display: flex; gap: 12px; align-items: flex-start;
  margin: 0 28px 18px; padding: 14px 16px;
  background: var(--warn-soft); border: 1px solid #fcd9a5; border-radius: var(--radius-sm);
  color: #92400e;
}
.res-dealbreaker-ic { font-size: 1.1rem; line-height: 1.2; flex: none; }
.res-dealbreaker strong { display: block; margin-bottom: 4px; color: #92400e; }
.res-dealbreaker-list { margin: 4px 0 0; padding-left: 18px; font-size: .88rem; }
.res-dealbreaker-list li { margin: 2px 0; }

/* matched / unmatched priorities */
.res-priorities { padding: 0 28px 8px; display: grid; gap: 12px; }
.res-priorities-lbl { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); display: block; margin-bottom: 7px; }
.res-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.res-priority-chip { font-size: .82rem; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--ink-2); }
.res-priority-chip.is-matched { background: var(--good-soft); border-color: #bbf7d0; color: #166534; }
.res-priority-chip.is-unmatched { background: var(--warn-soft); border-color: #fcd9a5; color: #92400e; }

/* lifestyle adjustments */
.res-adjust { padding: 4px 28px 8px; display: grid; gap: 8px; }
.res-adjust-note {
  font-size: .9rem; color: var(--ink-2); background: var(--accent-soft);
  border-radius: var(--radius-sm); padding: 10px 14px; margin: 0;
}

/* similar alternatives */
.res-alts { padding: 6px 28px 10px; }
.res-alts-lbl { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); display: block; margin-bottom: 8px; }
.res-alt-chip {
  font-size: .84rem; font-weight: 600; padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-2);
  cursor: pointer; transition: border-color .15s ease, transform .1s ease;
}
.res-alt-chip:hover { transform: translateY(-1px); }
.res-alt-chip.band-exceptional { border-left: 4px solid var(--band-exceptional); }
.res-alt-chip.band-strong { border-left: 4px solid var(--band-strong); }
.res-alt-chip.band-good { border-left: 4px solid var(--band-good); }
.res-alt-chip.band-mixed { border-left: 4px solid var(--band-mixed); }
.res-alt-chip.band-significant { border-left: 4px solid var(--band-significant); }
.res-alt-chip.band-poor { border-left: 4px solid var(--band-poor); }

/* version footnote */
.res-version { padding: 0 28px 22px; margin: 0; font-size: .76rem; color: var(--muted-2); }

/* add-to-comparison button */
.res-cmp-btn { text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.res-cmp-btn-ic { width: 16px; height: 16px; border: 1.6px solid currentColor; border-radius: 4px; position: relative; flex: none; }
.res-cmp-btn.is-added { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.res-cmp-btn.is-added .res-cmp-btn-ic { background: var(--accent); border-color: var(--accent); }
.res-cmp-btn.is-added .res-cmp-btn-ic::before {
  content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* compact card additions */
.res-portrait-sm { width: 52px; height: 52px; border-radius: 12px; }
.res-compact-name-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.res-compact-score { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 1.4rem; line-height: 1; color: var(--ink); }
.res-compact-conf { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.res-conf-pill { font-size: .74rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 3px 10px; }
.res-status-chip { font-size: .72rem; font-weight: 600; color: #92400e; background: var(--warn-soft); border: 1px solid #fcd9a5; border-radius: 999px; padding: 2px 9px; }
.res-compact-concern .res-reason-ic { margin-top: 0; }
.res-compact-reasons.res-compact-concern { color: #92400e; }
.res-compact-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.res-compact-actions .btn { font-size: .82rem; padding: 8px 12px; }

/* flash highlight when scrolled-to via similar-alternatives chip */
.res-featured.is-flash, .res-compact.is-flash { animation: res-flash 1.2s ease; }
@keyframes res-flash { 0%, 100% { box-shadow: var(--shadow); } 30% { box-shadow: 0 0 0 3px var(--accent); } }

/* show-more toggle for ranks 6–10 */
.res-more-toggle { margin: 20px auto 0; display: inline-flex; }
.res-more { margin-top: 16px; }
.res-more-grid { margin-top: 0; }

/* ==========================================================================
   Low-confidence / no-strong-fit / empty states
   ========================================================================== */
.res-lowconf-banner {
  background: var(--warn-soft); border: 1px solid #fcd9a5; border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 24px; color: #92400e;
}
.res-lowconf-banner strong { display: block; font-size: 1.02rem; margin-bottom: 4px; }
.res-lowconf-banner p { margin: 0 0 12px; font-size: .9rem; }
.res-cards.is-lowconf .res-featured, .res-cards.is-lowconf .res-compact { opacity: .82; position: relative; }
.res-lowconf-badge {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: #92400e; background: var(--warn-soft); border: 1px solid #fcd9a5;
  border-radius: 999px; padding: 3px 9px;
}
.res-featured { position: relative; }

.res-nostrong {
  background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--band-mixed);
  border-radius: var(--radius); padding: 22px 24px; margin-bottom: 26px; box-shadow: var(--shadow);
}
.res-nostrong h2 { font-family: "Fraunces", Georgia, serif; font-size: 1.35rem; color: var(--ink); margin: 0 0 10px; }
.res-nostrong p { color: var(--ink-2); margin: 0 0 12px; line-height: 1.55; }
.res-nostrong-list { margin: 0 0 14px; padding-left: 20px; color: var(--ink-2); }
.res-nostrong-list li { margin: 4px 0; }

.res-empty-state { max-width: 760px; margin: 0 auto; text-align: center; padding: 20px; }
.res-empty-state h2 { font-family: "Fraunces", Georgia, serif; font-size: 1.7rem; color: var(--ink); margin: 0 0 12px; }
.res-empty-state > p { color: var(--ink-2); line-height: 1.6; margin: 0 auto 22px; max-width: 54ch; }
.res-reconsider-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 0 auto 24px; text-align: left; }
.res-reconsider-card {
  display: flex; gap: 12px; align-items: flex-start; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px;
}
.res-reconsider-ic { font-size: 1.2rem; color: var(--accent); flex: none; line-height: 1.2; }
.res-reconsider-card p { margin: 0; font-size: .9rem; color: var(--ink-2); line-height: 1.5; }
.res-empty-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.res-advisory { font-size: .86rem; color: var(--muted); font-style: italic; max-width: 52ch; margin: 0 auto 18px; }
.res-seeall-list { display: none; text-align: left; max-width: 620px; margin: 0 auto; }
.res-seeall-list.is-open { display: grid; gap: 8px; }
.res-seeall-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; display: grid; gap: 3px;
}
.res-seeall-item strong { color: var(--ink); }
.res-seeall-detail { font-size: .84rem; color: var(--muted); }

/* ==========================================================================
   Comparison tray (floating) + modal table
   ========================================================================== */
.res-compare-tray {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 -6px 24px rgba(0,0,0,.1);
  transform: translateY(110%); transition: transform .28s ease; padding: 12px 0;
}
.res-compare-tray.is-open { transform: translateY(0); }
.res-compare-tray-inner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.res-compare-tray-lbl { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.res-compare-chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 0; }
.res-compare-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 600;
  color: var(--ink); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 6px 5px 13px;
}
.res-compare-x { border: none; background: var(--border); color: var(--ink); width: 20px; height: 20px; border-radius: 50%; cursor: pointer; font-size: 1rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.res-compare-x:hover { background: var(--red); color: #fff; }
.res-compare-go { flex: none; }
.res-compare-clear { border: none; background: none; color: var(--muted); font-size: .84rem; cursor: pointer; text-decoration: underline; }
.res-compare-limit { text-align: center; font-size: .82rem; color: var(--red); margin-top: 8px; opacity: 0; transition: opacity .2s ease; }
.res-compare-limit.is-show { opacity: 1; }

.res-compare-overlay {
  position: fixed; inset: 0; z-index: 80; background: rgba(15,15,15,.55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.res-compare-modal {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 900px; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden;
}
.res-compare-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.res-compare-modal-head h2 { font-family: "Fraunces", Georgia, serif; font-size: 1.3rem; color: var(--ink); margin: 0; }
.res-compare-close { border: none; background: var(--surface-2); width: 34px; height: 34px; border-radius: 50%; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--ink-2); }
.res-compare-close:hover { background: var(--border); }
.res-compare-scroll { overflow: auto; padding: 8px 22px 22px; }

.res-compare-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.res-compare-table th, .res-compare-table td { padding: 10px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); }
.res-ct-rowlbl { font-weight: 600; color: var(--ink-2); white-space: nowrap; position: sticky; left: 0; background: var(--surface); }
.res-ct-head { text-align: center; }
.res-portrait-xs { width: 48px; height: 48px; border-radius: 10px; margin: 0 auto 6px; }
.res-portrait-xs .res-portrait-img { width: 100%; height: 100%; object-fit: cover; }
.res-ct-name { display: block; font-weight: 600; color: var(--ink); font-size: .84rem; text-align: center; }
.res-ct-cell { min-width: 120px; }
.res-ct-score .res-ct-cell { font-weight: 600; }
.res-ct-val { color: var(--ink); }
.res-ct-na { color: var(--muted-2); }
.res-ct-stars { color: #f59e0b; letter-spacing: 1px; }
.res-ct-tradeoffs { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .8rem; color: var(--ink-2); }
.res-ct-tradeoffs li::before { content: "• "; color: var(--amber); }

/* ==========================================================================
   ON-PROFILE COMPATIBILITY MODULE (breed pages)
   ========================================================================== */
.compat-module {
  background: var(--surface, #fff); border: 1px solid var(--border, #e5e7eb);
  border-top: 5px solid var(--band-poor); border-radius: var(--radius, 14px);
  box-shadow: var(--shadow, 0 1px 3px rgba(0,0,0,.08));
  margin: 30px auto; max-width: 1000px;
}
.compat-module.band-exceptional { border-top-color: var(--band-exceptional); }
.compat-module.band-strong { border-top-color: var(--band-strong); }
.compat-module.band-good { border-top-color: var(--band-good); }
.compat-module.band-mixed { border-top-color: var(--band-mixed); }
.compat-module.band-significant { border-top-color: var(--band-significant); }
.compat-module.band-poor { border-top-color: var(--band-poor); }
.compat-module-inner { padding: 22px 26px 24px; }
.compat-module-header { margin-bottom: 16px; }
.compat-module-eyebrow { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); display: block; margin-bottom: 8px; }
.compat-module-scoreline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.compat-module-score { display: inline-flex; align-items: baseline; gap: 2px; }
.compat-module-score-num { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 2.4rem; line-height: 1; color: var(--ink); }
.compat-module-score-of { font-size: .95rem; color: var(--muted-2); }
.compat-module-band { padding: 5px 13px; border-radius: 999px; font-size: .82rem; font-weight: 600; color: #fff; background: var(--band-poor); }
.compat-module-band.band-exceptional { background: var(--band-exceptional); }
.compat-module-band.band-strong { background: var(--band-strong); }
.compat-module-band.band-good { background: var(--band-good); }
.compat-module-band.band-mixed { background: var(--band-mixed); }
.compat-module-band.band-significant { background: var(--band-significant); }
.compat-module-band.band-poor { background: var(--band-poor); }
.compat-module-conf { font-size: .82rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 4px 11px; }
.compat-module-body { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.compat-module-col { min-width: 0; }
.compat-col-head { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 12px; }
.compat-module-col .compat-col-head + * { margin-bottom: 16px; }
.compat-reasons { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 9px; }
.compat-reasons li { display: flex; gap: 9px; align-items: flex-start; font-size: .9rem; line-height: 1.45; color: var(--ink-2); }
.compat-reason-ic { width: 18px; height: 18px; flex: none; border-radius: 50%; margin-top: 2px; display: inline-flex; align-items: center; justify-content: center; }
.compat-reason-ic-positive { background: var(--good-soft, #dcfce7); }
.compat-reason-ic-positive::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good, #16a34a); }
.compat-reason-ic-concern { background: var(--warn-soft, #fef3c7); }
.compat-reason-ic-concern::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--amber, #d97706); }
.compat-module-cats { display: grid; gap: 11px; }
.compat-cat-row { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; align-items: center; }
.compat-cat-lbl { font-size: .84rem; color: var(--ink-2); }
.compat-cat-num { font-size: .82rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.compat-cat-track { grid-column: 1 / -1; height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; }
.compat-cat-fill { height: 100%; border-radius: 999px; background: var(--band-poor); transition: width .5s ease; }
.compat-cat-fill.band-exceptional { background: var(--band-exceptional); }
.compat-cat-fill.band-strong { background: var(--band-strong); }
.compat-cat-fill.band-good { background: var(--band-good); }
.compat-cat-fill.band-mixed { background: var(--band-mixed); }
.compat-cat-fill.band-significant { background: var(--band-significant); }
.compat-cat-fill.band-poor { background: var(--band-poor); }
.compat-module-improve { margin-top: 14px; background: var(--accent-soft, #eef2ff); border-radius: var(--radius-sm, 8px); padding: 14px 16px; }
.compat-improve-head { font-size: .82rem; font-weight: 700; color: var(--accent); margin: 0 0 10px; }
.compat-improve-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.compat-improve-list li { display: flex; gap: 8px; align-items: flex-start; font-size: .86rem; line-height: 1.45; color: var(--ink-2); }
.compat-improve-ic { flex: none; }
.compat-module-footer { margin-top: 18px; }
.compat-back-link { font-size: .88rem; font-weight: 600; color: var(--accent); text-decoration: none; }
.compat-back-link:hover { text-decoration: underline; }
.compat-module-cta .compat-cta-body { text-align: center; padding: 8px 0; }
.compat-cta-head { font-family: "Fraunces", Georgia, serif; font-size: 1.3rem; color: var(--ink); margin: 0 0 8px; }
.compat-cta-p { color: var(--ink-2); line-height: 1.55; max-width: 52ch; margin: 0 auto 16px; }

/* ==========================================================================
   Responsive — results experience + compat module
   ========================================================================== */
@media (max-width: 900px) {
  .res-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .compat-module-body { grid-template-columns: 1fr; gap: 18px; }
  .res-reconsider-grid { grid-template-columns: 1fr; }
  .res-dealbreaker, .res-priorities, .res-adjust, .res-alts, .res-version { padding-left: 18px; padding-right: 18px; }
}
@media (max-width: 560px) {
  .res-grid { grid-template-columns: 1fr; }
  .res-compare-tray-inner { gap: 8px; }
  .res-compare-go { width: 100%; }
  .compat-module-inner { padding: 18px; }
  .compat-module-score-num { font-size: 2rem; }
}


/* ==========================================================================
   Auth panel (slide-in drawer), inline email-capture, rank 4–5 gating,
   premium upsell, results account menu, shared toast.
   Appended for the launch build. All values reference existing design tokens
   from style.css / the band palette above — no new colour literals.
   ========================================================================== */

/* ---- shared toast (bottom-centre) --------------------------------------- */
.auth-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  z-index: 1200; background: var(--green); color: #fff;
  font-size: .95rem; font-weight: 600; padding: 12px 20px;
  border-radius: 999px; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
}
.auth-toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ---- auth panel overlay + drawer ---------------------------------------- */
body.auth-panel-lock { overflow: hidden; }

.auth-panel-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 15, 15, .5);
  opacity: 0; transition: opacity .25s ease;
}
.auth-panel-overlay.is-open { opacity: 1; }
.auth-panel-overlay[hidden] { display: none; }

.auth-panel-drawer {
  position: fixed; top: 0; right: 0; z-index: 1001;
  width: 400px; max-width: 100vw; height: 100%;
  background: var(--surface); box-shadow: var(--shadow-lg);
  border-left: 1px solid var(--border);
  padding: 28px 26px 34px; overflow-y: auto;
  transform: translateX(100%); transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  display: flex; flex-direction: column; gap: 4px;
}
.auth-panel-drawer.is-open { transform: translateX(0); }

@media (max-width: 480px) {
  .auth-panel-drawer { width: 100vw; border-left: none; }
}

.auth-panel-close {
  position: absolute; top: 14px; right: 16px;
  width: 34px; height: 34px; border: none; background: var(--surface-2);
  border-radius: 50%; font-size: 1.4rem; line-height: 1; color: var(--muted);
  cursor: pointer; transition: background .15s ease, color .15s ease;
}
.auth-panel-close:hover { background: var(--border); color: var(--ink); }

.auth-panel-title {
  font-family: "Fraunces", Georgia, serif; font-size: 1.5rem;
  color: var(--ink); margin: 4px 0 18px;
}

.auth-panel-tabs {
  display: flex; gap: 4px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 4px; margin-bottom: 22px;
}
.auth-panel-tab {
  flex: 1; border: none; background: transparent; cursor: pointer;
  font-size: .82rem; font-weight: 600; color: var(--muted);
  padding: 9px 6px; border-radius: 6px; transition: background .15s ease, color .15s ease;
}
.auth-panel-tab:hover { color: var(--ink); }
.auth-panel-tab.is-active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }

/* ---- forms (shared by drawer + inline email-capture) -------------------- */
.auth-form { display: flex; flex-direction: column; gap: 4px; }
.auth-form-intro { font-size: .95rem; color: var(--ink-2); line-height: 1.5; margin: 0 0 14px; }
.auth-label {
  font-size: .78rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em; margin: 12px 0 6px;
}
.auth-input {
  width: 100%; box-sizing: border-box; font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.auth-input::placeholder { color: var(--muted-2); }
.auth-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .18);
}

.auth-pw-wrap { position: relative; }
.auth-pw-wrap .auth-input { padding-right: 46px; }
.auth-pw-toggle {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  border: none; background: transparent; cursor: pointer;
  font-size: 1.05rem; line-height: 1; padding: 6px; opacity: .55;
  transition: opacity .15s ease;
}
.auth-pw-toggle:hover, .auth-pw-toggle.is-showing { opacity: 1; }

.auth-pw-strength { margin: 10px 0 2px; }
.auth-pw-strength-track {
  height: 6px; background: var(--border); border-radius: 999px; overflow: hidden;
}
.auth-pw-strength-bar {
  height: 100%; width: 0; border-radius: 999px; background: var(--muted-2);
  transition: width .3s ease, background .3s ease;
}
.auth-pw-strength-bar.is-weak { background: var(--red); }
.auth-pw-strength-bar.is-good { background: var(--amber); }
.auth-pw-strength-bar.is-strong { background: var(--green); }
.auth-pw-strength-label { display: block; margin-top: 6px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.auth-pw-strength-label.is-weak { color: var(--red); }
.auth-pw-strength-label.is-good { color: var(--amber); }
.auth-pw-strength-label.is-strong { color: var(--green); }
.auth-pw-req { font-size: .78rem; color: var(--muted); margin: 6px 0 0; }

.auth-checkbox-row {
  display: flex; align-items: flex-start; gap: 10px; margin: 16px 0 4px;
  font-size: .88rem; color: var(--ink-2); line-height: 1.45; cursor: pointer;
}
.auth-checkbox-row input { margin-top: 2px; flex: none; width: 16px; height: 16px; accent-color: var(--accent); }

.auth-error {
  color: var(--red); font-size: .86rem; font-weight: 600; line-height: 1.4;
  margin: 12px 0 0; background: var(--surface-2);
  border: 1px solid var(--red); border-radius: var(--radius-sm);
  padding: 9px 12px;
}
.auth-error[hidden] { display: none; }

.auth-fine-print { font-size: .78rem; color: var(--muted); margin: 12px 0 0; }
.auth-forgot { font-size: .85rem; margin: 14px 0 0; }
.auth-forgot a { color: var(--accent); }

.auth-submit { width: 100%; margin-top: 18px; justify-content: center; }
.auth-submit:disabled { opacity: .6; cursor: default; }

/* ---- results header row / account menu ---------------------------------- */
.res-header-row { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.res-account-menu { display: inline-flex; align-items: center; gap: 14px; }
.res-account-name { font-size: .92rem; font-weight: 600; color: var(--ink); }
.btn-link {
  border: none; background: transparent; cursor: pointer;
  font-size: .88rem; font-weight: 600; color: var(--accent); padding: 4px 2px;
}
.btn-link:hover { text-decoration: underline; }
.res-save-btn { font-size: .9rem; }

/* ---- inline email-capture section --------------------------------------- */
.email-capture-section { margin: 24px 0 8px; }
.email-capture-inner {
  background: var(--accent-soft); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px; text-align: center;
}
.email-capture-head {
  font-family: "Fraunces", Georgia, serif; font-size: 1.25rem;
  color: var(--ink); margin: 0 0 6px;
}
.email-capture-desc { font-size: .95rem; color: var(--ink-2); line-height: 1.5; margin: 0 auto 16px; max-width: 46ch; }
.email-capture-form { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: 480px; margin: 0 auto; }
.email-capture-form .auth-input { flex: 1 1 220px; }
.email-capture-form .btn { flex: none; }
.email-capture-done { font-size: 1.05rem; font-weight: 600; color: var(--green); margin: 8px 0; }
.email-capture-section .auth-error { text-align: left; max-width: 480px; margin-left: auto; margin-right: auto; }

/* ---- rank 4–5 gating ---------------------------------------------------- */
.res-gated-wrap { position: relative; margin-top: 22px; }
.res-gated-grid {
  filter: blur(6px); opacity: .55; pointer-events: none; user-select: none;
}
.res-gated-overlay {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center; padding: 20px;
  background: rgba(255, 255, 255, .35);
  backdrop-filter: blur(1px);
  border-radius: var(--radius);
}
.res-gated-msg {
  font-family: "Fraunces", Georgia, serif; font-size: 1.15rem;
  font-weight: 600; color: var(--ink); margin: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 18px; box-shadow: var(--shadow);
}
.res-unlock-btn { font-size: .95rem; }

/* ---- premium upsell section --------------------------------------------- */
.premium-section { margin: 34px 0 10px; }
.premium-inner {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 30px 32px; text-align: center;
  position: relative; overflow: hidden;
}
.premium-inner::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--accent);
}
.premium-badge {
  display: inline-block; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; color: var(--accent);
  background: var(--accent-soft); border-radius: 999px; padding: 5px 13px; margin-bottom: 14px;
}
.premium-headline {
  font-family: "Fraunces", Georgia, serif; font-size: 1.6rem;
  color: var(--ink); margin: 0 0 10px;
}
.premium-desc { font-size: 1rem; color: var(--ink-2); line-height: 1.55; max-width: 54ch; margin: 0 auto 20px; }
.premium-list {
  list-style: none; margin: 0 auto 24px; padding: 0; max-width: 420px;
  display: grid; gap: 11px; text-align: left;
}
.premium-list li { display: flex; gap: 11px; align-items: flex-start; font-size: .96rem; color: var(--ink-2); line-height: 1.45; }
.premium-list-ic {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 800; margin-top: 1px;
}
.btn-premium {
  border: none; cursor: pointer; background: var(--accent); color: #fff;
  font-size: 1.08rem; font-weight: 700; padding: 15px 34px;
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  transition: filter .15s ease, transform .1s ease;
}
.btn-premium:hover { filter: brightness(1.08); }
.btn-premium:active { transform: translateY(1px); }
.premium-fine-print { font-size: .82rem; color: var(--muted); margin: 14px 0 0; }
.premium-policy {
  font-size: .82rem; color: var(--muted); line-height: 1.5;
  max-width: 52ch; margin: 16px auto 0; padding-top: 16px;
  border-top: 1px solid var(--border);
}
.premium-policy strong { color: var(--ink-2); }

.premium-modal { max-width: 460px; text-align: center; }
.premium-modal h2 { font-family: "Fraunces", Georgia, serif; margin: 0 0 12px; color: var(--ink); }
.premium-modal p { color: var(--ink-2); line-height: 1.55; margin: 0 0 18px; }
.premium-modal .email-capture-form { justify-content: center; }

@media (max-width: 560px) {
  .premium-inner { padding: 24px 20px; }
  .premium-headline { font-size: 1.35rem; }
  .email-capture-form .auth-input { flex: 1 1 100%; }
}
