:root {
  --ex-dark-bg: #0a0612;
  --ex-dark-panel: rgba(22, 12, 36, 0.72);
  --ex-dark-panel-strong: rgba(30, 16, 49, 0.88);
  --ex-dark-line: rgba(221, 203, 255, 0.18);
  --ex-dark-text: #fffafd;
  --ex-dark-muted: #d2c7df;
  --ex-dark-soft: #aa9bbd;
  --ex-dark-purple: #bd72ff;
  --ex-dark-purple-deep: #7c45e8;
  --ex-dark-pink: #e972b7;
  --ex-dark-shadow: 0 18px 48px rgba(2, 0, 10, 0.34);
}

html.excompat-dark,
html.excompat-dark body {
  min-height: 100%;
  background: var(--ex-dark-bg) !important;
  color: var(--ex-dark-text) !important;
}

html.excompat-dark body {
  position: relative;
  overflow-x: hidden;
  isolation: isolate;
}

html.excompat-dark body::before {
  content: "";
  position: fixed;
  inset: -2px;
  z-index: -2;
  background-image:
    linear-gradient(180deg, rgba(7, 4, 13, 0.18), rgba(7, 4, 13, 0.42)),
    url("/assets/quiz-bg-calm-stars-v1.webp");
  background-position: 50% 50%;
  background-size: cover;
  background-repeat: no-repeat;
  transform: translateZ(0);
}

html.excompat-dark body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 82% 12%, rgba(137, 83, 206, 0.08), transparent 27%),
    radial-gradient(circle at 12% 88%, rgba(196, 79, 145, 0.07), transparent 31%),
    linear-gradient(180deg, rgba(5, 3, 10, 0.03), rgba(5, 3, 10, 0.2));
}

/* Decision screens explicitly retain the same quiet background. This selector
   stays separate so later per-screen adjustments do not reintroduce the old
   relationship artwork on the start or other quiz routes. */
html.excompat-dark.ex-calm-quiz-bg body::before {
  background-image:
    linear-gradient(180deg, rgba(7, 4, 13, 0.18), rgba(7, 4, 13, 0.42)),
    url("/assets/quiz-bg-calm-stars-v1.webp");
  background-position: 50% 50%;
  background-size: cover;
}

html.excompat-dark.ex-calm-quiz-bg body::after {
  background:
    radial-gradient(circle at 82% 12%, rgba(137, 83, 206, 0.08), transparent 27%),
    radial-gradient(circle at 12% 88%, rgba(196, 79, 145, 0.07), transparent 31%),
    linear-gradient(180deg, rgba(5, 3, 10, 0.03), rgba(5, 3, 10, 0.2));
}

html.excompat-dark .page {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  background: transparent !important;
  color: var(--ex-dark-text) !important;
}

html.excompat-dark .app-header,
html.excompat-dark .app-header-center,
html.excompat-dark .quiz-logo-bar,
html.excompat-dark .progress-header,
html.excompat-dark .progress-top {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

html.excompat-dark .quiz-logo-bar,
html.excompat-dark .app-header,
html.excompat-dark .app-header-center {
  padding-top: max(12px, env(safe-area-inset-top)) !important;
}

html.excompat-dark .progress-header {
  position: relative;
}

html.excompat-dark .mg-info-progress {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0 20px 10px;
}

html.excompat-dark .mg-info-progress .progress-top {
  min-height: 44px;
}

html.excompat-dark .progress-header::before {
  content: "";
  position: absolute;
  inset: -26px -18px -12px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 3, 16, 0.72), rgba(8, 3, 16, 0.08));
}

html.excompat-dark .logo,
html.excompat-dark .logo-sm {
  filter: brightness(0) invert(1) drop-shadow(0 4px 14px rgba(255, 255, 255, 0.16));
}

html.excompat-dark .burger,
html.excompat-dark .back {
  color: #f6efff !important;
}

html.excompat-dark .progress-track {
  background: rgba(255, 255, 255, 0.13) !important;
  overflow: hidden;
}

html.excompat-dark .progress-fill {
  background: linear-gradient(90deg, var(--ex-dark-pink), var(--ex-dark-purple-deep)) !important;
  box-shadow: 0 0 18px rgba(194, 160, 255, 0.5);
}

html.excompat-dark .category,
html.excompat-dark .step-badge,
html.excompat-dark .accent {
  color: #dcc8ff !important;
}

html.excompat-dark .rotator-line,
html.excompat-dark .rotator-line.on {
  color: #bd72ff !important;
  text-shadow:
    0 0 18px rgba(174, 86, 255, 0.42),
    0 3px 22px rgba(68, 19, 126, 0.42) !important;
}

html.excompat-dark .rotator-line.on {
  opacity: 1 !important;
}

html.excompat-dark .static-line {
  color: #ffffff !important;
  opacity: 1 !important;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.52) !important;
}

html.excompat-dark .step-badge {
  background: rgba(145, 91, 236, 0.2) !important;
  border: 1px solid rgba(207, 176, 255, 0.28) !important;
  box-shadow: 0 8px 24px rgba(82, 39, 137, 0.22);
}

html.excompat-dark .heading,
html.excompat-dark .question,
html.excompat-dark .scan-title,
html.excompat-dark h1,
html.excompat-dark h2,
html.excompat-dark h3 {
  color: var(--ex-dark-text) !important;
  text-shadow: 0 2px 20px rgba(1, 0, 7, 0.48);
}

html.excompat-dark .question-sub,
html.excompat-dark .consent,
html.excompat-dark .privacy,
html.excompat-dark .footer,
html.excompat-dark .static-line,
html.excompat-dark .rotator,
html.excompat-dark p {
  color: var(--ex-dark-muted) !important;
}

html.excompat-dark .heading .static-line {
  color: #ffffff !important;
  opacity: 1 !important;
}

html.excompat-dark .badge-text small {
  color: #d8cce7 !important;
  opacity: 0.88 !important;
}

html.excompat-dark .badge-text b {
  color: #fff !important;
  opacity: 1 !important;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
}

html.excompat-dark .option-card,
html.excompat-dark .input,
html.excompat-dark .date-wheel,
html.excompat-dark .scan-upload,
html.excompat-dark .zodiac-info,
html.excompat-dark .chip,
html.excompat-dark .badge,
html.excompat-dark .scan-example,
html.excompat-dark .phone-input,
html.excompat-dark .country-select {
  color: var(--ex-dark-text) !important;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.025)),
    var(--ex-dark-panel) !important;
  border: 1px solid var(--ex-dark-line) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    var(--ex-dark-shadow) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
}

html.excompat-dark .option-card {
  position: relative;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

html.excompat-dark .option-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 18%, rgba(255, 255, 255, 0.08) 48%, transparent 78%);
  opacity: 0.35;
  transform: translateX(-70%);
}

html.excompat-dark .option-card:hover,
html.excompat-dark .option-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(199, 161, 255, 0.52) !important;
  background: rgba(37, 20, 61, 0.86) !important;
}

html.excompat-dark .option-card:active {
  transform: scale(0.985);
}

html.excompat-dark .option-label,
html.excompat-dark .wheel-item.selected,
html.excompat-dark input,
html.excompat-dark select,
html.excompat-dark textarea {
  color: var(--ex-dark-text) !important;
}

html.excompat-dark .option-emoji {
  display: grid;
  place-items: center;
  min-width: 40px;
  min-height: 40px;
  border: 0 !important;
  border-radius: 14px;
  background: rgba(180, 119, 255, 0.08) !important;
  box-shadow: none !important;
  color: #eadcff !important;
  text-shadow: 0 0 16px rgba(190, 118, 255, 0.35);
}

html.excompat-dark .option-emoji img {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 7px 14px rgba(87, 45, 166, 0.28));
}

html.excompat-dark .wheel-item {
  color: rgba(222, 211, 234, 0.46) !important;
}

html.excompat-dark .wheel-item.selected {
  background: rgba(142, 91, 235, 0.2) !important;
  border-color: rgba(207, 176, 255, 0.28) !important;
}

html.excompat-dark .zodiac-badge,
html.excompat-dark .zodiac-chip {
  color: #f6eefe !important;
  background: rgba(23, 12, 39, 0.75) !important;
  border-color: rgba(220, 195, 255, 0.22) !important;
}

html.excompat-dark .zodiac-badge {
  display: grid !important;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px !important;
  border: 1px solid rgba(220, 195, 255, 0.2) !important;
  border-radius: 22px !important;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.02)),
    rgba(24, 13, 40, 0.74) !important;
  box-shadow: var(--ex-dark-shadow) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
}

html.excompat-dark .zodiac-glyph {
  display: grid !important;
  place-items: center;
  width: 58px !important;
  height: 58px !important;
  border-radius: 19px !important;
  color: #fff !important;
  background: linear-gradient(145deg, #a66af2, #6537cf) !important;
  box-shadow: 0 10px 28px rgba(92, 47, 180, 0.36) !important;
}

html.excompat-dark .zodiac-info {
  min-width: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

html.excompat-dark .zodiac-info b {
  display: block;
  margin-bottom: 7px;
  color: #fff !important;
  font-size: 20px !important;
  line-height: 1.1;
}

html.excompat-dark .zodiac-chips {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px;
}

html.excompat-dark .zodiac-chips em {
  padding: 5px 9px !important;
  border: 1px solid rgba(218, 194, 255, 0.18) !important;
  border-radius: 999px !important;
  color: #eadfff !important;
  background: rgba(151, 94, 234, 0.2) !important;
  font-size: 12px !important;
  font-style: normal !important;
}

html.excompat-dark .zodiac-info small {
  display: block;
  margin-top: 8px;
  color: var(--ex-dark-muted) !important;
  font-size: 12px !important;
  line-height: 1.35;
}

html.excompat-dark .scan-example {
  border: 1px solid rgba(222, 203, 255, 0.2) !important;
  border-radius: 24px !important;
  background: rgba(22, 12, 36, 0.82) !important;
  box-shadow: var(--ex-dark-shadow) !important;
  filter: none !important;
}

html.excompat-dark .scan-example.correct {
  filter: none !important;
}

html.excompat-dark .scale-annot-bubble {
  color: #fff !important;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(28, 15, 47, 0.92) !important;
  border: 1px solid rgba(222, 199, 255, 0.28) !important;
  box-shadow: 0 12px 34px rgba(2, 0, 10, 0.35) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
}

html.excompat-dark .scale-ends {
  color: #f0e8f8 !important;
  font-weight: 700 !important;
  opacity: 1 !important;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.72);
}

html.excompat-dark .scale-range {
  accent-color: #a75df3;
}

html.excompat-dark .progress-bar-wrap,
html.excompat-dark .progress-bar {
  background: rgba(255, 255, 255, 0.16) !important;
}

html.excompat-dark .progress-pct {
  color: #c989ff !important;
  font-size: 18px !important;
  font-weight: 850 !important;
  opacity: 1 !important;
  text-shadow: 0 0 17px rgba(176, 89, 255, 0.42);
}

html.excompat-dark .page:has(.progress-pct) .question-sub,
html.excompat-dark .page:has(.progress-pct) .scan-status,
html.excompat-dark .page:has(.progress-pct) p {
  color: #eee4f7 !important;
  opacity: 1 !important;
  font-weight: 650 !important;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.74);
}

html.excompat-dark .tc-intro {
  color: var(--ex-dark-text) !important;
  background: rgba(24, 13, 40, 0.68) !important;
  border: 1px solid rgba(220, 195, 255, 0.18) !important;
  box-shadow: var(--ex-dark-shadow) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
}

html.excompat-dark .tc-intro-text {
  color: #eee5f7 !important;
  opacity: 1 !important;
}

html.excompat-dark .tp-card {
  color: #fff !important;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.02)),
    rgba(25, 13, 42, 0.9) !important;
  border: 1px solid rgba(218, 193, 255, 0.22) !important;
  box-shadow: 0 15px 40px rgba(2, 0, 10, 0.32) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
}

html.excompat-dark .tp-card.on {
  border-color: #a865f5 !important;
  background:
    linear-gradient(145deg, rgba(181, 106, 255, 0.22), rgba(203, 74, 183, 0.12)),
    rgba(31, 15, 52, 0.94) !important;
  box-shadow: 0 16px 44px rgba(112, 54, 211, 0.38), inset 0 0 0 1px rgba(220, 187, 255, 0.16) !important;
}

html.excompat-dark .tp-price,
html.excompat-dark .tp-card.on .tp-price {
  color: #fff !important;
  background: none !important;
  -webkit-text-fill-color: #fff !important;
  opacity: 1 !important;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.5);
}

html.excompat-dark .tp-card.on .tp-price {
  color: #d49bff !important;
  -webkit-text-fill-color: #d49bff !important;
}

html.excompat-dark .tp-cap,
html.excompat-dark .tp-card.on .tp-cap {
  color: #d8cde4 !important;
  opacity: 1 !important;
}

html.excompat-dark .tp-check {
  color: #fff !important;
  background: rgba(159, 92, 240, 0.16) !important;
  border-color: rgba(222, 199, 255, 0.34) !important;
}

html.excompat-dark .palm-shot,
html.excompat-dark .palm-legend-chip {
  color: #fff !important;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.02)),
    rgba(25, 13, 42, 0.86) !important;
  border: 1px solid rgba(218, 193, 255, 0.2) !important;
  box-shadow: 0 14px 38px rgba(2, 0, 10, 0.28) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
}

html.excompat-dark .palm-shot img {
  background: rgba(12, 7, 22, 0.7) !important;
}

html.excompat-dark .palm-shot figcaption,
html.excompat-dark .palm-legend-chip {
  color: #efe7f8 !important;
  opacity: 1 !important;
}

html.excompat-dark .cta {
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  background: linear-gradient(100deg, #7847ed 0%, #9848e0 50%, #c148bd 100%) !important;
  box-shadow:
    0 14px 38px rgba(113, 48, 214, 0.48),
    0 0 24px rgba(178, 77, 237, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  text-shadow: 0 1px 6px rgba(25, 8, 54, 0.45);
}

html.excompat-dark .cta:hover,
html.excompat-dark .cta:focus-visible {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

html.excompat-dark .prelanding .hero {
  background:
    linear-gradient(180deg, rgba(14, 7, 26, 0.16), rgba(14, 7, 26, 0.62)),
    rgba(20, 10, 34, 0.32) !important;
  border: 1px solid rgba(226, 205, 255, 0.15);
  box-shadow: var(--ex-dark-shadow);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

html.excompat-dark .prelanding .chip,
html.excompat-dark .prelanding .badge {
  color: #f8f1ff !important;
}

html.excompat-dark .prelanding .chip svg,
html.excompat-dark .prelanding .chip [class*="icon"],
html.excompat-dark .prelanding .badge-icon.accent {
  color: #c683ff !important;
}

html.excompat-dark .prelanding .chips {
  display: grid !important;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 9px !important;
  width: 100%;
}

html.excompat-dark .prelanding .chip {
  width: 100% !important;
  min-width: 0 !important;
  justify-content: center !important;
  padding-inline: 10px !important;
  font-size: 13px !important;
  white-space: nowrap;
}

html.excompat-dark .prelanding .chip:nth-child(3) {
  grid-column: 1 / -1;
  width: min(100%, 278px) !important;
  justify-self: center;
}

html.excompat-dark a {
  color: #caa9ff !important;
}

@media (max-width: 520px) {
  html.excompat-dark body::before {
    background-position: 50% 46%;
  }

  html.excompat-dark .page {
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  html.excompat-dark .option-card,
  html.excompat-dark .input,
  html.excompat-dark .date-wheel,
  html.excompat-dark .scan-upload {
    border-radius: 20px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.excompat-dark *,
  html.excompat-dark *::before,
  html.excompat-dark *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
