/* One platform background. Glass and chrome tokens remain in office-theme.css. */
#reef-plate, #sea-light, #study-life { position: fixed; inset: 0; width: 100%; height: 100dvh; pointer-events: none; user-select: none; }
#reef-plate { z-index: 0; background: radial-gradient(ellipse at 45% 118%, #27637155, transparent 55%), linear-gradient(180deg, #034859, #073743 76%, #164750); }
#sea-light { z-index: 1; mix-blend-mode: screen; opacity: .95; }
#study-life { z-index: 2; contain: strict; will-change: transform; }
#study-life canvas { display: block; width: 100%; height: 100%; }
html[data-aqua-sea-enabled="false"] :is(#reef-plate, #sea-light, #study-life),
html:not([data-theme="aqua"]) #sea-light { display: none; }
/* Day and Night (owner THEME RULE, Nov 3 22:10): Day is true Apple-native light glass over a white / near-white page with a soft top light (no teal, no aqua-tinted water);
   Night is warm black with faint warm light from above (no navy). CSS only, no image. Panels stay transparent glass over both. */
html[data-theme="light"] #reef-plate { z-index: 0; background:
  radial-gradient(ellipse 60% 30% at 50% 0%, #ffffff, transparent 72%),
  radial-gradient(ellipse 55% 26% at 12% 100%, rgba(226, 232, 240, .7), transparent 70%),
  linear-gradient(180deg, #fdfdfe 0%, #f6f8fa 55%, #edf1f5 100%); }
html[data-theme="dark"] #reef-plate { z-index: 0; background:
  radial-gradient(ellipse 50% 22% at 30% 0%, rgba(255, 170, 100, .048), transparent 70%),
  radial-gradient(ellipse 40% 20% at 72% 0%, rgba(255, 170, 100, .036), transparent 72%),
  repeating-linear-gradient(100deg, rgba(255, 190, 130, .021) 0 4px, transparent 4px 110px),
  linear-gradient(180deg, #100d0b 0%, #0b0a09 55%, #070606 100%); }
#ascii-sea { transition: opacity .3s linear; }
@media (prefers-reduced-motion: reduce) { #ascii-sea { transition: none; } }
/* Original colored procedural animals remain visible over white Day and warm black Night.
   Only animal-layer opacity changes; panel fills, blur and text/control masks remain intact. */
html[data-theme="light"] #study-life { opacity: 1; }
html[data-theme="dark"] #study-life { opacity: 1; }
@media print { #reef-plate, #sea-light, #study-life { display: none; } }

[data-aqua-foreground] { position: relative; z-index: 3; }

/* CEO and Rep: no Office shell, so the layers sit behind every page element inside the isolated body. */
html[data-sea-surface] body { isolation: isolate; }
/* Never reposition the body itself: absolutely positioned page elements keep their own containing block. */
html[data-sea-surface] body[data-aqua-foreground] { position: static; z-index: auto; }
html[data-sea-surface] #reef-plate { z-index: -3; }
html[data-sea-surface] #sea-light { z-index: -2; }
html[data-sea-surface] #study-life { z-index: -1; }

/* Explicit low power: no backdrop-filter anywhere behind the panels, no Aqua rays.
   Without the blur a panel needs more of its own fill so text stays readable over the animals. */
/* Layered !important wins over surface-specific unlayered !important rules (including CEO panels and the Office rail). */
@layer iovo-sea-low-power {
 /* The baked glyph halo stays; a second CSS blur of the full viewport is too expensive. */
 html[data-sea-low-power] #ascii-sea { filter: none !important; }
 html[data-sea-low-power] *, html[data-sea-low-power] *::before, html[data-sea-low-power] *::after {
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  animation: none !important; transition: none !important;
 }
}
html[data-sea-low-power] [data-shell] .shx-rail { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
html[data-sea-low-power] #sea-light { display: none; }
html:root[data-sea-low-power][data-theme="aqua"]:not([data-glass="solid"]) { --og-panel: rgba(0, 30, 42, .62); --c-surface-1: rgba(0, 30, 42, .62); --c-surface-2: rgba(0, 30, 42, .62); --c-surface-3: rgba(0, 30, 42, .62); }

/* Glass rule: one panel-level blur, never a blur inside a blur. A control or card on a panel, drawer or dialog uses the blur its parent already has. */
html [data-shell] .shx-content :is([class*="panel"], .iox-card, .aq-card, .og-card) button,
html [data-shell] :is(.iox-drawer, dialog) :is(.iox-card, .aq-card, button) { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }

/* Coral reef corner photograph retired across all platform faces (Nov 19): keep pure CSS ocean gradient + swimming sea life. */
#reef-plate img { display: none !important; }

/* Scrawl #10 (Frame #3): Keep the exact living sea backdrop (#reef-plate + caustic #sea-light) visible beneath the Dive overlay while foreground app chrome hides. */
html[data-iovo-game-open] body > #reef-plate,
html[data-iovo-game-open] body > #sea-light {
  visibility: visible !important;
  pointer-events: none !important;
}
