/* Mobile application surfaces. Load after app.css and quiz-experience.css.
   Desktop, dialog lifecycle/layers, and exported share cards stay untouched. */
@media (max-width:720px) {
  body {
    --m-on-accent:#ffffff;
    --m-soft-accent:#321216;
  }
  body.theme-light {
    --m-bg:#f5f1eb;
    --m-surface:#fffdf9;
    --m-text:#24211e;
    --m-muted:#6c655f;
    --m-accent:#e50914;
    --m-border:#d8d2c9;
    --m-on-accent:#ffffff;
    --m-soft-accent:#fbe5e7;
  }

  /* Alias the existing component tokens locally, never invert the whole app. */
  :is(#quizOverlay,#movieModal,.modal-overlay,.auth-overlay,.profile-overlay,
      #genreOverlay,#igPickerOverlay,#rouletteModal,.generic-page,.lists-page,
      .journal-page,.stats-page,.discovery-hub-page,.leaderboard-page,.live-page,
      .person-page,.releases-page,.tag-page,.popular-lists-page,.trending-page,
      .friend-suggestions-page,.follow-requests-page,.studio-page,.circles-page,
      .profile-page,.pricing-page,.legal-page) {
    --ink:var(--m-bg,#101112);
    --paper:var(--m-text,#f5f1eb);
    --dim:var(--m-muted,#a5a5ac);
    --line:var(--m-border,#303136);
    --accent:var(--m-accent,#e50914);
    --accent-soft:var(--m-soft-accent,#321216);
    color:var(--m-text,#f5f1eb);
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-y:contain;
    overflow-wrap:anywhere;
  }
  :is(#quizOverlay,.profile-overlay,#genreOverlay,.generic-page.active,
      .lists-page.active,.journal-page.active,.stats-page.active,
      .discovery-hub-page.active,.leaderboard-page.active,.live-page.active,
      .person-page.active,.releases-page.active,.tag-page.active,
      .popular-lists-page.active,.trending-page.active,.friend-suggestions-page.active,
      .follow-requests-page.active,.studio-page.active,.circles-page.active,
      .profile-page.active,.pricing-page.active,.legal-page.active) {
    background:var(--m-bg,#101112);
    padding-bottom:calc(32px + env(safe-area-inset-bottom,0px));
  }
  :is(#quizOverlay,#movieModal,.auth-overlay,.profile-overlay,#genreOverlay,
      #igPickerOverlay,#rouletteModal,.review-composer-overlay,.generic-page)
      :is(button,.btn,summary,.auth-google,.profile-tab,.wl-sort-btn,.gf-chip) {
    min-height:44px;
    touch-action:manipulation;
  }
  :is(#quizOverlay,#movieModal,.auth-overlay,.profile-overlay,#genreOverlay,
      #igPickerOverlay,#rouletteModal,.review-composer-overlay,.generic-page)
      :is(input:not([type=checkbox]):not([type=radio]),select,textarea) {
    min-width:0;
    max-width:100%;
    font-size:16px!important;
    line-height:1.5;
    color:var(--m-text,#f5f1eb);
    background-color:var(--m-surface,#1c1d20);
    border-color:var(--m-border,#303136);
  }
  :is(#quizOverlay,#movieModal,.auth-overlay,.profile-overlay,#genreOverlay,
      #igPickerOverlay,#rouletteModal,.review-composer-overlay,.generic-page)
      :is(button,a,input,select,textarea,summary):focus-visible {
    outline:2px solid var(--m-accent,#e50914);
    outline-offset:3px;
  }
  :is(#quizOverlay,.auth-overlay,.profile-overlay,#genreOverlay,.review-composer-overlay,.generic-page)
      :is(input,textarea)::placeholder { color:var(--m-muted,#a5a5ac);opacity:1; }
  :is(#quizOverlay,#movieModal,.auth-overlay,.profile-overlay,#genreOverlay,
      #igPickerOverlay,#rouletteModal,.review-composer-overlay,.generic-page) .btn {
    justify-content:center;
    padding:12px 16px;
    border-radius:12px;
    font-size:14px;
    line-height:1.35;
  }
  :is(#quizOverlay,#movieModal,.auth-overlay,.profile-overlay,#genreOverlay,
      #igPickerOverlay,#rouletteModal,.review-composer-overlay,.generic-page) .btn-primary {
    background:var(--m-accent,#e50914);
    color:var(--m-on-accent,#ffffff);
  }
  :is(#quizOverlay,#movieModal,.auth-overlay,.profile-overlay,#genreOverlay,
      #igPickerOverlay,#rouletteModal,.review-composer-overlay,.generic-page) .btn-ghost {
    color:var(--m-text,#f5f1eb);
    border-color:var(--m-border,#303136);
  }
  :is(.modal-close,.modal-close-top,.wl-close,.auth-close,.profile-close,.ig-picker-close,.rc-close,
      .genre-close,.roulette-modal-close,.qx-preferences-head>button) {
    width:44px!important;
    height:44px!important;
    min-width:44px;
    padding:0!important;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    color:var(--m-text,#f5f1eb)!important;
    background:var(--m-surface,#1c1d20);
    border:1px solid var(--m-border,#303136);
    border-radius:50%;
    line-height:1;
  }

  /* Three anchors and the optional settings sheet. */
  #quizOverlay { background:var(--m-bg,#101112); }
  #quizOverlay::before,#quizOverlay::after { display:none; }
  #quizOverlay>.container { padding:0;max-width:none; }
  #quizOverlay .quiz-header {
    background:var(--m-bg,#101112);
    color:var(--m-text,#f5f1eb);
    padding:calc(12px + env(safe-area-inset-top,0px)) 20px 12px;
    gap:10px;
    border-bottom:1px solid var(--m-border,#303136);
    backdrop-filter:none;
  }
  #quizOverlay :is(.quiz-back,.quiz-close) {
    background:var(--m-surface,#1c1d20);
    color:var(--m-text,#f5f1eb);
    border:1px solid var(--m-border,#303136);
  }
  #quizOverlay :is(.progress-text,.quiz-quota-chip) {
    color:var(--m-muted,#a5a5ac);
    letter-spacing:0;
  }
  #quizOverlay .progress-text { min-width:32px;font-size:11px; }
  #quizOverlay .quiz-quota-chip {
    white-space:normal;
    max-width:82px;
    min-width:0;
    line-height:1.3;
    border-color:var(--m-border,#303136);
    border-radius:8px;
    background:var(--m-surface,#1c1d20);
  }
  #quizOverlay .quiz-quota-chip .qqc-label { display:inline; }
  #quizOverlay .progress-bar { min-width:20px;background:var(--m-border,#303136); }
  #quizOverlay .progress-fill { background:var(--m-accent,#e50914); }
  #quizOverlay #quizContent,
  #quizOverlay .quiz-content:has(.qx-results) {
    width:100%;max-width:640px;
    padding:28px 20px calc(36px + env(safe-area-inset-bottom,0px));
    color:var(--m-text,#f5f1eb);
  }
  #quizOverlay .quiz-question h2 { font-size:clamp(32px,8.8vw,42px);line-height:1.1; }
  #quizOverlay .quiz-question .sub { font-size:15px;line-height:1.5;margin-bottom:24px; }
  #quizOverlay .quiz-options { gap:12px; }
  #quizOverlay .quiz-option {
    background:var(--m-surface,#1c1d20);
    color:var(--m-text,#f5f1eb);
    border:1px solid var(--m-border,#303136);
    border-radius:12px;
    padding:18px 16px;
    min-height:72px;
    font-size:16px;line-height:1.45;gap:12px;
    transform:none;
  }
  #quizOverlay .quiz-option.selected {
    border-color:var(--m-accent,#e50914);
    background:var(--m-soft-accent,#321216);
  }
  #quizOverlay :is(.qo-text,.qo-label,.qo-sublabel,.hint,.qcp-reading) { color:var(--m-muted,#a5a5ac); }
  #quizOverlay :is(.qo-label strong,.qo-text strong,.qcp-title,.qcp-reading strong) { color:var(--m-text,#f5f1eb); }
  #quizOverlay :is(.quiz-option .text strong,.qo-text-block strong) { color:var(--m-text,#f5f1eb);font-size:16px;line-height:1.4; }
  #quizOverlay :is(.quiz-option .text small,.qo-text-block small) { color:var(--m-muted,#a5a5ac);font-size:13px;line-height:1.5; }
  #quizOverlay :is(.quiz-actions,.qcp-actions) { margin-top:24px; }
  #quizOverlay .quiz-actions .btn { width:100%;min-height:48px; }
  #quizOverlay .quiz-checkpoint { padding:16px 0; }
  #quizOverlay .qcp-title { font-size:36px; }
  #quizOverlay .qcp-title em { color:var(--m-accent,#e50914); }
  #quizOverlay :is(.qcp-eyebrow,.qx-eyebrow),.qx-preferences .qx-eyebrow { color:var(--m-muted,#a5a5ac); }
  #quizOverlay .qcp-actions { grid-template-columns:1fr;gap:12px; }
  #quizOverlay .qcp-btn {
    background:var(--m-surface,#1c1d20);
    border-color:var(--m-border,#303136);
    color:var(--m-text,#f5f1eb);
    padding:18px 16px;
    flex-direction:row;gap:12px;
  }
  #quizOverlay .qcp-fast { border-color:var(--m-accent,#e50914); }
  #quizOverlay .qcp-btn-block { text-align:left; }
  #quizOverlay .qcp-btn-block small { color:var(--m-muted,#a5a5ac); }
  #quizOverlay .qx-preference-summary {
    margin:0 0 20px;
    padding:6px 12px;
    background:var(--m-surface,#1c1d20);
    border-color:var(--m-border,#303136);
    color:var(--m-muted,#a5a5ac);
    font-size:13px;line-height:1.5;
  }
  #quizOverlay .qx-preference-summary>span { min-width:0; }
  #quizOverlay .qx-preference-summary>button { min-width:88px;padding:4px 8px; }
  #quizOverlay .qo-scenario{grid-template-columns:36px minmax(0,1fr);padding:12px;min-height:76px}
  #quizOverlay .qo-tag{display:none}
  #quizOverlay .qo-text-block small{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-style:normal}
  .qx-preferences-overlay {
    padding:calc(12px + env(safe-area-inset-top,0px)) 12px calc(12px + env(safe-area-inset-bottom,0px));
    align-items:flex-start;
  }
  .qx-preferences-overlay .qx-preferences {
    margin:0 auto;
    padding:24px 20px;
    background:var(--m-bg,#101112);
    color:var(--m-text,#f5f1eb);
    border:1px solid var(--m-border,#303136);
    border-radius:16px;
  }
  .qx-preferences-head { gap:10px; }
  .qx-preferences-head h2 { font-size:30px;line-height:1.15; }
  .qx-form-grid { grid-template-columns:minmax(0,1fr);gap:18px; }
  .qx-preferences :is(label,legend) { font-size:14px; }
  .qx-choice-chips span { padding:12px 14px;min-height:44px;border-color:var(--m-border,#303136); }
  .qx-choice-chips input:checked+span { background:var(--m-soft-accent,#321216);border-color:var(--m-accent,#e50914); }
  .qx-reference-result { background:var(--m-surface,#1c1d20);color:var(--m-text,#f5f1eb);border-color:var(--m-border,#303136); }
  .qx-reference-chip { max-width:100%;border-color:var(--m-border,#303136); }
  .qx-reference-chip button { min-width:44px; }
  .qx-preference-actions { flex-wrap:wrap; }
  .qx-preference-actions .btn { flex:1;min-width:100px; }

  /* Keep every reason, availability note, correction and sharing control. */
  #quizOverlay .qx-results-head { text-align:left;margin-bottom:20px; }
  #quizOverlay .qx-results-head h1 { font-size:clamp(32px,9vw,42px);line-height:1.12; }
  #quizOverlay .qx-results-head>p:not(.qx-eyebrow) { color:var(--m-muted,#a5a5ac);font-size:13px;line-height:1.55; }
  #quizOverlay .qx-results-head>p.quiz-source {
    margin:0 0 10px;
    font-size:12px;
    line-height:1.5;
  }
  #quizOverlay .quiz-source .btn {
    margin-top:4px;
    padding:8px 10px!important;
    font-size:12px!important;
    min-height:44px;
    color:var(--m-text,#f5f1eb);
    text-decoration:underline;
    text-underline-offset:3px;
    border-color:var(--m-border,#303136);
  }
  #quizOverlay .qx-comparison { grid-template-columns:minmax(0,1fr);gap:14px; }
  #quizOverlay .qx-result-card.carousel-slide,
  #quizOverlay .qx-result-card.qx-primary-pick {
    grid-template-columns:90px minmax(0,1fr);
    gap:8px 14px;
    padding:16px;
    border-radius:12px;
    border-color:var(--m-border,#303136);
    background:var(--m-surface,#1c1d20);
    color:var(--m-text,#f5f1eb);
  }
  #quizOverlay .qx-poster { grid-row:1/5; }
  #quizOverlay .qx-poster img { border-radius:8px; }
  #quizOverlay .qx-result-card .slide-title { font-size:28px;color:var(--m-text,#f5f1eb);line-height:1.15; }
  #quizOverlay :is(.qx-film-meta,.qx-tmdb-rating) { font-size:12px;color:var(--m-muted,#a5a5ac);line-height:1.55; }
  #quizOverlay .qx-reasons { font-size:13px;line-height:1.6;color:var(--m-text,#f5f1eb);margin:12px 0; }
  #quizOverlay .qx-card-body>.qx-factual-reason,
  #quizOverlay .qx-card-body>.qx-card-explanation { grid-column:1/-1; }
  #quizOverlay .qx-factual-reason { margin:6px 0 0;font-size:13px;line-height:1.5;color:var(--m-text,#f5f1eb); }
  #quizOverlay .qx-card-explanation { min-width:0;margin:0;font-size:13px;line-height:1.5; }
  #quizOverlay .qx-card-explanation>summary { padding:10px 0;color:var(--m-muted,#a5a5ac);cursor:pointer; }
  #quizOverlay .qx-card-explanation[open]>summary { color:var(--m-text,#f5f1eb);text-decoration:underline;text-underline-offset:3px; }
  #quizOverlay .qx-card-explanation .qx-reasons { margin:0 0 8px;padding-left:17px; }
  #quizOverlay .qx-availability { font-size:12px;line-height:1.55;color:var(--m-muted,#a5a5ac); }
  #quizOverlay .qx-result-card .slide-actions { gap:8px; }
  #quizOverlay .qx-result-card .slide-actions>.wl-btn {
    background:var(--m-accent,#e50914);
    color:var(--m-on-accent,#ffffff);
    border-color:var(--m-accent,#e50914);
    min-height:46px;font-size:14px;border-radius:9px;
  }
  #quizOverlay .qx-result-card .slide-actions>.wl-btn.saved {
    background:var(--m-soft-accent,#321216);
    color:var(--m-text,#f5f1eb);
  }
  #quizOverlay .qx-result-card .qx-details-btn {
    color:var(--m-text,#f5f1eb);border-color:var(--m-border,#303136);
    font-size:14px;min-height:46px;border-radius:9px;
  }
  #quizOverlay .qx-card-feedback { font-size:12px;color:var(--m-muted,#a5a5ac);gap:8px; }
  #quizOverlay .qx-card-feedback>button {
    background:var(--m-bg,#101112);border:1px solid var(--m-border,#303136);
    padding:10px 12px;border-radius:999px;text-decoration:none;
  }
  #quizOverlay .qx-share summary { padding:10px; }
  #quizOverlay .qx-refine { padding:20px 0;border-width:1px 0 0;border-radius:0;text-align:left; }
  #quizOverlay .qx-refine h2 { font-size:30px; }
  #quizOverlay .qx-refine p { font-size:14px; }
  #quizOverlay .qx-refine>div { justify-content:flex-start; }
  #quizOverlay .qx-refine .btn { font-size:14px; }
  #quizOverlay .qx-quota-policy { color:var(--m-muted,#a5a5ac);font-size:12px; }
  #quizOverlay .loading-screen { padding:48px 0;min-height:55dvh; }
  #quizOverlay .loading-screen h2 { font-size:34px; }

  /* Movie detail: poster and metadata share the opening row. */
  #movieModal { align-items:flex-end;padding:0; }
  #movieModal #modalContent {
    background:var(--m-bg,#101112);
    border-color:var(--m-border,#303136);
    width:100%;max-width:100%;max-height:94dvh;
    border-radius:20px 20px 0 0;
  }
  #movieModal .modal-backdrop { display:none; }
  #movieModal .modal-body { padding:20px 20px calc(92px + env(safe-area-inset-bottom,0px)); }
  #movieModal .modal-head { flex-direction:row;align-items:center;gap:16px;margin-top:0;margin-bottom:24px; }
  #movieModal .modal-poster { width:100px;min-width:100px;border-radius:10px; }
  #movieModal .modal-info { min-width:0;padding-top:0;padding-bottom:4px; }
  #movieModal .modal-title { font-size:32px;line-height:1.1; }
  #movieModal .modal-meta { font-size:12px;line-height:1.5;gap:6px 10px;margin-bottom:12px; }
  #movieModal .modal-genres { gap:6px;margin-bottom:0; }
  #movieModal .genre-chip { padding:5px 8px;font-size:11px;background:var(--m-surface,#1c1d20);color:var(--m-muted,#a5a5ac); }
  #movieModal .modal-overview { color:var(--m-text,#f5f1eb);font-size:15px;line-height:1.65; }
  #movieModal .modal-section-title { font-size:12px;color:var(--m-muted,#a5a5ac);letter-spacing:.1em; }
  #movieModal .modal-close { top:18px;right:16px; }
  #movieModal .modal-close-bottom { background:var(--m-surface,#1c1d20);color:var(--m-text,#f5f1eb);border-color:var(--m-border,#303136); }
  #movieModal :is(.provider-list,.provider-group-label) { justify-content:flex-start; }
  #movieModal .providers-section { text-align:left; }
  #movieModal .providers-section .modal-section-title { text-align:left; }
  #movieModal .provider-group-label { font-size:12px;color:var(--m-muted,#a5a5ac); }
  #movieModal .provider-group-label::before,#movieModal .provider-group-label::after { display:none; }
  #movieModal .provider-list { gap:10px; }
  #movieModal .provider-card {
    width:100%;max-width:none;min-width:0;flex-direction:row;gap:12px;
    padding:12px 14px;background:var(--m-surface,#1c1d20);border-color:var(--m-border,#303136);
    border-radius:10px;text-align:left;transform:none;
  }
  #movieModal .provider-logo { width:40px;height:40px;border-radius:8px; }
  #movieModal .provider-name { max-width:none;white-space:normal;flex:1;text-align:left; }
  #movieModal .provider-action { font-size:10px;letter-spacing:.03em;max-width:78px; }
  #movieModal .providers-empty { color:var(--m-muted,#a5a5ac);background:var(--m-surface,#1c1d20); }
  #movieModal .modal-actions-centered { display:grid;grid-template-columns:1fr 1fr;gap:10px;padding-top:20px; }
  #movieModal .modal-actions-centered .btn { min-width:0; }
  #movieModal #watchlistBtn { background:var(--m-accent,#e50914);color:var(--m-on-accent,#ffffff)!important;border-color:var(--m-accent,#e50914)!important; }

  /* Watchlist stays a genuine collection, including filters and bulk tools. */
  .modal-overlay:has(#wlModalRoot) { padding:0;align-items:flex-end; }
  #wlModalRoot {
    width:100%!important;max-width:100%!important;max-height:94dvh!important;
    background:var(--m-bg,#101112)!important;border-color:var(--m-border,#303136);
    border-radius:20px 20px 0 0;overflow:hidden;
  }
  #wlModalRoot>div:first-child { padding:20px!important;gap:12px; }
  #wlModalRoot>div:first-child h2 { font-size:32px!important;line-height:1.1; }
  #wlModalRoot>div:first-child h2 span { color:var(--m-muted,#a5a5ac)!important; }
  #wlScroll { min-height:0;padding:16px 20px calc(24px + env(safe-area-inset-bottom,0px))!important;overscroll-behavior:contain; }
  #wlModalRoot .wl-grid { grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 12px; }
  #wlModalRoot .wl-item { background:var(--m-surface,#1c1d20);border-radius:10px;min-width:0; }
  #wlModalRoot .wl-item-body { padding:10px 10px 12px; }
  #wlModalRoot .wl-item-title { font-size:15px;color:var(--m-text,#f5f1eb);line-height:1.4; }
  #wlModalRoot .wl-item-meta { font-size:11px;color:var(--m-muted,#a5a5ac);letter-spacing:0; }
  #wlModalRoot .wl-item-remove { opacity:1;width:44px;height:44px;top:5px;right:5px;background:#191a1de6;border:1px solid #ffffff55; }
  #wlModalRoot .wl-empty { padding:36px 0; }
  #wlModalRoot .wl-empty-sub { font-size:14px;color:var(--m-muted,#a5a5ac); }
  #wlModalRoot .wl-sort-btn { padding:10px 12px;font-size:12px;white-space:nowrap; }
  #wlModalRoot :is(.wl-tonight,.wl-avail-row) { margin-left:20px;margin-right:20px; }
  #wlBulkBar { flex-wrap:wrap;gap:8px;padding:12px 20px; }

  /* Account surfaces and keyboard-safe login. */
  .auth-overlay { overflow-y:auto;align-items:flex-start;padding:calc(20px + env(safe-area-inset-top,0px)) 20px calc(20px + env(safe-area-inset-bottom,0px)); }
  .auth-overlay .auth-modal {
    margin:auto;width:100%;max-width:480px;padding:44px 24px 28px;
    background:var(--m-bg,#101112);border-color:var(--m-border,#303136);border-radius:16px;
  }
  .auth-overlay .auth-modal h2 { font-size:34px;line-height:1.12; }
  .auth-overlay .auth-modal .sub { font-size:15px;color:var(--m-muted,#a5a5ac);line-height:1.6; }
  .auth-overlay .auth-close { top:12px;right:12px; }
  :is(.auth-overlay,.profile-overlay) :is(.auth-btn,.auth-google) { min-height:48px;border-radius:10px;font-size:15px; }
  :is(.auth-overlay,.profile-overlay) .auth-btn { background:var(--m-accent,#e50914);color:var(--m-on-accent,#ffffff); }
  .auth-overlay .auth-google { background:#fff;color:#222;border-color:#ddd; }
  .auth-overlay .auth-divider { color:var(--m-muted,#a5a5ac); }
  .auth-overlay .auth-check:not(.avail):not(.taken) { color:var(--m-muted,#a5a5ac); }
  .profile-overlay .profile-inner { padding:calc(68px + env(safe-area-inset-top,0px)) 20px calc(36px + env(safe-area-inset-bottom,0px)); }
  .profile-overlay .profile-close { top:calc(12px + env(safe-area-inset-top,0px));right:16px; }
  .profile-overlay .profile-hero { padding:24px 16px;border:1px solid var(--m-border,#303136);background:var(--m-surface,#1c1d20);border-radius:14px; }
  .profile-overlay .profile-hero::before { display:none; }
  .profile-overlay .profile-hero h2 { font-size:32px; }
  .profile-overlay .profile-avatar { background:var(--m-accent,#e50914);color:var(--m-on-accent,#ffffff); }
  .profile-overlay .profile-hero .profile-meta { color:var(--m-muted,#a5a5ac);font-size:12px;letter-spacing:0; }
  .profile-overlay .profile-hero .profile-stats { flex-wrap:wrap;gap:16px 24px; }
  .profile-overlay .profile-hero .profile-stat .stat-label { color:var(--m-muted,#a5a5ac);letter-spacing:0; }
  .profile-overlay .profile-tabs { overflow-x:auto;gap:8px;padding-bottom:8px;overscroll-behavior-x:contain; }
  .profile-overlay .profile-tab { flex-shrink:0;padding:10px 16px; }
  .profile-overlay .profile-features { grid-template-columns:repeat(2,minmax(0,1fr));gap:12px; }
  .profile-overlay .profile-feat { padding:18px 12px;background:var(--m-surface,#1c1d20);border-color:var(--m-border,#303136); }
  .profile-overlay .profile-feat .feat-desc { color:var(--m-muted,#a5a5ac);font-size:12px; }
  .profile-overlay .watchlist-remove { opacity:1;width:44px;height:44px; }
  #settingsContent .profile-section { margin-bottom:20px; }
  #settingsContent h2 { font-size:36px!important; }
  #settingsContent input.auth-input { width:auto; }
  #settingsContent .settings-toggle { min-height:44px;display:flex;align-items:center; }
  #settingsContent .settings-toggle .toggle-slider { top:9px;bottom:9px; }

  /* Browse and all existing routed screens retain their navigation/state. */
  :is(.generic-page.active,.lists-page.active,.journal-page.active,.stats-page.active,
      .discovery-hub-page.active,.leaderboard-page.active,.live-page.active,
      .person-page.active,.releases-page.active,.tag-page.active,.popular-lists-page.active,
      .trending-page.active,.friend-suggestions-page.active,.follow-requests-page.active,
      .studio-page.active,.circles-page.active,.profile-page.active,
      .pricing-page.active,.legal-page.active) {
    padding-left:20px;padding-right:20px;
    padding-bottom:calc(96px + env(safe-area-inset-bottom,0px));
  }
  :is(.generic-page,.lists-page,.journal-page,.stats-page,.discovery-hub-page,
      .leaderboard-page,.live-page,.person-page,.releases-page,.tag-page) :is(h1,.lp-title) { font-size:36px;line-height:1.12; }
  .generic-page .search-filters { grid-template-columns:minmax(0,1fr);background:var(--m-surface,#1c1d20);border-color:var(--m-border,#303136);padding:16px; }
  .generic-page .search-filter label { font-size:12px;letter-spacing:.05em;color:var(--m-muted,#a5a5ac); }
  #genreOverlay { padding-top:env(safe-area-inset-top,0px); }
  #genreOverlay .genre-overlay-inner { padding:28px 20px calc(32px + env(safe-area-inset-bottom,0px)); }
  #genreOverlay .genre-overlay-title { font-size:34px; }
  #genreOverlay .genre-filter-bar { background:var(--m-surface,#1c1d20);border-color:var(--m-border,#303136);padding:16px; }
  #genreOverlay .genre-search-row { min-width:0; }
  #genreOverlay .genre-movie-grid { grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 12px; }
  #genreOverlay .gm-title { font-size:14px;line-height:1.4; }
  #genreOverlay .gm-meta { color:var(--m-muted,#a5a5ac); }

  /* Swipe sizing remains compatible with drag coordinates and JS transforms. */
  body.swipe-modal-open #swipe {
    --ink:var(--m-bg,#101112);--paper:var(--m-text,#f5f1eb);--dim:var(--m-muted,#a5a5ac);--accent:var(--m-accent,#e50914);
    background:var(--m-bg,#101112);
    padding-left:20px;padding-right:20px;
    padding-top:calc(64px + env(safe-area-inset-top,0px));
    padding-bottom:calc(32px + env(safe-area-inset-bottom,0px));
  }
  body.swipe-modal-open #swipe .swipe-container { width:100%;max-width:380px; }
  body.swipe-modal-open #swipe .swipe-stack,
  body.swipe-modal-open #swipe .swipe-card { max-width:100%; }
  body.swipe-modal-open #swipe .swipe-title { font-size:34px;line-height:1.12; }
  body.swipe-modal-open #swipe .swipe-sub { color:var(--m-muted,#a5a5ac);font-size:14px;line-height:1.55; }
  body.swipe-modal-open #swipe .swipe-btn { min-width:60px;min-height:60px; }
  body:is(.swipe-modal-open,.roulette-modal-open) .modal-close-top { top:calc(12px + env(safe-area-inset-top,0px));right:16px; }
  #rouletteModal .roulette-modal-inner { max-height:94dvh;background:var(--m-bg,#101112);border-color:var(--m-border,#303136); }
  #rouletteModal .roulette-interactive { background:var(--m-bg,#101112);padding:64px 20px calc(28px + env(safe-area-inset-bottom,0px)); }
  #rouletteModal .roulette-modal-close { top:14px;right:16px; }

  /* Composer and picker chrome only. Export canvases and preview art are excluded. */
  .review-composer-overlay { padding:calc(12px + env(safe-area-inset-top,0px)) 12px calc(12px + env(safe-area-inset-bottom,0px));align-items:flex-start; }
  .review-composer-overlay .review-composer { width:100%;max-width:560px;margin:auto;background:var(--m-bg,#101112);max-height:94dvh;overflow-y:auto;border:1px solid var(--m-border,#303136); }
  .review-composer-overlay .rc-close { top:12px;right:12px; }
  .review-composer-overlay .rc-head { padding:32px 60px 20px; }
  .review-composer-overlay .rc-title { font-size:26px; }
  .review-composer-overlay :is(.rc-body,.rc-actions) { padding:20px; }
  .review-composer-overlay :is(.rc-meta,.rc-label,.rc-counter,.rc-rating-label) { color:var(--m-muted,#a5a5ac); }
  .review-composer-overlay .rc-actions { flex-wrap:wrap; }
  #igPickerOverlay { padding:calc(16px + env(safe-area-inset-top,0px)) 12px calc(16px + env(safe-area-inset-bottom,0px)); }
  #igPickerOverlay .ig-picker-inner { padding:56px 20px 24px;background:var(--m-bg,#101112);color:var(--m-text,#f5f1eb);border-color:var(--m-border,#303136); }
  #igPickerOverlay .ig-picker-close { top:12px;right:12px; }
  #igPickerOverlay .ig-picker-title { font-size:32px; }
  #igPickerOverlay .ig-picker-sub { color:var(--m-muted,#a5a5ac);font-size:14px; }
  #igPickerOverlay .ig-picker-actions { gap:10px;flex-wrap:wrap;border-color:var(--m-border,#303136); }
  #igPickerOverlay :is(.ig-picker-btn-primary,.ig-picker-btn-ghost) { min-height:48px;flex:1;padding:12px 14px;border-radius:10px;font-size:12px;letter-spacing:.04em; }
  #igPickerOverlay .ig-picker-btn-primary { background:var(--m-accent,#e50914);color:var(--m-on-accent,#ffffff); }
  #igPickerOverlay .ig-picker-btn-ghost { color:var(--m-muted,#a5a5ac);border-color:var(--m-border,#303136); }

  /* Inline legacy secondary text uses pale RGBA; scope light fixes to UI chrome. */
  body.theme-light :is(#movieModal,.profile-overlay,.auth-overlay,#genreOverlay)
      :is(.modal-meta,.modal-overview,.profile-meta,.empty-state,.rc-public,.rc-meta,.genre-loading) {
    color:var(--m-muted);
  }
  body.theme-light #settingsContent :is(p,span,label,h3) { color:var(--m-text)!important; }
  body.theme-light #settingsContent :is(a,.profile-section h3) { color:var(--m-text)!important; }
  body.theme-light #settingsContent a { text-decoration:underline;text-underline-offset:3px; }
  body.theme-light #wlModalRoot [style*="color:rgba(245,241,234"] { color:var(--m-muted)!important; }
}
