/* The Blazor Web App template's Bootstrap-era rules (.valid.modified/.invalid/.validation-message/
   .darker-border-checkbox/.form-floating) were deleted here: this app ships no Bootstrap and renders every
   input through MudBlazor, which carries its own validation styling — grep confirms nothing outside this file
   ever referenced those classes. */

h1:focus {
    outline: none;
}

/* Restyled off the template's raw #b32121 + inline yellow-warning SVG onto the design tokens (Sparkd.Components/
   wwwroot/sparkd-tokens.css), so the one surface a user only ever sees when something has already gone wrong
   isn't also the one surface that looks like a different product — and so it follows the dark canvas like
   everything else. Error hue comes from MudBlazor's own palette (SparkdTheme's Error, #B3261E / #FF8A80), which
   is theme-aware already; the token fallbacks keep it readable if this ever renders before MudThemeProvider. */
.blazor-error-boundary {
    padding: var(--space-4, 16px) var(--space-5, 20px);
    background: var(--color-surface, #FFFFFF);
    border-left: 4px solid var(--mud-palette-error, #B3261E);
    border-radius: var(--radius-control, 16px);
    box-shadow: var(--shadow-float, 0 8px 16px rgba(28, 23, 20, 0.08));
    color: var(--color-text-primary, #27221F);
    font-family: var(--font-family-ui, sans-serif);
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* UI-fidelity workstream Phase 1 — NavShell.razor's own remarks: reserves layout space for the fixed nav shell
   once its role is known, so page content never renders underneath the fixed bottom pill nav (Creator, and
   Marketer at mobile) or the fixed rail (all three roles: a full-height left rail at ≥960px, the same element
   reshaped into a horizontal top bar below that). Global/unscoped by necessity — the
   anchor lives in NavShell.razor's own render output, outside any component's scoped-CSS boundary (a plain,
   unscoped `id` selector reaches it regardless).

   DEF-075-01: keyed off "#app-state-anchor[data-nav-role]" (NavShell.razor's own remarks) rather than a
   `body[data-nav-role]` attribute selector — Blazor Web App's enhanced navigation was reconciling `<body>` itself
   against every destination page's server-rendered response on each in-app navigation and silently stripping that
   attribute back off. The anchor renders AFTER the conditional nav markup (NavShell.razor), so this general
   sibling combinator reaches only what follows it in document order — `@Body`'s actual page content, plus a
   couple of inert/invisible roots (MudBlazor's popover/dialog/snackbar providers, ReconnectModal) that padding
   doesn't visibly affect — and deliberately NEVER the fixed nav bar itself (a sibling BEFORE the anchor):
   an earlier anchor placement (`<body>`'s first child) let this same selector ALSO match `.bottom-nav-bar`/
   `.marketer-rail`, inflating the nav's OWN height by this same clearance padding and making it overlap (and
   swallow clicks on) the very content it was supposed to make room for. */
/* ══ THE ADMIN IMPERSONATION BAND ══════════════════════════════════════════════════════════════════════════
   ImpersonationBanner.razor is `position: fixed` at the top edge with a very high z-index, which by itself would
   COVER the top of whatever chrome the role's shell pins there (the phone top bar, or the full-height rail's
   brand lockup at desktop). A band that hides part of the app is a band people resent and then work around; a
   band that MOVES the app down is a state they simply live inside. So this block does the second thing, in two
   rules and one number:

     1. <body> takes the band's height as padding, which pushes every in-flow element — including each page's own
        `#app-state-anchor ~ *` clearance below — down as a group. One rule instead of four edits to the four
        role-specific clearance expressions, which is also why those expressions did not need to change at all.
     2. Every element the shells pin to the viewport's top edge starts BELOW the band instead of at 0.

   The number lives once, as --impersonation-band-height, read by both rules AND by the component's own
   stylesheet. The `:has()` predicate is what makes all of this cost nothing when nobody is impersonating: with
   no band in the document the token stays 0px and every declaration below is a no-op.

   Global and unscoped by necessity, exactly like the `#app-state-anchor` rules below: these selectors have to
   reach elements that live inside four different components' scoped-CSS boundaries. Specificity is enough to win
   against those components' own `top: 0` (a scoped rule is `.creator-rail[b-xxxxx]`, one class + one attribute;
   `body:has(#impersonation-band) .creator-rail` is one class + one id + one element). */
:root {
    --impersonation-band-height: 0px;
}

body:has(#impersonation-band) {
    --impersonation-band-height: 56px;
    padding-top: var(--impersonation-band-height);
}

/* The band stacks its two emails at phone width rather than truncating either (its own stylesheet says why), so
   the reservation grows with it. Same token, so the two can never disagree. */
@media (max-width: 600px) {
    body:has(#impersonation-band) {
        --impersonation-band-height: 76px;
    }
}

body:has(#impersonation-band) .top-bar,
body:has(#impersonation-band) .creator-rail,
body:has(#impersonation-band) .marketer-rail,
body:has(#impersonation-band) .admin-rail,
body:has(#impersonation-band) .stage-sidebar {
    inset-block-start: var(--impersonation-band-height);
}

#app-state-anchor[data-nav-role] ~ * {
    padding-bottom: var(--nav-bottom-clearance);
}

/* Each clearance below is `nav footprint + the page's own top breathing room`, NOT the bare nav footprint.
   These rules carry an ID and so outrank SparkPage's own scoped `padding-block`, REPLACING it rather than adding
   to it — so a bare footprint value left every authenticated page's first heading sitting flush against the
   chrome with a measured 0px gap (screenshot- and getBoundingClientRect-confirmed on admin at 390px). The old
   MudContainer pages never hit this because they spaced themselves with a `mt-8` MARGIN, which these
   padding rules do not touch. Same reason `padding-bottom` restores --space-9 instead of zeroing out.

   RAIL-FIRST: there is NO top bar at ≥960px any more — the three shells fold brand, search, navigation and the
   account cluster into one full-height left rail (CreatorNavShell.razor's own remarks). So --nav-topbar-height
   is reserved BELOW the breakpoint only, where that same element reshapes into the phone's horizontal top bar.
   Above it the top clearance is just the page's own breathing room, and the 64px band the old bar occupied is
   reclaimed by content rather than left as dead space. */

/* Creator and marketer share ONE rule because they share one shell shape (CreatorNavShell.razor — one rail at
   ≥960px, a horizontal top bar plus the shared bottom pill below that), so their clearance arithmetic is
   identical to the pixel. The role string is the one NavShell already stamps — `RoleAttribute` lowercases
   "Creator" to "creator" (NavShell.razor.cs), and NavShellTests asserts that attribute value directly. */
#app-state-anchor[data-nav-role="creator"] ~ *,
#app-state-anchor[data-nav-role="marketer"] ~ * {
    padding-top: calc(var(--nav-topbar-height) + var(--space-7));
}

/* Rail footprint + the page's own gutter, the same arithmetic the top clearance uses — this ID rule REPLACES
   SparkPage's scoped padding-inline on the left side, so the bare rail width left the first heading flush
   against (and clipped by) the rail hairline wherever the viewport was too narrow for the centered max-width
   column to add slack of its own (~960–1100px; screenshot-confirmed on marketer Requests at ~975px). */
/* --nav-rail-width is declared per breakpoint (sparkd-tokens.css): 88px where X collapses its rail to icons,
   the full 267px column above 1250px. Both branches read it, so the clearance follows the rail for free. */
@media (min-width: 960px) {
    #app-state-anchor[data-nav-role="creator"] ~ *,
    #app-state-anchor[data-nav-role="marketer"] ~ * {
        padding-top: var(--space-7);
        /* THE RAIL, THEN ONE INSET — and the inset is --x-row-inset (20px since the 2026-09-05 parity pass took
           that token to the number all three approved prototypes draw), the same one the column header over
           the page and every row in the app use, applied to BOTH sides here. It was `rail + --gutter-page` on
           the left and SparkPage's own --gutter-page (32px at this width) on the right, which put the content
           32px in from the panel's right edge and 32px in from its left. That was invisible while the page's
           padding was unpainted canvas; with the panel filling it, one inset on both sides is the difference
           between a panel and a page that happens to be white. */
        padding-left: calc(var(--nav-rail-width) + var(--x-row-inset));
        padding-right: var(--x-row-inset);
        /* --space-7, matching the top. It was --space-9 (48px against 32px) — invisible for the same reason, and
           a lopsided panel now. There is no bottom pill at this width to clear; below 960px the base rule's
           --nav-bottom-clearance still is that pill's own reservation and is deliberately untouched. */
        padding-bottom: var(--space-7);
    }
}

/* At the three-column width the rail becomes the LEAD COLUMN — the rail plus the margin that centres the group —
   and page content takes the identical expression. Every creator/marketer route, not just the timeline: the rail
   is one fixed element, and one that moved sideways between routes would be the one thing about it a person
   actually notices. */
@media (min-width: 1250px) {
    #app-state-anchor[data-nav-role="creator"] ~ *,
    #app-state-anchor[data-nav-role="marketer"] ~ * {
        padding-left: calc(var(--shell-lead) + var(--x-row-inset));
    }
}

/* TASK-154 (US-029) — AdminNavShell's own rail (AdminNavShell.razor.css). At ≤960px admin now takes the
   creator/marketer phone shape — one top bar plus the shared bottom pill — so it clears exactly what they clear:
   the bar on top and (via the general rule above) --nav-bottom-clearance below. At ≥960px the rail returns to
   the left edge and there is no header row left to clear. */
#app-state-anchor[data-nav-role="admin"] ~ * {
    padding-top: calc(var(--nav-topbar-height) + var(--space-7));
}

@media (min-width: 960px) {
    #app-state-anchor[data-nav-role="admin"] ~ * {
        padding-top: var(--space-7);
        /* Rail + one inset, on both sides — see the creator/marketer rule above for why it is --x-row-inset. */
        padding-left: calc(var(--nav-rail-width) + var(--x-row-inset));
        padding-right: var(--x-row-inset);
        /* Matching the top, same reasoning as the creator/marketer rule above: admin inherited --space-9 from
           its own mobile rule, which is 16px more air under the panel than over it. */
        padding-bottom: var(--space-7);
    }
}

/* At the three-column width admin's rail is the LEAD COLUMN too, as of the mock-parity pass
   (AdminNavShell.razor.css) — the same expression the other two roles' non-bleed pages already take, for the
   same reason: content that does not read it sits under the rail. */
@media (min-width: 1250px) {
    #app-state-anchor[data-nav-role="admin"] ~ * {
        padding-left: calc(var(--shell-lead) + var(--x-row-inset));
    }
}

/* A PAGE WITH THE SHARED COLUMN HEADER (SparkPage's `Title`/`Actions`, .spark-page--headed) takes the chrome's
   footprint and NOT the page's own 40px of breathing room. The bar is the top of the page now and it is STICKY,
   so 40px of canvas above it is 40px that scrolls away on the first flick and never comes back — X's column
   header sits flush under the chrome. Written here, beside the rules it overrides, because those carry an ID and
   no scoped stylesheet could ever outrank them (the same reason the bleed rules below live here); `~
   .spark-page--headed` is exactly as specific as the general `~ *` rule and wins on order. */
#app-state-anchor[data-nav-role="creator"] ~ .spark-page--headed,
#app-state-anchor[data-nav-role="marketer"] ~ .spark-page--headed,
#app-state-anchor[data-nav-role="admin"] ~ .spark-page--headed {
    /* The chrome's footprint and nothing more — the SAME value the bleed rules below use, because the question is
       the same one: what has to be cleared for the page's first element to sit directly under the chrome. The
       fixed top bar still has to be cleared on a phone; only the page's own --space-7 goes. */
    padding-top: var(--nav-topbar-height);
}

@media (min-width: 960px) {
    #app-state-anchor[data-nav-role="creator"] ~ .spark-page--headed,
    #app-state-anchor[data-nav-role="marketer"] ~ .spark-page--headed,
    #app-state-anchor[data-nav-role="admin"] ~ .spark-page--headed {
        /* No top bar at this width, so the bar starts at y=0 exactly as X's column header does. */
        padding-top: 0;
    }
}

/* FULL BLEED (SparkPage's `FullBleed`, .spark-page--bleed). The clearance above deliberately bundles the nav
   footprint WITH the page's own breathing room, which is right for a page in a column and wrong for one whose
   content is meant to touch the window edge. These rules give such a page the BARE footprint instead: enough to
   clear the chrome, and not one pixel more.

   They live here, beside the rules they override, rather than in SparkPage.razor.css — the rules above carry an
   ID, so a scoped component stylesheet could never outrank them. `[data-nav-role] ~ .spark-page--bleed` is
   ID+2-classes, which beats `[data-nav-role="…"] ~ *` outright and therefore does not depend on source order.
   Bottom clearance is deliberately NOT overridden: the fixed bottom pill still has to be cleared, bleed or not. */
/* Admin's bleed pages are the CONSOLE (AdminConsole.razor), whose surface is meant to reach the bottom of the
   window the way X's column does. On a phone it clears the bottom pill like any other bleed page; at ≥960px
   there is no pill, so the --space-7 the admin rule reserves there would be dead canvas under a white panel —
   the console gives its own body the bottom inset instead (`.x-console__body` in sparkd-tokens.css). */
#app-state-anchor[data-nav-role="creator"] ~ .spark-page--bleed,
#app-state-anchor[data-nav-role="marketer"] ~ .spark-page--bleed,
#app-state-anchor[data-nav-role="admin"] ~ .spark-page--bleed {
    padding-top: var(--nav-topbar-height);
    padding-inline: 0;
}

@media (min-width: 960px) {
    #app-state-anchor[data-nav-role="admin"] ~ .spark-page--bleed {
        padding-bottom: 0;
    }
}

@media (min-width: 960px) {
    #app-state-anchor[data-nav-role="creator"] ~ .spark-page--bleed,
    #app-state-anchor[data-nav-role="marketer"] ~ .spark-page--bleed,
    #app-state-anchor[data-nav-role="admin"] ~ .spark-page--bleed {
        /* No top bar at this width, so nothing to clear: the content starts at y=0 and runs to the right edge. */
        padding-top: 0;
        padding-left: var(--nav-rail-width);
    }
}

/* Admin joined this rule with the mock-parity pass: its rail takes the lead column at this width like the other
   two (AdminNavShell.razor.css), so the console has to read the same expression or it overlaps the rail. */
@media (min-width: 1250px) {
    #app-state-anchor[data-nav-role="creator"] ~ .spark-page--bleed,
    #app-state-anchor[data-nav-role="marketer"] ~ .spark-page--bleed,
    #app-state-anchor[data-nav-role="admin"] ~ .spark-page--bleed {
        padding-left: var(--shell-lead);
    }
}

/* STAGE SURFACES ON A PHONE (`data-nav-stage`, stamped by NavShell.razor.cs beside the role). Below the rail
   breakpoint the shells' top bar stops being a band on these routes and becomes two controls floating over the
   media (each shell's own `--stage` block), so the band it used to reserve here has to go with it — otherwise the
   content still starts 64px down and the only thing that changed is that the strip is now empty.

   Placed AFTER the rules it overrides, deliberately: `[data-nav-stage] ~ *` is exactly as specific as
   `[data-nav-role="creator"] ~ *`, and `~ .spark-page--bleed` exactly as specific as its own bleed rule, so the
   tie is broken by source order in this one file rather than by inventing specificity. It is also why both
   variants are restated here — winning the general rule and losing the bleed one would leave the media pages
   alone and move nothing.

   Two values, not one. A bleed page's first element IS the media and must touch the top of the window. A page in
   a column (the deck's own empty/error states) still needs its content clear of the floating controls, so it
   keeps the bar's footprint and gives up only the page's own extra breathing room. The deck's card itself takes
   neither: it is a fixed, full-window box at this width (Deck.razor.css). */
@media (max-width: 959.98px) {
    #app-state-anchor[data-nav-stage] ~ * {
        padding-top: var(--nav-topbar-height);
    }

    /* `[data-nav-timeline]` as well, and that second attribute is the whole point of this pass. Starting a
       bleed page's media at y=0 is only correct where the bar SCROLLS AWAY off it — the timeline bar's
       `position: absolute` (each shell's own phone block). On a stage route that is NOT a timeline one the bar
       is the ordinary pinned 56px band every board draws, and a bleed page under it began behind it:
       /campaigns/{guid} rendered its hero at y=0 with the avatar and the bell sitting on the campaign's own
       status chip and clipping it. There is exactly one such route, and it now takes the band's footprint from
       the `~ *` rule above like every other page.

       Specificity is ID+2 attributes against that rule's ID+1, so it wins wherever it applies regardless of
       source order — and where it does not apply, the `~ *` rule is simply left standing, which is the
       behaviour this is after. */
    #app-state-anchor[data-nav-stage][data-nav-timeline] ~ .spark-page--bleed {
        padding-top: 0;
    }

    /* EXCEPT WHERE THAT PAGE'S OWN HEADER CARRIES THE WAY BACK. Starting at y=0 is right for MEDIA, which is
       what the rule above is for. These pages' first element is a 56px header, and it landed exactly under the
       floating bar: measured at 390 on 2026-09-17, the back control sat at x=20 y=6 at 44x44 with the shell's
       32x32 account avatar painted over its centre, so a POINTER could never press it — elementFromPoint at the
       control's centre returned the avatar, on /search, /posts/{id} and /orgs/{id}/profile alike (the hit-target
       survey's rest-state pass). The keyboard could still reach it, which is why it survived a keyboard audit.

       A way back that cannot be pressed is a dead end, and this project's standing bar is that no state is one,
       so the band's footprint comes back for these pages and their content starts 56px lower.

       :has() names the defect itself — a page holding a back control — rather than listing routes, so a new page
       that puts a ColumnHeader on a timeline surface is covered the day it is written. A timeline page with NO
       back (/feed, /cycles) keeps the rule above: its header is the bar's own substitute, it loses no control to
       the overlap, and moving it would shift the home surface for nothing. */
    #app-state-anchor[data-nav-stage][data-nav-timeline] ~ .spark-page--bleed:has(.col-header__back, .profile-col__back) {
        padding-top: var(--nav-topbar-height);
    }
}

/* ── THE THREE-COLUMN SHELL (`data-nav-timeline`, stamped by NavShell.razor.cs beside the role and the stage
   flag) ──────────────────────────────────────────────────────────────────────────────────────────────────────
   A route whose centre column is a READING column gets X's own shape: the rail grows to keep the group centred,
   the page's left clearance is THE SAME EXPRESSION so the two agree to the pixel, and the reading column itself
   is capped by the page (Feed.razor.css's own `.feed` block).

   Placed AFTER every rule it overrides, deliberately, and restated for both the general and the bleed variant:
   `[data-nav-timeline] ~ *` is exactly as specific as `[data-nav-role="creator"] ~ *`, so the tie is broken by
   source order in this one file rather than by inventing specificity. Winning one and losing the other would
   leave the timeline half-moved.

   Why `--shell-lead` and not `--nav-rail-width`: the lead is the rail PLUS the margin that centres the group, and
   it is written with `50%` rather than `50vw` precisely so it resolves to the same number here (a percentage
   against this element's containing block) as it does on the fixed rail (a percentage against the viewport).
   sparkd-tokens.css's own block has the measurements and the reasoning. */
@media (min-width: 960px) {
    #app-state-anchor[data-nav-timeline] ~ *,
    #app-state-anchor[data-nav-timeline] ~ .spark-page--bleed {
        /* The reading column starts right after the collapsed rail and nothing sits to its right — the sidebar
           does not exist below 1250px. `padding-right: 0` is what lets the column keep its own hairline edges
           rather than floating inside a gutter, and the left is the BARE rail for the same reason: the column
           brings its own edge, and the gutter that used to sit here is 32px of panel between the rail's hairline
           and the column's. */
        padding-left: var(--nav-rail-width);
        padding-right: 0;
    }
}

/* THE SIDEBAR'S FOOTPRINT IS RESERVED HERE, once, for the whole timeline family. StageSidebar is
   `position: fixed`, so it reserves no space in flow — before the full-width pass the centred group's own
   trailing margin happened to leave room for it and only `.messages` (a fixed-height two-pane grid) had to
   reserve it explicitly. With the sidebar pinned to the window's right edge there is no such margin, and a
   reading column free to run the full width would slide straight under it. Since the fill-the-width ruling the
   columns have NO cap of their own — they take 100% of what is left — so this reservation is the only thing
   deciding where a column stops, and removing it would run every timeline route under the sidebar. */
@media (min-width: 1250px) {
    #app-state-anchor[data-nav-timeline] ~ *,
    #app-state-anchor[data-nav-timeline] ~ .spark-page--bleed {
        padding-left: var(--shell-lead);
        padding-right: var(--shell-sidebar-width);
    }
}

/* A timeline route whose page is NOT full-bleed (/deals, /campaigns/new) has no column of its own to bring the
   inset: its filter chips, section titles and column header sat flush against the rail's hairline (0px) while every
   other page sits --x-row-inset in. Such a page keeps the inset on both sides, like any page in a column.
   ID + attribute + :not(class) outranks the rule above. */
@media (min-width: 1250px) {
    #app-state-anchor[data-nav-timeline] ~ :not(.spark-page--bleed) {
        padding-left: calc(var(--shell-lead) + var(--x-row-inset));
        padding-right: calc(var(--shell-sidebar-width) + var(--x-row-inset));
    }
}

/* ── THE GROUP DOES NOT CENTRE (firstmate's ruling, 2026-09-05, superseding his own earlier decision) ────────
   A `@media (min-width: 1583px)` rule used to raise `--shell-outer-gutter` here, centring the whole
   rail|column|sidebar group on a timeline route once the region grew past the column's 950px ceiling. It moved
   THE RAIL. Measured at 1920: rail trailing edge 451.5 on /feed and /matches, 283 on /deck and /campaigns, with
   the sidebar moving with it — the navigation jumped 168px sideways between two routes at the same width. The
   captain's standing instruction is "be consistent on each page".

   The rail and the sidebar are FIXED CHROME and never move: rail leading edge 0, sidebar trailing edge the
   viewport's, on every route and every width. Since the fill-the-width ruling (captain, 2026-09-05: "yes make
   it fill the width") a timeline route has NO surplus to place: the column is the whole region between the two
   reservations above, so --shell-column-max and its `margin-inline: auto` are both retired and each boundary
   still shows exactly the one hairline the rail or the sidebar draws. Re-measured with the column filling its
   region: gap 0, one hairline per boundary, no vertical border on the column.

   Nothing may re-introduce a group-centring margin. --shell-outer-gutter and --shell-lead-base are deleted from
   sparkd-tokens.css so there is nothing left to raise. */

/* ── THE THIRD SECTION ON A PAGE THAT IS NOT A TIMELINE (`data-nav-sidebar`) ─────────────────────────────────
   Captain, 2026-09-05: "every page should be 3 sections". The sidebar renders on every signed-in Creator and
   Marketer route now bar three (NavShell.razor.cs's own exception list), and its footprint has to be reserved
   on those routes too — a `position: fixed` column reserves no space in flow, so without this the page's last
   column simply runs under it.

   A SEPARATE FLAG from `data-nav-timeline`, not a widening of it. The timeline flag also decides the phone's
   scroll-away top bar and the reading-column shape; a form or a roster is neither of those things, and folding
   the two answers together would have changed the phone chrome on twenty routes to move a desktop column.

   `:not([data-nav-timeline])` because a timeline route already has its reservation two rules up and takes the
   BARE sidebar width (its column brings its own hairline edges); a non-timeline page keeps the --x-row-inset the
   ≥960px rule gives it on both sides, so its reservation is the sidebar PLUS that inset. Specificity is
   ID+2-attributes, which outranks the ID+1-attribute rules above it regardless of source order.

   THE BLEED VARIANT TAKES THE BARE SIDEBAR (spacing pass). That reasoning is true of a page in a column and
   false of a bleed one, and this rule used to cover both from one selector: a bleed page does NOT keep the
   ≥960px inset on its left — the bleed block above replaces `padding-inline` with the bare --shell-lead — so
   adding it on the right alone made the page lopsided by exactly one inset. MEASURED on the offline harness at
   1440 on the Workbench family (eleven routes: /billing, /organisation, /organisation/team, /permissions,
   /requests, /notifications, /privacy, /creator-profile/social, the interest list, the contract and the rating
   form): a card's text sat 40px in from the rail's trailing edge and 60px in from the sidebar's leading one.
   Same panel, same card, two different margins. With the bare width it is 40/40, and the page's own room
   (`.spark-bench`, or the page's blocks on /campaigns and the profile) supplies the whole inset on both sides,
   which is what full-bleed means. The non-bleed selector keeps the inset it genuinely has on both sides. */
@media (min-width: 1250px) {
    #app-state-anchor[data-nav-sidebar]:not([data-nav-timeline]) ~ * {
        padding-right: calc(var(--shell-sidebar-width) + var(--x-row-inset));
    }

    #app-state-anchor[data-nav-sidebar]:not([data-nav-timeline]) ~ .spark-page--bleed {
        padding-right: var(--shell-sidebar-width);
    }
}

/* ── THE PANEL IS THE GROUND (`#app-state-anchor[data-nav-role]`) ────────────────────────────────────────────
   Captain's ruling, 2026-09-05: "make sure the white background covers the whole page." The signed-in app is ONE
   continuous --color-surface surface from edge to edge of the window — left, right, top and bottom, at every
   width, in both themes — and where two regions still need separating a HAIRLINE does it: the rail's
   `border-inline-end`, the sidebar's `border-inline-start`, the reading column's `border-inline`, a row's
   divider. Never a gap of bare ground.

   THIS SUPERSEDES THE PANEL-ON-CANVAS ARRANGEMENT this block used to hold, and the history is worth keeping
   because it was three passes of the same complaint. `body` painted --color-surface-variant for months (~1.05:1
   against the panels — the bug sparkd-tokens.css's own `body` block records); then the canvas became the boards'
   warm #E9E2D7 and every Workbench route drew a panel on it; then the full-width pass removed the centred
   group's ~96px side gutters. What was left was smaller but exactly the same complaint — the page's own right,
   top and bottom padding, and the ground under a page shorter than the window.

   The canvas token is NOT deleted: --color-bg is still what a designed plate, an avatar's page-ring and a
   recessed hover fill read. It simply may not appear as UNFILLED PAGE inside the shell.

   `:has()` is what scopes this to a signed-in route: the anchor is NavShell's own element and renders only once
   a role is known, so the marketing front door and the auth screens (which are not this shell, and whose ground
   is deliberately the canvas) are untouched. Specificity is (1,1,1) — it outranks sparkd-tokens.css's own
   one-element `body` rule regardless of which stylesheet loads last. */
body:has(#app-state-anchor[data-nav-role]) {
    background: var(--color-surface);
}

/* The page paints it too, rather than relying on the ground showing through — a page is the thing a component
   sits on, and one that is transparent is one nobody can reason about locally. Unconditional: the rail, the
   phone's top bar and the sidebar are all `position: fixed` and paint over their own footprint, so there is no
   region of this element that needs to be left unpainted (which is what the old `background-clip: content-box`
   and, after it, the hard-stop gradient were for). */
#app-state-anchor[data-nav-role] ~ .spark-page {
    background: var(--color-surface);
}

/* THE PANEL REACHES THE BOTTOM OF THE WINDOW. A page with three rows is shorter than the viewport, and the
   ground under its last row was the canvas — a beige band below the content, as visible as the side gutters
   were. `box-sizing: border-box` is SparkPage's own, so this is the window's height INCLUDING the nav clearance
   this file puts on the same element: it adds no scrollbar to a short page. `dvh` rather than `vh` for the
   phone's collapsing browser chrome, the same reason every other full-height box here uses it. */
#app-state-anchor[data-nav-role] ~ .spark-page {
    min-block-size: 100dvh;
}

/* On a phone the timeline's top bar is `position: absolute` — it sits at the top of the PAGE and scrolls away
   with the content, which is X's own behaviour and the reason the whole first screen belongs to the timeline.
   Out of flow, so the content still has to reserve the band it starts under; the two then scroll together. */
@media (max-width: 959.98px) {
    #app-state-anchor[data-nav-timeline] ~ *,
    #app-state-anchor[data-nav-timeline] ~ .spark-page--bleed {
        padding-top: var(--x-bar-height);
    }
}

/* TASK-087 (US-042 AC-1/AC-3): the deck card's hero is now the shared `MediaImage` composite (Deck.razor,
   `Class="deck-card-hero-media"`), which is built as a bounded avatar/tile (fixed px width tiers, its own
   shadow-float/radius-card, an optional bloom ring) — the deck card instead needs it to fill
   `.swipe-card__hero`'s own 4:5 box edge-to-edge, full-bleed, with no card-within-a-card shadow/radius of its
   own. Global/unscoped by necessity, same reasoning as the nav-clearance rules above: MediaImage's rendered root
   is a CHILD component's own markup, and Blazor CSS isolation never scopes a caller's stylesheet (SwipeCard's or
   Deck's) onto it, regardless of where the `<MediaImage>` tag is written. Selectors are 3+ classes deep
   deliberately, so they win over MediaImage's own 1-2-class rules regardless of stylesheet load order. */
.swipe-card__hero .deck-card-hero-media.media-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

/* The extra `.media-image--card-4x5` qualifier is load-order-proof specificity, NOT redundancy: MediaImage's own
   scoped size rule `.media-image--card-4x5.media-image--size-medium .media-image__frame[b-xxx]` is (0,4,0) — the
   same specificity a 4-class override would be — and its bundle (Sparkd.Web.styles.css) loads AFTER app.css, so a
   tie let `width: 160px` win and the niche-gradient hero placeholder only filled the fixed 160px tile (the rest of
   the card showing the hero's surface background). Five classes here beats that scoped rule outright, restoring the
   full-bleed 4:5 cover for a no-photo campaign (the common case), regardless of stylesheet load order. */
.swipe-card__hero .deck-card-hero-media.media-image.media-image--card-4x5 .media-image__frame {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
}

/* Print. Added for the contract document view (Pages/DealContract.razor — the owner's "viewed and downloaded as
   pdf": the browser's own Print must give a clean sheet too, not a screenshot of an app), but deliberately
   GLOBAL rather than contract-only — no screen in this app has ever wanted its navigation chrome on paper, and
   the alternative is every future printable page re-deriving these two rules.

   Global/unscoped by necessity, the same reasoning the nav-clearance rules above carry: the shells are rendered
   by NavShell/MarketerNavShell/AdminNavShell, outside any page's scoped-CSS boundary. Selectors are semantic
   (`nav`, `role="banner"`) rather than a list of shell class names, so a fourth shell is covered the day it
   ships. The clearance padding those fixed bars need goes with them — left in, it prints as a blank band where
   the chrome used to be.

   Ink and canvas are deliberately NOT forced here: a document decides that on its own root, where it can
   re-point the colour tokens for its own subtree (DealContract.razor.css's own print block does exactly that). */
@media print {
    nav,
    [role="banner"],
    /* The third column joined the chrome on every product route with the 2026-09-05 sidebar pass, and it is an
       <aside> rather than a nav or a banner — so without naming it here a printed contract carried a deal digest
       down its right-hand side. */
    .stage-sidebar {
        display: none;
    }

    /* The bleed variant is listed explicitly because its own clearance rules above are ID+class and would
       otherwise outrank this ID-only reset, printing a blank band where the rail used to be. */
    #app-state-anchor[data-nav-role] ~ *,
    #app-state-anchor[data-nav-role] ~ .spark-page--bleed {
        padding: 0;
    }
}
/* Skip link (WCAG 2.4.1): off-screen until it takes focus, then a normal, visible control pinned top-left.
   Not display:none — that would take it out of the tab order, which is the entire point of it. */
.spark-skip-link {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2000;
    padding: 0.75rem 1rem;
    /* 48px tall when it shows (the KISS touch floor; the padding alone made it 44). */
    min-height: var(--size-touch-target-min, 48px);
    box-sizing: border-box;
    background: var(--color-surface, #fff);
    /* --color-text is not a token that exists; the fallback (near-black ink) therefore ALWAYS won, so the skip
       link was dark-on-dark the moment it took focus in dark mode. --color-text-primary is the real name. */
    color: var(--color-text-primary, #14100d);
    border-radius: 0 0 var(--radius-control, 8px) 0;
    font-family: var(--font-family-ui, system-ui), sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-150%);
}

.spark-skip-link:focus-visible,
.spark-skip-link:focus {
    transform: translateY(0);
    outline: 2px solid var(--accent-ember, #b8441e);
    outline-offset: 2px;
}

/* ── X's keyboard shortcuts ─────────────────────────────────────────────────────────────────────────────────
   Global/unscoped by necessity, the same reasoning the nav-clearance rules carry: `.shortcut-current` is stamped
   on a PostRow by js/shortcuts.js, which is outside every component's scoped-CSS boundary, and the help sheet is
   a <dialog> NavShell renders for the whole app.

   The current row's ring is `inset` so it never adds a pixel to the row's height — a timeline that reflowed as
   j walked down it would be a timeline that moved under the reader. */
.shortcut-current {
    box-shadow: inset 0 0 0 2px var(--color-focus-ring);
}

.spark-shortcuts {
    max-width: min(480px, calc(100vw - var(--space-8, 40px)));
    padding: var(--space-6, 24px);
    border: 0;
    border-radius: var(--radius-panel, 24px);
    background: var(--color-surface, #fff);
    color: var(--color-text-primary, #27221F);
    font-family: var(--font-family-ui, system-ui), sans-serif;
    box-shadow: inset 0 0 0 1px var(--color-divider), var(--shadow-lift);
}

.spark-shortcuts::backdrop {
    background: rgba(20, 16, 13, 0.6);
}

.spark-shortcuts__title {
    margin: 0 0 var(--space-4, 16px);
    font-size: var(--x-type-lead, 20px);
    font-weight: var(--x-weight-heavy, 800);
    line-height: 1.3;
}

/* Two columns, the key on the left and what it does on the right — a definition list because that is exactly
   what this is, and it reads correctly to a screen reader without a single aria attribute. */
.spark-shortcuts__list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-2, 8px) var(--space-4, 16px);
    margin: 0 0 var(--space-5, 20px);
    font-size: var(--x-type-body, 15px);
    line-height: var(--x-type-body-leading, 20px);
}

.spark-shortcuts__list dt,
.spark-shortcuts__list dd {
    margin: 0;
}

.spark-shortcuts__list dd {
    color: var(--color-text-secondary);
}

.spark-shortcuts kbd {
    display: inline-block;
    min-width: 1.5em;
    padding: 2px 6px;
    border-radius: var(--radius-sm, 6px);
    background: var(--color-surface-variant);
    color: var(--color-text-primary);
    font-family: var(--font-family-ui, system-ui), sans-serif;
    font-size: var(--x-type-meta, 13px);
    font-weight: var(--x-weight-bold, 700);
    text-align: center;
}

.spark-shortcuts__close {
    min-height: var(--size-touch-target-min, 44px);
    padding-inline: var(--space-5, 20px);
    border: 0;
    border-radius: var(--radius-full, 9999px);
    background: var(--surface-button-fill);
    color: var(--on-fill);
    font-family: var(--font-family-ui, system-ui), sans-serif;
    font-size: var(--x-type-body, 15px);
    font-weight: var(--x-weight-bold, 700);
    cursor: pointer;
}

.spark-shortcuts__close:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

