/* ─────────────────────────────────────────────────────────────
   Clyffe — Design system component styles (shared by all web apps)
   Consumed via _content/Clyffe.DesignSystem/clyffe-components.css,
   linked after clyffe-tokens.css. Uses tokens only — no raw values.
   ───────────────────────────────────────────────────────────── */

/* ── Utilities ── */
.cursor-pointer {
    cursor: pointer;
}

/* ── Backdrop (the surface you meet Clyffe on, epic #1548 decision 16) ──
   Drift at frost 5, picked from the round-2 mock on 20 Oct 2026 (#1665): four soft navy orbs on
   white, each wandering the screen on its own loop and swelling on another, under a white veil.
   The loops are unrelated lengths and start part-way through, so no two orbs move in step and the
   picture never visibly repeats; where two cross, multiply deepens the navy. Each load starts them
   somewhere new: clyffe-backdrop.js picks each orb's point in its loops, away from the card and
   from the other orbs, and sets it as the orb's --drift-from and --swell-from (#1716); without the
   script they start where these rules say. They emerge as the page opens, one after another, each
   fading in as it swells to size, and --emerge-from is how the script lets a backdrop the page
   redraws carry on rather than arrive twice. The page wears .clyffe-backdrop and carries the orbs
   as one decorative element (.clyffe-backdrop-forms with four empty children), fixed to the
   viewport so a page that scrolls does not drag them up. The orbs are the brand's navy at 30, 26,
   24 and 30 percent and the veil the brand's white at 20, set by opacity so no colour is declared
   here. White cards sit on it with their usual border, and words that stand on it outside a card
   sit in a clearing (.clyffe-backdrop-clearing, below). Signing in and setting up are one arrival,
   so the door and the setup shell both wear it (#1550, #1551). It isolates, so the orbs' negative
   layer sits above the surface's own white rather than behind it, whether the surface is the page
   or a shell. */
.clyffe-backdrop {
    background-color: var(--surface-page);
    isolation: isolate;
}

.clyffe-backdrop-forms {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

/* Each orb is sized on the longer side of the screen and centred on its point by its left and top.
   The loops move it with the translate and scale properties, so those are what it promotes. */
.clyffe-backdrop-forms > i {
    position: absolute;
    border-radius: 50%;
    background: var(--navy);
    filter: blur(63px);
    mix-blend-mode: multiply;
    will-change: translate, scale;
}

.clyffe-backdrop-forms > :nth-child(1) {
    width: 36vmax;
    height: 36vmax;
    left: calc(14vw - 18vmax);
    top: calc(24vh - 18vmax);
    opacity: 0.3;
    animation:
        clyffe-backdrop-drift-1 41s ease-in-out var(--drift-from, -7s) infinite,
        clyffe-backdrop-drift-swell-1 17s ease-in-out var(--swell-from, 0s) infinite alternate,
        clyffe-backdrop-drift-emerge calc(var(--duration-panel) * 2) var(--ease-out) var(--emerge-from, 0s) backwards;
}

.clyffe-backdrop-forms > :nth-child(2) {
    width: 30vmax;
    height: 30vmax;
    left: calc(84vw - 15vmax);
    top: calc(26vh - 15vmax);
    opacity: 0.26;
    animation:
        clyffe-backdrop-drift-2 47s ease-in-out var(--drift-from, -19s) infinite,
        clyffe-backdrop-drift-swell-2 23s ease-in-out var(--swell-from, 0s) infinite alternate,
        clyffe-backdrop-drift-emerge calc(var(--duration-panel) * 2) var(--ease-out) var(--emerge-from, var(--duration-stagger)) backwards;
}

.clyffe-backdrop-forms > :nth-child(3) {
    width: 40vmax;
    height: 40vmax;
    left: calc(70vw - 20vmax);
    top: calc(88vh - 20vmax);
    opacity: 0.24;
    animation:
        clyffe-backdrop-drift-3 53s ease-in-out var(--drift-from, -31s) infinite,
        clyffe-backdrop-drift-swell-3 29s ease-in-out var(--swell-from, 0s) infinite alternate,
        clyffe-backdrop-drift-emerge calc(var(--duration-panel) * 2) var(--ease-out) var(--emerge-from, calc(var(--duration-stagger) * 2)) backwards;
}

.clyffe-backdrop-forms > :nth-child(4) {
    width: 26vmax;
    height: 26vmax;
    left: calc(28vw - 13vmax);
    top: calc(80vh - 13vmax);
    opacity: 0.3;
    animation:
        clyffe-backdrop-drift-4 37s ease-in-out var(--drift-from, -11s) infinite,
        clyffe-backdrop-drift-swell-4 19s ease-in-out var(--swell-from, 0s) infinite alternate,
        clyffe-backdrop-drift-emerge calc(var(--duration-panel) * 2) var(--ease-out) var(--emerge-from, calc(var(--duration-stagger) * 3)) backwards;
}

/* The frost: a plain white veil. A backdrop-filter here would paint a second copy of orbs that are
   already blurred and darken them, so the softening lives in the orbs' own blur. */
.clyffe-backdrop-forms::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--white);
    opacity: 0.2;
}

/* The shader (clyffe-backdrop-gl.js, #2091) draws the same orbs and veil into a canvas it adds as
   the forms' last child, with noise of about one colour level added before the browser rounds to
   8 bits, which the blur above cannot do: blurred here, the orbs' edges step into bands. The canvas
   fills the forms; the orb rules name the orbs (> i), so it wears none of them. Only once the shader has a working context does
   it mark the forms, and only then do the CSS orbs and veil hide; they keep running their loops
   underneath, because the shader reads each orb's box every frame. Without WebGL they show. */
.clyffe-backdrop-forms > canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.clyffe-backdrop-gl > i,
.clyffe-backdrop-gl::after {
    visibility: hidden;
}

/* Four waypoints per orb, back to where it started. */
@keyframes clyffe-backdrop-drift-1 {
    0%, 100% {
        translate: 0 0;
    }

    25% {
        translate: 18vw 26vh;
    }

    50% {
        translate: 30vw 4vh;
    }

    75% {
        translate: 8vw -12vh;
    }
}

@keyframes clyffe-backdrop-drift-2 {
    0%, 100% {
        translate: 0 0;
    }

    25% {
        translate: -20vw 30vh;
    }

    50% {
        translate: -8vw 50vh;
    }

    75% {
        translate: 6vw 14vh;
    }
}

@keyframes clyffe-backdrop-drift-3 {
    0%, 100% {
        translate: 0 0;
    }

    25% {
        translate: -26vw -14vh;
    }

    50% {
        translate: -44vw -30vh;
    }

    75% {
        translate: -10vw -36vh;
    }
}

@keyframes clyffe-backdrop-drift-4 {
    0%, 100% {
        translate: 0 0;
    }

    25% {
        translate: 22vw -30vh;
    }

    50% {
        translate: 42vw -6vh;
    }

    75% {
        translate: 14vw 10vh;
    }
}

@keyframes clyffe-backdrop-drift-swell-1 {
    from {
        scale: 0.8;
    }

    to {
        scale: 1.15;
    }
}

@keyframes clyffe-backdrop-drift-swell-2 {
    from {
        scale: 0.85;
    }

    to {
        scale: 1.25;
    }
}

@keyframes clyffe-backdrop-drift-swell-3 {
    from {
        scale: 0.85;
    }

    to {
        scale: 1.1;
    }
}

@keyframes clyffe-backdrop-drift-swell-4 {
    from {
        scale: 0.8;
    }

    to {
        scale: 1.2;
    }
}

/* The entrance: twice a panel step, so orbs this large and soft read as arriving rather than
   blinking on, and the last of the four is in place within 780ms. It runs to each orb's own
   opacity and to the full size its swell loop sets. */
@keyframes clyffe-backdrop-drift-emerge {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* Each orb is named, not matched with > i: the rules that start the drift are an nth-child each,
   which outranks > i, so a reduce rule any less specific leaves the orbs drifting. Stopped, each
   rests on its own point at full size. */
@media (prefers-reduced-motion: reduce) {
    .clyffe-backdrop-forms > :nth-child(1),
    .clyffe-backdrop-forms > :nth-child(2),
    .clyffe-backdrop-forms > :nth-child(3),
    .clyffe-backdrop-forms > :nth-child(4) {
        animation: none;
    }
}

/* Words that stand on the backdrop rather than on a card (Setting up, the setup step rail, the
   door's Terms line) sit in a soft white clearing, so they read at 4.5:1 or better wherever the
   orbs drift (#1716). The clearing is a white oval a step wider than the words all round, blurred
   by most of that, so it is all but solid white under the words and fades out into the backdrop
   with no edge or corner: a haze, never a second card. It takes the backdrop's own layer, under
   every card and above the orbs, so it never covers a card's edge; the element itself does not
   isolate for the same reason. */
.clyffe-backdrop-clearing {
    position: relative;
}

.clyffe-backdrop-clearing::before {
    content: "";
    position: absolute;
    inset: calc(var(--space-5) * -1);
    z-index: -1;
    border-radius: 50%;
    background: var(--white);
    filter: blur(var(--space-4));
    pointer-events: none;
}

/* ── Brand lockup (the mark beside the name) ──
   The one way Clyffe signs a screen: the brand's wordmark, the ring beside "Clyffe" in Crimson Pro
   Light (design-system#13), never the old "CLYFFE.IO" capitals marketing lockup (#578). Two tones,
   white on navy and navy on light, because the lockup sits on both; four sizes, because the
   sidebar's signature is smaller than an entry screen's and the ring also stands where an icon
   would. Nothing else varies. */
.clyffe-lockup {
    display: inline-flex;
    align-items: center;
}

/* The artwork's height is the ring's, so each step sizes the ring and the name follows it. */
.clyffe-lockup-mark {
    display: block;
    flex-shrink: 0;
    width: auto;
}

.clyffe-lockup-sm .clyffe-lockup-mark {
    height: 26px;
}

/* The drawer's foot, beneath the menu (#1242): the organisation heads the drawer and Clyffe signs
   it in full white, the wordmark about 92px wide as the Glass (Pro) mock draws it (#2235). */
.clyffe-lockup-signature .clyffe-lockup-mark {
    height: 28px;
}

.clyffe-lockup-lg .clyffe-lockup-mark {
    height: 34px;
}

/* The ring where an icon would go (#1907): the icon system's 20px, so it sits in a button, a
   header or beside a line of text the way any other icon does. */
.clyffe-lockup-icon .clyffe-lockup-mark {
    height: 20px;
}

/* ── Product logo tile ──
   One treatment for every product in the app, whether we fetched a logo for it or fall back to
   its initial: a white tile, one radius, one size ramp off the control-height scale. Until #578
   the fallback sat on a navy MudAvatar and the fetched logo on white, so one list showed two
   kinds of thing; white is the one the vendors' own artwork is drawn for, and it keeps a column
   of logos quiet (Jamie's call, 28 Aug — the issue text had said parchment). The hairline is
   what makes it a tile rather than a floating mark on a white card. */
.clyffe-app-logo {
    background-color: var(--surface-card);
    color: var(--text-strong);
    border: var(--border-card);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-weight: var(--weight-body-semibold);
    overflow: hidden;
}

.clyffe-app-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* A logo made for a dark background (#1116): a light mark the white tile would swallow, so a
   wrapper that knows the logo's theme puts the same tile on ink. Used wherever an organisation's
   own logo is drawn (the sidebar badge, Settings, the onboarding preview); the tile stays one
   treatment with one variant, described here and nowhere else. */
.clyffe-logo-on-ink .clyffe-app-logo {
    background-color: var(--ink);
    border-color: var(--ink);
}

/* A catalogue page's initial on navy (Clyffe admin mocks ae-p1, ae-p2, ae-p7): only ever a tile with no logo to show. */
.clyffe-logo-initial-on-navy .clyffe-app-logo {
    background-color: var(--navy);
    border-color: var(--navy);
    color: var(--white);
    font-family: var(--font-display);
}

/* Compounded so the ramp out-specifies MudAvatar's own per-size width/height. */
.clyffe-app-logo.clyffe-app-logo-sm {
    width: var(--control-height-sm);
    height: var(--control-height-sm);
    font-size: var(--text-caption-size);
}

.clyffe-app-logo.clyffe-app-logo-md {
    width: var(--control-height-md);
    height: var(--control-height-md);
    font-size: var(--text-body-size);
}

.clyffe-app-logo.clyffe-app-logo-lg {
    width: var(--control-height-lg);
    height: var(--control-height-lg);
    font-size: var(--text-h2-size);
}

/* ── Brand mark (epic #1883): a company's wordmark alone, or its icon tile or initial with the
   name beside it. The icon tile is AppLogo's; the initial's disc takes the theme document's sheet
   accent, lettered in the sheet's colour, as inline values and falls back to navy. ── */
.clyffe-brand-mark {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
}

.clyffe-brand-mark-file {
    display: inline-flex;
    flex: 0 0 auto;
}

.clyffe-brand-mark-initial {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--navy);
    color: var(--white);
    font-family: var(--font-display);
    font-weight: var(--weight-body-semibold);
}

.clyffe-brand-mark-initial-sm {
    width: var(--control-height-sm);
    height: var(--control-height-sm);
    font-size: var(--text-body-size);
}

.clyffe-brand-mark-initial-lg {
    width: var(--control-height-lg);
    height: var(--control-height-lg);
    font-size: var(--text-h1-size);
}

.clyffe-brand-mark-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clyffe-brand-mark-wordmark {
    display: inline-flex;
    max-width: 100%;
}

/* A wordmark made for a dark background (#1116), on the same ink the icon tile uses. */
.clyffe-brand-mark-wordmark--on-ink {
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    background-color: var(--ink);
}

.clyffe-brand-mark-wordmark-img {
    display: block;
    max-width: 100%;
    width: auto;
    object-fit: contain;
}

.clyffe-brand-mark-wordmark-sm {
    height: var(--control-height-sm);
}

.clyffe-brand-mark-wordmark-lg {
    height: var(--control-height-lg);
}

/* ── Empty state (calm, quiet — no alarm styling) ── */
.clyffe-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-2);
    padding: var(--space-6) var(--space-4);
}

.clyffe-empty-state-icon {
    color: var(--navy-40);
}

.clyffe-empty-state-title {
    font-family: var(--font-display);
    font-size: var(--text-h2-size);
    font-weight: var(--weight-display-medium);
    color: var(--text-heading);
}

.clyffe-empty-state-description {
    max-width: 420px;
    font-size: var(--text-body-size);
    line-height: var(--leading-body);
    color: var(--text-body);
}

.clyffe-empty-state-actions {
    margin-top: var(--space-2);
    display: flex;
    gap: var(--space-2);
}

/* ── Page transition (subtle fade on navigation — nothing snaps) ──
   Opacity only, deliberately: animating transform makes the wrapper the containing
   block for position: fixed descendants, which clipped the detail panes to the page
   content instead of the viewport. */

.clyffe-page-transition {
    animation: clyffe-page-enter var(--duration-panel) var(--ease-out) both;
}

@keyframes clyffe-page-enter {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ── Entrance (a setup screen arriving, epic #1548) ──
   .clyffe-screen-enter fades a screen in as it rises 12px; .clyffe-rise staggers its children in
   after it, each rising 8px one --duration-stagger step behind the one before. The screen goes on
   the element holding the card, never on a wrapper of a position: fixed child such as
   .clyffe-backdrop-forms: a transform, even mid-animation, makes the wrapper the containing block
   that child is placed against (see the page transition above). The fill is backwards, so a child
   sits hidden through its delay and leaves no transform behind once it has arrived. A container
   that should rise only after something else has played sets --rise-after on itself (never on an
   element that is itself rising), and its children wait that long before the stagger starts.
   .clyffe-screen-exit is the screen leaving before the next one enters (#1636): it fades as it
   lifts 8px, and holds there until the page moves on. It takes the place of the entrance on the
   same element, so the two never run at once. */

.clyffe-screen-enter {
    animation: clyffe-screen-enter var(--duration-panel) var(--ease-out) backwards;
}

.clyffe-screen-exit {
    animation: clyffe-screen-exit var(--duration-micro) var(--ease-out) forwards;
    pointer-events: none;
}

.clyffe-rise > * {
    animation: clyffe-rise var(--duration-panel) var(--ease-out) backwards;
}

.clyffe-rise > :nth-child(1) {
    animation-delay: calc(var(--rise-after, 0s) + var(--duration-stagger));
}

.clyffe-rise > :nth-child(2) {
    animation-delay: calc(var(--rise-after, 0s) + var(--duration-stagger) * 2);
}

.clyffe-rise > :nth-child(3) {
    animation-delay: calc(var(--rise-after, 0s) + var(--duration-stagger) * 3);
}

.clyffe-rise > :nth-child(4) {
    animation-delay: calc(var(--rise-after, 0s) + var(--duration-stagger) * 4);
}

.clyffe-rise > :nth-child(5) {
    animation-delay: calc(var(--rise-after, 0s) + var(--duration-stagger) * 5);
}

.clyffe-rise > :nth-child(6) {
    animation-delay: calc(var(--rise-after, 0s) + var(--duration-stagger) * 6);
}

.clyffe-rise > :nth-child(7) {
    animation-delay: calc(var(--rise-after, 0s) + var(--duration-stagger) * 7);
}

.clyffe-rise > :nth-child(n + 8) {
    animation-delay: calc(var(--rise-after, 0s) + var(--duration-stagger) * 8);
}

@keyframes clyffe-screen-enter {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes clyffe-screen-exit {
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

@keyframes clyffe-rise {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* ── Skeleton loading (skeletons over spinners; navy-to-cream pulse) ── */

.clyffe-skeleton {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-2) 0;
}

.clyffe-skeleton-row {
    height: 40px;
    border-radius: var(--radius-xs);
    background: linear-gradient(90deg, var(--navy-05), var(--parchment-50), var(--navy-05));
    background-size: 200% 100%;
    animation: clyffe-skeleton-pulse 1.6s var(--ease-in-out) infinite;
}

/* A line of text still to come (#1907): the row's pulse at a line's height, for the place a
   sentence will land rather than a list row. */
.clyffe-skeleton-row--line {
    height: 12px;
}

/* A mark that breathes beside skeleton lines (the Clyffe AI sheet while it looks, #1907), on the
   pulse's own loop so the two move together: full to faint and back. */
.clyffe-skeleton-mark {
    animation: clyffe-skeleton-breathe 1.6s var(--ease-in-out) infinite;
}

@keyframes clyffe-skeleton-pulse {
    from {
        background-position: 200% 0;
    }
    to {
        background-position: -200% 0;
    }
}

@keyframes clyffe-skeleton-breathe {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

@media (prefers-reduced-motion: reduce) {
    .clyffe-page-transition,
    .clyffe-screen-enter,
    .clyffe-screen-exit,
    .clyffe-rise > *,
    .clyffe-skeleton-mark {
        animation: none;
    }

    .clyffe-skeleton-row {
        animation: none;
        background: var(--navy-05);
    }
}

/* ── The setup handoff's layer (clyffe-handoff.js; epic #2085 decision 3, ADR 0040 §I) ──
   Its canvas and its reduced-motion veil cover the window above every layer the product draws,
   MudBlazor's overlays included. They take clicks only until the new page shows (the module
   sets that inline), and never over the page it clears onto. */
.clyffe-handoff-layer {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2147483000;
    pointer-events: none;
}

/* ── The flip that opens a guided setup (clyffe-flip.js; ADR 0040 §I) ──
   The area's card, lifted off the page, holds its place while the setup loads, then turns over
   into the setup room's card. Its layers sit above the page and below the handoff, take no clicks,
   and the module places, sizes and removes them. The card is solid for the turn only: its faces
   are opaque and its edges show between them, a departure from the flat card for one motion. */
.clyffe-flip,
.clyffe-flip-words {
    position: fixed;
    z-index: 2147482000;
    margin: 0;
    pointer-events: none;
}

/* The lifted copy keeps the card's border box exactly, whatever its own box sizing. */
.clyffe-flip-words {
    z-index: 2147482001;
    box-sizing: border-box;
    max-width: none;
    max-height: none;
}

/* A still copy of the old page laid over the window, which dissolves into the setup page's backdrop
   behind the lifted card. The module copies the page's own background and type onto it. */
.clyffe-flip-cover {
    position: fixed;
    inset: 0;
    z-index: 2147481999;
    overflow: hidden;
    pointer-events: none;
}

.clyffe-flip-spin {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
}

.clyffe-flip-face,
.clyffe-flip-edge {
    position: absolute;
    margin: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Scoped under the layer so it outranks the copied card's own size rules, wherever they load:
   each face is exactly the card's border box. */
.clyffe-flip .clyffe-flip-face {
    inset: 0;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
}

.clyffe-flip-front {
    background-color: var(--surface-card);
}

.clyffe-flip-edge {
    background: linear-gradient(var(--navy-15), var(--navy-15)), var(--surface-card);
}

.clyffe-flip-lift {
    box-shadow: var(--shadow-overlay);
    opacity: 0;
}

.clyffe-flip-shade {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--ink);
    opacity: 0;
    pointer-events: none;
}

/* ── Card (the surface everything on a page sits on) ──
   Flat by brand: white, one hairline border at 8% navy, 2px radius, never a shadow — a card is
   a surface, not a floating layer. Declared here rather than per app because the page header
   below is one, and a second definition is how the two drifted apart in the first place. */
.clyffe-card {
    border: var(--border-card);
    border-radius: var(--radius-xs);
    background: var(--white);
    box-shadow: none;
}

/* ── Page header (the one way a page introduces itself) ──
   Twenty-one pages hand-rolled this block, the home screen drew a bare heading with no card,
   and the setup screens used a third vocabulary of their own (#579). The spacing and type of a
   page title now live here and nowhere else. */
.clyffe-page-header {
    padding: var(--pad-card);
}

.clyffe-page-header.clyffe-page-header-flat {
    padding: 0;
}

.clyffe-page-header-back {
    margin-bottom: var(--space-2);
}

.clyffe-page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3);
}

/* The logo, the title block and anything sitting beside the title read as one unit, so they
   stay together when the actions wrap onto their own line. */
.clyffe-page-header-lead {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
    min-width: 0;
}

/* The title block is a flex item beside the logo and the adornment. Without this a long title
   refuses to shrink and pushes the page's actions off the end of the row. */
.clyffe-page-header-heading {
    min-width: 0;
}

/* A section's heading in a searchable select's list. */
.clyffe-select-section {
    font-family: var(--font-body);
    font-size: var(--text-eyebrow-size);
    font-weight: var(--weight-body-semibold);
    line-height: var(--leading-ui);
    letter-spacing: var(--tracking-ui);
    color: var(--text-label);
}

.clyffe-page-header-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--text-h1-size);
    font-weight: var(--weight-display);
    line-height: var(--leading-heading);
    color: var(--text-display);
}

/* Blazor's FocusOnNavigate puts focus on the h1 (it adds tabindex="-1") so a screen reader
   announces the new page. That is the announcement we want and the focus ring we do not, on
   every heading it lands on, not only the page header's. Chrome draws that programmatic focus
   as :focus-visible after a cross-origin redirect, so the app-wide :focus:not(:focus-visible)
   rule does not hide it. A heading is not a control, so keyboard rings on controls stay. */
h1[tabindex="-1"]:focus,
h1[tabindex="-1"]:focus-visible {
    outline: none;
    box-shadow: none;
}

.clyffe-page-header-subtitle {
    margin: var(--space-1) 0 0;
    font-family: var(--font-body);
    font-size: var(--text-body-size);
    font-weight: var(--weight-body);
    line-height: var(--leading-body);
    color: var(--text-body);
    max-width: 70ch;
}

.clyffe-page-header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.clyffe-page-header-body {
    margin-top: var(--space-3);
}

/* ── Secondary navigation (the one row of switchable labels) ──
   An area's pages and a page's filters are drawn by one component (issue #581). Cove, not navy: the sidebar is the product and owns navy;
   this row is context inside whatever the sidebar selected, and the brand's secondary colour is
   what says so. These rules draw a filter row; a row of sections always takes the flat look below
   (#2246). Spacing is the caller's, through Class. */
.clyffe-section-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.clyffe-section-nav-item {
    display: inline-flex;
    align-items: center;
    min-height: var(--control-height-sm);
    padding: 0 var(--space-3);
    border: var(--border-width) solid var(--border-hairline);
    border-radius: var(--radius-sm);
    background: var(--surface-card);
    color: var(--text-body);
    font-family: var(--font-body);
    font-size: var(--text-caption-size);
    font-weight: var(--weight-body-semibold);
    line-height: var(--leading-ui);
    letter-spacing: var(--tracking-ui);
    /* The label stays on one line: a wrapped tab is taller than the ones beside it, which is the
       ragged row of controls the sizing rules exist to stop. */
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-micro);
}

.clyffe-section-nav-item:hover {
    border-color: var(--cove);
    color: var(--ink);
}

/* Keyboard focus draws the design system's ring (#1652), clear of a navy or Cove fill. */
.clyffe-section-nav-item:focus-visible {
    outline: var(--border-width-indicator) solid var(--focus-ring);
    outline-offset: var(--border-width-indicator);
}

/* White on the fill, so the fill is the text-safe Cove (5.6:1); the hover border above is a mark.
   The active item keeps its white label when hovered: hover's ink on this fill is 3.4:1. */
.clyffe-section-nav-item-active,
.clyffe-section-nav-item-active:hover {
    background: var(--cove-text);
    border-color: var(--cove-text);
    color: var(--white);
}

/* Joined: the same segments as one segmented control, sharing their inner edges (#1636). */
.clyffe-section-nav--joined {
    flex-wrap: nowrap;
    gap: 0;
}

.clyffe-section-nav--joined .clyffe-section-nav-item + .clyffe-section-nav-item {
    margin-left: calc(var(--border-width) * -1);
}

.clyffe-section-nav--joined .clyffe-section-nav-item:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.clyffe-section-nav--joined .clyffe-section-nav-item:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Flat: an area's pages are always an underlined row of tabs on a hairline, in navy as the design
   system's Tabs draws them, so a row that changes page never looks like a row that filters
   (#2246). A filter row on a page whose header is flat (#2070, the Hub mock's p1) asks for the
   flat look too: outlined chips, the active one outlined in navy on a navy tint. */
.clyffe-section-nav-sections.clyffe-section-nav--flat {
    gap: var(--space-4);
    border-bottom: var(--border-width) solid var(--border-hairline);
}

.clyffe-section-nav-sections.clyffe-section-nav--flat .clyffe-section-nav-item {
    min-height: 0;
    padding: 0 0 var(--space-2);
    margin-bottom: calc(var(--border-width) * -1);
    border: 0;
    border-bottom: var(--border-width-indicator) solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--text-muted);
    font-weight: var(--weight-body-medium);
}

.clyffe-section-nav-sections.clyffe-section-nav--flat .clyffe-section-nav-item:hover {
    color: var(--navy);
}

.clyffe-section-nav-sections.clyffe-section-nav--flat .clyffe-section-nav-item-active,
.clyffe-section-nav-sections.clyffe-section-nav--flat .clyffe-section-nav-item-active:hover {
    border-bottom-color: var(--navy);
    background: transparent;
    color: var(--navy);
}

.clyffe-section-nav-filters.clyffe-section-nav--flat .clyffe-section-nav-item {
    border-color: var(--navy-10);
    border-radius: var(--radius-pill);
    background: var(--white);
    color: var(--text-muted);
    font-weight: var(--weight-body-medium);
}

.clyffe-section-nav-filters.clyffe-section-nav--flat .clyffe-section-nav-item:hover {
    border-color: var(--navy);
    color: var(--navy);
}

.clyffe-section-nav-filters.clyffe-section-nav--flat .clyffe-section-nav-item-active,
.clyffe-section-nav-filters.clyffe-section-nav--flat .clyffe-section-nav-item-active:hover {
    border-color: var(--navy);
    background: var(--navy-05);
    color: var(--navy);
}

/* Flat and joined: a couple of exclusive views as one segmented control, the active segment filled
   navy (the Hub mock's s2 preview: Clyffe app / New tab, Light / Dark). */
.clyffe-section-nav-filters.clyffe-section-nav--flat.clyffe-section-nav--joined .clyffe-section-nav-item {
    border-radius: 0;
}

.clyffe-section-nav-filters.clyffe-section-nav--flat.clyffe-section-nav--joined .clyffe-section-nav-item:first-child {
    border-top-left-radius: var(--radius-sm);
    border-bottom-left-radius: var(--radius-sm);
}

.clyffe-section-nav-filters.clyffe-section-nav--flat.clyffe-section-nav--joined .clyffe-section-nav-item:last-child {
    border-top-right-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
}

.clyffe-section-nav-filters.clyffe-section-nav--flat.clyffe-section-nav--joined .clyffe-section-nav-item-active,
.clyffe-section-nav-filters.clyffe-section-nav--flat.clyffe-section-nav--joined .clyffe-section-nav-item-active:hover {
    border-color: var(--navy);
    background: var(--navy);
    color: var(--white);
}

/* Steps: a setup page's rail (the Hub mock's s2). One bordered row of equal cells, each a link to
   its step with a ring: ticked in Cove once passed, a navy ring on the current step, empty ahead. */
.clyffe-section-nav-steps {
    gap: 0;
    border: var(--border-card);
    border-radius: var(--radius-xs);
    background: var(--surface-card);
}

/* Equal cells, as s2 draws them; a label never shrinks below its own width, so a narrow screen wraps. */
.clyffe-section-nav-steps .clyffe-section-nav-item {
    flex: 1 1 0;
    min-width: max-content;
    gap: var(--space-2);
    min-height: var(--control-height-md);
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text-muted);
    font-weight: var(--weight-body-medium);
}

.clyffe-section-nav-steps .clyffe-section-nav-item + .clyffe-section-nav-item {
    border-left: var(--border-width) solid var(--border-hairline);
}

.clyffe-section-nav-steps .clyffe-section-nav-item:hover {
    color: var(--navy);
}

.clyffe-section-nav-steps .clyffe-section-nav-item-active,
.clyffe-section-nav-steps .clyffe-section-nav-item-active:hover {
    background: transparent;
    color: var(--navy);
}

/* The ring is the spacing scale's 16px, where s2 draws 18px: there is no indicator-size token, and
   the nearest step on the scale is close enough not to need one. */
.clyffe-section-nav-dot {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: var(--space-3);
    height: var(--space-3);
    border: var(--border-width-indicator) solid var(--navy-15);
    border-radius: var(--radius-pill);
    color: var(--white);
}

.clyffe-section-nav-dot .mud-icon-root {
    width: calc(var(--space-3) - 2 * var(--border-width-indicator));
    height: calc(var(--space-3) - 2 * var(--border-width-indicator));
}

.clyffe-section-nav-item-done .clyffe-section-nav-dot {
    border-color: var(--cove);
    background: var(--cove);
}

.clyffe-section-nav-item-active .clyffe-section-nav-dot {
    border-color: var(--navy);
    box-shadow: inset 0 0 0 var(--border-width-indicator) var(--navy);
}

/* Text for a screen reader only: what a mark says, such as a step's tick. One recipe for any
   component that needs it. */
.clyffe-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* On a phone the rail goes single-file, one step per row, rather than wrapping into a ragged grid
   (--bp-sm). */
@media (max-width: 600px) {
    .clyffe-section-nav-steps {
        flex-direction: column;
        align-items: stretch;
    }

    .clyffe-section-nav-steps .clyffe-section-nav-item {
        flex: none;
        min-width: 0;
    }

    .clyffe-section-nav-steps .clyffe-section-nav-item + .clyffe-section-nav-item {
        border-left: 0;
        border-top: var(--border-width) solid var(--border-hairline);
    }
}

/* ── Searchable select (the one dropdown) ──
   Every picker over a list the business owns is this control (issue #694): the reader types
   rather than scrolls, and a name only ever carries an address where the name alone would name
   two people. The row and the chosen-token strip are styled here so no page can grow a second
   look for the same control. ── */
.clyffe-select {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.clyffe-select-option {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.clyffe-select-option-label {
    font-family: var(--font-body);
    font-size: var(--text-body-size);
    color: var(--text-strong);
    line-height: var(--leading-ui);
}

/* The disambiguating line. Quieter than the name it sits under, because it is there to tell two
   rows apart rather than to be read on its own. */
.clyffe-select-option-secondary {
    font-family: var(--font-body);
    font-size: var(--text-caption-size);
    color: var(--text-muted);
    line-height: var(--leading-ui);
}

.clyffe-select-empty {
    font-family: var(--font-body);
    font-size: var(--text-caption-size);
    color: var(--text-muted);
    padding: var(--space-2) var(--space-3);
}

/* What a multi-select has been set to. Tokens, not badges: each one is the control that takes
   itself back off, which is the opposite of what a status pill means. */
.clyffe-select-tokens {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

.clyffe-select-token {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-height: var(--control-height-sm);
    padding: 0 var(--space-2);
    background: var(--surface-sunken);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: var(--text-caption-size);
    color: var(--text-strong);
    cursor: pointer;
    transition: var(--transition-micro);
}

.clyffe-select-token:hover:not(:disabled) {
    border-color: var(--cove);
}

.clyffe-select-token:disabled {
    cursor: default;
    color: var(--text-muted);
}

.clyffe-select-token-remove {
    font-size: var(--text-body-size);
    line-height: 1;
    color: var(--text-muted);
}

/* ── Brand candidate tile (#1921) ──
   One logo the look-up found, as a tile to pick: BrandCandidateTile, shared by onboarding,
   Settings and Clyffe admin. */
.clyffe-brand-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--pad-card);
    background: var(--surface-card);
    border: var(--border-card);
    border-radius: var(--radius-lg);
    color: var(--text-body);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-micro);
}

.clyffe-brand-tile:hover:not(:disabled) {
    border-color: var(--navy-40);
}

/* The focus ring as an outline, the same 3px of --focus-ring as --focus-shadow, so the selected
   tile's inset border keeps its own box-shadow; no design-system rule hides an outline on a control. */
.clyffe-brand-tile:focus-visible {
    outline: 3px solid var(--focus-ring);
}

.clyffe-brand-tile--selected,
.clyffe-brand-tile--selected:hover:not(:disabled) {
    border-color: var(--navy);
    box-shadow: inset 0 0 0 1px var(--navy);
}

.clyffe-brand-tile:disabled {
    cursor: default;
}

/* The logo sits on the warm surface so a white logo and a dark one both read. */
.clyffe-brand-tile-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: var(--control-height-lg);
    padding: var(--space-2);
    background: var(--surface-warm);
    border-radius: var(--radius-sm);
}

.clyffe-brand-tile-name {
    font-weight: var(--weight-body-semibold);
    color: var(--text-strong);
}

.clyffe-brand-tile-source {
    font-size: var(--text-caption-size);
    color: var(--text-muted);
}

/* ── Status pill (ClyffeStatusPill, Badge in the plugin) ──
   A leading dot in the tone's colour on every live tone (Neutral's in navy-40, #3506); Quiet, a state that is over, is an outline
   with no dot (mock p1, #2088); Standing, a state in effect that asks nothing of anyone, is the outline with a navy-40 dot (mock
   policy, #3636). */
.clyffe-status-pill-dot {
    display: inline-block;
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    margin-inline-end: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* Neutral, a plain fact such as Off: the dot in navy-40, as the plugin Badge's neutral dot, so it recedes
   beside a live tone while the label keeps the pill's colour (#3506). */
.clyffe-status-pill--neutral .clyffe-status-pill-dot,
.clyffe-status-pill--standing .clyffe-status-pill-dot {
    background: var(--navy-40);
}

/* Doubled class for weight, so no MudBlazor internal class is named (MudBlazor renames them). */
.clyffe-status-pill.clyffe-status-pill--quiet,
.clyffe-status-pill.clyffe-status-pill--standing {
    border-color: var(--navy-15);
    background: transparent;
    color: var(--text-muted);
}

/* ── Info tip (ClyffeInfoTip) ──
   A term's or a value's one plain line behind a small "i" (#3475): a button, so the keyboard and a
   tap reach it; the line opens in the tooltip layer, anchored to the mark wherever it sits. */
/* Centred on the line it sits in, and never taller than it: the negative block margin keeps a 20px
   icon from growing a row of small text, so rows with a tip and rows without one keep one height. */
.clyffe-info-tip {
    vertical-align: middle;
    line-height: 0;
    margin-block: calc(var(--space-1) * -1);
}

/* Lifted above a row's stretched link, so a hover or tap opens the tip rather than the row. */
.clyffe-info-tip-mark {
    position: relative;
    z-index: 1;
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    line-height: 0;
    color: inherit;
    cursor: pointer;
}

/* A 24px hit area around the 20px icon, so a tap reaches it without moving anything beside it. */
.clyffe-info-tip-mark::after {
    content: "";
    position: absolute;
    inset: calc(var(--space-1) / -2);
    border-radius: var(--radius-pill);
}

.clyffe-info-tip-mark:focus-visible {
    outline: var(--border-width-indicator) solid var(--focus-ring);
    outline-offset: var(--border-width-indicator);
}
