/* The account's own background (public/background.js): the picture or video, covering, with a scrim of the theme's
   ground colour over it at the person's own Dim (0 unless raised). Behind the dashboard and the builder, and in
   Settings' preview. */
.acbg { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; contain: strict; }
.acbg-page { position: fixed; z-index: -1; }
.acbg-media { position: absolute; inset: 0; background: var(--ground) center / cover no-repeat; opacity: 0; transition: opacity 400ms var(--ease); }
.acbg.is-ready .acbg-media { opacity: 1; }
.acbg-video { display: block; width: 100%; height: 100%; object-fit: cover; }
.acbg-scrim { position: absolute; inset: 0; background: var(--ground); opacity: 0; transition: opacity 400ms var(--ease), background-color var(--t-2, 200ms) var(--ease); }
@media (prefers-reduced-motion: reduce) { .acbg-media, .acbg-scrim { transition: none; } }
:root[data-motion="reduce"] .acbg-media, :root[data-motion="reduce"] .acbg-scrim { transition: none; }

/* with a background on, it takes the place of Anticode's own (the dot grid and glow) */
:root[data-bg] .backdrop, :root[data-bg] .panel-backdrop, :root[data-bg] .bd-field { display: none; }
/* the dashboard's main panel lets it through whole: no fill of its own over the picture */
:root[data-bg] .dash .panel { background: transparent; }

/* the builder lets it through too: the stage drops its dot grid and fill, and the preview window, while it waits for a
   build, and Run's desk become frosted glass over the picture (solid again under Reduce Transparency) */
:root[data-bg] { --bg-glass: rgba(22, 22, 25, 0.5); --bg-glass-top: rgba(34, 34, 38, 0.56); --bg-blur: blur(26px) saturate(170%); }
:root[data-bg][data-theme="light"] { --bg-glass: rgba(255, 255, 255, 0.52); --bg-glass-top: rgba(255, 255, 255, 0.66); }
@media (prefers-color-scheme: light) { :root[data-bg]:not([data-theme="dark"]) { --bg-glass: rgba(255, 255, 255, 0.52); --bg-glass-top: rgba(255, 255, 255, 0.66); } }
:root[data-bg] .build .stage { background: transparent; }
:root[data-bg] .build .blueprint { background: transparent; }
:root[data-bg] .build:not([data-native]) .device { background: var(--bg-glass); -webkit-backdrop-filter: var(--bg-blur); backdrop-filter: var(--bg-blur); }
:root[data-bg] .build .device-top { background: var(--bg-glass-top); }
/* the chat over the picture: the Architect's lines sit on the same frosted glass as the preview, and the tabs and
   the box you type into become one frosted bar, so nothing reads straight off the photo */
:root[data-bg] .build .msg-agent > :last-child { justify-self: start; max-width: 100%; padding: 10px 15px; border-radius: 8px 22px 22px 22px; background: var(--bg-glass-top); -webkit-backdrop-filter: var(--bg-blur); backdrop-filter: var(--bg-blur); }
:root[data-bg] .build .msg-user { background: var(--surface); }
:root[data-bg] .build .ask, :root[data-bg] .build .mob-tabs { background: var(--bg-glass-top); -webkit-backdrop-filter: var(--bg-blur); backdrop-filter: var(--bg-blur); border-color: transparent; }
:root[data-bg] .build .ask .btn-quiet { background: color-mix(in srgb, var(--text) 7%, transparent); }
/* the builder's own bars over the picture: the Home / Build / Laptop bar and the preview's toolbar become frosted bars,
   and the fine print under the preview a frosted pill, so their icons and words never sit on the bare photo */
:root[data-bg] .build .stage-bar { background: var(--bg-glass-top); -webkit-backdrop-filter: var(--bg-blur); backdrop-filter: var(--bg-blur); border-color: transparent; }
:root[data-bg] .build .stage-fine { width: fit-content; max-width: calc(100% - 32px); margin: 6px auto 10px; padding: 6px 14px; border-radius: 999px; background: var(--bg-glass-top); -webkit-backdrop-filter: var(--bg-blur); backdrop-filter: var(--bg-blur); color: var(--text); }
/* No square corners over the picture: the chat is one floating, rounded pane of glass (its header and its list sit
   inside it, clear), the box you type into is a rounded capsule at its foot, the tabs and the preview's toolbar are
   rounded bars, and the Home / Build / Laptop bar lets the picture through around its own pill */
:root[data-bg] .build.ws > .rail { margin: 10px; border-radius: 26px; border: 0; overflow: hidden; background: var(--bg-glass); -webkit-backdrop-filter: var(--bg-blur); backdrop-filter: var(--bg-blur); box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.45); }
@media (min-width: 821px) { :root[data-bg] .build.ws > .rail { margin-inline-end: 0; } }
:root[data-bg] .build .rail .wschat-head { background: transparent; border-color: transparent; }
:root[data-bg] .build .rail .ask { margin: 0 10px 10px; border-radius: 24px; border: 0; }
:root[data-bg] .build .rail .ask-media { margin: 0 10px; border-radius: 18px 18px 0 0; border: 0; background: transparent; }
:root[data-bg] .build .rail .ask-target:not([hidden]) { background: var(--bg-glass-top); }
:root[data-bg] .build .mob-tabs { margin: 10px 10px 0; padding: 4px; border-radius: 999px; border: 0; }
:root[data-bg] .build.ws > .mbar { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
:root[data-bg] .build .mbar-task { justify-self: start; max-width: 100%; padding: 7px 14px; border-radius: 999px; background: var(--bg-glass-top); -webkit-backdrop-filter: var(--bg-blur); backdrop-filter: var(--bg-blur); }
:root[data-bg] .build .mbar-task:has(> b:empty) { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
:root[data-bg] .build .stage-bar { margin: 0 10px; border-radius: 22px; }
:root[data-bg] .run-desk { background-color: var(--bg-glass); background-image: none; -webkit-backdrop-filter: var(--bg-blur); backdrop-filter: var(--bg-blur); }

/* secondary text a step stronger (the "More contrast" values), so the scrim can stay thinner and the picture show;
   Settings' preview (.sp-bg-shot) uses the same, so it's dimmed exactly as the page is */
:root[data-bg], .sp-bg-shot { --muted: #c0c5cc; }
:root[data-bg][data-theme="light"], :root[data-theme="light"] .sp-bg-shot { --muted: #3e3e3e; }
@media (prefers-color-scheme: light) { :root[data-bg]:not([data-theme="dark"]), :root:not([data-theme="dark"]) .sp-bg-shot { --muted: #3e3e3e; } }

/* Anticode's own background (public/background.js energyOn): a plain near-black ground behind the dashboard and the
   builder when there's no picture of their own. The panels over it are the same frosted glass as over a picture (the
   :root[data-bg] rules), a touch darker so the work reads. (data-bg="energy" is the name it kept from the three.js
   flow of energy that used to be drawn here, removed 2026-11-11.) */
.acen { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; contain: strict; background: #020203; }
html[data-bg="energy"] { background: #020203; }
html[data-bg="energy"] body { background-color: transparent; }
:root[data-bg="energy"] { --bg-glass: rgba(13, 13, 13, 0.56); --bg-glass-top: rgba(22, 22, 22, 0.62); }
:root[data-bg="energy"] .dash { --glass: rgba(15, 15, 15, 0.5); --glass-hi: rgba(22, 22, 22, 0.62); --glass-menu: rgba(20, 20, 20, 0.86); }
