/* ============================================================
   Desktop anti-flash (min-width:901px)

   The old light V1 layout — #workbench with its white .control-panel /
   .result-panel ("Creative results"), plus #historyPanel ("Recent
   generations") and #adminPanel — briefly paints between the dark overlays
   during studio<->studio and studio<->home transitions. That white paint is
   the flash. (openStudio removes .workspace-hidden a frame before the studio
   overlay covers, so the base panels show.)

   On desktop that light base is NEVER the real UI: the Home Command Center
   and the Image / Video studios are separate fixed overlays that reparent the
   controls (#modeSelect, #falModel, #resultGrid, #chatForm) into themselves.
   So we stop rendering it — #workbench and its light panels are display:none,
   so the old layout can never paint and there is nothing left to flash.

   Selectors must outrank desktop-workspace-pro.css, which sets
   `#workbench.workbench{display:grid!important}` and
   `#workbench>.control-panel/.result-panel{background:#fff!important}` at
   specificity (1,1,0). The `html body …#workbench.workbench` /
   `html body #workbench>.control-panel` selectors here are (1,1,2), so they win.

   The Music and GPT-5.6 studios render INSIDE #workbench in place, so they
   show it again (their own studio-scoped rules restore the panels).
   ============================================================ */
@media (min-width:901px){
  html, html body{ background:#07080f !important; }

  /* Remove the old light base from the render. */
  html body #workbench.workbench,
  html body #historyPanel,
  html body #adminPanel{ display:none !important; }

  /* Even if a later rule forces #workbench visible, keep its light panels
     hidden so nothing white can paint during a transition. */
  html body #workbench > .control-panel,
  html body #workbench > .result-panel{ display:none !important; }

  /* In-place studios (Music, GPT-5.6) live inside #workbench — show it again.
     Their own higher-specificity, studio-scoped rules restore the panels. */
  html body.music-studio-pc-active #workbench.workbench,
  html body.gpt56-clean-active #workbench.workbench,
  html body:has(#gpt56Studio:not(.hidden)) #workbench.workbench{ display:grid !important; }

  /* pc-studio-results.js flags results that don't belong to the active studio
     (e.g. a GPT chat reply inside Image/Video/Music) — hide them. */
  #resultGrid .pc-foreign-hidden{ display:none !important; }

}

/* ============================================================
   Old V1 floating tools — kill on EVERY width (render-blocking)

   The old cluster (.ml-top-tools: green 🔥 credit chip, yellow "Upgrade"
   button, burger) is created early by dashboard.js and superseded by the V2
   headers on every device: desktop uses #homeCcTools (which mirrors the live
   balance + opens the same Upgrade / account menu), mobile uses #homeCcMobile
   (its own menu / Upgrade / profile). The old cluster was only hidden by
   home-command-center.css (≥901px) and image-studio-mobile.css — both loaded
   LATE by the loader — so it painted top-right for a frame on load and during
   studio switches, and it leaked permanently as a duplicate on the mobile
   home. dashboard.css / top-tools-layout-fix.css force it visible with
   `.ml-top-tools{display:flex!important}` (specificity 0,1,0), so we outrank
   them with a (0,1,2) selector that loads render-blocking here in <head>, at
   ALL widths — the old cluster can never paint again. The elements stay in the
   DOM (they remain the wiring the V2 headers delegate to); they are just never
   rendered. */
html body .ml-top-tools{ display:none !important; }

/* The chatForm is shared between the V2 studios, so after visiting Image then
   Video (or vice versa) it carries BOTH studios' toolbars — showing two
   "+ / Enhance Prompt" rows. Scope structurally by composer (body classes can
   lag on deep links): each composer shows only its own toolbar. */
#vv2Composer .iv2-toolbar{ display:none !important; }
#iv2Composer .vv2-toolbar{ display:none !important; }
