/* ANIMUS — test page (/test) aligned with app shell */

body.page-test {
  font-family: 'DM Sans', sans-serif;
  --accent: var(--gold);
  --accent2: var(--gold2);
  --accent3: var(--gold3);
  padding-bottom: 0;
}

body.page-test.phase-intro,
body.page-test.phase-results {
  padding-bottom: calc(var(--mbn-h) + var(--safe-bottom) + 16px);
}

body.page-test .test-quiz-ui {
  font-family: 'DM Sans', sans-serif;
}

/* ── Phase visibility (override legacy inline display from psyche-engine.js) ── */
body.page-test #intro,
body.page-test #quiz,
body.page-test #loading,
body.page-test #results,
body.page-test #compareView {
  display: none !important;
}

body.page-test.phase-intro #intro {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

body.page-test.phase-quiz #quiz {
  display: block !important;
}

body.page-test.phase-loading #loading {
  display: flex !important;
  position: fixed;
  inset: 0;
  z-index: 400;
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
}

body.page-test.phase-results #results {
  display: block !important;
}

body.page-test.phase-compare #compareView {
  display: block !important;
}

body.page-test.phase-quiz #appNavMount,
body.page-test.phase-quiz #appBottomMount,
body.page-test.phase-quiz .mobile-bottom-nav,
body.page-test.phase-loading #appNavMount,
body.page-test.phase-loading #appBottomMount,
body.page-test.phase-loading .mobile-bottom-nav {
  display: none !important;
}

body.page-test.phase-results #results,
body.page-test.phase-intro #intro {
  padding-bottom: 0;
}

/* ── Intro ── */
.test-intro {
  position: relative;
  overflow-x: hidden;
  min-height: calc(100dvh - var(--nav-h));
  display: flex;
  align-items: center;
}

.test-intro-shell {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  padding: 32px 20px 40px;
  text-align: center;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.test-intro::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(200, 169, 110, 0.07) 0%, transparent 72%);
  pointer-events: none;
}

.test-intro-card {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 24px 22px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

body.light-mode .test-intro-card {
  box-shadow: 0 8px 28px rgba(26, 23, 20, 0.08);
}

.test-resume-wrap {
  margin: 0;
  width: 100%;
}

.test-resume-btn {
  width: 100%;
  margin-top: 4px;
  border: 1px solid var(--border2) !important;
  background: var(--bg) !important;
}

.btn-primary--wide {
  width: 100%;
  min-height: 48px;
}

.intro-eyebrow {
  font-size: 10px;
  letter-spacing: 0.35em;
  color: var(--gold2);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.intro-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(64px, 13vw, 108px);
  letter-spacing: 0.06em;
  line-height: 0.9;
  margin-bottom: 8px;
  color: var(--white);
}

.intro-title em {
  font-style: normal;
  color: var(--gold);
}

.intro-subtitle {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(17px, 3vw, 20px);
  color: var(--muted2);
  letter-spacing: 0.02em;
  margin-bottom: 24px;
}

.intro-rule {
  width: 48px;
  height: 1px;
  background: var(--border2);
  margin: 0 auto 24px;
}

.intro-desc {
  max-width: 520px;
  margin: 0 auto 28px;
  color: var(--muted2);
  font-size: 14px;
  line-height: 1.75;
}

.intro-meta {
  display: flex;
  gap: 40px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.intro-meta-compact {
  margin-bottom: 20px;
}

.intro-meta-item strong {
  display: block;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 36px;
  letter-spacing: 0.04em;
  color: var(--white);
  margin-bottom: 4px;
  line-height: 1;
}

.intro-meta-item span {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.intro-actions {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}

.intro-main-label {
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold2);
  text-align: left;
}

.intro-shop-hint {
  font-size: 12px;
  color: var(--muted2);
  line-height: 1.6;
  margin: 4px 0 0;
  text-align: center;
}

.intro-shop-hint a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid var(--gold2);
}

.btn-primary {
  background: var(--gold);
  border: none;
  color: #000;
  padding: 14px 32px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.2s, transform 0.15s;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:hover {
  background: var(--gold3);
}

.intro-import-btn,
.observer-btn {
  flex-shrink: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--gold);
  padding: 12px 18px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.intro-import-btn:hover,
.observer-btn:hover {
  background: rgba(200, 169, 110, 0.12);
  border-color: var(--gold2);
}

/* ── Quiz chrome ── */
body.page-test.phase-quiz {
  background: var(--bg);
}

body.page-test #quiz {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
}

body.page-test #quiz button {
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0;
  font-family: 'DM Sans', sans-serif;
  box-sizing: border-box;
}

#quiz .qhdr {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(8, 8, 8, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 200;
}

body.light-mode #quiz .qhdr {
  background: rgba(244, 241, 236, 0.96);
}

#quiz .qhdr-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 0.1em;
  color: var(--white);
  text-decoration: none;
  flex-shrink: 0;
}

#quiz .qhdr-logo span {
  color: var(--gold);
}

#quiz .qhdr-est {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--gold2);
  margin-left: 6px;
  vertical-align: middle;
}

#quiz .qhdr-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

#quiz .qhdr-section {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(42vw, 220px);
}

#quiz .qhdr-num,
#quiz .pbar-wrap,
#quiz .test-progress-wrap,
#quiz .test-progress-label {
  display: none;
}

body.page-test.test-progress-on #quiz .qhdr-num {
  display: inline-flex;
  align-items: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--gold2);
  flex-shrink: 0;
}

body.page-test.test-progress-on .test-progress-wrap {
  display: block;
}

body.page-test.test-progress-on .test-progress-label {
  display: block;
}

body.page-test.test-progress-on #quiz .qbody {
  padding-top: calc(var(--nav-h) + 28px);
}

#quiz .qhdr-mode-switch {
  display: none !important;
}

#quiz .qhdr-mode-switch:hover {
  border-color: var(--gold);
  color: var(--gold);
}

#quiz {
  width: 100%;
  overflow-x: hidden;
}

#quiz .qbody {
  padding: calc(var(--nav-h) + 20px) 24px 100px;
  max-width: 680px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

/* Profile-style result actions */
.btn-action-profile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  min-height: 44px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  border: none;
}

.btn-primary-profile {
  background: var(--gold);
  color: #000;
}

.btn-primary-profile:hover {
  background: var(--gold3);
}

.btn-secondary-profile {
  background: none;
  border: 1px solid var(--border2);
  color: var(--muted2);
}

.btn-secondary-profile:hover {
  border-color: var(--gold2);
  color: var(--gold);
}

.test-action-bar {
  display: none;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px 0;
  flex-wrap: wrap;
  max-width: 1000px;
  margin: 0 auto;
}

body.page-test.phase-results #actionBar.is-visible,
body.page-test.phase-results .test-action-bar.is-visible {
  display: flex !important;
}

.test-action-bar .btn-action-profile {
  text-decoration: none;
}

#results .tabs-wrap {
  position: sticky;
  top: var(--nav-h);
  z-index: 150;
  background: rgba(8, 8, 8, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

body.light-mode #results .tabs-wrap {
  background: rgba(244, 241, 236, 0.97);
}

body.page-test #results {
  padding-bottom: calc(var(--mbn-h) + var(--safe-bottom) + 24px);
}

@media (max-width: 768px) {
  body.page-test.phase-results .test-action-bar.is-visible,
  body.page-test.phase-results #actionBar.is-visible {
    padding-bottom: 8px;
    margin-bottom: 4px;
  }
}

.detailed-test-upsell {
  margin-top: 20px;
  padding: 0;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted2);
  text-align: center;
  border: none;
  background: transparent;
}

.detailed-test-upsell a,
.intro-shop-hint a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid var(--gold2);
}

.intro-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 20px;
  border: 1px solid var(--border2);
  border-radius: 2px;
  overflow: hidden;
}

.intro-mode-btn {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 64px;
  padding: 12px 10px;
  border: none;
  border-right: 1px solid var(--border2);
  background: var(--bg);
  color: var(--muted2);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.intro-mode-btn:last-child {
  border-right: none;
}

.intro-mode-btn.active {
  background: rgba(200, 169, 110, 0.1);
  color: var(--text);
}

.intro-mode-btn .mode-label {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold2);
}

.intro-mode-btn.active .mode-label {
  color: var(--gold);
}

.intro-mode-btn .mode-sub {
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--muted);
  line-height: 1.35;
}

.intro-mode-badge {
  display: none;
  margin-top: 2px;
  padding: 2px 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted2);
  border: 1px solid var(--border2);
  border-radius: 2px;
}

.intro-mode-badge.is-owned {
  color: var(--gold);
  border-color: var(--gold2);
  background: rgba(200, 169, 110, 0.08);
}

.intro-mode-btn.is-locked {
  opacity: 0.72;
  cursor: pointer;
}

.intro-mode-btn.is-locked:not(.active) .mode-label {
  color: var(--muted2);
}

.intro-mode-btn.is-locked.active {
  background: rgba(200, 169, 110, 0.06);
}

.test-intro-shell.intro--detailed-owned .intro-shop-hint {
  display: none !important;
}

.intro-entitled-banner {
  margin: 0 0 16px;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--gold);
  text-align: center;
  border: 1px solid var(--gold2);
  background: rgba(200, 169, 110, 0.06);
}

body.test-has-detailed .intro-mode-btn[data-mode="full"].is-locked {
  opacity: 1;
}

body.test-has-detailed .intro-mode-btn[data-mode="full"] .intro-mode-badge.is-owned {
  display: inline-block;
}

.intro-shop-hint.is-hidden {
  display: none !important;
}

/* Entitled vs locked — visually distinct intro states */
body.test-has-detailed.test-intro-detailed-active .test-intro-card {
  border-color: var(--gold2);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(200, 169, 110, 0.12);
}

body.test-has-detailed.test-intro-detailed-active .intro-mode-btn[data-mode='full'].active {
  background: rgba(200, 169, 110, 0.14);
}

body.test-has-detailed.test-intro-detailed-active .btn-primary--wide {
  background: linear-gradient(135deg, var(--gold2), var(--gold));
  color: #0a0a0a;
  letter-spacing: 0.14em;
}

body.test-needs-detailed .intro-mode-btn[data-mode='full'].is-locked .intro-mode-badge {
  color: var(--muted);
  border-color: var(--border2);
}

body.test-needs-detailed.test-intro-detailed-active .test-intro-card {
  border-color: var(--border2);
}

body.test-needs-detailed.test-intro-detailed-active .intro-shop-hint {
  color: var(--gold);
  font-weight: 500;
}

.qhdr--detailed {
  border-bottom-color: var(--gold2) !important;
}

.qhdr--detailed .qhdr-section::after {
  content: ' · Premium';
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--gold2);
  margin-left: 6px;
  vertical-align: middle;
}

.detailed-test-owned-badge {
  margin-top: 16px;
  padding: 8px 14px;
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold2);
  background: rgba(200, 169, 110, 0.08);
}

.test-continue-link {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  margin: 0;
  padding: 6px 0;
  border: none;
  background: none;
  color: var(--gold2);
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.test-continue-link--alt {
  color: var(--muted2);
}

.test-other-resume-wrap {
  margin-top: -4px;
}

#results .tab {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  letter-spacing: 0.12em;
}

#results .tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

#results .res-type {
  font-family: 'Bebas Neue', sans-serif;
}

#results .res-archetype {
  font-family: 'Playfair Display', serif;
  color: var(--gold);
}

#results .chip strong {
  color: var(--gold);
}

#results .panel-title {
  font-family: 'Playfair Display', serif;
}

#results .section-label,
#results .card-title {
  color: var(--gold2);
}

#results .bar-fill,
#results .trait-thumb,
#results .pbar-fill {
  background: linear-gradient(to right, var(--gold2), var(--gold));
}

body.page-test .modal-overlay {
  z-index: 500;
}

body.page-test .modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
}

body.page-test .toast {
  bottom: calc(var(--mbn-h) + var(--safe-bottom) + 16px);
}

body.page-test.phase-quiz .toast,
body.page-test.phase-loading .toast {
  bottom: 24px;
}

.q-section-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  letter-spacing: 0.28em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 14px;
  padding: 4px 12px;
  border: 1px solid var(--border2);
}

.q-dot {
  width: 4px;
  height: 4px;
  background: var(--gold);
  border-radius: 50%;
}

.q-header-row {
  margin-bottom: 12px;
}

body.page-test #quiz .q-text {
  font-family: 'Playfair Display', serif;
  font-size: clamp(22px, 4vw, 30px);
  line-height: 1.3;
  color: var(--white);
  font-weight: 400;
  margin-bottom: 0;
}

body.page-test #quiz .btn-explain {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted2);
  padding: 10px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  margin-bottom: 20px;
}

body.page-test #quiz .btn-explain:hover {
  border-color: var(--gold2);
  color: var(--gold);
}

body.page-test #quiz .explain-bubble {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-left: 2px solid var(--gold2);
  padding: 14px 18px;
  font-size: 13px;
  color: var(--muted2);
  line-height: 1.75;
  margin-bottom: 20px;
  display: none;
}

body.page-test #quiz .explain-bubble.open {
  display: block;
  animation: test-fade-up 0.35s ease both;
}

body.page-test #quiz .mc-choices,
body.page-test #quiz .agree-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 560px;
}

body.page-test #quiz .mc-choice,
body.page-test #quiz .agree-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  text-align: left;
  padding: 0;
}

body.page-test #quiz .mc-choice:hover,
body.page-test #quiz .agree-btn:hover {
  border-color: var(--gold2);
  background: var(--surface2);
  color: var(--text);
}

body.page-test #quiz .mc-choice.selected,
body.page-test #quiz .agree-btn.sel {
  border-color: var(--gold);
  background: rgba(200, 169, 110, 0.08);
  color: var(--text);
}

body.light-mode.page-test #quiz .mc-choice,
body.light-mode.page-test #quiz .agree-btn,
body.light-mode.page-test #quiz .scale-btn {
  background: var(--surface2);
}

.mc-letter,
.agree-letter,
.agree-lbl {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--muted);
  min-width: 44px;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 0;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  text-transform: uppercase;
  transition: color 0.15s, border-color 0.15s;
}

.agree-btn .agree-lbl {
  border-right: 1px solid var(--border);
}

.agree-btn:not(:has(.agree-label)) {
  align-items: stretch;
}

.agree-btn:not(:has(.agree-label)) .agree-lbl {
  align-self: stretch;
}

.mc-choice:hover .mc-letter,
.agree-btn:hover .agree-letter,
.agree-btn:hover .agree-lbl {
  color: var(--gold2);
  border-color: var(--gold2);
}

.mc-choice.selected .mc-letter,
.agree-btn.sel .agree-letter,
.agree-btn.sel .agree-lbl {
  color: var(--gold);
  border-color: var(--gold);
}

.mc-content,
.agree-label {
  padding: 14px 16px;
  flex: 1;
  min-width: 0;
}

.scale-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scale-row {
  display: flex;
  gap: 6px;
}

body.page-test #quiz .scale-btn {
  flex: 1;
  min-height: 52px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.page-test #quiz .scale-btn:hover {
  border-color: var(--gold2);
  color: var(--text);
}

body.page-test #quiz .scale-btn.sel {
  border-color: var(--gold);
  background: rgba(200, 169, 110, 0.1);
  color: var(--gold);
}

.scale-lbls {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 0 2px;
}

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 36px;
}

body.page-test #quiz .btn-sec {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted2);
  padding: 12px 24px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  min-height: 44px;
}

body.page-test #quiz .btn-sec:hover:not(:disabled) {
  border-color: var(--border2);
  color: var(--text);
}

body.page-test #quiz .btn-sec:disabled,
body.page-test #quiz .btn-next:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
}

body.page-test #quiz .btn-next {
  background: var(--gold);
  border: none;
  color: #000;
  padding: 12px 28px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s;
  min-height: 44px;
}

.btn-next:hover:not(:disabled) {
  background: var(--gold3);
}

.test-progress-wrap {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border);
  z-index: 201;
  display: none;
}

.test-progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--gold2), var(--gold));
  transition: width 0.4s ease;
  width: 0%;
}

.test-progress-label {
  position: fixed;
  top: calc(var(--nav-h) + 8px);
  right: max(16px, env(safe-area-inset-right));
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.12em;
  z-index: 201;
  display: none;
}

/* Milestone nudge every 10 questions — non-blocking */
.test-milestone-toast {
  position: fixed;
  top: calc(var(--nav-h) + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  z-index: 210;
  max-width: min(92vw, 420px);
  padding: 10px 18px;
  text-align: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--white, #f0ece4);
  background: rgba(12, 12, 12, 0.92);
  border: 1px solid rgba(200, 169, 110, 0.45);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

body.light-mode .test-milestone-toast {
  background: rgba(244, 241, 236, 0.96);
  color: #1a1a1a;
  border-color: rgba(160, 130, 70, 0.5);
}

.test-milestone-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

body.page-test.test-progress-on .test-milestone-toast {
  top: calc(var(--nav-h) + 18px);
}

/* ── Loading ── */
#loading {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-h));
  gap: 28px;
  padding: 40px 24px;
  text-align: center;
}

.load-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(24px, 5vw, 32px);
  font-weight: 400;
  font-style: italic;
  color: var(--gold);
}

.load-dots {
  display: flex;
  gap: 10px;
}

.load-dot {
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
  animation: test-load-dot 1.4s ease-in-out infinite;
}

.load-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.load-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes test-load-dot {
  0%, 80%, 100% {
    opacity: 0.2;
    transform: scale(0.75);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

.load-status {
  font-size: 12px;
  color: var(--muted2);
  letter-spacing: 0.08em;
}

.load-retry {
  font-size: 11px;
  color: var(--gold2);
  letter-spacing: 0.08em;
}

/* ── Results panels ── */
.res-hero {
  padding: 28px 24px 40px;
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(ellipse at 50% 0%, rgba(200, 169, 110, 0.06) 0%, transparent 62%);
}

.res-eyebrow {
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--gold2);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.res-type {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(56px, 10vw, 96px);
  color: var(--white);
  line-height: 1;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.res-archetype {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-style: italic;
  color: var(--gold);
  margin-bottom: 24px;
}

.res-tagline {
  max-width: 640px;
  margin: 0 auto 32px;
  color: var(--muted2);
  font-size: 14px;
  line-height: 1.85;
}

.res-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.chip {
  padding: 6px 14px;
  border: 1px solid var(--border2);
  font-size: 10px;
  color: var(--muted2);
  letter-spacing: 0.08em;
}

.chip strong {
  color: var(--gold);
  margin-right: 6px;
}

.tabs-wrap {
  position: sticky;
  top: var(--nav-h);
  background: rgba(8, 8, 8, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 150;
  overflow-x: auto;
}

body.light-mode .tabs-wrap {
  background: rgba(244, 241, 236, 0.97);
}

.tabs {
  display: flex;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

.tab {
  padding: 16px 18px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: 'DM Sans', sans-serif;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.tab-panels {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
  animation: test-fade-up 0.4s ease both;
}

@keyframes test-fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-title {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  color: var(--white);
  margin-bottom: 6px;
}

.panel-sub {
  font-size: 13px;
  color: var(--muted2);
  margin-bottom: 28px;
  line-height: 1.75;
}

.section-label {
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--gold2);
  text-transform: uppercase;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.card,
.card2 {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 20px;
  margin-bottom: 12px;
}

.card-title {
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--gold2);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 600px) {
  .grid2,
  .grid3 {
    grid-template-columns: 1fr;
  }
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.bar-label {
  font-size: 11px;
  color: var(--muted2);
  min-width: 60px;
}

.bar-label strong {
  color: var(--text);
  display: block;
  font-size: 12px;
}

.bar-wrap {
  flex: 1;
  height: 4px;
  background: var(--border);
}

.bar-fill {
  height: 100%;
  background: var(--gold);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.bar-fill.dim {
  background: var(--gold2);
}

.bar-fill.low {
  background: var(--border2);
}

.bar-num {
  font-size: 11px;
  color: var(--muted);
  min-width: 28px;
  text-align: right;
}

.trait-slider {
  margin-bottom: 16px;
}

.trait-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 6px;
}

.trait-track {
  height: 3px;
  background: var(--border);
  position: relative;
}

.trait-thumb {
  position: absolute;
  height: 100%;
  background: var(--gold);
  transition: width 1s ease;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  margin-bottom: 12px;
}

.stat-cell {
  background: var(--surface);
  padding: 20px 14px;
  text-align: center;
}

.stat-big {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 34px;
  color: var(--white);
  display: block;
  margin-bottom: 4px;
  line-height: 1;
}

.stat-lbl {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.narrative-block {
  border-left: 2px solid var(--gold2);
  padding: 18px 20px;
  margin-bottom: 14px;
  background: var(--surface);
  border-radius: 0 2px 2px 0;
}

.narrative-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-style: italic;
  color: var(--gold);
  margin-bottom: 8px;
}

.narrative-text {
  font-size: 13px;
  color: var(--muted2);
  line-height: 1.85;
}

.restart-wrap {
  text-align: center;
  padding: 48px 0 32px;
}

.btn-restart {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted2);
  padding: 12px 36px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-restart:hover {
  border-color: var(--gold2);
  color: var(--text);
}

.fade-in {
  animation: test-fade-up 0.4s ease forwards;
}

@media (max-width: 768px) {
  body.page-test #intro,
  body.page-test .test-intro {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .test-intro {
    min-height: auto;
    align-items: center;
    justify-content: center;
  }

  .test-intro-shell {
    width: 100%;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    padding: 24px max(16px, env(safe-area-inset-right)) 32px max(16px, env(safe-area-inset-left));
  }

  .test-intro-card {
    width: 100%;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
  }

  #quiz .qhdr {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  #quiz .qbody {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: calc(var(--mbn-h) + var(--safe-bottom) + 48px);
  }

  body.page-test #quiz .mc-choices,
  body.page-test #quiz .agree-grid,
  body.page-test #quiz .scale-wrap {
    margin-left: auto;
    margin-right: auto;
  }

  .nav-row {
    flex-wrap: wrap;
  }

  .btn-sec,
  .btn-next {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
  }

  .res-hero {
    padding-top: 24px;
  }

  .tab-panels {
    padding-bottom: calc(var(--mbn-h) + var(--safe-bottom) + 48px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel.active,
  .explain-bubble.open,
  .fade-in,
  .load-dot {
    animation: none !important;
  }
}

/* Override global style.css test letter badges */
body.page-test .mc-letter,
body.page-test .agree-letter,
body.page-test .agree-lbl {
  font-family: 'DM Sans', sans-serif !important;
  font-size: 10px !important;
  letter-spacing: 0.14em !important;
}

body.page-test .mc-choice:hover .mc-letter,
body.page-test .agree-btn:hover .agree-letter,
body.page-test .agree-btn:hover .agree-lbl {
  color: var(--gold2) !important;
}

body.page-test .mc-choice.selected .mc-letter,
body.page-test .agree-btn.sel .agree-letter,
body.page-test .agree-btn.sel .agree-lbl {
  color: var(--gold) !important;
}

/* ── Results extras (values, compass, figures, moral) ── */
body.page-test .value-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--text);
  margin: 4px;
  background: var(--surface);
}

body.page-test .value-dot {
  width: 4px;
  height: 4px;
  background: var(--gold);
  flex-shrink: 0;
}

body.page-test .moral-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

body.page-test .moral-row:last-child {
  border-bottom: none;
}

body.page-test .moral-name {
  color: var(--text);
  min-width: 100px;
}

body.page-test .moral-bar-wrap {
  flex: 1;
  height: 3px;
  background: var(--border);
}

body.page-test .moral-bar-fill {
  height: 100%;
  background: linear-gradient(to right, var(--gold2), var(--gold));
  transition: width 1s ease;
  width: 0%;
}

body.page-test .moral-num {
  color: var(--gold);
  min-width: 28px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

body.page-test .compass-wrap {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 0 auto 20px;
  aspect-ratio: 1;
}

body.page-test .compass-svg {
  width: 100%;
  height: 100%;
}

body.page-test .figures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

body.page-test .fig-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 16px;
  text-align: center;
  transition: border-color 0.2s;
}

body.page-test .fig-card:hover {
  border-color: var(--gold2);
}

body.page-test .fig-init {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-style: italic;
  color: var(--gold);
  margin-bottom: 8px;
  line-height: 1;
}

body.page-test .fig-name {
  font-size: 12px;
  color: var(--text);
  margin-bottom: 4px;
}

body.page-test .fig-type,
body.page-test .fig-note {
  font-size: 10px;
  color: var(--muted2);
  line-height: 1.5;
}

body.page-test .fig-cat {
  display: inline-block;
  font-size: 9px;
  letter-spacing: 0.12em;
  padding: 2px 8px;
  border: 1px solid var(--border2);
  color: var(--gold2);
  text-transform: uppercase;
  margin-bottom: 8px;
}

body.page-test .pos-badge {
  font-size: 8px;
  color: var(--gold2);
  margin-left: 4px;
  font-weight: normal;
}

body.page-test .ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  padding: 5px 12px;
  margin-bottom: 20px;
}

body.page-test .ai-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

body.page-test .btn-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: none;
  border: 1px solid var(--border2);
  color: var(--muted2);
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

body.page-test .btn-action:hover {
  border-color: var(--gold2);
  color: var(--gold);
}

body.page-test .modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

body.page-test .modal-overlay.open {
  display: flex;
}

body.page-test .modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 28px;
  max-width: 480px;
  width: 100%;
  position: relative;
}

body.page-test .modal-sub {
  font-size: 13px;
  color: var(--muted2);
  line-height: 1.7;
  margin-bottom: 16px;
}

body.page-test .share-url-wrap {
  display: flex;
  border: 1px solid var(--border);
}

body.page-test .share-url {
  flex: 1;
  padding: 12px;
  font-size: 11px;
  color: var(--muted2);
  word-break: break-all;
  min-width: 0;
}

body.page-test .btn-copy {
  border: none;
  border-left: 1px solid var(--border);
  background: var(--gold);
  color: #000;
  padding: 12px 16px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}

body.page-test .modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--muted2);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
}

/* In-test compare view */
body.page-test #compareView {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 24px calc(var(--mbn-h) + var(--safe-bottom) + 48px);
}

body.page-test .compare-header {
  text-align: center;
  margin-bottom: 28px;
}

body.page-test .compare-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(26px, 4vw, 32px);
  color: var(--white);
  margin-bottom: 8px;
}

body.page-test .compare-sub {
  font-size: 13px;
  color: var(--muted2);
  line-height: 1.65;
}

body.page-test .compare-legend {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 14px;
  font-size: 11px;
  color: var(--muted2);
}

body.page-test .compare-legend-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}

body.page-test .compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: var(--border);
  margin-bottom: 20px;
}

body.page-test .compare-col {
  background: var(--surface);
  padding: 20px;
}

body.page-test .compare-col-head {
  text-align: center;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

body.page-test .compare-type {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(36px, 8vw, 44px);
  color: var(--white);
  line-height: 1;
  letter-spacing: 0.06em;
}

body.page-test .compare-name {
  font-size: 12px;
  color: var(--gold);
  font-style: italic;
  margin-top: 4px;
}

body.page-test .compare-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 11px;
  align-items: flex-start;
}

body.page-test .compare-lbl {
  min-width: 52px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

body.page-test .compare-val {
  color: var(--text);
  flex: 1;
}

body.page-test .compare-section-title {
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--gold2);
  text-transform: uppercase;
  margin: 14px 0 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

body.page-test .compare-fn-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 11px;
}

body.page-test .compare-fn-lbl {
  min-width: 24px;
  color: var(--muted);
  font-weight: 500;
}

body.page-test .compare-fn-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

body.page-test .compare-bar-you,
body.page-test .compare-bar-them {
  height: 3px;
  transition: width 1s ease;
  width: 0%;
}

body.page-test .compare-bar-you {
  background: var(--gold);
}

body.page-test .compare-bar-them {
  background: #5a8a6a;
}

body.page-test .compare-fn-num {
  min-width: 22px;
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
  body.page-test .compare-grid {
    grid-template-columns: 1fr;
  }

  body.page-test .test-intro-shell {
    padding-top: 20px;
    padding-bottom: 28px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  body.page-test .test-action-bar .btn-action-profile {
    flex: 1 1 calc(50% - 6px);
  }
}

@media (max-width: 600px) {
  body.page-test .figures-grid {
    grid-template-columns: 1fr 1fr;
  }
}
