/* Scoped to a validated quest theme; unthemed cards keep their original rules. */
[data-qc-theme][data-qc-theme] {
  --qc-card-border-unavailable: #64748b;
  --qc-card-border-available: #38bdf8;
  --qc-card-border-unlocked: #2dd4bf;
  --qc-card-border-completed: #f59e0b;
}
[data-qc-theme][data-qc-theme] :is(.card-front, .card-back, .character-card-compact, .character-card-expanded, .impact-character-card, .quest-character-detail-card, .quest-character-detail-panel, .treasure-card, .qc-flip-face, .card-face-1, .quest-booklet-memento, .quest-memento-gallery-card, .quest-memento-gallery-extra-slot, .memento-award-card),
[data-qc-theme][data-qc-theme].collection-item,
[data-qc-theme][data-qc-theme].collection-detail {
  background: var(--qc-surface-tint, #1e293b) !important;
  border-color: var(--qc-border, #ffd700) !important;
  color: var(--qc-text, #f8fafc) !important;
}
[data-qc-theme][data-qc-theme] :is(.card-front, .card-back, .character-card-compact, .character-card-expanded, .impact-character-card, .quest-character-detail-card, .treasure-card, .card-face-1, .quest-booklet-memento, .quest-memento-gallery-card, .quest-memento-gallery-extra-slot, .memento-award-card) :is(h2, h3, h4, p, span, small, strong, em, a, div),
[data-qc-theme][data-qc-theme].collection-item :is(span, strong),
[data-qc-theme][data-qc-theme].collection-detail :is(p, h3, strong) {
  color: var(--qc-text, #f8fafc) !important;
  text-shadow: none !important;
}
[data-qc-theme][data-qc-theme] :is(.quest-booklet-memento, .quest-memento-gallery-extra-slot):not(.is-earned) {
  background: color-mix(in srgb, var(--qc-surface-tint, #1e293b) 40%, var(--qc-surface, #1e293b)) !important;
  border-color: var(--qc-border, #64748b) !important;
  border-style: dashed !important;
  box-shadow: none !important;
  opacity: 1 !important;
  filter: none !important;
}
[data-qc-theme][data-qc-theme] :is(.character-card-compact, .character-card-expanded, .impact-character-card):is(.locked, .unavailable, .is-locked, .is-unavailable) {
  background: #0b1220 !important;
  border-color: var(--qc-card-border-unavailable, #64748b) !important;
  border-style: solid !important;
  box-shadow: inset 0 0 22px rgba(0, 0, 0, .72), 0 8px 18px rgba(0, 0, 0, .45) !important;
  opacity: 1 !important;
  filter: none !important;
}
[data-qc-theme][data-qc-theme] :is(.character-card-compact.locked, .character-card-compact.unavailable, .character-card-compact.is-unavailable, .quest-booklet-memento:not(.is-earned), .quest-memento-gallery-extra-slot:not(.is-earned)) :is(p, span, small, strong, h3, h4, div),
[data-qc-theme][data-qc-theme] :is(.meta-1, .treasure-rarity, .qc-helps-hint, .character-description, .quest-character-detail-copy) {
  color: var(--qc-muted, #cbd5e1) !important;
  opacity: 1 !important;
}
[data-qc-theme][data-qc-theme] :is(.character-card-compact, .character-card-expanded, .impact-character-card):is(.available, .ready, .is-available) {
  border-color: var(--qc-card-border-available, #38bdf8) !important;
  border-style: solid !important;
  box-shadow: 0 0 10px color-mix(in srgb, var(--qc-card-border-available, #38bdf8) 46%, transparent) !important;
}
[data-qc-theme][data-qc-theme] :is(.character-card-compact, .character-card-expanded, .impact-character-card):is(.unlocked, .is-unlocked) {
  border-color: var(--qc-card-border-unlocked, #2dd4bf) !important;
  border-style: solid !important;
  box-shadow: 0 0 10px color-mix(in srgb, var(--qc-card-border-unlocked, #2dd4bf) 46%, transparent) !important;
}
[data-qc-theme][data-qc-theme] :is(.character-card-compact, .character-card-expanded, .impact-character-card):is(.completed, .is-completed, .beaten) {
  border-color: var(--qc-card-border-completed, #f59e0b) !important;
  border-style: solid !important;
  box-shadow: 0 0 12px color-mix(in srgb, var(--qc-card-border-completed, #f59e0b) 50%, transparent) !important;
}
#quest-booklet-modal [data-qc-theme] .character-card-compact.is-completed .character-name-compact,
#quest-booklet-modal .character-card-compact.is-completed .character-name-compact {
  color: #fffbeb !important;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85) !important;
}
/* Light theme booklet tiles are pale grey/cream — cream name ink fails AA. */
body.quest-theme-light #quest-booklet-modal [data-qc-theme] .character-card-compact .character-name-compact,
body.quest-theme-light #quest-booklet-modal .character-card-compact .character-name-compact,
body.quest-theme-light #quest-booklet-modal [data-qc-theme] .character-card-compact.is-completed .character-name-compact,
body.quest-theme-light #quest-booklet-modal .character-card-compact.is-completed .character-name-compact {
  color: #1a140b !important;
  -webkit-text-fill-color: currentColor !important;
  text-shadow: none !important;
}
[data-qc-theme][data-qc-theme] :is(.quest-booklet-memento.is-earned, .quest-memento-gallery-card, .quest-memento-gallery-extra-slot.is-earned, .memento-award-card),
[data-qc-theme][data-qc-theme].collection-item {
  border-color: var(--qc-accent, #ffd700) !important;
  box-shadow: var(--qc-glow, 0 4px 12px #0003) !important;
  background: var(--qc-gradient, linear-gradient(135deg, #334155, #1e293b)) top / 100% 5px no-repeat,
    var(--qc-surface-tint, #1e293b) !important;
}
[data-qc-theme][data-qc-theme] :is(.treasure-card.rare, .treasure-card[data-qc-rarity="rare"]) .qc-flip-face,
[data-qc-theme][data-qc-theme] :is(.card-option-1.rare, .card-option-1.epic, .card-option-1.legendary) .card-face-1 {
  border-color: transparent !important;
  background: linear-gradient(var(--qc-surface, #1e293b), var(--qc-surface, #1e293b)) padding-box,
    var(--qc-gradient, linear-gradient(135deg, #ffd700, #b8860b)) border-box !important;
  box-shadow: var(--qc-glow, 0 4px 12px #0003) !important;
}
/* Status chips stay semantic gold/green — not the quest accent control fill. */
[data-qc-theme][data-qc-theme] :is(.character-card-compact, .character-card-expanded, .impact-character-card, .quest-character-detail-card) :is(.quest-character-detail-status, .treasure-need-step.is-done) {
  background: #FBBF24 !important;
  color: #111827 !important;
  border-color: #D97706 !important;
}
[data-qc-theme][data-qc-theme] :is(.character-card-compact, .character-card-expanded, .impact-character-card):is(.locked, .unavailable, .is-unavailable) .character-status-tag {
  background: #334155 !important;
  color: #f8fafc !important;
  border-color: #64748b !important;
}
[data-qc-theme][data-qc-theme] :is(.character-card-compact, .character-card-expanded, .impact-character-card):is(.available, .ready, .is-available) .character-status-tag {
  background: var(--qc-card-border-available, #38bdf8) !important;
  color: #0b1220 !important;
  border-color: #0284c7 !important;
}
[data-qc-theme][data-qc-theme] :is(.character-card-compact, .character-card-expanded, .impact-character-card):is(.unlocked, .is-unlocked) .character-status-tag {
  background: var(--qc-card-border-unlocked, #2dd4bf) !important;
  color: #0b1220 !important;
  border-color: #0f766e !important;
}
[data-qc-theme][data-qc-theme] :is(.character-card-compact, .character-card-expanded, .impact-character-card):is(.completed, .beaten, .is-completed) .character-status-tag,
[data-qc-theme][data-qc-theme] :is(.character-card-compact.completed, .character-card-expanded.completed, .impact-character-card.completed) .character-status-tag {
  background: var(--qc-card-border-completed, #f59e0b) !important;
  color: #111827 !important;
  border-color: #b45309 !important;
  box-shadow: none !important;
}
[data-qc-theme][data-qc-theme] .character-card-compact .character-complete-badge {
  background: var(--qc-card-border-completed, #f59e0b) !important;
  color: #111827 !important;
  border-color: #b45309 !important;
}
[data-qc-theme][data-qc-theme] .treasure-need-step:not(.is-done) {
  box-shadow: inset 3px 0 var(--qc-accent, #ffd700);
}
/* Premium identity stays gold independently of the quest's border/glow. */
[data-qc-theme][data-qc-theme] :is(.quest-booklet-extra-badge, .quest-reading-premium-badge, .premium-badge),
[data-qc-theme][data-qc-theme] :is(.quest-booklet-memento, .quest-memento-gallery-extra-slot) span.quest-booklet-extra-badge,
[data-qc-theme][data-qc-theme] .treasure-card div.qc-bonus-badge {
  background: #ffd700 !important;
  color: #111 !important;
}
[data-qc-theme][data-qc-theme] :is(.character-card-compact, .character-status-tag, .card-face-1, .quest-booklet-memento, .quest-character-detail-card) {
  transition-property: transform, box-shadow !important;
}
[data-qc-theme][data-qc-theme] :is(.quest-character-detail-hero, .quest-character-detail-actions) {
  background: var(--qc-surface, #111827) !important;
  border-color: var(--qc-border, #ffd700) !important;
}
[data-qc-theme][data-qc-theme] .quest-character-detail-panel::before,
[data-qc-theme][data-qc-theme] .quest-character-detail-status::before {
  background: var(--qc-accent, #ffd700) !important;
}
[data-qc-theme][data-qc-theme] .quest-character-detail-hero::before {
  background: none;
}
[data-qc-theme][data-qc-theme] :is(.quest-character-detail-action, .quest-character-detail-close) {
  background: var(--qc-surface, #111827) !important;
  color: var(--qc-text, #f8fafc) !important;
  border-color: var(--qc-border, #ffd700) !important;
  font-size: 1rem !important;
  line-height: 1.2 !important;
  gap: 8px;
}
/* Sticky footer Talk CTA — SideQueso primary green (accent is decoration only). */
[data-qc-theme][data-qc-theme] .quest-character-detail-action.primary {
  background: #15803D !important;
  background-image: none !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border: 0 !important;
  border-bottom: 4px solid #166534 !important;
  box-shadow: none !important;
}
[data-qc-theme][data-qc-theme] .quest-character-detail-action.primary .quest-character-detail-action-label {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
body.quest-theme-light[data-qc-theme] .quest-character-detail-actions {
  background: color-mix(in srgb, var(--qc-surface, #d4deec) 92%, #0f172a) !important;
}

/* Specimen tags: parchment cards + thin quest-accent top edge (not pink/red wash). */
[data-qc-theme][data-qc-theme] #treasure-grid .card-option-1 .card-face-1.front,
[data-qc-theme][data-qc-theme] #treasure-grid .card-option-1 .card-face-1.back {
  background: linear-gradient(var(--qc-accent, #b08948) 0 4px, #fbf5e6 4px 100%) !important;
  background-color: #fbf5e6 !important;
  border-color: #b08948 !important;
  color: #2b1d0e !important;
  -webkit-text-fill-color: #2b1d0e !important;
  box-shadow: none !important;
}
[data-qc-theme][data-qc-theme] #treasure-grid .card-option-1 .card-face-1.back {
  background: linear-gradient(var(--qc-accent, #b08948) 0 4px, #fff9ef 4px 100%) !important;
  background-color: #fff9ef !important;
}
[data-qc-theme][data-qc-theme] #treasure-grid .card-option-1:is(.rare, .epic, .legendary) .card-face-1 {
  box-shadow: none !important;
}
[data-qc-theme][data-qc-theme] #treasure-grid .card-face-1 :is(.title-1, .treasure-description-title, .desc-1, .char-name, .char-msg) {
  color: #2b1d0e !important;
  -webkit-text-fill-color: #2b1d0e !important;
}
[data-qc-theme][data-qc-theme] #treasure-grid .card-face-1 .meta-1 {
  color: #3b2a10 !important;
  -webkit-text-fill-color: #3b2a10 !important;
}
[data-qc-theme][data-qc-theme] #treasure-grid .card-face-1 .char-row-1 {
  background: #f3e8d0 !important;
  color: #2b1d0e !important;
  opacity: 1 !important;
}
/* Treasures Give / Speak: flat dark-ink field journal (cream on ink, AA). */
[data-qc-theme][data-qc-theme] #treasure-grid .card-face-1 .speak-btn-1 {
  background: #2b1d0e !important;
  color: #fbf5e6 !important;
  -webkit-text-fill-color: #fbf5e6 !important;
  border: 1px solid #b08948 !important;
  border-bottom-width: 1px !important;
  box-shadow: none !important;
}
[data-qc-theme][data-qc-theme] #treasure-grid .card-option-1.has-active-character .card-face-1.front {
  border-color: var(--qc-needed-border, #22c55e) !important;
  box-shadow: var(--qc-needed-glow, 0 0 0 2px rgba(34,197,94,.35), 0 0 26px rgba(34,197,94,.6)) !important;
}
[data-qc-theme][data-qc-theme] .quest-booklet-memento-placeholder {
  background: var(--qc-surface-tint) !important;
  border: 1px dashed var(--qc-border) !important;
  color: var(--qc-muted) !important;
}

body.quest-theme-light[data-qc-theme] :is(
  .memento-award-card,
  .memento-award-item,
  .quest-memento-gallery-shell,
  #quest-memento-gallery-panel.chronicle-card,
  .quest-memento-gallery-extra-row,
  .quest-memento-gallery-extra-slot,
  .quest-memento-gallery-extra-placeholder,
  .quest-trading-card-viewer-panel,
  .quest-trading-card-back,
  .quest-trading-card-art,
  .home-collection,
  .collection-header,
  .quest-booklet-memento img,
  .quest-trader-card.treasures
) {
  background: var(--qc-surface-tint) !important;
  background-image: none !important;
  border-color: var(--qc-accent) !important;
  color: var(--qc-text) !important;
}
body.quest-theme-light[data-qc-theme] :is(
  .memento-award-card,
  .memento-award-item,
  .quest-memento-gallery-shell,
  #quest-memento-gallery-panel.chronicle-card,
  .quest-memento-gallery-extra-row,
  .quest-memento-gallery-extra-slot,
  .quest-memento-gallery-extra-placeholder,
  .quest-trading-card-viewer-panel,
  .quest-trading-card-back,
  .quest-trading-card-art,
  .home-collection,
  .collection-header,
  .quest-trader-card.treasures
) :is(h2, h3, h4, p, span, small, strong, em, a, div, li, label) {
  color: var(--qc-text) !important;
  text-shadow: none !important;
}
body.quest-theme-light[data-qc-theme] :is(
  .memento-award-title,
  .memento-award-subtitle,
  .memento-award-guidance,
  .memento-award-item-title,
  .memento-award-item-subtitle,
  .quest-memento-gallery-card-title,
  .quest-memento-gallery-card-copy,
  .quest-memento-gallery-extra-heading,
  .quest-trading-card-back-copy,
  .quest-trading-card-detail-label,
  .quest-trading-card-detail-value,
  .quest-trading-card-viewer-title,
  .quest-trading-card-viewer-subtitle,
  .quest-trading-card-viewer-counter,
  .quest-trading-card-viewer-kind,
  .quest-trading-card-viewer-description
) {
  color: var(--qc-text) !important;
  text-shadow: none !important;
}
/* Treasures Holding/Got/Gave ledger: parchment (not pink qc-surface-tint wash). */
body.quest-theme-light[data-qc-theme] .treasure-ledger-strip .treasure-accounting-card,
body.quest-theme-light[data-qc-theme] .treasure-accounting-summary .treasure-accounting-card,
body.quest-theme-light[data-qc-theme] .treasure-accounting-card {
  background: linear-gradient(180deg, #fff9ef 0%, #fbf5e6 55%, #f3e8d0 100%) !important;
  background-color: #fbf5e6 !important;
  background-image: linear-gradient(180deg, #fff9ef 0%, #fbf5e6 55%, #f3e8d0 100%) !important;
  border: 1.5px solid #b08948 !important;
  border-color: #b08948 !important;
  color: #2b1d0e !important;
  -webkit-text-fill-color: #2b1d0e !important;
  box-shadow: none !important;
}
body.quest-theme-light[data-qc-theme] .treasure-accounting-card :is(strong, b, span),
body.quest-theme-light[data-qc-theme] .treasure-accounting-card strong,
body.quest-theme-light[data-qc-theme] .treasure-accounting-card b {
  color: #2b1d0e !important;
  -webkit-text-fill-color: #2b1d0e !important;
  text-shadow: none !important;
}
body.quest-theme-light[data-qc-theme] .treasure-accounting-card span {
  color: #3f2e1c !important;
  -webkit-text-fill-color: #3f2e1c !important;
}
body.quest-theme-light[data-qc-theme] :is(
  .memento-award-image,
  .quest-memento-gallery-card img,
  .quest-memento-gallery-extra-slot img
) {
  background: var(--qc-surface-tint) !important;
  border-color: var(--qc-accent) !important;
}
body.quest-theme-light[data-qc-theme] .memento-award-scope {
  background: color-mix(in srgb, var(--qc-accent) 18%, var(--qc-surface)) !important;
  color: var(--qc-text) !important;
}

[data-quest-banner-slot]:empty { display: none !important; }
.quest-home-banner-slot { grid-column: 1 / -1; min-width: 0; }
.quest-banner-media,
.hero-banner-media-frame,
.quest-card-media-frame {
  position: relative;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  margin: 0;
}
.quest-banner-media > img,
.hero-banner-media-frame > img,
.quest-card-media-frame > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}
.quest-banner {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  aspect-ratio: auto;
  min-width: 0;
  overflow: hidden;
  border-radius: 16px;
  margin: 0;
  isolation: isolate;
}
.quest-banner > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 1;
  flex: none;
  object-fit: cover;
  object-position: center 35%;
}
.quiz-preflight-banner-slot {
  width: 100%;
  max-width: min(100%, 640px);
  margin: 0 0 4px;
  min-width: 0;
}
.quiz-preflight-banner-slot:empty { display: none; }
.quiz-preflight-banner-slot .quest-banner {
  width: 100%;
  margin: 0;
  border-radius: 14px;
  background: rgba(8, 14, 28, 0.45);
}
.quiz-preflight-banner-slot .quest-banner > img {
  aspect-ratio: 3 / 1;
}
.quiz-preflight-banner-slot .quest-banner > .quest-banner__title {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.sq-art-frame,
.quiz-results-art-frame {
  position: relative;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.sq-art-frame > img,
.quiz-results-art-frame > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sq-art-frame--banner { aspect-ratio: 3 / 1; width: 100%; }
.sq-art-frame--portrait,
.quiz-results-art-frame {
  aspect-ratio: 3 / 4;
  width: min(132px, 34vw);
  flex: 0 0 auto;
}
.quiz-results-art {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
  justify-content: center;
  grid-column: 1 / -1;
  width: 100%;
  margin: 0 0 4px;
}
.quiz-results-art:empty { display: none; }
.impact-character-portrait {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 6px;
  background: rgba(255, 255, 255, 0.08);
}
body.results-mode .impact-character-portrait,
body.quest-theme-light.results-mode .impact-character-portrait {
  width: 96px;
  height: 96px;
  border-radius: 50%;
}
body.quest-theme-light:not(.results-mode) .impact-character-portrait {
  width: 64px;
  height: 64px;
  border-radius: 50%;
}
.impact-character-portrait > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#quest-reading-path .quest-banner,
#quest-reading-path [data-quest-banner-slot] .quest-banner {
  max-height: none;
  overflow: visible;
}
#quest-reading-path .quest-banner > img {
  max-height: min(18vh, 112px);
  height: min(18vh, 112px);
  aspect-ratio: auto;
  object-fit: cover;
}
#quest-reading-path .quest-reading-card-banner .quest-banner > img,
#quest-reading-path .quest-reading-card-banner .quest-banner-media > img {
  max-height: min(22vh, 140px);
  height: min(22vh, 140px);
}
.quest-opening-content:has(> .quest-opening-banner) > h2,
.quest-opening-card:has(> .quest-opening-banner) > h1 {
  display: none;
}
.quest-opening-card { min-width: 0; box-sizing: border-box; }
.quest-opening-banner { margin-bottom: 16px; }
.quest-opening-identity { display: grid; gap: 12px; text-align: left; }
.quest-opening-identity :is(input, select) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  font-size: 16px;
}
.quest-opening-card:has(.quest-opening-identity) .quest-opening-controls {
  position: sticky;
  bottom: 0;
  padding: 10px 0;
  background: var(--qc-surface, #182234);
}
#change-profile-modal .modal-content {
  box-sizing: border-box;
  width: min(92vw, 540px);
  max-height: 90dvh;
  overflow-y: auto;
}
#change-profile-modal :is(input, select, button) {
  box-sizing: border-box;
  max-width: 100%;
  min-height: 44px;
}
/* Save Changes: keep primary (deep orange) vs Cancel (.secondary-btn grey).
   White on #B45309 is ≥4.5:1 (coral→#ffa500 was ~2:1 on the orange end). */
#change-profile-modal .auth-form button[type="submit"] {
  background: #B45309 !important;
  color: #ffffff !important;
}
/* Change Your Name labels: later .form-group label slate (#34495e) was ~1.1:1
   on the purple→teal modal gradient. Dark ink on a cream plate clears AA. */
#change-profile-modal .form-group label,
#change-profile-modal.modal .form-group label,
#change-profile-modal .auth-form .form-group label {
  color: #1a140b !important;
  -webkit-text-fill-color: #1a140b !important;
  background: #f5e8c8;
  opacity: 1 !important;
  text-shadow: none;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-weight: 700;
}
/* Name/title fields: cream + dark ink (beat quest-theme dark input wash). */
#change-profile-modal .form-group :is(input, select),
#change-profile-modal :is(#new-name, #new-title) {
  background: #f5e8c8 !important;
  color: #1a140b !important;
  -webkit-text-fill-color: #1a140b !important;
  border: 2px solid #c4b89a !important;
  box-shadow: none !important;
  caret-color: #1a140b;
}
#change-profile-modal :is(#new-name, #new-title)::placeholder {
  color: #5c4a32 !important;
  -webkit-text-fill-color: #5c4a32 !important;
  opacity: 1 !important;
}
#change-profile-modal :is(#new-name, #new-title):invalid,
#change-profile-modal :is(#new-name, #new-title):user-invalid {
  border-color: #c4b89a !important;
  box-shadow: none !important;
  outline: none !important;
  outline-color: transparent !important;
  outline-width: 0 !important;
}
#change-profile-modal :is(#new-name, #new-title)[aria-invalid="true"],
#change-profile-modal :is(#new-name, #new-title).is-error,
#change-profile-modal :is(#new-name, #new-title)[aria-invalid="true"]:invalid,
#change-profile-modal :is(#new-name, #new-title).is-error:invalid {
  border: 2px solid #b91c1c !important;
  outline: none !important;
}
/* Accent allowed on chapter/quest header art band only. */
body .quest-banner > .quest-banner__title {
  position: static;
  inset: auto;
  padding: 8px 14px 10px;
  margin: 0;
  background: var(--qc-accent, #1e293b) !important;
  color: var(--qc-on-accent, #fff) !important;
  font-size: clamp(1rem, 4.6vw, 1.4rem);
  font-weight: 800;
  line-height: 1.25;
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
  white-space: normal;
  overflow-wrap: break-word;
  text-overflow: clip;
  text-shadow: none;
}
body .quest-banner > .quest-banner__title:empty,
body .quest-banner > .quest-banner__title[hidden] {
  display: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}
.quest-hub-title.quest-banner-heading-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.quest-booklet-page[data-booklet-page="welcome"]:has(> [data-quest-banner-slot] > .quest-banner) > h3 {
  display: none;
}
#quest-booklet-modal [data-booklet-page="welcome"] > [data-quest-banner-slot] {
  display: block;
  width: 100%;
  min-width: 0;
  flex: 0 0 auto;
  aspect-ratio: 3 / 1;
  height: auto;
  min-height: min(18dvh, calc((100vw - 24px) / 3));
}
#quest-booklet-modal [data-booklet-page="welcome"] .quest-banner {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 3 / 1;
  overflow: hidden;
}
#quest-booklet-modal [data-booklet-page="welcome"] .quest-banner > img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  min-height: 0;
  aspect-ratio: 3 / 1;
  object-fit: cover;
  object-position: center center;
}
/* Desktop short viewports: cap Welcome banner height so tiles/Memento/candle
   can sit in the first view or scroll cleanly above the Booklet footer. */
@media (min-width: 601px) and (max-height: 900px) {
  #quest-booklet-modal [data-booklet-page="welcome"] > [data-quest-banner-slot] {
    flex: 0 1 auto;
    aspect-ratio: auto;
    max-height: min(200px, 26vh);
    min-height: 0;
    overflow: hidden;
  }
  #quest-booklet-modal [data-booklet-page="welcome"] .quest-banner,
  #quest-booklet-modal [data-booklet-page="welcome"] .quest-banner > img {
    aspect-ratio: auto;
    height: 100%;
    max-height: min(200px, 26vh);
  }
}
#quest-booklet-modal [data-booklet-page="welcome"] .quest-banner > .quest-banner__title {
  display: none;
}
@media (max-width: 600px) {
  .quest-home-banner-slot:not(:empty) {
    margin-inline: -18px;
    width: calc(100% + 36px);
  }
  #quest-booklet-modal .quest-booklet-page > .quest-banner,
  #quest-booklet-modal .quest-booklet-page > [data-quest-banner-slot]:not(:empty) {
    margin-inline: 0;
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  [data-qc-theme] :is(.character-card-compact, .character-card-expanded, .impact-character-card, .treasure-card, .card-face-1, .qc-flip-face, .quest-booklet-memento, .quest-memento-gallery-card, .quest-memento-gallery-extra-slot) {
    animation: none !important;
  }
  [data-qc-theme][data-qc-theme] #treasure-grid .card-option-1.has-active-character .card-face-1.front {
    animation: none !important;
  }
}
@media (forced-colors: active) {
  [data-qc-theme][data-qc-theme] {
    --qc-surface: Canvas !important;
    --qc-surface-tint: Canvas !important;
    --qc-text: CanvasText !important;
    --qc-muted: CanvasText !important;
    --qc-accent: Highlight !important;
    --qc-accent-strong: Highlight !important;
    --qc-border: CanvasText !important;
    --qc-on-accent: HighlightText !important;
    --qc-gradient: none !important;
    --qc-glow: none !important;
    --qc-needed-border: Highlight !important;
    --qc-needed-glow: none !important;
    --qc-card-border-unavailable: GrayText !important;
    --qc-card-border-available: Highlight !important;
    --qc-card-border-unlocked: Highlight !important;
    --qc-card-border-completed: Highlight !important;
  }
  .quest-banner { --qc-accent: Highlight !important; --qc-on-accent: HighlightText !important; }
}
