/* batch4-integration — fixes found by the integrated full-app check (qa/nav/batch4-integrated-live.mjs) on the
   merged batch-4 branch. Loaded last so it can correct earlier sheets without editing them. Every rule names what
   it fixes; contrast values are measured (WCAG: 4.5:1 text, 3:1 large text / icons). */

/* ── Pop-ups are always centred (owner rule): the video upload wizard and the Studio "Edit video" editor were
      bottom sheets below 600px (css/style.css "Mobile"). ─────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  body .video-upload-overlay { padding: 16px; align-items: center; justify-content: center; }
  body .video-upload-overlay .video-upload-modal-premium,
  body .video-upload-overlay > .vu-modal { border-radius: 24px; max-width: 100%; max-height: calc(100dvh - 32px); }
}

/* ── Upload wizard ───────────────────────────────────────────────────────────────────────────────────────────
   Dark: the ACTIVE step's label was grey on the purple pill (1.3:1) — `body:not(.light) .vu-step-pill` out-ranked
   `.vu-step-pill.active`. The pill and "Select file" also put white on the light end of the accent (3.2:1). */
.vu-step-pill.active, body:not(.light) .vu-step-pill.active, .vu-cta-pill {
  background: linear-gradient(135deg, var(--accent-strong, #7c3aed), color-mix(in srgb, var(--accent-strong, #7c3aed) 76%, #000));
  color: #fff;
}
.vu-step-pill.active .vu-step-num, body:not(.light) .vu-step-pill.active .vu-step-num { background: rgba(0, 0, 0, 0.22); color: #fff; }
body.light .vu-btn-ghost { color: #4b5563; }
body.light .vu-subtitle, body.light .vu-dropzone p { color: #5b6472; }

/* ── Goals (js/goals-hub.js): white and gold text sat on the light top of the hero gradient (2.9–4.2:1). The hero,
      the Badge earned card and the podium keep the app's purple, one step deeper. ─────────────────────────── */
#goalsHubPage, .gh-modal, .quests-hub-strip { --gh-hero: linear-gradient(160deg, #5a3ae6 0%, #4c2fd6 55%, #3d22b8 100%); }
.gh-modal-earned .gh-modal-card { background: linear-gradient(160deg, #5a3ae6 0%, #4c2fd6 55%, #3d22b8 100%); }
.gh-pod .gh-av-initials, .gh-av-initials.is-me { background: linear-gradient(160deg, #6d4df1, #4c2fd6); }
.gh-pod-3 .gh-pod-av em { background: #8a5a2b; }
body.light .gh-row-rank.is-first { color: #9a5b00; }
body.light #goalsHubPage, body.light .gh-modal, body.light .quests-hub-strip { --gh-sub: #5c5580; --gh-rank-level: #5c5080; }
body.light .gv2-app-links a:not(.gv2-open-app) { color: color-mix(in srgb, var(--accent-strong, #7c3aed) 80%, #000); }
.gh-pod small { color: #ffe08a; }
.gh-pod-1 .gh-pod-av em { background: #9a5b00; }
.gh-pod-2 .gh-pod-av em { background: #5e5099; }
.gh-hex-inner { color: #9a5200; }
.gh-unread { background: #c81e4a; }
body.light .gh-ms-label { color: #5f53a6; }
body.light .gh-ms.is-done .gh-ms-label, body.light .gh-ms.is-today .gh-ms-label { color: #a35600; }
body.light .gh-ms:not(.is-done):not(.is-today):not(.is-gift) .gh-hex { color: #5f53a6; }
.gv2-app-links a.gv2-open-app { background: color-mix(in srgb, var(--accent-primary, #7c3aed) 80%, #000); }

/* ── Studio (js/studio.js table + filter chips) ───────────────────────────────────────────────────────────── */
.studio-filter-chip-count { background: color-mix(in srgb, var(--accent-strong, #7c3aed) 82%, #000) !important; color: #fff !important; }
body.light .studio-btn-monetize.is-on { background: linear-gradient(135deg, #15803d, #166534); }
body.light .studio-toolbar-info { color: #4b5563; }
/* the "↕" sort hint was 35 % opacity (1.6–1.9:1) */
.studio-sort-icon.dim { opacity: 1; }
body:not(.light) .studio-sort-icon.dim { color: #8e88a8; }
body.light .studio-sort-icon.dim { color: #6b7080; }

/* ── Author dashboard cards (js/author-book-list.js): white "PRO" on the light accent (3.2:1). ───────────── */
.author-book-pro-tag { background: color-mix(in srgb, var(--accent-strong, #7c3aed) 80%, #000) !important; color: #fff !important; }

/* ── Audio (js/audio-consumer.js, dark): the accent purple as text on the dark page (3.2:1) — tabs, Back links. */
/* --ac-accent is also set inline from the playing track's colour, so the text is lifted where it is used. */
body:not(.light) .audio-consumer .ac-tab[aria-selected=true], body:not(.light) .audio-consumer .ac-link { color: color-mix(in srgb, var(--ac-accent, #7c3aed) 55%, #fff); }
body:not(.light) .ab4-choice .ac-link, body:not(.light) .ab4-batch .ac-link { color: color-mix(in srgb, var(--accent-primary, #7c3aed) 55%, #fff); }

/* ── Books home (light canvas in both themes): muted greys and the accent link measured 3.0–4.4:1. ───────── */
.bfy { --bfy-muted: #6c6479; }
.bfy .bfy-continue-info p, .bfy .bfy-progress span, .bfy .bfy-empty p { color: #6c6479; }
.bfy .bfy-menu { color: #6c6479; }
.bfy .bfy-continue-go, .bfy .bfy-feed-actions button { color: color-mix(in srgb, var(--accent-strong, #7c3aed) 85%, #000); }
#booksMobileV2 .bmv2-tabs button:not(.active) { color: #5d6472; }

/* ── Reader (light, before a reader theme is applied): the "Aa" button was lilac on lilac (1.6:1). ────────── */
body.light #btnReaderSettings { color: color-mix(in srgb, var(--accent-strong, #7c3aed) 80%, #000); }

/* ── Book page "Free parts here" block: App Store / Google Play links on the lilac card (3.0:1). ──────────── */
.bxi-stores a { color: color-mix(in srgb, var(--accent-strong, #7c3aed) 80%, #000); }

/* ── Trophy panel, light theme: "Resets in 24 hrs" was accent on a 60 % accent pill (2.5:1). ───────────────── */
body.light .quests-countdown { background: rgba(var(--accent-rgb), 0.12); color: color-mix(in srgb, var(--accent-strong, #7c3aed) 80%, #000); }
body:not(.light) .gv2-app-links a:not(.gv2-open-app) { color: color-mix(in srgb, var(--accent-primary, #7c3aed) 55%, #fff); }
