/* ===========================================================================
   ELECTRICITY

   Rebuilt 2026-09-05 after the first version was rejected outright — "there is
   nothing in your design that says electricity. Total fail." — and then
   rebuilt again the same hour, after two corrections from the maintainer that
   were both right and both went to the root of it:

     1. "Most of our themes are about cliches so I don't understand why the
        lightning-bolt cliche was deemed undesirable in this particular case.
        Themes ARE cliches."
     2. "The theme is electricity, NOT electricity when it was just invented;
        it's about electricity, not a fucking period piece."

   Both corrections killed a rule I had imported from somewhere it did not
   belong. Avoiding cliche is advice for original work made for one client; a
   theme in a picker is a COSTUME, and its whole job is to be recognised in a
   glance. Matrix is green rain. Halloween is orange and spooky. The bolt is
   not beneath this theme — the bolt IS this theme. And the subject is
   electricity itself, not the decade it was commercialised in, so there is no
   slate, no brass, no Victorian slab and no sepia anywhere below.

   WHAT ELECTRICITY LOOKS LIKE, which is the entire design:

   IT EMITS. That is the one thing it does that no other material does, and
   nothing in the first version glowed. A glow is not a colour, it is a RAMP:
   a white-hot core, a saturated body, and a halo bleeding onto whatever is
   near it. Anything here that is meant to be live shows all three or it reads
   as a coloured thing rather than a lit one.

   IT IS TWO COLOURS. An arc is blue-white with a violet fringe — a spark plug,
   a Tesla coil, lightning against a night sky. High tension is signed in
   YELLOW, black-on-yellow, the most recognisable warning mark there is. So:
   ARC is the light (focus, energised state, the glow itself) and VOLT is the
   action (links, buttons, the page you are on). Dark mode is the strike at
   night; light mode is the hazard plate in daylight.

   IT STRIKES IN A LINE. The bolt runs the width of the topbar as a real
   discharge trace — jagged, branching, brightest in the middle, dying out at
   both ends. It is drawn as a mask so its colour comes from a token, and it is
   the first thing on the page.

   THE DISCIPLINE, and the only reason this is usable for work: THE CHROME AND
   THE CONTROLS ARE LIVE; THE READING PATH IS NOT. No table cell glows, no body
   text glows. Nobody reads 394 rows on a page where everything shines. Every
   glow here is box-shadow, text-shadow, mask or gradient — additive light,
   which changes no computed contrast, so the ratios below stand as measured.

   Structure lives in chrome.css; this file is colour, type and light. The
   voice is `arc` in public/js/uiSound.js. The plan, the research and the one
   device that was cut before a line was written are in docs/design-electricity.md.
   =========================================================================== */

:root[data-palette="electricity"] {
  /* ---- The hazard plate in daylight. Cool, charged, faintly blue. ---- */
  --el-panel:      #e8edf3;   /* the page ground */
  --el-surface:    #f6f9fc;   /* cards, table field */
  --el-surface-2:  #dce4ee;   /* the striped row — ratios are checked on THIS */
  --el-ink:        #0f1319;
  --el-ink-2:      #38414c;
  --el-ink-3:      #525c68;
  --el-rule:       #ccd5e0;
  --el-rule-firm:  #a8b3c1;

  /* VOLT. On a pale ground the sign yellow cannot be text — it measures about
     1.6:1 — so on daylight it does what it does on a real high-tension plate:
     it becomes the FILL, with near-black on it. That is not a compromise, it
     is the more recognisable half of the mark. Link text drops to the deep end
     of the same hue so the family holds. Same lesson as the base theme's teal
     and Apple's blue — the ink is the lever, not the accent. */
  --el-volt:       #ffd21e;   /* the plate — fills, never small text */
  --el-volt-ink:   #1550c8;   /* the arc as text — see the dark block */
  --el-volt-deep:  #0f3b96;
  --el-volt-soft:  rgba(122, 86, 0, 0.13);
  --el-on-volt:    #14100a;   /* black on yellow: 13.9:1 */

  /* ARC. Violet-blue in daylight so it stays clearly apart from link text,
     which is the other blue on the page. */
  --el-arc:        #4a2fd6;
  --el-arc-soft:   rgba(74, 47, 214, 0.16);
  --el-arc-halo:   rgba(74, 47, 214, 0.32);
  --el-arc-violet: rgba(120, 60, 230, 0.34);

  /* EMISSION. A white-hot core is invisible on a pale ground, so the light
     variant runs the same ramp shifted down: saturation and a coloured cast
     shadow do the work brightness does in the dark. Different mechanism,
     same idea. */
  --el-core:       #2b6ad6;
  --el-busbar:     #14337a;   /* the conductor under the topbar, on a pale ground */
  --el-bloom:      rgba(30, 90, 200, 0.28);
  --el-bloom-hot:  rgba(20, 80, 190, 0.42);
  --el-volt-bloom: rgba(200, 150, 0, 0.45);
  --el-lamp-top:   #ffe066;
  --el-lamp-mid:   #ffd21e;
  --el-lamp-base:  #e0a800;
  --el-lamp-gloss: rgba(255, 252, 235, 0.75);

  /* The bolt trace, and the arc's own line weight. */
  --el-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* SAIRA, replacing Zilla Slab. Zilla was chosen for a period that this theme
     no longer has: a Clarendon slab says 1890s trade catalogue, which is
     exactly the framing the maintainer struck out. Saira is a technical
     grotesque with squared-off corners and a lot of tension at heavy weights —
     the lettering of a rating plate and a warning label, which is where the
     word ELECTRICITY actually appears in the world. Headings only; 394 rows of
     table data is not the place for character. Fetched only when this theme is
     selected (the `font` field on its registry entry). */
  --heading-font-family: "Saira", "Archivo Narrow", Inter, system-ui, sans-serif;

  /* The sidebar is dark in BOTH variants (the base app's own rule), so its
     light has to be the DARK ramp whichever variant is on — otherwise the lamp
     on the rail goes flat the moment somebody picks light mode. Declared once,
     here, and never overridden below. */
  --el-sb-core:      #cfeaff;
  --el-sb-bloom:     rgba(120, 190, 255, 0.42);
  --el-sb-bloom-hot: rgba(180, 225, 255, 0.72);
  --el-sb-volt:      #ffd21e;
  --el-sb-volt-glow: rgba(255, 210, 30, 0.50);
  --el-sb-rail:      rgba(120, 150, 190, 0.26);

  /* ---- Pico surface + ink ---- */
  --pico-background-color: var(--el-panel);
  --pico-color: var(--el-ink);
  --pico-h1-color: var(--el-ink);
  --pico-h2-color: var(--el-ink);
  --pico-h3-color: var(--el-ink);
  --pico-h4-color: var(--el-ink);
  --pico-h5-color: var(--el-ink);
  --pico-h6-color: var(--el-ink);
  --pico-muted-color: var(--el-ink-3);
  --pico-muted-border-color: var(--el-rule);
  --pico-border-color: var(--el-rule-firm);
  --pico-table-border-color: var(--el-rule);
  --pico-table-row-stripped-background-color: var(--el-surface-2);
  --pico-card-background-color: var(--el-surface);
  --pico-card-border-color: var(--el-rule);
  --pico-card-sectioning-background-color: var(--el-surface);
  --pico-code-background-color: var(--el-surface-2);
  --pico-code-color: var(--el-ink-2);
  --pico-blockquote-border-color: var(--el-volt);
  --pico-border-radius: 0.15rem;  /* hard corners. Nothing about a discharge is soft. */

  /* ---- Volt is the action colour ---- */
  --pico-primary: var(--el-volt-ink);
  --pico-primary-background: var(--el-volt);
  --pico-primary-hover: var(--el-volt-deep);
  --pico-primary-hover-background: #ffdd4d;
  --pico-primary-underline: rgba(21, 80, 200, 0.38);
  --pico-primary-focus: var(--el-arc-halo);
  --pico-primary-inverse: var(--el-on-volt);

  --pico-secondary: var(--el-ink-2);
  --pico-secondary-background: var(--el-ink-2);
  --pico-secondary-hover: var(--el-ink);
  --pico-secondary-hover-background: var(--el-ink);
  --pico-secondary-focus: rgba(56, 65, 76, 0.25);
  --pico-secondary-inverse: #ffffff;

  --pico-mark-background-color: #ffe89a;
  --pico-mark-color: #4d3800;

  /* ---- Forms: the field you are in is arc-lit ---- */
  --pico-form-element-background-color: var(--el-surface);
  --pico-form-element-border-color: var(--el-rule-firm);
  --pico-form-element-color: var(--el-ink);
  --pico-form-element-placeholder-color: var(--el-ink-3);
  --pico-form-element-active-background-color: #ffffff;
  --pico-form-element-active-border-color: var(--el-arc);
  --pico-form-element-focus-color: var(--el-arc);
  --pico-form-element-selected-background-color: var(--el-arc-soft);
  --pico-switch-background-color: var(--el-rule-firm);
  --pico-switch-checked-background-color: var(--el-volt);
  --pico-range-thumb-color: var(--el-volt-ink);

  --pico-dropdown-background-color: var(--el-surface);
  --pico-dropdown-border-color: var(--el-rule);
  --pico-dropdown-hover-background-color: var(--el-surface-2);

  --scroll-shadow-color: rgba(15, 19, 25, 0.28);

  /* ---- The sidebar: the dark panel the board is wired to ---- */
  --sidebar-bg: #0b0f16;
  --sidebar-ink: #eef3f9;
  --sidebar-muted: #8996a7;
  --sidebar-link: #c2ccd9;
  --sidebar-link-active: #ffffff;
  --sidebar-hover-bg: #151d29;
  --sidebar-active-bg: #1b2537;

  --theme-sound: 1;
  --theme-voice: arc;

  /* ---- THE SEMANTIC TIERS (2026-09-05) -----------------------------------
     These used to be seven .status-* rules written out three times over. They
     are tokens now, and that is the whole point: the app's styles.css reads
     them for the status chips AND for the flash banner, the error banner, the
     audit flag, the import outcome/state badges, the errored-row tint and the
     filter chips — families this theme could not reach before, because
     reaching one meant restating three cascade blocks per selector.

     Measured 2026-09-05 across all seven themes: this theme's flash banner,
     audit flag and import badges were wearing SCP brand teal and amber in the
     middle of an arc-blue palette. Every value below is unchanged from the
     chip it came from; only its reach is new.

     Lamp order is preserved — green pilot, amber caution, blue fault, with the
     two reds beyond it — and the contrast note further down still describes
     these exact pairs. */
  --sem-good-bg: #d6ecd4;      --sem-good-fg: #1c5420;
  --sem-caution-bg: #f8e6bf;   --sem-caution-fg: #6b4a05;
  --sem-bad-bg: #d9e2fa;       --sem-bad-fg: #25408f;
  --sem-inactive-bg: #fadcd6;  --sem-inactive-fg: #8e3320;
  --sem-alarm-bg: #f6c4b8;     --sem-alarm-fg: #752313;
  --sem-neutral-bg: #dee1e3;   --sem-neutral-fg: #3c4448;
  --sem-archived-bg: #ece3cf;  --sem-archived-fg: #4f4526;

  /* The banner edge is DERIVED from the tier, not chosen, so re-pitching a
     tier does not also mean picking three border colours by hand. 28% of the
     ink mixed into the fill lands between the two in the tier's own hue. */
  --sem-good-border: color-mix(in srgb, var(--sem-good-fg) 28%, var(--sem-good-bg));
  --sem-caution-border: color-mix(in srgb, var(--sem-caution-fg) 28%, var(--sem-caution-bg));
  --sem-bad-border: color-mix(in srgb, var(--sem-bad-fg) 28%, var(--sem-bad-bg));

  /* The lit lamp and the fault lamp, moved off the component rules below for
     the same reason. --sem-bad-accent is the rule down the side of an errored
     import panel and the colour its row tint is mixed from; on this palette
     that is the fault red, not the base brand's salmon. */
  --sem-chip-fill: var(--el-volt);
  --sem-chip-ink: var(--el-on-volt);
  /* FAULT IS RED HERE AND in_maintenance IS NOT. On this palette the bad tier
     is arc blue, because an asset at the shop is a state and not a failure — so
     the error family is moved off it onto the fault lamp. Without this the error
     banner, the import error list and the alerting filter chip all come out
     blue, which was measured and is the reason --sem-error-* exists at all. */
  --sem-error-bg: var(--sem-inactive-bg);
  --sem-error-fg: var(--sem-inactive-fg);
  --sem-error-border: color-mix(in srgb, var(--sem-error-fg) 28%, var(--sem-error-bg));

  --sem-chip-alert-ink: #fff4f0;
  --sem-chip-alert-fill: #8e3320;
  --sem-chip-alert-outline: #8e3320;
  --sem-bad-accent: #8e3320;

  /* Was three copies of one nth-child(even) rule; the base rule reads this. */
  --zebra-stripe: rgba(120, 165, 220, 0.07);

  /* Was eight .chart-bar-* rules stated three times. Same conductors. */
  --chart-bar-available: #6fc7f5;
  --chart-bar-category: #4a8fd0;
  --chart-bar-checked_out: #ffd21e;
  --chart-bar-in_maintenance: #ff9a4d;
  --chart-bar-not_working: #ff7a5c;
  --chart-bar-lost: #f2593c;
  --chart-bar-disposed: #7d8794;
  --chart-bar-donated: #5a6472;
}

/* ===========================================================================
   DARK — the strike. The variant this theme is designed around, because a
   discharge is a thing you see against darkness.
   =========================================================================== */
:root[data-palette="electricity"][data-theme="dark"] {
  /* ---- The strike at night. Cool near-black; a sky about to conduct. ---- */
  --el-panel:      #090c11;
  --el-surface:    #111621;
  --el-surface-2:  #19212f;   /* the striped row — ratios are checked on THIS */
  --el-ink:        #e9eef6;
  --el-ink-2:      #bac5d3;
  --el-ink-3:      #8b98a9;
  --el-rule:       #232c3b;
  --el-rule-firm:  #354154;

  /* VOLT — high tension, the action colour. Black-on-yellow is the most
     recognisable electrical mark there is, and in the dark the yellow is
     legible as text outright, so here the sign colour IS the link colour. */
  --el-volt:       #ffd21e;
  --el-volt-deep:  #ffe066;
  --el-volt-soft:  rgba(255, 210, 30, 0.16);
  --el-on-volt:    #14100a;
  /* Link text is the ARC, not the volt. Measured on a full 394-row table: with
     yellow links the page has yellow text, yellow chips and yellow buttons and
     reads as one hue. The split is by job — arc informs, volt acts. */
  --el-volt-ink:   #8fd0ff;

  /* ARC — the light itself. Blue-white with a violet fringe, which is what a
     spark plug, a coil and a lightning channel all actually look like. */
  --el-arc:        #9fd8ff;
  --el-arc-soft:   rgba(159, 216, 255, 0.18);
  --el-arc-halo:   rgba(120, 170, 255, 0.40);
  --el-arc-violet: rgba(150, 120, 255, 0.45);

  /* EMISSION — the ramp. Core, body, halo. */
  --el-core:       #f4fbff;
  --el-busbar:     #bfe4ff;
  --el-bloom:      rgba(120, 190, 255, 0.38);
  --el-bloom-hot:  rgba(180, 225, 255, 0.70);
  --el-volt-bloom: rgba(255, 210, 30, 0.42);
  --el-lamp-top:   #ffe066;
  --el-lamp-mid:   #ffd21e;
  --el-lamp-base:  #c99400;
  --el-lamp-gloss: rgba(255, 252, 235, 0.45);

  --pico-primary: var(--el-volt-ink);
  --pico-primary-hover: var(--el-volt-deep);
  --pico-primary-underline: rgba(143, 208, 255, 0.42);
  --pico-mark-background-color: #4a3c05;
  --pico-mark-color: #ffe89a;
  --pico-form-element-active-background-color: #141b27;
  --pico-secondary: var(--el-ink-2);
  --pico-secondary-background: #2b3546;
  --pico-secondary-hover: var(--el-ink);
  --pico-secondary-hover-background: #364258;
  --scroll-shadow-color: rgba(0, 0, 0, 0.65);
  --sidebar-active-bg: #23304a;

  /* ---- THE SEMANTIC TIERS, dark. See the light block for why these are
     tokens and not .status-* rules. ------------------------------------- */
  --sem-good-bg: #12331a;      --sem-good-fg: #7ada86;
  --sem-caution-bg: #3c2e0a;   --sem-caution-fg: #f4c65c;
  --sem-bad-bg: #1b2647;       --sem-bad-fg: #9db8f5;
  --sem-inactive-bg: #3f1a12;  --sem-inactive-fg: #ff9b80;
  --sem-alarm-bg: #571407;     --sem-alarm-fg: #ff8f72;
  --sem-neutral-bg: #26292b;   --sem-neutral-fg: #aeb5b9;
  --sem-archived-bg: #2c2617;  --sem-archived-fg: #cfbe8e;

  --sem-good-border: color-mix(in srgb, var(--sem-good-fg) 28%, var(--sem-good-bg));
  --sem-caution-border: color-mix(in srgb, var(--sem-caution-fg) 28%, var(--sem-caution-bg));
  --sem-bad-border: color-mix(in srgb, var(--sem-bad-fg) 28%, var(--sem-bad-bg));

  --sem-error-bg: var(--sem-inactive-bg);
  --sem-error-fg: var(--sem-inactive-fg);
  --sem-error-border: color-mix(in srgb, var(--sem-error-fg) 28%, var(--sem-error-bg));

  --sem-chip-alert-ink: #ffe8e1;
  --sem-chip-alert-fill: #7c2d18;
  --sem-chip-alert-outline: #ff9b80;
  --sem-bad-accent: #ff9b80;

  --zebra-stripe: rgba(130, 180, 255, 0.055);
}

@media (prefers-color-scheme: dark) {
  :root[data-palette="electricity"]:not([data-theme="light"]) {
    /* ---- The strike at night. Cool near-black; a sky about to conduct. ---- */
    --el-panel:      #090c11;
    --el-surface:    #111621;
    --el-surface-2:  #19212f;   /* the striped row — ratios are checked on THIS */
    --el-ink:        #e9eef6;
    --el-ink-2:      #bac5d3;
    --el-ink-3:      #8b98a9;
    --el-rule:       #232c3b;
    --el-rule-firm:  #354154;

    /* VOLT — high tension, the action colour. Black-on-yellow is the most
       recognisable electrical mark there is, and in the dark the yellow is
       legible as text outright, so here the sign colour IS the link colour. */
    --el-volt:       #ffd21e;
    --el-volt-ink:   #8fd0ff;
    --el-volt-deep:  #ffe066;
    --el-volt-soft:  rgba(255, 210, 30, 0.16);
    --el-on-volt:    #14100a;

    /* ARC — the light itself. Blue-white with a violet fringe, which is what a
       spark plug, a coil and a lightning channel all actually look like. */
    --el-arc:        #9fd8ff;
    --el-arc-soft:   rgba(159, 216, 255, 0.18);
    --el-arc-halo:   rgba(120, 170, 255, 0.40);
    --el-arc-violet: rgba(150, 120, 255, 0.45);

    /* EMISSION — the ramp. Core, body, halo. */
    --el-core:       #f4fbff;
    --el-busbar:     #bfe4ff;
    --el-bloom:      rgba(120, 190, 255, 0.38);
    --el-bloom-hot:  rgba(180, 225, 255, 0.70);
    --el-volt-bloom: rgba(255, 210, 30, 0.42);
    --el-lamp-top:   #ffe066;
    --el-lamp-mid:   #ffd21e;
    --el-lamp-base:  #c99400;
    --el-lamp-gloss: rgba(255, 252, 235, 0.45);

    --pico-primary: var(--el-volt-ink);
    --pico-primary-hover: var(--el-volt-deep);
    --pico-primary-underline: rgba(143, 208, 255, 0.42);
    --pico-mark-background-color: #4a3c05;
    --pico-mark-color: #ffe89a;
    --pico-form-element-active-background-color: #141b27;
    --pico-secondary: var(--el-ink-2);
    --pico-secondary-background: #2b3546;
    --pico-secondary-hover: var(--el-ink);
    --pico-secondary-hover-background: #364258;
    --scroll-shadow-color: rgba(0, 0, 0, 0.65);
    --sidebar-active-bg: #23304a;

    /* ---- THE SEMANTIC TIERS, dark. See the light block for why these are
       tokens rather than .status-* rules. --------------------------------- */
    --sem-good-bg: #12331a;      --sem-good-fg: #7ada86;
    --sem-caution-bg: #3c2e0a;   --sem-caution-fg: #f4c65c;
    --sem-bad-bg: #1b2647;       --sem-bad-fg: #9db8f5;
    --sem-inactive-bg: #3f1a12;  --sem-inactive-fg: #ff9b80;
    --sem-alarm-bg: #571407;     --sem-alarm-fg: #ff8f72;
    --sem-neutral-bg: #26292b;   --sem-neutral-fg: #aeb5b9;
    --sem-archived-bg: #2c2617;  --sem-archived-fg: #cfbe8e;

    --sem-good-border: color-mix(in srgb, var(--sem-good-fg) 28%, var(--sem-good-bg));
    --sem-caution-border: color-mix(in srgb, var(--sem-caution-fg) 28%, var(--sem-caution-bg));
    --sem-bad-border: color-mix(in srgb, var(--sem-bad-fg) 28%, var(--sem-bad-bg));

    --sem-error-bg: var(--sem-inactive-bg);
    --sem-error-fg: var(--sem-inactive-fg);
    --sem-error-border: color-mix(in srgb, var(--sem-error-fg) 28%, var(--sem-error-bg));

    --sem-chip-alert-ink: #ffe8e1;
    --sem-chip-alert-fill: #7c2d18;
    --sem-chip-alert-outline: #ff9b80;
    --sem-bad-accent: #ff9b80;

    --zebra-stripe: rgba(130, 180, 255, 0.055);

    /* The conductors are NOT restated here. They are declared once in the
       palette block, which is unscoped by variant, and this theme draws the
       same eight bars in light and dark — the original rules paired the light
       and dark selectors on one line for exactly that reason. Restating them
       in one dark block and not the other is what the parity test caught. */
  }
}

/* ===========================================================================
   NO BOLT. CUT 2026-09-05, after three attempts.

   This is here because the absence is a decision, not an oversight, and the
   next person to think "this theme is called Electricity and has no lightning
   in it" should read the three tries before making a fourth.

     1. A jagged trace repeating the full width of the topbar. The maintainer:
        "what looks like a cardiogram line on the top. Is that supposed to be
        lightning?" It was, and they were right — a horizontal baseline carrying
        periodic spikes of even amplitude IS the visual grammar of an ECG.
     2. One descending strike, non-repeating. Read as a scribble: a single
        uniform stroke oscillating six times around a vertical axis is a spring.
     3. The same strike tapered in three widths, with forks. Better drawn, and
        the verdict was "equally dumb. Rather leave it out if you can't pull off
        a better lightning effect."

   Three misses on one element says the PLACEMENT was wrong, not the drawing.
   Lightning needs one of three things to read: scale, a visible source, or
   darkness around it. A 111px figure floating in a pale topbar has none of
   them, so it can only ever look like a decal stuck on the chrome — and each
   attempt made it a better-drawn decal.

   The theme does not need it. What carries the identity is the two colours
   split by job (arc blue informs, volt yellow acts), the emission ramp on the
   controls, the lit rail down the nav, and the warning lamp on the alert tile —
   all of which the maintainer accepted. Chanel's rule: take one thing off
   before leaving the house.

   If it comes back, give it somewhere it can be big and dark: the sign-in page,
   an empty state, the 404. Not a 111px slot in a topbar somebody stares at all
   day.
   =========================================================================== */

/* The busbar: a live conductor under the topbar: a live conductor under the topbar,
   brightest where the current is. */
:root[data-palette="electricity"] .topbar {
  background-image:
    linear-gradient(to right, transparent 0%, var(--el-busbar) 22%, var(--el-busbar) 78%, transparent 100%),
    linear-gradient(to top, var(--el-bloom) 0%, transparent 100%);
  background-repeat: no-repeat, no-repeat;
  background-size: 100% 1px, 100% 20px;
  background-position: left bottom, left bottom;
}

/* ===========================================================================
   THE ARC — the light itself, and the fiercest thing in the theme. Focus only,
   because an arc lamp is not something you leave burning in a room. Three
   rings: a hard core, the halo it throws, and a violet fringe, which is what
   the edge of a real discharge actually looks like.
   =========================================================================== */
:root[data-palette="electricity"] :focus-visible {
  outline: 2px solid var(--el-arc);
  outline-offset: 2px;
  box-shadow:
    0 0 0 5px var(--el-arc-soft),
    0 0 18px 1px var(--el-arc-halo),
    0 0 34px 4px var(--el-arc-violet);
  transition: box-shadow 120ms ease-out;
}

/* ===========================================================================
   THE RAIL AND THE LAMP. The nav is a bus with every page hung off it, dim,
   and the page you are on is the one drawing current: a hot node on the rail,
   its light spilling left onto the panel and warming its own label. This is
   the theme's vocabulary doing a job the theme did not invent — it is how you
   know where you are.
   =========================================================================== */
:root[data-palette="electricity"] .sidebar-nav a {
  box-shadow: inset 2px 0 0 var(--el-sb-rail);
  transition: box-shadow 130ms ease-out;
}
:root[data-palette="electricity"] .sidebar-nav a:hover {
  box-shadow:
    inset 2px 0 0 var(--el-sb-core),
    inset 0 0 18px -8px var(--el-sb-bloom);
}
:root[data-palette="electricity"] .sidebar-nav a.active {
  background-image: linear-gradient(to right, var(--el-sb-bloom) 0%, transparent 72%);
  box-shadow:
    inset 3px 0 0 var(--el-sb-volt),
    inset 0 0 26px -6px var(--el-sb-bloom-hot),
    0 0 22px -4px var(--el-sb-bloom);
  text-shadow: 0 0 12px var(--el-sb-bloom-hot);
}

/* The name of the thing, lit. One text-shadow, at the top of the sidebar, where
   the eye starts. */
:root[data-palette="electricity"] .sidebar-brand-subtitle {
  color: var(--el-sb-volt);
  text-shadow: 0 0 14px var(--el-sb-volt-glow);
}

/* A faint charge across the panel: brightest at the top, where the supply
   comes in, plus a hairline vertical grain so the sidebar reads as a surface
   rather than a hole. Both well under the threshold where they would compete
   with the nav. */
:root[data-palette="electricity"] .sidebar {
  background-image:
    linear-gradient(to bottom, var(--el-sb-bloom) 0, transparent 200px),
    repeating-linear-gradient(90deg, rgba(190, 220, 255, 0.018) 0 1px, transparent 1px 3px);
}

/* ===========================================================================
   LIVE CONTROLS. A primary button is a thing that is switched on: three stops
   of the ramp (hot top, body, base), the gloss where a lens catches the light,
   and a bloom on whatever is behind it. It gets hotter when you touch it.

   THE EXCLUSION LIST IS LOAD-BEARING AND IS NOT OPTIONAL. Pico styles every
   bare `button` as a primary action, so `button:not(.secondary):not(.outline):not(.th-sort):not(.sidebar-toggle):not(.hubmenu-icon-button):not(.hubmenu-avatar-button):not(.hubmenu-item-button)`
   looks like the right way to say "a real button" — and it is not, because
   several controls in this app are `<button>` elements deliberately stripped
   back to look like something else. This rule is (0,4,1); the base resets that
   strip them are (0,1,1) and (0,1,0), so the lamp wins every one of them and
   they turn into solid amber blocks. Measured, on the live page, all five:

     .th-sort              column headers on CLIENT-sorted tables (assignees,
                           "Who has what") became amber blocks with invisible
                           text at 1.0-1.9:1. Server-sorted tables use an <a>
                           and were untouched, which is why it only showed on
                           two pages out of ten.
     .sidebar-toggle       the narrow-screen hamburger: 1.03:1.
     .hubmenu-icon-button  the waffle,
     .hubmenu-avatar-button  the avatar — both are transparent by design in
                           chrome.css and became filled yellow discs.
     .hubmenu-item-button  "Sign out" inside the account menu.

   Excluded HERE rather than undone in a later rule, because an undo would need
   to beat (0,4,1) and `:root[…] th > button.th-sort` is only (0,3,2) — it would
   lose, silently. A theme test now pins this list; see darkVariantParity's
   sibling in packages/hub-chrome/test.
   =========================================================================== */
:root[data-palette="electricity"] button:not(.secondary):not(.outline):not(.th-sort):not(.sidebar-toggle):not(.hubmenu-icon-button):not(.hubmenu-avatar-button):not(.hubmenu-item-button),
:root[data-palette="electricity"] [role="button"]:not(.secondary):not(.outline),
:root[data-palette="electricity"] input[type="submit"] {
  background-image: linear-gradient(to bottom, var(--el-lamp-top) 0%, var(--el-lamp-mid) 52%, var(--el-lamp-base) 100%);
  box-shadow:
    inset 0 1px 0 var(--el-lamp-gloss),
    0 1px 0 rgba(0, 0, 0, 0.22),
    0 2px 20px -6px var(--el-volt-bloom);
  transition: box-shadow 130ms ease-out;
}
:root[data-palette="electricity"] button:not(.secondary):not(.outline):not(.th-sort):not(.sidebar-toggle):not(.hubmenu-icon-button):not(.hubmenu-avatar-button):not(.hubmenu-item-button):hover,
:root[data-palette="electricity"] [role="button"]:not(.secondary):not(.outline):hover,
:root[data-palette="electricity"] input[type="submit"]:hover {
  box-shadow:
    inset 0 1px 0 var(--el-lamp-gloss),
    0 1px 0 rgba(0, 0, 0, 0.22),
    0 3px 30px -4px var(--el-volt-bloom);
}

/* ===========================================================================
   THE HEADING RULE. What was here was a "marquee" — a row of lamps under the
   page title — and it is CUT, on its second attempt, for the same reason it
   failed the first time: at every size tried it read as a dotted border rather
   than as light. It was also the second flourish on a page that already has the
   bolt, and two flourishes dilute each other. What is left is a charged rule:
   one conductor under the title, hot at the start and dying out across the
   width, which is a line with a direction rather than an ornament.
   =========================================================================== */
:root[data-palette="electricity"] main h1 {
  padding-bottom: 0.5rem;
  background-image: linear-gradient(to right, var(--el-volt) 0%, var(--el-bloom) 34%, transparent 72%);
  background-size: 100% 2px;
  background-repeat: no-repeat;
  background-position: left bottom;
}

/* The dark variant is a room with a source in it, not a flat dark rectangle:
   one cool wash entering from the top left, at a level you would not notice
   until it was removed. */
:root[data-palette="electricity"][data-theme="dark"] body {
  background-image: radial-gradient(120% 90% at 10% -12%, rgba(120, 190, 255, 0.055) 0%, transparent 62%);
  background-attachment: fixed;
}
@media (prefers-color-scheme: dark) {
  :root[data-palette="electricity"]:not([data-theme="light"]) body {
    background-image: radial-gradient(120% 90% at 10% -12%, rgba(120, 190, 255, 0.055) 0%, transparent 62%);
    background-attachment: fixed;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root[data-palette="electricity"] :focus-visible,
  :root[data-palette="electricity"] .sidebar-nav a,
  :root[data-palette="electricity"] button:not(.secondary):not(.outline):not(.th-sort):not(.sidebar-toggle):not(.hubmenu-icon-button):not(.hubmenu-avatar-button):not(.hubmenu-item-button),
  :root[data-palette="electricity"] [role="button"]:not(.secondary):not(.outline),
  :root[data-palette="electricity"] input[type="submit"] {
    transition: none;
  }
}

/* ===========================================================================
   PANEL HARDWARE
   =========================================================================== */
:root[data-palette="electricity"] h1,
:root[data-palette="electricity"] h2,
:root[data-palette="electricity"] h3 {
  font-family: var(--heading-font-family);
  font-weight: 600;
  letter-spacing: -0.005em;
}

:root[data-palette="electricity"] table thead th {
  border-bottom: 1.5px solid var(--el-rule-firm);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--el-ink-2);
}

/* Figures are tabular: this is a meter reading, and a column of money that
   does not line up is the one place this costs the reader something. */
:root[data-palette="electricity"] td.num,
:root[data-palette="electricity"] .money,
:root[data-palette="electricity"] .stat-tile-value {
  font-family: var(--el-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
}

/* Pilot lamps: small, squared, ringed in their own colour. */
:root[data-palette="electricity"] .status-badge,
:root[data-palette="electricity"] .filter-chip {
  border-radius: 0.12rem;
  border: 1px solid currentColor;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

/* THE ACTIVE FILTER CHIP. styles.css paints it with a hardcoded #00838f — a
   literal, not a token — so any theme that does not override it wears the base
   teal in the middle of its own palette. Only halloween and matrix do; Apple,
   Material and Cyberpunk are all currently showing a chip from another theme
   (logged as a follow-up). Here it is a lit lamp: volt fill, dark ink,
   9.2:1. */
/* RESOLVED 2026-09-05 by the tier tokens the comment above asks for. Both
   chips take their fill and their ink from --sem-chip-* in this theme's own
   token blocks — the lit lamp, the fault lamp, and the filled alert chip's warm
   ink, which is its own --sem-chip-alert-ink and not the volt lamp's. Neither
   needs a dark copy any more: the token blocks carry the variant.

   The BORDER still has to be said, and only on the FILLED chips. This theme
   rings every chip in currentColor a few rules up, at (0,2,0), which outranks
   the base rule's (0,1,0) border-color — so a filled chip comes out ringed in
   its own INK instead of its fill. Measured after the conversion: the volt lamp
   came back with a near-black ring around it. The OUTLINE chip is deliberately
   left alone, because ringing that one in its own ink is the pilot-lamp rule
   this theme is built on. */
:root[data-palette="electricity"] .filter-chip-active {
  border-color: var(--sem-chip-fill);
}
:root[data-palette="electricity"] .filter-chip-alert.filter-chip-active {
  border-color: var(--sem-chip-alert-fill);
}

/* ===========================================================================
   THE PILOT LAMPS — green normal, amber caution, red fault. This is not a
   metaphor applied to a palette; it is where the convention comes from, and
   this theme sits close enough to the source to say so.

   Measured, per the three rules in this directory's README:
     1. Distinguishable FROM EACH OTHER, as CIELAB deltaE between fills (the
        metric that matches the rule — these fills are near-identical lightness
        and differ in hue, so a luminance ratio would say nothing). Light:
        good/caution 16.9, caution/bad 17.3, good/bad 21.2. Dark: 24.0 / 19.2 /
        36.4. Over ~10 reads as a different colour.
     2. Direction preserved: green pilot < amber caution < red fault.
     3. Every label clears 4.5:1 on its own fill; the lowest here is 6.15.
   `disposed` and `donated` are separated by temperature — dead panel grey
   against the panel — at 12.2 (light) and 12.8 (dark).
   =========================================================================== */

/* The seven chips are the seven tiers, declared as tokens in the blocks above.
   Nothing is restated here, and nothing needs a dark copy. */

/* The dashboard's attention tiles are the same three lamps, at panel scale. */
/* THE TILES. The four plain ones are dark faces with a hairline of light along
   the top edge, which is where a lit panel actually catches. The AMBER one is
   different on purpose: on this dashboard it is the only coloured tile and it
   means "this needs you", so it stops being a coloured rectangle and becomes a
   warning lamp — near-black behind a live volt edge, glowing onto the page.
   A dark yellow fill was tried first and measured as olive mud against a
   charged palette, which is the whole reason this is an outline and not a fill.
   =========================================================================== */
:root[data-palette="electricity"] .stat-tile {
  box-shadow: inset 0 1px 0 rgba(185, 215, 245, 0.10);
}
:root[data-palette="electricity"] .stat-tile-teal   { background: #14405e; box-shadow: inset 0 1px 0 rgba(159, 216, 255, 0.30); }
:root[data-palette="electricity"] .stat-tile-salmon { background: #7d2c1a; box-shadow: inset 0 1px 0 rgba(255, 150, 120, 0.35); }
:root[data-palette="electricity"] .stat-tile-amber  {
  background: #221900;
  box-shadow:
    inset 0 0 0 1px var(--el-volt),
    inset 0 1px 0 var(--el-volt),
    0 0 24px -8px var(--el-volt-bloom);
}
:root[data-palette="electricity"] .stat-tile-grey   { background: #333c49; box-shadow: inset 0 1px 0 rgba(190, 205, 225, 0.22); }

/* Paper needs no marquee and no bloom. */
@media print {
  :root[data-palette="electricity"] main h1 { background-image: none; }
  :root[data-palette="electricity"] .sidebar-nav a.active { box-shadow: none; }
}

/* ===========================================================================
   THE DASHBOARD BARS. `.chart-bar-*` is hardcoded to the SCP brand palette in
   the app's own stylesheet and NO theme in this directory re-pitches it, so
   every theme here has been wearing brand teal on the dashboard. That is a
   defect in all seven and is logged as such; this is the fix for this one.
   Same tiers as the status chips, same direction, drawn as conductors.
   =========================================================================== */
/* The eight conductors are --chart-bar-* in the token blocks above. They used
   to be sixteen selectors here plus eight more inside a media query; the base
   rule reads the token, so one declaration per bar covers every variant. */

/* ===========================================================================
   THE ZEBRA. The app's own stylesheet tints every even row with
   `rgba(120, 100, 70, 0.07)` — a warm brown overlay tuned for the base theme's
   cream, applied to EVERY theme, and overridden by exactly one of them
   (halloween). On this palette it laid a brown wash over a cool blue page,
   which is visible on a 394-row table and was found by reading the computed
   background rather than by looking. Logged as a defect in the other five.

   Same specificity as the base rule, later in the cascade, so it wins on source
   order — the theme layer's rule and the reason there is no !important here.
   =========================================================================== */
/* RESOLVED 2026-09-05: the base rule reads --zebra-stripe, which this theme
   declares once per variant in its token blocks. Six selectors became two
   declarations, and the overlay is now re-pitchable by any theme. */
