/* SkillBridge - Design Tokens
 *
 * The static :root design-token layer, split out of main.css so public
 * booking surfaces (base_public.html, base_embed.html) can load JUST the
 * tokens without pulling the whole app stylesheet. main.css and every
 * component sheet read these var(--token) refs.
 *
 * Per-org brand tokens (--brand-primary, foregrounds, etc.) are injected
 * separately at runtime by apps/core/branding.py (ADR-124); the defaults
 * here are the fallbacks those overrides sit on top of.
 */

:root {
    --systems-content-width: 1500px;
    --systems-change-width: 100px;
    --systems-change-width-small: 70px;
    --systems-check-map-height: 340px;
    --systems-network-height: 560px;
    --systems-trend-width: 110px;
    --systems-trend-height: 26px;
    --systems-drive-opacity: .15;
    --systems-hot-drive-opacity: .2;
    --systems-check-border-width: 4px;
    --systems-check-link-top: calc(-1 * var(--spacing-md) - 1px);
    /* Brand Colors (per-org customizable via context processor).
       Defaults are neutral ink — the pre-injection baseline a brand-free org
       sits on. branding.py (ADR-124) overrides these per-tenant at runtime, so
       existing orgs (e.g. a wine primary) are unaffected; only the neutral baseline
       moved off wine. */
    --brand-primary: #24292f;
    --brand-secondary: #32383e;
    --brand-accent: #0d6efd;
    --brand-highlight: #24292f;
    --event-color: #3B82F6;
    --due-date-color: #D4A017;
    --calendar-unfilled-opacity: .65;
    --calendar-done-opacity: .6;

    /* Semantic tones, four slots each: the base color, a soft notice fill, the
       edge drawn on that fill, and a text tone that clears 4.5:1 on it
       (success 6.65:1, warning 4.79:1, error 6.6:1). The ramps are flat values,
       not tints mixed off the base — the --status-* recipe below is a 10% badge
       tint, and these are the deeper notice surfaces the components were drawn
       against, which a tint does not land on. Error's fill keeps its
       pre-existing -subtle name; its consumers predate the slot grammar.
       Success's -bg/-border/-text and error's -border/-text are ADDITIVE: no
       refs yet — the notice codemod adopts them. */
    --color-success: #00823a;
    --color-success-bg: #f4fcf7;
    --color-success-border: #97dbae;
    --color-success-text: #006831;
    --color-warning: #d39913;
    /* Hover/press step for warning-tinted controls. Same recipe as
       --color-neutral-ink-hover (88% of the base, 12% black), so the two hover
       steps darken by the same amount and no new hex enters the file. */
    --color-warning-hover: color-mix(in srgb, var(--color-warning) 88%, black);
    --color-warning-bg: #fcf6e6;
    --color-warning-border: #fccb57;
    --color-warning-text: #956309;
    --color-error: #d9002b;
    --color-error-subtle: #fcece9;
    --color-error-border: #ffa499;
    --color-error-text: #ac0020;
    --color-info: #6431da;

    /* Organizational tag palette. The fixed set of hues an org-picked label —
       booking category colors today; any future stage or event-type picker —
       may take, replacing free color wheels that let every org improvise.
       Tags organize; they carry no meaning, so the set skips purple (focus and
       info own it) and its red/green/amber are distinct hexes from the
       semantic ramps above, which a tag must never impersonate. Pickers offer
       exactly these ten and store the resolved hex; slate is the unset
       default. Blue and amber deliberately match --event-color and
       --due-date-color so tagged items sit naturally beside them on the
       calendar. */
    --tag-slate: #64748b;
    --tag-red: #cc4245;
    --tag-orange: #e0762e;
    --tag-amber: #d4a017;
    --tag-green: #33875a;
    --tag-teal: #12808a;
    --tag-blue: #3b82f6;
    --tag-navy: #35508c;
    --tag-pink: #c74f8e;
    --tag-brown: #8d6248;

    /* Inbox bubbles (ADR-181, Nick 2026-10-03): the colours a phone shows, so a
       text reads the way it did on the client's screen. Our texts are iMessage
       blue or SMS green; theirs are the light grey with dark words. Only the
       Inbox wears these; they are not the button ink or a tag. */
    --texts-imessage: #0a84ff;
    --texts-sms: #34c759;
    --texts-theirs: #e9e9eb;
    --texts-theirs-text: #1c1c1e;

    /* Chart series colours (ADR-174, amended 2026-10-09). A chart's first
       series wears --chart-1, its second --chart-2, and so on. Every series
       is a tone of the org's own colour, as Nick chose on 2026-10-09: red and
       green read as good and bad in a report, so no series wears them. The
       first is the org's colour as it reads on a card (branding.py darkens a
       pale brand until it does), and each next one mixes it toward the card's
       white, dark, mid and light in turn so neighbours stand apart. None is
       paler than a quarter of the colour, so every series shows on the card.
       The purple stays the focus and info colour and is never a series. */
    --chart-1: var(--brand-primary-on-card-bg);
    --chart-2: color-mix(in srgb, var(--brand-primary-on-card-bg) 55%, var(--color-card-bg));
    --chart-3: color-mix(in srgb, var(--brand-primary-on-card-bg) 25%, var(--color-card-bg));
    --chart-4: color-mix(in srgb, var(--brand-primary-on-card-bg) 90%, var(--color-card-bg));
    --chart-5: color-mix(in srgb, var(--brand-primary-on-card-bg) 45%, var(--color-card-bg));
    --chart-6: color-mix(in srgb, var(--brand-primary-on-card-bg) 80%, var(--color-card-bg));
    --chart-7: color-mix(in srgb, var(--brand-primary-on-card-bg) 35%, var(--color-card-bg));
    --chart-8: color-mix(in srgb, var(--brand-primary-on-card-bg) 65%, var(--color-card-bg));

    /* Tone tints (ADR-131, UI Component Service). Every soft surface the
       platform paints — the .global-badge pill, the .global-alert box, the
       .global-notice strip — takes its fill and its edge from here, so a
       palette change moves all of them together. The edge is the same hue at
       twice the strength; --color-border is the neutral page rule and reads as
       a seam under a tinted fill. Red (danger) is reserved for genuine
       failures — cancellations are neutral, not red. */
    --status-success-bg: color-mix(in srgb, var(--color-success) 10%, transparent);
    --status-success-border: color-mix(in srgb, var(--color-success) 20%, transparent);
    --status-warning-bg: color-mix(in srgb, var(--color-warning) 10%, transparent);
    --status-warning-border: color-mix(in srgb, var(--color-warning) 20%, transparent);
    --status-warning-fg: color-mix(in srgb, var(--color-warning) 45%, var(--color-grey-700));
    --status-danger-bg: color-mix(in srgb, var(--color-error) 10%, transparent);
    --status-danger-border: color-mix(in srgb, var(--color-error) 20%, transparent);
    --status-info-bg: color-mix(in srgb, var(--color-info) 10%, transparent);
    --status-info-border: color-mix(in srgb, var(--color-info) 20%, transparent);
    /* Availability — deliberately teal, NOT success green, so the "Available"
       highlight never reads as the green "Signed Up" pill. -bg is the soft fill
       for a highlighted row; the base token is the pill border/text. */
    --color-availability: #0f766e;
    --color-availability-bg: #e6f4f2;

    /* Value pill — the green numeric value badge (see components/value-pill.css).
       These are the original signup-pill colors. Defined here so an org can
       override the pill without touching the component file. -start/-end are the
       gradient top/bottom; -fg is the text; -shadow is the pill's own colored
       glow, which is derived from -end so an override recolors it too. */
    /* Money-pill gradient. White text stays — cleaner; the stops
       are deepened from the old #32d583/#16a34a so white reads a bit better
       without turning murky. White-on-gradient ~2.4:1 top, ~3.7:1 bottom. */
    --global-value-pill-start: #22b06a;
    --global-value-pill-end: #0f8a3c;
    --global-value-pill-fg: #fff;
    --global-value-pill-shadow: 0 2px 6px
        color-mix(in srgb, var(--global-value-pill-end) 25%, transparent);

    /* Seat badges (components/seat-badge.css): what a seat IS, like Worship
       Leader, Lead or Shadow, as a thin grey outline tag after the role name
       (Nick 11-05). One grey for every badge, never a status colour: the word
       is --color-grey-600 (4.5:1 or better on white and on every grid row
       grey, the darkest too), the hairline --color-grey-400. Three sizes,
       never shrunk: sm a grid cell, a table cell, the Lineup or the drawer's
       Roles list (16px tall, 11px word); md a card, a roster card, a Sign Up
       row or a pin pop-up (20 / 12); lg the seat page header (28 / 13). */
    --badge-fg: var(--color-grey-600);
    --badge-line: var(--color-grey-400);
    --badge-line-width: 1px;
    --badge-size-sm: 16px;
    --badge-size-md: 20px;
    --badge-size-lg: 28px;
    --badge-font-sm: 11px;
    --badge-font-md: 12px;
    --badge-font-lg: 13px;
    --badge-pad-sm: 5px;
    --badge-pad-md: 6px;
    --badge-pad-lg: 8px;

    /* Focus Ring (fixed - not per-org, uses info color for accessibility) */
    --color-focus-ring: #6431da;
    --color-focus-ring-alpha: rgba(100, 49, 218, 0.25);

    --color-page-bg: #f0f0f0;
    --color-card-bg: #ffffff;

    /* What is actually behind a card inside .global-app-content. The same value as
       --color-page-bg until an org picks its own "Every page" background, which
       base/app.html republishes on .global-app-main — above both the content and the
       sticky .global-app-header that paints over it — so a rule that has to repaint
       a piece of the canvas reads THIS and follows the tenant, where
       --color-page-bg would paint every such org the default grey. Not a synonym
       for --color-page-bg: that one is also a hairline, a shimmer stop and a
       calendar cell, none of which follow a tenant's canvas. */
    --color-canvas: var(--color-page-bg);
    --color-text: #232323;
    --color-text-light: #33232c;
    --color-border: #d0d4db;
    --color-border-dark: #232323;

    /* The call sheet on the worker's phone (app/agenda/_call_sheet_phone.html):
       what means something reads in ink, the rest in the soft ink, never lighter. */
    --color-sheet-ink: #111111;
    --color-sheet-ink-soft: #555555;

    /* Exact-match tokens for the owner-approved OAuth consent page
       (apps/mcp_oauth/templates/mcp_oauth/authorize.html). Each value is the
       exact literal that design shipped with, moved here so the page carries no
       raw literal. Do NOT retune — changing one moves an approved pixel. */
    --color-page-bg-soft: #f4f5f7;    /* consent page background (cool off-white) */
    --color-text-cool: #1f2937;       /* consent body text (cool slate) */
    --color-text-muted-cool: #6b7280; /* consent subtitle + scope note (cool grey) */
    --color-border-hairline: #e6e8eb; /* consent card + settings-scope-group hairline */

    /* Table / list-header band. Live on `.payments-ledger__table thead th`, a
       one-off table with no Bootstrap `.table` class, so no cell rule competes
       with it. On a Bootstrap `.table`, set this as --bs-table-bg on the thead —
       as a `background` the cells paint over it. */
    --color-header-band: #eef1f5;

    /* Warm neutral grey ramp (50 lightest → 900 darkest).
       The app today mixes ~six grey systems (Tailwind-gray, Tailwind-slate,
       Material grey, Bootstrap #6c757d, cool blue-greys, stale #0f1116) totalling
       ~1,000 literals. This is the single ramp the grey codemod collapses them to.
       Warm (R >= G > B, a faint taupe) so it sits under the wine brand instead of
       fighting it with cool blue-grey. ADDITIVE: no refs yet — pure no-op. The
       broken --color-text-light fix (separate gated PR) points it at --color-grey-600. */
    --color-grey-50: #faf9fa;
    --color-grey-100: #f3f1f2;
    --color-grey-200: #e7e3e5;
    --color-grey-300: #d4cfd1;
    --color-grey-400: #b3acaf;
    --color-grey-500: #8d8588;
    --color-grey-600: #6c6467;
    --color-grey-700: #4e4749;
    --color-grey-800: #332e30;
    --color-grey-900: #211d1f;

    /* Sidebar Variables.
       Defaults assume a dark brand. The inline <style> from branding_context
       overrides --sidebar-text / --sidebar-text-muted / --sidebar-hover-bg
       per-tenant via brand_tokens so light-brand tenants get dark text. */
    --sidebar-width: 256px;
    /* The collapsed icon rail. Anything positioned against the sidebar has to
       clear BOTH widths, and there was no name for this one — so each of those
       places carried its own 56, and the global toast cleared the rail at the
       wrong width for as long as it had been doing it. */
    --sidebar-collapsed-width: 56px;
    --sidebar-bg: var(--brand-primary);
    --sidebar-text: #ffffff;
    --sidebar-text-muted: rgba(255, 255, 255, 0.7);
    --sidebar-border: rgba(255, 255, 255, 0.1);
    --sidebar-hover-bg: rgba(255, 255, 255, 0.1);
    --sidebar-active-bg: var(--brand-secondary);
    /* RGB triple of --sidebar-text — lets sidebar overlays build any opacity
       (rgba(var(--sidebar-fg-rgb), 0.08)) and flip cleanly between white
       and dark foregrounds based on brand luminance. */
    --sidebar-fg-rgb: 255, 255, 255;

    /* Brand foreground tokens.
       Defaults match the historical hardcoded #fff. The inline <style> from
       branding_context overrides per-tenant via brand_tokens, computing the
       correct contrast color for any brand including white/monochrome. */
    --brand-primary-fg: #ffffff;
    --brand-secondary-fg: #ffffff;
    --brand-highlight-fg: #ffffff;

    /* Brand-color text safe against fixed surfaces.
       Default to brand-primary itself (correct for dark brands).
       Overridden per-tenant when brand-primary fails 4.5:1 contrast against
       the page or card surface (e.g., white-primary tenants). */
    --brand-primary-on-page-bg: var(--brand-primary);
    --brand-primary-on-card-bg: var(--brand-primary);

    /* Hover/active variant of primary that is always visibly different.
       Default falls back to brand-secondary (the historical hover bg —
       was named "accent" before the 2026-05-04 secondary/accent split). */
    --brand-primary-hover: var(--brand-secondary);

    /* Brand-primary alpha overlays (replaces hardcoded rgba(70, 6, 43, ...)
       lurkers that previously baked one tenant's exact burgundy into shared CSS).
       Default is the neutral-ink primary (rgb 36 41 47 == #24292f); branding.py
       overrides per-tenant, so a tenant's own overlays are unaffected. */
    --brand-primary-alpha-05: rgba(36, 41, 47, 0.05);
    --brand-primary-alpha-10: rgba(36, 41, 47, 0.1);

    /* Header — SINGLE SOURCE OF TRUTH for the top-chrome band height. Everything
       that lines up with the header's bottom edge keys off THIS token and nothing
       else: the inverted corner (::before top:100%), the sidebar hairline
       (.global-sidebar::after top), .global-sidebar-brand (min-height), and — one hop away, via
       --drawer-top below — every content-area overlay/drawer. Do NOT hardcode a pixel height for
       any of those, and do NOT leave a stale fallback — a `var(--header-height)`
       with the wrong N is how this drifted before.

       The value is DERIVED, not magic: header controls are 28px (--filter-ctrl-h)
       and we want a 6px gutter top and bottom → 28 + 6 + 6 = 40px. Keep this in
       sync with .global-app-header's vertical padding (0.375rem = 6px) and --filter-ctrl-h;
       if you change the control height, change this and the padding together so the
       band keeps hugging its contents. (Previously 44px, sized for 32px controls
       that no longer exist — that left an 8px dead gutter and read as "too tall".) */
    --header-height: 40px;
    /* Compact-shell (<1024px) header height: a thumb needs 44px controls and
       the bar keeps 6px above and below them. The swap happens on :root, in
       the block right after this one, because --header-bottom and
       --drawer-top resolve here — a height on .global-app-header is inert. */
    --header-height-touch: 56px;
    /* The phone's bottom bar. 0px everywhere but a phone: every rule that
       lifts something by the bar (toasts, sheets, the fill lock, the portal
       frame) subtracts it unconditionally and pays nothing off the phone.
       Set on :root under the phone query below. */
    --bottom-bar-h: 0px;
    --framed-nav-size: 0px;
    /* Keep room for the form when the Book tab shows copy feedback below it. */
    --booking-frame-min-height: min(18rem, 45vh);
    /* Where a bottom sheet's lower edge sits, and the room it keeps inside
       for the home bar. A sheet stands on the bottom bar by default; on a
       phone with the floating tab capsule (phone-bar.css, look D) it runs to
       the screen's edge and covers the capsule, the way an iPhone sheet does. */
    --sheet-bottom: var(--bottom-bar-h);
    --sheet-pad-bottom: 0px;
    --header-bg: var(--sidebar-bg);
    /* Bottom-sheet furniture (drawer.css / main.css phone blocks): the drag
       handle pill and the dim wash over the page above a phone menu. */
    --sheet-handle-w: 36px;
    --sheet-handle-h: 4px;
    --color-scrim: rgba(17, 24, 39, 0.4);
    /* Swipe strip (main.css phone block, .global-swipe-strip): the width of one
       card in a sideways row of cards. Under half the row, so the next card
       always peeks in from the right — the peek IS the "swipe me" cue, no
       arrows or dots. Capped so a wide phone in landscape still shows three. */
    --swipe-card-w: min(44%, 12rem);

    /* Drawer/overlay top edge — the ONE place the "start below the header" offset
       is computed. Every content-area drawer, scrim, and offcanvas keys off this
       instead of re-deriving `safe-top + header-height` (and drifting on the
       fallback). Adopted by drawer.css; a css-standards test fails the build if a
       drawer selector hardcodes a `--header-height, N` fallback again.

       --header-bottom is that same edge on its own — where the header ends and
       sticky content below it begins. The notice band pins here
       (components/notice-strip.css); --drawer-top then adds the band's height so
       everything deeper clears the band too. Both read this one place instead of
       re-deriving `safe-top + header-height` inline (the documented drift vector).

       --notice-height is the live height of the pinned notice band (the
       profile-photo / operator strips in .global-notice-slot), measured by the
       shell in base/app.html and 0px whenever the slot is empty. Folding it in
       here means every content-area drawer, the settings sub-nav, and the scrim
       all start below a pinned banner too — with the same header spacing they
       already use — and no per-consumer rule has to know the banner exists. */
    --header-bottom: calc(var(--safe-top) + var(--header-height));
    --notice-height: 0px;
    --drawer-top: calc(var(--header-bottom) + var(--notice-height));
    /* No push: a drawer that floats over the page leaves the content where it
       is. A page that floats its drawer sets drawer.css's --content-push to it. */
    --content-push-none: 0px;

    /* Header controls — FIXED, not per-org. The header shares the sidebar
       (brand) surface, so to keep every tenant's top bar reading identically
       regardless of brand, controls render EXACTLY like the sidebar org-switcher
       toggle (.global-sidebar-org-toggle): a flat translucent WHITE veil over the dark
       brand bar (white-at-opacity, so the wine shows through warm and muted),
       white text, hairline white border, brightening on hover. Built from
       white-on-dark opacity — NOT brand tints — so every tenant's bar reads
       identically and stays legible on any brand.

       Values mirror the org toggle: fill rgba(white,.10) [toggle uses .10],
       border rgba(white,.15), hover fill .20 / hover border .30. CRITICAL: do
       NOT add a backdrop-filter saturate() here — the chips are ~90% transparent,
       so saturate() boosts the wine seen THROUGH them into a vivid magenta/blue
       cast (measured: fill went (88,31,64) warm-mauve → (114,26,75) vivid-pink,
       which read as "super blue, not white"). A flat veil with no backdrop-filter
       lands exactly on the org toggle's (88,31,64). Was solid white #fff / dark
       #232323 text; briefly had a blur+saturate "liquid glass" material (removed
       — it caused the cast and its blur was inert over the opaque bar anyway). */
    --header-control-bg: rgba(255, 255, 255, 0.10);
    --header-control-fg: #ffffff;
    --header-control-border: rgba(255, 255, 255, 0.15);
    --header-control-hover-bg: rgba(255, 255, 255, 0.20);
    --header-control-hover-fg: #ffffff;
    --header-control-focus-ring: rgba(255, 255, 255, 0.30);

    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    /* The notch pulled back out: body pads by --safe-top, and the phone's top
       bar steps back up over that padding with this (phone-bar.css). */
    --safe-top-bleed: calc(-1 * var(--safe-top));
    /* The app bar's room pulled back out: the phone search gives it back at
       once, while the bar slides away (page-header.css). */
    --header-height-bleed: calc(-1 * var(--header-height));

    /* The platform's own body face, named so a surface that must read as
       SkillBridge rather than as the tenant can point back at it. base.html
       overrides --font-family per-org from Organization.body_font; this holds
       the pre-injection stack, and branding.py never writes it, so it stays
       the platform's whatever the tenant sets. Same job --color-neutral-ink
       does for fill: the fixed value a platform surface reaches for. An alias
       is the only way to keep it — a var() resolves at USE time, so
       --platform-font-family: var(--font-family) would just follow the org
       override rather than capture the value underneath it. */
    --platform-font-family: 'Poppins', 'Avenir', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family: var(--platform-font-family);
    --font-family-heading: 'Poppins', 'Avenir', sans-serif;
    --font-family-subheading: var(--font-family-heading);
    --font-size-base: 16px;
    /* Type scale — the small step set the app sizes text from. Values match the
       ad-hoc rem sizes already in use so adopting a token never changes the render. */
    --font-size-2xs: 0.6875rem; /* 11px — micro chips, meta lines */
    --font-size-xs: 0.75rem;    /* 12px — small labels, counts */
    --font-size-sm: 0.8125rem;  /* 13px — dense body / secondary text */
    --font-size-md: 0.875rem;   /* 14px — standard body */
    --font-size-lg: 0.9375rem;  /* 15px — emphasized body / lead lines */
    --font-size-xl: 1.25rem;    /* 20px — large glyphs / avatars */
    --font-size-content-detail: 0.85rem;
    --font-size-content-account: 0.9rem;
    /* Heading scale — fixed sizes pinned on h1-h6 in main.css so Bootstrap's
       reboot defaults (2.5rem h1, viewport-scaled) stop reaching the render.
       h5/h6 read the body ladder above rather than owning a rung. display-* is
       for hero and public surfaces only, never an app page heading. */
    --font-size-h1: 1.75rem;        /* 28px — page headings */
    --font-size-h2: 1.5rem;         /* 24px */
    --font-size-h3: 1.25rem;        /* 20px */
    --font-size-h4: 1.125rem;       /* 18px */
    --font-size-display: 2rem;      /* 32px — hero / public surfaces */
    --font-size-large-title: 2.125rem; /* 34px — a phone page's big title, as on an iPhone */
    --font-size-display-lg: 2.5rem; /* 40px — hero / public surfaces */
    --font-size-page-title: clamp(0.9rem, 2vw, 1.1rem); /* list page and record titles */
    /* Structural leading. Dense data surfaces (the kanban frame, the agenda
       sheet) pin this at their roots so their row-geometry proofs hold; reading
       surfaces take the roomier --line-height-body below. */
    --line-height: 1.5;
    --font-weight-heading: 600;
    --font-style-heading: normal;
    --text-transform-heading: none;
    --letter-spacing-heading: normal;
    --line-height-heading: 1.2;
    --font-weight-subheading: var(--font-weight-heading);
    --font-style-subheading: var(--font-style-heading);
    --text-transform-subheading: var(--text-transform-heading);
    --letter-spacing-subheading: var(--letter-spacing-heading);
    --line-height-subheading: 1.3;
    --font-weight-body: 400;
    --font-style-body: normal;
    --text-transform-body: none;
    --letter-spacing-body: normal;
    --line-height-body: 1.65;
    --font-weight-accent: 400;
    --font-style-accent: normal;
    --text-transform-accent: none;
    --letter-spacing-accent: normal;
    --line-height-accent: 1.4;

    /* Utility emphasis weight (semibold). NOT a type role — it's the weight the
       app already reaches for ~200 times as a raw `font-weight: 600` for labels,
       active states, and table headers. The font-weight codemod maps those
       literals here. Distinct from --font-weight-heading — the two coincide at
       600 today but must stay free to move independently, and heading weight is
       org-overridable where this is not. */
    --font-weight-medium: 600;
    /* A phone page's big title (phone-bar.css, look D): bold and set a little
       tighter, the way an iPhone sets its large titles. */
    --font-weight-large-title: 700;
    --letter-spacing-large-title: -0.02em;

    /* The one weight every button wears. FIXED at 400 and deliberately NOT part
       of the per-tenant brand-config injection in base.html — real `.btn` reads
       Bootstrap's own 400 default no matter the org, so a button-shaped custom
       control must resolve to that same fixed 400, not to the tenant-overridable
       --font-weight-body. Real buttons read this via --bs-btn-font-weight; the
       bespoke button-like controls read it directly. Never inject this. */
    --font-weight-button: 400;

    --spacing-2xs: 0.125rem; /* 2px  — hairline nudges */
    --spacing-xs: 0.25rem;   /* 4px  */
    --spacing-xsm: 0.375rem; /* 6px  — between xs and sm; chip padding and tight
                                control gaps sit here across the app. */
    --spacing-sm: 0.5rem;    /* 8px  */
    --spacing-smd: 0.75rem;  /* 12px — between sm and md; the app's most common
                                missing step (gaps/padding sit at 12 constantly).
                                Named "smd" (not the brief's "2xs") because this
                                scale runs xs<sm<md<lg<xl and a 12px "2xs" would be
                                3x larger than xs — backwards. Rename in review if
                                preferred; additive, so no refs depend on the name. */
    --spacing-md: 1rem;      /* 16px */
    --spacing-mdlg: 1.25rem;  /* 20px — between md and lg, same bridge pattern as
                                smd; card gutters and section padding sit here
                                (payment dashboard, template builder). */
    --spacing-lg: 1.5rem;    /* 24px */
    --spacing-xl: 2rem;      /* 32px */
    --spacing-2xl: 2.5rem;   /* 40px — above xl; section gaps / hero padding. */

    /* The one gap between the app chrome (header, sidebar) and page content,
       and everything aligned to it: content padding, the docked drawer's top
       edge, the pinned header's sticky offset and canvas band. 16px matches
       HubSpot's tight chrome-to-content gutter (Nick, 09-03). Change it here
       and every coupled surface moves together. */
    --page-gutter: var(--spacing-md);
    /* The gutter pulled back out: a full-bleed surface (a phone swipe strip)
       cancels the page padding with this, then pads itself with the gutter so
       its first item still lines up with the text above it. */
    --page-gutter-bleed: calc(-1 * var(--page-gutter));

    /* Border radius.
       Ladder matched to HubSpot's (Nick 09-02): 4px / 6px small components,
       16px cards and floating containers, pill for buttons and search fields.
       --radius-card is the one corner radius for content cards, panels, and
       tiles; migrate raw card radii to it. --radius-pill is the fully-rounded
       value (999px renders identically to any large value at control heights).
       Buttons read --radius-button, never a rung directly, so the whole
       product's button shape flips in one line. */
    --radius-sm: 0.25rem;    /* 4px — controls (inputs, selects) */
    --radius-button: var(--radius-pill);  /* pill buttons (Nick 09-02, matching HubSpot's own button token) */
    --radius-card: 1rem;     /* 16px — content cards (HubSpot card radius)  */
    --radius-md: 6px;        /* small components — menu items, tags, chips  */
    --radius-lg: 1rem;       /* 16px — floating panels and dropdowns        */
    --radius-xl: 1rem;       /* 16px — hero/modal shells                    */
    --radius-pill: 999px;    /* fully rounded — switches, badges, pills     */
    --radius-none: 0;        /* squared — overrides a rounded base so adjacent cells join into one stripe */
    --radius-card-lg: 14px;  /* exact-match for the approved OAuth consent card */

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 4px 6px rgba(15, 23, 42, 0.10);
    --shadow-lg: 0 10px 15px rgba(15, 23, 42, 0.10);
    --shadow-modal: 0 12px 32px rgba(15, 23, 42, 0.18); /* overlay elevation — modals, dialogs, drawers */
    /* Guided-tour spotlight: the scrim is the spread of the spotlit element's
       own shadow, so the hole in it is the element's shape — the 100vmax spread
       covers any viewport from any anchor position. The hairline second layer
       is the card colour, which lifts the anchor off the scrim. */
    --shadow-tour-spotlight: 0 0 0 100vmax rgba(15, 23, 42, 0.45), 0 0 0 2px var(--color-card-bg);
    /* A solid copy of a sheet that hangs under the notch, lifted by the notch's
       height, so the sheet's colour runs up behind the clock (the phone search
       sheet in main.css). 0px tall on a screen with no notch. */
    --shadow-notch-fill: 0 calc(-1 * var(--safe-top)) 0 0 var(--header-bg);
    /* The same fill in the card colour, for the search sheet under the
       phone's clear glass top bar (phone-bar.css). The lifted copy keeps the
       sheet's round bottom corners, which would show the page through two
       small gaps at the notch's lower edge; a second copy lifted by just the
       corner fills them. */
    --shadow-notch-fill-card:
        0 calc(-1 * var(--safe-top)) 0 0 var(--color-card-bg),
        0 calc(-1 * var(--radius-lg)) 0 0 var(--color-card-bg);
    /* The phone's glass bars (phone-bar.css; Nick's look D, 10-31): the top
       bar once the page scrolls, and the floating tab capsule. A see-through
       card colour, a blur that keeps the page's colour under it, a hairline
       rim, and a faint light edge along the capsule's top. The fill turns
       solid where a phone cannot blur or asks for less see-through (below). */
    --glass-bar-fill: color-mix(in srgb, var(--color-card-bg) 80%, transparent);
    --glass-bar-blur: saturate(180%) blur(20px);
    --glass-bar-rim: color-mix(in srgb, var(--color-text) 8%, transparent);
    --glass-bar-pill: color-mix(in srgb, var(--color-text) 8%, transparent);
    /* How far the tab capsule floats above the screen's bottom edge: just over
       the home bar, and never flush with an edge that has none. */
    --glass-capsule-lift: max(var(--spacing-sm), calc(var(--safe-bottom) - var(--spacing-xs)));
    --shadow-glass-capsule:
        inset 0 1px 0 color-mix(in srgb, var(--color-card-bg) 90%, transparent),
        0 8px 24px rgba(15, 23, 42, 0.12),
        0 1px 3px rgba(15, 23, 42, 0.08);
    /* The popup a select hangs off its control. Two casts of one geometry: the
       menu normally drops below the control, but flips above it near a fold
       (.global-cs-menu--up), and the light has to keep coming from the same place or
       the flipped menu reads as sitting under the page. Value is the one
       .global-cs-menu already shipped, lifted here verbatim — pure black rather than
       the ladder's slate, deliberately unchanged so nothing re-renders. */
    --shadow-menu: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-menu-up: 0 -10px 25px rgba(0, 0, 0, 0.1);
    /* The call box's Answer and end-call discs glow in their own colour. */
    --shadow-call-answer: 0 8px 20px color-mix(in srgb, var(--color-success) 30%, transparent);
    --shadow-call-end: 0 8px 20px color-mix(in srgb, var(--color-error) 28%, transparent);
    /* Hero-avatar halo — a soft spread ring, not a drop shadow, so it sits
       beside the elevation ladder rather than in it. Avatars are neutral
       (people are not the org's marketing surface), so the ring is a fixed
       ink wash on every tenant. Pair it with --shadow-sm at the call site;
       that pairing is exactly what the retired .worker-hero-avatar drew. */
    --shadow-avatar-ring: 0 0 0 5px color-mix(in srgb, var(--color-action) 14%, transparent);

    /* Focus ring — the 3px spread halo a control draws on :focus-visible, over
       the translucent --color-focus-ring-alpha. Lives here beside the avatar
       ring so the ring geometry stays out of component files (ADR-125); a
       component references the token instead of re-typing the raw 0 0 0 3px. */
    --shadow-focus-ring: 0 0 0 3px var(--color-focus-ring-alpha);

    /* The same ring drawn tight and solid, for a small control that sits inside
       a row and would have its 3px halo clipped by the row's own edge — the
       quick channel buttons on an alert, the permission row's segmented
       control. Two rungs, not a free choice: 3px translucent for a field, 2px
       solid for a control in a row. */
    --shadow-focus-ring-tight: 0 0 0 2px var(--color-focus-ring);

    /* Row hover/selected ring — a hairline inset ring in the same ink wash as
       the avatar halo, so a list row lifts as one card on hover (14%) and holds
       a stronger ring while its drawer is open (22%). Inset, so it rings the
       row without nudging layout the way a real border would. */
    --shadow-inset-ring: inset 0 0 0 1px color-mix(in srgb, var(--color-action) 14%, transparent);
    --shadow-inset-ring-strong: inset 0 0 0 1px color-mix(in srgb, var(--color-action) 22%, transparent);

    /* The same hairline in neutral ink — the well an editable grid cell draws.
       Controls here are greyscale, never the org's fill (Nick, 2026-09-01). */
    --shadow-inset-ring-neutral: inset 0 0 0 1px var(--color-border);

    /* A left accent bar in the action colour, drawn inset so it follows the
       corners and sits inside any border, dashed or solid. Marks the one card
       a docked drawer is editing (the booking page's Roster tab). */
    --shadow-accent-bar: inset var(--spacing-xs) 0 0 var(--color-action);

    /* Exact-match shadows for the owner-approved OAuth consent page
       (apps/mcp_oauth). Frozen to that design's approved pixels — do not retune. */
    --shadow-card-soft: 0 1px 3px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.05);
    --shadow-focus-ring-soft: 0 0 0 0.2rem rgba(99, 102, 241, 0.15);

    /* The stream viewer's locked key (a modifier tapped twice to stay down):
       a 2px ring in the viewer's own light ink (#f2f2f2) at 45%, drawn around
       the filled key so locked reads apart from on-for-one-press. The viewer
       paints on black with its own dark palette, so none of the app rings fit. */
    --shadow-stream-key-locked: 0 0 0 2px rgba(242, 242, 242, 0.45);

    /* The stream viewer's touch ring: a 2px edge in the viewer's dark ink at
       60% around the ring's light line, so the ring reads on light and dark
       photos alike. */
    --shadow-stream-touch-ring: 0 0 0 2px rgba(20, 20, 30, 0.6);

    /* ── Milestone / stage status ─────────────────────────────────────────
       ONE status grammar for pipelines and milestones, used at every zoom
       level: the check in the opportunity-detail list, the dot on a card, the
       dot on a kanban column, the badge in the builder. Before this, "done"
       green had five different hex values across those surfaces and "active"
       had four; every surface now derives its status color from here, so a
       theme change flows everywhere and nothing drifts. Color always means
       the same thing; components pair it with a shape (fill / ring / dot /
       dash) so status survives at small sizes and for colorblind viewers.
       Active is the fixed action ink, not the tenant's brand: stage progress
       is working state, and it reads identically on every org. */
    --ms-pending: var(--color-border);        /* not started — grey ring       */
    --ms-active: var(--color-action);         /* current stage / in progress    */
    --ms-active-soft: var(--ink-alpha-05);
    --ms-active-ring: var(--ink-alpha-15);
    --ms-done: var(--color-success);          /* completed                      */
    --ms-done-soft: color-mix(in srgb, var(--color-success) 12%, var(--color-card-bg));
    --ms-skipped: var(--color-grey-500);      /* optional, passed over          */
    --ms-skipped-soft: var(--color-grey-200);
    --ms-blocked: var(--color-warning);       /* waiting on a dependency        */
    --ms-blocked-soft: color-mix(in srgb, var(--color-warning) 14%, var(--color-card-bg));

    /* Black-ink alpha overlays. The rgba(0,0,0,.05/.1/.15/.2) ladder is hand-typed
       dozens of times for hairlines, scrims, and pressed states (self-flagged as a
       gap in assignments-groups/global-split-button). These are the neutral counterpart to the
       --brand-primary-alpha-* set above. ADDITIVE: the shadow/overlay codemod maps
       the literals here. NOT the same material as --color-action-tint below:
       these are translucent black, so they darken whatever they sit on and are
       right for shadows, scrims, and hairlines over unknown ground. A hover or
       selected FILL takes the opaque tint trio instead — folding the two
       vocabularies together would change paint. */
    --ink-alpha-05: rgba(0, 0, 0, 0.05);
    --ink-alpha-10: rgba(0, 0, 0, 0.10);
    --ink-alpha-15: rgba(0, 0, 0, 0.15);
    --ink-alpha-20: rgba(0, 0, 0, 0.20);

    /* Neutral ink surface — a fixed dark bar that carries the SAME weight for
       every tenant, so it holds ZERO brand or status color. Used by the
       platform-standard toast; reusable for any dark neutral overlay that must
       read identically across brands. Primary text is white, secondary text is
       the muted grey below, and a faint white hairline separates actions. */
    --color-neutral-ink: #24292f;             /* dark neutral surface           */
    --color-neutral-ink-fg: #ffffff;          /* primary text on the ink surface */
    --color-neutral-ink-muted-fg: #9aa4af;    /* secondary text on the ink surface */
    --neutral-ink-border: rgba(255, 255, 255, 0.15);
    /* Interaction states for the neutral-ink primary CTA (.global-btn-ink) on the public
       auth / invite / error surfaces. Derived from the ink surface so the set
       moves together and introduces no new hex: a darker press ink and a
       translucent ink focus ring. color-mix means these only apply on engines
       that support it — main.css references them behind an @supports gate and
       falls back to the flat ink token, so pre-2023 engines degrade legibly. */
    --color-neutral-ink-hover: color-mix(in srgb, var(--color-neutral-ink) 88%, black);
    --neutral-ink-focus-ring: color-mix(in srgb, var(--color-neutral-ink) 40%, transparent);
    /* Dark surfaces of our own call room, all made from the ink so they add
       no new hex: the deeper well a shared screen sits in, an empty picture,
       and the see-through ink and white laid over a picture. */
    --color-neutral-ink-deeper: color-mix(in srgb, var(--color-neutral-ink) 60%, black);
    --neutral-ink-empty-picture: radial-gradient(90% 80% at 50% 30%, color-mix(in srgb, var(--tag-slate) 45%, var(--color-neutral-ink)), var(--color-neutral-ink));
    --neutral-ink-veil: color-mix(in srgb, var(--color-neutral-ink) 55%, transparent);
    --neutral-ink-veil-strong: color-mix(in srgb, var(--color-neutral-ink) 70%, transparent);
    --neutral-ink-fg-faint: color-mix(in srgb, var(--color-neutral-ink-fg) 12%, transparent);
    --neutral-ink-fg-ghost: color-mix(in srgb, var(--color-neutral-ink-fg) 22%, transparent);
    /* Our own call room's sizes (meet-room.css): the person glyph that fills a
       picture while its camera is off, the round call buttons (a little bigger
       on a phone), the waiting room's width, the people strip beside a share,
       the call screen's top and bottom bars, the brand's letter spacing, the inset of a device list's
       arrow, the host's face on a phone, and the edges round the share
       controls and a picture floating over the call. */
    --room-person: min(15vw, 14rem);
    --room-person-phone: 10rem;
    --room-person-small: 5rem;
    --room-person-tiny: 3.5rem;
    --room-btn: 48px;
    --room-btn-phone: 52px;
    --room-wait-width: 1040px;
    --room-share-strip: 200px;
    /* The New suggestion form's one column, a little wider than the Support
       panel's 372px (.support-panel in features/support) it is drawn like. */
    --suggestion-form-width: 560px;
    /* One suggestion's side column and its comment box (features/suggestions).
       Its steps fold to two across when the column is under 360px: that
       breakpoint is written in suggestions.css, since a container query
       cannot read a variable. */
    --suggestion-side-width: 320px;
    --suggestion-comment-height: 96px;
    --room-bars: 170px;
    --room-brand-spacing: 0.02em;
    --room-select-arrow: 0.6rem;
    --room-host-phone: 56px;
    --room-edge: 1px;
    --room-edge-float: 2px;
    /* The status ring on a face in the Scheduling grid (tasks.css). */
    --task-grid-ring-width: 3px;
    /* The empty-seat box (components/seat.css): its width in a list row with
       the Person column hidden and on the Lineup strip, and the height of one
       person row in the role drawer's pick list. */
    --seat-door-row-width: 6rem;
    --seat-door-lineup-width: 9rem;
    --seat-pick-row-height: 3.25rem;
    /* The Scheduling page's booking picker: the widest its field grows. */
    --scheduling-picker-width: 480px;
    /* The Watch Tutorials panel in the top bar (components/demo-video.css): its
       width, the width of one film's picture, and the play mark on the picture. */
    --watch-tutorials-width: 400px;
    --watch-tutorials-thumb-width: 136px;
    --watch-tutorials-play: 2rem;
    --content-network-label-width: 220px;
    --content-network-label-height: 32px;
    --content-accounts-width: 36rem;
    --settings-permission-setup-width: 45rem;
    /* An upload card on the role page (role-page.css): its narrowest width, so a
       long file count shows in full. */
    --role-upload-card-min-width: 15rem;
    /* The Covers panel on a session card (schedule.css): its width on a wide
       screen. It holds a session name, its time and the two-way switch. */
    --agenda-covers-width: 27rem;
    --call-sheet-menu-width: 18rem;
    --call-sheet-menu-screen-gap: 4.5rem;
    --call-sheet-focus-width: 2px;
    /* The minutes box of a line in the template builder, on a phone
       (agenda.css). It holds three digits, so "min" stays beside it. */
    --agenda-minutes-box: 5rem;
    /* The track that holds the faces of one agenda line (agenda.css). The
       server counts the faces that fit this width too (_FACE_TRACK in
       interface/views/agenda.py), so the two change together. */
    --agenda-face-track: 150px;
    /* The room for the role chips of one line in a wide agenda list, with the
       margin of each chip (agenda.css). The room for one chip holds a name like
       "Assistant Photographer" on one line. A longer name wraps inside its chip.
       A list from 1232 px with a line of two chips keeps the room for two. */
    --agenda-gap-room-one: calc(11.5rem + var(--spacing-xs));
    --agenda-gap-room-two: calc(2 * var(--agenda-gap-room-one));

    /* Action ink — the interaction ramp for quiet controls (checkboxes, radios,
       switches, ghost/outline buttons, icon buttons). Fixed neutral for every
       tenant: brand color belongs to chrome and the filled CTA, purple to focus
       and info, so this ramp is the ONLY color a quiet control may take. It
       LIGHTENS on hover/press — a dark ink control reads "released", not
       "pressed harder" — unlike the -hover above, which darkens a CTA fill.
       The tint trio is the warm-grey wash behind hovered icon buttons and
       selected rows, warm to match the grey ramp's undertone. */
    --color-action: var(--color-neutral-ink);
    /* The same two colors as bare `r, g, b` triples, for the Bootstrap
       utilities that build their own opacity out of one (`rgba(var(--bs-
       primary-rgb), …)`) — a hex cannot be poured into that. Pinned to their
       hexes by test_css_standards: a triple that drifts from its hex is a
       color nobody chose. */
    --color-action-rgb: 36, 41, 47;
    --color-action-hover-rgb: 61, 68, 76;
    --color-action-hover: #3d444c;
    --color-action-pressed: #565e66;
    --color-action-disabled-bg: #f5f5f5;
    --color-action-disabled-fg: #8a8a8a;
    /* The tint trio is OPAQUE warm grey, not translucent black: it paints a
       flat wash that matches the grey ramp's undertone on any surface. The
       --ink-alpha-* ladder above is the translucent counterpart for shadows and
       scrims; the two never substitute for each other. */
    --color-action-tint: #f1efec;
    --color-action-tint-pressed: #e7e4df;
    --color-action-selected: #d9d5cd;

    /* The stream viewer's two inks (stream.css). The viewer paints on black
       with its own palette, so the app's neutral inks, made for a white page
       or the dark toast bar, do not fit. The light ink is the text on the
       canvas, its bars and its prompts; the inverse is the dark text on a key
       filled with the light ink, the one place the viewer puts text on light. */
    --color-stream-ink: #f2f2f2;
    --color-stream-ink-inverse: #14141e;

    /* Lightroom's four colour labels, as the iPad keys mockup draws them: the
       dots on the stream's label keys (stream.css), and nowhere else. */
    --color-stream-label-red: #f0564f;
    --color-stream-label-yellow: #f2c230;
    --color-stream-label-green: #3fbf6b;
    --color-stream-label-blue: #4a8ff7;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;

    /* Progress bar (.global-progress, components/progress.css): the one
       track-and-fill vocabulary for a bar that says how far. The fill is
       the fixed action ink (brand stays on chrome and the filled CTA — the
       button under a bar); done reads --color-success at the bar. Scripts
       that wait for a fill to land read --progress-fill-ms rather than
       typing the number twice. */
    --progress-h: 0.5rem;
    --progress-track: var(--color-grey-200);
    --progress-fill: var(--color-action);
    --progress-fill-ms: 900ms;

    --form-group-gap: 1rem;
    --color-text-muted: #9ca3af;
    --color-text-secondary: #64748b;
    /* A third party's own mark, kept as they draw it: the Google blue on
       the account row's icon. Not ours to theme. */
    --color-brand-google: #4285f4;
    /* Google Calendar's own "Basil", the colour the bookings calendar takes
       there (ADR-259); the row's dot matches what the creative sees in Google. */
    --color-brand-google-basil: #0b8043;
    --color-surface-subtle: #f8f9fa;
    --color-surface-hover: #e9ecef;
    /* The dark counterpart to the two surfaces above — the fill for inverted
       chrome (dark bars, inverted panels, ink-on-dark overlays). NOT a new
       color: it points at --color-neutral-ink (#24292f), the fixed brand-free
       dark surface the platform toast already stands on, so inverted chrome and
       the toast can never drift apart. Named into the --color-surface-* family
       because that is where a developer looks for "what fill do I use". */
    --color-surface-inverse: var(--color-neutral-ink);
    --color-border-subtle: var(--color-surface-hover); /* same grey as surface-hover, for resting borders */

    /* Control-height scale — the ONE height vocabulary for controls (ADR-125).
       Controls today scatter across 28/32/34/36/40/44/48/52px with fragmented
       half-tokens (--filter-ctrl-h in filter-bar.css = 36px). --control-h-base
       (36px) is the standard row and lines up with global-filter-bar's existing
       --filter-ctrl-h so the codemod can unify them. --control-h-touch (44px)
       is the WCAG 2.5.5 tap target: the minimum height touch-first inputs
       (phone, file upload) rest on, and the floor every rung rises to on
       coarse pointers, enforced below the :root. */
    --control-h-sm: 32px;    /* compact controls (dense toolbars)        */
    --control-h-base: 36px;  /* standard control row (== --filter-ctrl-h) */
    --control-h-touch: 44px; /* touch target / minimum input height       */
    /* The height of the thin upright line between two groups of controls
       (.global-toolbar__sep), a little shorter than the 36px controls beside it. */
    --hairline-h: 1.375rem;
    /* The width of the page search box and of the views menu that drops
       under its pill, so the menu lines up with the box above it. */
    --page-search-w: 20rem;
    --view-picker-max-height: 32rem;

    /* Z-index ladder. The app used ~24 ad-hoc z-index values (up to 1100, plus
       9999/10000 outliers) with no shared scale, so overlays fought unpredictably.
       This ladder is Bootstrap-5-compatible (its dropdown=1000, modal=1055,
       tooltip=1080 sit inside these bands) and is what the overlay codemod maps the
       literals onto. The 1070 / 1080 / 10000 one-offs are now wired to rungs; each
       kept its EXACT previous value, so no stacking order moved. */
    /* The bottom of the ladder, and the only rung that is not an overlay: an
       element lifted above a SIBLING inside its own stacking context, not above
       the page. The overflow-scroll treatment needs it — the chevron slivers are
       absolutely positioned over the list they scroll, and the list's own edge
       mask would otherwise paint across them. Deliberately not folded into the
       10xx band: a local raise must stay under every real overlay, so a chevron
       never outranks a dropdown that opens over it. */
    /* Under its parent's own content, inside the parent's stacking context:
       the phone top bar's glass layer sits behind the bar's buttons. */
    --z-behind: -1;
    --z-raised: 2;            /* raised above a sibling, below every overlay */
    --z-under-sticky: 1019;   /* sticky, one under a pinned header card     */
    --z-sticky: 1020;        /* sticky table headers / toolbars            */
    --z-dropdown: 1030;       /* custom select & menu popups                */
    --z-scrim: 1045;          /* drawer / offcanvas backdrop                */
    --z-modal-backdrop: 1050; /* centered-modal backdrop                    */
    --z-modal: 1060;          /* modal & drawer panels (above their scrim)  */
    --z-popover: 1070;        /* autocomplete / popovers above modals       */
    /* The rung the 1080 literals land on. There was no rung between popover
       (1070) and toast (1090), and four components independently picked 1080
       for a panel that must clear the popover layer: the impersonate modal and
       assignments-day-preview panels (each stacked over their OWN 1070 backdrop), the
       referral-breakdown modal, and the pipelines move-confirm popover. Named
       by HEIGHT, not by component, so it stays true for all four — and it is
       still Bootstrap-5-compatible (BS tooltip is also 1080). Added rather than
       squeezing those panels down onto 1070, which would have flattened them
       into their own backdrops. */
    --z-overlay-top: 1080;    /* panel raised above the popover layer       */
    --z-toast: 1090;          /* toasts — always on top                     */
    /* Body-portaled third-party overlays. Google's Maps JS appends the Places
       .pac-container to <body>, outside every app stacking context, so it has
       to clear the whole ladder including toasts; both copies of that rule
       (components/places-autocomplete.css, features/booking/address-step.css)
       already hand-typed 10000. Kept at its existing 10000 rather than folded
       into the 10xx band so its stacking is unchanged. The .global-skip-link's 9999 in
       main.css is deliberately left alone — it is the a11y escape hatch and
       sits just under this by design; retokenizing it would tie the two. */
    --z-portal: 10000;        /* third-party overlays appended to <body>    */
    /* The stream viewer's prompts (still there? / leave this session?). The
       viewer stacks its own layers from 5 to 40 in stream.css: input ghost,
       loading overlay, controls and exit bar, notice, reconnect pill. A prompt
       sits on top of all of them, and still under the app's 10xx overlays, so
       it keeps the 50 it always had instead of borrowing --z-modal. */
    --z-stream-prompt: 50;    /* the viewer's prompts, above its own layers */
    /* The ring under a resting finger or Pencil: above the viewer's input
       layer (5) and loading cover (10), under its bars and keys (20). */
    --z-stream-touch-ring: 15;
}

/* Compact shell: the same 1023px line main.css draws for the off-canvas
   sidebar. The header grows to the touch height HERE, on :root, so every
   value derived from it (--header-bottom, --drawer-top) follows. */
@media (max-width: 1023px) {
    :root {
        --header-height: var(--header-height-touch);
    }
}

/* Two pages have no app header, so nothing is paid at the top: a page inside
   the frame (texts.css hides its sidebar and header), and the calls window. */
:root:has(body.is-framed),
:root.is-framed {
    --sidebar-width: 0px;
    --header-height: 0px;
}

:root:has(body.conversations-calls-window) {
    --header-height: 0px;
}

/* Phone: the app bar leaves the top of the screen and becomes the bottom bar
   (main.css phone block re-pins .global-app-header). --header-height reads 0
   HERE so --header-bottom and --drawer-top, "the top of the screen once the
   header is paid", stay honest: nothing sits under a header that is not there.
   --bottom-bar-h is the bar's seat: the touch bar plus the home indicator.
   Text never drops under 12px on a phone, so the 11px step reads as 12px here. */
@media (max-width: 767.98px) {
    :root {
        --header-height: 0px;
        --bottom-bar-h: calc(var(--header-height-touch) + var(--safe-bottom));
        --font-size-2xs: var(--font-size-xs);
    }

    /* With the bottom bar of doors (phone-bar.css, look D) the app bar is back
       at the top, one touch row tall. */
    :root:has(.global-phone-bar) {
        --header-height: var(--control-h-touch);
    }

    /* An open text thread hides the app bar (texts.css). Set on :root, where
       --header-bottom and --drawer-top are worked out, so a drawer over the
       thread does not sit one header low. */
    :root:has(.conversations-app.is-thread-open) {
        --header-height: 0px;
    }
}

/* The glass bars turn solid where the phone cannot blur what is behind them
   (the words would sit on a see-through film over the page) or where its owner
   turned on Reduce Transparency. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    :root {
        --glass-bar-fill: var(--color-card-bg);
    }
}

@media (prefers-reduced-transparency: reduce) {
    :root {
        --glass-bar-fill: var(--color-card-bg);
    }
}

/* Touch floor: on coarse pointers every control grows to a 44px tap target
   (WCAG 2.5.5). ADDITIVE — a control only grows if its own rule is sized off
   --control-h-*. The Scheduling meeting controls are wired up; the rest of the
   app still waits on the control-height codemod. */
@media (pointer: coarse) {
    :root {
        --control-h-sm: 44px;
        --control-h-base: 44px;
    }
}

/* High-contrast support. Lives here, not main.css, so public pages
   (base_public / base_embed / standalone errors) get it too — they load
   tokens.css but not the app's main.css. */
@media (prefers-contrast: more) {
    :root {
        --color-border: var(--color-border-dark);
        --shadow-sm: none;
        --shadow-md: none;
        --shadow-lg: none;
    }

    .btn {
        border-width: 2px;
    }

    a:focus,
    button:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline-width: 3px;
    }
}

/* One look for every dropdown (ADR-125 Amendment 5). Older menus keep their own
   names, listed beside .global-menu; their sheets only place and size the menu.
   New menus use .is-current. Menus sit at --z-dropdown, above sticky headers.
   The People flyout clears the phone sidebar on the popover rung. */

.global-menu,
.global-tab-add__menu,
.global-toolbar__menu,
.global-action-dropdown-menu,
.global-cs-menu,
.global-grid-picker,
.global-grid-menu,
.global-filter-builder-picker,
.global-sidebar-people-flyout,
.calendar-filter-dropdown {
    z-index: var(--z-dropdown);
    padding: var(--spacing-xsm);
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.global-sidebar-people-flyout {
    z-index: var(--z-popover);
}

/* The search row at the top: the page search box (menu_search.html), and room for
   one small button beside it. */
.global-menu__search {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

/* The box takes the row's width, less the "+". The second selector is for a menu
   inside the header card, as the views menu is: page-header.css gives the header's
   own search box one fixed width and loads after this sheet, so it would win a tie
   and cap the menu's box too. */
.global-menu__search .global-page-search,
.global-page-header .global-menu__search .global-page-search {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
}

.global-menu__option,
.global-tab-add__option,
.global-toolbar__option,
.global-action-dropdown-item,
.global-cs-item,
.global-grid-picker__option,
.global-filter-builder-picker__option {
    border-radius: var(--radius-sm);
    color: var(--color-text);
}

.global-menu__option {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
    padding: var(--spacing-xsm) var(--spacing-sm);
    border: 0;
    background: none;
    font: inherit;
    font-size: var(--font-size-sm);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.global-menu__option:hover,
.global-tab-add__option:hover,
.global-toolbar__option:hover,
.global-action-dropdown-item:hover,
.global-cs-item:hover,
.global-grid-picker__option:hover,
.global-filter-builder-picker__option:hover {
    background: var(--color-surface-hover);
}

/* The row that is already chosen: the open page, the sort in use, the value held. */
.global-menu__option.is-current,
.global-tab-add__option.is-current,
.global-toolbar__option.is-active,
.global-action-dropdown-item.is-active,
.global-cs-item.is-active,
.global-filter-builder-picker__option.is-picked {
    background: var(--color-action-tint);
    font-weight: var(--font-weight-medium);
}

.global-menu__option--danger,
.global-action-dropdown-item--danger {
    color: var(--color-error-text);
}

/* A row shown but not open to a click reads muted and takes no hover. */
.global-menu__option:disabled,
.global-action-dropdown-item:disabled,
.global-grid-picker__option:disabled {
    color: var(--color-text-muted);
    cursor: default;
}

.global-menu__option:disabled:hover,
.global-action-dropdown-item:disabled:hover,
.global-grid-picker__option:disabled:hover {
    background: none;
}

/* A quiet second line under a row's label. */
.global-menu__desc,
.global-tab-add__hint {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.global-menu__divider {
    height: 0;
    margin: var(--spacing-xs) 0;
    border: 0;
    border-top: 1px solid var(--color-border-subtle);
}

/* A row reached by the keyboard wears the same ring as the icon button. */
.global-menu__option:focus-visible,
.global-tab-add__option:focus-visible,
.global-toolbar__option:focus-visible,
.global-action-dropdown-item:focus-visible,
.global-cs-item:focus-visible,
.global-grid-picker__option:focus-visible,
.global-filter-builder-picker__option:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

/* On a touch screen every row is a full tap target. */
@media (pointer: coarse) {
    .global-menu__option,
    .global-tab-add__option,
    .global-toolbar__option,
    .global-action-dropdown-item,
    .global-cs-item,
    .global-grid-picker__option,
    .global-filter-builder-picker__option {
        min-height: var(--control-h-touch);
    }
}


.global-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    /* No border-right: the header shares this surface, and a full-height
       hairline would draw a visible vertical seam through the unified top
       strip. The ::after below restores the subtle edge against the page
       content, starting only below the header. */
    z-index: var(--z-modal);
    transition: transform var(--transition-normal), width var(--transition-normal);
    padding-top: var(--safe-top);
    /* Logout is the last row and the sidebar is pinned to the bottom edge, so
       without this the phone's home indicator is drawn over it. */
    padding-bottom: var(--safe-bottom);
    /* Sidebar inherits the per-tenant body font (var(--font-family) on body,
       set from organization.body_font with Poppins fallback). The brand-name
       below opts up to var(--font-family-heading) so the org name reads in
       the tenant's display/header font. Fonts vary per tenant by design —
       that's the white-label point. */
    /* Visual size parity across tenant fonts. Different fonts have different
       x-heights at the same nominal font-size (Fortis's body font is shorter
       than Poppins, so it reads small). font-size-adjust normalizes the
       x-height to a fixed ratio of font-size, so every tenant's nav reads at
       the same visual size regardless of which font is active. 0.52 is
       calibrated to Poppins (the platform default) — tenants on Poppins are
       unchanged, smaller-x-height fonts get scaled up to match. */
    font-size-adjust: 0.52;
}

/* Hairline edge between sidebar and page content — replaces the old
   border-right, which ran the full height and showed as a thin vertical
   line splitting the sidebar from the header band. Starts at the header's
   bottom edge so the top strip stays seamless. */
.global-sidebar::after {
    content: "";
    position: absolute;
    top: var(--header-bottom);
    right: 0;
    bottom: 0;
    width: 1px;
    background: var(--sidebar-border);
    pointer-events: none;
}

/* Bootstrap Icons render at a font-family that has no meaningful x-height
   (glyphs fill the em-box), so font-size-adjust on .global-sidebar would shrink
   them and throw off centering inside fixed-size buttons. Opt icon glyphs
   out of x-height normalization — they keep their nominal font-size. */
.global-sidebar .bi {
    font-size-adjust: none;
}

/* Sidebar brand/logo area — height matches the header so its bottom edge
   lines up with the header's. No separate background: the header now shares
   the sidebar surface, so a darker brand band would break the single
   continuous chrome strip across the top. */
.global-sidebar-brand {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0 var(--spacing-sm) 0 0;
    min-height: var(--header-height);
}

.global-sidebar-brand-link {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius-md);
    padding-left: var(--spacing-xs);
    margin-left: calc(-1 * var(--spacing-xs));
    transition: background var(--transition-fast);
}

.global-sidebar-brand-link:hover {
    background: rgba(var(--sidebar-fg-rgb),0.08);
    text-decoration: none;
    color: inherit;
}

.global-sidebar-brand-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 50%;
    flex-shrink: 0;
}

.global-sidebar-brand-logo-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(var(--sidebar-fg-rgb),0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-md);
    flex-shrink: 0;
    color: var(--sidebar-text);
}

/* Icon rail: fixed 56px column for logos, nav icons, and avatars.
   Matches collapsed sidebar width so icons never move during transition. */
.global-sidebar-icon-rail {
    width: 56px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.global-sidebar-brand-name {
    flex: 1;
    min-width: 0;
    /* Per-tenant header font for the org name itself.
       --font-family-heading is set per-org in base.html from
       organization.header_font (Poppins fallback). */
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-base);
    color: var(--sidebar-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-sidebar-org-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--control-h-sm);
    height: var(--control-h-sm);
    border-radius: var(--radius-md);
    background: rgba(var(--sidebar-fg-rgb),0.1);
    border: 1px solid rgba(var(--sidebar-fg-rgb),0.15);
    cursor: pointer;
    color: var(--sidebar-text);
    flex-shrink: 0;
    transition: background var(--transition-fast), border-color var(--transition-fast);
    padding: 0;
}

.global-sidebar-org-toggle:hover {
    background: rgba(var(--sidebar-fg-rgb),0.2);
    border-color: rgba(var(--sidebar-fg-rgb),0.3);
}

.global-sidebar-org-toggle-svg {
    width: 10px;
    height: 16px;
    opacity: 0.85;
}

.global-sidebar-org-dropdown {
    position: absolute;
    top: 100%;
    left: 100%;
    width: 240px;
    background: var(--color-card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-popover);
    overflow: hidden;
    margin-left: var(--spacing-sm);
    margin-top: var(--spacing-xs);
}

/* Inline org reveal (expanded sidebar): rendered BEFORE the brand row in DOM
   order, animates max-height from 0 → cap so the brand row gets pushed down
   by normal flex flow — visually, "the brand slides down, others reveal
   above." Scroll-capped at 5 rows so 6+ orgs don't shove nav off-screen.
   On collapsed (icon rail) sidebars, the flyout below takes over instead.

   --sidebar-org-row-height is the single source of truth for that cap: the row
   below is pinned to it, so 5 rows fit the cap exactly. The cap used to be a
   hand-written 44px while the row rendered at 45.78px (24px line box + 2 x
   0.65rem padding + 1px rule), which left the 5th org sliced ~8px short
   against the brand row under it. */
.global-sidebar-org-others {
    --sidebar-org-row-height: 46px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease-out;
    scrollbar-width: none;
}

.global-sidebar-org-others.is-open {
    max-height: calc(5 * var(--sidebar-org-row-height));
    overflow: hidden auto;
    overscroll-behavior: contain;
}

.global-sidebar-org-others::-webkit-scrollbar {
    display: none;
}

.is-sidebar-collapsed .global-sidebar-org-others {
    display: none;
}

.global-sidebar-org-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    /* Pinned so every row is the same height whether or not it carries the
       bottom rule, and so the 5-row cap above stays exact. The height has to
       cover this padding + the 24px line box (--line-height x 1rem) + the rule
       — 45.8px today, 46 rounded up. Grow the padding or the type scale and
       you must grow this too, or the name below (overflow: hidden) clips. */
    height: var(--sidebar-org-row-height);
    box-sizing: border-box;
    padding: var(--spacing-smd) var(--spacing-smd);
    color: var(--sidebar-text);
    text-decoration: none;
    transition: filter 0.15s ease;
    border-bottom: 1px solid var(--sidebar-border);
}

.global-sidebar-org-row:last-child {
    border-bottom: none;
}

.global-sidebar-org-row:hover {
    filter: brightness(1.25);
    color: var(--sidebar-text);
    text-decoration: none;
}

.global-sidebar-org-row-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-sidebar-org-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    padding: var(--spacing-smd) var(--spacing-smd);
    color: var(--sidebar-text);
    text-decoration: none;
    transition: filter 0.15s ease;
    border-bottom: 1px solid var(--sidebar-border);
}

.global-sidebar-org-dropdown-item:last-child {
    border-bottom: none;
}

.global-sidebar-org-dropdown-item:hover {
    filter: brightness(1.25);
    color: var(--sidebar-text);
    text-decoration: none;
}

.global-sidebar-org-dropdown-item.is-current {
    font-weight: var(--font-weight-medium);
}

/* Dot indicator for current org. Uses currentColor so it inherits the
   per-row contrast color set by the inline `color:` style — works for any
   row brand luminance, including light brands where #ffffff would vanish. */
.global-sidebar-org-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.global-sidebar-org-dropdown-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-sidebar-nav-container {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.global-sidebar-nav {
    flex: 1;
    overflow: hidden auto; /* hidden-x prevents scrollbar during collapse, auto-y for long lists */
    overscroll-behavior: contain;
    scrollbar-width: none; /* Firefox: hide scrollbar (scroll arrows replace it) */
    padding: var(--spacing-xs) 0;
}

.global-sidebar-nav::-webkit-scrollbar {
    display: none; /* Chrome/Safari: hide scrollbar */
}

.global-sidebar-nav-arrow {
    position: absolute;
    left: 0;
    right: 0;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--sidebar-text-muted);
    opacity: 0.7;
    z-index: var(--z-raised);
    transition: opacity var(--transition-fast);
}

.global-sidebar-nav-arrow:hover {
    opacity: 1;
}

.global-sidebar-nav-arrow-up {
    top: 0;
    background: linear-gradient(to bottom, var(--sidebar-bg) 40%, transparent);
}

.global-sidebar-nav-arrow-down {
    bottom: 0;
    background: linear-gradient(to top, var(--sidebar-bg) 40%, transparent);
}

.global-sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.global-sidebar-nav ul + ul {
    margin-top: 0;
}

/* Box + sidebar ink only — the caps type comes from
   .global-label-caps--strong --wide on the element (components/label-caps.css). */
.global-sidebar-section-label {
    padding: var(--spacing-smd) var(--spacing-mdlg) var(--spacing-xs);
    color: rgba(var(--sidebar-fg-rgb),0.45);
    overflow: hidden;
    white-space: nowrap;
}

.is-sidebar-collapsed .global-sidebar-section-label span {
    visibility: hidden;
}

/* Collapsed: remove right padding so hover covers the full sidebar width */
.is-sidebar-collapsed .global-sidebar-brand,
.is-sidebar-collapsed .global-sidebar-profile-row {
    padding-right: 0;
}

.global-sidebar-section-label + ul {
    margin-top: 0;
}

.global-sidebar-nav li {
    margin-bottom: var(--spacing-2xs);
}

.global-sidebar-nav a {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 0;
    padding: var(--spacing-sm) 0;
    margin: 0 var(--spacing-sm);
    border-radius: var(--radius-pill);
    color: var(--sidebar-text) !important;
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-base);
    transition: background var(--transition-fast);
}

.global-sidebar-nav a:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-text) !important;
    text-decoration: none;
}

.global-sidebar-nav a:focus {
    color: var(--sidebar-text) !important;
}

.global-sidebar-nav a[aria-current="page"] {
    background: var(--sidebar-active-bg);
    color: var(--brand-secondary-fg) !important;
}

.global-sidebar-nav a i,
.global-sidebar-nav a .bi,
.global-sidebar-nav a span {
    color: inherit !important;
}

.global-sidebar-nav a i,
.global-sidebar-nav a .bi {
    font-size: var(--font-size-base);
    width: 56px;
    text-align: center;
    flex-shrink: 0;
}

.global-sidebar-nav a span {
    white-space: nowrap;
}

/* Collapsed: the hover/active fill becomes a circle behind the icon so the
   pill shape survives the narrow rail. 38px matches the link's row height. */
.is-sidebar-collapsed .global-sidebar-nav a {
    margin: 0;
}

.is-sidebar-collapsed .global-sidebar-nav a::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 38px;
    height: 38px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    transition: background var(--transition-fast);
    z-index: var(--z-behind);
}

.is-sidebar-collapsed .global-sidebar-nav a:hover,
.is-sidebar-collapsed .global-sidebar-nav a[aria-current="page"] {
    background: none;
}

.is-sidebar-collapsed .global-sidebar-nav a:hover::before {
    background: var(--sidebar-hover-bg);
}

.is-sidebar-collapsed .global-sidebar-nav a[aria-current="page"]::before {
    background: var(--sidebar-active-bg);
}

.global-sidebar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 var(--spacing-xsm);
    border-radius: 0.625rem;
    background: var(--color-error);
    color: white;
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    margin-left: auto;
}

.global-sidebar-badge[hidden] {
    display: none;
}

/* A count on a nav link (the Inbox's unread threads) sits at the row's right
   edge, white on red whatever colour the link's own label inherits. */
.global-sidebar-nav a .global-sidebar-badge {
    color: white !important;
    margin-right: var(--spacing-md);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

/* On the icon rail the label is gone, so the count rides the icon's top-right
   corner, ringed in the sidebar's own colour so it reads as a separate dot.
   The ring is an outline, so it takes the sidebar colour of the element it
   sits in and follows the badge's rounded corners. */
.is-sidebar-collapsed .global-sidebar-nav a .global-sidebar-badge {
    position: absolute;
    top: 2px;
    left: 32px;
    min-width: 1rem;
    height: 1rem;
    margin: 0;
    padding: 0 var(--spacing-2xs);
    outline: var(--spacing-2xs) solid var(--sidebar-bg);
}

/* People (ADR-204 §7): one row that opens a card of Contacts, Leads,
   Companies, Partners and the roster beside it, at every width. The task
   count and a chevron pointing at the card share the row's right edge. */
.global-sidebar-people-end {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    margin-left: auto;
    margin-right: var(--spacing-md);
}

/* A menu name of up to 40 signs (Platform) shows "…" when it is too long for
   the row, so the chevron stays in view. */
.global-sidebar-nav a .global-sidebar-people-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-sidebar-nav a .global-sidebar-people-end .global-sidebar-badge {
    margin-right: var(--spacing-sm);
}

.global-sidebar-nav a .global-sidebar-people-chevron {
    width: auto;
    font-size: var(--font-size-xs);
    opacity: 0.7;
}

/* The People card: the same card as the org switcher's. sidebar-state.js keeps
   it one gap (--spacing-sm) from each edge, and a card taller than the screen
   scrolls inside itself (#8780). */
.global-sidebar-people-flyout {
    position: fixed;
    width: 232px;
    max-height: calc(100dvh - 2 * var(--spacing-sm));
    overflow-y: auto;
    overscroll-behavior: contain;
    color: var(--color-text);
}

/* The top layer keeps Media above the phone sheet while it stays inside its focus trap. */
.global-sidebar-media-popup {
    --sidebar-text: var(--color-text);
    --brand-secondary-fg: var(--color-text);
    inset: auto;
    margin: 0;
}

/* Box + muted ink only: the caps type comes from .global-label-caps. */
.global-sidebar-people-label {
    padding: var(--spacing-xs) var(--spacing-sm);
    color: var(--color-text-muted);
}

.global-sidebar-people-flyout .global-menu__option {
    font-size: var(--font-size-base);
}

.global-sidebar-people-flyout .global-menu__option + .global-menu__option {
    margin-top: var(--spacing-2xs);
}

.global-sidebar-people-flyout .global-menu__option .bi {
    width: 20px;
    text-align: center;
    color: var(--color-text-muted);
}

.global-sidebar-people-flyout .global-menu__option.is-current .bi {
    color: inherit;
}

.global-sidebar-footer {
    padding: var(--spacing-sm) 0 0 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

/* One footer row: the Skool CTA stretches across it and the collapse toggle
   sits at its right edge.

   Every control in this row is one height, declared once here. The two are
   neighbours with nothing between them, so a pill even a couple of pixels
   taller than the square reads as a mistake — and left to themselves they
   drift: the pill's height came out of its padding plus whatever line-height
   its tallest child inherited (38.8px against a 28px button), which is not a
   number anyone chose. The collapsed Skool mark takes it too, since it stands
   directly above the toggle in the rail. */
.global-sidebar-footer-actions {
    --sidebar-footer-control-h: 28px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--spacing-xs);
    padding: 0 var(--spacing-sm);
}

/* "Join Skool" is set in Skool's own logo typeface so the CTA reads as one
   continuous wordmark. The brand ships its wordmark only as outlined paths (no
   font file), so we render the text in a tiny subset of Nunito 800 — the closest
   match to Skool's letterforms — carrying just the glyphs of "Join Skool"
   (J o i n S k l). Scoped family name so it can't leak into the rest of the app. */
@font-face {
    font-family: 'SkoolJoin';
    src: url("../../fonts/skool-join.ffcc88916947.woff2") format("woff2");
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

/* Skool community CTA, sharing the footer action row with the collapse toggle.
   Expanded reads "Join Skool" (matched wordmark + external-link icon) and takes
   the row's whole width left of that toggle; collapsed swaps the whole CTA for
   the compact "sk" mark centred in the shared 56px icon rail (the same trade
   the brand row makes). */
.global-sidebar-skool {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    text-decoration: none;
}

/* Expanded: the CTA row; no icon rail. */
.global-sidebar-skool-rail {
    display: none;
}

/* Expanded CTA is a pill button filling the row up to the collapse toggle, so
   it reads as the primary community invite, not a nav row. The label sits hard
   left, the open-in-new-tab icon hard right (space-between). Same frosted-glass
   fill as the collapse button (fg over the sidebar, not a flat white tint) so
   the two neighbours read as one material. No side margins: the row's own
   padding is the inset, and doubling it would pull the pill off the toggle it
   is meant to sit against. Decoration sits on the pill (not the <a>) so the
   collapsed rail stays bare. */
.global-sidebar-skool-cta {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    /* Height from the row, inset from here: vertical padding would fight the
       height it is supposed to produce. */
    height: var(--sidebar-footer-control-h);
    padding-inline: var(--spacing-smd);
    border: 1px solid rgba(var(--sidebar-fg-rgb),0.1);
    border-radius: var(--radius-md);
    background: rgba(var(--sidebar-fg-rgb),0.06);
    transition:
        background var(--transition-fast),
        border-color var(--transition-fast);
}

.global-sidebar-skool:hover .global-sidebar-skool-cta {
    background: rgba(var(--sidebar-fg-rgb),0.12);
    border-color: rgba(var(--sidebar-fg-rgb),0.18);
}

/* "Join Skool" as one text lockup. Both words are set in the matched face at the
   sidebar-menu size so the CTA reads as a peer of the nav items, not an oversized
   banner. "Join" is white; "Skool" carries the real logo colours per letter. They
   share a baseline so they read as a single lockup. */
.global-sidebar-skool-lockup {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-xs);
    font-family: 'SkoolJoin', var(--font-family);
    font-weight: var(--font-weight-large-title);
    font-size: var(--font-size-base);
    line-height: 1;
    /* Tightened slightly so the two words read as one lockup. */
    letter-spacing: -0.005em;
}

.global-sidebar-skool-join {
    color: var(--sidebar-text);
}

/* "Skool" rendered as text (not the fixed lowercase artwork) so the S can be
   capitalised, each letter tinted to the real Skool logo palette. These five are
   Skool's own brand colors — a foreign logo, not our design system — so they have
   no --token to map to and stay raw on purpose (baselined in css_standards). */
.global-sidebar-skool-name span:nth-child(1) { color: #263397; }
.global-sidebar-skool-name span:nth-child(2) { color: #D3513E; }
.global-sidebar-skool-name span:nth-child(3) { color: #E0B467; }
.global-sidebar-skool-name span:nth-child(4) { color: #6BB7EE; }
.global-sidebar-skool-name span:nth-child(5) { color: #C45946; }

/* Open-in-new-tab icon — this link opens the community in a new tab, so the
   box-arrow says exactly that. Sits at the pill's right edge (space-between on
   the parent) and nudges out slightly on hover. */
.global-sidebar-skool-arrow {
    font-size: var(--font-size-base);
    color: var(--sidebar-text-muted);
    transition: transform var(--transition-fast);
}

.global-sidebar-skool:hover .global-sidebar-skool-arrow {
    transform: translateX(2px);
}

/* Collapsed mark, square, matching the toggle stacked below it. */
.global-sidebar-skool-icon {
    width: var(--sidebar-footer-control-h);
    height: var(--sidebar-footer-control-h);
    border-radius: var(--radius-md);
    display: block;
}

.is-sidebar-collapsed .global-sidebar-skool-cta {
    display: none;
}

.is-sidebar-collapsed .global-sidebar-skool-rail {
    display: flex;
}

/* Profile row: just the profile button now (the notification bell moved to
   the header bar). Kept as its own flex row rather than folded into the
   button so the impersonation banner below can share the same rhythm. */
.global-sidebar-profile-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding-right: var(--spacing-sm);
    position: relative;
    background: var(--ink-alpha-10);
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-none) var(--radius-none);
}

.global-sidebar-profile-row .global-sidebar-profile {
    flex: 1;
    min-width: 0;
}

.global-sidebar-profile {
    display: flex;
    align-items: center;
    padding: var(--spacing-xsm) 0 var(--spacing-sm) var(--spacing-xs);
    margin-left: calc(-1 * var(--spacing-xs));
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-none) var(--radius-none);
    min-width: 0;
    text-decoration: none;
    color: inherit;
    transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.global-sidebar-profile:hover {
    background: rgba(var(--sidebar-fg-rgb),0.08);
}

/* Sidebar profile face — geometry now comes from `.global-avatar
   .global-avatar--sm` (components/avatar.css). What survives here is the SKIN
   only: the sidebar's own themed fill and text color, which no platform fill
   modifier can express because they follow the per-org sidebar tokens.
   img.sidebar-profile-photo is gone — `img.global-avatar` covers it. */
.global-sidebar-profile-avatar {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-text);
}

.global-sidebar-profile-link {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.global-sidebar-profile:focus {
    color: inherit;
}

/* The name now owns the row (the email line was dropped), so it reads a touch
   larger and heavier. */
.global-sidebar-profile-name {
    font-weight: var(--font-weight-heading);
    font-size: var(--font-size-base);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--sidebar-text);
}

/* Impersonation indicator: the retired top banner, relocated into the sidebar
   as a persistent full-width block directly under the profile row. Shown only
   while impersonating (request.user is the target, so the avatar/name reuse the
   .global-sidebar-profile-avatar treatment above for a cohesive look). Wears the
   org-accent --brand-highlight to match the Impersonate start button — the
   whole impersonate feature reads as one family — and leaves red to Logout.
   Hosts the sole Stop control. */
.global-sidebar-impersonate {
    display: flex;
    align-items: center;
    background: var(--brand-highlight);
    color: var(--brand-highlight-fg);
}

.global-sidebar-impersonate-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    padding: var(--spacing-xs) var(--spacing-sm) var(--spacing-xs) 0;
}

.global-sidebar-impersonate-name {
    font-weight: var(--font-weight-medium);
    font-size: 0.85rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-sidebar-impersonate-stop {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--brand-highlight-fg);
    text-decoration: underline;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-sidebar-impersonate-stop:hover {
    color: var(--brand-highlight-fg);
    filter: brightness(0.9);
}

/* Profile drawer: wraps the profile row + a click-to-reveal sign-out shelf.
   Closed: only the profile row is visible. Open: the .global-sidebar-profile-signout
   shelf grows from 0 → its natural height. Because the sidebar footer is
   pinned to the viewport bottom by flex layout, the drawer expands UPWARD —
   the avatar visually slides up while the sign-out reveals at the new bottom. */
.global-sidebar-profile-drawer {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.global-sidebar-profile {
    border: 0;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

/* Actions shelf: collapsed by default, animates open via max-height + opacity.
   Houses the Impersonate (when enabled) and Logout buttons stacked vertically.
   max-height is generous enough for both buttons; the actual height is bounded
   by content. */
.global-sidebar-profile-actions {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-height 220ms ease-out, opacity 180ms ease-out;
}

.global-sidebar-profile-drawer.is-open .global-sidebar-profile-actions {
    max-height: 8rem;
    opacity: 1;
    pointer-events: auto;
}

.global-sidebar-profile-signout-form {
    margin: 0;
}

/* Shared metrics for action buttons (Impersonate, Logout). Each row is a
   full-width banner that aligns its icon with the avatar's icon-rail above. */
.global-sidebar-profile-action-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: var(--spacing-sm) 0;
    border: 0;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast),
                filter var(--transition-fast);
}

.global-sidebar-profile-action-btn:focus-visible {
    outline: 2px solid var(--sidebar-text);
    outline-offset: -2px;
}

.global-sidebar-profile-action-btn .bi {
    font-size: var(--font-size-base);
}

.global-sidebar-profile-action-label {
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-md);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Impersonate row: per-tenant brand-highlight accent so the action is
   recognizable without competing with the red Logout below for "danger"
   semantics. --brand-highlight is the brightest org-defined accent (paired
   with --brand-highlight-fg). Both default in tokens.css and are overridden per
   tenant by the inline :root base.html emits when brand_colors is set. */
.global-sidebar-profile-impersonate-btn {
    background: var(--brand-highlight);
    color: var(--brand-highlight-fg);
}

.global-sidebar-profile-impersonate-btn:hover {
    filter: brightness(0.92);
    color: var(--brand-highlight-fg);
}

.global-sidebar-profile-impersonate-btn:active {
    filter: brightness(0.85);
}

/* Logout: solid danger banner, white text. The strongest visual signal in the
   sidebar — by design, it should be unmissable and unmistakable. */
.global-sidebar-profile-signout-btn {
    background: var(--color-error);
    color: #fff;
}

.global-sidebar-profile-signout-btn:hover {
    filter: brightness(0.92);
    color: #fff;
}

.global-sidebar-profile-signout-btn:active {
    filter: brightness(0.85);
}

.global-sidebar-collapse-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: var(--sidebar-footer-control-h);
    height: var(--sidebar-footer-control-h);
    border-radius: var(--radius-button);
    background: rgba(var(--sidebar-fg-rgb),0.06);
    border: 1px solid rgba(var(--sidebar-fg-rgb),0.1);
    color: var(--sidebar-text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.global-sidebar-collapse-btn:hover {
    background: rgba(var(--sidebar-fg-rgb),0.12);
    color: var(--sidebar-text);
}

.global-sidebar-collapse-btn i {
    /* Center the glyph itself: making the <i> a flex box drops Bootstrap Icons'
       ::before vertical-align: -.125em, which otherwise rode the icon high of
       center inside the flex button (the gear looked too high). */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-md);
    line-height: 1;
}

.global-sidebar-settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-button);
    background: rgba(var(--sidebar-fg-rgb),0.08);
    border: 1px solid rgba(var(--sidebar-fg-rgb),0.1);
    color: var(--sidebar-text-muted);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    flex-shrink: 0;
    margin-left: auto;
}

.global-sidebar-settings-btn:hover {
    background: rgba(var(--sidebar-fg-rgb),0.15);
    color: var(--sidebar-text);
    border-color: rgba(var(--sidebar-fg-rgb),0.2);
}

.global-sidebar-settings-btn i {
    font-size: var(--font-size-base);
}

.global-sidebar-scrim {
    position: fixed;
    inset: 0;
    background: var(--color-scrim);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
    z-index: var(--z-scrim);
}

.global-sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: var(--control-h-sm);
    height: var(--control-h-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-text-light);
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
    position: relative;
    z-index: 1;
}

.global-sidebar-toggle:hover {
    background: var(--brand-primary);
    color: var(--brand-primary-fg);
    border-color: var(--brand-primary);
}

.global-sidebar-toggle:focus {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

.global-sidebar-toggle i {
    font-size: var(--font-size-md);
}

.global-sidebar-close {
    display: none;
    margin-left: auto;
    width: var(--control-h-sm);
    height: var(--control-h-sm);
    border: 1px solid rgba(var(--sidebar-fg-rgb),0.15);
    border-radius: var(--radius-md);
    background: rgba(var(--sidebar-fg-rgb),0.1);
    color: var(--sidebar-text);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-md);
}

.global-sidebar-close:hover {
    background: var(--sidebar-hover-bg);
}

/* Desktop global-sidebar-collapse-btn and Sidebar Collapsed State are in main.css (layout/responsive section) */

/* The scroll arrows answer a hovering pointer. A finger scrolls the list
   itself, so on a touch screen they would only paint a chevron and a fade
   over whichever row sits at the edge. */
@media (hover: none) {
    .global-sidebar-nav-arrow {
        display: none;
    }
}

/* ── Compact shell (<1024px) ────────────────────────────────────────────────
   Off-canvas sidebar: rows reach the touch height, and the top row (logo,
   studio switcher, close) lines up with the rows under it and ends in a
   hairline. Stays LAST in the file. */
@media (max-width: 1023px) {
    .global-sidebar-nav a {
        min-height: var(--control-h-touch);
    }

    /* Doubled class to tie the collapsed-rail rule above (a phone can carry
       the collapsed flag over from a desktop visit); being last wins the tie. */
    .global-sidebar .global-sidebar-brand {
        /* --header-height reads 0 on a phone, which has no header beside the sheet. */
        min-height: var(--header-height-touch);
        /* The nav rows' inset: the logo sits over their icons, the close on their right edge. */
        padding-inline: var(--spacing-sm);
        border-bottom: 1px solid var(--sidebar-border);
    }

    .global-sidebar-brand-link {
        min-height: var(--control-h-touch);
        margin-left: 0;
        padding-left: 0;
    }

    /* The switcher and the close are one pair: the same 44 square, a bare
       icon with no box until the finger is on it. */
    .global-sidebar-org-toggle,
    .global-sidebar-close {
        width: var(--control-h-touch);
        height: var(--control-h-touch);
        border: 0;
        background: transparent;
    }

    .global-sidebar-org-toggle:hover,
    .global-sidebar-close:hover {
        background: var(--sidebar-hover-bg);
    }

    /* The account row and its Logout / Impersonate shelf are thumb targets
       in the off-canvas sidebar too. */
    .global-sidebar-profile,
    .global-sidebar-profile-action-btn {
        min-height: var(--control-h-touch);
    }

    /* The face sits in the nav icons' column and the name starts where the
       nav words start. */
    .global-sidebar-profile {
        margin-left: 0;
        padding: var(--spacing-xs) 0 var(--spacing-xs) var(--spacing-sm);
    }

    /* The account row closes the list the way the top row opens it: one
       hairline, no darker tab. The tint belongs to the desktop rail, where
       it caps the column; in a sheet it reads as a second panel. */
    .global-sidebar-footer {
        border-top: 1px solid var(--sidebar-border);
    }

    .global-sidebar-profile-row {
        background: transparent;
    }
}

/* Shared slide-in drawer (F5 consolidation, ADR-125).

   One bespoke base for the right-side drawers that used to copy-paste the same
   CSS into per-feature inline <style> blocks. The look is kept pixel-identical
   to those drawers. New behavior: HubSpot-style PUSH at >=1200px — the panel
   slides in and the main content resizes beside it and stays interactive, with
   no scrim. Below 1200px it falls back to the old OVERLAY + scrim.

   The push line moved from 992px to 1200px on 2026-07-28. What the old line
   missed is that the sidebar only joins the arithmetic at >=1024px: below that
   it is off-canvas and costs nothing, at or above it holds a 256px column
   (--sidebar-width, tokens.css) that the content never gets back. So the worst
   viewport under the old rule was not 992 — it was 1024, where the 256px
   sidebar and the panel and the 24px .global-app-content gutters left about 240px to
   read in. Page content that sits in two columns has nowhere to go at that
   width; the availability page was cutting its working-hours dropdowns in half
   with no scrollbar to reach them.

   1200px is the floor being accepted: 1200 - 256 - 500 - 48 leaves ~396px with
   the sidebar out, ~596px on the collapsed 56px rail. Narrower than that,
   overlaying is the honest answer.

   EVERY drawer in the app is 500px (Nick, 2026-07-29 — design frozen). One
   token, no per-instance override: widths used to be passed per template to
   skillbridge.drawer.open(), which drifted to nine different values between
   380px and 640px. That capability is gone from drawer.js on purpose, so a new
   template cannot reintroduce the drift. Wide content adapts INSIDE the drawer
   (its own overflow-x: auto container); the drawer never widens to fit it.
   z comes from the ADR-125 ladder: scrim var(--z-scrim), panel var(--z-modal). */

:root {
    --drawer-width: 500px;
}

/* How far an open drawer has pushed the content in, or 0px when nothing is
   pushing — the push below is the only thing that sets it.

   It is published on .global-app-layout, not on the .global-app-content the push moves,
   because .global-app-content is a DEAD END for this: it is the sticky .global-app-header's
   SIBLING, and custom properties inherit down, never sideways. .global-app-layout is
   the nearest element above both, and it is the one carrying the push classes,
   so a rule in either child can read how far the content moved.

   The one reader today is the band the pinned header paints
   (components/page-header.css, "--pinned"): the bar it hangs off stays full width
   while the content narrows, so the band has to subtract this or it overhangs
   the card by the drawer's whole width. Reading the same token the push is
   written from is what keeps them in step — a band that hardcoded 500px would
   be wrong the day the drawer resizes, and silently, since nothing about the
   drawer itself would look off. */
.global-app-layout {
    --content-push: 0px;
}

body.is-drawer-lock {
    overflow: hidden;
}

.global-drawer-scrim {
    position: fixed;
    top: var(--drawer-top);
    right: 0;
    bottom: 0;
    left: var(--sidebar-width, 0px);
    background: var(--color-scrim);
    backdrop-filter: blur(2.5px);
    -webkit-backdrop-filter: blur(2.5px);
    z-index: var(--z-scrim);
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

.global-drawer-scrim.is-open {
    opacity: 1;
    pointer-events: auto;
}

.global-drawer-panel {
    position: fixed;
    top: var(--drawer-top);
    right: 0;
    bottom: 0;
    /* The floor is 100%, not the 100vw the offcanvas skin uses: this panel is
       position:fixed, so 100% is the viewport minus the scrollbar, while 100vw
       includes it. Below 500px that difference is a scrollbar's worth of
       overflow; the skin keeps 100vw because that is Bootstrap's own rule. */
    width: min(var(--drawer-width), 100%);
    background: var(--bs-body-bg);
    /* Overlay-mode dress: below the push line this panel floats over the page
       behind a scrim, so it wears the overlay rung like any dialog. At >=1200px
       it stops floating and the PUSH block below re-dresses it in the page
       containers' own skin (Nick, 08-17: an open drawer is just another
       container on the page, not something hovering over it). */
    box-shadow: var(--shadow-modal);
    z-index: var(--z-modal);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--transition-normal);
}

.global-drawer-panel.is-open {
    transform: translateX(0);
}

/* A closing panel still covers the page for its .2s slide out, and a tap there
   would land on a drawer that is already gone. */
.global-drawer-panel:not(.is-open) {
    pointer-events: none;
}

/* Inset top divider — used by the payments and opportunity drawers. */
.global-drawer-panel--inset {
    border-top: 1px solid rgba(15, 23, 42, .08);
    box-shadow: var(--shadow-modal),
                inset 0 6px 6px -6px rgba(15, 23, 42, .12);
}

.global-drawer-body {
    padding: var(--spacing-mdlg);
    /* Zero extra on desktop; the home bar on a phone. */
    padding-bottom: calc(var(--spacing-mdlg) + var(--safe-bottom));
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    flex: 1 1 auto;
}

/* One box around the head, body and foot, for a drawer whose x-if needs a
   single root. It fills the panel and can shrink, so the body scrolls and the
   foot stays on screen. A phone sheet has no set height, so a height: 100%
   box there grew to its content and pushed Save off the screen. */
.global-drawer-frame {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.global-drawer-sub {
    font-size: var(--font-size-md);
    /* Slate-500 secondary text, shared via tokens.css :root (not --color-text-muted,
       which is a lighter #9ca3af). */
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-mdlg);
}

/* ── HEAD + CLOSE ──────────────────────────────────────────────────────────
   The one drawer header: the drawer's name on the left, the X on the right,
   pinned above the scrolling .global-drawer-body. Write it with the shared partial
   (shared/components/drawer_header.html), not by hand — the fleet had five
   different header classes and five different ways out (an X, a "Done"
   button, a Bootstrap .btn-close, a footer Cancel, and eight drawers with no
   header affordance at all), so the way to leave a drawer changed from page
   to page.

   The X matters most in PUSH mode: at >=1200px the scrim is hidden and the
   page stays live beside the panel, so clicking off it does nothing and this
   button (with the root's Escape handler) is the only way out.

   Borderless on purpose — .global-icon-btn's bordered circle would put the
   close on the same footing as the drawer's own actions, and this is chrome
   for leaving the panel, not one of its choices. */
.global-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-smd);
    padding: var(--spacing-md) var(--spacing-mdlg);
    border-bottom: 1px solid var(--color-border-subtle);
    flex-shrink: 0;
}

/* Grows so the title hugs the left edge (or the back arrow) with the X pinned
   right — space-between alone would float it to the center once the head holds
   three children. min-width lets a long title truncate instead of pushing. */
.global-drawer-head__text {
    flex: 1 1 auto;
    min-width: 0;
}

/* An <h2>, so heading navigation finds the open drawer. That tag costs us two
   fixes. It brings its own big size and bottom margin, reset below. And main.css
   styles every h2 from the tenant's subheading tokens, which base/base.html sets
   per org — so without the four body-token lines here, a tenant whose brand sets
   subheading type (Fortis: Helvetica Neue, uppercase) would show every drawer
   title in that font, ALL CAPS. Those four only look redundant. They are what
   keeps this title plain for every tenant, so leave them in place. */
.global-drawer-head__title {
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-md);
    font-style: var(--font-style-body);
    font-weight: var(--font-weight-medium);
    letter-spacing: var(--letter-spacing-body);
    line-height: 1.5;
    text-transform: var(--text-transform-body);
    color: var(--color-text);
}

.global-drawer-head__sub {
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

/* The back arrow (drawer_header.html's back_click param) shares the X's whole
   recipe: two quiet icon buttons bracketing the title, one look. */
.global-drawer-head__back,
.global-drawer-close {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--control-h-sm);
    height: var(--control-h-sm);
    padding: 0;
    font-size: var(--font-size-base);
    color: var(--color-text-muted);
    background: transparent;
    border: 0;
    border-radius: var(--radius-md);
    cursor: pointer;
}

.global-drawer-head__back:hover,
.global-drawer-close:hover {
    color: var(--color-text);
    background: var(--color-surface-subtle);
}

.global-drawer-head__back:focus-visible,
.global-drawer-close:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

/* ── OVERLAY variant ───────────────────────────────────────────────────────
   For the persistent, teleported drawers that open ON TOP of another modal
   (e.g. the add-exception form launched from inside the settings modal). Unlike
   the push drawer above — ephemeral, content-level, pushes the page beside it —
   this one stays in the DOM and slides on .is-open, always overlays (never
   pushes, so it is safe outside .global-app-layout and never trips the JS reconcile),
   dims the whole viewport, and clears the modal rung. It reuses .global-drawer-panel's
   box (position/width/bg/shadow/slide) and the shared .global-drawer-body / -title /
   -sub; only the persistent + modal-level bits differ. The closed state is
   visibility:hidden so the off-screen fields stay out of the tab order. */
.global-drawer-overlay-scrim {
    position: fixed;
    inset: 0;
    background: var(--color-scrim);
    backdrop-filter: blur(2.5px);
    -webkit-backdrop-filter: blur(2.5px);
    z-index: var(--z-popover);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.global-drawer-overlay-scrim.is-open {
    opacity: 1;
    visibility: visible;
}

.global-drawer-panel--overlay {
    z-index: calc(var(--z-popover) + 1);
    visibility: hidden;
    transition: transform var(--transition-normal), visibility var(--transition-normal);
}

.global-drawer-panel--overlay.is-open {
    visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
    .global-drawer-overlay-scrim,
    .global-drawer-panel--overlay {
        transition: none;
    }
}

/* ── Bootstrap-offcanvas skin ──────────────────────────────────────────────
   Some drawers stay on Bootstrap's .offcanvas — its JS owns show/hide, the
   backdrop, the focus trap, and the HTMX-loaded bodies, so they aren't worth
   rebuilding on the custom drawer. This skin gives them the shared drawer LOOK:
   the overlay-mode panel shadow (this family always overlays behind Bootstrap's
   backdrop, so it keeps the halo the push drawers drop at >=1200px), 1.25rem
   body padding, and a top edge that starts BELOW the main header instead of
   sliding up over it. A stock offcanvas is top:0/full-height, which would cover
   the sticky header (and hide its own title behind it); starting at the header's
   bottom edge keeps the header visible and clickable. It stays AT that edge —
   the extra --spacing-lg drop is a push-mode dress; this family always floats,
   like the push drawers under 1200px, and floating drawers stay flush.
   Behavior, header, and close button stay Bootstrap's; width does NOT — it
   reads the same --drawer-width token as the push drawers so the two families
   can't diverge.
   The 100vw floor is Bootstrap's own small-screen behavior, kept. */
.offcanvas.global-drawer-offcanvas {
    top: var(--drawer-top);
    height: auto;
    bottom: 0;
    width: min(var(--drawer-width), 100vw);
    box-shadow: var(--shadow-modal);
}

.global-drawer-offcanvas .offcanvas-body {
    padding: var(--spacing-mdlg);
}

/* Bootstrap puts its own dim after the drawer, black at half strength.
   drawer.js marks it, so it takes the shared scrim like every other drawer
   (Nick, 2026-11-09). The scrim holds its own strength, so the dim shows at
   full opacity; is-closing fades it out with Bootstrap's own timing. The
   sibling selector outranks Bootstrap's `.show` rule. */
.global-drawer-offcanvas ~ .global-drawer-offcanvas__scrim {
    background-color: var(--color-scrim);
    opacity: 1;
}

.global-drawer-offcanvas ~ .global-drawer-offcanvas__scrim.is-closing {
    opacity: 0;
}

/* ── DOCK marker ───────────────────────────────────────────────────────────
   No rule below sets it: .drawer-panel--dock styles nothing, it only marks a
   panel for drawer.js. It is documented here because this is where you look
   for it.

   A PERSISTENT push drawer that lives in the page full-time so its Alpine state
   survives htmx repaints of the content under it (the opportunities view-settings
   drawer). It looks and pushes exactly like the ephemeral push drawer, but two
   bits differ so a permanent panel doesn't jam the shared reconcile:
     • drawer.js panels() skips it (the :not() in its selector), so its
       always-present node never pins the ephemeral push on;
     • it rides its OWN push class (.is-dock-drawer-open, toggled by drawer.dock())
       instead of .is-drawer-open, so an ephemeral drawer opening/closing beside it
       can't clear its push, and vice-versa.
   It carries no width rule of its own: it inherits .global-drawer-panel's
   --drawer-width like every other drawer. It used to have a wider
   --dock-drawer-width token; that was the last per-family width and it went
   with the rest of the drift (2026-07-29). */

/* PUSH (>=1200px): the open drawer resizes the content beside it; no scrim. */
@media (min-width: 1200px) {
    .global-drawer-scrim {
        display: none;
    }

    /* A pushed-in drawer is not an overlay — it sits IN the page next to the
       cards, so it dresses like one: .global-card's hairline + resting shadow,
       and the page's own top gap (Nick, 08-17). Every container starts
       --page-gutter below the header — the .global-app-content padding — so the
       drawer does too: its top edge lands on the content line and is finished
       like a container's, full border and the card corner on the one corner it
       exposes. The right and bottom edges stay flush — it is still a drawer.
       The halo (and the flush top) survive only where the panel truly floats:
       under 1200px, and the --overlay variant, which opens above a modal
       behind its own scrim at every width. The --wide lead drawer floats over
       the board too, so it stays flush under the header (ADR-205): this rule
       is what used to leave a --page-gutter gap above it.

       No inset re-dress for --inset here: that band sells content tucking
       under the header, and up here nothing tucks — the (0,2,0) selector below
       outweighs the variant's (0,1,0) base, so both wear the plain card skin. */
    .global-drawer-panel:not(.global-drawer-panel--overlay, .global-drawer-panel--wide) {
        top: calc(var(--drawer-top) + var(--page-gutter));
        border-top: 1px solid var(--color-border);
        border-top-left-radius: var(--radius-card);
        border-left: 1px solid var(--color-border);
        box-shadow: var(--shadow-sm);
    }

    /* Resize only the CONTENT beside the drawer — NOT .global-app-main, which also holds
       the sticky .global-app-header. Pushing .global-app-main shifted the header sideways too;
       the header must stay full-width above the drawer (which opens below it at
       --drawer-top). width:100% + max-width:calc(100% - drawer) resolves to the
       shrunk width (border-box app-wide) and margin-right fills the gap.
       Both push classes get the same offset because both push the same distance —
       every drawer is --drawer-width wide, so the ephemeral and dock pushes are
       one rule, not two that have to be kept in step.

       The distance is named first and consumed second so that a rule elsewhere
       in the layout can read it: see --content-push at the top of this file.
       Only the header stays put — anything the header PAINTS over the content
       has to move with the content. */
    .global-app-layout.is-drawer-open,
    .global-app-layout.is-dock-drawer-open {
        --content-push: var(--drawer-width);
    }

    .global-app-layout.is-drawer-open .global-app-content,
    .global-app-layout.is-dock-drawer-open .global-app-content {
        margin-right: var(--content-push);
        max-width: calc(100% - var(--content-push));
    }

    /* Content stays scrollable in push mode — the lock only matters for overlay. */
    body.is-drawer-lock {
        overflow: visible;
    }
}

/* OVERLAY (<1200px): panel over full-width content, scrim visible. */
@media (max-width: 1199.98px) {
    .global-drawer-scrim {
        left: 0;
    }
}

/* A closed panel waits just past the right edge, so its shadow showed there as
   a dark band. Only an open panel casts a shadow. This rule comes after the
   push block, so it also takes off that block's resting shadow. A move above
   the push block fails test_dashboard_view_settings_drawer_proof.py.

   The rule takes off the shadow and no more. A clip here hid the open drawers
   that live inside a closed panel, such as View settings in the phone fold. */
.global-drawer-panel:not(.is-open) {
    box-shadow: none;
}

/* ── Wide (ADR-198, ADR-205) ────────────────────────────────────────────────
   One drawer is wider than the rest on purpose: the lead drawer opened from
   the Leads page holds the lead's conversation beside the lead's tabs. It
   covers the whole page under the header, from the sidebar's edge to the
   right edge, and still reads the one --drawer-width token as its floor. Too
   wide to push the board aside, it floats over it at every width and dims it
   behind the scrim. Its body hands the scrolling to the two sides inside it,
   so each side scrolls on its own. */
@media (min-width: 768px) {
    .global-drawer-panel--wide {
        width: max(var(--drawer-width), 100%);
    }
}

@media (min-width: 1024px) {
    .global-drawer-panel--wide {
        width: max(var(--drawer-width), calc(100% - var(--sidebar-width)));
    }

    .global-app-layout.is-sidebar-collapsed .global-drawer-panel--wide {
        width: max(var(--drawer-width), calc(100% - var(--sidebar-collapsed-width)));
    }
}

@media (min-width: 1200px) {
    .global-app-layout.is-drawer-open:has(.global-drawer-panel--wide) {
        --content-push: 0px;
    }

    .global-drawer-scrim:has(+ .global-drawer-panel--wide) {
        display: block;
    }
}

.global-drawer-panel--wide .global-drawer-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

/* ── Phone (<768px) ─────────────────────────────────────────────────────────
   Every drawer is a bottom sheet. drawer.js adds `global-drawer-panel--sheet`
   to each panel while this query matches, so no template carries a per-page
   class. The 1200px push/overlay split above is untouched. Stays LAST. */
@media (max-width: 767.98px) {
    /* clip, not hidden: hidden makes body a scroll box of its own, the sticky
       app bar stops sticking, and on a scrolled page it rides up under the
       notch while a sheet is open. clip still stops the page scrolling. */
    body.is-drawer-lock {
        overflow: clip;
    }

    .global-drawer-panel,
    .global-drawer-offcanvas {
        --drawer-visible-top: max(var(--header-bottom), var(--phone-covered-top, 0px));
        --drawer-visible-bottom: max(var(--sheet-bottom), var(--phone-covered-bottom, 0px));
    }

    /* A drawer inside a drawer is fixed to the transformed panel around it.
       That panel already fits the keyboard, so the inner sheet uses its space. */
    .global-drawer-panel .global-drawer-panel {
        bottom: 0;
        max-height: 100%;
    }

    .global-drawer-panel {
        /* The sheet stands on the bottom bar, or covers the tab capsule
           (tokens.css --sheet-bottom). */
        inset: auto 0 var(--drawer-visible-bottom) 0;
        /* No width here: the base rule's min(var(--drawer-width), 100%) is
           already the phone width. max() picked the 500px token over 100% and
           the sheet ran off the right edge. Past 500px the sheet centres. */
        margin-inline: auto;
        height: auto;
        max-height: calc(100dvh - var(--drawer-visible-top) - var(--drawer-visible-bottom));
        transform: translateY(100%);
        border-radius: var(--radius-lg) var(--radius-lg) var(--radius-none) var(--radius-none);
        /* translateY(100%) parks the closed sheet ON the bar (its bottom edge is
           the bar's top), so its head drew over the bottom bar. Hidden while
           closed, the same as the sidebar sheet; visibility rides the transform's
           transition so the slide still shows. */
        visibility: hidden;
        transition: transform var(--transition-normal), visibility var(--transition-normal);
    }

    .global-drawer-panel.is-open {
        transform: translateY(0);
        visibility: visible;
    }

    /* The sheet is its own scroller; overscroll-behavior-y sits beside
       overflow-y (test_overscroll_containment keys on file + selector). */
    .global-drawer-panel--sheet {
        overflow-y: auto;
        overscroll-behavior-y: contain;
        /* The bar under the sheet pays the home indicator, or the sheet does
           where it covers the tab capsule. */
        padding-bottom: calc(var(--spacing-lg) + var(--sheet-pad-bottom));
    }

    .global-drawer-body {
        padding-bottom: var(--spacing-mdlg);
    }

    /* Add contact and the quick add put a field in focus as they open, and
       iPhone Safari focuses only a field that shows. So these sheets show at
       once and only slide. A closing sheet still hides after its slide. */
    .global-drawer-panel--focus-first.is-open {
        transition: transform var(--transition-normal);
    }

    /* Add contact with the keys up (typing-sheet.js). The sheet glides onto
       the keys: by its bottom edge when the keys cover the page, and by its
       height when the page gets short. */
    .global-drawer-panel--typing {
        transition: transform var(--transition-normal), visibility var(--transition-normal),
            bottom var(--transition-normal), max-height var(--transition-normal);
    }

    .global-drawer-panel--typing.is-open {
        transition: transform var(--transition-normal), bottom var(--transition-normal),
            max-height var(--transition-normal);
    }

    /* The sheet follows the finger at once and glides when the finger lifts. */
    .global-drawer-panel--typing.is-open:where(:not(.is-swipe-dragging)) {
        transition-property: transform, bottom, max-height, translate;
    }

    .global-drawer-panel--typing .global-drawer-head {
        touch-action: none;
    }

    /* The discard choices stay in reach while the phone hides its keys. */
    body:has(.global-drawer-panel--typing.is-asking-discard) .global-confirm-overlay {
        padding-block:
            calc(var(--spacing-md) + var(--phone-covered-top, 0px))
            calc(var(--spacing-md) + var(--phone-covered-bottom, 0px));
    }

    /* While a field takes typing, the sheet may rise to the safe top (the
       scrim covers the app bar already). */
    .global-drawer-panel--typing:has(:is(input:not([type="checkbox"]), textarea):focus) {
        --drawer-visible-top: max(var(--safe-top), var(--phone-covered-top, 0px));
    }

    /* Its head is slim then. The grab bar and the 44px X stay; only the space
       above and below the title row shrinks. */
    .global-drawer-panel--typing:has(:is(input:not([type="checkbox"]), textarea):focus) .global-drawer-head {
        padding-top: var(--spacing-smd);
        padding-bottom: var(--spacing-xs);
    }

    /* The body and its groups sit closer, so the names, Phone and Email show
       above the footer on a small phone with the keys up. These pads do not
       change with the focus: a tap that moves the focus must not move a row. */
    .global-drawer-panel--typing .global-drawer-body {
        padding-top: var(--spacing-xs);
    }

    .global-drawer-panel--typing .global-drawer__section {
        padding-block: var(--spacing-smd);
    }

    .global-drawer-panel--typing .global-drawer__section:first-child {
        padding-top: 0;
    }

    /* The bell's Bootstrap offcanvas is a bottom sheet on the bar too. Left
       and right at 0 with the token width and auto margins = centred, which
       under 500px is the whole screen (the same shape .global-drawer-panel
       takes above; test_drawer_width lets only the token size a drawer). */
    .offcanvas.global-drawer-offcanvas {
        top: auto;
        bottom: var(--drawer-visible-bottom);
        left: 0;
        right: 0;
        margin-inline: auto;
        height: auto;
        max-height: calc(100dvh - var(--drawer-visible-top) - var(--drawer-visible-bottom));
        padding-bottom: var(--sheet-pad-bottom);
        border: 0;
        border-radius: var(--radius-lg) var(--radius-lg) var(--radius-none) var(--radius-none);
    }

    /* The closed transform lives on a one-class selector on purpose: it
       outranks Bootstrap's `.offcanvas-end` only by source order, and stays
       UNDER Bootstrap's own `.offcanvas.showing` / `.offcanvas.show`, so the
       open and closing states stay Bootstrap's without this file spelling
       its state classes. */
    .global-drawer-offcanvas {
        transform: translateY(100%);
    }

    /* The drag-handle pill sits centred on the head's top edge. It hangs off
       the head, not the panel: test_drawer_width reads every `width` on a
       `global-drawer-panel` selector as the drawer's size, and a 36px pill
       is not that. The head grows at the top to make room for it. */
    .global-drawer-head {
        position: relative;
        padding-top: var(--spacing-mdlg);
    }

    .global-drawer-head::before {
        content: "";
        position: absolute;
        top: var(--spacing-sm);
        left: 50%;
        width: var(--sheet-handle-w);
        height: var(--sheet-handle-h);
        translate: -50%;
        border-radius: var(--radius-pill);
        background: var(--color-grey-300);
    }

    /* The Add contact pill clears the phone's top gesture when the keys are up. */
    .global-drawer-panel--typing .global-drawer-head::before {
        top: var(--spacing-mdlg);
    }

    .global-drawer-close {
        width: var(--control-h-touch);
        height: var(--control-h-touch);
        color: var(--color-text-secondary);
    }

    .global-drawer-head__back {
        width: var(--control-h-touch);
        height: var(--control-h-touch);
        color: var(--color-text-secondary);
    }

    /* Below the header nothing is sticky, so the scrim starts at the top. */
    .global-drawer-scrim {
        top: 0;
    }

    /* A panel that opts out of the sheet (drawer.js skips it, so it never
       wears --sheet) keeps the overlay shape on a phone: the right edge, the
       slide in from the right, the phone's own width, clear of the bottom bar.
       No visibility rule here on purpose: the bare .global-drawer-panel rule
       above already hides it closed and .is-open shows it, the same way
       opportunity-cards.css layers its own side panel under that rule. */
    .global-drawer-panel--side {
        inset: max(var(--drawer-top), var(--phone-covered-top, 0px)) 0 max(var(--bottom-bar-h), var(--phone-covered-bottom, 0px)) auto;
        width: min(var(--drawer-width), 100%);
        margin-inline: 0;
        max-height: none;
        border-radius: var(--radius-none);
        transform: translateX(100%);
    }

    .global-drawer-panel--side.is-open {
        transform: translateX(0);
    }

    /* No drag handle: the panel slides in from the side, not up from the bar. */
    .global-drawer-panel--side .global-drawer-head {
        padding-top: var(--spacing-md);
    }

    .global-drawer-panel--side .global-drawer-head::before {
        display: none;
    }

    /* The wide drawer's sheet stands full height, so its two sides scroll
       inside it and the reply box stays at the bottom (ADR-198). It stands
       on --sheet-bottom, so it takes that off, and its top meets the top bar. */
    .global-drawer-panel--wide.is-open {
        height: calc(100dvh - var(--drawer-visible-top) - var(--drawer-visible-bottom));
    }

    /* No sheet gap under the reply box, but the sheet still pays the home
       indicator where it covers the tab capsule, so Send stays above it. */
    .global-drawer-panel--wide.global-drawer-panel--sheet {
        overflow: hidden;
        padding-bottom: var(--sheet-pad-bottom);
    }
}

/* Reduced motion: Add contact jumps onto the keys with no glide. The open
   slide stays, as it does for every sheet. */
@media (max-width: 767.98px) and (prefers-reduced-motion: reduce) {
    .global-drawer-panel--typing {
        transition: transform var(--transition-normal), visibility var(--transition-normal);
    }

    .global-drawer-panel--typing.is-open {
        transition: transform var(--transition-normal);
    }
}

/* The drawer's CONTENT language — what goes inside the shell that
   components/drawer.css draws. Every saved-view settings drawer and the
   panels that step out of them are built from these classes and nothing else:

     .global-drawer__section   one group, hairline between groups
     .global-drawer__legend    small-caps heading over a group's controls
     .global-drawer__field     one control row inside a section
     .global-drawer__rowbtn    the neutral row that steps into a panel or does an act
     .global-drawer__input     the drawer's text box (the view's name)
     .global-drawer__cols      a checklist (columns, metric cards), draggable or not
     .global-drawer__kinds     the view-type picker, a skin on .global-segmented
     .global-drawer__footer    the staged-save footer with its Reset / Save pair

   Loaded on every page from base.html, so a rename here restyles every
   drawer that speaks it. */

/* View-type picker: five equal icon cells, one per view kind. This IS the shared segmented control
   (.global-segmented + --equal + __btn, components/segmented.css) — the canon in
   docs/plans/controls-canon.md names the view switcher as its labels variant, and
   the approved mock draws one connected strip rather than five loose cards. Only
   two things are local: the track fills the drawer width instead of hugging its
   buttons, and the cells are square icons with no label. */
.global-segmented.global-drawer__kinds {
    display: grid;
}

.global-segmented__btn.global-drawer__kind {
    padding: var(--spacing-sm) 0;
    font-size: var(--font-size-lg);
}

.global-drawer__kind:disabled {
    cursor: default;
    opacity: 0.55;
}

/* The drawer SHELL (scrim, panel, body, slide) is components/drawer.css, driven
   by skillbridge.drawer.dock(); `.drawer-panel--dock` styles nothing — it is the
   marker drawer.js reads to leave this always-present panel out of the push
   count. */

.global-drawer__section {
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--color-border-subtle);
}

.global-drawer__section:first-child {
    padding-top: 0;
}

.global-drawer__section:last-child {
    border-bottom: none;
}

/* The SETTINGS drawer draws no rules between its groups — the approved mock sets
   them apart with the small-caps legend and space alone, and the drawer structure
   names exactly one divider, the one above Delete view. Scoped to sections that
   carry data-drawer-section so the opportunity-create drawer, which shares this
   class without that attribute, keeps its rules. */
.global-drawer__section[data-drawer-section] {
    border-bottom: none;
}

/* The view-type picker and the "[Type] settings" section beneath it are one block,
   so the pair closes up tighter than the gap between groups. */
.global-drawer__section--tight {
    padding-bottom: var(--spacing-xs);
}

/* Settings sections space themselves with their own padding, so a section's last
   field/hint must not stack its in-flow margin on top of that: with the read-back
   and quick-filter groups gone, that slack left one panel mixing 20/33/47px seams.
   Zeroing the trailing margin (one level of nesting deep — Actions ends in a
   sharing row whose own last child is a hint) makes every group seam the same
   16+16. Scoped to [data-drawer-section] like the divider rule above, so the
   create/detail drawers that share these classes keep their rhythm. */
.global-drawer__section[data-drawer-section] > :last-child,
.global-drawer__section[data-drawer-section] > :last-child > :last-child {
    margin-bottom: 0;
}

/* :last-child is blind to Alpine: a trailing x-if template (the card lines'
   separator picker) or x-show'd global-empty-state line is still the DOM's last child,
   so the visibly-last cols box above it kept its margin and the old wide seam
   with it. A cols box that is the last RENDERED element of its group — the only
   things after it are template tags or the global-empty-state <p>s, so it is the last
   div — drops the margin too; the global-empty-state line carries its own top margin
   (rule below), which collapses with a cols margin where one remains, so
   nothing else moves. */
.global-drawer__section[data-drawer-section] > :last-child > .global-drawer__cols:last-of-type {
    margin-bottom: 0;
}

/* The drawer's one act row: every whole-row control wears it — the rows that
   open a panel (Filters, Table / Calendar / Board / Card settings), Set as
   default, Who sees it, Delete view. Label left, an optional current value
   and a chevron right, like a HubSpot settings row (Nick 08-28: "they should
   all sort of look the same, going down the line"). Delete is deliberately NOT
   red; the confirm dialog is what guards it. Disabled = the act already done
   (the lit star reading "Default view"). */
.global-drawer__rowbtn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
    min-height: var(--control-h-base);
    padding: 0 var(--spacing-smd);
    font-size: var(--font-size-md);
    text-decoration: none;
    color: var(--color-text);
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-button);
    cursor: pointer;
}

.global-drawer__rowbtn:hover:not(:disabled) {
    color: var(--color-text);
    border-color: var(--color-text-muted);
}

/* A row that is one of a set of choices (Who sees it) says which is live. */
.global-drawer__rowbtn[aria-pressed="true"] {
    border-color: var(--color-text);
    font-weight: var(--font-weight-medium);
}

.global-drawer__rowbtn:disabled {
    opacity: 0.5;
    cursor: default;
}

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

.global-drawer__rowbtn-label {
    flex: 1 1 auto;
    text-align: left;
}

.global-drawer__rowbtn-value {
    color: var(--color-text-secondary);
}

/* The key that does the row's act (Save changes · Ctrl+S). */
.global-drawer__kbd {
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
}

/* A legend with room for a chip beside it. The row carries the legend's bottom
   margin so a chip sits on the legend's line, not under it. */
.global-drawer__legendrow {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin: 0 0 var(--spacing-sm);
}

.global-drawer__legendrow .global-drawer__legend {
    margin: 0;
}

/* A segmented control standing alone in a panel group (row height, the
   calendar's default view) spans the column like every other control there;
   the base .global-segmented is inline and would sit short on the left. */
.global-drawer__seg {
    display: flex;
    width: 100%;
}

/* Section legend mirrors HubSpot's drawer headers: 11px uppercase. This is the
   top tier — text-secondary — with each group label (.global-drawer__label) a notch
   down in muted, so every group reads on the same small-caps rhythm. */
.global-drawer__legend {
    margin: 0 0 var(--spacing-sm);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-secondary);
}

.global-drawer__hint {
    margin: 0 0 var(--spacing-smd);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

/* Edit-columns checkbox list — a bordered scroll box (like the create drawer's
   field chrome) so the list reads as one control, not loose rows. */
/* The search box over a checklist sits a hair above it, as one control. */
.global-drawer__cols-search {
    margin-bottom: var(--spacing-xs);
}

.global-drawer__cols {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    max-height: 260px;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin-bottom: var(--spacing-smd);
    padding: var(--spacing-xs);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-sm);
    background: var(--color-card-bg);
}

.global-drawer__col {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xsm) var(--spacing-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.global-drawer__col:hover {
    background: var(--color-surface-subtle);
}

/* Checkboxes here use the shared .global-checkbox component —
   shared/css/components/checkbox.css. The rows carry that class. */

.global-drawer__col-name {
    font-size: var(--font-size-md);
    color: var(--color-text);
}

.global-drawer__col-stage {
    margin-left: auto;
    font-size: var(--font-size-2xs);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--color-text-muted);
}

/* One row of a card-line picker (_opps_drawer_lines.html): the piece's checkbox
   label, what KIND of piece it is, and — on the pieces that are in the line — the
   buttons that move it. Rides inside .global-drawer__cols, which already supplies the
   bordered scroll box, so the row supplies only its own layout. The label does not
   grow: the kind chip reads as part of the piece, and only the move buttons are
   pushed right, so the arrows line up down the list however long the labels are. */
.global-drawer__line-piece {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 0;
}

.global-drawer__line-piece .global-drawer__col-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-drawer__line-moves {
    display: flex;
    gap: var(--spacing-xs);
    margin-left: auto;
    padding-right: var(--spacing-xs);
}

/* Drag reorder (table column list): a grip handle sits left of the checkbox
   label. The row is a plain flex container; the label carries the click target so
   grabbing the handle never toggles the box. */
.global-drawer__col-handle {
    display: inline-flex;
    align-items: center;
    color: var(--color-text-secondary);
    cursor: grab;
}

.global-drawer__col-handle:active {
    cursor: grabbing;
}

.global-drawer__col-check {
    display: flex;
    flex: 1;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 0;
    cursor: pointer;
}

/* SortableJS drag placeholder — the gap the row will drop into. */
.global-drawer__col--ghost {
    opacity: 0.4;
}

/* Grouped drawer checklists (calendar Event categories + Task types): the group
   row (a toggle-all category, or a plain section label) reads bold, and each leaf
   checkbox is indented under it, mirroring the header filter dropdowns. */
.global-drawer__subgroup + .global-drawer__subgroup {
    margin-top: var(--spacing-sm);
}

.global-drawer__col--group .global-drawer__col-name,
.global-drawer__col-name.global-drawer__col--group {
    font-weight: var(--font-weight-medium);
}

.global-drawer__col--sub {
    padding-left: var(--spacing-lg);
}

/* Details by Job (task view): one list holds the ticked fields and, under group
   heads, the rest, so it grows with the panel instead of scrolling in a box. A
   ticked row wraps to show its Show when block under it; an unticked row keeps a
   hidden grip so its box lines up with the ticked ones at any font size.
   overflow-y: visible takes it out of the scroll boxes: a box that holds the
   wheel but never scrolls kept a wheel over it from moving the drawer body. */
.global-drawer__cols--tall {
    max-height: none;
    overflow-y: visible;
}

.global-drawer__col--rule {
    flex-wrap: wrap;
}

.global-drawer__col-rule {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.global-drawer__col-when {
    display: flex;
    flex: 1 0 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xs);
    padding-left: var(--spacing-lg);
}

.global-drawer__col-spacer {
    display: inline-flex;
    visibility: hidden;
}

.global-drawer__col-head {
    padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-2xs);
}

.global-drawer__note {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* In the settings drawers the global-empty-state line under a cols box carries its own
   top margin (not just the box's bottom one, which the seam rules zero when the
   box ends its group) — the two collapse where both exist, so the gap stays
   12px in every visibility state. The lead-detail drawer's sections carry no
   data-drawer-section and its empties keep their flush default. */
.global-drawer__section[data-drawer-section] .global-drawer__note {
    margin-top: var(--spacing-smd);
}

.global-drawer__field {
    margin-bottom: var(--spacing-smd);
}

/* Group label — one small-caps treatment for every group inside a section, so
   "Row height", "Sort by", "Date filter" etc. all match the section legend's
   idiom instead of floating as loose dark labels. Muted keeps it a
   tier below the legend above it. */
.global-drawer__label {
    display: block;
    margin-bottom: var(--spacing-xsm);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}

.global-drawer__input {
    width: 100%;
    height: var(--control-h-base);
    padding: 0 var(--spacing-smd);
    font-size: var(--font-size-md);
    color: var(--color-text);
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-button);
}

.global-drawer__input:focus {
    outline: none;
    border-color: var(--color-focus-ring);
    box-shadow: var(--shadow-focus-ring);
}

.global-drawer__input--name {
    flex: 1;
}

/* A many-line box (a role's description, a note): the same skin at a taller,
   draggable height. It takes the card corner. A pill corner on a tall box cuts
   into the first and last letters. */
.global-drawer__input--multi {
    height: auto;
    min-height: calc(var(--control-h-base) * 1.6);
    padding: var(--spacing-sm) var(--spacing-smd);
    border-radius: var(--radius-card);
    line-height: 1.4;
    resize: vertical;
}

/* A money box: the sign sits inside the input's left edge, the way the booking
   drawer's pay boxes read, without Bootstrap's input-group chrome. */
.global-drawer__affix {
    position: relative;
}

.global-drawer__affix-sign {
    position: absolute;
    top: 50%;
    left: var(--spacing-smd);
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
}

.global-drawer__affix .global-drawer__input {
    padding-left: calc(var(--spacing-smd) * 2 + 0.6em);
}

/* Full-width sort-direction pair — the adaptive labels ("Most recent" /
   "Oldest", "A → Z" / "Z → A" …) run long, so this shared .global-segmented spans
   the whole field with each option flexing to half, sitting under the Sort-by
   select. Every segmented control in a drawer wears `--picker` (segmented.css)
   so it stands at the same height and in the same pill as that select; only the
   view-kind icon strip above keeps the recessed track. */
.global-drawer__sortdir {
    display: grid;
    width: 100%;
    margin-top: var(--spacing-xsm);
}

.global-drawer__btn {
    min-height: var(--control-h-base);
    padding: 0 var(--spacing-smd);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-button);
    border-radius: var(--radius-button);
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.global-drawer__btn:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Keyboard focus ring — the action buttons (save / delete / save-as-new) had none,
   so a keyboard user tabbing the drawer saw nothing. Matches .global-drawer-close. */
.global-drawer__btn:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

.global-drawer__btn--primary {
    color: var(--color-neutral-ink-fg);
    background: var(--color-action);
    border: 1px solid var(--color-action);
}

.global-drawer__btn--primary:hover:not(:disabled) {
    background: var(--color-action-hover);
    border-color: var(--color-action-hover);
}

.global-drawer__btn--ghost {
    color: var(--color-text);
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
}

.global-drawer__btn--ghost:hover:not(:disabled) {
    border-color: var(--color-text-muted);
}

/* The one rule in the settings drawer: it sets the last row (Delete view, an
   .global-drawer__rowbtn like every other act) apart from Actions. */
.global-drawer__delete {
    border-top: 1px solid var(--color-border-subtle);
}

/* Staged-save footer: pinned to the bottom of the drawer panel. .global-drawer-body is the flex child that
   grows, so this sibling never scrolls away. It renders ONLY while edits are
   staged, which is what makes the unsaved state readable without a badge. */
.global-drawer__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-smd);
    flex: 0 0 auto;
    padding: var(--spacing-smd) var(--spacing-mdlg);
    background: var(--color-card-bg);
    border-top: 1px solid var(--color-border);
}

.global-drawer__footer-note {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.global-drawer__footer-actions {
    display: flex;
    gap: var(--spacing-sm);
}

/* A checklist dimmed while the switch above it is off (the bills drawer's
   metric cards). The boxes stay live: a click says to turn the switch on first. */
.global-drawer__cols--off {
    opacity: 0.55;
}

/* The hidden field that holds the focus while a refused Save swaps the form
   (typing-sheet.js). It wears .visually-hidden. At 16px a phone does not zoom
   when it takes the focus. */
.global-drawer__focus-holder {
    font-size: var(--font-size-base);
}

/* On a phone every row and button is tall enough for a thumb (44px). */
@media (max-width: 767.98px) {
    .global-drawer__rowbtn,
    .global-drawer__btn {
        min-height: var(--control-h-touch);
    }

    /* A box and its words, such as Main contact, take a thumb. */
    .global-drawer__check-touch {
        display: flex;
        align-items: center;
        min-height: var(--control-h-touch);
    }

    /* The "Show count on tab" switch keeps its size. An unseen square around
       it takes the tap, as in the Inbox settings (texts.css). */
    [data-drawer-section="show-count"] .form-switch .form-check-input {
        position: relative;
    }

    [data-drawer-section="show-count"] .form-switch .form-check-input::before {
        content: "";
        position: absolute;
        inset: calc((100% - var(--control-h-touch)) / 2);
    }
}

/* Platform-wide "add another" tile. `.global-add-tile` is the canonical
   full-width affordance that appends a row to a repeating list or reveals a
   collapsed optional band — the "Add an event" / "Add Role" / "Add competency"
   button that reads as a bordered empty slot rather than a normal button.

       <button type="button" class="global-add-tile">
         <i class="bi bi-plus-lg"></i><span>Add competency</span>
       </button>

   Scope: this is the LIST-GROWING tile. It deliberately does NOT cover ordinary
   primary/secondary actions (those stay Bootstrap `.btn`), nor the small inline
   remove X that pairs with it — that rides the canonical
   `.global-icon-btn --sm --danger` (components/icon-button.css).

   Every value resolves to a token, so the tile inherits per-tenant brand and the
   platform focus ring instead of the Bootstrap blue it was hand-typed against. */

/* ── Canonical component ── neutral card fill, a slightly heavy 1.5px hairline
   so the slot reads as an empty container, and the large-panel corner.

   The hairline binds to --color-border, NOT --color-border-subtle. The tile's
   whole affordance IS its border — there is no fill or label weight carrying it
   — so the edge has to stay visible. --color-border-subtle resolves to
   --color-surface-hover (#e9ecef, 1.19:1 on the white card), lighter than the
   #e5e7eb (1.24:1) this component was hand-typed against, and the
   prefers-contrast: more block in tokens.css only remaps --color-border. Binding
   subtle would have dimmed the resting edge AND left high-contrast users with no
   affordance at all. --color-border is #d0d4db (1.49:1) and darkens to
   --color-border-dark (#232323, 15.72:1) under prefers-contrast. */
.global-add-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    width: 100%;
    padding: var(--spacing-md) var(--spacing-mdlg);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    background: var(--color-card-bg);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition:
        border-color 0.12s ease,
        background-color 0.12s ease;
}

/* The leading glyph sits optically level with the label. */
.global-add-tile i {
    font-size: var(--font-size-base);
    line-height: 1;
}

/* Hover firms the hairline to the action ink and washes the slot with the warm
   action tint every other hover-tinted control already uses. */
.global-add-tile:hover {
    border-color: var(--color-action);
    background: var(--color-action-tint);
}

/* Platform focus treatment (matches .global-icon-btn / .global-segmented): an
   offset outline, not a ring shadow. */
.global-add-tile:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

/* Platform-wide choice tiles. `.global-choice-tiles` / `.global-choice-tile` is the
   canonical way to ask a form question whose answer is one of two or three kinds
   of thing, where the answer changes what the rest of the form asks for.

       <div class="global-choice-tiles" role="group" aria-label="Schedule">
         <button type="button" class="global-choice-tile is-active">
           <i class="bi bi-calendar-event"></i>
           <span class="global-choice-tile__name">One-time</span>
         </button>
         <button type="button" class="global-choice-tile">
           <i class="bi bi-arrow-repeat"></i>
           <span class="global-choice-tile__name">Recurring</span>
         </button>
       </div>

   Scope, against the two controls it sits between. `.global-segmented`
   (components/segmented.css) flips a SETTING — which slice of a list you are
   looking at — and stays small and inline so it reads as chrome. These tiles
   answer a question the record is built around, so they take the full width of
   the field they occupy and carry a glyph: the weight is the point, because the
   fields below rearrange behind the answer. `.global-add-tile`
   (components/add-tile.css) is the other bordered slot in this family and is not
   a choice at all — it grows a list, and nothing about it is ever "active".

   No label rides above this. A segmented control needs one because two bare
   words in a pill track do not say what they are picking between; a pair of
   full-width tiles with glyphs does, and a label on top of them only repeats
   the question the tiles already ask. */

/* ── The track ── equal columns so neither option looks like the default, and
   full width so the pair reads as one control spanning the field rather than
   two buttons that happen to sit together. */
.global-choice-tiles {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: var(--spacing-sm);
    width: 100%;
}

/* ── One option ── the resting state is the same bordered card slot
   .global-add-tile uses, for the same reason: the border is the whole
   affordance, so it binds to --color-border rather than --color-border-subtle
   and stays visible under prefers-contrast. */
.global-choice-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-2xs);
    padding: var(--spacing-smd);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-card-bg);
    color: var(--color-text-muted);
    font: inherit;
    font-size: var(--font-size-sm);
    text-align: left;
    cursor: pointer;
    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast),
        color var(--transition-fast);
}

/* The glyph rides the large-glyph step rather than the tile's own text size: it
   is what makes the pair readable before either word is. */
.global-choice-tile i {
    font-size: var(--font-size-xl);
    line-height: 1;
}

.global-choice-tile__name {
    font-weight: var(--font-weight-medium);
}

/* ── Stacked ── `.global-choice-tiles--stacked` puts one option on each row, each
   a full-width button with the name centred on one line (a glyph is optional
   here: a person's or organisation's name needs none): the shape
   of the stacked `.global-add-tile` buttons in the opportunity drawer, kept a
   choice by the same `is-active` mark. For a narrow drawer where the answers are
   names of people or organisations, which crowd a side-by-side pair. */
.global-choice-tiles--stacked {
    grid-auto-flow: row;
}

.global-choice-tiles--stacked .global-choice-tile {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-mdlg);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-lg);
}

/* The option you are NOT in firms its hairline and darkens its text, so it reads
   as reachable without pretending to be chosen. */
.global-choice-tile:hover {
    border-color: var(--color-action);
    color: var(--color-text);
}

/* The chosen option. The mark is a doubled edge — the border plus the platform
   inset ring in the same ink — rather than a filled panel, which is what keeps
   the pair legible on any tenant's brand instead of resolving to one house
   colour. Defined after :hover so the active tile stays marked while hovered. */
.global-choice-tile.is-active {
    border-color: var(--color-action);
    color: var(--color-action);
    box-shadow: var(--shadow-inset-ring-strong);
}

/* Platform focus treatment (matches .global-add-tile / .global-segmented): an
   offset outline, not a ring shadow. A tile that is a <label> around a hidden
   radio shows the ring when that radio has keyboard focus. */
.global-choice-tile:focus-visible,
.global-choice-tile:has(:focus-visible) {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}


.global-filter-bar {
    --filter-ctrl-h: 36px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-smd);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-md);
}

.global-filters-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
    overflow-x: auto;
    overflow-y: visible;
    overscroll-behavior-x: contain;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.global-filters-row::-webkit-scrollbar {
    display: none;
}

/* Search input with icon. .global-page-search is the ADR-131 canonical name
   (controls-canonicalization Lane 0, shared/components/page_search.html); the
   legacy .global-search-input-wrapper name stays on the same rule so every existing
   consumer that still carries only the old class (not yet migrated onto
   page_search.html) keeps its layout unchanged. */
.global-search-input-wrapper,
.global-page-search {
    position: relative;
    flex: 1 1 260px;
    min-width: 220px;
}

.global-search-input-wrapper .global-filter-control {
    width: 100%;
    padding-left: var(--spacing-2xl);
    /* Tighten the right padding so the clear (×) sits hard against the
       right edge of the field instead of floating inward. */
    padding-right: var(--spacing-sm);
}

.global-search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
    width: 18px;
    height: 18px;
}

/* Loading spinner that swaps in for the magnifier while a search request is
   in flight. Pair with hx-indicator="closest .global-search-input-wrapper" on the
   input: htmx then marks the wrapper .htmx-request, which shows this span
   via the global .htmx-request .htmx-indicator rule. Centered with a margin,
   not translateY — the spin keyframes own the transform property. */
.global-search-spinner {
    position: absolute;
    left: 0.9375rem;
    top: 50%;
    margin-top: calc(-1 * var(--spacing-sm));
    color: var(--color-text-muted);
    pointer-events: none;
}

.global-search-input-wrapper.htmx-request .global-search-icon {
    display: none;
}

/* Base control style. Search fields are pills, matching HubSpot's search
   inputs everywhere they appear (Nick 09-02). */
.global-filter-control {
    height: var(--filter-ctrl-h, 36px);
    min-width: 180px;
    padding: 0 var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-grey-50);
    color: var(--color-text);
    font-size: var(--font-size-md);
    font-family: var(--font-family);
    line-height: 1;
    box-sizing: border-box;
    transition: background-color var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.global-filter-control:hover {
    background: var(--color-grey-100);
}

/* Focus deliberately leaves the resting background alone — flipping it to
   white at the same time as the border and ring reads as a flash. */
.global-filter-control:focus {
    outline: none;
    border-color: var(--color-focus-ring);
    box-shadow: var(--shadow-focus-ring);
}

.global-filter-control::placeholder {
    color: var(--color-text-muted);
}

/* Replace the inconsistent native clear (×) control on type="search" inputs
   with a masked icon matching the muted icon palette. Clearing already works:
   the native "search" event fires on clear/Escape and htmx listens for it. */
.global-filter-control[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    margin-left: auto;
    cursor: pointer;
    background: var(--color-text-muted);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18 6 6 18M6 6l12 12' stroke='black' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18 6 6 18M6 6l12 12' stroke='black' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
}

.global-filter-control[type="search"]::-webkit-search-cancel-button:hover {
    background: var(--color-text);
}

/* Filter select dropdowns - custom chevron. Pill like the search field and
   the buttons beside them, matching HubSpot's filter triggers (Nick 09-02). */
.global-filter-select {
    height: var(--filter-ctrl-h, 36px);
    padding: 0 var(--spacing-xl) 0 var(--spacing-smd);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    font-size: var(--font-size-md);
    background: var(--color-card-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E") right 0.5rem center/1.25rem no-repeat;
    appearance: none;
    cursor: pointer;
    min-width: 90px;
    color: var(--color-text);
    line-height: 1;
    box-sizing: border-box;
    transition: all var(--transition-normal);
}

.global-filter-select:focus {
    outline: none;
    border-color: var(--color-focus-ring);
    box-shadow: var(--shadow-focus-ring);
}

/* Controls hosted in the app header share the standardized control palette
   (see --header-control-* in main.css): solid white, dark text, neutral
   border — org-independent so every tenant's top bar reads identically. The
   base .global-filter-control resting fill is a faint gray; on the dark header that
   reads as muddy, so force pure white here. */
.global-app-header .global-filter-control {
    background-color: var(--header-control-bg);
    color: var(--header-control-fg);
    border-color: var(--header-control-border);
}

.global-app-header .global-filter-control:hover {
    background-color: var(--header-control-hover-bg);
    border-color: var(--header-control-hover-bg);
}

/* ── Header search affordances: white icon, white clear (×), no-flash spinner ──
   On the glass header every search affordance is the same white as the
   placeholder and chrome (var(--header-control-fg)), not the list-page gray.
   All scoped to .global-app-header so the list-page (light background) search keeps
   its gray icon / × / spinner. */
.global-app-header .global-search-icon {
    color: var(--header-control-fg);
}

/* Clear (×) button — white on the header (base mask fill is gray #9ca3af). */
.global-app-header .global-filter-control[type="search"]::-webkit-search-cancel-button,
.global-app-header .global-filter-control[type="search"]::-webkit-search-cancel-button:hover {
    background: var(--header-control-fg);
}

/* The search field's placeholder ("Search") inherits the base muddy-gray
   .global-filter-control::placeholder (#9ca3af) — fine on the old opaque-white pill,
   but low-contrast/hard-to-read over the translucent wine glass. Bring it into
   the same white-frost family as the chrome, i.e. the solid header-control
   foreground. Scoped to .global-app-header so the list-page (light-background) search
   keeps its gray placeholder. */
.global-app-header .global-filter-control::placeholder {
    color: var(--header-control-fg);
    opacity: 1;
}

/* Focus uses the fixed neutral ring, not the brand ring (invisible on a
   brand-colored bar and inconsistent across orgs). */
.global-app-header .global-filter-control:focus {
    border-color: var(--header-control-hover-bg);
    box-shadow: 0 0 0 3px var(--header-control-focus-ring);
}

/* ── Date-filter cluster in a page header ────────────────────────────────────
   The month/year controls and their prev/next arrows, laid out as one evenly
   spaced row. Unscoped on purpose: these render in the page-header toolbar
   slots (My Assignments, My Pay), not in the dark app bar. */
.global-header-date-filters {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Phone: three selects side by side overrun a 361px header, so the cluster
   wraps onto a second line instead of pushing the page sideways. */
@media (max-width: 767.98px) {
    .global-header-date-filters {
        flex-wrap: wrap;
    }

    /* Search boxes, filter pills and selects are 44px tap targets on a phone. */
    :root,
    .global-filter-bar {
        --filter-ctrl-h: var(--control-h-touch);
    }
}

/* Header arrows are not styled here — the calendar's are .global-icon-btn in
   components/date-nav.css. */

/* ── Light-header pickers ──────────────────────────────────────────────────
   The month/year/status/view comboboxes in a page_header.html card or toolbar.
   Their skin is the shared .global-cs--compact (main.css); this sheet only
   sizes them and anchors their menus. */

/* flex: 0 0 auto pins each pill to its own width below. Without it the pills
   stretch to fill the bar, which is what the titleless toolbar shape shows:
   there is no title taking up the left side. */
.global-page-header--card .global-header-cs,
.global-page-header--toolbar .global-header-cs {
    flex: 0 0 auto;
}

/* Sized to the longest label — "All Months", the resting placeholder — with the
   visible chevron (matching .global-filter-select's look) eating into the right side.
   8.5rem is what stops it clipping to "All Month".

   MEASURE THESE IN THE REAL DEPLOYED FONT (Poppins 500 14px, loaded via Google
   Fonts), never a system-font fallback: the fallback under-reports width by
   ~10px, and trusting it once shipped a month pill 6px too tight with
   "September" clipped to "Septembe". */
.global-page-header--card .global-header-cs--month,
.global-page-header--toolbar .global-header-cs--month {
    width: 8.5rem;
}

/* "All Years" (60px) is shorter than month's "All Months" (73px) but still
   needs room for the visible chevron — 6rem clipped it to "All Yea"; 7.5rem
   shows it in full. */
.global-page-header--card .global-header-cs--year,
.global-page-header--toolbar .global-header-cs--year {
    width: 7.5rem;
}

/* Calendar view switcher (Month / Week / Events), declared in
   app/assignments/_calendar_toolbar.html and teleported into this card's row-2
   slot. It is the one .global-header-cs modifier whose width was only ever written
   .app-header-scoped, where it never matched — so it alone fell back to an
   <input>'s intrinsic size and rendered 318px, while --month, --year and
   --status each pin one below. "Events" is shorter than the "All Years" that
   7.5rem already fits with the chevron, so it takes year's width. */
.global-page-header--card .global-header-cs--view,
.global-page-header--toolbar .global-header-cs--view {
    width: 7.5rem;
}

/* The ledger's status filter (payments/partials/_ledger_filters.html). The
   longest label is a comparable length to "All Months" and pays for the same
   visible chevron, so it takes month's 8.5rem.

   The workers roster sized this rule first and no longer draws it: that filter
   became a segmented control on 08-10 and an ordinary saved-view filter on
   08-26 — a Status quick chip on the shared toolbar row, the segmented
   template deleted with it. The bills dashboard drew it too, with a wider
   --status-ramp box for the Ramp rail's "Awaiting Payment", until its status
   combobox was retired for the saved-view chip (08-29). Left at 8.5rem — the
   caller that stayed was measured against it, so re-fitting the width to it is
   its own change. */
.global-page-header--card .global-header-cs--status,
.global-page-header--toolbar .global-header-cs--status {
    width: 8.5rem;
}

/* Panels grow to fit their widest option and anchor to the RIGHT edge of the
   trigger so extra width grows leftward. These pills sit at the right of their
   row, where the base .global-cs-menu's trigger-width panel (left:0;right:0) would
   clip. */
.global-page-header--card .global-header-cs .global-cs-menu,
.global-page-header--toolbar .global-header-cs .global-cs-menu {
    left: auto;
    right: 0;
    width: max-content;
    min-width: 100%;
    overflow-x: hidden;
}

/* ── The dark bar's control height ───────────────────────────────────────────
   28px matches the sidebar org-toggle, so everything across the top strip reads
   as the same control rank. Set as a variable rather than a height because two
   files size the bar's controls from it: .global-filter-control above (the topbar
   search input), and .global-header-btn / .global-header-btn-icon / .global-sidebar-toggle in
   main.css. Those are the only var() readers. tokens.css and notifications.css
   quote the 28px in prose but hardcode their own numbers, so they do NOT follow
   a change made here — grep `var(--filter-ctrl-h`, not the bare name. */
.global-app-header {
    --filter-ctrl-h: 28px;
}

/* No narrow-viewport rule for .global-app-header lives here any more, and none should:
   this file loads BEFORE main.css, which declares `height: var(--header-height)`
   on the same selector at the same specificity, so anything about the bar's
   height written here is silently overruled. The block that used to sit here set
   `flex-wrap: wrap; height: auto` and was half-applied because of exactly that —
   the wrap took, the height did not, so on a phone the bar reflowed onto three
   rows while its box stayed pinned at 40px and rows two and three spilled out
   over whatever was underneath. The header is a single fixed-height row at every
   width (see .global-app-header-actions in main.css); the narrow-viewport give is the
   search box shrinking, which now lives with the rest of its sizing in
   topbar-search.css. */

.global-filter-select:hover {
    border-color: var(--color-text-muted);
}

.global-toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.global-toggle-switch input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    width: 46px;
    height: 26px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--color-border);
    background: var(--color-grey-200);
    position: relative;
    transition: background var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
    outline: none;
}

.global-toggle-switch input[type="checkbox"]::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: var(--radius-pill);
    background: var(--color-card-bg);
    transition: transform var(--transition-normal), background var(--transition-normal), box-shadow var(--transition-normal);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.global-toggle-switch input[type="checkbox"]:checked {
    background: var(--color-action);
    border-color: transparent;
}

.global-toggle-switch input[type="checkbox"]:checked::after {
    transform: translateX(20px);
}

.global-toggle-switch input[type="checkbox"]:focus-visible {
    box-shadow: var(--shadow-focus-ring);
}

@media (max-width: 575.98px) {
    .global-filter-bar {
        padding: var(--spacing-md);
    }

    .global-filters-row {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    .global-search-input-wrapper {
        flex: 1 1 auto;
        min-width: 0;
    }

    .global-status-toggle {
        width: 100%;
        margin-left: 0;
    }

    .global-status-toggle__btn {
        flex: 1;
    }
}

/* Legacy support - map old class names */
.global-filter-bar .form-control,
.global-filter-bar .form-select {
    max-width: 200px;
}

.global-filter-bar .btn {
    white-space: nowrap;
}

/* Advanced-filter builder — the grouped condition list every saved-view drawer
   shows. Markup: shared/components/_filter_builder.html. Behaviour:
   shared/js/filter-builder.js.

   Each condition reads as a sentence ("Service type is Wedding") whose three parts
   are clickable tokens. Rows inside a group are joined by "and"; groups are cards
   joined by "or" — the border is what makes the boolean split readable at a glance.

   Lifted out of features/opportunities/milestones.css when the roster asked for the
   same builder. The rules are unchanged; only the names lost their opp- prefix, which
   the naming charter does not allow on a cross-surface component anyway.

   Shared vocabulary, on purpose: the buttons, inputs, section frame and hint text
   are the drawer content language every saved-view panel wears (.global-drawer__btn,
   __input, __section, __hint — components/drawer-content.css, loaded on every page),
   so the builder reads as part of whichever drawer holds it. */
/* One OR group: everything inside a border ANDs together, borders OR. */
.global-filter-builder-group {
    margin-bottom: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.global-filter-builder-list {
    margin-bottom: var(--spacing-smd);
}

/* Inside a group card the card's own padding closes the gap to the add button, so
   the list gives most of its old air back. */
.global-filter-builder-group .global-filter-builder-list {
    margin-bottom: var(--spacing-xs);
}

/* The two connectors — one quiet chip, two placements. Quiet on purpose: the
   sentences carry the eye, the connector only joins them. */
.global-filter-builder-and,
.global-filter-builder-or {
    padding: 1px var(--spacing-sm);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    background: var(--color-surface-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
}

/* Between rows inside a group card. */
.global-filter-builder-and {
    display: inline-block;
    margin: var(--spacing-2xs) 0 var(--spacing-2xs) var(--spacing-xs);
}

/* Between group cards, sitting in the gutter between their borders. */
.global-filter-builder-or {
    display: inline-block;
    margin: 0 0 var(--spacing-sm) var(--spacing-sm);
}

/* ANDs a condition onto this card. Styled like the sentence tokens, not the drawer's
   block buttons — it belongs to the card's conversational register. */
.global-filter-builder-group__add {
    padding: var(--spacing-2xs) var(--spacing-xsm);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.global-filter-builder-group__add:hover:not(:disabled) {
    color: var(--color-text);
    background: var(--color-surface-hover);
}

/* At a limit the button stays in place and goes quiet, as the drawer's own buttons do. */
.global-filter-builder-group__add:disabled {
    opacity: 0.5;
    cursor: default;
}

.global-filter-builder-group__add:focus-visible {
    outline: 2px solid var(--color-focus-ring);
}

.global-filter-builder-row {
    /* The box a row-wide picker hangs from (see --row below, and the phone rule). */
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-xs);
    padding: var(--spacing-xsm) var(--spacing-xs);
    border-radius: var(--radius-sm);
}

.global-filter-builder-row:hover {
    background: var(--color-surface-subtle);
}

/* Generous line-height: the tokens sit inline and wrap like words, so the sentence
   stays readable when a long value pushes it onto a second line. */
.global-filter-builder-sentence {
    flex: 1 1 auto;
    margin: 0;
    font-size: var(--font-size-sm);
    line-height: 2;
    color: var(--color-text-muted);
}

/* Anchors the token's picker to the token itself. */
.global-filter-builder-anchor {
    position: relative;
    display: inline-block;
}

.global-filter-builder-token {
    padding: var(--spacing-2xs) var(--spacing-xsm);
    font: inherit;
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.global-filter-builder-token:hover {
    background: var(--color-surface-hover);
}

.global-filter-builder-token:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 1px;
}

/* Property and value carry the meaning, so they read solid; the operator is the
   connecting word and stays light. */
.global-filter-builder-token--property,
.global-filter-builder-token--value {
    font-weight: var(--font-weight-medium);
    color: var(--color-action);
    text-decoration: underline;
    text-decoration-color: var(--color-border);
    text-underline-offset: 3px;
}

.global-filter-builder-token--operator {
    color: var(--color-text-muted);
}

/* The limits drawer's count per condition ("36 opportunities"): quiet, at the
   row's far end, before the delete button. Only that host draws it. */
.global-filter-builder-row__count {
    flex: 0 0 auto;
    align-self: center;
    margin-left: auto;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Delete stays out of the way until the row is hovered or the button is focused. */
.global-filter-builder-row__remove {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--control-h-sm);
    height: var(--control-h-sm);
    padding: 0;
    color: var(--color-text-muted);
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    opacity: 0;
}

.global-filter-builder-row:hover .global-filter-builder-row__remove,
.global-filter-builder-row__remove:focus-visible {
    opacity: 1;
}

.global-filter-builder-row__remove:hover {
    color: var(--color-error);
    background: var(--color-error-subtle);
}

.global-filter-builder-row__remove:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

/* Touch has no hover, so the delete button would never appear — keep it visible. */
@media (hover: none) {
    .global-filter-builder-row__remove {
        opacity: 1;
    }
}

/* Token pickers — a small popover hanging off the token you clicked. */
.global-filter-builder-picker {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 240px;
}

.global-filter-builder-picker--narrow {
    width: 170px;
}

/* On a phone the panel fills the screen, so a picker hung off a token near the right
   edge runs past it with no way to scroll over. Narrow screens drop the picker under
   the whole row instead, which always lands inside the panel. */
@media (max-width: 575.98px) {
    .global-filter-builder-anchor {
        position: static;
    }

    .global-filter-builder-picker,
    .global-filter-builder-picker--narrow {
        width: 100%;
    }
}

/* The day count beside its ago / from-now pair needs more than a token's 240px —
   the pair alone is wider, and squeezed, the count box shrinks to its spinner with
   the number out of sight. That picker hangs under the whole row on every screen:
   the phone rule, for one anchor. */
.global-filter-builder-anchor--row {
    position: static;
}

.global-filter-builder-anchor--row > .global-filter-builder-picker {
    width: 100%;
}

.global-filter-builder-picker__list {
    max-height: 260px;
    margin-top: var(--spacing-xs);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.global-filter-builder-picker__group {
    margin: var(--spacing-xsm) 0 var(--spacing-2xs);
    padding: 0 var(--spacing-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.global-filter-builder-picker__option {
    display: block;
    width: 100%;
    padding: var(--spacing-xsm) var(--spacing-sm);
    font-size: var(--font-size-sm);
    text-align: left;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.global-filter-builder-picker__option.is-picked {
    color: var(--color-action);
}

/* "Me" — the value that means whoever is reading. It leads the list, so it gets
   the rule the other rows would otherwise run into. */
.global-filter-builder-picker__option--viewer {
    margin-bottom: var(--spacing-xsm);
    font-weight: var(--font-weight-medium);
    border-bottom: 1px solid var(--color-border-subtle);
}

/* The bolt beside "Me", in the picker's row and on the value token. Sized in em
   so it tracks whatever text it sits beside, and painted the action ink the
   picked row already wears. */
.global-viewer-bolt {
    width: 0.85em;
    height: 0.85em;
    margin-right: var(--spacing-2xs);
    vertical-align: -0.1em;
    color: var(--color-action);
}

.global-filter-builder-picker__pad {
    padding: var(--spacing-sm);
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* A between-date pair shares one picker, each input taking half. */
.global-filter-builder-range {
    display: flex;
    gap: var(--spacing-xsm);
}

/* Child selectors, not the input's own class: the row's children are the two
   dates of a custom range, or a day count beside an ago / from-now pair, and
   naming the host drawer's input class here would tie this sheet to the borrow
   the markup makes. The pair keeps the width its labels need — the host class
   would stretch it to the whole row and squeeze the count to its spinner — and
   the box beside it takes the rest. */
.global-filter-builder-range > input {
    flex: 1 1 0;
    min-width: 0;
}

.global-filter-builder-range > .global-segmented {
    flex: 0 0 auto;
}

.global-filter-builder-add {
    display: block;
    margin-bottom: var(--spacing-sm);
}

/* The All filters panel with nothing set: the line and Add filter under it,
   centered (_filter_builder.html all_filters). */
.global-filter-builder-empty {
    margin: var(--spacing-md) 0 var(--spacing-smd);
    text-align: center;
    font-size: var(--font-size-md);
    color: var(--color-text);
}

.global-filter-builder-add--center {
    margin-inline: auto;
}

/* Add-"or"-group takes the same slot once a first group exists. */
.global-filter-builder-add-group {
    display: block;
    margin-bottom: var(--spacing-sm);
}

/* The line is what separates ending the question from extending it, so the
   commit never reads as a third add. */
.global-filter-builder-commit {
    margin-top: var(--spacing-smd);
    padding-top: var(--spacing-smd);
    border-top: 1px solid var(--color-border);
}

.global-filter-builder-commit .global-drawer__btn {
    width: 100%;
    justify-content: center;
}

/* Conditional-styling builder — the colour rules a saved view paints its grid by.
   Markup: shared/components/_styling_builder.html. Behaviour:
   shared/js/styling-builder.js.

   The rule card and the colour token live here. The tokens and the pickers are
   components/filter-builder.css, because a clause IS that control, and two
   stylesheets for one control would drift. */

/* One rule: a card read top to bottom — its conditions, then, set apart along the
   bottom edge, what it paints. */
.global-styling-builder-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-smd);
}

.global-styling-builder-rule {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-card-bg);
}

.global-styling-builder-rule__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-xs) var(--spacing-xs) 0 var(--spacing-sm);
}

.global-styling-builder-rule__title {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
}

.global-styling-builder-rule__remove {
    padding: var(--spacing-2xs) var(--spacing-xs);
    color: var(--color-text-muted);
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.global-styling-builder-rule__remove:hover {
    color: var(--color-error);
    background: var(--color-error-subtle);
}

.global-styling-builder-rule__remove:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

.global-styling-builder-rule__when {
    padding: var(--spacing-xs) var(--spacing-sm) var(--spacing-sm);
}

/* One clause to a line. The line is the box every picker inside it hangs from, so
   a picker opened off the last token still lands inside the drawer. */
.global-styling-builder-line {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-2xs);
    padding: var(--spacing-2xs) 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.global-styling-builder-line .global-filter-builder-anchor {
    position: static;
}

.global-styling-builder-line .global-filter-builder-picker,
.global-styling-builder-line .global-filter-builder-picker--narrow {
    width: 100%;
}

.global-styling-builder-line .global-filter-builder-token {
    text-align: left;
}

/* "When", "and", "Paint" — one column wide, so the clauses line up under each
   other. */
.global-styling-builder-line__lead {
    flex: 0 0 var(--spacing-2xl);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* The result: along the bottom of the card, on the card's quieter ground. */
.global-styling-builder-rule__result {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--color-surface-subtle);
    border-top: 1px solid var(--color-border);
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

/* The colour token wears the fill the cell will wear, so the rule shows its own
   answer rather than naming it. The four slots are the platform's and nothing else
   (Nick's rule, 2026-09-02) — the same pairs object-grid.css paints a cell with. */
.global-styling-builder-token--tone {
    font-weight: var(--font-weight-medium);
    background: var(--styling-tone-bg);
    color: var(--styling-tone-text);
    border: 1px solid transparent;
}

.global-styling-builder-token--tone:hover {
    /* Filter tokens light up on hover; this one already carries a fill, so it
       draws its own edge instead of trading the fill for the hover grey. */
    background: var(--styling-tone-bg);
    border-color: var(--styling-tone-text);
}

/* A dot in the pick list, where the option's own row has to stay readable. */
.global-styling-builder-swatch::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: var(--spacing-xs);
    vertical-align: -1px;
    background: var(--styling-tone-text);
    border-radius: var(--radius-pill);
}

.is-tone-success {
    --styling-tone-bg: var(--color-success-bg);
    --styling-tone-text: var(--color-success-text);
}

.is-tone-warning {
    --styling-tone-bg: var(--color-warning-bg);
    --styling-tone-text: var(--color-warning-text);
}

.is-tone-danger {
    --styling-tone-bg: var(--color-error-subtle);
    --styling-tone-text: var(--color-error-text);
}

.is-tone-info {
    --styling-tone-bg: var(--status-info-bg);
    --styling-tone-text: var(--color-info);
}

/* A further condition's own small delete, at the end of its line. */
.global-styling-builder-condition__remove {
    margin-left: auto;
    padding: 0 var(--spacing-2xs);
    color: var(--color-text-muted);
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.global-styling-builder-condition__remove:hover {
    color: var(--color-error);
    background: var(--color-error-subtle);
}

.global-styling-builder-condition__remove:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

/* Quick search widget for the dark header bar (Phase 2, P2-L1). Round 3
   (Nick: "we want to have the full searchbar not just an icon or anything.
   Make it a good size"): an always-visible field, not a collapsed magnifier
   (interface/templates/shared/components/topbar_search.html) — focusing the
   field opens a panel of matches under it. Sized off a live HubSpot
   capture (scratchpad/hubspot-ref/ui-2026-07-24/geometry.json): a 550px rest
   width and an 8px radius, both wider/rounder than this bar's other controls
   (.global-filter-control's sitewide default is 6px) — scoped to this widget only,
   not a sitewide radius change. Reuses .global-filter-control / .global-search-icon
   (filter-bar.css) for the field itself, so it inherits the header's
   white-veil palette via the existing .app-header-scoped overrides and
   already sits inside the SB control height idiom (28px on this bar) — this
   file only adds the layout wrapper and the results panel those page-level
   classes don't already cover.

   .global-topbar-search deliberately does NOT use .global-search-input-wrapper: that
   class carries a page-level flex:1 1 260px/min-width:220px sizing meant for
   a list page's own full-width search bar. The bar widget instead shrinks to
   as little as 240px on narrow viewports and never drops to an icon-only
   state — do not reintroduce one. No focus-widening: the results panel
   already covers the focused state, so the field itself stays a fixed size.

   The flex-basis lives on .global-topbar-search (the actual flex item inside
   .global-app-header), not on .global-topbar-search__form: a nested flex container
   with its own flex-basis does not reliably propagate that size out to its
   parent's flex layout, so the outer wrapper needs the explicit sizing and
   the form just fills it (width: 100%). */
.global-topbar-search {
    display: flex;
    align-items: center;
    flex: 0 1 550px;
    max-width: 560px;
    min-width: 240px;
}

/* On a phone the 240px floor is the whole problem: the bar's other two items
   (the menu toggle and the never-compressing action cluster) leave less than
   that, and a flex item cannot shrink past its min-width, so the search was
   pushed onto a line of its own and the actions onto a third. Below 576px it
   gives instead — the field takes the space that is left, however little that
   is, and the bar stays the single 40px row everything else is measured
   against. Same idiom the page-level filter bar uses at this breakpoint. */
@media (max-width: 575.98px) {
    .global-topbar-search {
        flex: 1 1 auto;
        min-width: 0;
    }
}

.global-topbar-search__form {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    width: 100%;
}

.global-topbar-search__form .global-filter-control {
    flex: 1 1 auto;
    min-width: 0;
    padding-left: var(--spacing-2xl);
    padding-right: var(--spacing-md);
}

/* ── In-flight spinner ───────────────────────────────────────────────────────
   Same handoff the list pages use (.global-search-spinner in filter-bar.css): the
   input carries hx-indicator="closest .global-topbar-search__form", so htmx
   marks the form .htmx-request. Every rule filter-bar.css scopes to
   .global-search-input-wrapper has to be spelled again here, because this widget
   deliberately does not use that class (see the note at the top of this file).
   White like the rest of the bar's chrome.

   The dim opt-out comes first. The global .htmx-request rule (main.css) fades
   and deadens whatever htmx marks; here that is the form, and the results
   panel is inside it, so a person reading the matches watched them go
   translucent and unclickable on every keystroke's request. The spinner alone
   says a request is out. */
.global-topbar-search__form.htmx-request {
    opacity: 1;
    pointer-events: auto;
}

/* No-flash magnifier ↔ spinner handoff. Both glyphs stay in the layout and
   swap by opacity on a 0.4s delay (instant on release), so a search that
   answers inside 0.4s — the normal case — flips nothing at all. Matched to the
   magnifier's exact size and position so the swap never jumps. */
.global-topbar-search__form .global-search-spinner {
    display: inline-block;
    left: 0.875rem;
    width: 18px;
    height: 18px;
    margin-top: calc(-1 * var(--spacing-sm));
    color: var(--header-control-fg);
    opacity: 0;
    transition: opacity 0s;
}

.global-topbar-search__form.htmx-request .global-search-spinner {
    opacity: 1;
    transition: opacity 0s linear 0.4s;
}

.global-topbar-search__form .global-search-icon {
    opacity: 1;
    transition: opacity 0s;
}

.global-topbar-search__form.htmx-request .global-search-icon {
    display: block;
    opacity: 0;
    transition: opacity 0s linear 0.4s;
}

/* ── Results panel ───────────────────────────────────────────────────────────
   The typeahead's matches, swapped in by htmx and shown while the field has
   focus (interface/templates/shared/components/topbar_search.html). It hangs
   off .global-topbar-search__form, which is the position:relative box, so it
   lines up with the field and matches its width on every screen size. Same
   popup treatment as .global-cs-menu (main.css): white card, hairline border,
   --radius-md corners, soft shadow, and its own scroll once the list gets tall — so a long
   list never grows the bar or runs off a short screen. The bar's own controls
   are painted from the dark --header-control-* palette, but this panel sits
   BELOW the bar on the page surface, so it uses the page's light tokens like
   every other popup. */
.global-topbar-search__panel {
    position: absolute;
    top: calc(100% + 0.375rem);
    left: 0;
    right: 0;
    z-index: var(--z-dropdown);
    /* Rows carry a name, a status, and a meta line now, so the old 26rem cut
       the second group in half. */
    max-height: min(70vh, 40rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--spacing-xs);
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.global-topbar-search__group + .global-topbar-search__group {
    border-top: 1px solid var(--color-border);
    margin-top: var(--spacing-xs);
    padding-top: var(--spacing-xs);
}

.global-topbar-search__group-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--spacing-sm);
    margin: 0;
    padding: var(--spacing-xsm) var(--spacing-sm) var(--spacing-xs);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.global-topbar-search__row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xsm) var(--spacing-sm);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    text-decoration: none;
}

/* The lit row (.is-active, set by the server on the first row and by the
   Alpine component). The mouse moves .is-active as the arrow keys do
   (topbar-search.js point), so hover has no colour of its own and one row is
   lit at a time (Nick, 11-10). */
.global-topbar-search__row.is-active {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

.global-topbar-search__row-icon {
    flex-shrink: 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.global-topbar-search__row-avatar {
    flex-shrink: 0;
}

/* min-width: 0 lets the long-text truncation below actually kick in — without
   it the flex child refuses to shrink past its content. The row is two stacked
   lines now (name + status, then the meta line), so this column stacks and the
   old baseline alignment moves up to the title line. */
.global-topbar-search__row-text {
    display: flex;
    flex-direction: column;
    gap: 0.0625rem;
    min-width: 0;
    flex: 1 1 auto;
}

.global-topbar-search__row-line {
    display: flex;
    align-items: center;
    gap: var(--spacing-xsm);
    min-width: 0;
}

.global-topbar-search__row-title {
    font-size: var(--font-size-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The matched part of a row, in the title or down in the meta line. A <mark> is
   the honest element for "this is why you see this row", but its yellow crayon
   default has no place on the panel — weight carries it instead. Bootstrap also
   pads .mark/mark, which pushed the matched letters apart and split words
   ("Ka rla"), so that padding goes too. */
.global-topbar-search__panel mark {
    background: none;
    color: inherit;
    padding: 0;
    font-weight: var(--font-weight-medium);
}

.global-topbar-search__row-line .global-badge {
    flex-shrink: 0;
}

.global-topbar-search__row-meta {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The money on a bill row, held to the right edge so a column of amounts lines
   up no matter how long the names are. */
.global-topbar-search__row-amount {
    flex-shrink: 0;
    margin-left: auto;
    font-size: var(--font-size-xs);
}

.global-topbar-search__see-all {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}


/* ── Tabs ── the house segmented control over the results (Nick, 11-10). It
   holds four tabs at most: past four, the last kinds fold into More, so the
   row never scrolls sideways at 390 or 1440 px. The row clips nothing, so the
   More menu can drop over the results. */
.global-topbar-search__tabs {
    display: flex;
    padding: var(--spacing-xs) var(--spacing-xs) var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--color-border);
}

/* ── A person's card ── their threads, leads, bookings and bills as small
   links under their row, lined up with the name: the row's own inset, the
   face and the gap after it. */
.global-topbar-search__chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    padding: 0 var(--spacing-sm) var(--spacing-sm) calc(var(--spacing-sm) + var(--spacing-lg) + var(--spacing-sm));
}

.global-topbar-search__chip {
    text-decoration: none;
}

/* One lit option at a time: a link in a card lights like a row does. */
.global-topbar-search__chip.is-active {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

/* ── Recent records ── Clear sits at the right end of the Recent heading. */
.global-topbar-search__clear {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: var(--font-size-xs);
    letter-spacing: normal;
    text-transform: none;
    color: var(--color-text-muted);
    text-decoration: underline;
    cursor: pointer;
}

.global-topbar-search__clear:hover,
.global-topbar-search__clear:focus-visible {
    color: var(--color-text);
}

/* ── Cancel ── only the phone's full-screen search shows it (main.css). */
.global-topbar-search__cancel {
    display: none;
}


:root {
    --role-tile-height: 52px;
    --role-tile-gap: var(--spacing-xsm);
    /* Roles section holds ~3 tile rows, then scrolls — so the card never grows
       with the role count (same "list scrolls, frame stays put" idea as the
       sidebar nav). 3 rows + 2 gaps + the section's --spacing-smd padding × 2 (1.5rem). */
    --role-section-h: calc(var(--role-tile-height) * 3 + var(--role-tile-gap) * 2 + 1.5rem);
    /* Date banner floor. A dateless card renders the strip too (icon over a blank
       span — the template's config-not-data contract), and this floor is what makes
       the blank strip exactly a filled one's height: one text line at the strip's
       own type (--font-size-sm × the inherited --line-height) + --spacing-sm padding × 2
       + the 1px border-bottom, which border-box counts inside min-height. */
    --card-banner-h: calc(var(--font-size-sm) * var(--line-height) + 1rem + 1px);
    --role-tile-open-bg: var(--color-page-bg);
    --role-tile-open-border: var(--color-border);
    --role-tile-filled-bg: color-mix(in srgb, var(--color-action-pressed) 10%, white);
    --role-tile-filled-border: color-mix(in srgb, var(--color-action-pressed) 45%, white);
    --role-tile-mine-bg: color-mix(in srgb, var(--color-action) 10%, white);
    --role-tile-mine-border: var(--color-action);
    /* Local stacking INSIDE a card — deliberately not the app-level --z-* ladder,
       which starts at 1020 and would lift a card's internals over the sidebar.
       The roster arrows and the progress panel share this one value on purpose:
       equal z-index means DOM order breaks the tie, and the panel comes later,
       so it covers the arrows whenever it is open. Changing this to two separate
       values re-opens that fight — see the note on .opportunities-card__roles-arrow. */
    --z-card-overlay: 1;
}

/* Card grid layout — 3 columns on desktop (sidebar closed), 2 with sidebar open */
.opportunities-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
}

@media (max-width: 1199.98px) {
    .opportunities-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767.98px) {
    .opportunities-card-grid {
        grid-template-columns: 1fr;
    }
}

/* When sidebar is open, use auto-fill so column count adapts to available space.
   400px minimum is what the roster row needs to stay readable: a full-width row
   carries a role name, whoever is on it, the pay and the location at ~370px of
   usable width, and truncates the name first below that. (It used to be sized for
   a 2-up sub-grid at ~185px per tile — that layout is gone.) */
@media (min-width: 768px) {
    /* Wide screens only: a phone hides the sidebar without collapsing it, so an
       unscoped rule here beat the phone's one-column rule above and a 400px card
       ran off a 393px screen (test_phone_list_pages). */
    .global-app-layout:not(.is-sidebar-collapsed) .opportunities-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    }
}

/* Outer wrapper — establishes the positioning context for the referrer avatar
   WITHOUT clipping its pulse glow. .opportunities-card itself keeps overflow:hidden so
   inner children honor the rounded corners. The grid item is this wrapper. */
.opportunities-card-container {
    position: relative;
    min-width: 0; /* Prevent grid blowout — inherited by .opportunities-card visual. */
}

/* A card fills its grid cell, so the cards in one row are one height whatever
   their names hold: one line or two, a second line or none (Nick 08-26). The
   extra room goes to the header, so the date row and roles line up. */
.opportunities-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    min-width: 0;
    transition: box-shadow 0.15s ease;
}

.opportunities-card > a {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

/* Referral avatar in top-right of every booking card. The avatar lives
   OUTSIDE .opportunities-card so a future overflow:hidden on .opportunities-card can never clip it.
   PLACEMENT ONLY: the circle (radius, overflow clip) and the `img` fill rule are
   `.global-avatar` in components/avatar.css — the raw 999px that used to sit
   here was a second copy of --radius-pill, not a different value. Its tooltip
   is the shared portal bubble (accessibility.js), which needs nothing local. */
.opportunities-card-container .opportunities-card__referral-avatar {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    z-index: var(--z-raised);
    width: 1.85rem;
    height: 1.85rem;
    min-width: 1.85rem;
    font-size: var(--font-size-2xs);
    cursor: default;
    pointer-events: auto;
    border: 2px solid var(--color-card-bg);
}

.opportunities-card__booking-code {
    color: var(--color-grey-600);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-md);
    margin-right: var(--spacing-2xs);
}

.opportunities-card:hover {
    box-shadow: var(--shadow-md);
}

.opportunities-card__header {
    flex: 1 0 auto;
    background: var(--color-card-bg);
    color: var(--color-text);
    padding: var(--spacing-smd) var(--spacing-md);
    border-bottom: 1px solid var(--color-grey-100);
    border-radius: var(--radius-card) var(--radius-card) var(--radius-none) var(--radius-none);
}

.opportunities-card__title {
    display: block;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    line-height: 1.3;
    color: var(--color-text);
}

.opportunities-card__subtitle {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--color-grey-600);
    line-height: 1.3;
}

/* Date row — centered bold, on a NEUTRAL band.

   The band, its border and its clock were Tailwind indigo literals (#eef2ff,
   #e0e7ff, #6366f1) sitting one row under a header that draws the org's own
   colour, in an app where every tenant picks that colour — the default is wine
   and the org running this grid is green, so indigo matched nothing on either.
   Laurel 08-10: "the background color on the event time... it just doesn't really
   look good or match anything else on the platform at all."

   --color-header-band is the platform's own faint band and --color-border its own
   hairline, so the strip reads as structure — the line between who/what and the
   roster — and leaves colour to the brand and to role status. */
.opportunities-card__date-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    min-height: var(--card-banner-h);
    background: var(--color-header-band);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-grey-700);
    border-bottom: 1px solid var(--color-border);
}

.opportunities-card__date-row i {
    font-size: var(--font-size-md);
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

/* The roster — ONE role per row, always. Fixed height (min == max == 3 rows) so the
   card keeps a uniform height AND never stretches with the role count: extra roles
   scroll inside this section, like the sidebar nav. min-height also reserves the
   footprint for the progress panel that overlays this region (inset: 0).

   Single column is not a setting any more. The 2-up option split a 400px card into
   ~185px tiles, and at that width a row can hold a name or a person, not both — the
   whole reason the tile beneath it was three different shapes. Laurel 08-10: "get rid
   of the 2 column stuff, we are not doing that anymore... which should help us be able
   to have more space for a nicer UI." The card_roles_layout preference went with it.

   Rows are a FIXED track, not minmax(..., auto). With an auto maximum the default
   content distribution stretched short rosters to fill min-height, so a two-role
   card rendered two tall blocks instead of two rows. align-content: start parks the
   rows at the top instead of spreading them. Row text is nowrap+ellipsis below, so
   nothing inside a row can outgrow the track. */
.opportunities-card__roles {
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: var(--role-tile-height);
    align-content: start;
    gap: var(--role-tile-gap);
    padding: var(--spacing-smd);
    min-height: var(--role-section-h);
    max-height: var(--role-section-h);
    overflow-y: auto;
    overscroll-behavior: contain;
    /* Scrollbar hidden; the hover arrows below are the affordance (sidebar nav
       convention). Firefox. */
    scrollbar-width: none;
    transition: opacity 0.2s ease;
}

/* Nobody on this opportunity yet needs no rule of its own: the section above is
   already min-height == max-height, so an empty grid holds the same space as a
   full one. That reserved height is what keeps a role-less card the same size as
   its neighbours, and it is all this case wants — no label, no centring. */

/* Chrome/Safari half of the hidden scrollbar. */
.opportunities-card__roles::-webkit-scrollbar {
    display: none;
}

/* Roster scroll arrows — the sidebar nav pattern (sidebar.css), driven by the
   same skillbridge.hoverScroll component.

   --z-card-overlay is load-bearing in BOTH directions and must stay at 1.
   Raised off auto for the UP arrow specifically: it precedes the scrolled roster
   in the DOM, and the tile that used to fill these rows was position:relative, so
   at auto it painted over the arrow and ate the hover — measured then,
   elementFromPoint at the up arrow's centre returned .opportunities-role-tile--open. The row
   that replaced that tile (.opportunities-card__role-row) is static and no longer competes,
   but the value stays: the DOWN arrow shares this rule, and the progress panel
   that overlays this region uses the same token and comes after these in the DOM,
   so the tie is what keeps the panel on top while it's open — measured too, with
   the panel present both arrow centres return .opportunities-card__progress-panel. Raising
   this past 1 re-opens that fight; dropping it to auto re-opens the first one for
   any row treatment that takes a position. */
.opportunities-card__roles-arrow {
    position: absolute;
    left: 0;
    right: 0;
    height: 28px;
    z-index: var(--z-card-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    cursor: pointer;
    color: var(--color-text-muted);
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.opportunities-card__roles-arrow:hover {
    opacity: 1;
}

/* The arrow gradients fade INTO the card surface — keep them on the same token
   as .opportunities-card's background or the fade shows a seam. */
.opportunities-card__roles-arrow--up {
    top: 0;
    background: linear-gradient(to bottom, var(--color-card-bg) 40%, transparent);
}

.opportunities-card__roles-arrow--down {
    bottom: 0;
    background: linear-gradient(to top, var(--color-card-bg) 40%, transparent);
}

/* ==========================================================================
   Roster row (opportunities-card__role-row) — one role, one 52px row, one shape
   ==========================================================================

   Card-scoped on purpose. The .role-tile-* block this replaces is still the
   opportunity DETAIL roster's (role-tiles.css serves .opportunities-detail__role-tile too),
   which wants a taller centred tile — restyling those modifiers here would have
   moved that page along with this one.

   The shape is fixed before the content is known: rail, face, name over person,
   facts. Whatever a row has to say lands in one of those slots or is not shown,
   so a roster of eight reads as eight of the same thing. Laurel 08-10: "just
   standardize the height please, so if you are going to put the name under then
   just do that."

   Colour carries exactly one meaning here — status, on the 3px rail and its chip.
   The old tile tinted its whole surface brand-green for every filled role ("why is
   the whole thing green???"), which spent the loudest signal on the most ordinary
   state and left nothing for the roles that actually need a look. */

.opportunities-card__role-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding-right: var(--spacing-sm);
    border: 1px solid var(--color-border-hairline);
    border-radius: var(--radius-card);
    background: var(--color-surface-subtle);
    /* The row is a fixed 52px grid track; anything that would grow it is clipped
       rather than allowed to push the roster off its 3-row cap. */
    overflow: hidden;
    transition: background-color 0.15s, border-color 0.15s;
}

/* Your own role. The one tint left on the row, and it says whose it is, not what
   state it is in — status stays on the rail. On My Assignments that is normally a
   single row per card, so it reads as "this one is yours" instead of as a colour
   the whole roster shares. */
.opportunities-card__role-row--mine {
    background: var(--role-tile-mine-bg);
    border-color: var(--role-tile-mine-border);
}

/* The name's ::after stretches its link over the row;
   the pill, the "+N" and directions paint above it by DOM order. */
.opportunities-card__role-row[data-linked] {
    position: relative;
}

.opportunities-card__role-link {
    color: inherit;
    text-decoration: none;
}

.opportunities-card__role-link::after {
    content: "";
    position: absolute;
    inset: 0;
}

.opportunities-card__role-row[data-linked] .opportunities-card__role-pay--interactive,
.opportunities-card__role-row[data-linked] .opportunities-card__role-skill--more,
.opportunities-card__role-row[data-linked] a.opportunities-card__role-mode {
    position: relative;
}

.opportunities-card__role-row[data-linked]:hover {
    border-color: var(--color-border);
}

.opportunities-card__role-row--mine[data-linked]:hover {
    background: color-mix(in srgb, var(--color-action) 18%, white);
    border-color: var(--color-action);
}

/* Status, as a rail rather than a fill: the same information the old tile shouted
   with its background, in 3px at the edge where the eye can run down it. */
.opportunities-card__role-rail {
    width: 3px;
    align-self: stretch;
    flex-shrink: 0;
    background: var(--color-border);
}

.opportunities-card__role-row--assigned .opportunities-card__role-rail,
.opportunities-card__role-row--completed .opportunities-card__role-rail {
    background: var(--color-success);
}

.opportunities-card__role-row--invited .opportunities-card__role-rail,
.opportunities-card__role-row--pending .opportunities-card__role-rail {
    background: var(--color-warning);
}

.opportunities-card__role-row--declined .opportunities-card__role-rail,
.opportunities-card__role-row--no_show .opportunities-card__role-rail {
    background: var(--color-error);
}

/* The shift is over but the files are not in — the one row on a finished booking
   that is still asking for something, so it is the one that keeps a colour. Must
   stay BELOW the --completed rule above: same specificity, and this row carries
   both classes, so source order is what decides.

   The same amber as invited/pending on purpose, not by accident: on this rail
   amber has always meant "waiting on somebody", and a fourth hue would make the
   roster a legend to memorise. The two are told apart by the rest of the row —
   an invited row carries its chip and a name-less seat, a files-due row carries
   neither. */
.opportunities-card__role-row--files-due .opportunities-card__role-rail {
    background: var(--color-warning);
}

/* Finished work recedes. Everything on a settled row steps back together — rail
   included — so a roster of eight reads as "these two still want something" at a
   glance instead of eight rows of equal weight. Laurel 08-10: "some kind of
   indicator or something showing whether or not the work has been completed."
   Hover restores it, which is what keeps the fade reading as a decision rather
   than as a row that failed to load. */
.opportunities-card__role-row--settled {
    opacity: 0.62;
}

.opportunities-card__role-row--settled[data-linked]:hover {
    opacity: 1;
}

/* Positioning context for the tick, and the row's left offset with it. This is
   what retired .opportunities-card__role-avatar: that class existed only to hold the
   margin, and the badge overhangs the circle, so the circle can no longer be the
   element that owns the spacing. */
.opportunities-card__role-face {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    margin-left: var(--spacing-xsm);
}

/* Done, as a mark on the face. Its own disc rather than bi-check-circle-fill,
   whose knocked-out check would show the avatar through it. */
.opportunities-card__role-tick {
    position: absolute;
    right: -1px;
    bottom: -1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: var(--radius-pill);
    background: var(--color-success);
    color: var(--color-card-bg);
    font-size: var(--font-size-2xs);
    line-height: 1;
}

/* Name over person. min-width: 0 is what lets the ellipsis below actually fire —
   a flex item defaults to min-content and would push the facts column off the row
   instead of truncating. */
.opportunities-card__role-who {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.opportunities-card__role-name {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.opportunities-card__role-line {
    display: flex;
    align-items: center;
    gap: var(--spacing-xsm);
    min-width: 0;
    line-height: 1.3;
}

.opportunities-card__role-person {
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted-cool);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Nobody on it yet — quieter than a name, because an empty seat is a fact, not a
   person. Laurel 08-10: it says "Unassigned", not "Nobody yet".

   It is also the one label on this line that must never clip. A worker's name
   truncates gracefully because the first half still identifies them; "Unassig…"
   is one word losing its ending and reads as a rendering fault. So this holds its
   width and the requirement pills beside it give theirs up instead. */
.opportunities-card__role-person--none {
    color: var(--color-text-muted);
    flex-shrink: 0;
}

/* The chip only appears on a row that wants something: open, invited, pending,
   declined, no-show. Assigned and completed carry a green rail and no chip. */
.opportunities-card__role-chip {
    flex-shrink: 0;
    white-space: nowrap;
}

.opportunities-card__role-chip--invited,
.opportunities-card__role-chip--pending {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
}

.opportunities-card__role-chip--declined,
.opportunities-card__role-chip--no_show {
    background: var(--color-error-subtle);
    color: var(--color-error);
}

/* What an empty seat is asking for. Same pill geometry as the status chip and
   deliberately the same neutral fill: a requirement is a fact about the role, not
   a state to act on, so it must not compete with the invited/declined chips that
   are.

   The only thing on this line that gives up width, and the last resort rather
   than the plan: the template ships ONE pill precisely so the common case has
   room to render whole. What this handles is the outlier name — the cap holds it
   to 7rem, and min-width: 0 lets it clip instead of pushing "+2" or the pay off
   the row. The seat label and the "+N" hold their size against it. */
.opportunities-card__role-skill {
    display: inline-block;
    min-width: 0;
    max-width: 7rem;
    padding: 0 var(--spacing-xsm);
    border-radius: var(--radius-pill);
    font-size: var(--font-size-2xs);
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: var(--color-grey-100);
    color: var(--color-grey-700);
}

/* "+2" names the rest rather than being a third requirement — no fill, so it does
   not read as one more thing the seat wants, and the help cursor says the names
   are one hover away instead of one page away. Never shrinks: a clipped count is
   a lie about how much is hidden, where a clipped skill name still reads as the
   name it is. */
.opportunities-card__role-skill--more {
    flex-shrink: 0;
    padding-left: var(--spacing-2xs);
    padding-right: var(--spacing-2xs);
    background: transparent;
    color: var(--color-text-muted);
    cursor: help;
}

/* Right column: the two facts that change a decision — what it pays, and when it
   is due. Right-aligned so the numbers stack into a column the eye can scan
   down, which is the whole point on a booking whose seats differ by date alone.
   Where the seat is moved to the person's line to make room. */
.opportunities-card__role-facts {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    flex-shrink: 0;
    text-align: right;
}

.opportunities-card__role-pay {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
}

.opportunities-card__role-pay--interactive {
    cursor: pointer;
}

.opportunities-card__role-pay--interactive:hover {
    color: var(--color-action);
}

/* When the seat's own work is due, under the pay. It is the one fact that tells
   two seats of the same role apart, and until now it was on the Billing page and
   nowhere on the booking: twelve rows reading "Video Editor / Unassigned / $200"
   with no way to say which was which. Tabular figures so the dates stack into a
   column under the money that already does. */
.opportunities-card__role-due {
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted-cool);
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
    white-space: nowrap;
}

/* Past its date with the files still out — the same amber the rail has already
   gone, on the fact that says why. */
.opportunities-card__role-due--late {
    color: var(--color-warning-text);
}

/* Where the seat is, on the person's line: the facts column's second slot is the
   due date's now. Never shrinks, so the requirement pill beside it stays the one
   thing on the line that gives up width. */
.opportunities-card__role-mode {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2xs);
    flex-shrink: 0;
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted-cool);
    line-height: 1.3;
    white-space: nowrap;
    text-decoration: none;
}

a.opportunities-card__role-mode:hover {
    color: var(--color-action);
}

.opportunities-card__role-mode i {
    font-size: var(--font-size-2xs);
}

.opportunities-property-filter-option {
    display: flex;
    align-items: center;
    gap: var(--spacing-xsm);
    font-size: var(--font-size-sm);
    color: var(--bs-gray-700);
    cursor: pointer;
    padding: var(--spacing-2xs) 0;
}

.opportunities-property-filter-option input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--color-action);
}

.opportunities-card__progress-toggle {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-text);
    color: var(--color-neutral-ink-fg);
    border: none;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-button);
    cursor: pointer;
    transition: background-color 0.15s;
    flex-wrap: nowrap;
    overflow: hidden;
}

.opportunities-card__progress-toggle:hover {
    background: var(--color-grey-700);
}

.opportunities-card__stage-name {
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
    flex-shrink: 0;
}

.opportunities-card__stage-dots {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
    flex-wrap: nowrap;
    min-width: 0;
}

.opportunities-card__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    background: transparent;
    flex-shrink: 0;
}

.opportunities-card__dot--completed {
    background: var(--ms-done);
    border-color: var(--ms-done);
}

.opportunities-card__dot--active {
    background: var(--color-action);
    border-color: var(--color-action);
    animation: card-dot-pulse 1.5s ease-in-out infinite;
}

.opportunities-card__dot--pending {
    /* transparent with faint border — default state */
}

.opportunities-card__dot-connector {
    width: 12px;
    height: 2px;
    background: var(--color-border);
    flex-shrink: 0;
}

.opportunities-card__dot-connector--completed {
    background: var(--ms-done);
}

.opportunities-card__dot-connector--active {
    background: linear-gradient(90deg, var(--color-success), var(--color-action));
}

@keyframes card-dot-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    50% { box-shadow: 0 0 0 3px rgba(99, 102, 241, 0); }
}

.opportunities-card__roles-wrap {
    position: relative;
}

.opportunities-card__roles.is-hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Progress panel — overlays the roles area. Shares --z-card-overlay with the
   roster arrows so DOM order decides, and this comes later. */
.opportunities-card__progress-panel {
    position: absolute;
    inset: 0;
    padding: var(--spacing-smd) var(--spacing-md);
    background: var(--color-grey-50);
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: var(--z-card-overlay);
    display: flex;
    flex-direction: column;
}

/* With the team field switched off for the org there is no roles section under the
   panel, so there is no reserved height to overlay and an absolute panel would have
   nothing to sit on — it flows normally instead. This used to be the no-roles case
   too; since 08-10 a role-less card renders an empty roles region, so the panel has
   a sibling there and keeps overlaying it. */
.opportunities-card__roles-wrap > .opportunities-card__progress-panel:only-child {
    position: relative;
}

/* Transition classes for Alpine x-transition */
.opportunities-progress-enter,
.opportunities-progress-leave {
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.opportunities-progress-enter-from {
    opacity: 0;
    transform: translateY(-8px);
}

.opportunities-progress-enter-to {
    opacity: 1;
    transform: translateY(0);
}

.opportunities-card__progress-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.opportunities-card__progress-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    flex-wrap: nowrap;
}

.opportunities-card__milestone-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.opportunities-card__milestone-actions {
    display: flex;
    gap: var(--spacing-xs);
    flex-shrink: 0;
    margin-left: auto;
}

.opportunities-card__milestone-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-card-bg);
    color: var(--color-grey-600);
    font-size: var(--font-size-2xs);
    cursor: pointer;
    padding: 0;
    transition: all 0.15s ease;
}

.opportunities-card__milestone-btn:hover {
    border-color: var(--color-action);
    color: var(--color-action);
    background: color-mix(in srgb, var(--color-action) 8%, white);
}

.opportunities-card__milestone-btn--skip:hover {
    border-color: var(--color-text-muted);
    color: var(--color-text-muted);
    background: var(--color-grey-50);
}

.opportunities-card__milestone-btn.is-loading {
    opacity: 0.5;
    pointer-events: none;
}

.opportunities-card__milestone-btn.is-done {
    border-color: var(--color-success);
    background: var(--color-success);
    color: #fff;
}

.opportunities-card__progress-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-border);
    flex-shrink: 0;
}

.opportunities-card__milestone--completed { color: var(--color-grey-700); }
.opportunities-card__milestone--completed .opportunities-card__progress-dot { background: var(--ms-done); }

.opportunities-card__milestone--in_progress { color: var(--color-grey-700); }
.opportunities-card__milestone--in_progress .opportunities-card__progress-dot { background: var(--color-action); }

.opportunities-card__milestone--scheduled { color: var(--color-grey-700); }
.opportunities-card__milestone--scheduled .opportunities-card__progress-dot { background: var(--color-warning); }

.opportunities-card__milestone--skipped { color: var(--color-text-muted); text-decoration: line-through; }
.opportunities-card__milestone--skipped .opportunities-card__progress-dot { background: var(--color-border); }

.opportunities-card__milestone--pending { /* default gray */ }

.opportunities-card__progress-empty {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    font-style: italic;
    padding: var(--spacing-sm) 0;
}

/* The wrapper is a CSS hook and nothing else, so it steps out of layout. The
   header's toolbar slot (.global-page-header__toolbar, page-header.css) is a
   wrapping flex row, and the shared .global-toolbar inside fills it with
   `flex: 1 1 100%` (toolbar.css) — a rule that only reaches a DIRECT flex
   child. Left as a plain block flex item, this wrapper shrank to its
   content on desktop (559px of a 1175px slot): Search stopped filling the
   line and the gear's margin-left:auto had no slack, so Filter, Sort by and
   the gear bunched up beside Search ("looks fucking different and terrible
   on desktop" — Nick, 09-17). With display: contents the shared row is the
   slot's flex child again, exactly as on the four other dashboards, and the
   descendant selectors below still match through it. */
.opportunities-toolbar-row {
    display: contents;
}

/* The folded header's flex rule from page-header.css is a child selector,
   and a child selector cannot see through this display: contents wrapper. */
@media (min-width: 1024px) {
    .global-page-header--collapsible .global-page-header__toolbar > .opportunities-toolbar-row > .global-toolbar {
        flex: 1 1 0;
    }
}

/* ── Phone: the settings/filters drawer opens like desktop, never a sheet ───
   drawer.css turns every .global-drawer-panel into a bottom sheet under
   767.98px (drawer.js tags it .global-drawer-panel--sheet while that query
   matches) — the right call for an ephemeral drawer, wrong for this page,
   whose phone drawers are the desktop's own (Nick, 10-01: "much more similar
   to the desktop").

   .opportunities-drawer-panel marks the dock panels in _opps_view_controls.html
   (the settings drawer plus its Filters / Who sees it / kind-settings /
   card-settings steps). Restating the box below drops the sheet's bottom-anchored
   inset/transform back to the OVERLAY-mode (<1200px) shape drawer.css already
   ships for tablet width — same right edge, same slide-in-from-the-right
   transform, just narrowed to the phone's own width (min(--drawer-width,
   100%)) and still clearing the bottom bar (--bottom-bar-h, tokens.css) so it
   never covers it. Equal specificity to the .global-drawer-panel rules it
   replaces, so this only wins by loading after drawer.css (base.html) — the
   other four dashboards sharing the same dock shell never carry this class
   and keep their sheet. */
@media (max-width: 767.98px) {
    .opportunities-drawer-panel {
        inset: var(--drawer-top) 0 var(--bottom-bar-h) auto;
        width: min(var(--drawer-width), 100%);
        margin-inline: 0;
        max-height: none;
        border-radius: var(--radius-none);
        transform: translateX(100%);
        /* No visibility rule here on purpose: drawer.css's own phone block
           already carries .global-drawer-panel { visibility: hidden } (closed)
           and .is-open { visibility: visible } — the same hidden-until-open
           behavior the overlay-mode (<1200px) shape uses via transform alone,
           and test_the_page_fits_a_phone's closed-sheet check reads it. Only
           the axis changes (translateX here vs. drawer.css's translateY), so
           layering under the existing visibility rule is exactly right. */
    }

    .opportunities-drawer-panel.is-open {
        transform: translateX(0);
    }
}

/* ── Phone: no bottom-sheet grab handle on a drawer that opens from the
   right ── drawer.css's own phone block gives every .global-drawer-head a
   ::before grab-handle pill plus extra padding-top to make room for it
   (drawer.css, its "drag-handle pill" rule) — sheet-only chrome for a
   panel a user drags DOWN to dismiss. This page's settings/filters drawer
   slides in from the right instead (the box above), so a drag-down handle
   promises a gesture the panel does not have; it read as debris left over
   from the bottom sheet. Hide the pill and drop the reserved space back to
   the drawer's normal padding-top (var(--spacing-md) — the same value
   drawer.css's own non-phone .global-drawer-head rule uses), so the head
   reads exactly like the desktop drawer's.

   Scoped to .opportunities-drawer-panel .global-drawer-head (two classes)
   so it outranks drawer.css's bare .global-drawer-head phone rule (one
   class) regardless of link order — the same reason the box above restates
   its own properties instead of leaning on load order alone. */
@media (max-width: 767.98px) {
    .opportunities-drawer-panel .global-drawer-head {
        padding-top: var(--spacing-md);
    }

    .opportunities-drawer-panel .global-drawer-head::before {
        display: none;
    }

    .opportunities-card__title {
        overflow-wrap: anywhere;
    }

    .opportunities-card__roles {
        grid-auto-rows: auto;
        min-height: 0;
        max-height: none;
        overflow: visible;
    }

    .opportunities-card__roles-arrow {
        display: none;
    }

    .opportunities-card__role-row {
        min-height: var(--role-tile-height);
        padding-block: var(--spacing-xs);
        overflow: visible;
    }

    .opportunities-card__role-name,
    .opportunities-card__role-person,
    .opportunities-card__role-mode,
    .opportunities-card__role-due,
    .opportunities-card__role-skill {
        overflow: visible;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .opportunities-card__role-line {
        flex-wrap: wrap;
    }

    .opportunities-card__role-skill {
        max-width: none;
    }

    .opportunities-card__role-link,
    .opportunities-card__role-pay--interactive {
        display: inline-flex;
        align-items: center;
        min-height: var(--control-h-touch);
    }

    .opportunities-card__role-pay--interactive {
        justify-content: flex-end;
        min-width: var(--control-h-touch);
    }

    .opportunities-card__progress-toggle {
        min-height: var(--control-h-touch);
    }
}


/* global-value-pill — the platform's one numeric value badge.

   A gradient pill that carries a number the user cares about: a pay amount, a
   payout, a total. It is deliberately NOT .global-chip. A chip is a static
   label (a skill, a role, a key:value tag); this is a value — it is heavier,
   it is colored, and it can be clicked. Nick approved keeping it as its own
   element rather than folding it into the chip.

   Colors come from --global-value-pill-start / --global-value-pill-end /
   --global-value-pill-fg (defined in tokens.css so an org can override the
   pill without touching this file). Tokens only here — no raw hex, no raw
   radius, no raw shadow (ADR-124 / ADR-125).

     <span class="global-value-pill">$250</span>
     <button class="global-value-pill global-value-pill--interactive">$250</button>
     <button class="global-value-pill global-value-pill--interactive
                    global-value-pill--unset">Set pay</button>

   Callers add only spacing for their own layout; the box metrics live here. */

.global-value-pill {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    background: linear-gradient(
        180deg,
        var(--global-value-pill-start),
        var(--global-value-pill-end)
    );
    color: var(--global-value-pill-fg);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-md);
    line-height: 1.25;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    box-shadow: var(--global-value-pill-shadow);
    vertical-align: middle;
}

/* --interactive — the pill is a control (click to open the bill drawer, click
   to edit pay). It must not carry the browser's button chrome, only the pill
   look, plus a quiet hover and a clear focus ring. */
.global-value-pill--interactive {
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.global-value-pill--interactive:hover,
.global-value-pill--interactive:focus-visible {
    filter: brightness(1.05);
}

.global-value-pill--interactive:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 1px;
}

/* --unset — there is no value yet. It reads as a quiet dashed outline rather
   than a filled pill, because there is no amount to show. */
.global-value-pill--unset {
    background: none;
    color: var(--color-text-muted);
    border: 1px dashed var(--color-border);
    box-shadow: none;
    font-weight: var(--font-weight-medium);
}

.global-value-pill--unset.global-value-pill--interactive:hover,
.global-value-pill--unset.global-value-pill--interactive:focus-visible {
    color: var(--color-text);
    border-color: var(--color-text-muted);
    filter: none;
}

/* ==========================================================================
   Signup Groups — grouped role rows on the sign-up dashboard
   ========================================================================== */

:root {
    /* One height for the action buttons and the status badges that sit beside
       them, so a pill and a button read the same size. The tap-target rung of
       the shared control-height ladder — these are the page's primary actions. */
    --signup-role-control-h: var(--control-h-touch);
}

.assignments-groups {
    width: 100%;
    /* The first group's header carries 0.875rem of internal top padding, which
       stacks on the toolbar's standard 1.25rem margin and reads as a wider gap
       than every other dashboard. Cancel it here so the first visible ink lands
       at the platform's usual 1.25rem below the toolbar (Nick, 08-17). */
    margin: calc(-1 * var(--spacing-smd)) 0 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--spacing-smd);
    align-items: start;
}

/* Group container — white bg starts halfway up the pill */
.assignments-group {
    background: transparent;
    position: relative;
    margin: 0;
}

.assignments-group::before {
    content: '';
    position: absolute;
    top: 2.1rem;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border-hairline);
    border-radius: var(--radius-card);
    box-shadow: 0 2px 8px var(--ink-alpha-05);
    z-index: 0;
}

.assignments-group__header {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, max-content) fit-content(50%) minmax(var(--control-h-touch), 1fr);
    align-items: center;
    min-width: 0;
    gap: var(--spacing-sm);
    padding: var(--spacing-smd) var(--spacing-md) var(--spacing-2xs);
}

.assignments-group__title-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-2xs);
    min-width: 0;
    max-width: 100%;
}

.assignments-group__subtitle {
    display: block;
    max-width: 100%;
    margin: 0;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    line-height: normal;
    color: var(--color-text-secondary);
    text-align: left;
    overflow-wrap: anywhere;
}

/* Ink pill title — the group heading, on the neutral action ramp */
.assignments-group__pill {
    background: var(--color-action);
    color: var(--color-neutral-ink-fg);
    font-weight: var(--font-weight-heading);
    border-radius: var(--radius-pill);
    padding: var(--spacing-xsm) var(--spacing-md);
    font-size: var(--font-size-lg);
    letter-spacing: 0.15px;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    transition: background 200ms ease, box-shadow 200ms ease;
}

.assignments-group__pill:hover {
    background: var(--color-action-hover);
    box-shadow: 0 2px 8px var(--ink-alpha-20);
    color: var(--color-neutral-ink-fg);
    text-decoration: none;
}

.assignments-group__ref {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
}

/* Worker avatars — at the far right of the header, after the date (Nick 11-09),
   no overlap, pill-height matched. justify-self: end packs them on the right edge;
   a long list still scrolls inside its column. */
.assignments-group__workers {
    display: flex;
    align-items: center;
    grid-column: 3;
    justify-self: end;
    grid-row: 1;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    margin-left: var(--spacing-sm);
    gap: var(--spacing-xsm);
    padding: var(--spacing-2xs);
}

.assignments-group__worker-avatar {
    width: 2.25rem;
    height: 2.25rem;
    font-size: var(--font-size-2xs);
    border: 2px solid var(--color-card-bg);
    cursor: default;
    box-shadow: 0 1px 3px var(--ink-alpha-10);
}

.assignments-group__worker-avatar:first-child {
    margin-left: 0;
}

/* Referral avatar — worker-sized (shares .assignments-group__worker-avatar) but glows
   with brand color to draw attention. The scoped selector outranks the
   worker-avatar box-shadow so the glow ring wins. The clip and the `img` fill rule
   that used to live here are `.global-avatar`; only the glow is local. */
.assignments-group .assignments-group__referral-avatar {
    box-shadow: 0 0 0 3px var(--brand-primary),
                0 0 12px color-mix(in srgb, var(--brand-primary) 40%, transparent);
    animation: referral-pulse 2s ease-in-out infinite;
}

@keyframes referral-pulse {
    0%, 100% { box-shadow: 0 0 0 3px var(--brand-primary), 0 0 8px color-mix(in srgb, var(--brand-primary) 30%, transparent); }
    50% { box-shadow: 0 0 0 3px var(--brand-primary), 0 0 16px color-mix(in srgb, var(--brand-primary) 50%, transparent); }
}

/* Opportunity-level event info — date + booking time, shown once for the whole
   group. It sits right beside the black pill so the name and its day read together;
   the worker avatars take the far-right edge (Nick 11-09).
   Date and time sit INLINE (flex-direction:row) on one line, joined by a · separator,
   wrapped in a raised white pill — the small shadow floats it off the grey header band
   (grey-on-grey faded there; Nick picked the raised look over a brand tint) — so the
   block reads as a single standout chip rather than two stacked lines. */
.assignments-group__event {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-sm);
    flex-shrink: 0;
    line-height: 1.2;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border-hairline);
    border-radius: var(--radius-pill);
    padding: var(--spacing-xsm) var(--spacing-smd);
    box-shadow: var(--shadow-sm);
}

/* Calendar glyph leading the pill — a quiet visual cue that this chip is the date/time.
   Slightly tighter gap to the date than the date·time gap so it reads as an icon, not a
   third value. Brand ink (the contrast-corrected on-card pair, safe on the white
   fill for any org palette) so the pill reads as "this is the when" at a glance. */
.assignments-group__event-icon {
    color: var(--brand-primary-on-card-bg);
    font-size: var(--font-size-sm);
    margin-right: -0.1rem;
}

/* The dot joining date and time inside the pill (only rendered when both exist). */
.assignments-group__event-sep {
    color: var(--color-text-muted);
    font-weight: var(--font-weight-heading);
}

.assignments-group__event-date {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-heading);
    color: var(--color-text);
    white-space: nowrap;
}

/* For a signed-in worker the date is the Day Preview trigger — a button styled to read
   as plain text (no chrome). font-family (NOT font shorthand) so weight/size stay ours. */
.assignments-group__event-date--action {
    padding: 0;
    border: 0;
    background: none;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.15s ease;
}

.assignments-group__event-date--action:hover {
    color: var(--brand-primary);
}

.assignments-group__event-time {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-grey-600);
    white-space: nowrap;
}

/* Role row — desktop grid
   name+location | dates (150px) | properties (150px) | action
   NOTE: no overflow:hidden — would clip the global-split-button chevron menu.
   Inner text fields handle their own ellipsis truncation.
   NOTE: z-index:auto (not 1) so the row doesn't form a stacking context;
   otherwise an open .global-split-button__menu would be trapped below later rows. */
.assignments-role-row {
    position: relative;
    display: grid;
    /* Three columns: the main column (role name stacked over the muted meta chip line,
       FIXED width) | the scrolling property card (1fr) | the action, content-sized and
       pinned to the right edge. The main column is a FIXED track (--signup-name-col), not
       greedy, so the property card begins at the same x on every row no matter how wide a
       row's name or chips are — variable name content can't bump the card column sideways.
       The card is 1fr (fills the slack) and the action sizes to content. align-items:center
       keeps all three vertically centered against the stacked main block. Move the shared
       card start left/right with the single --signup-name-col knob. */
    --signup-name-col: 27.5rem;
    grid-template-columns: var(--signup-name-col) minmax(0, 1fr) max-content;
    align-items: center;
    gap: 0 var(--spacing-smd);
    padding: var(--spacing-smd) var(--spacing-md);
    line-height: 1.25;
}

/* Left main column — stacks the bold name line over the muted meta line. min-width:0 lets
   both children shrink and truncate instead of forcing the row wider than its grid track. */
.assignments-role-row__main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
    gap: var(--spacing-xs);
}

/* Border between consecutive role rows only (not between header and first role) */
.assignments-role-row + .assignments-role-row {
    border-top: 1px solid var(--color-border-hairline);
}

/* The value pill base lives in components/value-pill.css (one shared numeric
   value badge). The signup meta row keeps only its own box-metric override below. */

/* Role name row — a flex row holding the name text plus the decorations that stay on
   the name line (the availability pill and the coordinator approve-chip). The fixed-width
   grid track is __main, not this row; because the name text is the only shrinkable child
   here, it ellipsizes while every decoration stays full-size (flex:0 0 auto). That's what
   lets a pending-approval chip appear without bumping the property column — the name gives
   up width, not the row. */
.assignments-role-row__name {
    display: flex;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    text-align: left;
}

/* The role name itself — matched to the legacy .role-name. The lone shrinkable child; truncates
   with an ellipsis when name + decorations exceed the fixed name column. */
.assignments-role-row__name-text {
    font-size: var(--font-size-h4);
    font-weight: var(--font-weight-heading);
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 0 1 auto;
    min-width: 0;
}

/* Name-line chrome never shrinks — it keeps its size and pushes the name text to truncate.
   (Pay, location and the scope-of-work pill live on the meta line now; only the
   availability pill still sits on the name line.) */
.assignments-role-row__name > .assignments-role-row__available-pill {
    flex: 0 0 auto;
}

/* The approve-chip MAY shrink — 3× faster than the role name (flex-shrink 3 vs the name
   text's 1) — so a long signer name gives way before the role name does. It keeps its avatar
   and ellipsizes only the name label. This is the #2907 lesson: with the chip pinned at full
   size, a fixed name track truncated the *role* name to nothing on approval rows; letting the
   chip absorb most of the overflow keeps the role name readable while alignment still holds. */
.assignments-role-row__name > .assignments-role-row__approve-chip {
    flex: 0 3 auto;
    min-width: 0;
}
/* The chip's inner __current container already permits shrink-below-content
   (components/person-chip.css), so the name label ellipsizes here too. */

/* Location tag — the city/Remote tag on the meta line. Wears the outline-chip
   recipe (hairline --color-border, transparent fill, muted ink — the adoption
   sweep the styleguide names for this class) so it reads as the same family as
   the outlined View Full Details button and the pay pill beside it, instead of
   a borderless smudge between two bordered boxes.

   Ink is --color-text-muted-cool, not --color-text-muted: at this size the
   lighter muted grey measures 2.54:1 on white, so the city a worker travels to
   was the one thing on the row under the 4.5:1 floor.

   Corner is --radius-md because both neighbours on this line are: the pay pill
   and the View Full Details button. A capsule was tried here (Nick asked for
   the pay pill's roundness) and pulled straight back out — the pill only READS
   rounder because its corner is a filled gradient while this one is traced by a
   1px hairline, so a fully-rounded tag beside two 8px boxes was the odd shape
   on the row rather than the matching one. Match the neighbours, not the
   impression. */
.assignments-role-row__location-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-text-muted-cool);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    vertical-align: middle;
    margin-left: var(--spacing-xsm);
    text-decoration: none;
    line-height: 1.2;
}

.assignments-role-row__location-tag .bi-geo-alt-fill {
    color: var(--color-error);
    font-size: var(--font-size-2xs);
}

/* Hover is scoped to the <a> renders (address present → maps link). The
   city-only <span> and the Remote tag are static labels and must not invite a
   click they can't honor.

   The hairline and ink wake to the brand color with the fill left transparent:
   a grey wash is the platform's pressed/disabled language, so filling the chip
   read as "this control is spent" rather than "this opens a map". Leaving the
   background alone also keeps the chip's weight steady beside the pay pill —
   the View on Map tooltip is what explains the target.

   The pin keeps its --color-error red through hover, per Nick: it is the row's
   one map marker, and a marker that changes color on approach stops reading as
   a marker. The rule above sets the icon's color explicitly, so the anchor's
   hover ink is never inherited by it — no hover declaration is needed to hold
   the red, and adding one back is what turned the pin brand. */
a.assignments-role-row__location-tag:hover {
    border-color: var(--brand-primary);
    text-decoration: none;
    color: var(--brand-primary);
}

/* Remote wears the same quiet chip as a city: where a role happens is
   metadata, not a status, so it takes no color of its own — the screen glyph
   is the distinction. */
.assignments-role-row__location-tag--virtual .bi-display {
    font-size: var(--font-size-2xs);
}

.assignments-role-row__map-pill {
    white-space: nowrap;
}

.assignments-role-row__map-pill .bi-geo-alt-fill {
    color: var(--color-error);
}

.assignments-role-row__map-pill:hover .bi-geo-alt-fill {
    color: var(--brand-primary);
}

/* ── Meta chip line ────────────────────────────────────────────────────────
   The second line of the main column: the View Full Details button leads,
   then the pay pill, then the location/Remote tag, on one flowing, wrapping
   line. Everything else that varies by role renders in the scrolling
   property card to the right. */
.assignments-role-row__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-xs) var(--spacing-xsm);
    min-width: 0;
    max-width: 100%;
    font-size: var(--font-size-md);
    line-height: 1.35;
    color: var(--color-text-muted);
}

/* The details button and the two meta chips share one height so their top and
   bottom edges line up; each keeps its own color, background, radius and
   shadow — only the box metrics unify here. */
.assignments-role-row__meta .global-value-pill,
.assignments-role-row__meta .assignments-role-row__location-tag,
.assignments-role-row__details-btn {
    display: inline-flex;
    align-items: center;
    margin-left: 0;
    height: 24px;
    padding: 0 var(--spacing-sm);
    font-size: var(--font-size-sm);
}

/* View Full Details — a second door into the terms modal Sign Up opens. A ghost
   outline in the brand color so it reads as the row's one obvious "read more"
   control without competing with the solid Sign Up button in the action column.

   Weight 400 next to the tag's 600 and the pay pill's 700 drew the one control
   on the line you are meant to click the most faintly of the three. */
.assignments-role-row__details-btn {
    border: 1px solid var(--brand-primary);
    border-radius: var(--radius-button);
    background: transparent;
    color: var(--brand-primary);
    font-weight: var(--font-weight-medium);
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
}

/* A tint, not the solid flip: filling this button made the row's smallest
   control its heaviest mark, for a door the whole card behind it already opens. */
.assignments-role-row__details-btn:hover {
    background: var(--brand-primary-alpha-10);
    color: var(--brand-primary);
}

/* ── Scrolling property card ───────────────────────────────────────────────
   The middle grid cell: one org-configurable list of {label, value} rows (system
   fields + custom props) that scrolls inside a fixed-height host. The cap is the
   whole point — the role row stays a constant height no matter how many properties
   a role template is configured to show; overflow scrolls, revealed by hover arrows.
   No icons: each row is a flat inline "Label: value" line. */
.assignments-role-row__card {
    position: relative;
    min-width: 0;
    /* Defensive: a grid child defaults to min-height:auto and would refuse to shrink
       below its content. Pinning it to 0 lets the inner scroll's max-height govern the
       cell height, so a long prop list can never stretch the row. */
    min-height: 0;
    /* Inline "Label: value" rows (~1.2rem each + 0.3rem gap). The default card's three
       fields fit here with no scroll; a longer org-configured list fades the 4th row out
       under the scroll mask, signalling "scroll for more". */
    --card-max-height: 4.4rem;
    /* Pull the property block in from the action button so the values don't crowd it. */
    margin-right: var(--spacing-smd);
}

/* When the viewer can still sign up, the whole card is a click target for the
   same terms modal as View Full Details. The cursor is the only affordance —
   the old hover ring + label underline read as noise and Nick killed them
   (08-17); the View Full Details button beside the card already names the
   click. */
.assignments-role-row__card--openable {
    cursor: pointer;
}

.assignments-role-row__card-scroll {
    display: flex;
    flex-direction: column;
    /* Left-justify each property row so the labels line up on a common left edge. */
    align-items: flex-start;
    /* Vertically center the rows in the fixed-height cell so a 1- or 2-property card lines
       up with the (vertically-centered) role name beside it; `safe` falls back to
       top-alignment when the content overflows so the first row is never scrolled out. */
    justify-content: safe center;
    gap: var(--spacing-xs);
    min-width: 0;
    /* FIXED height (not max-height): every role row is exactly --card-max-height tall no
       matter how many properties it carries. Overflow scrolls, revealed by the hover arrows. */
    height: var(--card-max-height);
    overflow-y: auto;
    overscroll-behavior: contain;
    /* Arrows are the affordance — hide the native scrollbar to keep the cell clean. */
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* Per-edge fade depth, raised by the --fade-* classes (bound to the same
       Alpine state as the arrows). Kept at 0 here so a fully-scrolled edge
       renders crisp to the card boundary. */
    --card-fade-top: 0rem;
    --card-fade-bottom: 0rem;
}

/* Overflow fade — a mask on the scroll cell, not a wash painted over it. The
   old white scrim sat on top of clipped text, so however eased its ramp was,
   its outer edge always met full-strength letters in a visible line (Nick,
   08-17, twice). Masking makes the text itself dissolve into the card surface:
   there is no painted layer to end anywhere. The stops approximate a
   smoothstep so the alpha ramp arrives at full strength with a flat tangent.
   The -webkit- copy below is the same ramp verbatim (Safari before 15.4 knows
   only the prefixed property) — edit the two together or the mask layers
   drift. */
.assignments-role-row__card-scroll--fade-top,
.assignments-role-row__card-scroll--fade-bottom {
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent,
        rgba(0, 0, 0, 0.3) calc(var(--card-fade-top) * 0.35),
        rgba(0, 0, 0, 0.75) calc(var(--card-fade-top) * 0.7),
        rgba(0, 0, 0, 0.95) calc(var(--card-fade-top) * 0.88),
        black var(--card-fade-top),
        black calc(100% - var(--card-fade-bottom)),
        rgba(0, 0, 0, 0.95) calc(100% - var(--card-fade-bottom) * 0.88),
        rgba(0, 0, 0, 0.75) calc(100% - var(--card-fade-bottom) * 0.7),
        rgba(0, 0, 0, 0.3) calc(100% - var(--card-fade-bottom) * 0.35),
        transparent
    );
    mask-image: linear-gradient(
        to bottom,
        transparent,
        rgba(0, 0, 0, 0.3) calc(var(--card-fade-top) * 0.35),
        rgba(0, 0, 0, 0.75) calc(var(--card-fade-top) * 0.7),
        rgba(0, 0, 0, 0.95) calc(var(--card-fade-top) * 0.88),
        black var(--card-fade-top),
        black calc(100% - var(--card-fade-bottom)),
        rgba(0, 0, 0, 0.95) calc(100% - var(--card-fade-bottom) * 0.88),
        rgba(0, 0, 0, 0.75) calc(100% - var(--card-fade-bottom) * 0.7),
        rgba(0, 0, 0, 0.3) calc(100% - var(--card-fade-bottom) * 0.35),
        transparent
    );
}

.assignments-role-row__card-scroll--fade-top {
    --card-fade-top: 0.75rem;
}

.assignments-role-row__card-scroll--fade-bottom {
    --card-fade-bottom: 0.75rem;
}

.assignments-role-row__card-scroll::-webkit-scrollbar {
    display: none;
}

/* One flat row: "Label: value" on a single line, label muted, value emphasized. */
.assignments-role-row__card-item {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: flex-start;
    gap: var(--spacing-xsm);
    min-width: 0;
    max-width: 100%;
    text-align: left;
    line-height: 1.25;
}

.assignments-role-row__card-label {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    color: var(--color-grey-600);
    white-space: nowrap;
    flex: 0 0 auto;
}

/* The colon that turns "Deliverable" + "Highlight film" into one legible line. */
.assignments-role-row__card-label::after {
    content: ":";
}

.assignments-role-row__card-value {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    min-width: 0;
    /* Never clip a full value — wrap as a last resort instead of an ellipsis. */
    overflow-wrap: anywhere;
}

/* The scope brief is prose, not a short value: side-by-side it wrapped in a
   narrow column to the right of the label, which read badly (Nick, 08-17).
   Stack it — label on its own line, the brief full-width under it. */
.assignments-role-row__card-item--scope {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-2xs);
}

/* Hover-scroll chevrons — only shown (via x-show) when the rows overflow. The
   "scroll for more" affordance itself is the mask fade on the scroll cell; the
   chevron just names the direction. */
.assignments-role-row__card-arrow {
    position: absolute;
    left: 0;
    right: 0;
    /* A sliver: the text should run almost to the card's top/bottom edges, with
       just enough wash left for the chevron to sit on (Nick, 08-17 — "reaching
       closer to the edge of the top/bottom of the card"). */
    height: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    cursor: pointer;
    color: var(--brand-primary);
    /* Below the type scale on purpose — the chevron is an ornament, not text,
       and must fit inside the 0.5rem sliver without spilling onto the rows. */
    font-size: 0.5rem;
    opacity: 0.75;
    z-index: var(--z-raised);
    transition: opacity var(--transition-fast);
}

.assignments-role-row__card-arrow:hover {
    opacity: 1;
}

/* No background: the scroll cell's mask (above) already dissolves the text
   under the sliver, so the chevron sits directly on clean card surface. Any
   painted wash here would reintroduce the cutoff line the mask removed. */
.assignments-role-row__card-arrow--up {
    top: 0;
    background: none;
}

.assignments-role-row__card-arrow--down {
    bottom: 0;
    background: none;
}

/* Extra left margin keeps the buttons off the card edge */
.assignments-role-row__action {
    margin-left: var(--spacing-smd);
}

/* Action buttons — matched to the legacy .btn-admin. The height comes from the
   min-height floor, not from an explicit line-height (the button never sets
   one). Button and status badge both read --signup-role-control-h, so a pill
   and a button stand the same height side by side and grow together as the
   fluid font scales up on wide screens. */
/* The line above Accept anyway for a person who marked that day unavailable
   (Nick 11-07, pick 3). An alert carries no margin, so the caller spaces it. */
.assignments-role-unavailable {
  margin-bottom: var(--spacing-xs);
}

.assignments-role-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--signup-role-control-h, 2.55rem);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-button);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-button);
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    cursor: default;
}

.assignments-role-btn--open {
    background: var(--color-card-bg);
    color: var(--brand-primary);
    /* Soft lift, not a glow. One small, low-opacity brand shadow; no white
       halo. Neutral fallback line first for browsers without color-mix() —
       literal, not var(--ink-alpha-15), for the reason the split-button pair
       below spells out. */
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    box-shadow: 0 1px 4px color-mix(in srgb, var(--brand-primary) 18%, transparent);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.assignments-role-btn--open:hover {
    transform: scale(1.05);
    /* Keep the slight grow on hover; deepen the shadow a little instead of spreading it wide. */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--brand-primary) 28%, transparent);
    color: var(--brand-primary);
    text-decoration: none;
}

/* Yay button — same soft lift as assignments-role-btn--open, success tint instead of brand-primary */
.assignments-role-btn--yay {
    background: var(--color-card-bg);
    color: var(--color-success);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    box-shadow: 0 1px 4px color-mix(in srgb, var(--color-success) 18%, transparent);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.assignments-role-btn--yay:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--color-success) 28%, transparent);
    color: var(--color-success);
}

.assignments-role-btn--nay {
    background: transparent;
    color: var(--color-error);
    border: 2px solid var(--color-error);
    cursor: pointer;
    transition: background 0.2s ease;
}

.assignments-role-btn--nay:hover {
    background: color-mix(in srgb, var(--color-error) 6%, transparent);
}

.assignments-role-row--locked {
    opacity: 0.45;
    pointer-events: none;
}

/* Skill gate lock button. flex-wrap serves the two-line level-shortfall
   label: the icon and "Needs Established" share the first flex line, and
   __line2's full basis pushes the skill name onto its own centered row
   (justify-content is already center on .assignments-role-btn). One-line labels — a
   missing skill, the bare "Locked", the approve row, and the coordinator
   global-split-button menu item — have no __line2 and keep their single line.
   __line2 is also display: block for the ≤480px rule below that turns
   .assignments-role-btn into a plain block: flex-basis means nothing there, and a block
   child is what still forces the break under .assignments-role-btn's nowrap. */
.assignments-role-btn--locked {
    background: transparent;
    color: var(--color-text-muted);
    border: 2px dashed var(--color-border);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-button);
    cursor: not-allowed;
    flex-wrap: wrap;
}

.assignments-role-btn--locked .bi-lock-fill { margin-right: var(--spacing-xs); }

.assignments-role-btn--locked .assignments-role-btn__line2 {
    display: block;
    flex-basis: 100%;
}

/* Signup role badge — LAYOUT ONLY. The pill itself is the shared
   .global-badge (components/badge.css); the old .badge-role clone and its
   hand-typed amber/green/red hex pairs are gone, and the state colour now
   comes from the shared tone modifiers (--warning / --success / --neutral)
   like every other status pill on the platform. Declined/Denied are --neutral,
   not --danger: badge.css reserves danger for genuine failures and puts
   declines and cancellations in the neutral group.
   This modifier keeps just the two things the signup row genuinely needs:
   it reads the shared --signup-role-control-h min-height so a status pill
   stands as tall as the button beside it at every viewport, and it drops the
   uppercase treatment because these labels are human sentences ("Waiting for
   Approval"), not one-word states.
   Doubled class on purpose: this file loads BEFORE components/badge.css in
   base.html, so a single-class .global-badge--role ties the .global-badge base
   on specificity and loses on source order — the base would win back uppercase,
   letter-spacing, line-height, padding and the pill radius. .global-badge
   .global-badge--role is (0,2,0) and beats the base regardless of load order. */
.global-badge.global-badge--role {
    justify-content: center;
    min-height: var(--signup-role-control-h, 2.55rem);
    line-height: 1.1;
    text-align: center;
    text-transform: none;
    letter-spacing: normal;
    padding: var(--spacing-xsm) var(--spacing-smd);
    border-radius: var(--radius-lg);
    cursor: default;
}

/* Two-step Cancel confirm (dashboard). confirm-action.js adds .is-confirming on
   the first click; the button turns a solid red "Confirm Cancel" so the armed
   state is unmistakable. It reverts only on outside click / Escape, never on a
   silent timer. Scoped to .assignments-role-btn so it never touches other confirm buttons. */
.assignments-role-btn.is-confirming {
    background: var(--color-error);
    color: #fff;
    border-color: var(--color-error);
}

/* Waiting-for-Approval pill and its Cancel button in one horizontal row,
   vertically centered with a small gap. Replaces the old stacked column so the
   pill and the button read as a matched pair. */
.assignments-waiting-cancel {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* The muted "Invited · waiting Nd" pill on an invited (locked) row now renders
   as .global-badge--role.global-badge--neutral — no local rule needed. */

/* "Invited by" attribution — a quiet label + micro person chip naming the
   inviter. On the invited worker's row it sits on the name line next to the
   role name (mirroring where the invitee's chip sits for a coordinator); on a
   locked row it is the whole action column. */
.assignments-role-row__invited-by {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xsm);
    margin-left: var(--spacing-sm);
    vertical-align: middle;
}

.assignments-role-row__invited-by-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
}

/* Cancel-invite × on the invitee's chip (coordinator view). Quiet until
   hovered. confirm-action.js swaps the glyph for the data-confirm-text on the
   first click, so .is-confirming must restyle the grown text button as the
   armed state — the shared .assignments-role-btn.is-confirming rule can't reach this
   button because it isn't a .assignments-role-btn. */
.assignments-role-row__chip-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    margin-left: var(--spacing-2xs);
    padding: 0;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    line-height: 1;
    cursor: pointer;
}

.assignments-role-row__chip-cancel:hover {
    background: var(--color-surface-hover);
    color: var(--color-error);
}

.assignments-role-row__chip-cancel.is-confirming {
    padding: 0 var(--spacing-sm);
    background: var(--color-error);
    color: #fff;
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
}

/* Availability row highlight (worker view, plugin-gated): a soft teal tint on
   rows the worker IS showing available for, plus an outlined "Available" pill.
   Teal (--color-availability), deliberately distinct from the success-green
   "Signed Up" pill. Keyed off role.availability_match (singular); absent = no
   highlight. */
.assignments-role-row--available {
    background: var(--color-availability-bg);
}

.assignments-role-row__available-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-left: var(--spacing-sm);
    padding: var(--spacing-2xs) var(--spacing-sm);
    border: 1px solid var(--color-availability);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-availability);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
    vertical-align: middle;
}

/* The viewer's own invite on a day they marked unavailable (Nick 11-07, pick 3):
   the Available pill's shape in the warning colour. Its Accept reads Accept anyway. */
.assignments-role-row__unavailable-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-left: var(--spacing-sm);
    padding: var(--spacing-2xs) var(--spacing-sm);
    border: 1px solid var(--status-warning-fg);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--status-warning-fg);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
    vertical-align: middle;
}

/* Split-button: primary action + chevron menu of alternates.
   Sibling layout via inline-flex; menu is absolutely positioned
   below the row. Chevron only renders when 2+ actions exist. */
.global-split-button {
    position: relative;
    display: inline-flex;
    align-items: stretch;
    gap: var(--spacing-xsm);
}

/* Chevron is a square toggle styled like global-sidebar-org-toggle: a tinted square
   with a subtle border, hover deepens both, padding:0 so the inner SVG centers.
   align-self: stretch grows its height to the Sign Up button next to it, so
   their top and bottom edges always line up; the fixed width is set to about
   that same height so it reads as a square. Colors are literal black-alpha for
   the light card, not the sidebar's dark-surface tokens. */
.global-split-button__chevron {
    align-self: stretch;
    width: 2.5rem;
    padding: 0;
    background: var(--ink-alpha-05);
    border: 1px solid var(--ink-alpha-15);
    border-radius: var(--radius-button);
    cursor: pointer;
    color: var(--color-grey-600);
    transition: background-color 120ms ease-in-out, border-color 120ms ease-in-out, color 120ms ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.global-split-button__chevron:hover,
.global-split-button__chevron:focus {
    background: var(--ink-alpha-10);
    border-color: var(--ink-alpha-20);
    color: var(--color-text);
    outline: none;
}

/* Sized here (not inline) so the glyph is one source of truth, the same way
   global-sidebar-org-toggle-svg sizes the matching sidebar toggle. */
.global-split-button__chevron svg {
    width: 14px;
    height: 22px;
    opacity: 0.85;
}

.global-split-button__menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 20;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-xsm);
    min-width: 9rem;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
}

/* Each item mirrors the action button it switches to: full-width, bold, and
   tinted to the action's color (green = yes, red = no, brand = open). The base
   color is overridden by the --yay/--nay/--open modifiers below. */
.global-split-button__menu-item {
    display: block;
    width: 100%;
    background: transparent;
    border: none;
    text-align: left;
    padding: var(--spacing-sm) var(--spacing-smd);
    border-radius: var(--radius-md);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-button);
    color: var(--color-text);
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 120ms ease-in-out;
}

.global-split-button__menu-item:hover,
.global-split-button__menu-item:focus {
    background: var(--ink-alpha-05);
    outline: none;
}

.global-split-button__menu-item--yay {
    color: var(--color-success);
}

.global-split-button__menu-item--yay:hover,
.global-split-button__menu-item--yay:focus {
    background: var(--status-success-bg);
}

.global-split-button__menu-item--nay {
    color: var(--color-error);
}

.global-split-button__menu-item--nay:hover,
.global-split-button__menu-item--nay:focus {
    background: var(--status-danger-bg);
}

/* Brand-tinted; color-mix gives a 10%-brand hover where supported, with a
   neutral fallback for older engines (no brand color hardcoded). */
.global-split-button__menu-item--open {
    color: var(--brand-primary);
}

.global-split-button__menu-item--open:hover,
.global-split-button__menu-item--open:focus {
    /* Spelled out, not `var(--ink-alpha-05)`, though that token holds exactly
       this value. This is the fallback half of a pair, read by an engine that
       has already shown it cannot resolve the line below it; a literal asks
       nothing of the engine on the way to being painted. #6119 folded it into
       the token along with 30 genuine duplicates — the fold is right
       everywhere the value stands alone, and wrong here. */
    background: rgba(0, 0, 0, 0.05);
    background: color-mix(in srgb, var(--brand-primary) 10%, transparent);
}

/* The skill gate, shown to a coordinator who can staff the role but not take it.
   Muted like .assignments-role-btn--locked so it reads as the reason Sign Up is absent rather
   than as a third action. It stays clickable on purpose (ADR-043): the click is
   what raises the toast naming the missing skill. */
.global-split-button__menu-item--locked {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    cursor: not-allowed;
}

.global-split-button__menu-item--locked .bi-lock-fill { margin-right: var(--spacing-xs); }

.assignments-role-row__locked-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xsm);
    flex-wrap: wrap;
}

/* Coordinator approve chip — sits inside .assignments-role-row__name immediately
   after the location pill. Single pending = static chip showing avatar+full name.
   Multi-pending = same chip wired as an Alpine.js dropdown that lets the
   coordinator pick which signup to approve; the visible Approve button in
   .assignments-role-row__action retargets to match. */
/* Layout hook only — the chip's skin (pill fill, 20px avatar, name, chevron)
   is the global-person-chip atom in components/person-chip.css. This rule keeps
   just the spacing that belongs to the signup role row. */
.assignments-role-row__approve-chip {
    margin-left: var(--spacing-sm);
}

/* Menu rows show a 24px face rather than the trigger's 20px.
   The panel ancestor is in the selector on purpose: this file loads BEFORE
   components/person-chip.css, so a two-class selector would tie with
   `.global-person-chip--dropdown .global-person-chip__avatar` (0,2,0) and
   lose on source order. Three classes (0,3,0) wins regardless of load order. */
.assignments-role-row__approve-panel .assignments-role-row__approve-panel-row .global-person-chip__avatar {
    width: 24px;
    height: 24px;
}

.assignments-role-row__approve-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 20;
    min-width: 220px;
    padding: var(--spacing-xsm);
    border-radius: var(--radius-md);
    background: var(--color-card-bg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--ink-alpha-05);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
}

.assignments-role-row__approve-panel-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xsm) var(--spacing-sm);
    border-radius: var(--radius-sm);
    border: 0;
    background: transparent;
    color: var(--color-text);
    text-align: left;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: background-color 100ms ease-in-out;
}

.assignments-role-row__approve-panel-row:hover {
    background: var(--ink-alpha-05);
}

.assignments-role-row__approve-panel-name {
    flex: 1;
    white-space: nowrap;
}

.assignments-role-row__approve-panel-check {
    color: var(--color-success);
    font-size: var(--font-size-lg);
}

@keyframes signup-success-flash {
    0%   { background-color: color-mix(in srgb, var(--color-success) 12%, var(--color-card-bg)); }
    100% { background-color: transparent; }
}
/* Assign panel header — uses org brand color instead of impersonate red.
   Override the inherited hardcoded `color: #fff` from .core-impersonate-modal-header
   so the text honors the per-color text override (Auto/Light/Dark). */
.assignments-assign-panel .core-impersonate-modal-header {
    background: var(--brand-primary);
    color: var(--brand-primary-fg);
}

/* A row's action slot once that worker already has an unanswered assignment
   here. Deliberately a <span>, not a disabled <button>: there is no action left
   on the row, and a button shape invites a click that could only be refused.
   Muted + dashed to match .assignments-role-btn--locked, the platform's other "this is why,
   not what next". Padded like the Bootstrap .btn-sm it replaces so rows do not
   shift. */
.assignments-assign-panel__pending-pill {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    line-height: 1.5;
    background: transparent;
    color: var(--color-text-muted);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-button);
}

/* Busy on the seat's day: the mark, then why in words (an exception, or Holding
   another seat). The reason wraps under a long email rather than pushing the
   Invite button off the row. */
.assignments-assign-panel__busy {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-2xs);
}

.assignments-assign-panel__busy-why {
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
}

/* The People tab's list: the qualified on top, then this small heading over
   everyone else (Nick 11-05). Worn like the seat sheet's section headings. */
.assignments-assign-panel__divider {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-smd) var(--spacing-xs);
    border-top: 1px solid var(--color-border);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-heading);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
}

/* Every other row while an unanswered invite holds the role: still a button,
   because the lock lifts (INVITE_LOCK_DURATION) and the row goes live again,
   but it must not read as one. A number here would rot the next time that
   constant moves — it already did once.
   Bootstrap's :disabled only drops opacity to .65, which on an
   outline button still comes out blue and clickable — this takes the pill's
   colours instead so the whole panel says one thing.

   The button is never `disabled` (a locked tap explains itself in a toast), so
   the lock is the aria-disabled attribute. Wins on load order, this file being
   the later one. That is a real dependency and not an
   assumption: tests/browser/test_invite_pill_swap_proof.py reads the painted
   colour off a locked button and compares it to the pill beside it. */
.assignments-assign-panel__invite-btn[aria-disabled="true"] {
    opacity: 1;
    background: transparent;
    color: var(--color-text-muted);
    border-color: var(--color-border);
}

@media (max-width: 767.98px) {
    /* Phone: every row and its Invite button is a 44px target, and the search
       box is 16px so iOS does not zoom into it. */
    .assignments-assign-panel__row,
    .assignments-assign-panel__invite-btn {
        min-height: var(--control-h-touch);
    }

    .assignments-assign-panel .global-filter-control {
        font-size: var(--font-size-base);
        min-height: var(--control-h-touch);
    }

    .assignments-groups {
        grid-template-columns: 1fr;
    }

    /* Mobile role rows: drop the fixed name track. The main block (name + meta) spans the
       full width on its own row; the property card and the action share the row below it. */
    .assignments-role-row {
        grid-template-columns: 1fr auto;
        gap: var(--spacing-xs) var(--spacing-sm);
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .assignments-role-row__main {
        grid-column: 1 / -1;
    }

    /* Property card drops under the main block, in the left column; reset the desktop
       margin that pulled it off the action button (irrelevant when it's on its own row). */
    .assignments-role-row__card {
        grid-column: 1;
        margin-right: 0;
    }

    /* On narrow widths let a long role name wrap to a second line instead of
       ellipsizing against its decorations — there's no fixed name track, so wrapping is
       safe and keeps the whole name readable (mockup A6). */
    .assignments-role-row__name {
        flex-wrap: wrap;
    }
    .assignments-role-row__name-text {
        font-size: var(--font-size-h3);
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .assignments-role-row__action {
        grid-column: 2;
        justify-self: end;
        align-self: center;
        margin-left: 0;
    }

    /* Let the header wrap on mobile so the event pill drops to its own right-aligned line
       (margin-left:auto pushes it to the right edge) instead of crowding pill + avatars. */
    .assignments-group__header {
        flex-wrap: wrap;
    }

    /* The header wraps here, so the pill has the first line to itself; a
       60% cap left it a stub ("Wedding · Full day …") beside empty space. */
    .assignments-group__pill {
        max-width: 100%;
    }

    /* Rows stack on a phone, so the desktop's constant row height buys
       nothing: a role with no properties showed 4.4rem of blank card. The
       cell sizes to its rows and the cap still scrolls a long list. */
    .assignments-role-row__card-scroll {
        height: auto;
        max-height: var(--card-max-height);
    }

    /* The pill stays compact and right-floated on its wrapped line — no full-width stretch
       (that was the stacked-column era; it's now an inline date·time chip). It gives up
       the desktop's flex-shrink: 0 here: a long date and time ran the pill off the
       right edge of a 393px screen, so it shrinks and wraps instead
       (test_phone_list_pages). */
    .assignments-group__event {
        margin-left: auto;
        flex-shrink: 1;
        flex-wrap: wrap;
        min-width: 0;
        max-width: 100%;
    }

    .assignments-group__event-date,
    .assignments-group__event-time {
        white-space: normal;
    }

    /* The row and its main column never grow past the card: the meta line's
       chips ran under the right edge when the grid sized to their content. */
    .assignments-role-row {
        min-width: 0;
        max-width: 100%;
    }

    .assignments-role-row__main {
        max-width: 100%;
    }

    .assignments-group__worker-avatar {
        margin-left: calc(-1 * var(--spacing-sm));
    }

    .assignments-group__worker-avatar:first-child {
        margin-left: 0;
    }

    /* Height needs no override here: button and badge keep reading the shared
       --signup-role-control-h, which is already the tap-target rung. */
    .assignments-role-btn {
        padding: var(--spacing-smd) var(--spacing-mdlg);
        font-size: var(--font-size-lg);
    }
}

@media (max-width: 480px) {
    /* Very narrow: drop to a single column so main, card and action each stack full-width. */
    .assignments-role-row {
        grid-template-columns: 1fr;
    }
    /* Reset the two-column action placement from the 768px rule — in one column the action
       spans the full width below the property card. */
    .assignments-role-row__action {
        grid-column: 1 / -1;
        justify-self: stretch;
    }

    .assignments-role-btn {
        display: block;
        text-align: center;
    }

    /* Start-aligned action: its menu opens rightward, not past the left edge. */
    .assignments-role-row__action .global-split-button__menu {
        right: auto;
        left: 0;
    }

    .assignments-group__ref {
        display: none;
    }
}

/* Phone: the Invite panel is a bottom sheet like every drawer (drawer.css),
   not a full-screen modal with a blank lower half. It is not a
   .global-drawer-panel, so drawer.js never adds the --sheet class; the shape
   lives here on the panel's own class. Same handle as .global-drawer-head. */
@media (max-width: 767.98px) {
    .core-impersonate-modal.assignments-assign-panel,
    .core-impersonate-modal.assignments-assign-panel.is-open {
        /* Standing on the bottom bar, or over the tab capsule
           (tokens.css --sheet-bottom). */
        inset: auto 0 var(--sheet-bottom) 0;
        width: 100%;
        max-width: none;
        height: auto;
        max-height: calc(100dvh - var(--header-bottom) - var(--sheet-bottom));
        padding-bottom: var(--sheet-pad-bottom);
        border-radius: var(--radius-lg) var(--radius-lg) var(--radius-none) var(--radius-none);
        transform: none;
    }

    .assignments-assign-panel .core-impersonate-modal-header {
        position: relative;
        padding-top: var(--spacing-mdlg);
    }

    /* A long email gives way so the Invite button or pill keeps its full size. */
    .assignments-assign-panel__person,
    .assignments-assign-panel__person-text {
        min-width: 0;
    }

    .assignments-assign-panel__invite-btn,
    .assignments-assign-panel__pending-pill {
        flex-shrink: 0;
    }

    .assignments-assign-panel .core-impersonate-modal-header::before {
        content: "";
        position: absolute;
        top: var(--spacing-sm);
        left: 50%;
        width: var(--sheet-handle-w);
        height: var(--sheet-handle-h);
        translate: -50%;
        border-radius: var(--radius-pill);
        background: var(--color-grey-300);
    }
}

/* A quiet link: Cancel sign-up beside the waiting chip, and under a phone row.
   It is text, not a second button. Armed by confirm-action.js, it turns the
   warning color until the second tap. */
.assignments-quiet-link {
    padding: var(--spacing-2xs) var(--spacing-xs);
    border: none;
    background: none;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
    cursor: pointer;
}

.assignments-quiet-link:hover,
.assignments-quiet-link:focus-visible {
    color: var(--color-text);
}

.assignments-quiet-link.is-confirming {
    color: var(--status-warning-fg);
}

.assignments-quiet-link:disabled {
    opacity: 0.5;
    cursor: default;
}

/* ── Signup terms modal — the card stack a worker reads before sealing the deal ──
   (interface/templates/app/signup/_signup_terms_modal.html)

   Full-width cards in the opportunity edit drawer's writing order rather than a
   2×2 grid: a sparse role (unpaid, virtual, nothing to hand in) reads as a
   stack of real answers instead of a grid with holes. Tokens only — this file
   holds zero raw hex / radius / shadow / font-weight, and the CSS-standards
   ratchet keeps it that way.

   The classes say assignments- while the file says signup-: the prefix charter
   has no signup- prefix (the guard maps it to assignments-, the app these
   modals belong to), but the file sits beside signup-groups.css and is named
   for the surface it styles, like every other component sheet here. The
   data-testids keep the signup-terms- spelling because tests name the surface
   too, and the guard only charters CSS class prefixes. */

.assignments-terms {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-smd);
    margin-bottom: var(--spacing-md);
}

/* One term: an icon chip beside a labelled value. Top-aligned, because the
   scope card's prose grows and the chip should hold its first line. */
.assignments-terms__card {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    background: var(--color-card-bg);
}

/* A term that moved since the worker last saw it wears the warning ramp; what
   it used to say sits struck through in __was below the new value. */
.assignments-terms__card--changed {
    border-color: var(--color-warning-border);
    background: var(--color-warning-bg);
}

.assignments-terms__chip {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-card);
    background: var(--brand-primary-alpha-05);
    color: var(--brand-primary-on-card-bg);
    font-size: var(--font-size-xl);
}

.assignments-terms__card--changed .assignments-terms__chip {
    background: color-mix(in srgb, var(--color-warning) 12%, transparent);
    color: var(--color-warning-text);
}

.assignments-terms__main {
    flex: 1;
    min-width: 0;
}

.assignments-terms__label {
    margin-bottom: var(--spacing-2xs);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
}

/* 17px, between the lg and xl tokens: lg (15px) reads as body text beside an
   11px label, and xl (20px) on every card shouts over the pay figure. */
.assignments-terms__value {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    line-height: 1.3;
    color: var(--color-text);
    overflow-wrap: anywhere;
}

/* The number the worker is really here for. */
.assignments-terms__value--big {
    font-size: 1.375rem;
}

/* A real answer that is deliberately not a headline — Unpaid, Virtual, Not set
   yet. Quiet, so the loud values stay the ones that vary. */
.assignments-terms__value--quiet {
    font-weight: var(--font-weight-body);
    color: var(--color-text-secondary);
}

.assignments-terms__sub {
    margin-top: var(--spacing-2xs);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

/* The scope of work's own sentences, printed as written. */
.assignments-terms__body {
    margin: var(--spacing-2xs) 0 0;
    font-size: var(--font-size-md);
    line-height: 1.55;
    color: var(--color-text);
    overflow-wrap: anywhere;
}

/* What a moved term used to say — the template strikes it, this colors it. */
.assignments-terms__was {
    margin: var(--spacing-2xs) 0 0;
    font-size: var(--font-size-sm);
    color: var(--color-warning-text);
}

/* Phone Sign Up board and role drawer. */

:is(.assignments-phone-head__faces, .assignments-phone-person, .assignments-phone-row__held, .assignments-seat-sheet__person) .global-avatar {
    position: relative;
}

:is(.assignments-phone-head__faces, .assignments-phone-person, .assignments-phone-row__held, .assignments-seat-sheet__person) .global-avatar img {
    position: absolute;
    inset: 0;
    background: inherit;
    opacity: 0;
}

:is(.assignments-phone-head__faces, .assignments-phone-person, .assignments-phone-row__held, .assignments-seat-sheet__person) .global-avatar img.is-ready {
    opacity: 1;
}

.assignments-phone-head,
.assignments-phone-rows,
.assignments-phone-person,
.global-toolbar__menu-wrap.assignments-phone-gear,
.assignments-phone-count {
    display: none;
}

/* The computer's gear sits in a wrapper the phone can hide; on a computer the
   wrapper leaves no box of its own, so the toolbar lays out as it did. */
.assignments-desktop-gear {
    display: contents;
}

.assignments-phone-pay {
    --global-value-pill-start: var(--color-success);
    --global-value-pill-end: var(--color-success-text);
}

.assignments-phone-address {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    max-width: 100%;
    min-height: var(--control-h-touch);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    text-decoration: underline;
    overflow-wrap: anywhere;
}

.assignments-phone-address:focus-visible {
    box-shadow: var(--shadow-focus-ring-tight);
}

.assignments-seat-sheet__panel,
.assignments-seat-sheet__page {
    background: var(--color-card-bg);
}

.assignments-seat-sheet__scrim {
    inset: 0;
    z-index: var(--z-popover);
}

.assignments-seat-sheet__page {
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
}

.assignments-seat-sheet__panel .global-drawer-head__sub,
.assignments-seat-sheet__page .global-drawer-head__sub {
    overflow-wrap: anywhere;
}

.assignments-seat-sheet__page .global-drawer-head {
    padding-top: var(--spacing-md);
}

.assignments-seat-sheet__page .global-drawer-head::before {
    content: none;
}

@media (min-width: 768px) {
    .assignments-seat-sheet__phone-only {
        display: none;
    }
}

.assignments-seat-sheet__tabs {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    padding-inline: var(--spacing-mdlg);
}

.assignments-seat-sheet__tabs .global-tab {
    min-height: var(--control-h-touch);
}

.assignments-seat-sheet__tabs .global-tab:not(.is-active, :hover) {
    color: var(--color-text-secondary);
}

.assignments-seat-sheet--review {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.assignments-seat-sheet--review .global-drawer-body {
    min-height: 0;
    padding-top: var(--spacing-smd);
}

.assignments-seat-sheet--review .assignments-terms {
    gap: var(--spacing-sm);
    margin-bottom: 0;
}

.assignments-seat-sheet--review .assignments-terms__card {
    gap: var(--spacing-smd);
    padding: var(--spacing-smd);
}

.assignments-seat-sheet--review .assignments-terms__chip {
    width: var(--control-h-touch);
    height: var(--control-h-touch);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
}

.assignments-seat-sheet--review .assignments-terms__card:not(.assignments-terms__card--changed) .assignments-terms__chip {
    background: var(--color-surface-subtle);
    color: var(--color-action);
}

.assignments-seat-sheet__day {
    overflow: hidden;
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
}

.assignments-seat-sheet__day + .assignments-seat-sheet__day {
    margin-top: var(--spacing-sm);
}

.assignments-seat-sheet__day-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-xs) var(--spacing-sm);
    margin: 0;
    padding: var(--spacing-smd) var(--spacing-md);
    background: var(--color-surface-subtle);
    font-size: var(--font-size-sm);
}

.assignments-seat-sheet__hours {
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
}

.assignments-seat-sheet__sessions {
    margin: 0;
    padding-inline: var(--spacing-md);
    border-top: 1px solid var(--color-border-subtle);
    list-style: none;
}

.assignments-seat-sheet__session {
    display: grid;
    grid-template-columns: minmax(max-content, calc(2 * var(--spacing-2xl))) minmax(0, 1fr);
    align-items: center;
    column-gap: var(--spacing-sm);
    padding-block: var(--spacing-sm);
    font-size: var(--font-size-sm);
}

.assignments-seat-sheet__session + .assignments-seat-sheet__session {
    border-top: 1px solid var(--color-border-hairline);
}

.assignments-seat-sheet__session-name {
    grid-column: 2;
    color: var(--color-text);
    font-weight: var(--font-weight-heading);
    overflow-wrap: anywhere;
}

.assignments-seat-sheet__hint {
    margin: 0;
    color: var(--color-text-secondary);
}

.assignments-seat-sheet__picker {
    margin-bottom: var(--spacing-sm);
}

.assignments-seat-sheet__picker .btn,
.assignments-seat-sheet__picker input,
.assignments-seat-sheet__confirm,
.assignments-seat-sheet__actions .assignments-quiet-link {
    min-height: var(--control-h-touch);
}

.assignments-seat-sheet__picker .assignments-seat-sheet__assign:not(:empty) {
    margin-top: var(--spacing-smd);
}

.assignments-seat-sheet__actions {
    background: var(--color-card-bg);
    gap: var(--spacing-sm);
    justify-content: center;
    padding: var(--spacing-smd) var(--spacing-mdlg);
}

.assignments-seat-sheet__reply {
    display: grid;
    justify-items: center;
    gap: var(--spacing-xs);
    width: 100%;
}

.global-modal .assignments-seat-sheet__confirm {
    padding-inline: var(--spacing-2xl);
    font-size: var(--font-size-xl);
}

.assignments-seat-sheet__directions {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xsm);
    min-height: var(--control-h-sm);
    margin-top: var(--spacing-xsm);
    padding: 0 var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    color: var(--color-text);
    font-weight: var(--font-weight-heading);
    text-decoration: none;
}

.assignments-seat-sheet__section {
    padding: var(--spacing-md) 0 0;
}

.assignments-seat-sheet__heading {
    margin: 0 0 var(--spacing-sm);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-heading);
    color: var(--color-text-secondary);
}

.assignments-seat-sheet__people {
    margin: 0;
    padding: 0;
    list-style: none;
}

.assignments-seat-sheet__person {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-smd);
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--color-border-hairline);
}

.assignments-seat-sheet__people-tab .assignments-seat-sheet__section {
    padding-top: 0;
}

.assignments-seat-sheet__people-tab .assignments-seat-sheet__section + .assignments-seat-sheet__section {
    margin-top: var(--spacing-smd);
}

.assignments-seat-sheet__people-tab .assignments-seat-sheet__heading {
    margin-bottom: var(--spacing-xsm);
}

.assignments-seat-sheet__people-tab .assignments-seat-sheet__person {
    padding-block: var(--spacing-xs);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-subheading);
}

.assignments-seat-sheet__people-tab .assignments-seat-sheet__person .global-avatar {
    width: var(--spacing-xl);
    height: var(--spacing-xl);
    font-size: var(--font-size-xs);
}

.assignments-seat-sheet__people-tab .assignments-seat-sheet__who small {
    font-size: var(--font-size-xs);
}

.assignments-seat-sheet__person:last-child {
    border-bottom: none;
}

.assignments-seat-sheet__person .global-avatar,
.assignments-seat-sheet__icon {
    flex-shrink: 0;
    width: var(--control-h-base);
    height: var(--control-h-base);
}

.assignments-seat-sheet__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--color-surface-subtle);
}

.assignments-seat-sheet__who {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    overflow-wrap: anywhere;
}

.assignments-seat-sheet__who small {
    color: var(--color-text-secondary);
}

/* Approve and Deny, and Call and Text, drop under the name and split the row. */
.assignments-seat-sheet__answer {
    display: flex;
    flex-basis: 100%;
    gap: var(--spacing-sm);
}

.assignments-seat-sheet__answer--decision {
    flex-wrap: wrap;
    min-width: 0;
}

.assignments-seat-sheet__answer--decision > * {
    flex: 1 1 0;
    min-width: 0;
}

.assignments-seat-sheet__answer--decision .assignments-seat-sheet__btn {
    width: 100%;
}

.assignments-seat-sheet__denial[open] {
    flex-basis: 100%;
}

.assignments-seat-sheet__denial form {
    display: grid;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.assignments-seat-sheet__denial .form-label {
    margin-bottom: 0;
}

.assignments-seat-sheet__denial summary::-webkit-details-marker {
    display: none;
}

.assignments-seat-sheet__assign [data-send-invite] {
    width: auto;
    min-height: var(--control-h-touch);
    padding-inline: var(--spacing-sm);
    border-style: solid;
    border-radius: var(--radius-pill);
    color: var(--color-text);
    white-space: nowrap;
}

.assignments-seat-sheet__btn {
    display: inline-flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xsm);
    padding: 0 var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-card-bg);
    color: var(--color-text);
    font-weight: var(--font-weight-heading);
    text-decoration: none;
}

.assignments-seat-sheet__person > .assignments-seat-sheet__btn {
    flex: 0 0 auto;
}

.assignments-seat-sheet__btn--yes {
    border-color: var(--color-action);
    background: var(--color-action);
    color: var(--color-card-bg);
}

.assignments-seat-sheet__done {
    flex-basis: 100%;
    font-weight: var(--font-weight-heading);
    color: var(--color-success-text);
}

/* Today's assign list, laid flat inside the seat: no floating panel, no
   backdrop, the list as long as it is. */
.core-impersonate-modal.assignments-assign-panel.assignments-assign-panel--inline,
.core-impersonate-modal.assignments-assign-panel.assignments-assign-panel--inline.is-open {
    position: static;
    inset: auto;
    width: auto;
    max-width: none;
    height: auto;
    max-height: none;
    border-radius: var(--radius-none);
    box-shadow: none;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    transition: none;
}

.assignments-assign-panel--inline .core-impersonate-modal-body {
    overflow: visible;
    max-height: none;
    padding: 0;
}

.assignments-assign-panel--inline .core-impersonate-modal-filters {
    padding: 0 0 var(--spacing-sm);
}

/* ── Phone ── last in the file. */
@media (max-width: 767.98px) {
    /* The wide header and role rows give way to the compact ones. */
    .assignments-group__header,
    .assignments-role-row {
        display: none;
    }

    /* A grid item never shrinks below its content unless told it may, and a
       long booking name would otherwise push the card past the screen's edge. */
    .assignments-group {
        min-width: 0;
    }

    .assignments-phone-head {
        position: relative;
        z-index: var(--z-raised);
        display: grid;
        justify-items: start;
        gap: var(--spacing-xs);
        padding: var(--spacing-smd) var(--spacing-md) var(--spacing-xs);
    }

    .assignments-phone-head__pill {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: var(--control-h-touch);
        padding: var(--spacing-sm) var(--spacing-md);
        border-radius: var(--radius-pill);
        background: var(--color-action);
        color: var(--color-card-bg);
        font-size: var(--font-size-lg);
        font-weight: var(--font-weight-heading);
        line-height: var(--line-height-subheading);
        text-align: center;
        text-decoration: none;
    }

    .assignments-phone-head__name {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .assignments-phone-head__date {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        justify-self: center;
        gap: var(--spacing-xs) var(--spacing-sm);
        width: 100%;
        min-height: var(--control-h-touch);
        padding: var(--spacing-xsm) var(--spacing-smd);
        border: 1px solid var(--color-border-hairline);
        border-radius: var(--radius-pill);
        background: var(--color-surface-subtle);
        color: var(--color-text);
        font-size: var(--font-size-xs);
        text-align: center;
        overflow-wrap: anywhere;
    }

    .assignments-phone-head__date > span {
        color: var(--color-text-secondary);
    }

    .assignments-phone-address {
        gap: var(--spacing-2xs);
        margin-block: calc(var(--spacing-xs) - var(--spacing-sm));
    }

    .assignments-phone-address .bi-geo-alt {
        flex: none;
        color: var(--color-error);
        font-size: var(--font-size-base);
    }

    /* The link box is the tap area. It sits above the photo button padding. */
    .assignments-phone-head > .assignments-phone-address {
        z-index: var(--z-raised);
        justify-self: center;
        overflow: clip;
        line-height: var(--line-height-heading);
    }

    /* Shift the buttons up by their top padding so the faces start at the link edge. */
    .assignments-phone-roster {
        width: 100%;
        min-width: 0;
        margin-block-start: calc(var(--spacing-2xs) - var(--spacing-sm));
    }

    .assignments-phone-roster__strip {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* The row shares both edges of the title. The script sets --roster-slot:
       a face and the gap after it. A long team ends on half a face. */
    .assignments-phone-head__faces {
        flex: 1 1 auto;
        min-width: 0;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }
    .assignments-phone-roster[data-roster-more-ahead] .assignments-phone-head__faces {
        mask-image: linear-gradient(to right, currentColor calc(100% - var(--spacing-smd)),
            color-mix(in srgb, currentColor 86%, transparent) calc(100% - var(--spacing-sm)),
            color-mix(in srgb, currentColor 50%, transparent) calc(100% - var(--spacing-xs)), transparent);
    }

    .assignments-phone-head__faces::-webkit-scrollbar {
        display: none;
    }

    .assignments-phone-roster__people {
        display: flex;
        justify-content: center;
        width: max-content;
        min-width: 100%;
    }

    .assignments-phone-head__faces .global-avatar {
        font-size: var(--font-size-2xs);
    }

    .assignments-phone-roster__person {
        display: grid;
        flex: 0 0 auto;
        place-items: center start;
        width: var(--roster-slot, calc(var(--spacing-xl) + var(--spacing-xs)));
        height: var(--control-h-touch);
        padding: 0;
        border: 0;
        border-radius: var(--radius-sm);
        background: transparent;
        cursor: pointer;
        scroll-snap-align: start;
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }

    /* No gap follows the last face. A short team centers on its faces, and
       the end of a long row shows the last face whole at the far edge. */
    .assignments-phone-roster__person:last-child {
        width: var(--spacing-xl);
    }

    .assignments-phone-roster__person:focus-visible {
        outline: var(--spacing-2xs) solid var(--color-focus-ring);
        outline-offset: calc(-1 * var(--spacing-2xs));
    }

    .assignments-phone-roster__person[aria-expanded="true"] .global-avatar {
        outline: var(--spacing-2xs) solid var(--color-action);
    }

    .assignments-phone-person:not([hidden]) {
        position: sticky;
        z-index: var(--z-dropdown);
        inset-block-start: calc(var(--header-bottom) + var(--spacing-xs));
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: var(--spacing-sm);
        margin: 0 var(--spacing-md) var(--spacing-sm);
        min-block-size: calc(var(--spacing-xl) + var(--control-h-touch) + var(--spacing-xs));
        max-block-size: 40dvh;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        padding: var(--spacing-sm) var(--spacing-2xs) var(--spacing-sm) var(--spacing-sm);
        border: 1px solid var(--color-border-hairline);
        border-radius: var(--radius-card);
        background: var(--color-card-bg);
        box-shadow: var(--shadow-card-soft);
        overflow-anchor: none;
    }

    .assignments-phone-person[data-roster-float]:not([hidden]) {
        position: fixed;
        inset-inline: calc(var(--page-gutter) + var(--spacing-md));
        margin: 0;
    }

    .assignments-phone-person [data-roster-card-photo] {
        display: flex;
    }

    .assignments-phone-person__identity {
        overflow-wrap: anywhere;
    }

    .assignments-phone-person__identity h2 {
        margin: 0;
        font-size: var(--font-size-lg);
        font-weight: var(--font-weight-heading);
        line-height: var(--line-height-subheading);
    }

    .assignments-phone-person__identity ul {
        margin: 0;
        padding: 0;
        color: var(--color-text-secondary);
        font-size: var(--font-size-sm);
        list-style: none;
    }

    .assignments-phone-person__close {
        display: grid;
        place-items: center;
        min-width: var(--control-h-touch);
        min-height: var(--control-h-touch);
        padding: 0;
        border: 0;
        border-radius: var(--radius-pill);
        background: transparent;
        color: var(--color-text-secondary);
        cursor: pointer;
    }

    .assignments-phone-rows {
        position: relative;
        z-index: var(--z-raised);
        display: block;
        margin: 0 var(--spacing-sm);
        padding: 0 0 var(--spacing-xsm);
        border-top: 1px solid var(--color-border-hairline);
        list-style: none;
    }

    .assignments-phone-rows li + li .assignments-phone-row {
        border-top: 1px solid var(--color-border-hairline);
    }

    .assignments-phone-row {
        display: flex;
        align-items: center;
        gap: var(--spacing-sm);
        width: 100%;
        min-height: calc(var(--control-h-touch) + var(--spacing-sm));
        padding: var(--spacing-sm);
        color: var(--color-text);
        text-align: left;
        text-decoration: none;
    }

    .assignments-phone-row__main {
        display: flex;
        flex: 1;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-2xs);
        min-width: 0;
    }

    .assignments-phone-row:has(.assignments-phone-row__invite--wide) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) fit-content(48%) auto;
    }

    .assignments-phone-row:has(.assignments-phone-row__invite--wide) > .assignments-phone-row__main {
        display: grid;
        grid-template-columns: subgrid;
        grid-column: 1 / -1;
        grid-row: 1;
        column-gap: inherit;
    }

    .assignments-phone-row:has(.assignments-phone-row__invite--wide) > .assignments-phone-row__main > :not(.assignments-phone-row__invite) {
        grid-column: 1;
        justify-self: start;
        max-width: 100%;
    }

    .assignments-phone-row:has(.assignments-phone-row__invite--wide) > .assignments-phone-row__chip {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        max-width: none;
    }

    .assignments-phone-row:has(.assignments-phone-row__invite--wide) > .assignments-phone-row__chevron {
        grid-column: 3;
        grid-row: 1;
    }

    .assignments-phone-row__invite {
        align-self: stretch;
        min-width: 0;
    }

    .assignments-phone-row__invite--wide {
        grid-column: 1 / -1;
        margin-block-start: var(--invite-clearance, 0px);
    }

    .assignments-phone-row__role {
        font-size: var(--font-size-md);
        font-weight: var(--font-weight-heading);
        line-height: var(--line-height-subheading);
        overflow-wrap: anywhere;
    }

    .assignments-phone-badges {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--spacing-2xs);
        max-width: 100%;
    }

    .assignments-phone-badges .global-seat-badge {
        max-width: 100%;
        height: auto;
        min-height: var(--sb-h);
        margin: 0;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .assignments-phone-badges .global-seat-badge__more {
        margin: 0;
    }

    .assignments-phone-row__when {
        color: var(--color-text-secondary);
        font-size: var(--font-size-xs);
        line-height: var(--line-height-accent);
        overflow-wrap: anywhere;
    }

    .assignments-phone-row__when > span + span::before {
        content: " · ";
    }

    .assignments-phone-row__place {
        display: inline-flex;
        align-items: center;
        gap: var(--spacing-2xs);
        color: var(--color-text-secondary);
        font-size: var(--font-size-xs);
        line-height: var(--line-height-accent);
        overflow-wrap: anywhere;
    }

    .assignments-phone-row__place .bi-geo-alt {
        flex: none;
        color: var(--color-error);
    }

    .assignments-phone-row__chip {
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        gap: var(--spacing-xs);
        max-width: 48%;
        padding: var(--spacing-xs) var(--spacing-sm);
        border-radius: var(--radius-pill);
        background: var(--color-surface-subtle);
        color: var(--color-text-secondary);
        font-size: var(--font-size-2xs);
        font-weight: var(--font-weight-heading);
        line-height: var(--line-height-heading);
        overflow-wrap: anywhere;
    }

    .assignments-phone-row__main .assignments-phone-row__chip {
        max-width: 100%;
    }

    .assignments-phone-row__status {
        max-width: 48%;
        color: var(--color-text-secondary);
        font-size: var(--font-size-xs);
        text-align: end;
        overflow-wrap: anywhere;
    }

    .assignments-phone-row__held {
        display: flex;
        align-items: center;
        gap: var(--spacing-xs);
        max-width: 100%;
        margin-top: var(--spacing-2xs);
        min-width: 0;
    }

    .assignments-phone-row__held-name {
        min-width: 0;
        font-size: var(--font-size-sm);
        font-weight: var(--font-weight-heading);
        overflow-wrap: anywhere;
    }

    .assignments-phone-row__chip--open {
        border: 1px solid var(--color-border);
        background: var(--color-card-bg);
        color: var(--color-text);
    }

    .assignments-phone-row__chip--mine {
        background: var(--color-success-bg);
        color: var(--color-success-text);
    }

    /* The viewer's own invite on a day they marked unavailable (Nick 11-07, pick 3). */
    .assignments-phone-row__chip--unavailable {
        background: var(--status-warning-bg);
        color: var(--status-warning-fg);
    }

    .assignments-phone-row__chip--waiting {
        background: var(--color-warning-bg);
        color: var(--color-warning-text);
    }

    /* The quiet link a row's own waiting sign-up takes, under the row: the row
       is one button, and a link cannot live inside it. */
    .assignments-phone-row__after {
        padding: 0 var(--spacing-sm) var(--spacing-xs);
    }

    .assignments-phone-row__chevron {
        display: grid;
        place-items: center;
        flex-shrink: 0;
        color: var(--color-text-secondary);
        line-height: var(--line-height-heading);
    }

    /* One strip at the foot: the phone's own bar. The view bar's count and
       buttons fold into the toolbar row's gear. */
    .global-app-main:has(.assignments-phone-gear) .global-view-bar,
    .assignments-desktop-gear {
        display: none;
    }

    .global-toolbar__actions:has(.assignments-phone-gear) {
        flex: 1;
    }

    .assignments-phone-count {
        display: inline-flex;
        margin-right: auto;
    }

    .global-toolbar__menu-wrap.assignments-phone-gear {
        display: inline-flex;
    }

    /* menu.css draws the menu and its rows; a phone only makes each row a thumb's height. */
    .assignments-phone-gear__menu {
        display: flex;
        flex-direction: column;
    }

    .assignments-phone-gear__menu .global-menu__option,
    .assignments-phone-gear__menu .global-drawer__btn {
        min-height: var(--control-h-touch);
    }

    .assignments-seat-sheet__desktop-only {
        display: none;
    }

    :root:has(.assignments-seat-sheet__panel.is-open) {
        scrollbar-gutter: auto;
    }

    .assignments-seat-sheet__panel,
    .assignments-seat-sheet__page {
        --seat-gutter-left: max(var(--spacing-md), env(safe-area-inset-left));
        --seat-gutter-right: max(var(--spacing-md), env(safe-area-inset-right));
        border: 0;
        border-radius: var(--radius-none);
    }

    .assignments-seat-sheet__panel {
        inset: 0 auto 0 0;
        width: 100vw;
        height: 100dvh;
        overflow: hidden;
        padding-bottom: var(--safe-bottom);
        box-shadow: none;
    }

    .global-app-content:has(> .assignments-seat-sheet__page) {
        padding-inline: 0;
    }

    :is(.assignments-seat-sheet__panel, .assignments-seat-sheet__page) .global-drawer-head {
        align-items: flex-start;
        padding: var(--spacing-md) var(--seat-gutter-right) var(--spacing-md) var(--seat-gutter-left);
    }

    .assignments-seat-sheet__panel .global-drawer-head {
        padding-top: calc(var(--spacing-md) + var(--safe-top));
    }

    .assignments-seat-sheet__panel .global-drawer-head__text {
        max-height: 30dvh;
        overflow-y: auto;
        overscroll-behavior-y: contain;
    }

    .global-drawer-head__text > .assignments-phone-badges {
        margin-top: var(--spacing-2xs);
    }

    :is(.assignments-seat-sheet__panel, .assignments-seat-sheet__page) .global-drawer-head__title {
        font-size: var(--font-size-xl);
        overflow-wrap: anywhere;
    }

    .assignments-seat-sheet--review .assignments-seat-sheet__tabs {
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: var(--spacing-lg);
        overflow-x: auto;
        overscroll-behavior-x: contain;
        padding-inline: var(--seat-gutter-left) var(--seat-gutter-right);
        scroll-padding-inline: var(--seat-gutter-left) var(--seat-gutter-right);
        scrollbar-width: none;
    }

    .assignments-seat-sheet__tabs .global-tab {
        flex: 0 0 auto;
        min-width: var(--control-h-touch);
        margin-bottom: 0;
        padding-inline: 0;
        font-size: var(--font-size-lg);
        white-space: nowrap;
    }

    .assignments-seat-sheet__tabs .global-tab:focus-visible {
        outline-offset: calc(-1 * var(--spacing-2xs));
    }

    .assignments-seat-sheet--review .global-drawer-body {
        padding: 0 var(--seat-gutter-right) var(--spacing-sm) var(--seat-gutter-left);
    }

    .assignments-seat-sheet--review .assignments-terms {
        gap: 0;
    }

    .assignments-seat-sheet--review .assignments-terms__card,
    .assignments-seat-sheet__day {
        padding: var(--spacing-md) 0;
        border: 0;
        border-bottom: 1px solid var(--color-border-subtle);
        border-radius: var(--radius-none);
        background: none;
    }

    .assignments-seat-sheet--review .assignments-terms__card--changed {
        border-bottom-color: var(--color-warning-border);
    }

    .assignments-seat-sheet--review .assignments-terms__chip,
    .assignments-seat-sheet--review .assignments-seat-sheet__icon {
        display: none;
    }

    .assignments-seat-sheet__day + .assignments-seat-sheet__day {
        margin-top: 0;
    }

    .assignments-seat-sheet__day-head,
    .assignments-seat-sheet__sessions {
        padding: 0;
        border: 0;
        background: none;
    }

    .assignments-seat-sheet__actions {
        margin: 0;
        padding-inline: var(--seat-gutter-left) var(--seat-gutter-right);
        border-radius: var(--radius-none);
    }

    .assignments-seat-sheet__panel > form {
        flex: 0 0 auto;
    }

    .assignments-seat-sheet__actions .assignments-seat-sheet__confirm {
        flex: 1 1 auto;
    }

    .assignments-seat-sheet__reply .assignments-seat-sheet__confirm {
        width: 100%;
    }

    .assignments-seat-sheet__btn,
    .assignments-seat-sheet__directions,
    .assignments-phone-row__after .assignments-quiet-link {
        min-height: var(--control-h-touch);
    }
}

@media (max-width: 767.98px) and (prefers-reduced-motion: no-preference) {
    .assignments-phone-person:not([hidden]) {
        animation: signup-person-enter var(--transition-normal);
    }

    @keyframes signup-person-enter {
        from { transform: translateY(calc(-1 * var(--spacing-md))); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }

    .assignments-seat-sheet__panel.is-open {
        animation: signup-seat-enter var(--transition-normal);
    }

    @keyframes signup-seat-enter {
        from { transform: translateX(100%); }
        to { transform: translateX(0); }
    }
}

/* Platform-wide star-rating atom. `.global-star-rating` is the canonical READ-ONLY
   score display (partial-fill stars) and `.global-star-rating-input` is the canonical
   INTERACTIVE 1-5 picker. One home for both halves so a rating never gets hand-rolled
   again.

       <span class="global-star-rating global-star-rating--sm">
         <span class="global-star-rating__value">4.7</span>
         <span class="global-star-rating__stars">
           <span class="global-star-rating__star" style="--fill: 100%"></span>…
         </span>
         <span class="global-star-rating__count">(23)</span>
       </span>

   Partial fill is driven by the per-star `--fill` custom property (0-100%): the
   server sets it with the `star_fill_percent` filter, Alpine sets it with the
   matching `starFill()` helper in worker-skills.js. Both halves are token-only —
   the gold is `--color-warning`, the empty track is `--color-border`. */

.global-star-rating {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xsm);
    font-size: var(--font-size-md);
    line-height: 1;
}

.global-star-rating__value {
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.global-star-rating__stars {
    display: inline-flex;
    gap: var(--spacing-2xs);
}

/* One star box. The glyph is drawn TWICE — ::before is the empty track, ::after is
   the gold overlay clipped to `--fill` — which is what makes a 3.5 read as half a
   star instead of rounding. */
.global-star-rating__star {
    position: relative;
    display: inline-block;
    width: 1em;
    height: 1em;
    font-size: var(--font-size-base);
}

.global-star-rating__star::before {
    content: "\2605";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--color-border);
}

.global-star-rating__star::after {
    content: "\2605";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--color-warning);
    clip-path: inset(0 calc(100% - var(--fill, 0%)) 0 0);
}

.global-star-rating__count {
    color: var(--color-text-light);
    font-size: var(--font-size-sm);
}

/* ── Display size variants ── the block scales its text, the stars scale with it. */
.global-star-rating--sm {
    font-size: var(--font-size-xs);
}

.global-star-rating--sm .global-star-rating__star {
    font-size: var(--font-size-md);
}

.global-star-rating--lg {
    font-size: var(--font-size-base);
}

.global-star-rating--lg .global-star-rating__star {
    font-size: var(--font-size-xl);
}

/* ── Input ── five buttons + a live "n / 5" label. State comes from Alpine, which
   toggles `.is-active` (committed) and `.is-hover` (preview) on each button. */
.global-star-rating-input {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.global-star-rating-input__btn {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-border);
    transition: color 0.15s ease, transform 0.15s ease;
    background: none;
    border: none;
    padding: var(--spacing-2xs);
    line-height: 1;
}

.global-star-rating-input__btn:hover {
    transform: scale(1.15);
}

.global-star-rating-input__btn:focus {
    outline: none;
}

.global-star-rating-input__btn:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.global-star-rating-input__btn.is-active,
.global-star-rating-input__btn.is-hover {
    color: var(--color-warning);
}

/* Hover preview sits a shade lighter than a committed star (--color-warning) so the
   two read apart mid-pick. There is no lighter-gold token, so the literal is kept and
   COUNTED in the css-standards baseline — never hidden behind a color-mix with the
   `white` keyword, which the hex ratchet can't see. */
.global-star-rating-input__btn.is-hover:not(.is-active) {
    color: #fcd34d;
}

.global-star-rating-input__btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.global-star-rating-input__label {
    margin-left: var(--spacing-sm);
    font-size: var(--font-size-md);
    color: var(--color-text-light);
}

.global-star-rating-input--sm .global-star-rating-input__btn {
    font-size: var(--font-size-xl);
}

.global-star-rating-input--lg .global-star-rating-input__btn {
    font-size: 2rem;
}

/* Rating-card avatar — DELETED. It was a brand-fill modifier on top of the old
   `.avatar` base; rating cards now use the atom's own fill:
   `.global-avatar .global-avatar--md|--lg .global-avatar--ink`. */

/* Skill pill hover state. The SHAPE is .global-chip now (components/chip.css) —
   the styleguide's adoption sweep names .workers-skill-pill as one of the hand-rolled
   tags that component exists to absorb — so this class kept only the job the
   chip deliberately does not do: mark this tag as a hover target, because
   hovering it opens the competency tooltip.

   The hover fill is one step down the grey ramp from the chip's own
   --color-surface-subtle. It was #e2e8f0 !important: a blue-grey off the brand
   ramp, and the bang existed to beat the Bootstrap .bg-light this pill used to
   carry. Both went with that class — .workers-skill-pill:hover already outweighs
   .global-chip on specificity, so the fill lands without forcing it. */
.workers-skill-pill {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.workers-skill-pill:hover {
    background-color: var(--color-grey-200);
}

/* The pill's tone: what the profile card's standing badge spells out, said in
   colour instead (skill_pill.html) — amber for Incomplete, red for Expired,
   and a Qualified holding stays the plain chip, so the one coloured chip on
   a row IS the signal. The tones are the badge's own (badge.css, the
   --status-* pairs), so the card and the roster agree; red is the colour
   tokens.css reserves for a genuine failure, and a lapsed cert keeps a person
   off the work, which is exactly that — so red alone also gets a faint edge,
   and the one failure reads first even beside amber. The word is still in the
   chip for a screen reader (.visually-hidden), and the hover says it in full.

   Doubled class on purpose: this sheet loads before chip.css, so a lone
   modifier at .global-chip's own specificity would lose the fill to it.
   Each tone names its own hover a step deeper for the same reason — the
   grey hover above would otherwise wipe the tint on the way in. */
.workers-skill-pill.workers-skill-pill--incomplete {
    background: var(--status-warning-bg);
    color: var(--status-warning-fg);
}

.workers-skill-pill.workers-skill-pill--incomplete:hover {
    background: color-mix(in srgb, var(--color-warning) 18%, transparent);
}

.workers-skill-pill.workers-skill-pill--expired {
    background: var(--status-danger-bg);
    color: var(--color-error);
    border-color: color-mix(in srgb, var(--color-error) 35%, transparent);
}

.workers-skill-pill.workers-skill-pill--expired:hover {
    background: color-mix(in srgb, var(--color-error) 18%, transparent);
}

/* Skill-rating tooltip panel: see .global-tooltip--rich in
   components/global-tooltip.css. */

/* ============================================
   Toast Notifications (platform-standard)
   One card, bottom-left of the content area, single slot
   (newest replaces oldest).

   Brand-free, but no longer status-free. It held zero status
   color so it would read the same for every tenant — but the
   tenant also picks the chrome behind it, and a fixed dark bar
   on a dark sidebar measured 1.03:1. So the card is the page's
   own white, set apart by a border and a shadow instead of by
   a color a tenant can collide with, and the only thing that
   varies is a status rail and glyph. Those use the platform
   status tokens, which branding.py cannot override.

   Self-contained: CSS variable fallbacks let it work on
   pages that don't load main.css (e.g. public booking).
   ============================================ */

.global-toast-container {
    position: fixed;
    /* Pin to the bottom-left corner. top/right are set to auto on purpose so
       no stray utility rule can drag the bar to the top-right — bottom + left
       always win here. */
    top: auto;
    right: auto;
    bottom: var(--spacing-lg, 1.5rem);
    /* The page gutter. This is the whole offset on a page with no sidebar —
       sign-in, public booking — and the base the rail rules below add to. */
    left: var(--spacing-md, 1rem);
    z-index: var(--z-toast, 1090);
    display: flex;
    flex-direction: column;
    pointer-events: none;
    /* The card's width range lives here, not on .global-toast: a fixed box with only
       `left` set shrinks to fit, so a long message stops at 460 and a short one
       is held at 320 rather than shrinking to the size of its own sentence. */
    min-width: 320px;
    max-width: 460px;
}

.global-toast-container.global-toast-container--inline {
    position: static;
    inset: auto;
    flex: 0 0 auto;
    min-width: 0;
    max-width: none;
    margin-top: var(--spacing-xs);
}

.global-toast-container--inline:empty {
    display: none;
}

/* Clear the sidebar, which has two widths. This was one fixed `calc(56px +
   1rem)` — the collapsed width — so an open sidebar covered 184px of the toast,
   and the toast is where a failed action goes to be explained.

   #global-toast-container is a sibling of .global-app-layout, not a child (base.html renders
   it after the block app.html fills), so the state class is read across `~`.
   Below 1024px the sidebar is off-canvas and .global-app-main's margin is 0, so the
   gutter above is already right and these must not apply. */
@media (min-width: 1024px) {
    .global-app-layout ~ .global-toast-container {
        left: calc(var(--sidebar-collapsed-width, 56px) + var(--spacing-md, 1rem));
    }

    .global-app-layout:not(.is-sidebar-collapsed) ~ .global-toast-container {
        left: calc(var(--sidebar-width, 256px) + var(--spacing-md, 1rem));
    }
}

/* display: flex !important predates the .global-toast rename, when Bootstrap's
   .toast:not(.show) { display: none } used to hit this card. The class no
   longer collides, but the !important stays: a cached pre-rename toast.js can
   still stamp the old Bootstrap-colliding class list for a deploy window. */
.global-toast-container .global-toast {
    /* Named once here, used by every part below. The fallbacks are this file's
       self-contained half — a booking page loads no tokens.css — and naming
       them once is what stops that from meaning five copies of each literal. */
    --toast-bg: var(--color-card-bg, #ffffff);
    --toast-border: var(--color-border, #d0d4db);
    --toast-text: var(--color-text, #232323);
    --toast-text-muted: var(--color-text-secondary, #64748b);
    /* The glyph and the message have to share a line box, or the glyph stops
       sitting on the first line's baseline. One value, read by both. */
    --toast-line-height: 1.45;
    /* Info is the base, so it needs no rule of its own — and a toast built by a
       stale cached toast.js, with no status class at all, still gets a rail and
       a glyph that agree with each other. */
    --toast-status: var(--color-info, #6431da);

    display: flex !important;
    align-items: stretch;
    background: var(--toast-bg);
    border: 1px solid var(--toast-border);
    /* The status rail: the left border, widened and colored, so a status
       class only has to name a color. */
    border-left: 3px solid var(--toast-status);
    border-radius: var(--radius-md, 6px);
    /* Deeper and softer than --shadow-lg, whose 0.10 alpha disappears against a
       grey page. A white card on a near-white page is set apart by this and the
       border or by nothing at all, so it is tuned here, not taken from the
       shared elevation step. */
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.2);
    overflow: hidden;
    pointer-events: auto;
    /* Fill the container so its 320–460px range above decides the card's
       width. (Historically Bootstrap's .toast — a name this card carried
       before the .global-toast rename — pinned every toast to a flat 350px
       because our rule set no width of its own.) */
    width: 100%;

    transform: translateX(-120%);
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.global-toast-container .global-toast.global-toast-success {
    --toast-status: var(--color-success, #00823a);
}

.global-toast-container .global-toast.global-toast-error {
    --toast-status: var(--color-error, #d9002b);
}

/* Not --color-warning: amber measures 2.15:1 on white, under the 3:1 a
   non-text indicator needs. --status-warning-fg is the same hue darkened
   for exactly this, and it is what the rest of the app already uses. The
   fallback is that token's color-mix flattened, since a booking page has
   neither the mix's inputs nor the token itself. */
.global-toast-container .global-toast.global-toast-warning {
    --toast-status: var(--status-warning-fg, #8a6c31);
}

.global-toast-container .global-toast.global-toast-neutral {
    --toast-status: var(--toast-text-muted);
}

.global-toast-container .global-toast.is-toast-show {
    transform: translateX(0);
    opacity: 1;
}

.global-toast-container .global-toast.is-toast-hiding {
    transform: translateX(-120%);
    opacity: 0;
}

.global-toast-body {
    display: flex;
    align-items: center;
    gap: var(--spacing-md, 1rem);
    padding: var(--spacing-md, 1rem);
    flex: 1;
    min-width: 0;
    /* A short message keeps its action alongside. A long one would otherwise
       squeeze into a sliver of a column, so the action drops to its own line. */
    flex-wrap: wrap;
}

/* The glyph belongs to the sentence, so it sits inside the wrap boundary above:
   the action may drop to its own line, the icon never does. Without this the
   icon is just another wrappable sibling, and a three-line message pushes it
   onto a line by itself. */
.global-toast-main {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm, 0.5rem);
    flex: 1 1 auto;
    min-width: 0;
}

.global-toast-glyph {
    flex: 0 0 auto;
    color: var(--toast-status);
    font-size: var(--font-size-lg, 0.9375rem);
    line-height: var(--toast-line-height);
}

.global-toast-message {
    font-size: var(--font-size-lg, 0.9375rem);
    /* The house medium weight, from Nick's text weight pick on 11-09. The
       fallback keeps it on a page that loads no tokens.css. */
    font-weight: var(--font-weight-medium, 600);
    line-height: var(--toast-line-height);
    color: var(--toast-text);
    word-break: break-word;
    /* Sized from its own text so flex breaks the line on a long sentence and
       keeps a short one next to its action. */
    flex: 1 1 auto;
    min-width: 0;
}

/* Action = underlined text in the message's own color, nothing more. */
.global-toast-action {
    flex-shrink: 0;
    margin-left: auto;
    background: transparent;
    border: none;
    padding: 0;
    font-size: var(--font-size-md, 0.875rem);
    font-weight: var(--font-weight-medium, 600);
    color: var(--toast-text);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.global-toast-action:hover,
.global-toast-action:focus-visible {
    color: var(--toast-text-muted);
}

.global-toast-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    background: transparent;
    border: none;
    border-left: 1px solid var(--toast-border);
    color: var(--toast-text-muted);
    font-size: var(--font-size-xl, 1.25rem);
    cursor: pointer;
    transition: color var(--transition-fast, 0.15s ease);
}

.global-toast-close:hover {
    color: var(--toast-text);
}

@media (max-width: 480px) {
    .global-toast-container {
        left: var(--spacing-sm, 0.5rem);
        right: var(--spacing-sm, 0.5rem);
        bottom: var(--spacing-sm, 0.5rem);
        /* Page gutters at the sides; clear of the home indicator below. */
        inset: auto var(--page-gutter, 1rem)
            calc(var(--safe-bottom, env(safe-area-inset-bottom, 0px)) + var(--spacing-md, 1rem))
            var(--page-gutter, 1rem);
        /* Both gutters are set, so the container is already the width of the
           screen minus them. Carrying a 320px floor through would push a 320px
           phone into a horizontal scroll. */
        min-width: 0;
        max-width: none;
    }
}

/* High-contrast: tokens.css drops the app's shadows here and swaps
   --color-border for near-black, so the card's separation moves entirely
   onto the border. Carrying a 34px shadow through would be the one element
   still casting one. */
@media (prefers-contrast: more) {
    .global-toast-container .global-toast {
        box-shadow: none;
    }
}

/* Respect reduced-motion — appear without sliding. */
@media (prefers-reduced-motion: reduce) {
    .global-toast-container .global-toast {
        transition: opacity 0.3s ease-out;
        transform: none;
    }

    .global-toast-container .global-toast.is-toast-show,
    .global-toast-container .global-toast.is-toast-hiding {
        transform: none;
    }
}

/* Every drawer is a bottom sheet on a phone, and its Cancel/Save row sits on
   the same bottom band the toast does. While a drawer holds the body lock
   (drawer.js sets body.is-drawer-lock while a panel is open) the
   toast moves under the header, so "Saved." never covers the button that saved. */
@media (max-width: 767.98px) {
    /* Above the bottom bar (tokens.css --bottom-bar-h, which already carries
       the home indicator). Wins over the 480px inset above by source order. */
    .global-toast-container {
        bottom: calc(var(--bottom-bar-h, 0px) + var(--spacing-md, 1rem));
    }

    .global-toast-close {
        width: var(--control-h-touch, 44px);
    }

    body.is-drawer-lock .global-toast-container {
        inset: calc(
                var(--header-bottom, calc(env(safe-area-inset-top, 0px) + 40px))
                + var(--spacing-sm, 0.5rem)
            )
            var(--page-gutter, 1rem) auto var(--page-gutter, 1rem);
    }
}

/* ============================================
   Confirm Dialog (global hx-confirm interceptor)
   One centered modal that replaces the native browser confirm()
   for every `hx-confirm` action and every form with `data-confirm`.
   Chrome only — the words and the request come from htmx or from the
   form (confirm-submit.js); the accept/cancel buttons reuse the
   shared .btn classes so status color and dark mode come for free.
   Built and torn down by htmx-confirm.js.
   ============================================ */

.global-confirm-overlay {
    position: fixed;
    inset: 0;
    /* Above drawer and modal panels (--z-modal), below toasts. A confirm asks
       about the thing on screen, so it can never sit behind it — at the backdrop
       rung the roster drawer painted right over this one. */
    z-index: var(--z-overlay-top);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    background: var(--color-scrim);
    opacity: 0;
    transition: opacity 0.12s ease;
}

.global-confirm-overlay.is-open {
    opacity: 1;
}

.global-confirm-dialog {
    width: 100%;
    max-width: 25rem;
    padding: var(--spacing-lg);
    background: var(--color-card-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-modal);
    transform: translateY(0.5rem);
    transition: transform 0.12s ease;
}

.global-confirm-overlay.is-open .global-confirm-dialog {
    transform: translateY(0);
}

/* Optional title: a form's `data-confirm-title`, or a title passed to `open` from JS. */
.global-confirm-title {
    margin: 0 0 var(--spacing-sm);
    font-size: var(--font-size-h4);
    font-weight: var(--font-weight-medium);
    line-height: 1.35;
    color: var(--color-text);
}

/* A message may hold one line per person (the Invite ask, Nick 11-07): a line
   break in it stays a line break. */
.global-confirm-message {
    margin: 0 0 var(--spacing-lg);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--color-text);
    white-space: pre-line;
}

.global-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}

/* ── Phone (<768px) ─────────────────────────────────────────────────────────
   The confirm sits at the bottom of the screen where the thumb is; buttons
   stack with the accept on top (column-reverse keeps the DOM order cancel →
   accept for the focus ring). Stays LAST in the file. */
@media (max-width: 767.98px) {
    .global-confirm-overlay {
        align-items: flex-end;
    }

    .global-confirm-dialog {
        width: 100%;
        max-width: none;
        border-radius: var(--radius-lg) var(--radius-lg) var(--radius-none) var(--radius-none);
        padding-bottom: calc(var(--safe-bottom) + var(--spacing-md));
    }

    .global-confirm-actions {
        flex-direction: column-reverse;
    }

    .global-confirm-actions .btn {
        width: 100%;
        min-height: var(--control-h-touch);
    }
}

/* ============================================
   Modal Shell (canonical centered dialog) — ADR-131
   One shared shell for every hand-rolled Bootstrap `.modal`: void/approve/
   payout confirms, add-skill/attachment/competency forms, and friends. It
   skins Bootstrap's `.modal` chrome with design tokens so every dialog shares
   one elevation, radius, and z-index stack, and it kills the two backdrop
   idioms these modals used to hand-roll (a sibling `.modal-backdrop` element vs
   an inline `background: rgba(0,0,0,.5)`).

   Rendered by the {% modal %} block tag → shared/components/_modal.html. No JS:
   the tag ships a tiny inline Alpine `dismiss($el)` closer that walks to the
   modal root (`[data-global-modal-root]`) and removes the whole fragment; the close
   button, the backdrop click, and the Escape key all call it. Walking the DOM
   (not `$root`) keeps dismiss correct when a slot declares its own `x-data`
   (a payout form with live money-math) — `$root` would resolve to that nested
   scope and orphan the backdrop. The fragment is HTMX-injected only when it
   should be shown, so the shell is always visible (no Bootstrap modal JS
   toggling `display`).

   TWO PARADIGMS, ONE CHROME. The block tag above is for HTMX-injected fragments:
   they appear the moment they're injected, so `.global-modal` forces `display:block`
   to beat Bootstrap's `.modal { display:none }`. But a handful of dialogs are
   *persistent* — hidden until a trigger shows them, via Bootstrap modal JS
   (`data-bs-toggle`/`data-bs-dismiss`) or an Alpine state flag. Those can't wear
   `.global-modal` (its `display:block` would defeat the hide). So the visual chrome —
   the panel's border/radius/shadow — is split out onto `.global-modal-chrome`, which
   a persistent modal adds to its `.modal` element to share the exact same panel
   look while keeping its own show/hide + backdrop. `.global-modal` = injected shell
   (visibility + chrome); `.global-modal-chrome` = chrome only, for the persistent ones.

   `.global-modal` is a locked singleton (test_css_standards.py) — a second base
   definition fails the build. Variants: `--md` (640px, two panels side by side), `--lg` (wide dialog).

   Deliberate exception to the sibling components: drawer.css / confirm-dialog.css
   are framework-free, but this shell *skins* Bootstrap's `.modal` / `.modal-dialog`
   / `.modal-content` / `.modal-backdrop` classes — because the ~23 dialogs it
   replaces already speak that markup. That's why it depends on loading after
   Bootstrap (see below), unlike its siblings.
   ============================================ */

/* Base def — loaded after Bootstrap so this beats `.modal { display:none }` at
   equal specificity. This is the one bare `.global-modal {` rule (the singleton). */
.global-modal {
    display: block;
    z-index: var(--z-modal);
    top: var(--phone-covered-top, 0px);
    bottom: var(--phone-covered-bottom, 0px);
    height: auto;
}

/* Every injected dialog sits dead-center of the viewport (Bootstrap's default
   top-anchored dialog reads too high). The flex column centers short dialogs;
   one taller than the viewport tops out at the margin and scrolls INSIDE
   itself — see the .modal-content cap below. */
.global-modal .modal-dialog {
    display: flex;
    align-items: center;
    min-height: calc(100% - 3.5rem);
    margin: var(--spacing-lg) auto;
}

/* A dialog taller than the viewport scrolls its body, not the whole panel:
   the header (title + the X that is sometimes the only way out) and any footer
   stay frozen while the content moves under them (Nick, 08-17). Capping
   .modal-content — which Bootstrap already lays out as a flex column — makes
   the body the one flexible row; its own overflow makes it shrinkable, and
   overflow:hidden keeps the scrolled content clipped to the rounded panel.
   3.5rem mirrors the dialog's top+bottom margins above. Injected shell only:
   persistent `.global-modal-chrome` modals keep Bootstrap's own behavior. */
.global-modal .modal-content {
    max-height: calc(100vh - 3.5rem);
    overflow: hidden;
}

/* The slot between .modal-content and .modal-body is one wrapper — a <form>,
   or a plain div when there is nothing to post — except the top-up modal's
   pending face, which renders body + footer bare. Without this rule the
   wrapper's flex min-height:auto keeps it content-sized, the cap above clips
   it, and the body's own overflow never engages: content below the fold is
   unreachable. Flexing the wrapper (min-height:0 so it may shrink) hands the
   constraint down to the body. The :not() list is load-bearing: a bare
   .modal-footer must keep Bootstrap's row direction (column re-aims
   align-items and centers its buttons), a bare .modal-body already shrinks
   and scrolls on its own (flex: 1 1 auto + the overflow below), and
   json_script drops a <script> sibling into one slot, so a bare :not()
   would un-hide its JSON. */
.global-modal .modal-content > form,
.global-modal .modal-content > div:not(.modal-header):not(.modal-body):not(.modal-footer) {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.global-modal .modal-body {
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Shared panel chrome — worn by BOTH the injected shell (`.global-modal`) and the
   persistent modals that opt in with `.global-modal-chrome`, so every dialog on the
   platform lands the same tokenized elevation/radius, not Bootstrap defaults. */
.global-modal .modal-content,
.global-modal-chrome .modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-modal);
}

/* Wide dialog (e.g. an editable line-item table). */
.global-modal--lg .modal-dialog {
    max-width: 800px;
}

/* Between the two: a dialog that lays two panels side by side (the calendar
   connect explainer) but has no table to justify the full 800. */
.global-modal--md .modal-dialog {
    max-width: 640px;
}

/* Backdrop element the tag renders as a sibling of the dialog. Sits one rung
   below the panel on the shared elevation ladder. */
.global-modal__backdrop {
    z-index: var(--z-modal-backdrop);
}

/* The page behind a dialog takes the shared scrim, the dim behind every other
   open window (Nick, 2026-11-09). Bootstrap's own dim is black at half
   strength; the scrim holds its own strength, so the backdrop shows at full
   opacity. The sibling selector outranks Bootstrap's `.show` rule. */
.global-modal + .global-modal__backdrop {
    background-color: var(--color-scrim);
    opacity: 1;
}

/* The dim behind a dialog that keeps its own show and hide (an Alpine flag,
   not the tag): the same scrim on the same rung, with no Bootstrap class. It
   keeps the box of Bootstrap's own dim, so it covers the scroll bar too. */
.global-modal__scrim {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: var(--z-modal-backdrop);
    background: var(--color-scrim);
}

/* ── Beside an open drawer (ADR-125) ───────────────────────────────────────
   A dialog opened FROM a drawer (Adjust amount, Void, the sync match picker)
   used to land BEHIND the panel: both wear var(--z-modal), and the drawer's
   container sits later in the page than the modal container, so the drawer won
   the tie. These rules lift the dialog and its backdrop over the panel — still
   under var(--z-popover), so autocompletes inside the dialog stay on top.

   In push mode the drawer leaves a free strip between the sidebar and the
   panel's left edge, so the dialog centers THERE instead of in the whole
   viewport (which read as "hiding under the drawer"). Padding does the work,
   not a width cap: the dialog's own `margin: auto` re-centers inside the padded
   box, and a dialog wider than the strip shrinks to fit it. Below the push line
   the drawer overlays the page and there is no free strip, so only the layering
   applies and centering stays normal. */
.global-app-layout.is-drawer-open .global-modal {
    z-index: calc(var(--z-modal) + 2);
}

.global-app-layout.is-drawer-open .global-modal__backdrop {
    z-index: calc(var(--z-modal) + 1);
}

@media (max-width: 767.98px) {
    .global-modal .modal-content {
        max-height: calc(100dvh - var(--phone-covered-top, 0px) - var(--phone-covered-bottom, 0px) - 2 * var(--spacing-lg));
    }
}

@media (min-width: 1200px) {
    .global-app-layout.is-drawer-open .global-modal {
        padding-left: var(--sidebar-width, 0px);
        padding-right: var(--drawer-width);
    }

    /* The collapsed sidebar is a 56px icon rail whose width lives in the rule,
       not in --sidebar-width (main.css), so the free strip is re-measured. */
    .global-app-layout.is-drawer-open.is-sidebar-collapsed .global-modal {
        padding-left: 56px;
    }
}

/* ============================================
   Form Switch (toggle) — refined alignment
   ============================================
   Bootstrap 5's default .form-check.form-switch uses a padding-left +
   negative-margin float trick. The result is the switch sitting at a
   slight vertical offset from the label baseline and minimal spacing
   between switch and text. We replace the trick with proper flexbox
   so the switch is truly centered with the label and there's enough
   breathing room.

   Applies globally — live forms (boolean / checkbox-style=toggle)
   AND the form-builder editor's settings panels.
*/

.form-check.form-switch {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);             /* breathing room between switch and label */
  padding-left: 0;           /* reset Bootstrap's float trick */
  min-height: auto;
  margin-bottom: 0;          /* container should manage outer spacing */
}

.form-check.form-switch .form-check-input {
  margin-left: 0;            /* reset the negative-margin float */
  margin-top: 0;
  flex-shrink: 0;            /* don't compress the switch when label wraps */
  cursor: pointer;
}

.form-check.form-switch .form-check-label {
  margin-bottom: 0;
  cursor: pointer;
  line-height: 1.4;          /* tighter line-height matches the switch height */
  /* Allow the label to wrap to multiple lines next to the switch — the
     parent's align-items: center keeps everything vertically centered. */
}

/* When stacking multiple switches in a panel (form-builder editor +
   section-level conditional toggles), keep them visually grouped with
   consistent vertical rhythm. */
.form-check.form-switch + .form-check.form-switch {
  margin-top: var(--spacing-sm);
}

/* ============================================
   Conditional editor — card layout
   ============================================
   Each condition is a self-contained card with a numbered header
   and three labeled sections (FIELD / OPERATOR / VALUE) stacked
   vertically. The card structure makes the stacking visually
   unambiguous in narrow editor panels (280-320px sidebar).
*/

.forms-conditional-builder {
  background-color: var(--color-page-bg);
  border: 1px solid var(--color-border);
}

.forms-conditional-builder__action {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  margin-bottom: var(--spacing-md);
}


/* Platform-wide tab component. `.global-tabs` / `.global-tab` is the canonical underline
   tab strip for the whole app. Every surface uses these classes directly. */

/* ── Canonical component ── the `.global-tabs` bottom border is the seam where the
   strip meets the content below it. */
.global-tabs {
    display: flex;
    gap: var(--spacing-2xs);
    flex-wrap: wrap;
    border-bottom: 1px solid var(--color-border);
}

/* Standalone strips (not built into a card's bottom edge) want a little air
   between the seam and the panel that follows. */
.global-tabs--spaced {
    margin-bottom: var(--spacing-mdlg);
}

.global-tab {
    border: 0;
    background: none;
    font: inherit;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
    text-decoration: none;
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xsm);
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.global-tab:hover {
    color: var(--color-text);
}

.global-tab.is-active {
    color: var(--color-action);
    border-bottom-color: var(--color-action);
}

/* --neutral: originally the escape hatch that marked the active tab in neutral
   dark grey instead of the brand accent. The interaction layer made that the
   base look (tabs are quiet controls, so every strip marks active in action
   ink); what the modifier still carries is the tighter tab rhythm — see the
   rhythm rules further down. */

.global-tab:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.global-tab__icon {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

/* Trailing "+" add-view tab (HubSpot add-view pattern) — an icon-only tab that opens
   the create flow rather than navigating. No label, no active underline; it reads as an
   action, not a destination. */
.global-tab--add {
    padding-inline: var(--spacing-smd);
}

.global-tab--add .global-tab__icon {
    font-size: var(--font-size-md);
}

/* The "+" tab's two-option menu — organization view vs personal. position:fixed
   for the same reason the opportunities toolbar's menus are (toolbar.css): the
   header strip is a sideways scroller (`overflow-x: auto`, page-header.css), and
   an overflow of auto on one axis clips the other axis too — an absolute menu
   hanging below the strip paints into the nav's scroll box instead of over the
   page. The trigger computes top/left from its own rect when it opens. */
.global-tab-add {
    display: inline-flex;
}

.global-tab-add__menu,
.global-object-switcher__menu {
    position: fixed;
    min-width: 15rem;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
}

.global-tab-add__option {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-sm);
    border: 0;
    background: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.global-tab-add__option > i,
.global-object-switcher__option > i {
    color: var(--color-text-muted);
}

/* Nudged down so the glyph centers on the option's first (label) line. */
.global-tab-add__option > i {
    margin-top: var(--spacing-2xs);
}

.global-tab-add__label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

/* Object switcher (HubSpot pattern, ADR-204 §5) — the "Contacts ⌄" button at the
   left of the header's tab strip, with a thin divider before the tabs. Its menu
   is position:fixed for the same reason the "+" tab's is: the strip beside it
   scrolls sideways and would clip an absolute menu. The header's tabs box only
   turns into a row when the switcher is in it, so every other strip keeps its
   own layout; the strip takes the slack and keeps its sideways scroll, and the
   switcher never shrinks, so on a phone it stays on the first row. */
.global-page-header__tabs:has(> .global-object-switcher) {
    display: flex;
    align-items: center;
}

.global-page-header__tabs:has(> .global-object-switcher) > .global-tabs {
    flex: 1 1 auto;
    min-width: 0;
}

.global-object-switcher {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    margin-right: var(--spacing-sm);
    padding-right: var(--spacing-sm);
    border-right: 1px solid var(--color-border);
}

.global-object-switcher__trigger {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2xs);
    height: var(--control-h-base);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-card-bg);
    padding: 0 var(--spacing-sm);
    font: inherit;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-body);
    color: var(--color-text);
    white-space: nowrap;
    cursor: pointer;
}

.global-object-switcher__trigger:hover {
    background: var(--color-surface-hover);
}

.global-object-switcher__trigger:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

.global-object-switcher__trigger > i {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* The menu and its rows are the "+" tab's (above); only these differ. */
.global-object-switcher__menu {
    min-width: 13rem;
}

.global-object-switcher__option {
    padding: var(--spacing-sm);
}

/* These rows are links; this keeps main.css's a:hover color off their text. */
.global-object-switcher__option:hover,
.global-views-dropdown__option:hover {
    color: var(--color-text);
}

.global-object-switcher__option > i {
    width: 1rem;
}

/* The check that marks the open page sits at the row's far end. */
.global-object-switcher__option.is-current > .bi-check-lg {
    margin-left: auto;
    color: var(--color-text);
}

/* Views dropdown (ADR-204 §6) — the saved-view strip folded into one button at
   the left of a folded header's toolbar row (_views_dropdown.html). The button
   is the Filter pill; the menu and its rows are the "+" tab's (above), with the
   shared menu search box and the "+" side by side on top. page-header.css
   decides when it shows. */
.global-views-dropdown {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
}

.global-views-dropdown__trigger {
    max-width: 14rem;
}

/* The menu's own "+" sits right of its search box on every width
   (_views_dropdown_search.html, Nick 11-10). So the strip's "+", which rides in
   the dropdown for its picker, hides beside the button. The picker then opens
   under the views button (saved-view-add-menu.js). */
.global-views-dropdown .global-tab-add > .global-tab--add {
    display: none;
}

.global-views-dropdown__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The "+" choices sit in a wrapper that shows only while adding; display: contents
   lets the menu's gap reach the two buttons through it. */
.global-views-dropdown__choices {
    display: contents;
}

.global-views-dropdown__menu {
    width: var(--page-search-w);
    max-height: 70vh;
    overflow-y: auto;
    overscroll-behavior-y: contain;
}

.global-views-dropdown__option {
    align-items: center;
    font-size: var(--font-size-sm);
    text-decoration: none;
}

.global-views-dropdown__option > i {
    margin-top: 0;
}

.global-views-dropdown__option > .bi-check-lg {
    margin-left: auto;
    color: var(--color-text);
}

/* Who-sees-it marker after a tab's label — every tab wears one (Nick, 10-01):
   a person = Just for me, people = Everyone, a person-check = Specific people
   (_saved_view_audience_badge.html). Quiet on purpose: muted, no chip
   background, sized under the label so it reads as a property of the tab
   rather than a count or an action. */
.global-tab__sharing {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* ── Hover box ── HubSpot's tab hover treatment, on --neutral strips only (the
   six saved-view strips): a hovered tab gets a soft box, not just the base
   strip's text-color nudge. Top corners round; the bottom stays square so the
   box sits ON the strip's seam instead of floating above it. :focus-within
   keeps the box while the tab (an <a>) holds keyboard focus. */
.global-tabs--neutral .global-tab:hover,
.global-tabs--neutral .global-tab:focus-within {
    background: var(--color-surface-hover);
    border-radius: var(--radius-sm) var(--radius-sm) var(--radius-none) var(--radius-none);
    color: var(--color-text);
}

/* ── Neutral strip rhythm ── the saved-view strips run many tabs in one row, so
   they sit a notch tighter than the base component's 0.9rem. Both rules are
   (0,2,0): the --add one must restate itself here or the strip rule above it
   would beat the base `.global-tab--add` (0,1,0) and the "+" would widen back
   to 0.75rem. */
.global-tabs--neutral .global-tab {
    padding-inline: var(--spacing-smd);
}

.global-tabs--neutral .global-tab--add {
    padding-inline: var(--spacing-sm);
}

/* ── In-strip management ── chrome rides PER-TAB classes, because one strip can
   mix tabs the viewer manages with tabs they don't (a member's personal tab
   beside org tabs; a board manager's board tabs beside admin-only table tabs).
   --sortable marks a tab whose drag can actually persist; the server writes it
   from the API's own update door (_build_saved_view_tabs). Drag is the strip's
   ONLY in-tab action — the delete ✕ and its constant widened right padding
   came off (Nick, 08-27: with no visible tab edges, every reserved pixel reads
   as dead space between labels), so deleting a view lives in the settings
   drawer's Delete row alone and every tab wears the same symmetric padding.
   The nav-level --manageable survives only as view-tab-strip.js's Sortable arm
   switch — no CSS keys on it, so hovering a tab that carries no chrome moves
   NOTHING (the old strip-level keying hid the kind glyph on every tab and the
   tabs without a grip jittered).

   Hovering a --sortable tab swaps the kind glyph for the drag grip in the SAME
   slot (grip renders before the glyph; exactly one of the two shows), so the
   tab never changes width mid-hover — but only because both SVGs declare the
   same 15×15 box (pinned by test_grip_and_kind_glyph_declare_the_same_size; an
   em-sized grip shipped once and every hover walked the label 2px). Only
   saved-view tabs carry the class, so the trailing "+" tab's __icon is safe by
   construction. */
/* The WHOLE tab is the drag handle — view-tab-strip.js dropped SortableJS's
   `handle:` because the grip is 15px and only appears on hover, so every grab
   landed on the label and nothing moved (Nick, 09-21: "the dragging for the
   view reordering is not working at all"). Dragging a label would otherwise
   sweep a text selection along under the cursor, so a draggable tab never
   selects. The grip stays as the hint that this tab moves. */
.global-tab--sortable,
.global-tab--grip-edge {
    -webkit-user-select: none;
    user-select: none;
}

.global-tab__grip {
    display: none;
    align-items: center;
    line-height: 1;
    color: var(--color-text-muted);
    cursor: grab;
}

.global-tab__grip:active {
    cursor: grabbing;
}

.global-tab--sortable:hover .global-tab__grip,
.global-tab--sortable:focus-within .global-tab__grip {
    display: inline-flex;
}

.global-tab--sortable:hover > .global-tab__icon,
.global-tab--sortable:focus-within > .global-tab__icon {
    display: none;
}

/* --grip-edge is --sortable's sibling for LABEL-ONLY tabs (the workers roster
   strip): with no kind glyph to swap with, an in-flow grip would walk the label
   on every hover — the exact wobble the swap exists to prevent. So the grip
   goes OUT of flow instead: absolute in constant widened LEFT padding, hidden
   by visibility (not display — it must hold its box) until hover/focus-within,
   so the tab measures the same hovered or not. These rules are (0,2,0)/(0,3,0),
   so they beat the base __grip display:none above without touching the
   --sortable variant. */
.global-tab--grip-edge {
    position: relative;
}

.global-tabs--neutral .global-tab--grip-edge {
    padding-left: var(--spacing-lg);
}

.global-tab--grip-edge .global-tab__grip {
    display: inline-flex;
    visibility: hidden;
    position: absolute;
    left: 0.45rem;
    top: 50%;
    transform: translateY(-50%);
}

.global-tab--grip-edge:hover .global-tab__grip,
.global-tab--grip-edge:focus-within .global-tab__grip {
    visibility: visible;
}

/* SortableJS ghost — the placeholder left in the strip while a tab is mid-drag. */
.global-tab--drag-ghost {
    opacity: 0.4;
}

/* Count chip after a tab label. Plain (brand tint) for a plain count; done/wait
   (success/warning tint) for progress. */
.global-tab__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    padding: 0.05rem var(--spacing-xsm);
    border-radius: var(--radius-pill);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    line-height: 1.4;
}

.global-tab__count--plain {
    background: var(--color-action-tint-pressed);
    color: var(--color-action);
}

.global-tab__count--done {
    background: color-mix(in srgb, var(--color-success) 15%, transparent);
    color: var(--color-success);
}

.global-tab__count--wait {
    background: color-mix(in srgb, var(--color-warning) 15%, transparent);
    color: var(--color-warning);
}

/* The number of rows a tab lists, quiet after its label: the Tasks tab, the
   For Review tab, and a saved tab with "Show count on tab" on. */
.global-tab__number {
    margin-left: var(--spacing-xs);
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    font-variant-numeric: tabular-nums;
}

/* ── Card shell ── Keep the underline strip, but give it a white surface
   instead of letting the tabs float bare on the grey page. That floating strip
   read as "not standardized" on settings Profile / Referrals / Properties.

   Two shapes, and which one you want depends on the PANELS below the strip:

   1. BAR (the common case — seven of the eight carded strips). The shell wraps
      the strip ONLY; the panels keep their own `.card` surfaces underneath.
      Wrapping an already-carded panel in the shell too reads as a card inside
      a card.

          <div class="global-tab-card mb-3">
            <nav class="global-tabs">…</nav>
          </div>
          <div class="card">…panel…</div>

   2. SECTION. The shell wraps the strip AND a `__body`, for panels that are
      bare (a naked table, list, or form with no surface of its own).

          <div class="global-tab-card mb-3">
            <nav class="global-tabs">…</nav>
            <div class="global-tab-card__body">…bare form…</div>
          </div>

   Pick by what sits DIRECTLY below the strip, not by what the page is "made
   of" — the platform ledger was carded as BAR on the reasoning that its table
   is a `.card`, which is true but skips the bare filter form in between. A BAR
   shell over a bare element leaves the tabs alone in a full-width white bar
   with nothing under them, reading as a page banner rather than a tab strip.
   Ledger is the app's one SECTION today; see the note in that template.

   The test is whether the strip is the top-level thing a page is organised by.
   Status filter strips count: they sit at the top of the page and navigate
   between URLs, so they card like any other page-level strip. What does NOT
   card is a strip that already has a surface or belongs to one: the in-board
   view switchers (`--neutral`, dense controls on the board's own chrome), a
   strip built into a card's bottom edge (the opportunity record header), and
   one already nested inside a `.card` (ramp activity).

   Outer spacing is the caller's (`mb-3`/`mb-4`), matching how `.card` is spaced
   everywhere else.

   Radius is `--radius-card`, matching `.card` — the panel this shell sits
   directly on in the BAR shape. Take the same token as the neighbour, not the
   same number: whatever `--radius-card` resolves to (tokens.css) the shell
   and card move together. */
.global-tab-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* `.global-tab` already carries 0.9rem of its own horizontal padding, so the
   strip adds none — that padding IS the inset, and `__body` matches it so the
   body's content edge lines up with the first tab's label. `--spaced` is
   meaningless in here (the card's own margin does that job), so the shell
   neutralises it rather than making every caller remember to drop the modifier. */
.global-tab-card > .global-tabs,
.global-tab-card > * > .global-tabs {
    margin-bottom: 0;
}

/* BAR shape: with no body under it, the strip's underline seam would land on
   the card's own bottom border and read as a double rule. The active tab's 2px
   marker lives on the tab itself, so it survives dropping the seam — but the
   tab's -1px seam overlap must go with it, or `overflow: hidden` clips the
   bottom pixel of that marker off at the card edge. */
.global-tab-card > .global-tabs:last-child {
    border-bottom: 0;
}

.global-tab-card > .global-tabs:last-child .global-tab {
    margin-bottom: 0;
}

/* SECTION shape. `--flush` is for a body that supplies its own edge-to-edge
   content (a table that should meet the card's sides). */
/* The shell clips to its padding box, and `.global-tab` carries no horizontal
   margin — so the first tab sits ~1px from the shell's edge while its focus
   ring needs 4px (2px wide at a 2px offset). Outside the shell the ring is
   fine; inside, the left half of it was clipped away to nothing.

   Inset the ring rather than widen the shell or drop `overflow: hidden`: the
   ring then paints inside the tab's own box, where there is a comfortable
   0.9rem of padding, so it cannot be clipped no matter how tight the strip is
   against the card edge. Measured, not assumed — a clipped outline still
   reports its full `outline-width` in computed style, so this was found by
   counting painted pixels either side of the tab.

   Keyboard-only users are the ones who hit this, which makes it the kind of
   bug that goes unreported rather than unnoticed. */
.global-tab-card .global-tab:focus-visible {
    outline-offset: -2px;
}

.global-tab-card__body {
    padding: var(--spacing-md) var(--spacing-md);
}

/* ROW shape: the strip plus a right-hand control cluster on ONE line, for a
   control that belongs to a tab rather than to the page (the profile Overview
   edit pencil). It used to sit in its own right-aligned row *below* the shell,
   which left a band of empty page between the tabs and the first card and read
   as a stray floating button.

   This is not a place for page-level actions — those belong in the page
   header's actions cluster. Use it only where the control switches with the
   tab, and hide it (`x-show`) on the tabs it doesn't apply to.

   The shell's `overflow: hidden` has to come back off here. Hosting controls is
   this shape's whole job, and a control's menu or tooltip opens OUTSIDE the
   strip's box: the availability schedule picker's menu drops below its trigger
   and the at-limit tooltip on New availability opens under the button, and
   both painted straight into the clip — the click flipped the state and
   nothing appeared, at every width.

   Dropping it costs this shape nothing, because the clip is only ever a
   rounded-corner clip. What needs rounding off is a child that meets the
   card's sides: a SECTION's `--flush` body, or the strip's own seam in BAR.
   A ROW card has neither — no body at all, and `.global-tab` paints no
   background, just a 2px bottom marker that the rules below already pull back
   off the card's edge. The corners still round; there is simply nothing
   reaching them to clip. */
.global-tab-card--row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-smd);
    overflow: visible;
}

/* The nav stops being `:last-child` the moment actions sit beside it, so the
   BAR rules above stop matching and the strip's seam comes back as a double
   rule against the shell's own bottom border. Restate both halves — the seam
   and the tab's -1px overlap, which `overflow: hidden` would clip. */
.global-tab-card--row > .global-tabs {
    border-bottom: 0;
}

.global-tab-card--row > .global-tabs .global-tab {
    margin-bottom: 0;
}

/* Right inset matches the 0.9rem the first tab's own padding gives the left,
   so the cluster and the tab labels sit the same distance from the edges. */
.global-tab-card__actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 0 0 auto;
    padding-right: var(--spacing-md);
}

.global-tab-add__picker {
    max-height: min(70vh, var(--view-picker-max-height));
    overflow-y: auto;
    overscroll-behavior-y: contain;
}

.global-tab-add__group {
    padding: var(--spacing-sm);
}

.global-tab-add__group .global-drawer__legend {
    margin: var(--spacing-sm) 0;
}

.global-tab-add__text {
    flex: 1;
    min-width: 0;
}

.global-tabs__divider {
    align-self: center;
    flex: 0 0 auto;
    width: 1px;
    height: var(--control-h-base);
    background: var(--color-border);
    margin: 0 var(--spacing-sm);
}

.global-drawer-body summary.global-drawer__rowbtn {
    list-style: none;
}

.global-drawer-body summary.global-drawer__rowbtn::-webkit-details-marker {
    display: none;
}

@media (max-width: 575.98px) {
    /* One line does not hold both halves on a phone. The tabs are as narrow as
       their labels and the cluster is as wide as its buttons, and neither can
       give: with `flex: 0 0 auto` on the cluster and no wrap, the overflow left
       the strip, and the page itself scrolled 154px sideways with the cluster
       wedged into the tabs.

       Wrapping rather than a column, because the two halves fit side by side
       whenever they do fit — a two-tab strip next to one button has room at
       420px, and forcing a column would spend a row it doesn't need.

       The cluster keeps its right inset when it wraps, so a button below the
       tabs still lines up with the tab labels' other edge; and both halves grow
       to the full width so a wrapped cluster reads as its own row rather than a
       short box floating under the first tab. */
    .global-tab-card--row {
        flex-wrap: wrap;
        align-items: stretch;
    }

    .global-tab-card--row > .global-tabs {
        flex: 1 1 100%;
    }

    .global-tab-card--row > .global-tab-card__actions {
        flex: 1 1 100%;
        justify-content: flex-end;
        padding-bottom: var(--spacing-sm);
    }
}

/* ── Phone (<768px) ─────────────────────────────────────────────────────────
   A tab keeps its natural width and never wraps, so the row scrolls instead
   of squeezing (the scroller itself lives on the tabs container). LAST. */
@media (max-width: 767.98px) {
    .global-tab {
        flex: 0 0 auto;
        min-height: var(--control-h-touch);
        min-width: var(--control-h-touch);
        white-space: nowrap;
        scroll-snap-align: start;
    }

    /* A strip on a card (the Events status filter, the Scheduling tabs) is one
       row that scrolls sideways instead of wrapping to three. It wears the
       shared edge fade (components/edge-fade.css), so a cut-off tab reads as
       "more to the right". */
    .global-tab-card > .global-tabs {
        flex-wrap: nowrap;
        min-width: 0;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-padding-right: var(--spacing-2xl);
        scrollbar-width: none;
    }

    .global-tab-card > .global-tabs::-webkit-scrollbar {
        display: none;
    }
}

/* ==========================================================================
   Global page header — the in-page top bar that page content migrates into as
   the dark global-app-header is emptied program-wide. Four shapes:

     .global-page-header--row   list pages (pre-page-top-design pick): title
                                left, a search/filter cluster, actions right.
     .global-page-header--card  list pages (page-top design pick, ADR-131
                                controls-canon skin pass): one card holding a
                                title bar, a toolbar row (search/filters/view
                                switcher), and the list body flush inside.
     .global-page-header--toolbar  list pages whose body is already cards: no
                                title, the controls alone in a small card, and
                                the body flush on the page background below it.
     .global-record-header      record/builder pages: a single card holding a
                                back link, title, status chip, and actions, with
                                an optional tab strip built into its bottom edge.

   The two card shapes generalize the opportunity detail's in-page header
   pattern (nothing rides the global top header — it all lives in the in-page
   header); opportunities is record_header's title_template/body_template/
   tabs_template consumer. All three shapes sit on the light content surface.
   ========================================================================== */

.global-page-header--row {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-mdlg);
}

/* Title is shared with the card shape below; the card adds truncation since its
   heading also carries the status chip. */
.global-page-header__title,
.global-record-header__title {
    margin: 0;
    font-family: var(--font-family-heading);
    font-size: var(--font-size-page-title);
    line-height: 1.1;
    color: var(--color-text);
}

.global-page-header__title {
    font-weight: var(--font-weight-large-title);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* A record's name is read, not scanned: the heading style rather than the list
   page's heavy capitals (Nick, 2026-10-13). */
.global-record-header__title {
    font-weight: var(--font-weight-heading);
    text-transform: var(--text-transform-heading);
    letter-spacing: var(--letter-spacing-heading);
}

/* The search / filter cluster sits next to the title; actions get pushed right. */
.global-page-header__cluster {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 0;
}

/* Actions cluster is shared with the card shape below; the card adds wrapping
   since its actions can hold more controls than a list row's. */
.global-page-header__actions,
.global-record-header__actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xsm);
    flex-shrink: 0;
    margin-left: auto;
}

/* -- Card shape (list pages, page-top design pick) --------------------------
   The page-top design pick: the search box, filters, and view switcher get
   their own toolbar row, hairline-separated under the title, with the list
   body flush inside the same card. Structurally the same one-card-with-
   hairline-sections idea as .global-record-header below, just with a toolbar
   section instead of a tab strip. */

/* Card container is shared with .global-record-header below: both read as ONE
   card, drawing the only border, radius, and background — the bar and the
   optional toolbar/tab-strip section are borderless sections inside it.
   overflow:hidden clips them to the rounded corners; the card shape reopens the
   down axis just below, for the filter panels. This rule sets no
   transform/filter/contain, so it never becomes a CSS containing block — a
   nested position:fixed overlay (an offcanvas, a modal) escapes the clip and
   renders full-viewport as expected. If a future change adds transform,
   filter, or contain here, any fixed-position overlay nested in a
   body_template would get trapped inside this clip instead. */
.global-page-header--card,
.global-record-header {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: var(--spacing-mdlg);
}

/* --line: a record header that is only its bar (back arrow, title, status,
   actions; no summary, body or tab strip) sits straight on the page as one
   line. The card box around a lone name was chrome without content (Nick,
   2026-10-22: "the big header at the top with that container ... is a waste
   of space"). A header that carries facts, a stage track or tabs (a booking)
   keeps the card, where the box holds real content. */
.global-record-header--line {
    background: none;
    border: 0;
    border-radius: var(--radius-none);
    box-shadow: none;
    overflow: visible;
    margin-bottom: var(--spacing-smd);
}

.global-record-header--line .global-record-header__bar {
    padding: 0;
}

.global-record-header--line .global-record-header__back {
    border-color: transparent;
    background: transparent;
}

/* The card's last section holds filter comboboxes on the list pages, and their
   panels open DOWNWARD past the card's bottom edge — overflow:hidden above ate
   them whole, so a filter opened to an empty space (the bill dashboard's
   Status/Month/Year, 249 of 256px clipped away). Only the down axis is opened:
   clip keeps the sideways guard the bar and tab strip rely on, and it is the one
   value that lets the other axis stay visible — overflow-y:visible beside
   overflow-x:hidden would compute to auto and clip all over again. The
   --toolbar shape already drops the clip for exactly this reason. Safe because
   no section inside paints a background, so there is nothing to bleed past the
   rounded corners; clip is not a containing block either, so the nested
   fixed-position overlays noted above still escape. */
.global-page-header--card {
    overflow: clip visible;
}

/* --pinned: the header card stays put while the page scrolls under it
   (pinned=True in page_header.html). For a page-scrolling body — the
   opportunity card view, the sign up and bills dashboards — whose header
   controls used to ride off the top and stay gone until the user scrolled all
   the way back. A viewport-fit page (.global-page-fill, main.css) gets the same
   frozen header as a consequence of the page never scrolling and does not need
   this.

   The offset is the two tokens .global-app-header is built from PLUS the
   gutter .global-app-content already puts above the card, not a measured
   number, so a change to any of the three moves the pinned bar with it. That
   third term is Nick's ask (2026-08-03): pinned hard against the top bar, the
   card read as a second strip of chrome; holding the same gap it has at rest
   keeps it reading as the page's own card that happens to stay put.

   --z-sticky is the ladder's rung for pinned toolbars: below the sidebar and
   the drawer panel. Sticky plus a z-index makes the card a stacking context,
   so popovers inside it (Filter, Sort by) no longer carry their own
   --z-dropdown out to the page — the card paints them at --z-sticky with the
   rest of its contents. The cost is the cap: anything outside the card above
   --z-sticky covers them, even at a number below their own. */
.global-page-header--pinned {
    position: sticky;
    top: calc(var(--header-bottom) + var(--page-gutter));
    z-index: var(--z-sticky);
}

/* Content fades out as it slides under the pinned card instead of being cut
   off at its edge (Nick, 09-03: "things fade out ... so that they cleanly can
   go behind the top container"). A canvas-to-transparent wash hung off the
   card's bottom; the card's `overflow: clip visible` cuts it to the card's
   width (right — the strips beside the card carry the sidebar and drawer
   shadows) while leaving the down axis open.

   The height is exactly the card's own margin-bottom, so at rest the wash
   covers only the canvas gap under the card — invisible — and never hazes the
   content below. Scrolling content fades inside that gap before it ducks
   under the card. Keep the two values in lockstep. */
.global-page-header--pinned::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: var(--spacing-mdlg);
    background: linear-gradient(to bottom, var(--color-canvas), transparent);
    pointer-events: none;
}

/* The gap the pinned offset holds open, repainted so content does not scroll
   through it — one gutter of canvas that pins under the top bar.

   The content column owns it, not the bar. Hung off the bar it was an opaque
   band riding a sticky element, and it painted straight over the notice strips
   that mount flush underneath (components/notice-strip.css). At the top of the
   column instead, the band IS the column's top padding — same colour, same
   height, which is why the padding comes off — so it shows nothing until the
   page scrolls, and it hands off exactly: the strips clear the bar at the same
   moment the band reaches it.

   The card cannot own the repaint either. It cannot paint outside its own
   padding box sideways (`overflow: clip visible` above), so a band inside the
   card stops one pixel short at each side and lets the content's hairline
   border scroll up through the gap (measured: 22 leaked pixels a side at
   1440px). overflow-clip-margin reads like the fix and is not: Chromium only
   honours it on a box that clips BOTH axes.

   Inside the column the band is as wide as the card for free, in both drawer
   states — the drawer narrows .global-app-content itself (drawer.css, "Resize
   only the CONTENT"), so no --content-push term. The strips either side stay
   clear, which they must: the sidebar and docked drawer each cast a shadow
   ~32px into them and a full-width band paints those out.

   --color-canvas, not --color-page-bg: an org running a custom "Every page"
   background republishes --color-canvas on .global-app-main; a band painted
   --color-page-bg would be default grey on every such org. */
.global-app-main:has(.global-page-header--pinned) .global-app-content {
    padding-top: 0;
}

.global-app-main:has(.global-page-header--pinned) .global-app-content::before {
    content: "";
    /* A ::before is inline, and height does nothing to an inline box. Without
       this the band held the gutter open only on the fill pages, whose column
       is a flex container; every other pinned page lost it entirely. */
    display: block;
    position: sticky;
    top: var(--header-bottom);
    z-index: var(--z-raised);
    flex: 0 0 auto;
    height: var(--page-gutter);
    background: var(--color-canvas);
}


/* Bar layout is shared with .global-record-header__bar below. */
.global-page-header--card .global-page-header__bar,
.global-record-header__bar {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
    padding: var(--spacing-smd) var(--spacing-md);
    flex-wrap: wrap;
}

.global-page-header--card .global-page-header__title {
    flex: 1 1 auto;
}

.global-page-header__toolbar {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    padding: var(--spacing-sm) var(--spacing-md);
    border-top: 1px solid var(--color-grey-100);
}

/* --notitle: the card opens straight on the toolbar row, so that row's hairline
   has no title bar above it to divide from — it would only double the card's own
   top border. The actions cluster rides the end of the row on the base rule's
   own margin-left:auto. */
.global-page-header--notitle .global-page-header__toolbar {
    border-top: 0;
    padding-top: var(--spacing-smd);
}

/* Every control in a page header keeps working while it filters. The global
   .htmx-request rule (main.css) fades and deadens whatever htmx marks, and the
   shared search points hx-indicator at its own wrapper, so measured on the rig
   the field the person was typing in sat at opacity .7 with pointer-events:none
   until the reply came back. Results land elsewhere (#list-container), so the
   field was the only thing showing it. Same opt-out the dark bar's copies of
   these controls (.global-app-header .global-search-input-wrapper.htmx-request, filter-bar.css)
   and its quick search (topbar-search.css) already carry — this is the light
   in-page header finally getting it too.

   What beats the global rule is specificity, NOT load order: three classes
   (0,3,0) against its bare .htmx-request (0,1,0). This file loads BEFORE
   main.css (base/base.html:111 vs :156), so a tie would go to main.css. The
   margin is two classes, not one — measured in Chromium, a two-class selector
   still wins and the field stays at opacity 1. Only a single class ties, and
   that is where the fade comes back with nothing to show it. */
.global-page-header .global-search-input-wrapper.htmx-request,
.global-page-header .global-header-filter.htmx-request,
.global-page-header .global-filter-select.htmx-request {
    opacity: 1;
    pointer-events: auto;
}

/* One search width for every page header — never standardized before this rule.
   The shared .global-page-search is flex:1 1 260px, so on a
   header carrying only a few other controls it grew to eat the whole row: measured at
   1440px the eight pages with a page search came out in six different widths, from
   320px on the opportunities header to 1158px on forms. HubSpot keeps this control
   about 320px and left-aligned, so pin the flex-basis + max-width and drop the grow
   here once instead of adding a per-page exception each time a header looks wrong.
   This rule replaces the --tabsactions and --notitle exceptions that grew here one at
   a time, which is the drift it exists to stop. Scoped to .global-page-header so the
   top bar's own quick search is untouched. */
.global-page-header .global-page-search {
    flex: 0 1 var(--page-search-w);
    max-width: var(--page-search-w);
}

/* With the search capped, whatever sits beside it would otherwise huddle against it and
   leave the rest of the row empty. The rule: search on the left, everything else on
   the right. The auto margin on the first sibling after the search eats all the slack,
   so that control and everything following it ride the right edge as one cluster —
   the view switcher on forms, the month/year nav on sign up.
   Opportunities (--tabsactions) is excluded: it already right-aligns only its date-nav
   (below) and deliberately keeps the lens selectors left next to search.

   One thing to know before adding a second control after the search: TWO auto
   margins in the same flex row split the free space EVENLY, so neither rides an
   edge. The roster's old status segmented sat right here, next to __actions' own
   auto margin (:57), and parked at the midpoint of the gap — measured 197px of
   slack on each side at 1280 wide, 277 at 1440, 517 at 1920 — until it was
   excluded from this rule. Status became a saved-view filter on 08-26 and the
   wrapper (.header-status-filter) retired with it on 08-29, so the exclusion is
   gone; anything that lands in that slot again wants the same one. */
.global-page-header:not(.global-page-header--tabsactions) .global-page-search + * {
    margin-left: auto;
}

/* Below the global-filter-bar breakpoint the controls stack one per row, where a 320px search
   in a full-width row reads as a mistake, and a right-aligned cluster has no slack to
   ride anyway. Release both, matching what .global-search-input-wrapper already does at this
   width (filter-bar.css). */
@media (max-width: 575.98px) {
    .global-page-header .global-page-search {
        flex: 1 1 auto;
        max-width: none;
    }

    .global-page-header:not(.global-page-header--tabsactions) .global-page-search + * {
        margin-left: 0;
    }
}

/* Date-nav rides the FAR RIGHT of the opps toolbar: search capped on
   the left, a flexible gap, then Today + arrows + month + year right-aligned.
   `margin-left: auto` eats the slack before the cluster. The calendar is the one
   surface with a date-nav now; its view-specific Events/Tasks lens selectors sit
   before the date-nav in the DOM, so they stay left next to search while only the
   date-nav cluster moves right. */
.global-page-header--tabsactions .global-page-header__toolbar .global-date-nav {
    margin-left: auto;
}

/* The toolbar's own actions cluster trails the date nav, and two auto margins in one
   flex row split the slack between them instead of pinning either to an edge. Dropping
   the cluster's lets it sit right behind the date nav, so the two read as one
   right-hand group. */
.global-toolbar__row:has(.global-date-nav) .global-toolbar__actions {
    margin-left: 0;
}

/* Saved-view tab strip row: sits between the title bar and the toolbar. The strip
   inside (`.global-tabs`) carries its own bottom-border seam, so when the strip is
   present the toolbar drops its own top rule to avoid a doubled hairline. */
.global-page-header__tabs {
    padding: var(--spacing-xs) var(--spacing-sm) 0;
}

.global-page-header__tabs + .global-page-header__toolbar {
    border-top: 0;
}

/* Overflow guard (scoped — never mutate the shared `.global-tabs` singleton, which
   flex-wraps by design for card-shape strips). The unified strip aggregates every
   saved view of all four kinds and lives in a height-pinned header, so a wrapped
   multi-row strip would permanently steal body height on the viewport-fit table
   view. Keep it a single row that scrolls sideways instead, and cap + ellipsize a
   long saved-view name so one entry can't blow out the row. */
.global-page-header__tabs .global-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    /* Keep the sideways scroll but hide its bar (HubSpot-style) — the strip is a
       thin control row, so a visible scrollbar under it reads as clutter. */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.global-page-header__tabs .global-tabs::-webkit-scrollbar {
    display: none;
}

.global-page-header__tabs .global-tab {
    flex: 0 0 auto;
    max-width: 12.5rem;
}

.global-page-header__tabs .global-tab__label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* -- Card shape, arrangement C (opportunities dashboard "controls join the tabs
   line", sb-header-layout-v1) -------------------------------------------------
   The card drops its title bar; row 1 packs the saved-view tab strip on the left
   and the action cluster (Add + Filter + view-kind + gear) on the right, and row 2
   (the toolbar) carries search + the view's own controls. Scoped to the
   --tabsactions variant, so every other card consumer keeps its title bar. */
.global-page-header--tabsactions .global-page-header__tabsrow {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
    padding: var(--spacing-xsm) var(--spacing-md) 0;
    border-bottom: 1px solid var(--color-grey-100);
}

/* Tabs take the row's slack and scroll sideways when they overrun (the nowrap +
   overflow-x guard on the inner strip already drives the scroll); the padding
   reset drops the strip's own inset so the first tab lines up with the 1rem card
   edge the bar and toolbar use. Actions hold their intrinsic width on the right. */
.global-page-header--tabsactions .global-page-header__tabs {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
}

.global-page-header--tabsactions .global-page-header__actions {
    flex: 0 0 auto;
}

/* One of the header row's 36px pills, level with the object switcher and the
   Filter and Sort by buttons. Keeps the org's fill. A record header's buttons
   are the same pill, and the rule names its text size, so Bootstrap's own
   size cannot make one button's words bigger than the next (Nick's pick 5,
   2026-11-07). Scoped to these three clusters, so .btn-primary keeps its
   default size elsewhere. */
.global-page-header--tabsactions .global-page-header__actions .btn,
.global-toolbar__folded-actions .btn,
.global-record-header__actions .btn {
    height: var(--control-h-base);
    border-radius: var(--radius-pill);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-body);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding-top: 0;
    padding-bottom: 0;
}

/* The same spec draws the icon a step above the label. */
.global-page-header--tabsactions .global-page-header__actions .btn i,
.global-toolbar__folded-actions .btn i {
    font-size: var(--font-size-base);
}

/* A button's word, one span, so the phone head (below) and the folded row's
   tight stages (above) can keep it for the screen reader alone. */
.global-btn-word {
    white-space: nowrap;
}

/* The row owns the full-width seam under both tabs and actions, so the inner strip
   drops its own bottom rule (it would run under the tabs only) and the toolbar
   below drops its top rule, leaving one hairline between the two rows. */
.global-page-header--tabsactions .global-page-header__tabs .global-tabs {
    border-bottom: 0;
}

.global-page-header--tabsactions .global-page-header__toolbar {
    border-top: 0;
}

/* On a phone the tabs get the whole row, so the strip scrolls sideways with each
   tab's who-sees-it icon in view, and the actions move up to their own line above
   it, on the right, where the phone mockup puts Add. */
@media (max-width: 767.98px) {
    .global-page-header--tabsactions .global-page-header__tabsrow {
        flex-wrap: wrap;
        row-gap: var(--spacing-xsm);
    }

    .global-page-header--tabsactions .global-page-header__actions {
        order: -1;
        margin-left: auto;
    }

    .global-page-header--tabsactions .global-page-header__tabs {
        flex-basis: 100%;
    }
}

/* -- Collapsible card (ADR-204 §6) -------------------------------------------
   Folded, the tabs row goes and the toolbar row draws its own copy of the
   action button, left of the gear behind a hairline, the way it draws its own
   views dropdown. Desktop only: below 1024px the header keeps its two rows,
   the toolbar wraps and the arrows hide. */
.global-page-header__collapse {
    display: none;
    flex: 0 0 auto;
}

.global-page-header__collapse .global-page-header__expand-btn,
.global-page-header__toolbar > .global-views-dropdown,
.global-toolbar__folded-actions {
    display: none;
}

@media (min-width: 1024px) {
    .global-page-header--collapsible .global-page-header__toolbar {
        flex-wrap: nowrap;
        align-items: flex-start;
    }

    .global-page-header--collapsible .global-page-header__toolbar > .global-toolbar {
        flex: 1 1 0;
    }

    .global-page-header__collapse {
        display: flex;
    }

    .global-page-header--collapsed .global-page-header__tabsrow {
        display: none;
    }

    .global-page-header--collapsed .global-toolbar__folded-actions {
        display: inline-flex;
        align-items: center;
        gap: var(--spacing-sm);
        margin-left: auto;
    }

    /* The cluster's gap and the row's gap space the hairline, so it needs no
       margins of its own here. */
    .global-toolbar__folded-actions .global-toolbar__sep {
        margin: 0;
    }

    .global-page-header--collapsed .global-toolbar__folded-actions + .global-toolbar__actions {
        margin-left: 0;
    }

    .global-page-header--collapsed .global-page-header__toolbar > .global-views-dropdown {
        display: flex;
    }

    .global-page-header--collapsed .global-page-header__collapse .global-page-header__collapse-btn {
        display: none;
    }

    .global-page-header--collapsed .global-page-header__collapse .global-page-header__expand-btn {
        display: inline-flex;
    }

    /* Folded, the row never wraps. Too wide for the card (View settings pushes
       the page narrower), it makes room in Nick's order (11-05), one stage
       class at a time from folded-header-room.js: the Add button's plus alone,
       then Filter and Sort by as icons alone, then a narrower search box. A
       hidden word stays in the button for the screen reader. */
    .global-page-header--collapsed .global-toolbar__row {
        flex-wrap: nowrap;
    }

    .global-page-header--collapsed .global-toolbar__row > * {
        flex-shrink: 0;
    }

    .global-page-header--tight-add .global-toolbar__folded-actions .btn .global-btn-word,
    .global-page-header--tight-labels .global-toolbar__btn .global-btn-word {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    /* At its plus alone the Add button is the round + the phone head draws
       (Nick's pick, 10-16), the size of the icon buttons on its row: it kept its
       side padding and was a 34 by 36 pill (Nick, 11-05: "not a real circle"). */
    .global-page-header--tight-add .global-toolbar__folded-actions .btn {
        justify-content: center;
        width: var(--control-h-base);
        height: var(--control-h-base);
        padding: 0;
    }

    /* Both button classes, so this beats the 8px side padding in toolbar.css,
       which loads later. */
    .global-page-header--tight-labels .global-header-btn.global-toolbar__btn {
        padding: 0 var(--spacing-xsm);
    }

    .global-page-header--tight-search .global-toolbar__row .global-page-search {
        flex-shrink: 1;
        min-width: 6rem;
    }

    .global-page-header--tight-search .global-toolbar__row .global-page-search input {
        min-width: 0;
    }
}

/* -- Toolbar shape (list pages whose body is already cards) ------------------
   The design pick for the signup dashboard: the page has no in-page title,
   the search box and filters get their own small card, and the body renders
   after it as a page-level sibling so its own cards sit on the grey page
   background instead of being nested inside a second card. Same card chrome
   and same control row as the card shape's toolbar, minus the hairline (there
   is no title bar above to separate from) and minus overflow:hidden (this card
   holds one row, so it has nothing to clip, and a filter dropdown can open
   past its bottom edge). */
.global-page-header--toolbar {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-mdlg);
}

/* Back arrow — light-surface twin of the on-dark header back button it replaced. */
.global-record-header__back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--control-h-base);
    height: var(--control-h-base);
    flex-shrink: 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-card-bg);
    color: var(--color-text-muted);
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.global-record-header__back:hover,
.global-record-header__back:focus-visible {
    background: var(--color-action-tint-pressed);
    border-color: var(--color-action);
    color: var(--color-action);
}

.global-record-header__back i {
    display: flex;
    font-size: var(--font-size-md);
    line-height: 1;
}

.global-record-header__heading {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 1 1 auto;
    min-width: 0;
}

/* Record title truncates — the heading also carries the status chip, so long
   record names can't push it off the card. */
.global-record-header__title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* A title that opens its parent record reads as the title until pointed at. */
.global-record-header__title-link {
    color: inherit;
    text-decoration: none;
}
.global-record-header__title-link:hover,
.global-record-header__title-link:focus-visible {
    text-decoration: underline;
}

/* Record actions wrap — a record's cluster can hold more controls than a
   list row's single "+ New". */
.global-record-header__actions {
    flex-wrap: wrap;
}

/* Optional tab strip is the divider row inside the one card: a light hairline
   above splits it from the bar, and its bottom seam is toned to the card's own
   border so the whole card reads as one surface. */
.global-record-header .global-tabs {
    padding: 0 var(--spacing-smd);
    border-top: 1px solid var(--color-grey-100);
    border-bottom-color: var(--color-border);
}

/* Optional summary row under the bar (a record's facts strip on the left, its
   stage track on the right). Hairline above, like the tab strip below it. A
   summary with neither a fact nor a track draws nothing. */
.global-record-header__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-lg);
    padding: var(--spacing-smd) var(--spacing-md);
    border-top: 1px solid var(--color-grey-100);
}

.global-record-header__summary:not(:has(.global-facts__item, .global-stage-track)) {
    display: none;
}

.global-record-header__summary > .global-facts {
    flex: 1 1 auto;
}

.global-record-header__summary > .global-stage-track {
    flex: 0 1 auto;
}

/* ── Phone (<768px) ─────────────────────────────────────────────────────────
   The record header stacks: back / heading / stage on the first row, actions
   on a full-width second row, title clamped to two lines, tabs in a
   horizontal scroller with a fade. Stays LAST in the file — a base rule
   written after this block wins the cascade back. */
/* A partial whose every control is gated off leaves the wrapper empty
   (record_header.html renders it spaceless for exactly this). */
.global-record-header__actions:empty {
    display: none;
}

@media (max-width: 767.98px) {
    .global-record-header__bar {
        display: grid;
        grid-template-areas:
            "back heading stage"
            "actions actions actions";
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        row-gap: var(--spacing-sm);
        padding: var(--spacing-sm) var(--page-gutter);
    }

    .global-record-header__back {
        grid-area: back;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: var(--control-h-touch);
        height: var(--control-h-touch);
    }

    .global-record-header__heading {
        grid-area: heading;
        min-width: 0;
    }

    /* Primary action takes the row; the ⋯ button keeps a 44px square. */
    .global-record-header__actions {
        grid-area: actions;
        display: grid;
        grid-template-columns: minmax(0, 1fr) var(--control-h-touch);
        gap: var(--spacing-sm);
        /* The bar's margin-left: auto pushes the cluster right on a desktop;
           on a grid item it shrinks the row to its content instead. */
        margin-left: 0;
    }

    .global-record-header__actions .btn {
        min-height: var(--control-h-touch);
    }

    /* Two lines, then an ellipsis. Case as typed — caps eat width. Large and
       bold, the way an iPhone sets a page's title (look D, Nick 10-31). */
    .global-record-header__title {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        white-space: normal;
        text-transform: none;
        font-size: var(--font-size-h2);
        font-weight: var(--font-weight-large-title);
        letter-spacing: var(--letter-spacing-large-title);
        line-height: 1.25;
    }

    /* The summary stacks: facts first, the stage track full width under them. */
    .global-record-header__summary {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-smd);
        padding: var(--spacing-smd) var(--page-gutter);
    }

    .global-record-header__summary > .global-stage-track {
        flex: 0 0 auto;
    }

    /* An odd fact out at the end takes the whole row, so a lone date reads
       on one line instead of wrapping in half the width. */
    .global-record-header__summary .global-facts__item:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    /* Tabs scroll sideways. overscroll-behavior-x sits in the same rule as
       overflow-x (test_overscroll_containment keys on file + selector). */
    .global-record-header .global-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        padding: 0 var(--page-gutter);
    }

    .global-record-header .global-tabs::-webkit-scrollbar {
        display: none;
    }

    /* The right edge fades, so a cut-off tab reads as "more to the right".
       That is the shared edge fade (components/edge-fade.css). */
}

/* -- Phone head: the one toolbar line (phone_head; Nick's pick 11-10) ---------
   On a phone a view page shows ONE line above its list (_phone_line.html): the
   views dropdown at the left, then the search icon, the Sort and filter fold
   and the add button as a round + at the right. The search icon opens the live
   search box across the line, with Close search at its end (.is-searching,
   phone-list-head.js). The page name sits in the app bar, so the line has no
   title. phone-list-head.js MOVES the live controls into the slots here, so
   each keeps its Alpine scope and its htmx wiring; the card keeps the page's
   h1 for the screen reader and nothing else. The fold is the Reports list's
   side drawer holding the whole toolbar — chips, Sort by, the view's own
   controls, the gear (toolbar.css lays it out). A desk never sees any of it. */
.global-phone-head {
    display: none;
}

@media (max-width: 767.98px) {
    .global-phone-head {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: var(--spacing-sm);
        margin-bottom: var(--spacing-smd);
    }

    /* The views dropdown: the saved views the strip would list, on one button
       that says which is open. It sits at the left and takes the room its name
       needs; a long name ends in an ellipsis. Its menu opens from its left edge
       (sbMenuStyle) at the row's width, so it stays on the screen. */
    .global-phone-head__views {
        display: flex;
        flex: 0 1 auto;
        min-width: 0;
        margin-right: auto;
    }

    .global-phone-head__views .global-views-dropdown {
        min-width: 0;
        max-width: 100%;
    }

    .global-phone-head__views .global-views-dropdown__trigger {
        min-width: 0;
        max-width: 100%;
        height: var(--control-h-touch);
        border-radius: var(--radius-pill);
        background: var(--color-card-bg);
        font-size: var(--font-size-md);
        font-weight: var(--font-weight-medium);
    }

    /* Both button classes, so this beats the 8px side padding in toolbar.css,
       which loads later. Apart from the rule above, so main.css's hover fill
       still wins there. */
    .global-phone-head__views .global-header-btn.global-views-dropdown__trigger {
        padding-inline: var(--spacing-md);
    }

    .global-phone-head__views .global-views-dropdown__name {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .global-phone-head__views .global-views-dropdown__menu {
        min-width: 16rem;
        max-width: calc(100vw - 2 * var(--spacing-sm));
    }

    /* The calendar's month pill and Today ride the line (date-nav.css). An
       empty slot takes no gap. */
    .global-phone-head__nav {
        display: flex;
        flex: 0 1 auto;
        min-width: 0;
    }

    .global-phone-head__nav:empty,
    .global-phone-head__add:empty {
        display: none;
    }

    /* The search box waits behind the search icon. Open, it takes the line,
       and every other part gives way to it and to Close search. Scoped to the
       line, so it wins over icon-button.css, which loads later. */
    .global-phone-head .global-phone-head__search,
    .global-phone-head .global-phone-head__unfind {
        display: none;
    }

    .global-phone-head.is-searching > :not(.global-phone-head__search):not(.global-phone-head__unfind) {
        display: none;
    }

    .global-phone-head.is-searching .global-phone-head__search {
        display: flex;
        flex: 1 1 auto;
        min-width: 0;
    }

    .global-phone-head.is-searching .global-phone-head__unfind {
        display: inline-flex;
        order: 1;
    }

    /* A page with no search box (the calendar) has no search icon. */
    .global-phone-head:has(.global-phone-head__search:empty) .global-phone-head__find {
        display: none;
    }

    .global-phone-head__search .global-page-search,
    .global-phone-head__search .global-search-input-wrapper {
        flex: 1 1 auto;
        width: 100%;
        max-width: none;
        min-width: 0;
        margin: 0;
    }

    .global-phone-head__search .global-filter-control {
        width: 100%;
        min-width: 0;
        height: var(--control-h-touch);
        border-radius: var(--radius-pill);
        border-color: var(--color-border);
        background: var(--color-card-bg);
        font-size: var(--font-size-base);
    }

    .global-phone-head__fold,
    .global-phone-head__add {
        display: flex;
        flex: 0 0 auto;
    }

    /* Search, Close search and Sort and filter: one look of round icon. */
    .global-phone-head__icon {
        flex: 0 0 auto;
        background: var(--color-card-bg);
        font-size: var(--font-size-lg);
    }

    /* The add button is a round + the size of the icons beside it, its word
       kept for the screen reader. A page with two adds shows the first, the
       page's own kind; the lead boards bring one + that asks (_leads_actions.html). */
    .global-phone-head .global-phone-head__add .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: var(--control-h-touch);
        height: var(--control-h-touch);
        min-height: var(--control-h-touch);
        padding: 0;
        border-radius: var(--radius-pill);
    }

    .global-phone-head .global-phone-head__add .btn:not(:first-child) {
        display: none;
    }

    .global-phone-head .global-phone-head__add .btn i {
        font-size: var(--font-size-lg);
        line-height: 1;
    }

    .global-phone-head .global-phone-head__add .btn .global-btn-word {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    /* The line has no title, so the page name stands in the app bar from the
       first paint, not only once the page has scrolled (phone-bar.css). */
    :root:has(.global-phone-head):has(.global-phone-bar) .global-app-header__title {
        opacity: 1;
    }

    /* The fold slides by its right edge, not a transform: a transformed panel
       becomes the containing block of every fixed box inside it, and the
       settings drawer and the Sort by popover live inside this one. */
    .global-phone-head__fold .global-drawer-panel--side {
        transform: none;
        right: calc(-1 * min(var(--drawer-width), 100%));
        transition: right var(--transition-normal);
    }

    .global-phone-head__fold .global-drawer-panel--side.is-open {
        right: 0;
    }

    /* A closed panel is inert (drawer.css), and that passes down to the settings
       drawer the fold holds: an open panel inside it takes its taps. */
    .global-phone-head__fold .global-drawer-panel.is-open {
        pointer-events: auto;
    }

    /* The list under the head runs edge to edge in its card, as the bookings
       grid does: the rhythm padding is a desk's. */
    .global-page-header--phonehead ~ .workers-list-card-body {
        padding: 0;
    }

    /* The card keeps the h1 and the controls' return spots, and no height. */
    .global-page-header--phonehead {
        position: static;
        height: 0;
        min-height: 0;
        margin: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
    }

    .global-page-header--phonehead::after,
    .global-page-header--phonehead > .global-page-header__tabsrow,
    .global-page-header--phonehead > .global-page-header__toolbar {
        display: none;
    }
}

@media (max-width: 767.98px) {
    :root:has([data-focused-phone-search].is-searching) .global-notice:has(.global-notice__label--narrow),
    :root:has([data-focused-phone-search].is-searching) .workers-list-card-body thead,
    :root:has([data-phone-head-failed]) .global-view-bar {
        display: none;
    }

    /* Search opens with a short slide, and Back brings it back the same way
       (Nick 11-22, P3). The app bar gives back its room at once, so the list
       takes its new place. Then the app bar slides up off the screen and the
       doors bar slides down. Each hides once it has slid. phone-list-head.js
       slides the line and the list. The app bar keeps the edge fade of
       phone-bar.css. */
    :root:has([data-focused-phone-search]:not(.is-searching)) .global-app-header {
        transition: border-color var(--transition-normal), transform var(--transition-fast);
    }

    :root:has([data-focused-phone-search]:not(.is-searching)) .global-phone-bar,
    [data-focused-phone-search].is-phone-head-sliding,
    [data-focused-phone-search] ~ .workers-list-card-body.is-phone-head-sliding {
        transition: transform var(--transition-fast);
    }

    :root:has([data-focused-phone-search].is-searching) .global-app-header,
    :root:has([data-focused-phone-search].is-searching) .global-phone-bar {
        visibility: hidden;
        transition: transform var(--transition-fast), visibility var(--transition-fast);
    }

    :root:has([data-focused-phone-search].is-searching) .global-app-header {
        margin-bottom: var(--header-height-bleed);
        transform: translateY(-100%);
    }

    :root:has([data-focused-phone-search].is-searching) .global-phone-bar {
        transform: translateY(calc(100% + var(--glass-capsule-lift)));
    }

    /* The typed letters in each name the search finds (phone-list-head.js):
       medium weight, as the top bar search marks them, with no highlighter
       paint. While the search is open, each name reads at the body weight, so
       the typed letters stand out (UI review D2). A People name sits in its own
       span: the Bootstrap fw-medium around it sets its weight as !important. */
    [data-focused-phone-search].is-searching ~ .workers-list-card-body :is(.global-person-chip__name, .workers-row__name) {
        font-weight: var(--font-weight-body);
    }

    [data-focused-phone-search] ~ .workers-list-card-body mark {
        padding: 0;
        background: none;
        color: inherit;
        font-weight: var(--font-weight-medium);
    }

    /* The visible screen starts at the safe edge or the top of a keyboard pan. */
    :root:has([data-focused-phone-search].is-searching) .global-app-main:has(.global-page-fill) {
        position: fixed;
        inset: max(var(--safe-top), var(--phone-covered-top, 0px)) 0 var(--phone-covered-bottom, 0px);
        height: auto;
        min-height: 0;
        overflow: clip;
    }

    :root:has([data-focused-phone-search].is-searching) .global-app-content {
        padding-block: var(--spacing-smd) max(var(--spacing-smd), env(safe-area-inset-bottom));
    }

    [data-focused-phone-search].is-searching .global-phone-head__unfind {
        order: 0;
        background: var(--color-card-bg);
    }

    [data-focused-phone-search] .global-phone-head__search {
        position: relative;
    }

    .global-phone-head__search-input {
        flex: 1;
        min-width: 0;
    }

    .global-phone-head__search-input .global-filter-control {
        padding-inline-end: var(--control-h-touch);
        font-size: var(--font-size-base);
    }

    .global-phone-head__search-input input::-webkit-search-cancel-button {
        display: none;
    }

    .global-phone-head .global-phone-head__clear {
        position: absolute;
        inset: 0 0 auto auto;
        width: var(--control-h-touch);
        height: var(--control-h-touch);
        border-color: transparent;
        background: transparent;
    }

    .global-phone-head .global-phone-head__clear[hidden] {
        display: none;
    }

    .global-phone-head__failure {
        padding: var(--spacing-md);
    }

    :root:has([data-phone-head-failed]) .workers-list-card-body {
        visibility: hidden;
    }

    :root:has([data-focused-phone-search].is-searching) .workers-list-card-body {
        flex-grow: 0;
        overscroll-behavior: contain;
    }

    [data-focused-phone-search].is-searching ~ .workers-list-card-body .workers-row__email {
        color: var(--color-text-secondary);
    }

    /* Contacts uses Previous and Next in place of the roster's infinite scroll. */
    :root:has([data-focused-phone-search].is-searching:not([data-phone-head-failed])) .global-app-main:has(.crm-list) .global-view-bar:has(a[aria-label="Previous"], a[aria-label="Next"]) {
        --view-bar-height: calc(var(--control-h-touch) + var(--spacing-2xs));

        position: absolute;
        inset: auto 0 0;
        display: flex;
    }

    :root:has([data-focused-phone-search].is-searching:not([data-phone-head-failed])) .global-app-main:has(.crm-list):has(.global-view-bar a:is([aria-label="Previous"], [aria-label="Next"])) .global-app-content {
        padding-bottom: calc(var(--spacing-smd) + var(--control-h-touch) + var(--spacing-2xs));
    }
}

/* Platform-wide segmented control. `.global-segmented` / `.global-segmented__btn` is the
   canonical toggle for switching a view or mode between 2–4 mutually-exclusive
   options (My Pay Deposits/Bills, availability month/week, a list/board switch).

   The idiom is a recessed pill track with one RAISED white panel marking the
   live option — emphasis comes from the lift, not a colored fill, so the active
   segment reads as on-brand on any tenant (no indigo). This is deliberately
   distinct from `.global-tabs` (components/page-tabs.css): tabs are the underline
   strip for in-page navigation; a segmented control flips one setting where
   exactly one option is always active. */

/* ── The recessed track ── inline-flex so it hugs its buttons; the 3px padding
   is the moat the raised active panel sits inside. */
.global-segmented {
    display: inline-flex;
    gap: var(--spacing-2xs);
    padding: var(--spacing-2xs);
    background: var(--color-surface-subtle);
    border-radius: var(--radius-md);
}

/* --equal: every segment the same width (the widest label wins) so a two-option
   toggle reads as one balanced control instead of two ragged buttons. */
.global-segmented--equal {
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
}

/* --block: equal segments spanning the whole column, for a switch that sits in
   a form between full-width pickers (the opportunity drawer's Virtual / In
   Person and Pick a date / Relative to event). Written after --equal so the
   pair resolves to a block grid. */
.global-segmented--block {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    width: 100%;
}

/* --field: a switch in a form row stands as tall as the inputs beside it (the
   track's two moat edges plus each segment make one --control-h-base) and
   speaks at body size, so it reads as an answer field, not a toolbar chip. */
.global-segmented--field .global-segmented__btn {
    min-height: calc(var(--control-h-base) - 2 * var(--spacing-2xs));
    font-size: var(--font-size-md);
}

.global-segmented__btn {
    border: 0;
    background: none;
    font: inherit;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
    text-decoration: none;
    padding: var(--spacing-xs) var(--spacing-smd);
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xsm);
    transition: color var(--transition-fast), background var(--transition-fast),
                box-shadow var(--transition-fast);
}

/* The option you're NOT in brightens on hover so it reads as clickable. */
.global-segmented__btn:hover {
    color: var(--color-text);
}

/* The live option: a raised white panel with action-ink text. The active
   fill is the neutral card surface — the emphasis is the lift, not a hue — so
   it reads identically for every tenant. Defined after :hover so it wins when
   the active segment is also hovered. */
.global-segmented__btn--active,
.global-segmented__btn.is-active {
    background: var(--color-card-bg);
    color: var(--color-action);
    box-shadow: var(--shadow-sm);
}

/* A label wrapping a hidden radio never takes focus itself: the radio does, so
   the label shows the ring while its radio has the keyboard. */
.global-segmented__btn:focus-visible,
.global-segmented__btn:has(> input:focus-visible) {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

/* ── Seated in a tab strip's actions cluster ──
   `.global-tab-card__actions` is the row a tab card hands its page-level
   controls, so a segmented control there lands directly beside `.global-tab`
   labels. Against that surface --color-surface-subtle measured 1.08:1 — near
   enough to invisible that the switch read as two loose words with one of them
   boxed — and the muted label 2.41:1. A step down the grey ramp gives the
   recess a visible edge without turning it into a second filled control, and
   takes the label to 7.21:1.

   Scoping on the ancestor rather than the component keeps the canon (the base
   rules above) untouched: every segmented control NOT in a tab strip paints
   exactly as it did. The scheduling page's two tabs were carrying identical
   copies of these three declarations in their own feature sheets before this
   rule existed; both are the same shipped strip, so they are one rule.
   Widening the base greys instead is a design review of every page that mounts
   either component (ADR-125/ADR-131), which this is not. */
.global-tab-card__actions .global-segmented {
    height: var(--control-h-base);
    background: var(--color-grey-200);
}

/* The live segment keeps its brand colour — without the :not() this would take
   the emphasis off the option the reader is standing in. */
.global-tab-card__actions .global-segmented__btn:not(.is-active) {
    color: var(--color-grey-700);
}

/* ── Beside a compact picker ──
   The Sort rows (the saved-view drawers' Sort by, the toolbar's Sort menu) put a
   direction pair — "A → Z" / "Z → A", "Most recent" / "Oldest" — right under or
   beside the site combobox, and the drawer's Row height trio stands in the same
   column. A recessed grey track there read as a different kind of control from
   the pill it sits with (Nick, 09-20). `--picker` keeps the segmented behaviour
   and wears the picker's skin instead: no track, two (or three) bordered pills
   at the control height, the live one inked and tinted. */
.global-segmented--picker {
    padding: 0;
    gap: var(--spacing-xs);
    background: none;
}
.global-segmented--picker .global-segmented__btn {
    flex: 1 1 0;
    min-height: var(--filter-ctrl-h, var(--control-h-base));
    padding: 0 var(--spacing-smd);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-button);
    background: var(--color-card-bg);
    color: var(--color-text);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-body);
}
.global-segmented--picker .global-segmented__btn:hover {
    background: var(--color-grey-50);
    border-color: var(--color-text-muted);
    color: var(--color-text);
}
.global-segmented--picker .global-segmented__btn--active,
.global-segmented--picker .global-segmented__btn.is-active {
    background: var(--color-action-tint);
    border-color: var(--color-action);
    color: var(--color-action);
    box-shadow: none;
}

/* ── More ── options past the fourth fold into a menu under a last "More"
   segment, so the track keeps to one row (segmented_control.html `more`).
   menu.css paints the menu; this only puts it under the segment, at least
   as wide as the segment and as wide as its longest word. */
.global-segmented__more {
    position: relative;
    display: inline-flex;
}

.global-segmented__menu {
    position: absolute;
    top: calc(100% + var(--spacing-xs));
    right: 0;
    min-width: 100%;
    width: max-content;
}

/* ── Phone (<768px) ─────────────────────────────────────────────────────────
   Every segment is a 44px tap target. LAST. */
@media (max-width: 767.98px) {
    .global-segmented__btn {
        min-height: var(--control-h-touch);
    }
}

/* Global date navigation — `.global-date-nav` is the canonical prev/next +
   month/year control for the in-page row header (ADR-131). Two calls on the
   same markup: calendar period navigation (a "Today" button jumps back to the
   current period) and list date-filter stepping (no "Today" — see
   shared/components/date_nav.html for the two `kind`s).

   Sits on the light content surface, not the dark global-app-header — the prev/next
   arrows reuse `.global-icon-btn`; only the layout, the "Today" pill, and the
   month/year select sizing are defined here. */

.global-date-nav {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.global-date-nav__arrows {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xsm);
}

/* "Today" — a bordered ghost pill, the light-surface twin of the arrows beside
   it. Disabled (already viewing the current period) reads faded and inert. */
.global-date-nav__today {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 var(--spacing-smd);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    background: none;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-button);
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.global-date-nav__today:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

.global-date-nav__today[aria-disabled="true"] {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

/* Month/year comboboxes — fixed width, centered label, 36px to match the
   arrows/Today pill beside them. 9.5rem so the longest month ("September") clears
   the 2rem chevron-clearance padding on both sides without clipping (8.5rem cut it
   by 5px). */
.global-date-nav__month,
.global-date-nav__year {
    flex: 0 0 auto;
    width: 9.5rem;
}

/* On top of the shared .global-cs--compact skin: symmetric 2rem padding (the
   chevron's clearance on both sides) so text-align:center lands the label at
   true center — the same fix .global-cs-date-row uses on the drawer's date selects. */
.global-date-nav__month .global-cs-input,
.global-date-nav__year .global-cs-input {
    padding: 0 var(--spacing-xl);
    text-align: center;
    font-size: var(--font-size-sm);
}

/* Where the arrows are, in words. Shown only where the month and year pickers
   are not: the phone head's tools row, below. */
.global-date-nav__label {
    display: none;
}

/* Phone: the nav takes its own row under the other controls — a two-by-two
   grid, Today and the arrows on the first line, the month and year sharing
   the next. A grid, not a wrapped flex row: with flex the two selects (basis
   0) squeezed onto the first line beside Today and read "Sept". On the
   desktop the cluster rides the far right of the toolbar row
   (page-header.css); a full row has no right to ride. Every control,
   arrows included, reaches the touch height. */
@media (max-width: 767.98px) {
    .global-date-nav {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas:
            "today arrows"
            "month year";
        flex: 1 1 100%;
        margin-left: 0;
        min-width: 0;
    }

    .global-date-nav__today {
        grid-area: today;
        justify-self: start;
        min-height: var(--control-h-touch);
    }

    .global-date-nav__arrows {
        grid-area: arrows;
        justify-self: end;
    }

    .global-date-nav__arrows .global-icon-btn {
        width: var(--control-h-touch);
        height: var(--control-h-touch);
    }

    .global-date-nav__month {
        grid-area: month;
    }

    .global-date-nav__year {
        grid-area: year;
    }

    .global-date-nav__month,
    .global-date-nav__year {
        width: auto;
        min-width: 0;
    }

    .global-date-nav__month .global-cs-input,
    .global-date-nav__year .global-cs-input {
        min-height: var(--control-h-touch);
        height: auto;
    }
}

/* The phone head's tools row (page-header.css): the nav is one pill — ‹ the
   month and year › — with Today beside it. The month and year pickers hide;
   the arrows step the month and the label says where you are. */
@media (max-width: 767.98px) {
    .global-phone-head__nav .global-date-nav {
        display: flex;
        flex: 1 1 auto;
        min-width: 0;
        align-items: center;
        gap: var(--spacing-xs);
    }

    .global-phone-head__nav .global-date-nav__arrows {
        order: -1;
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0;
        height: var(--control-h-touch);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-pill);
        background: var(--color-card-bg);
    }

    /* Full-height taps; the arrows take the small width where the pointer is
       fine and the 44px touch floor (tokens.css) where it is coarse. */
    .global-phone-head__nav .global-date-nav__arrows .global-icon-btn {
        flex: 0 0 auto;
        width: var(--control-h-sm);
        height: var(--control-h-touch);
        border: 0;
        background: transparent;
    }

    .global-phone-head__nav .global-date-nav__label {
        display: block;
        flex: 1 1 auto;
        min-width: 0;
        text-align: center;
        font-size: var(--font-size-sm);
        font-weight: var(--font-weight-medium);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .global-phone-head__nav .global-date-nav__today {
        flex: 0 0 auto;
        height: var(--control-h-touch);
        padding: 0 var(--spacing-xs);
        border-radius: var(--radius-pill);
        background: var(--color-card-bg);
    }

    .global-phone-head__nav .global-date-nav__month,
    .global-phone-head__nav .global-date-nav__year {
        display: none;
    }

    .global-app-content:has(.opportunities-calendar-view) .global-phone-head__nav .global-date-nav {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto repeat(2, var(--control-h-touch));
    }

    .global-app-content:has(.opportunities-calendar-view) .global-phone-head__nav .global-date-nav__arrows {
        display: contents;
    }

    .global-app-content:has(.opportunities-calendar-view) .global-phone-head__nav .global-date-nav__label {
        grid-area: 1 / 1;
        text-align: start;
        white-space: normal;
    }

    .global-app-content:has(.opportunities-calendar-view) .global-phone-head__nav .global-date-nav__today {
        grid-area: 1 / 2;
        min-width: var(--control-h-touch);
    }

    .global-app-content:has(.opportunities-calendar-view) .global-date-nav__arrows > .global-icon-btn {
        width: var(--control-h-touch);
    }
}

/* Date range picker — the HubSpot-style popover behind the "Service date" quick
   filter: a rail of named ranges beside a dual-month calendar, Clear/Apply below.
   Markup: the range_presets branch of shared/components/toolbar/_condition_value_picker.html.
   Behaviour: shared/js/date-range-calendar.js.

   Lives inside .global-toolbar__menu, which brings the card, shadow and
   fixed positioning; this file only shapes the inside. The whole popover is wider
   than the stock menu, and the toolbar's _reclampWide() (in opps-toolbar.js)
   is what pulls it back on screen — worth knowing before narrowing anything here.
   On narrow viewports the rail and the two months wrap instead of overflowing. */
/* placeMenu stops the menu at the screen's bottom edge; on a phone the rail, two
   months and Is known / Is unknown run taller than that, so this menu scrolls.
   Only this one: the number menus hold a combobox list that overflow would clip. */
.global-toolbar__menu:has(.global-date-range) {
    overflow-y: auto;
    overscroll-behavior: contain;
}

.global-date-range__body {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-smd);
}

/* The preset rail — a quiet column; the active pick carries the brand tint the
   toolbar's own active chips use. */
.global-date-range__rail {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    min-width: 9rem;
    padding-right: var(--spacing-smd);
    border-right: 1px solid var(--color-border);
}

/* Twenty-odd named ranges outrun the calendar beside them, so the list scrolls
   inside the rail and the popover keeps the calendar's height: six 2rem day
   rows plus the month head and the day names, near enough 16rem. The hint
   below stays put. */
.global-date-range__presets {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    max-height: 16rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.global-date-range__preset {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-sm);
    text-align: left;
    color: var(--color-text);
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.global-date-range__preset:hover {
    background: var(--color-surface-hover);
}

.global-date-range__preset.is-active {
    background: var(--color-action-tint);
    color: var(--color-action);
    font-weight: var(--font-weight-medium);
}

.global-date-range__month-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-xs);
}

.global-date-range__month-label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.global-date-range__nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    color: var(--color-text-muted);
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.global-date-range__nav:hover {
    background: var(--color-surface-hover);
}

/* Kept in the layout so the pair of headers stays aligned — each panel shows
   only its outward arrow. */
.global-date-range__nav.is-blank {
    visibility: hidden;
}

.global-date-range__grid {
    display: grid;
    grid-template-columns: repeat(7, 2rem);
}

.global-date-range__wd {
    padding: var(--spacing-xs) 0;
    font-size: var(--font-size-xs);
    text-align: center;
    color: var(--color-text-muted);
}

.global-date-range__day {
    height: 2rem;
    font-size: var(--font-size-sm);
    color: var(--color-text);
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.global-date-range__day:hover {
    background: var(--color-surface-hover);
}

.global-date-range__day.is-out {
    color: var(--color-text-muted);
    opacity: 0.55;
}

.global-date-range__day.is-today {
    font-weight: var(--font-weight-medium);
    text-decoration: underline;
}

/* The staged range: dark circles on the endpoints, a light band between. The
   band squares off so consecutive days read as one stripe. */
.global-date-range__day.is-in-span {
    background: var(--color-action-tint);
    border-radius: var(--radius-none);
}

.global-date-range__day.is-start,
.global-date-range__day.is-end {
    background: var(--color-action);
    color: var(--color-neutral-ink-fg);
    border-radius: var(--radius-pill);
}

.global-date-range__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-smd);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--color-border);
}

/* Global builder toolbar — `.global-builder-toolbar` is the canonical strip a
   builder-type page (form/pipeline-template editor) puts inside its
   record_header card's actions slot: save-state indicator, undo/redo, an
   optional preview step, and the primary Publish action (ADR-131).

   Sits on the light content surface, not the dark global-app-header — undo/redo/
   preview/save reuse `.global-icon-btn--sm`; only the save-status text and
   the brand-colored Publish pill are defined here. */

.global-builder-toolbar {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.global-builder-toolbar__save {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* One save signal colors every save indicator the same way. template_builder's
   editing JS sets data-state on every [data-save-status] element (the top-bar
   text and the drawer autosave), so both color from this single mapping.
   form_builder's JS only sets data-save-status, never data-state, so these are
   a no-op there. */
[data-save-status][data-state="saved"] { color: var(--color-success); }
[data-save-status][data-state="error"] { color: var(--color-error); }
[data-save-status][data-state="dirty"] { color: var(--color-warning); }

/* Publish — text + icon on desktop, icon-only on mobile (the label collapses
   via the same d-none d-sm-inline Bootstrap utility the old header button
   used). */
.global-builder-toolbar__publish {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 var(--spacing-sm);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-button);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-action);
    background: var(--color-action);
    color: var(--color-neutral-ink-fg);
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.global-builder-toolbar__publish:hover {
    background: color-mix(in srgb, var(--color-action) 85%, black);
    border-color: color-mix(in srgb, var(--color-action) 85%, black);
}

/* Platform-wide icon-button component. `.global-icon-btn` is the canonical
   content-area icon button: a bordered, circular tap target that holds a
   single icon and nothing else. Use it anywhere a bare icon needs to be a
   button — row actions, tile actions, close buttons, reveal toggles.

   Always give it an `aria-label` (the icon carries no text):
       <button class="global-icon-btn global-icon-btn--sm" aria-label="Remove role">…</button>

   NOT for the top main header: those icons keep the existing liquid-glass
   header styling (`.global-header-btn` / `.global-header-btn-circle` / `--header-control-*`).
   This component covers the content area and other colored surfaces (the
   sidebar, a filled modal header) — use the `--ondark` variant there. */

/* ── Canonical component ── a bordered circle holding one icon; the hairline
   ring is always present so the target reads as a control at rest, and a light
   grey wash fills on hover. Sizing comes from the size modifiers below; the
   base defaults to the medium (36px) target so a bare `.global-icon-btn` is usable.

   The icon carries the same ink as the header's Filter button
   (.global-header-btn, main.css). It was --color-text-muted, which is #9ca3af on
   a white card — about 2.4:1, under the 3:1 a control's glyph needs to be seen:
   "many fo those buttons are jsut too light to even really be abelt os ee the
   icon inside the button" (Nick, 09-02). */
.global-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--control-h-base);
    height: var(--control-h-base);
    /* A flex row never takes width from the circle: in the views menu's search
       row the + shrank to 31.8 by 36 (Nick, 11-05: "not a real circle"). */
    flex-shrink: 0;
    padding: 0;
    border: 1px solid var(--color-border);
    background: none;
    color: var(--color-text-light);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: color var(--transition-fast), background var(--transition-fast),
        border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.global-icon-btn:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

.global-icon-btn:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

/* The menu this button opens is showing: the hover wash holds until it shuts. */
.global-icon-btn[aria-expanded="true"] {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

/* Pressed: the wash goes one step deeper, so a tap shows it landed. */
.global-icon-btn:active {
    background: var(--color-action-tint-pressed);
    color: var(--color-text);
}

/* A disabled button is dimmed and shows no hand. */
.global-icon-btn:disabled,
.global-icon-btn[aria-disabled="true"] {
    opacity: 0.5;
    cursor: default;
}

/* A truly disabled button is inert — pointer-events: none means it never
   picks up the hover wash or its tooltip, so this stays correct for every
   variant (including --ondark on a dark surface, where a grey hover would
   misread, and --danger, where a red wash would read as armed). */
.global-icon-btn:disabled {
    pointer-events: none;
}

/* An aria-disabled control raises a toast that says why, so its tap must land:
   pointer-events: none would swallow the click that fires it. */
.global-icon-btn[aria-disabled="true"] {
    pointer-events: auto;
}

/* The icon fills the target; SVGs inherit the button's color via currentColor. */
.global-icon-btn svg {
    width: 1.15em;
    height: 1.15em;
}

/* The glyph inside the circle is centred with every other icon button's, in
   main.css under "Icon glyph centring". It used to be done here with
   `line-height: 1` + `vertical-align: 0` on the ::before, which measured as a
   no-op: this family sat 2px high for as long as that rule existed. */

/* ── Sizes ── the three targets seen across the app: 28 (dense row/tile
   actions), 36 (default), 44 (touch-comfortable / header-scale). */
.global-icon-btn--sm {
    width: var(--control-h-sm);
    height: var(--control-h-sm);
    font-size: var(--font-size-sm);
}

.global-icon-btn--md {
    width: var(--control-h-base);
    height: var(--control-h-base);
}

.global-icon-btn--lg {
    width: var(--control-h-touch);
    height: var(--control-h-touch);
    font-size: var(--font-size-lg);
}

/* ── Shape ── the target is a circle by default; --square is the rounded-square
   escape hatch for the rare icon button in a boxy toolbar/segmented context. */
.global-icon-btn--square {
    border-radius: var(--radius-sm);
}

/* ── Skins ──
   --ghost: a tool that paints nothing until you point at it — the pencils and
   copy buttons that hide inside a row and must not read as controls at rest.
   The ring stays but turns transparent, so a ghost button measures the same
   box as every other icon button of its size, and the glyph keeps the quieter
   ink the base gave up: a pencil that has to be found only when you go looking
   is the one place the lighter grey is the point. */
.global-icon-btn--ghost {
    border-color: transparent;
    color: var(--color-text-muted);
}

.global-icon-btn--ghost:hover,
.global-icon-btn--ghost:focus-visible {
    background: var(--color-card-bg);
    color: var(--color-action);
    box-shadow: var(--shadow-sm);
}

.global-icon-btn--ghost:active {
    background: var(--color-action-tint-pressed);
    color: var(--color-action);
    box-shadow: none;
}

/* --danger: destructive action. Stays ghost until hover, then red. Matches the
   hand-rolled `.icon-btn-danger` it replaces. */
.global-icon-btn--danger:hover,
.global-icon-btn--danger:active {
    background: var(--color-error-subtle);
    color: var(--color-error);
    border-color: var(--color-error-subtle);
}

/* --primary: the emphasized / affirmative icon action — hover picks up the warm
   action tint. (Named --brand before the interaction layer moved every quiet
   control onto the fixed action ink; it no longer touches the tenant's brand.) */
.global-icon-btn--primary:hover {
    background: var(--color-action-tint);
    color: var(--color-action);
    border-color: var(--color-action-tint);
}

/* --ondark: for icon buttons on a colored surface (sidebar, a filled modal
   header). The icon and ring are explicitly light so they stay visible on any
   dark/brand fill — do NOT rely on the surface setting a light currentColor,
   which fails silently when it doesn't. Hover is a translucent white veil. */
.global-icon-btn--ondark {
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.28);
}

.global-icon-btn--ondark:hover {
    background: var(--neutral-ink-border);
    color: var(--color-neutral-ink-fg);
    border-color: rgba(255, 255, 255, 0.45);
}

/* ── Toggle state ── an icon button that is also an on/off switch fills with
   the action ink while it is on; hover lightens a step (a dark ink control
   reads "released", not "pressed harder"). Pair it with `aria-pressed` so the
   state is read out, not just seen. Last in the sheet on purpose: it has to
   outrank every skin's own hover, or a pressed button goes pale under the
   pointer. */
.global-icon-btn.is-active {
    background: var(--color-action);
    color: var(--color-neutral-ink-fg);
    border-color: var(--color-action);
}

.global-icon-btn.is-active:hover {
    background: var(--color-action-hover);
    color: var(--color-neutral-ink-fg);
    border-color: var(--color-action-hover);
}

/* A word that rides beside the icon on a phone only. On a desk the tooltip
   names the button; on a phone there is no hover, so the button says it. */
.global-icon-btn__word {
    display: none;
}

/* ── Phone (<768px) ─────────────────────────────────────────────────────────
   Every size grows to the touch square; the glyph stays its size. A button
   carrying a word grows into a pill that fits it. LAST. */
@media (max-width: 767.98px) {
    .global-icon-btn--sm {
        width: var(--control-h-touch);
        height: var(--control-h-touch);
    }

    .global-icon-btn,
    .global-icon-btn--md {
        width: var(--control-h-touch);
        height: var(--control-h-touch);
    }

    .global-icon-btn:has(.global-icon-btn__word) {
        width: auto;
        gap: var(--spacing-xsm);
        padding-inline: var(--spacing-md);
        border-radius: var(--radius-pill);
        text-decoration: none;
    }

    .global-icon-btn__word {
        display: inline;
        font-size: var(--font-size-md);
        font-weight: var(--font-weight-button);
        white-space: nowrap;
    }
}

/* Platform-wide card component. `.global-card` is the canonical opaque panel — the
   single surface treatment for any dashboard block, form section, list, or
   detail pane. Converge on it; glass is allow-list only (see the styleguide).

   It carries chrome only (fill, hairline border, card radius, resting shadow)
   and the flex-column structure a card container needs, so it stands alone —
   no Bootstrap `.card` required. Content goes in the usual slots, which main.css
   already skins with bare `.card-header` / `.card-body` rules:

       <div class="global-card">
         <div class="card-header">Bookings</div>
         <div class="card-body">…</div>
       </div>

   Because it holds no padding of its own, migrating a hand-rolled `.card` panel
   onto `.global-card` is a near-mechanical class swap — since the card-adoption
   sweep the chrome is identical, corner included: both ride --radius-card. */

/* ── Canonical component ── the locked recipe: white fill, one hairline border,
   the 8px card radius, and the resting --shadow-sm lift. */
.global-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
}

/* A list that ends the card keeps the card's bottom corners — a flush list
   is square, and its last row's fill painted over the card's radius (the
   profile's Files card, Nick, 09-03). Bootstrap's own last-child rule hands
   the list's radius on to that row. */
.global-card > .list-group:last-child {
    border-bottom-left-radius: inherit;
    border-bottom-right-radius: inherit;
}

/* ── Variants ── each collapses a recipe that today is hand-rolled in feature
   CSS across many one-off `*-card` classes. */

/* --flat: border only, no resting shadow — for panels that sit flush inside
   another surface where a lift would double up (e.g. the profile card). */
.global-card--flat {
    box-shadow: none;
}

/* --elevated: a floating, borderless shell with a heavier shadow — for a
   standalone hero surface that isn't nested in a dashboard grid (the public
   booking-form shell, the embedded feed card). */
.global-card--elevated {
    border-color: transparent;
    box-shadow: var(--shadow-lg);
}

/* --accent: a brand-colored 3px left rail marking an attention / status card
   (a pending bill, a deposit, a flagged payment). Rides on top of the hairline
   border, so the other three sides stay neutral. Declared AFTER --elevated on
   purpose: --elevated paints all four borders transparent via the border-color
   shorthand, and this longhand re-colors the left rail — keep the order so the
   two compose (a floating card can still carry a status rail). */
.global-card--accent {
    border-left-width: 3px;
    border-left-color: var(--color-action);
}

/* --success and --warning: a status tint on the fill and the edge only.
   The text keeps the card color, so a count tile reads as dark text. */
.global-card--success {
    background: var(--status-success-bg);
    border-color: var(--status-success-border);
}

.global-card--warning {
    background: var(--status-warning-bg);
    border-color: var(--status-warning-border);
}

/* --clickable: the whole card is a target. Cursor + a hover lift; pair it with
   a real link/button for keyboard access (the card itself is not focusable). */
.global-card--clickable {
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.global-card--clickable:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* An elevated card already rests at --shadow-lg, so the plain --clickable hover
   (--shadow-md, smaller) would visibly SHRINK its shadow. Hold the large shadow
   for the combination — the translateY lift alone carries the hover feedback. */
.global-card--elevated.global-card--clickable:hover {
    box-shadow: var(--shadow-lg);
}

/*
 * Notice strip — a standing message about the account or the session, held
 * above the page it applies to: operator mode, the missing-photo nudge. One
 * component because the two are the same object, a sentence and the single
 * control that ends it; only the tone differs.
 *
 * The slot sits flush under the top bar (Nick, 09-03). The strips carry no
 * margins of their own so they can mount anywhere; the slot places them.
 */

/* Edge to edge, and no bottom gap: the content column's top padding is the
   space below. That padding is also where the pinned gutter's repaint sits at
   rest, which is why it has to stay below this slot rather than hang off the
   bar — see components/page-header.css. */
.global-notice-slot {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    gap: var(--spacing-sm);
    /* Pin the band under the header so an account-level notice (a missing
       profile photo, an operator override) stays put as the page scrolls;
       everything below clears it because its height feeds --drawer-top
       (tokens.css). Painted with the page ground so the gap between two stacked
       strips never flashes the scrolling content through it. --z-sticky is the
       band's own layer: above the scrolling content, below the header (which
       carries the top edge at 1050). Nothing sticky in the content ever reaches
       this vertical band — it all clears --drawer-top, which is below here. */
    position: sticky;
    top: var(--header-bottom);
    z-index: var(--z-sticky);
    background-color: var(--color-page-bg);
}

/* A band, not a card (Nick, 09-03): square, so the bottom reads as one straight
   line across the section and the top meets the bar with no notch at either
   end. Only the block edges are drawn — run out to the section's own sides, a
   left and right border are 1px of nothing. Transparent keeps a tone that
   paints only a fill the same height as one that draws an edge. */
.global-notice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-smd);
    padding: var(--spacing-sm) var(--page-gutter);
    border-block: 1px solid transparent;
    font-size: var(--font-size-md);
}

/* The platform's tint, never the org's: these state account-level facts that
   read the same on every tenant. */
.global-notice--info {
    background-color: var(--status-info-bg);
    border-color: var(--status-info-border);
    color: var(--color-text);
}

/* Opt-in, because a short sentence pushed away from its own button across a
   wide screen stops reading as one thought. */
.global-notice--split {
    justify-content: space-between;
}

/* Each half travels as one item, so a wrap breaks between the sentence and the
   control rather than inside either. */
.global-notice__side {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 0;
}

.global-notice__arrow {
    color: var(--color-text-secondary);
}

/* The short label ("Add photo") exists for the compact shell only; the block
   below swaps it in. On a wide bar the full sentence fits. */
.global-notice__label--narrow {
    display: none;
}

/* ── Compact shell (<1024px) ────────────────────────────────────────────────
   The strip stops being sticky (nothing under the header is sticky here; the
   measurer in app.html reports --notice-height as 0 for the same reason),
   wraps its button onto a full-width row and shortens the label. Stays LAST. */
@media (max-width: 1023px) {
    .global-notice-slot {
        position: static;
    }

    .global-notice {
        flex-wrap: wrap;
        gap: var(--spacing-sm);
        padding: var(--spacing-sm) var(--page-gutter);
    }

    .global-notice__side {
        width: 100%;
    }

    .global-notice__arrow {
        display: none;
    }

    .global-notice__label--wide {
        display: none;
    }

    .global-notice__label--narrow {
        display: inline;
    }

    .global-notice .btn {
        min-height: var(--control-h-touch);
    }
}

/* ==========================================================================
   Alert — the standing inline message (ADR-131, UI Component Service)

   States a fact about the page it sits on and stays until the fact changes: a
   form that will not submit, a connection that needs attention, a payout that
   is waiting on a bank. A toast is the other half of the pair — transient
   feedback for something the person just did.

     <div class="global-alert global-alert--danger" role="alert">…</div>

   Tone comes from the shared --status-* tints, the same fills and edges the
   .global-badge pill and the .global-notice strip wear, so retuning a semantic
   color moves every soft surface at once.

   Spacing is the caller's: an alert carries no margin, so it mounts anywhere.

   Singleton-gated: a second `.global-alert {` base definition anywhere fails
   tests/interface/test_css_standards.py. Do not fork it — add a modifier.
   ========================================================================== */

.global-alert {
    padding: var(--spacing-smd) var(--spacing-md);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: var(--font-size-md);
}

/* A layout modifier's display wins over the hidden attribute, and an alert
   revealed by a script spends most of its life hidden. */
.global-alert[hidden] {
    display: none;
}

/* Opt-in, for an alert riding inside a dense panel or under a single field,
   where a full-size box would outweigh the control it belongs to. */
.global-alert--compact {
    padding: var(--spacing-sm) var(--spacing-smd);
    font-size: var(--font-size-sm);
}

/* An icon beside the sentence. Top-aligned, so a two-line sentence keeps the
   icon on its first line rather than floating it to the middle. */
.global-alert--row {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
}

.global-alert__icon {
    flex: 0 0 auto;
}

/* The sentence at one end, the control that answers it at the other. */
.global-alert--split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-smd);
}

/* The control sits under the sentence instead of beside it — for a button
   wide enough that a row would strand the words against the far edge. */
.global-alert--stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
}

.global-alert--success {
    background: var(--status-success-bg);
    border-color: var(--status-success-border);
    color: var(--color-success);
}

.global-alert--warning {
    background: var(--status-warning-bg);
    border-color: var(--status-warning-border);
    color: var(--status-warning-fg);
}

.global-alert--danger {
    background: var(--status-danger-bg);
    border-color: var(--status-danger-border);
    color: var(--color-error-text);
}

.global-alert--info {
    background: var(--status-info-bg);
    border-color: var(--status-info-border);
    color: var(--color-info);
}

/* A fact that carries no weight — a state that is simply so, not a warning. */
.global-alert--neutral {
    background: var(--color-grey-200);
    border-color: var(--color-border);
    color: var(--color-grey-700);
}

/* ==========================================================================
   Auth page — the signed-out page shell around the email confirm steps

   The org's logo and name on top, one narrow column, the Roman Roads footer
   at the bottom, on the page background. "Confirm your email" and
   "Email already confirmed" are one step after another, so they share this shell
   (account/_auth_page.html) and read as the same place.
   ========================================================================== */

.global-auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-page-bg);
}

.global-auth-page__inner {
    width: 100%;
    padding: var(--spacing-xl) var(--spacing-lg);
}

.global-auth-page__brand {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.global-auth-page__logo {
    max-height: 80px;
    max-width: 240px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin-bottom: var(--spacing-md);
}

.global-auth-page__name {
    font-size: var(--font-size-display);
    color: var(--color-text);
    margin: 0 0 var(--spacing-sm);
}

/* Under a logo the name is the second line, so it steps down a size. */
.global-auth-page__name--under-logo {
    font-size: var(--font-size-h1);
    margin: 0;
}

.global-auth-page__column {
    max-width: 480px;
    margin: 0 auto;
}

.global-auth-page__footer {
    text-align: center;
    margin-top: var(--spacing-2xl);
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
}

.global-auth-page__footer a {
    color: inherit;
}

/* ==========================================================================
   Agree line — "By continuing, you agree to the Terms and Privacy Policy."

   It stands under "Powered by Roman Roads" on the sign-in and sign-up pages
   (shared/_agree_line.html), where the Privacy and Terms links stood. Nick
   approved it on 2026-11-13. Small, grey and centred. Both links are
   underlined at rest and take the colour of the text around them.

   The link rule goes through the wrapper class, so a footer rule for its own
   anchors cannot outrank it.
   ========================================================================== */

.global-agree-line {
    margin: var(--spacing-xsm) var(--spacing-lg) 0;
    font-size: var(--font-size-xs);
    color: var(--color-grey-700);
    text-align: center;
}

.global-agree-line .global-agree-line__link {
    color: inherit;
    font-weight: inherit;
    text-decoration: underline;
}

/* ==========================================================================
   Auth tagline — "Connecting people with skills to opportunities that need them"

   The line under "SkillBridge" on the sign-up pages (account/signup.html and
   account/signup_closed.html). On a computer it stays on one line, as it
   always did. On a phone it wraps. On one line, the page was 576 px wide on
   a 390 px phone and scrolled sideways (UI review of 2026-11-14). The look
   moved here from the style attribute, with tokens of the same sizes.
   ========================================================================== */

.global-auth-tagline {
    margin: 0;
    font-size: var(--font-size-h4);
    font-weight: var(--font-weight-body);
    color: var(--color-text-light);
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .global-auth-tagline {
        white-space: normal;
    }
}

/* Platform-wide chip/tag component. `.global-chip` is the canonical small rounded
   label — the single treatment for a metadata tag, skill, role label, or
   key:value pair. The styleguide flags the gap it closes: hand-rolled shapes
   (.workers-skill-pill, .badge-role and a Bootstrap rounded-pill count) all
   do this one job. A numeric VALUE (a pay amount, a payout, a total) is not a
   chip — that is .global-value-pill (components/value-pill.css).

   Scope: this is the label chip. A toggle chip (.settings-scope-pill) wears
   it too (Nick's chip pick, 11-09). Its own sheet adds only the checked fill.
   It does NOT cover
     • status pills — those route through the canonical .global-badge component;
     • notification count bubbles (.global-sidebar-badge) — a fixed circle, a different job.

       <span class="global-chip">Posing</span>
       <span class="global-chip global-chip--ink">Lead</span>
       <span class="global-chip"><span class="global-chip__label">City</span
             ><span class="global-chip__value">Austin</span></span>

   Chrome + text sizing only, so migrating a hand-rolled tag onto it is a class
   swap. Every color resolves to a token; adoption sweeps retire the raw-hex
   families onto these modifiers. */

/* ── Canonical component ── the neutral micro-tag: subtle fill, pill radius,
   11px meta text. A transparent hairline holds the box the same size whether or
   not a modifier colors the border. */
.global-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-2xs) var(--spacing-sm);
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    background: var(--color-surface-subtle);
    color: var(--color-text);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    line-height: 1.4;
    white-space: nowrap;
}

/* ── Variants ── each collapses a recipe hand-rolled across feature CSS. */

/* --ink: an ink tint marking a role / lead / emphasized tag (today
   .payments-bill-row__referral-tag). Mutually exclusive with
   --outline: both set background + color at equal specificity, so combining
   them just lets whichever is declared later win — pick one, don't stack. */
.global-chip--ink {
    background: var(--color-action-tint-pressed);
    color: var(--color-action);
}

/* --outline: no fill, just a hairline and muted text — for a low-emphasis tag
   that should read as a quiet outline against a busy surface (today the
   availability outline pill). */
.global-chip--outline {
    background: transparent;
    border-color: var(--color-border);
    color: var(--color-text-muted);
}

/* --md: the chunkier 14px tag for a headline-adjacent label like a City/Remote
   tag, where the 11px micro size reads too small. Size only — it does not make
   a chip the right home for a pay amount; a numeric value still routes through
   .global-value-pill (see the header note). */
.global-chip--md {
    font-size: var(--font-size-md);
    padding: var(--spacing-xs) var(--spacing-sm);
}

/* ── Key:value slots ── for a metadata pair in one chip: a muted key and an
   emphasized value. */
.global-chip__label {
    color: var(--color-text-muted);
}

.global-chip__value {
    font-weight: var(--font-weight-medium);
}

/* ── Remove control ─────────────────────────────────────────────────────────
   A chip that stands for a pick the reader can undo (the Properties card's
   chosen campuses). The × is a bare button INSIDE the chip so the chip stays
   one inline-flex row and the glyph inherits the chip's own colour. */
.global-chip__remove {
    display: inline-flex;
    align-items: center;
    margin-left: var(--spacing-2xs);
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
}

.global-chip__remove:hover,
.global-chip__remove:focus-visible {
    opacity: 1;
}

.global-chip__remove .bi {
    font-size: var(--font-size-sm);
}

/* Platform-wide uppercase eyebrow/section label. `.global-label-caps` is the
   canonical treatment for the small tracked all-caps line that titles a group:
   a stat caption, a sidebar section heading, a card's template line, a filter
   group label, a totals label.

   Six near-identical hand-rolled declarations did this one job before this file
   existed (.analytics-stat-label, .analytics-section-heading, .sidebar-section
   / .global-sidebar-section-label, .opportunities-card__template, .property-filter-label,
   .condition-card__heading, .ref-breakdown__total-label). They agreed on the
   three properties that make the treatment — micro size, uppercase, positive
   tracking — and drifted only on weight, tracking step, and color.

       <div class="global-label-caps">New Opportunities</div>
       <div class="global-label-caps global-label-caps--strong
                   global-label-caps--wide">Platform</div>
       <span class="global-label-caps global-label-caps--md
                    global-label-caps--strong global-label-caps--wide">Total</span>

   Scope: TYPE ONLY — size, case, tracking, weight. It sets no color, no
   padding, and no layout, so a call site keeps its own surface color (sidebar
   ink, muted body text) and its own box in its own file. That is what makes
   adoption a pure class add rather than a visual change.

   This is not a chip and not a badge: `.global-chip` is a filled box around a
   value, `.global-badge` carries state color. This is a bare line of text. */

/* ── Canonical component ── 11px, uppercase, 0.05em tracking. Weight is
   deliberately inherited so a caption inside an already-medium block does not
   get double-bolded; opt in with --strong. */
.global-label-caps {
    font-size: var(--font-size-2xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Variants ── each collapses a step the clones had already picked. */

/* --md: the 12px step, for a heading that sits next to body copy rather than
   under it (the analytics section heading, a totals label). */
.global-label-caps--md {
    font-size: var(--font-size-xs);
}

/* --strong: medium weight, for a label that titles a region instead of
   captioning a value. */
.global-label-caps--strong {
    font-weight: var(--font-weight-medium);
}

/* --wide: the looser 0.08em tracking used where the label is isolated on its
   own line and needs to read as chrome, not as content. */
.global-label-caps--wide {
    letter-spacing: 0.08em;
}

/* Tabular numerals — the platform's one numeric-alignment utility.
   `.global-num` makes every digit occupy the same advance width, so a column of
   money, counts, percents, or durations lines up on the decimal instead of
   drifting cell to cell. It is a UTILITY, not a component: no box, no color, no
   spacing, no chrome of any kind. Add it to whatever element already renders the
   figure.

       <td class="global-num">{{ row.cost|humanize_money }}</td>
       <span class="global-num">{{ stats.gross_cost }}</span>

   Scope: alignment of the glyphs only.
     • It does NOT set text-align — right-aligning a column is the caller's
       layout decision (Bootstrap `.text-end` already does that job).
     • It does NOT size, weight, or color the number.
     • It is not for prose that merely contains a number; reach for it when
       figures stack in a column and must line up.

   `white-space: nowrap` rides along because a figure that wraps mid-value
   ("$1,2 / 40.00") defeats the alignment this exists to provide — this matches
   the `.costs-num` clone it absorbs, so adopting it is a pure class swap.

   No `font-feature-settings: 'tnum'` fallback: `font-variant-numeric` is the
   standard property and is supported by every browser the platform targets, so
   the legacy duplicate would only be a second place to keep in sync. */

.global-num {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* A booking name that breaks only after a separator.

   A name such as "Greer · Camp Grace · Big Group 9 AM · Sun Nov 8" wrapped
   anywhere: "Sun Nov / 8", or a line that started with the dot. Each part is
   drawn as its own box with its separator at its end ("Greer ·"), so a line
   breaks only between the boxes.

       {{ composed_name|name_breaks }}      a card: the parts in running text
       <span class="global-name-parts">     a preview row the browser draws:
         <span x-text="part"></span> …      one span per part, spaced by a gap

   A part longer than its line still wraps inside its own box. */

.global-name-part {
    display: inline-block;
}

.global-name-parts {
    display: flex;
    flex-wrap: wrap;
    column-gap: var(--spacing-xs);
}

/* ============================================================================
   global-spinner — the one loading ring (ADR-131 atom)
   ============================================================================
   The shared in-flight indicator for dropzones, calendars, panels and buttons.
   Absorbs three forked rings: .calendar-avail-spinner (availability-calendar.css),
   .loading-spinner (main.css, the form/button spinner) and the .ig-loader::after
   ring (features/instagram-feed.css).

   Colour comes from currentColor, so the ring inherits whatever it sits on: a
   primary button paints a white ring, a light panel paints a dark one. Set the
   colour by putting `color` on the spinner (or an ancestor) — never by
   redeclaring border-color, which would fork the component.

   Size comes from --global-spinner-size; --sm is the inline/button size. A call
   site that genuinely needs an off-scale ring sets the custom property rather
   than re-declaring width/height.

   Honours prefers-reduced-motion: the rotation stops and the ring closes into a
   full circle, so the indicator still reads as "busy" without any motion.
   ========================================================================== */

.global-spinner {
    --global-spinner-size: 2rem;
    --global-spinner-width: 0.1875rem;
    display: inline-block;
    box-sizing: border-box;
    flex-shrink: 0;
    width: var(--global-spinner-size);
    height: var(--global-spinner-size);
    border: var(--global-spinner-width) solid color-mix(in srgb, currentColor 20%, transparent);
    border-top-color: currentColor;
    border-radius: var(--radius-pill);
    animation: global-spin 0.75s linear infinite;
}

/* Inline size — buttons, search fields, table cells. */
.global-spinner--sm {
    --global-spinner-size: 1rem;
    --global-spinner-width: 0.125rem;
}

/* Ink-coloured ring for standalone loading panels (calendars, booking forms,
   dropzones) where the spinner is the only thing on screen. */
.global-spinner--ink {
    color: var(--color-action);
}

.btn .global-spinner {
    margin-right: var(--spacing-sm);
}

/* .global-btn-spinner stands in for the label rather than sitting beside it (forms.js
   swaps .btn-text out for it), so the gap above would push it off-centre. */
.btn .global-btn-spinner.global-spinner {
    margin-right: 0;
}

@keyframes global-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .global-spinner {
        animation: none;
        border-color: color-mix(in srgb, currentColor 45%, transparent);
    }
}

/* ============================================
   Loading — the two sanctioned wait treatments
   ============================================

   Both reuse .global-spinner (components/spinner.css, ADR-131), so there is
   still exactly one spinner in the product. See docs/guides/SHARED_COMPONENTS.md
   for which one to reach for. */

/* Nothing to read here, so the ring carries the brand rather than the muted
   body colour a line of text would have wanted. Sized between the inline --sm
   and the full 2rem: standing alone it has to be findable, but it drops in over
   rows that are already on screen and must not shout over them. */
.global-loading-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    color: var(--color-action);
}

.global-loading-panel .global-spinner {
    --global-spinner-size: 1.5rem;
    --global-spinner-width: 0.15rem;
}

/* For an empty container with nothing else in it yet (a modal body before its
   first swap), so the ring is not pinned to the top edge. */
.global-loading-panel--tall {
    padding: var(--spacing-xl) var(--spacing-md);
}

.global-loading-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-card-bg);
    z-index: var(--z-modal);
    transition: opacity 0.45s ease;
}

/* Scoped to a positioned ancestor instead of the viewport — the stream player
   covers its own canvas, not the page chrome around it. Stacking is left to the
   caller: an inset screen has to sit above its container's content but below
   that container's own controls, and only the caller knows where that line is. */
.global-loading-screen--inset {
    position: absolute;
    z-index: auto;
}

/* The page-ready gate (shared/js/page-ready.js). Covers the content region and
   not the whole viewport: the sidebar and header are already correct when the
   page paints, and blanking them would make a routine navigation look like a
   full reload. Sits on the page background rather than the card surface for the
   same reason — it is standing in for the page, not for a card.

   Positioning is scoped through :has() so only a page that actually includes
   the gate gets a positioned parent; every other page keeps the static flow
   that drawers and sticky headers were built against. Two parents, because a
   page's content block lands in a different box depending on its shell: the
   settings pages have their own nav beside the content, and the gate must not
   cover it. Browsers without :has() fall back to sizing the sheet against a
   further ancestor — it overshoots the content region rather than vanishing,
   which is why this is a progressive enhancement and not a hard dependency. */
.global-app-content:has(> [data-page-gate]),
.core-settings-hub-content-inner:has(> [data-page-gate]) {
    position: relative;
}

/* One tier below the modal z-index the base sheet uses: this gate covers page
   content, but a modal opened over a still-booting page has to stay on top. */
.global-loading-screen--gate {
    background: var(--color-page-bg);
    z-index: var(--z-sticky);

    /* Not the box's height, which is what an inset sheet takes by default.
       Being absolute it adds nothing back to that box, so anything landing
       behind it grew the box, grew the sheet, and slid the centred mark down:
       314px in four visible steps on Developers, 63px on a worker profile.

       Subtracting the box's own offset makes the sheet reach the fold with no
       half-built page showing beneath it. Deeper of the two shells on purpose:
       running over instead would add scrollable overflow, and a scrollbar
       appearing for the sheet's life would move the mark sideways to stop it
       moving down.

       dvh, not vh, for the same reason stream.css uses it: Safari resolves vh
       against the viewport with the toolbar retracted, so a landscape phone —
       wide enough to miss the stacked query below and still showing its
       toolbar — would get a sheet taller than the screen and a mark centred
       below true centre. A smaller helping of the exact bug above. */
    height: calc(100dvh - var(--drawer-top) - var(--page-gutter));
}

/* The full-bleed sheet this component already ships, once the layout stacks:
   below here the settings nav is a wrapping row ON TOP of the content, so the
   box starts a third of the way down the screen and no longer frames anything —
   centring in it put the mark at y=1241 on an 844px phone, a loading screen the
   reader never saw.

   The desktop gate leaves the header alone; that stops being true once the
   layout stacks. The sidebar is off-canvas, the nav is content, and the header's
   search row overflows its 40px box mid-boot then vanishes once the page
   settles — exactly the half-built chrome the gate is for, and a sheet stopping
   below the header left it ghosted on top instead. Covering the header takes the
   sidebar toggle with it, so a boot that hangs to the 5s ceiling strands a phone
   reader: accepted, because the ghost showed on every load and a hang is rare.

   One tier down from the modal panels so a real modal still wins. .global-app-header
   reads the same rung (main.css) and ties, losing on document order — pinned by a
   test, because a tie broken that way is invisible here.

   Same query the hub stacks on (settings-hub.css), also pinned, so the two
   cannot drift and no new breakpoint enters the ladder. */
@media (max-width: 767.98px) {
    .global-loading-screen--gate {
        position: fixed;
        inset: 0;
        height: auto;
        z-index: var(--z-modal-backdrop);
    }
}

/* Removed from the DOM once faded — see reveal() in page-ready.js. Pointer
   events go first so a reader who aims at a control during the fade is not
   swallowed by a sheet that is on its way out. */
.global-loading-screen--gate.is-ready {
    opacity: 0;
    pointer-events: none;
}

/* Faded rather than removed, so the reveal is not a hard cut. Callers flip
   this class and leave the node in the DOM. */
.global-loading-screen.is-hidden {
    opacity: 0;
    pointer-events: none;
}

/* The seal and the rows under it (the error line, or the bar and its words)
   as one centred column. In a plain block box the badge's bottom margin
   collapsed into the bar's top margin and the bar sat 8px under the ring
   ("too close to the loading icon", the owner, 2026-10-02); flex margins add.
   A hidden row takes no gap. The gap is one step wider than a card's, to
   match the big seal above it. The seal's sizes live here so the bar under
   it can be as wide as the ring. */
.global-loading-screen__body {
    --mark-size: min(220px, 56vw);
    --mark-ring-gap: var(--spacing-md);
    --seal-size: calc(var(--mark-size) + 2 * var(--mark-ring-gap));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xl);
}

.global-loading-screen__badge {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-action);
}

.global-loading-screen__mark {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

/* Circle-cropped to fill the badge. Orgs upload whatever they have — square
   icons, wide wordmarks, screenshots with letterboxing — and letting each keep
   its own outline made the ring look wrapped around a different shape on every
   account. `cover` takes the crop off the long edge, so every mark reads as
   the same seal.

   The cost is real and deliberate: a mark far off square loses its ends, so a
   wordmark uploaded here shows its middle. The role is "Loading mark" and
   wants an icon; an org whose only asset is a wordmark should assign it to
   Sidebar and leave this one unset for the plain ring. */
.global-loading-screen__badge--mark .global-loading-screen__mark {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-pill);
    object-fit: cover;
}

/* Seal treatment: with a mark assigned the ring wraps it rather than sitting
   beside it. The badge box is forced square so the wrapping ring stays a true
   circle for any logo aspect — a wide logo would otherwise give an oval.

   The ring is drawn past this box by the ring gap on every side (the inset
   below), so the box gives that overflow back as margin, and the rows under
   it measure their step from the ring's outer edge. */
.global-loading-screen__badge--mark {
    width: var(--mark-size);
    aspect-ratio: 1;
    margin: var(--mark-ring-gap);
}

/* inset, not a translate-centering: global-spin's rotate() shares the transform
   property and would clobber it. Grown through the spinner's own size variable
   rather than width/height, which spinner.css owns. */
.global-loading-screen__badge--mark .global-spinner {
    --global-spinner-size: var(--seal-size);
    position: absolute;
    inset: calc(-1 * var(--mark-ring-gap));
}

/* The message line is for terminal errors only. A blocking wait shows no
   progress text — it either resolves or it explains itself. It reads in the
   same ink as the bar's words, so an error under the seal is as easy to read
   as the wait it replaced. */
.global-loading-screen__message {
    color: var(--color-text-secondary);
    font-size: var(--font-size-md);
    text-align: center;
}

/* The catalog staging bar (loading_screen progress=True): the one wait that
   reports how far it has got, so it gets the role page's bar under the ring,
   with clear words under it (the owner, 2026-10-02). Under a mark the bar is
   as wide as the ring, so the two stack as one shape; the ring alone is too
   small to set a width, so the bar keeps its own there. */
.global-loading-screen__progress {
    width: min(320px, 70vw);
}

.global-loading-screen__badge--mark ~ .global-loading-screen__progress {
    width: var(--seal-size);
}

.global-loading-screen__progress-label {
    margin-top: var(--spacing-smd);
    color: var(--color-text-secondary);
    font-size: var(--font-size-md);
    text-align: center;
}

.global-loading-screen__progress-note {
    display: block;
    margin-top: var(--spacing-xs);
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    text-align: center;
}

.global-loading-screen__progress-note[hidden] {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .global-loading-screen {
        transition: none;
    }
}

/* The wait between a tap and its page, with the org mark (ADR-252 point 10, Nick 11-06).
   - Outside <main> (base/app.html), so the swap cannot take it away mid-wait.
   - It takes clicks at once, so the page being left cannot start a second action.
   - The drawer scrim's box (drawer.css) and --z-sticky keep the menu and the header in sight.
   - Two classes, so it beats main.css's .htmx-request dim wherever this file sits. */
.global-page-wait {
    display: none;
    position: fixed;
    top: var(--drawer-top);
    right: 0;
    bottom: 0;
    left: 0;
    background: var(--color-page-bg);
    z-index: var(--z-sticky);
}

/* The loading screen inside paints the card surface. This sheet stands in for
   the page, as the page gate does, so the mark sits on the page's ground.

   The mark sits where a gated page's own mark will sit, so a page that loads
   whole (Availability) takes over the wait with no jump (Nick 11-07). The gate
   stops one gutter short of the fold on a wide screen. On a phone it covers
   the whole screen, so this box does too. The header and the phone bar
   stay on top. */
.global-page-wait .global-loading-screen {
    background: none;
    bottom: var(--page-gutter);
}

@media (max-width: 767.98px) {
    .global-page-wait .global-loading-screen {
        position: fixed;
        inset: 0;
    }
}

/* .is-leaving is the same wait for a page that loads whole (nav-after-tap.js).
   One rule for both, so the delay and the fade match. When htmx hands the wait
   to .is-leaving, the sheet stays shown and the fade does not start over. */
.global-page-wait.htmx-request,
.global-page-wait.is-leaving {
    display: block;
    opacity: 1;
    pointer-events: auto;
    animation-name: global-page-wait-in;
    animation-duration: 0.2s;
    animation-timing-function: ease;
    animation-fill-mode: both;
    animation-delay: 0.25s; /* a quick answer shows no sheet */
}

@keyframes global-page-wait-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (min-width: 1024px) {
    .global-page-wait {
        left: var(--sidebar-width);
    }

    .global-app-layout.is-sidebar-collapsed .global-page-wait {
        left: var(--sidebar-collapsed-width);
    }
}

@media (prefers-reduced-motion: reduce) {
    .global-page-wait.htmx-request,
    .global-page-wait.is-leaving {
        animation-duration: 0.01s; /* no fade, but the delay stays */
    }
}

/* Platform-wide divider atom. `.global-divider` is the canonical hairline rule —
   the single treatment for "break this stack of content in two", with or without
   a centered label sitting in the gap.

   Two shapes, one class:

       <hr class="global-divider">                          plain rule
       <div class="global-divider"><span>or</span></div>    labeled rule
       <div class="global-divider global-divider--caps"><span>Your Earnings</span></div>

   The labeled shape works because the flex row grows two pseudo-element rules
   around whatever child sits between them; there is no separate --label class to
   remember. `--caps` is the micro uppercase eyebrow treatment (11px, tracked) for
   a section label rather than a connective word like "or".

   Scope: horizontal separation only. A VERTICAL 1px separator between inline
   controls (.opportunities-record-header__divider) is a different job and stays its own
   thing, and the form builder's `divider` field type renders a plain <hr class=
   "form-divider"> inside the public form's own stylesheet — forms are not a
   target here.

   Every color resolves to a token, so a call site migrating onto this is a class
   swap that drops its hand-rolled rule color. */

.global-divider {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
    margin: var(--spacing-smd) 0;
    /* Reset the UA <hr> box so the same class works on <hr> and <div>. The rule
       itself is drawn by the ::before/::after pair below, never by a border, so
       both elements land on identical pixels. */
    border: 0;
    padding: 0;
    height: auto;
    opacity: 1;
    /* The label is real prose on the login and signup pages, so it must clear
       WCAG AA. --color-text-muted (#9ca3af) dropped it to 2.5:1 and failed.
       --color-text-light reads dark today (#33232c) but tokens.css flags it as a
       broken alias a separate gated PR redefines to --color-grey-600, so we bind
       straight to --color-grey-600 (#6c6467, 5.7:1 on white) — a real token that
       resolves dark today and is where the alias is headed anyway. Size is
       --font-size-lg (15px), the original "or" size the absorbed clones used;
       --font-size-sm (13px) had shrunk it. --caps overrides both below. */
    color: var(--color-grey-600);
    font-size: var(--font-size-lg);
    line-height: 1.4;
}

.global-divider::before,
.global-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

/* The PLAIN shape this component's own docstring documents — <hr
   class="global-divider"> — has nothing between its two pseudo rules, so the
   row's gap opened a 14px hole in the middle of what is supposed to read as one
   hairline. :empty is exactly "no label": an <hr> is a void element and always
   matches, and a labeled <div> never does, so the labeled shape keeps its gap
   untouched. Found on the leads card, the first call site to use the plain
   shape — every other one is labeled, which is why the rule went unnoticed. */
.global-divider:empty {
    gap: 0;
}

/* --caps: uppercase micro eyebrow — a section label ("Your Earnings"), not a
   connective word. */
.global-divider--caps {
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* --flush: no vertical margin, for a caller that owns its own spacing (a flex
   column using `gap`, or a panel that wants the rule tight under a heading). */
.global-divider--flush {
    margin: 0;
}

/* Platform-wide avatar atom. `.global-avatar` is the single circular person
   image with an initials fallback — the one face treatment for a worker, a
   member, a payee, a rater, or the signed-in user in the sidebar.

   It replaced six hand-rolled copies of the same circle:
     • main.css            .avatar + .avatar-xs/-sm/-md/-lg/-xl
     • star-rating.css     .rating-avatar
     • sidebar.css         .global-sidebar-profile-avatar / img.sidebar-profile-photo
     • payment-dashboard   .payments-bill-row__avatar(--img), .bill-sidebar__avatar
     • payment-dashboard   .payments-pay-confirm__avatar(--img)
       workers.css         .worker-hero-avatar
       profile.css         .profile-avatar          (dead 132px hero)

       <span class="global-avatar global-avatar--sm global-avatar--ink">RH</span>
       <img class="global-avatar global-avatar--sm" src="..." alt="">
       <span class="global-avatar global-avatar--xs global-avatar--empty"
             aria-hidden="true"><i class="bi bi-person-dash"></i></span>

   SIZE LADDER — five steps, and only five. A face is xs/sm/md/lg/xl; there is no
   in-between. The hero step is ONE value: the three former hero sizes (96px dead
   .avatar-xl, 104px worker hero, 132px dead .profile-avatar) collapse into --xl.

   FILL is a modifier, never a default. The base is geometry only, exactly like
   the `.avatar` it replaces, so a caller that supplies its own fill (a feature
   skin like `.global-sidebar-profile-avatar`) keeps winning and nothing re-tints. Pick one of
   --ink / --soft / --muted / --empty when you want the primitive to own it.

   Every color, radius, and shadow resolves to a token (ADR-125). --radius-pill
   on a square box renders the same circle 50% did. */

/* ── Canonical component ── geometry only: a circle that clips its image and
   centers its initials. Never sets a fill; see the fill modifiers below. */
.global-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: var(--radius-pill);
    font-weight: var(--font-weight-medium);
}

/* A photo inside the circle, and the same circle used AS the photo — both fill
   the box and crop to center, so `<img class="global-avatar">` needs no wrapper
   (this is what retired .bill-row__avatar--img, .pay-confirm__avatar--img, and
   img.sidebar-profile-photo). */
.global-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

img.global-avatar {
    display: block;
    object-fit: cover;
}

/* ── Size ladder ── each step carries its own type size so initials always fit. */

/* xs — 24px. Dense rows and table cells (bill rows, meeting pickers). */
.global-avatar--xs {
    width: 24px;
    height: 24px;
    font-size: var(--font-size-2xs);
}

/* sm — 32px. The default face: lists, pickers, the sidebar profile row. */
.global-avatar--sm {
    width: 32px;
    height: 32px;
    font-size: var(--font-size-xs);
}

/* md — 40px. Card and roster rows where the face leads the line. */
.global-avatar--md {
    width: 40px;
    height: 40px;
    font-size: var(--font-size-md);
}

/* lg — 48px. Detail headers, modal payee identity. */
.global-avatar--lg {
    width: 48px;
    height: 48px;
    font-size: var(--font-size-base);
}

/* xl — 104px. The ONE hero step (worker detail header). No type token exists
   above 20px, so the hero glyph keeps the size the hero already rendered. */
.global-avatar--xl {
    width: 104px;
    height: 104px;
    font-size: 2.2rem;
}

/* ── Fill modifiers ── each collapses a fill recipe that was hand-rolled per
   feature. Mutually exclusive: they all set background + color at equal
   specificity, so stacking two just lets the later one win — pick one. */

/* --ink: solid ink circle with white initials. Avatars are neutral on every
   tenant — a person is not the org's marketing surface. Was .rating-avatar,
   .bill-sidebar__avatar, and .payments-pay-confirm__avatar (which hard-coded `white`). */
.global-avatar--ink {
    background: var(--color-action);
    color: var(--color-neutral-ink-fg);
}

/* --soft: tinted disc behind dark initials — a quieter face for a dense row
   that shouldn't carry a solid disc. Was .payments-bill-row__avatar. */
.global-avatar--soft {
    background: var(--color-action-tint-pressed);
    color: var(--color-text);
}

/* --muted: neutral card fill with a hairline, for a face on a busy neutral
   surface that must not read as branded. Was .worker-avatar-initials. */
.global-avatar--muted {
    background: var(--color-card-bg);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

/* --gradient: the hero's ink gradient behind large initials. Was
   .worker-hero-avatar--initials / .profile-avatar--initials.
   The far stop only lifts 15% toward white so the white initials hold the
   4.5:1 floor where the gradient lightens; a bigger lift (the old 55%)
   dropped them to ~3.5:1. Keep the sheen small — a highlight, not a fade. */
.global-avatar--gradient {
    background: linear-gradient(135deg, var(--color-action), color-mix(in srgb, var(--color-action) 85%, white));
    color: var(--color-neutral-ink-fg);
}

/* --empty: the UNASSIGNED seat — nobody holds this slot yet. Previously
   undefined platform-wide, so each surface improvised (the bill row drew a
   person-dash glyph inside a full brand-tinted disc, reading like a real
   person). The explicit treatment: no fill, a dashed hairline, a quiet glyph — an
   open outline that reads as "empty" at a glance and never as a person. It is a
   STATE, not a fill; combine it with a size, never with --ink/--soft/--muted.

   The glyph is --color-text-secondary (#64748b, 4.76:1 on the white card), NOT
   --color-text-muted (#9ca3af, 2.57:1). The seat this replaces drew brand ink on
   a brand tint at roughly 14:1, and a consolidation must never hand back less
   contrast than the thing it absorbed — muted would have failed both the 4.5:1
   text floor and the 3:1 non-text floor for a glyph that carries meaning. */
.global-avatar--empty {
    background: transparent;
    color: var(--color-text-secondary);
    /* 1.5px dashed --color-text-secondary (#64748b, ~4.8:1 on the white card)
       clears the 3:1 non-text floor. The old 1px --color-border (#d0d4db) was
       1.49:1 — a shape carrying "empty" meaning that barely showed on a bright
       screen. Nick picked the stronger outline in the visual review. */
    border: 1.5px dashed var(--color-text-secondary);
}

/* ── Ring ── the hero's halo: an ink-tinted spread ring plus the standard small
   elevation. Both layers are real tokens from tokens.css — the ring literal is
   NOT re-declared here under a component-local property name, because renaming a
   raw elevation into a --custom-prop the ratchet's regex misses would dodge the
   gate without removing the literal (ADR-125 keeps elevation off raw values, and
   the point is the value, not the property name). */
.global-avatar--ring {
    box-shadow: var(--shadow-avatar-ring), var(--shadow-sm);
}

/* The seat (hold-then-invite, Nick 11-06).

   An open seat, for someone who may Invite, is one dotted box that fills the seat's whole
   slot with a plus inside, and the whole box is the click target (holds/_seat_door.html).
   It is drawn as the permissions page's empty cell (settings-permission-stack--empty in
   permissions.css): a dashed 1 px line, the cell's small radius, a solid line on hover, and
   the house focus ring. Each place sizes the box to the slot a face would fill. */

.global-seat-door {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: var(--control-h-sm);
    padding: 0;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-sm);
    background: none;
    color: var(--color-text-muted);
    font-size: var(--font-size-base);
    line-height: 1;
    cursor: pointer;
    transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}
.global-seat-door:hover {
    border-style: solid;
    border-color: var(--color-action);
    background: var(--color-action-tint);
    color: var(--color-action);
}
.global-seat-door:focus-visible {
    outline: none;
    border-color: var(--color-action);
    box-shadow: var(--shadow-focus-ring-tight);
}
.global-seat-door:disabled { cursor: progress; }
.global-seat-door .bi { line-height: 1; }

/* The Task grid: an empty circle the size of a face (Nick 11-09), so an open
   seat stands in its pair like a person, under its badge words when it has
   any. */
.global-seat-door--grid {
    flex: none;
    width: var(--task-grid-face);
    height: var(--task-grid-face);
    min-height: 0;
    border-radius: var(--radius-pill);
}
/* A list row with the Person column hidden: the box sits at the row's end. */
.global-seat-door--row {
    width: var(--seat-door-row-width);
    flex: none;
}
/* The booking page's roster card: the line the face, name and chip would fill. */
.global-seat-door--roster {
    min-height: var(--control-h-base);
}
/* The Lineup: the size of a face on the strip. */
.global-seat-door--lineup {
    width: var(--seat-door-lineup-width);
    flex: none;
    min-height: calc(var(--lineup-face, 36px) + 2 * var(--spacing-2xs));
}

/* The role drawer (_role_drawer.html), and the People tab it is built on. */
.opportunities-role-drawer .assignments-seat-sheet { padding: 0; }
.opportunities-role-drawer .assignments-assign-panel--inline,
.opportunities-role-drawer .core-impersonate-modal-filters,
.opportunities-role-drawer .core-impersonate-modal-body {
    padding: 0;
    border: 0;
    box-shadow: none;
    max-height: none;
    overflow: visible;
}

/* One person the seat could take: a face, the name, a quiet line or two, and the small
   dotted plus that adds them. The plus is the only thing to press. */
.opportunities-role-pick {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
    min-height: var(--seat-pick-row-height);
    padding: var(--spacing-xs) 0;
}
.opportunities-role-pick__who {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}
.opportunities-role-pick__name {
    color: var(--color-neutral-ink);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    line-height: 1.3;
}
.opportunities-role-pick__line {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    line-height: 1.35;
}
.opportunities-role-pick__add {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: var(--control-h-sm);
    height: var(--control-h-sm);
    padding: 0;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-sm);
    background: none;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}
.opportunities-role-pick__add:hover {
    border-style: solid;
    border-color: var(--color-action);
    background: var(--color-action-tint);
    color: var(--color-action);
}
.opportunities-role-pick__add:focus-visible {
    outline: none;
    border-color: var(--color-action);
    box-shadow: var(--shadow-focus-ring-tight);
}
.opportunities-role-pick__add[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.5;
}
.opportunities-role-pick--busy .global-avatar--soft { opacity: 0.55; }
.opportunities-role-pick--busy .opportunities-role-pick__name { color: var(--color-text-secondary); }
.opportunities-role-pick__heading {
    margin: var(--spacing-md) 0 var(--spacing-2xs);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

/* A planner's own Sign Up: one quiet line under the list, always in reach. Sticky stops at
   the scroller's padding, so the drawer gives that padding up and the line meets the edge. */
.global-drawer-body:has(.opportunities-role-people__self) { padding-bottom: 0; }
.opportunities-role-people__self {
    position: sticky;
    bottom: 0;
    z-index: var(--z-raised);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--spacing-md);
    padding-block: var(--spacing-sm);
    border-top: 1px solid var(--color-border-hairline);
    background: var(--color-card-bg);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}
.opportunities-role-people__self-btn {
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-neutral-ink);
    font-weight: var(--font-weight-medium);
    text-decoration: underline;
    text-decoration-color: var(--color-grey-300);
    text-underline-offset: 3px;
    cursor: pointer;
}
.opportunities-role-people__self-btn:hover { text-decoration-color: currentColor; }

/* A phone has its own Invite bar, so the page's desktop bar stands down. */
@media (max-width: 767.98px) {
    .global-view-bar[data-holds-bar] { display: none; }
}

/* The banner a lost plan brings: space under it, so it never sits on the list. */
.global-holds-lost-banner { margin-bottom: var(--spacing-md); }

/* Platform-wide status dot. `.global-status-dot` is the canonical small state
   circle — the one treatment for "this step / person / artifact is in state X",
   wherever a row, card, or timeline needs a colour-only signal.

   It replaced five hand-rolled 14px circles that each re-derived the same
   geometry and re-typed the same status colours: `.pipeline-dot` (payment
   pipeline indicator), `.payments-bill-timeline__dot` (bill drawer timeline),
   `.readiness-dot` (admin bill rows), `.pb-dot` (kanban card milestone dots),
   and `.opportunities-task-group__dot` (task grouping headers).

       <span class="global-status-dot global-status-dot--done"></span>
       <span class="global-status-dot global-status-dot--pending
                    global-status-dot--hollow"></span>
       <span class="global-status-dot global-status-dot--sm"
             style="background: #6366f1"></span>

   Scope: this is the COLOUR-ONLY state marker. It deliberately does NOT cover
     • status pills with words in them — those route through `.global-badge`;
     • notification count bubbles (`.global-sidebar-badge`) — those carry a number;
     • decorative bullets and legend swatches that carry no state.

   The dot is always a perfect circle, so `--radius-pill` (999px) and a raw 50%
   render identically; the token keeps the css-standards ratchet clean. Borders
   are declared on the base as `2px solid transparent` and the box is
   `border-box`, so a hollow dot and a filled dot occupy the exact same 14px. */

/* ── Canonical component ── neutral grey fill at 14px. The border starts
   transparent so a bare dot handed a colour inline (a task group's own swatch)
   reads as one clean circle; every state modifier then sets background AND
   border-color together, so `--hollow` can swap the fill out and leave a ring
   in the state's own colour. */
.global-status-dot {
    display: inline-block;
    flex: 0 0 auto;
    box-sizing: border-box;
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-radius: var(--radius-pill);
    background: var(--ms-pending);
}

/* ── States ── the colours resolve to the shared --ms-* milestone family, so a
   status means the same thing on a kanban card, a payment pipeline, and a bill
   timeline. `--waiting` is the one state outside that family: amber reads
   "blocked on a human" and three of the absorbed clones used it for exactly
   that (bill awaiting approval, worker mid-onboarding, milestone in progress),
   so folding it into --active or --flagged would lose a real distinction. */
.global-status-dot--pending {
    border-color: var(--ms-pending);
    background: var(--ms-pending);
}

.global-status-dot--active {
    border-color: var(--ms-active);
    background: var(--ms-active);
}

.global-status-dot--done {
    border-color: var(--ms-done);
    background: var(--ms-done);
}

.global-status-dot--skipped {
    border-color: var(--ms-skipped);
    background: var(--ms-skipped);
}

.global-status-dot--waiting {
    border-color: var(--color-warning);
    background: var(--color-warning);
}

.global-status-dot--flagged {
    border-color: var(--color-error);
    background: var(--color-error);
}

/* ── --hollow ── keeps the state's ring but empties the fill, for a step not
   reached yet or a signal that is deliberately not live. Combine with a state:
   `--pending --hollow` is the "not started" circle the payment pipeline and the
   bill timeline both draw. */
.global-status-dot--hollow {
    background: var(--color-card-bg);
}

/* ── --soft ── keeps the state's ring but swaps the fill for the state's soft
   tint: started, not finished. `--active --soft` is the step a pipeline is on
   right now — the same current-stage treatment the opportunity stage flow
   draws — and it stays readable with animation off, where a solid current dot
   is indistinguishable from a completed one. */
.global-status-dot--active.global-status-dot--soft {
    background: var(--ms-active-soft);
}

/* ── --ring ── a hairline outside the dot marking it as required / emphasized
   without changing its state colour. An outline (not a shadow) so it costs the
   layout nothing and stays token-clean. */
.global-status-dot--ring {
    outline: 1px solid var(--ink-alpha-20);
    outline-offset: 0;
}

/* ── --sm ── the dense size, for a dot sitting inside a table cell, a compact
   indicator strip, or a group header where 14px crowds the line. The surface
   decides this, not the component. */
.global-status-dot--sm {
    width: 10px;
    height: 10px;
    border-width: 1px;
}

/*
 * Run history — every run of one automation for one booking, one quiet row
 * each: when it was asked for, who asked, how it ended.
 * Markup lives in app/automations/_run_history.html; the role page's runs
 * panel and the booking page's export strip both include it.
 */
.global-run-history {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}
.global-run-history__row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: var(--spacing-xs) var(--spacing-sm);
    padding: var(--spacing-xs) 0;
    border-top: 1px solid var(--color-grey-100);
}
.global-run-history__row:first-child {
    border-top: 0;
}
.global-run-history__dot {
    flex: 0 0 auto;
    align-self: center;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: var(--radius-pill);
    background: var(--color-grey-300);
}
.global-run-history__row--queued .global-run-history__dot,
.global-run-history__row--running .global-run-history__dot {
    background: var(--color-warning);
}
.global-run-history__row--done .global-run-history__dot {
    background: var(--color-success);
}
.global-run-history__row--failed .global-run-history__dot {
    background: var(--color-error);
}
.global-run-history__row--failed .global-run-history__ending {
    color: var(--color-error);
}
.global-run-history__when {
    flex: 0 0 auto;
    color: var(--color-text);
}
.global-run-history__who {
    flex: 1 1 12rem;
    min-width: 0;
}
.global-run-history__ending {
    flex: 1 1 100%;
    padding-left: var(--spacing-md); /* dot width + the row gap */
}

/* ============================================================================
   Guided tour — the shared spotlight walkthrough (ADR-171, an ADR-131 component)

   Four pieces, all inside one position:fixed block that covers the viewport:
     .global-tour          the block — a plain scrim while the intro card is
                           centred (is-dim), transparent while a step is spotlit;
                           it never takes the pointer itself
     .global-tour__shield  what takes the pointer: covers the viewport so the
                           page under the scrim is inert, and on an interactive
                           step guided-tour.js clips a hole in it the shape of
                           the spotlight so the control there gets real hovers,
                           focus and clicks
     .global-tour__spot    the spotlight — its spread shadow IS the scrim, so
                           the hole is the anchor's shape (see
                           --shadow-tour-spotlight in tokens.css)
     .global-tour__card    the step card, placed beside the anchor by
                           guided-tour.js (left/top set inline, side in
                           data-place, arrow offset in --ax / --ay)

   Placement is the script's job; this sheet only draws. Under 900px the card
   becomes a bottom sheet and the arrow goes away — a phone has no room beside
   an anchor. Markup: shared/components/guided_tour.html.
   ========================================================================== */

.global-tour {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal-backdrop);
    font-family: var(--font-family);
    pointer-events: none;
}

/* A dropdown in the spotlight opens its list outside the spotlight, where the
   scrim and the shield would grey it out and eat the click. While a tour is up
   (guided-tour.js puts is-touring on <body>), lists sit one rung above the
   tour so the viewer can pick from them. Nick, 2026-11-04: the Notice unit
   and the calendar pill's menu are both house lists now. A list inside a
   drawer the tour is lifted over (below) needs no rung of its own: the drawer
   is the spotlight, so its lists show through the hole. */
body.is-touring .global-cs-menu {
    z-index: var(--z-popover);
}

/* A step that points into a drawer or modal (z-modal, above this layer):
   guided-tour.js lifts the tour over it, so the card is not hidden under the
   drawer and the scrim dims everything but the spotlit drawer. The drawer
   still takes clicks through the spotlight's hole. */
.global-tour.is-over-dialog {
    z-index: var(--z-overlay-top);
}

.global-tour__shield {
    position: absolute;
    inset: 0;
    pointer-events: auto;
}

.global-tour.is-dim {
    background: rgba(15, 23, 42, 0.45);
}

.global-tour__spot {
    position: absolute;
    display: none;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-tour-spotlight);
    pointer-events: none;
    transition: left 0.22s ease, top 0.22s ease, width 0.22s ease, height 0.22s ease;
}

.global-tour__spot.is-open {
    display: block;
}

.global-tour__spot.is-pill {
    border-radius: var(--radius-pill);
}

.global-tour__card {
    position: absolute;
    display: none;
    width: 328px;
    max-width: calc(100vw - var(--spacing-xl));
    padding: var(--spacing-md) var(--spacing-mdlg) var(--spacing-smd);
    background: var(--color-card-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-modal);
    pointer-events: auto;
}

.global-tour__card.is-open {
    display: block;
}

.global-tour__card.is-center {
    position: fixed;
    left: 50%;
    top: 50%;
    width: 380px;
    padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-mdlg);
    text-align: center;
    transform: translate(-50%, -50%);
}

/* The arrow: a rotated square sharing the card's face and border, with the two
   edges that would show inside the card turned off. */
.global-tour__card::before {
    content: "";
    position: absolute;
    display: none;
    width: 12px;
    height: 12px;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    transform: rotate(45deg);
}

.global-tour__card[data-place="right"]::before {
    display: block;
    left: -7px;
    top: var(--ay, 24px);
    border-right: 0;
    border-top: 0;
}

.global-tour__card[data-place="left"]::before {
    display: block;
    right: -7px;
    top: var(--ay, 24px);
    border-left: 0;
    border-bottom: 0;
}

.global-tour__card[data-place="bottom"]::before {
    display: block;
    top: -7px;
    left: var(--ax, 24px);
    border-right: 0;
    border-bottom: 0;
}

.global-tour__card[data-place="top"]::before {
    display: block;
    bottom: -7px;
    left: var(--ax, 24px);
    border-left: 0;
    border-top: 0;
}

.global-tour__close {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
}

.global-tour__eyebrow {
    margin-bottom: var(--spacing-xsm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
}

.global-tour__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0 auto var(--spacing-smd);
    border-radius: var(--radius-pill);
    background: var(--color-action-tint);
    color: var(--color-action);
    font-size: var(--font-size-xl);
}

.global-tour__title {
    margin: 0 0 var(--spacing-xsm);
    padding-right: var(--spacing-lg);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-heading);
    line-height: 1.3;
    color: var(--color-text);
}

.global-tour__card.is-center .global-tour__title {
    padding-right: 0;
    font-size: var(--font-size-h4);
}

.global-tour__body {
    margin: 0 0 var(--spacing-smd);
    font-size: var(--font-size-sm);
    line-height: 1.5;
    color: var(--color-text-secondary);
}

.global-tour__foot {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.global-tour__card.is-center .global-tour__foot {
    justify-content: center;
}

.global-tour__progress {
    flex: 1;
    height: 3px;
    margin-right: var(--spacing-sm);
    overflow: hidden;
    border-radius: var(--radius-pill);
    background: var(--color-border);
}

.global-tour__progress-fill {
    display: block;
    height: 100%;
    background: var(--color-action);
}

/* The replay button rides a toolbar at toolbar-control height. */
.global-tour-start {
    width: var(--control-h-base);
    height: var(--control-h-base);
    border-radius: var(--radius-md);
}

.global-tour-start .bi {
    font-size: var(--font-size-lg);
}

@media (prefers-reduced-motion: reduce) {
    .global-tour__spot {
        transition: none;
    }
}

@media (max-width: 991.98px) {
    /* Bottom sheet. Under 992px the script clears its inline left/top and
       data-place (so no arrow draws) and this rule takes over. */
    .global-tour__card:not(.is-center) {
        position: fixed;
        left: var(--spacing-smd);
        right: var(--spacing-smd);
        top: auto;
        /* --bottom-bar-h is 0px above the phone query. */
        bottom: calc(var(--bottom-bar-h) + var(--spacing-smd));
        width: auto;
        max-width: none;
    }
}

.global-demo-video-review {
    min-width: 0;
}

.global-demo-video-player__play:focus-visible,
.global-demo-video-list__link:focus-visible {
    outline: var(--spacing-2xs) solid var(--color-focus-ring);
    outline-offset: var(--spacing-2xs);
}

/* ── Watch Tutorials: the top bar's film panel (watch_tutorials.html) ──── */

/* The button sits in .support-desk before Support, and the panel hangs under it. */
.global-watch-tutorials {
    position: relative;
    display: inline-flex;
}

.global-watch-tutorials__panel {
    position: absolute;
    top: calc(100% + var(--spacing-sm));
    inset-inline-start: 0;
    z-index: var(--z-dropdown);
    display: flex;
    flex-direction: column;
    width: var(--watch-tutorials-width);
    max-width: calc(100vw - var(--spacing-xl));
    max-height: calc(100dvh - var(--drawer-top) - var(--spacing-xl));
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    color: var(--color-text);
    background: var(--color-card-bg);
    box-shadow: var(--shadow-modal);
}

.global-watch-tutorials__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    padding: var(--spacing-smd) var(--spacing-sm) 0 var(--spacing-md);
}

.global-watch-tutorials__title {
    margin: 0;
    color: var(--color-text);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-heading);
    line-height: var(--line-height-heading);
}

/* The list scrolls inside the panel. Its top and bottom edges fade over the
   list's own padding, so a card at rest is never faded, and a card that
   scrolls past an edge melts away. */
.global-watch-tutorials__list {
    display: grid;
    flex: 1 1 auto;
    gap: var(--spacing-2xs);
    min-height: 0;
    margin: 0;
    padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-md);
    list-style: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    mask-image: linear-gradient(
        to bottom,
        transparent,
        var(--color-neutral-ink) var(--spacing-sm),
        var(--color-neutral-ink) calc(100% - var(--spacing-md)),
        transparent
    );
}

.global-watch-tutorials__card {
    display: grid;
    grid-template-columns: var(--watch-tutorials-thumb-width) minmax(0, 1fr);
    align-items: center;
    gap: var(--spacing-smd);
    padding: var(--spacing-sm);
    border-radius: var(--radius-lg);
    color: var(--color-text);
    text-decoration: none;
    transition: background var(--transition-fast);
}

.global-watch-tutorials__card:hover {
    color: var(--color-text);
    background: var(--color-surface-hover);
}

.global-watch-tutorials__card:focus-visible {
    outline: var(--spacing-2xs) solid var(--color-focus-ring);
    outline-offset: calc(-1 * var(--spacing-2xs));
}

.global-watch-tutorials__thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--color-neutral-ink);
    box-shadow: var(--shadow-sm);
}

.global-watch-tutorials__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.global-watch-tutorials__card:hover .global-watch-tutorials__thumb img {
    transform: scale(1.04);
}

.global-watch-tutorials__play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    width: var(--watch-tutorials-play);
    height: var(--watch-tutorials-play);
    margin: auto;
    border-radius: var(--radius-pill);
    color: var(--color-neutral-ink-fg);
    background: var(--neutral-ink-veil);
    font-size: var(--font-size-lg);
    transition: background var(--transition-fast);
}

.global-watch-tutorials__card:hover .global-watch-tutorials__play {
    background: var(--neutral-ink-veil-strong);
}

.global-watch-tutorials__text {
    display: grid;
    gap: var(--spacing-2xs);
    min-width: 0;
}

.global-watch-tutorials__name,
.global-watch-tutorials__summary {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.global-watch-tutorials__name {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-subheading);
}

.global-watch-tutorials__summary {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-accent);
}

/* The Watched mark shows by the card's data-demo-video-seen, which
   demo-video.js turns on the moment a film ends. */
.global-watch-tutorials__watched {
    display: none;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
}

.global-watch-tutorials__watched i {
    color: var(--color-success);
}

.global-watch-tutorials__card[data-demo-video-seen="true"] .global-watch-tutorials__watched {
    display: inline-flex;
}

@media (prefers-reduced-motion: no-preference) {
    .global-watch-tutorials__panel {
        animation: global-watch-tutorials-in var(--transition-normal);
    }
}

@keyframes global-watch-tutorials-in {
    from {
        opacity: 0;
        transform: translateY(calc(-1 * var(--spacing-xs)));
    }
}

/* On a phone the panel spans the screen under the top bar. */
@media (max-width: 767.98px) {
    .global-watch-tutorials__panel {
        position: fixed;
        top: calc(var(--drawer-top) + var(--spacing-xs));
        inset-inline: var(--spacing-sm);
        width: auto;
        max-width: none;
        max-height: calc(100dvh - var(--drawer-top) - var(--bottom-bar-h) - var(--spacing-md));
    }
}

.global-demo-video-list {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border);
}

.global-demo-video-list__title,
.global-demo-video-review__label {
    margin: 0 0 var(--spacing-smd);
    color: var(--color-text);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-heading);
}

.global-demo-video-list__link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-height: var(--control-h-touch);
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: var(--font-size-md);
    text-decoration: none;
}

.global-demo-video-list__link i {
    color: var(--color-info);
}

.global-demo-video-list__link:hover {
    color: var(--color-text);
    background: var(--color-surface-hover);
}

.global-demo-video-summary {
    margin: 0 0 var(--spacing-md);
    color: var(--color-text-light);
    font-size: var(--font-size-md);
    line-height: var(--line-height-body);
}

.global-demo-video-player,
.global-demo-video-review__preview,
.global-demo-video-review__missing {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--color-neutral-ink);
}

.global-demo-video-player iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.global-demo-video-player__play {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-smd);
    width: 100%;
    height: 100%;
    padding: var(--spacing-lg);
    border: 0;
    color: var(--color-neutral-ink-fg);
    background: none;
    font-size: var(--font-size-md);
    cursor: pointer;
}

.global-demo-video-player__play i {
    font-size: var(--font-size-display-lg);
}

.global-demo-video-page {
    padding: var(--spacing-lg);
}

/* Review rows hold a badge, a note and four buttons, so they grow past the one-line grid row. */
.global-demo-video-review__grid .global-grid__cell {
    height: auto;
    padding-block: var(--spacing-sm);
    white-space: normal;
    vertical-align: top;
}

.global-demo-video-review__name {
    display: block;
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
}

.global-demo-video-review__grid .global-demo-video-summary {
    display: block;
    margin: 0;
}

/* ── Video Review: the Organization and Person picks (_audience.html) ── */

/* The row never scrolls sideways, so it must not clip the open list. Each
   label sits at the start of its field, on a phone too. */
.global-demo-video-review__audience .global-filters-row {
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: flex-start;
    overflow: visible;
    text-align: start;
}

.global-demo-video-review__pick {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    gap: var(--spacing-xs);
    min-width: 0;
    max-width: var(--page-search-w);
}

.global-demo-video-review__pick .form-label {
    margin: 0;
}

/* A film the picked person does not get: its words go grey, its buttons stay. */
.global-demo-video-review__row--hidden .global-demo-video-review__name,
.global-demo-video-review__row--hidden .global-demo-video-summary,
.global-demo-video-review__row--hidden .global-grid__cell:nth-child(2) {
    color: var(--color-text-muted);
}

.global-demo-video-review__why {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-xs);
    color: var(--color-text-light);
    font-size: var(--font-size-sm);
}

.global-demo-video-review__heading {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.global-demo-video-review__state {
    margin-inline-start: auto;
    flex-shrink: 0;
    text-align: end;
}

.global-demo-video-review__players {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--spacing-lg);
}

.global-demo-video-review__players--one {
    grid-template-columns: minmax(0, 1fr);
}

.global-demo-video-review__missing {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-page-bg);
}

.global-demo-video-review__note {
    margin: var(--spacing-xs) 0 0;
    color: var(--color-text-light);
    font-size: var(--font-size-md);
}

.global-demo-video-review__note time {
    display: block;
    font-size: var(--font-size-sm);
}

.global-demo-video-review__ask {
    display: grid;
    gap: var(--spacing-sm);
    justify-items: start;
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}

.global-demo-video-review__ask .form-control {
    justify-self: stretch;
}

.global-demo-video-review__actions,
.global-demo-video-review__decide {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm);
}

@media (max-width: 575.98px) {
    .global-demo-video-review__grid thead {
        display: none;
    }

    /* On a phone each pick takes its own line, so a long name still fits. */
    .global-demo-video-review__pick {
        flex-basis: 100%;
        max-width: none;
    }

    .global-demo-video-review__players {
        grid-template-columns: minmax(0, 1fr);
    }

    .global-demo-video-review__heading {
        flex-wrap: wrap;
    }

    /* Each film stacks as one block on a phone: name, page, status, then its buttons. */
    .global-demo-video-review__grid,
    .global-demo-video-review__grid tbody,
    .global-demo-video-review__grid .global-grid__row,
    .global-demo-video-review__grid .global-grid__cell {
        display: block;
    }

    .global-demo-video-review__grid .global-grid__row {
        padding-block: var(--spacing-sm);
        border-bottom: 1px solid var(--color-border);
    }

    .global-demo-video-review__grid .global-grid__cell {
        border: 0;
        padding-block: var(--spacing-xs);
    }
}

.global-demo-video-review__plain {
    --bs-btn-color: var(--color-text);
    --bs-btn-bg: var(--color-card-bg);
    --bs-btn-border-color: var(--color-border);
    --bs-btn-hover-color: var(--color-text);
    --bs-btn-hover-bg: var(--color-surface-hover);
    --bs-btn-hover-border-color: var(--color-border);
}

.global-demo-video-support {
    flex-shrink: 0;
    max-height: 30vh;
    overflow-y: auto;
    overscroll-behavior-y: contain;
}

.global-demo-video-support .global-demo-video-list {
    margin: 0 var(--spacing-md) var(--spacing-md);
}

/* Stage-plus-progress readout — the shared .opportunities-stage-progress component.
   Markup: shared/components/milestone_progress.html. Used in a bookings-table
   cell, on a board card, and in the opportunity detail stage band, so the same
   booking reads the same way everywhere. It is inline-flex and sizes to its
   host, so a table cell, a card, and the band each lay it out on their own. */
.opportunities-stage-progress {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 0;
    max-width: 100%;
}
.opportunities-stage-progress__stage {
    /* Never shrink the stage name to feed the bar — the stage is the point of the
       readout, so the bar (which can grow/shrink) gives up space first. */
    flex: 0 0 auto;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    letter-spacing: .02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.opportunities-stage-progress__bar {
    flex: 1 1 3rem;
    min-width: 2.5rem;
    height: 5px;
    border-radius: var(--radius-pill);
    background: var(--color-grey-200);
    overflow: hidden;
}
.opportunities-stage-progress__fill {
    display: block;
    height: 100%;
    border-radius: var(--radius-pill);
    background: var(--color-action);
    transition: width .3s ease;
}
.opportunities-stage-progress__count {
    font-size: var(--font-size-xs);
    color: var(--color-grey-600);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Platform-wide facts-strip component (booking page redesign, 2026-10-03).
   A record's key facts in one quiet row: each fact is a small muted label over
   its value, with a hairline between facts. On a phone the facts wrap to two
   columns and lose the hairlines. An address carries two spellings: plain text
   on a wide screen, an Apple Maps link on a phone. Tokens only. */

.global-facts {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    row-gap: var(--spacing-sm);
    margin: 0;
    min-width: 0;
}

/* Two classes deep so it still wins over the phone grid below. */
.global-facts.global-facts:empty {
    display: none;
}

.global-facts__item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    min-width: 0;
    padding: 0 var(--spacing-md);
    border-left: 1px solid var(--color-grey-200);
}

.global-facts__item:first-child {
    padding-left: 0;
    border-left: 0;
}

.global-facts__label {
    margin: 0;
    font-size: var(--font-size-xs);
    font-weight: normal;
    color: var(--color-text-secondary);
}

.global-facts__value {
    margin: 0;
    font-size: var(--font-size-md);
    color: var(--color-text);
}

.global-facts__value--address {
    overflow-wrap: anywhere;
}

.global-facts__narrow {
    display: none;
}

.global-facts__link {
    color: var(--color-action);
    text-decoration: underline;
}

@media (max-width: 767.98px) {
    .global-facts {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--spacing-smd) var(--spacing-md);
    }

    .global-facts__item {
        padding: 0;
        border-left: 0;
    }

    .global-facts__wide {
        display: none;
    }

    .global-facts__narrow {
        display: inline;
    }

    .global-facts__link {
        display: inline-flex;
        align-items: center;
        min-height: var(--control-h-touch);
    }
}

/* Platform-wide stage-track component (booking page redesign, 2026-10-03).
   The one bold thing in a record header: the stage name, a row of segments
   (one per pipeline stage, filled through the current one), then the next step
   in small muted words. The fill is the current stage's own color when the
   template passes one (--stage-track-fill on the element), else the token for an
   active milestone. As a button it opens the record's pipeline. On a phone it
   goes full width and is a full-height tap target. Tokens only. */

.global-stage-track {
    --stage-track-fill: var(--ms-active);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-xs);
    min-width: 0;
    margin: 0;
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 0;
    border-radius: var(--radius-md);
    background: none;
    color: var(--color-text);
    font: inherit;
    text-align: left;
}

button.global-stage-track {
    cursor: pointer;
}

button.global-stage-track:hover {
    background: var(--color-grey-50);
}

button.global-stage-track:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

.global-stage-track__label {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-heading);
    font-size: var(--font-size-md);
    line-height: var(--line-height-heading);
}

.global-stage-track__segs {
    display: flex;
    gap: var(--spacing-2xs);
}

.global-stage-track__seg {
    flex: 1 1 var(--spacing-lg);
    height: var(--spacing-xs);
    border-radius: var(--radius-pill);
}

.global-stage-track__seg--todo {
    background: var(--ms-pending);
}

.global-stage-track__seg--done,
.global-stage-track__seg--current {
    background: var(--stage-track-fill);
}

.global-stage-track__next {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 767.98px) {
    .global-stage-track {
        width: 100%;
        min-height: var(--control-h-touch);
        padding: var(--spacing-xs) 0;
    }
}

/* Platform-wide section component (booking page redesign, 2026-10-03).

   A section is a block of content on a surface that already has a frame — a
   pane inside the page's one card. It draws no box of its own: a hairline
   between neighbours and a small sentence-case heading are the whole
   separation, so there is never a card inside a card.

       <section class="global-section">
         <h2 class="global-section__title">Money</h2>
         <div class="global-section__body">…</div>
       </section>

   `.global-section-grid` lays sections out in two equal columns on a wide
   screen and one column under 768px. Each column is a plain wrapper holding a
   stack of sections; a lone column takes the full width. */

.global-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    min-width: 0;
    padding: var(--spacing-smd);
}

/* --flush: the content pads itself (a list of rows, a dropzone), so the section
   adds only the hairline. */
.global-section--flush {
    gap: 0;
    padding: 0;
}

.global-section + .global-section {
    border-top: 1px solid var(--color-border-hairline);
}

.global-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
}

.global-section__title {
    margin: 0;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.global-section__body {
    min-width: 0;
}

.global-section-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.global-section-grid__col {
    min-width: 0;
}

.global-section-grid__col + .global-section-grid__col {
    border-left: 1px solid var(--color-border-hairline);
}

.global-section-grid > .global-section-grid__col:only-child {
    grid-column: 1 / -1;
}

@media (max-width: 767.98px) {
    .global-section-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .global-section-grid__col + .global-section-grid__col {
        border-left: 0;
        border-top: 1px solid var(--color-border-hairline);
    }
}

/* Progress bar — the shared .global-progress component. One line that says
   how far a piece of work has got. Tokens: --progress-h, --progress-track,
   --progress-fill (tokens.css), --progress-fill-ms. The fill is the fixed
   action ink every in-app bar wears (the brand colour is for chrome and
   the filled CTA, which is what the button under a bar carries) and turns
   --color-success when the work is done.

   Markup:
     <div class="global-progress" role="progressbar"
          aria-valuemin="0" aria-valuemax="100" aria-valuenow="40">
       <div class="global-progress__fill" style="width: 40%"></div>
     </div>

   --busy: there is no number to show — a short run slides across instead
   of filling (give the fill NO inline width, or the slide is pinned).
   --done: the fill turns green.
   A light sweeps the filled part so a bar waiting between two marks still
   reads as moving; reduced motion stops the sweep and the slide.

   Live on the worker's role page over the Start Editing door
   (app/assignments/_role_connect_card.html). The bookings stage readout
   (.opportunities-stage-progress) is a different thing: a whole readout of
   stage name, bar and count, not the bare bar. */
.global-progress {
    height: var(--progress-h);
    border-radius: var(--radius-pill);
    background: var(--progress-track);
    overflow: hidden;
}
.global-progress__fill {
    position: relative;
    overflow: hidden;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--progress-fill);
    transition: width var(--progress-fill-ms) ease;
}
.global-progress__fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, white 45%, transparent), transparent);
    animation: global-progress-shine 1.6s linear infinite;
}
.global-progress--done .global-progress__fill { background: var(--color-success); }
.global-progress--done .global-progress__fill::after,
.global-progress--busy .global-progress__fill::after { animation: none; }
.global-progress--busy .global-progress__fill {
    width: 35%;
    animation: global-progress-slide 1.4s ease-in-out infinite;
}
@keyframes global-progress-shine {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}
@keyframes global-progress-slide {
    from { transform: translateX(-100%); }
    to { transform: translateX(300%); }
}
@media (prefers-reduced-motion: reduce) {
    .global-progress__fill { transition: none; }
    .global-progress__fill::after { animation: none; }
    .global-progress--busy .global-progress__fill { animation: none; width: 100%; opacity: 0.35; }
}

/* ==========================================================================
   Milestone checklist — shared/components/milestone_checklist.html
   --------------------------------------------------------------------------
   The current stage's step rows and their Complete / Skip / Reopen / Send /
   No-show actions. Used on the booking Pipeline tab (and its HTMX swap).

   Lived in a <style> block inside the partial until the phone pass: an inline
   block cannot be reached by the page's phone media query, so the rows and
   buttons could not grow to a thumb-sized target. Everything here is on tokens.

   Prefix: pipelines-  (the checklist is the pipelines app's component).
   ========================================================================== */

.pipelines-milestone-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pipelines-milestone-row {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-smd);
    padding: var(--spacing-smd) var(--spacing-md);
    min-height: var(--control-h-touch);
    border-bottom: 1px solid var(--color-border);
}

.pipelines-milestone-row:last-child {
    border-bottom: none;
}

/* Brief highlight when the blocked list jumps you to a step in the checklist. */
.pipelines-milestone-row:target {
    background: color-mix(in srgb, var(--color-warning) 10%, transparent);
}

/* The status circle is the canonical .global-status-dot atom; only its optical
   alignment with the first line of the name is local. */
.pipelines-milestone-row__dot {
    margin-top: var(--spacing-2xs);
}

.pipelines-milestone-row__body {
    flex: 1;
    min-width: 0;
}

.pipelines-milestone-row__name {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-heading);
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* Done reads as the check dot plus a quieter name. The row itself keeps full
   opacity: its Reopen button and detail line are still live and still read. */
.pipelines-milestone-row--done .pipelines-milestone-row__name {
    color: var(--color-text-secondary);
}

.pipelines-milestone-row--skipped .pipelines-milestone-row__name {
    text-decoration: line-through;
    text-decoration-color: var(--color-text-muted);
}

.pipelines-milestone-row__detail {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: var(--spacing-2xs);
}

.pipelines-milestone-row__actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xsm);
    flex-shrink: 0;
    margin-top: var(--spacing-2xs);
}

.pipelines-milestone-action {
    font-size: var(--font-size-sm);
    padding: var(--spacing-xs) var(--spacing-smd);
    white-space: nowrap;
}

/* Shared status legend — the system words every surface uses. Renders once, at
   the top of the current stage's list. */
.pipelines-milestone-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-xs) var(--spacing-md);
    padding: var(--spacing-smd) var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.pipelines-milestone-legend__item {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xsm);
}

.pipelines-milestone-legend__note {
    margin-left: auto;
    font-weight: var(--font-weight-medium);
}

/* Phone: the legend is desktop chrome (the dot colours still read on the rows);
   the step's actions drop under its text as one row of equal, thumb-sized
   buttons so a coordinator can Complete or Skip from the job site. */
@media (max-width: 767.98px) {
    .pipelines-milestone-legend {
        display: none;
    }

    .pipelines-milestone-row {
        flex-wrap: wrap;
    }

    .pipelines-milestone-row__actions {
        width: 100%;
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        gap: var(--spacing-sm);
        margin-top: var(--spacing-sm);
    }

    .pipelines-milestone-row__actions .global-badge {
        align-self: center;
        justify-self: start;
    }

    .pipelines-milestone-action {
        min-height: var(--control-h-touch);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: var(--font-size-md);
    }
}

/* The "Send Confirmation Text" step's Open group text button, greyed, with its reason under it. */
.pipelines-milestone-group-text-form {
    display: inline;
    margin: 0;
}
.pipelines-milestone-group-text-off {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-2xs);
}
.pipelines-milestone-group-text-off .btn[aria-disabled="true"] {
    opacity: .55;
    cursor: not-allowed;
}
.pipelines-milestone-group-text-why {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
}

/* ============================================================
   global-person-chip — the platform's one "who" atom (ADR-125/131)

   Avatar + FULL first and last name. The name is never shortened
   to a first name or an initial: when a slot is too tight for the
   whole name, use the `--avatar` variant, which drops the label and
   carries the full name in a hover tooltip instead.

   Composes the `.global-avatar` primitive (components/avatar.css) — this
   file never redefines the circle, the overflow, or the image fit. It
   only owns the layout, the size ladder, and the two behavioural variants.

   Size ladder (avatar diameter; the variant carries it, not a prop):
     --full      40px + name + role   headers, detail rails, cards
     (default)   32px + name          general lists
     --compact   24px + name          table cells, menu rows
     --micro     16px + name          meta lines under a title
     --avatar    32px face only       full name lives in the tooltip

   Behavioural variants:
     --dropdown  pill-backed, clickable, with a __chevron affordance
     --stacked   a CONTAINER of `--avatar` chips, faces overlapping

   Partials: shared/components/_person_chip.html
             shared/components/_person_stack.html
   ============================================================ */

.global-person-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 0;
}

/* The class sits on EITHER a `.global-avatar` span wrapping an <img>, OR directly
   on a bare <img> (the micro meta lines). object-fit therefore belongs here, not
   only on `.global-avatar img` — without it a non-square photo on a bare <img> is
   stretched to the square box instead of cropped. It is inert on the span. */
.global-person-chip__avatar {
    width: 32px;
    height: 32px;
    font-size: var(--font-size-xs);
    flex-shrink: 0;
    object-fit: cover;
}

.global-person-chip__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* The name is never truncated: a person is identified by their
   full first + last, so it wraps to a second line before it ever ellipses.
   Only the secondary meta line below may clip. */
.global-person-chip__name {
    font-weight: var(--font-weight-medium);
    line-height: 1.2;
    overflow-wrap: anywhere;
    min-width: 0;
}

/* A linked name stays ink and picks up its underline on the pointer. A column of
   underlined names would outshout the values beside it; the weight already tells
   a name from its data. */
a.global-person-chip__name {
    color: var(--color-text);
    text-decoration: none;
}

a.global-person-chip__name:hover,
a.global-person-chip__name:focus-visible {
    text-decoration: underline;
}

/* Secondary line under the name — a role, an email, a team.
   --color-grey-500 (#8d8588) is 3.59:1 on white; the lighter
   --color-text-muted (#9ca3af) is only 2.54:1. This line is the smallest
   type in the atom, so it takes the darker of the two greys the absorbed
   clones used — a migration must never lower contrast. */
.global-person-chip__meta {
    font-size: var(--font-size-xs);
    color: var(--color-grey-500);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Full — 40px, name + role. Headers, detail rails, cards. */
.global-person-chip--full .global-person-chip__avatar {
    width: 40px;
    height: 40px;
    font-size: var(--font-size-md);
}

/* Compact — 24px, name only. Table cells and menu rows. */
.global-person-chip--compact {
    gap: var(--spacing-xs);
}

.global-person-chip--compact .global-person-chip__avatar {
    width: 24px;
    height: 24px;
    /* No token below --font-size-2xs; it keeps two initials inside 24px. */
    font-size: var(--font-size-2xs);
}

.global-person-chip--compact .global-person-chip__name {
    font-size: var(--font-size-sm);
}

/* Micro — 16px, name only. Meta lines under a file or form title. */
.global-person-chip--micro {
    gap: var(--spacing-xs);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.global-person-chip--micro .global-person-chip__avatar {
    width: 16px;
    height: 16px;
    font-size: var(--font-size-2xs);
}

.global-person-chip--micro .global-person-chip__name {
    font-weight: inherit;
    font-size: inherit;
}

/* An icon standing in for a missing photo on the micro line. */
.global-person-chip__avatar-fallback {
    font-size: var(--font-size-md);
    flex-shrink: 0;
    line-height: 1;
}

/* Avatar-only — the face carries the full name in its tooltip.
   This is the ONLY sanctioned way to shrink a person chip; never
   truncate the name to a first name or an initial. */
.global-person-chip--avatar {
    width: 32px;
    height: 32px;
    font-size: var(--font-size-xs);
    flex-shrink: 0;
}

/* --- Dropdown + pill -----------------------------------------
   Both wear the same soft pill skin. The dropdown opens a picker (pointer
   + hover state); the pill is a static label with no picker behind it.
   The panel a dropdown opens is the caller's — this only styles the trigger. */
.global-person-chip--dropdown,
.global-person-chip--pill {
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm) var(--spacing-xs) var(--spacing-xs);
    border-radius: var(--radius-pill);
    background: var(--color-surface-subtle);
    color: var(--color-text);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    line-height: 1;
    vertical-align: middle;
}

.global-person-chip--dropdown {
    position: relative;
    cursor: pointer;
    transition: background-color 120ms ease-in-out;
}

.global-person-chip--dropdown:hover,
.global-person-chip--dropdown:focus {
    background: var(--color-surface-hover);
    outline: none;
}

.global-person-chip--pill .global-person-chip__avatar,
.global-person-chip--dropdown .global-person-chip__avatar {
    width: 20px;
    height: 20px;
    font-size: var(--font-size-2xs);
}

.global-person-chip__current {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    min-width: 0;
}

/* The chevron sits on the pill fill (--color-surface-subtle, #f8f9fa), not
   white. --color-grey-500 (#8d8588) is only 3.41:1 there — under 4.5:1. Bind to
   --color-text-secondary (#64748b), the app's cool secondary-text grey and the
   closest existing token to the original #6b7280: 4.51:1 on the resting pill. */
.global-person-chip__chevron {
    font-size: var(--font-size-2xs);
    color: var(--color-text-secondary);
    transition: transform 150ms ease-in-out;
    margin-left: var(--spacing-2xs);
    flex-shrink: 0;
}

.global-person-chip__chevron--open {
    transform: rotate(180deg);
}

/* --- Stacked --------------------------------------------------
   A container of `--avatar` chips whose faces overlap. Each face
   still carries its own full-name tooltip, so no name is lost. */
.global-person-chip--stacked {
    display: inline-flex;
    align-items: center;
}

.global-person-chip--stacked .global-person-chip--avatar {
    border: 2px solid var(--color-card-bg);
}

.global-person-chip--stacked .global-person-chip--avatar + .global-person-chip--avatar {
    margin-left: calc(-1 * var(--spacing-sm));
}

.global-person-chip--stacked .global-person-chip--avatar:hover,
.global-person-chip--stacked .global-person-chip--avatar:focus-visible {
    z-index: var(--z-sticky);
    position: relative;
}

/* ==========================================================================
   global-badge — the ONE status pill (ADR-131, UI Component Service)
   ==========================================================================

   One shape, one colour source. A badge says WHAT STATE something is in:
   success / warning / danger / info / neutral (plus the two ink-tinted role
   tones). It is never interactive — a filter you can click is a chip or a
   segmented control, not a badge.

   Render it through the partial, not by hand:

       {% include "shared/components/status_badge.html" with status=worker.status %}

   or, when the label is already computed:

       <span class="global-badge global-badge--{% status_variant x %}">…</span>

   The tone comes from status_variant() in apps/core/templatetags/ui_tags.py —
   that mapping stays the single status -> tone contract. Add a new status by
   mapping it there; no new CSS is ever needed.

   Absorbed clones (deleted in the same commit that added this file):
     .status-badge (main.css)                              — became this base
     .badge-role            components/signup-groups.css   — signup role pills
     .badge-type            templates/shared/components/milestone_checklist.html
     .status-pill           features/payment/payment-dashboard.css
     .exc-list__badge       features/exceptions-list.css
     .status-pill           templates/editing/remote_work.html (fleet board)

   Singleton-gated: a second `.global-badge {` base definition anywhere fails
   tests/interface/test_css_standards.py. Do not fork it — add a modifier.
   ========================================================================== */

.global-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    line-height: 1.4;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    /* A pill is one line by definition: a squeezed cell narrows the text
       beside it, never folds "NO PAYOUTS" into two stacked words. */
    white-space: nowrap;
}

/* Compact. Opt-in, for a pill that rides inline in a dense row instead of
   sitting in a cell of its own: smaller and tighter, holding its own width so
   a row short of space squeezes the words beside it rather than the pill, and
   keeping the case it was handed — a clock time or a street is not a word to
   shout. Digits line up column with column down a stack of rows. */
.global-badge--compact {
    flex: 0 0 auto;
    padding: 0 var(--spacing-xsm);
    font-size: var(--font-size-2xs);
    font-variant-numeric: tabular-nums;
    text-transform: none;
    letter-spacing: normal;
    white-space: nowrap;
}

/* Optional leading dot. Inherits the tone colour via currentColor, so a tone
   modifier is the only thing that ever has to know about colour. */
.global-badge__dot {
    width: 0.4rem;
    height: 0.4rem;
    flex: 0 0 auto;
    border-radius: var(--radius-pill);
    background: currentColor;
}

/* --------------------------------------------------------------------------
   Tones. Each group leads with the semantic tone that carries the colour; the
   status-named selectors after it are aliases so a template can use either
   `--<tone>` (emitted by {% status_variant %}) or a literal status name.
   This is the single colour source for the pill.
   -------------------------------------------------------------------------- */

/* Success (green) — completed / approved / locked-in / ready outcomes. */
.global-badge--success,
.global-badge--active,
.global-badge--confirmed,
.global-badge--assigned,
.global-badge--approved,
.global-badge--completed,
.global-badge--accepted,
.global-badge--ready,
.global-badge--open {
    background: var(--status-success-bg);
    color: var(--color-success);
}

/* Warning (amber) — awaiting action / in the queue / in use. */
.global-badge--warning,
.global-badge--pending,
.global-badge--scheduled,
.global-badge--in-use,
.global-badge--draft {
    background: var(--status-warning-bg);
    color: var(--status-warning-fg);
}

/* Danger (red) — RESERVED for genuine failures/errors and hard blocks. A
   cancellation or decline is not a failure; those live in the neutral group. */
.global-badge--danger,
.global-badge--failed,
.global-badge--error,
.global-badge--offline,
.global-badge--blocked,
.global-badge--revoked {
    background: var(--status-danger-bg);
    color: var(--color-error);
}

/* Neutral (grey) — calm outcomes and dormant states: cancelled, declined,
   closed, paused, inactive. Deliberately NOT red. */
.global-badge--neutral,
.global-badge--cancelled,
.global-badge--declined,
.global-badge--withdrawn,
.global-badge--inactive,
.global-badge--disabled,
.global-badge--paused,
.global-badge--closed,
.global-badge--expired,
.global-badge--other,
.global-badge--worker {
    background: var(--color-grey-200);
    color: var(--color-grey-700);
}

/* Info (platform purple) — open / neutral-active / in-flight states. */
.global-badge--info,
.global-badge--published,
.global-badge--rescheduled,
.global-badge--filled,
.global-badge--progress,
.global-badge--transient,
.global-badge--manual,
.global-badge--callback,
.global-badge--in_progress,
.global-badge--invited {
    background: var(--status-info-bg);
    color: var(--color-info);
}

/* Ink-tinted — internal / team-only tag, form-driven milestones. Ink text on
   the matching ink tint: fixed platform colors, the same on every tenant. */
.global-badge--ink,
.global-badge--internal,
.global-badge--form {
    background: var(--color-action-tint-pressed);
    color: var(--color-action);
}

/* Dark — admin role. */
.global-badge--dark,
.global-badge--admin {
    background: var(--color-grey-700);
    color: var(--color-card-bg);
}

/* --------------------------------------------------------------------------
   Size + density modifiers. The SURFACE picks the size, not the developer:
   default = normal rows and headers, --sm = dense lists and inline meta rows.
   -------------------------------------------------------------------------- */

/* Dense: exception rows, milestone type tags, table meta cells. */
.global-badge--sm {
    padding: var(--spacing-2xs) var(--spacing-sm);
    font-size: var(--font-size-2xs);
    letter-spacing: 0.02em;
}

/* Sentence-case: a badge whose label is a human phrase ("Waiting for
   approval", "Auto on booking") rather than a one-word state. */
.global-badge--sentence {
    text-transform: none;
    letter-spacing: normal;
}

.global-badge i {
    font-size: var(--font-size-2xs);
}

/* ==========================================================================
   global-seat-badge — what a seat IS (Worship Leader, Lead, Shadow)
   ==========================================================================

   A thin grey outline tag after the role name (Nick 11-05). The status pill
   (badge.css) says where a person stands: Confirmed, Invited, Open. This says
   what the seat is, so it never borrows a status colour or the round pill:
   one grey for every badge, square-ish corners, no fill, no icon. It rides
   the role name, never the person, and it is never a control.

   One markup, from shared/components/_seat_badges.html (the two Alpine
   copies in _opportunity_form.html and _lineup.html draw the same):

       <span class="global-seat-badge global-seat-badge--md" data-seat-badge
             data-badge-word="Worship Leader">Worship Leader<span
             class="visually-hidden"> badge</span></span>

   A seat with more than one badge shows the first in full and the rest as
   one "+N" (__more), with every name in its tooltip.

   Sizes: --sm a grid or table cell, the Lineup, the drawer's Roles list
   (16px); --md a card, a roster card, a Sign Up row, a pin pop-up (20px,
   the default); --lg the seat page header (28px). Every colour and size
   comes from tokens.css (--badge-*).
   ========================================================================== */

.global-seat-badge {
    display: inline-flex;
    flex: 0 0 auto;
    align-self: flex-start;
    align-items: center;
    width: fit-content;
    height: var(--sb-h);
    margin-left: var(--spacing-xsm);
    padding: 0 var(--sb-pad);
    vertical-align: middle;
    color: var(--badge-fg);
    font-family: var(--font-family);
    font-size: var(--sb-font);
    font-weight: var(--font-weight-medium);
    font-style: normal;
    line-height: 1;
    text-transform: none;
    white-space: nowrap;
    border: var(--badge-line-width) solid var(--badge-line);
    border-radius: var(--radius-sm);
}

.global-seat-badge--sm {
    --sb-h: var(--badge-size-sm);
    --sb-font: var(--badge-font-sm);
    --sb-pad: var(--badge-pad-sm);
}

.global-seat-badge,
.global-seat-badge--md {
    --sb-h: var(--badge-size-md);
    --sb-font: var(--badge-font-md);
    --sb-pad: var(--badge-pad-md);
}

.global-seat-badge--lg {
    --sb-h: var(--badge-size-lg);
    --sb-font: var(--badge-font-lg);
    --sb-pad: var(--badge-pad-lg);
}

/* A seat's second badge and on: one quiet count after the first. */
.global-seat-badge__more {
    margin-left: var(--spacing-xs);
    color: var(--badge-fg);
    font-size: var(--badge-font-sm);
    font-weight: var(--font-weight-medium);
    vertical-align: middle;
}

/* Platform-wide checkbox component. `.global-checkbox` is the canonical box for
   SELECTING FROM A LIST — pick these three files, show these four columns.

   Scope: this is the CHECKBOX only. It deliberately does NOT cover
     • switches / toggles (.form-switch, .global-toggle-switch) —
       turning ONE thing on or off is a different control and stays separate;
     • the form builder (apps/forms) — that editor legitimately renders both
       semantics and is not a sweep target;
     • native accent-color checkboxes (.calendar-filter-item, .calendar-avail-day-toggle,
       .opportunities-property-filter-option) — those never left the OS widget, so pulling
       them in here would be a visual change, not an absorption.

       <input type="checkbox" class="global-checkbox">

   Why appearance:none rather than accent-color: accent-color is honored
   unevenly on iOS Safari, so the box is drawn here and filled with
   var(--color-action) when checked — the fixed action ink, identical across
   browsers and tenants (a checkbox is a quiet control, so it never takes the
   brand color). The check glyph is an inline SVG data URI (no icon font inside
   a form control, and it stays crisp at any DPR), masked so its color comes
   from var(--color-neutral-ink-fg) — always legible on the ink fill.

   The one component-local custom property below is the size knob, kept local so
   the component owns its own recipe. The focus ring reuses the platform's
   canonical focus-visible declaration verbatim (see main.css / filter-bar.css). */

.global-checkbox {
    /* Box edge. 1rem matches both absorbed clones (the deliverables file row
       and the opportunities column drawer both drew a 16px box). */
    --global-checkbox-size: 1rem;

    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex: 0 0 auto;
    width: var(--global-checkbox-size);
    height: var(--global-checkbox-size);
    margin: 0;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-card-bg);
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.global-checkbox:hover {
    border-color: var(--color-action);
}

.global-checkbox:checked {
    background: var(--color-action);
    border-color: var(--color-action);
}

/* The tick. Painted on a full-bleed ::after so the glyph centers itself at any
   box size — no per-size offset math to drift.

   The glyph is MASKED, not drawn: the data URI supplies only the shape (a mask
   samples alpha, so the stroke color inside it is inert) and the paint comes
   from background: var(--color-neutral-ink-fg), the fixed foreground of the
   ink fill the box takes when checked (14.6:1 on #24292f).
   Same -webkit-mask/mask pairing the search-clear control uses in
   filter-bar.css. */
.global-checkbox:checked::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--color-neutral-ink-fg);
    -webkit-mask: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 8 7 12 13 5'/%3E%3C/svg%3E") center / 75% 75% no-repeat;
    mask: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 8 7 12 13 5'/%3E%3C/svg%3E") center / 75% 75% no-repeat;
}

.global-checkbox:focus-visible {
    outline: none;
    border-color: var(--color-focus-ring);
    box-shadow: var(--shadow-focus-ring);
}

.global-checkbox:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.global-ordered-checklist {
    display: flex;
    flex-direction: column;
}

.global-ordered-checklist__heading {
    margin-bottom: var(--spacing-sm);
}

.global-ordered-checklist__row {
    display: grid;
    grid-template-columns: var(--spacing-md) auto minmax(0, 1fr) max-content;
    align-items: center;
    column-gap: var(--spacing-sm);
    min-height: var(--spacing-2xl);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-top: 1px solid var(--color-border-hairline);
}

.global-ordered-checklist__row:last-of-type {
    border-bottom: 1px solid var(--color-border-hairline);
}

.global-ordered-checklist__label {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
}

.global-ordered-checklist__detail {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.global-ordered-checklist__grip {
    width: var(--spacing-md);
    color: var(--color-text-muted);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.global-ordered-checklist__row:hover .global-ordered-checklist__grip {
    opacity: 1;
}

.global-ordered-checklist__row.is-sortable-ghost {
    background: var(--color-action-tint);
}

/* ============================================================
   global-date-cal — the platform's month calendar (ADR-125/131)

   A whole month at a time, with the month and the year each a control of its
   own, so a date years out is two moves away instead of one arrow press per
   month. The state and the date maths live in shared/js/date-calendar.js.

   This sheet paints the inside of the calendar only. It carries no surface,
   border or shadow: it mounts inside whatever panel opened it (the grid's
   editor, a popover) and takes that panel's material, so a calendar never
   arrives as a second card floating inside the first.

   Partial: shared/components/_date_calendar.html
   ============================================================ */

.global-date-cal {
    width: 17rem;
    max-width: 100%;
}

/* ── The month and year line ─────────────────────────────────────────────── */
.global-date-cal__nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
}

.global-date-cal__arrow {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-card-bg);
    color: var(--color-text);
    cursor: pointer;
}

.global-date-cal__arrow:hover {
    background: var(--color-action-tint);
}

.global-date-cal__month,
.global-date-cal__year {
    padding: var(--spacing-2xs) var(--spacing-xs);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-card-bg);
    color: var(--color-text);
    font-size: var(--font-size-sm);
}

.global-date-cal__month {
    flex: 1 1 auto;
    min-width: 0;
}

/* Wide enough for four digits and the stepper the browser draws beside them. */
.global-date-cal__year {
    flex: 0 0 4.5rem;
    width: 4.5rem;
}

/* ── The month itself ────────────────────────────────────────────────────── */
.global-date-cal__dow,
.global-date-cal__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--spacing-2xs);
}

.global-date-cal__dow {
    margin-bottom: var(--spacing-2xs);
}

.global-date-cal__dow span {
    padding: var(--spacing-2xs) 0;
    text-align: center;
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
}

.global-date-cal__cell {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Transparent until today claims it, so no day shifts when the ring lands. */
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text);
    font-size: var(--font-size-sm);
    cursor: pointer;
}

.global-date-cal__cell:hover:not(:disabled) {
    background: var(--color-action-tint);
}

/* The days either side of this month are shown so the weeks stay whole, but they
   are not what the reader came to pick. */
.global-date-cal__cell--muted {
    color: var(--color-text-muted);
}

/* Today wears a ring so a reader who jumped to a far month keeps a bearing. A
   picked day is filled instead — it no longer needs one. */
.global-date-cal__cell--today {
    border-color: var(--color-action);
}

.global-date-cal__cell--selected {
    background: var(--color-action);
    color: var(--color-neutral-ink-fg);
    font-weight: var(--font-weight-medium);
}

/* The tight ring, not the 3px halo: a day sits against six neighbours that would
   clip a wider one. */
.global-date-cal__arrow:focus-visible,
.global-date-cal__month:focus-visible,
.global-date-cal__year:focus-visible,
.global-date-cal__cell:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus-ring-tight);
}

.global-date-cal__cell:disabled {
    color: var(--color-text-muted);
    cursor: not-allowed;
}

/* The shared grid shape: any list with a column catalog mounts it, so nothing here
   is named after a surface. Look copied from HubSpot's list (Nick's pick 2026-09-01). */

/* Bounded, so the header can stick to its top and the frozen column can slide
   under the rest. A table that scrolled with the page would have neither.
   Isolated, so the rungs its sticky parts climb stay inside the grid: a menu
   the toolbar opens over it sits above the whole table, frozen headers
   included, instead of losing to whatever shares its rung and comes later.
   The 70vh cap is the fallback bound; inside a viewport-fit page
   (.global-page-fill, main.css) flex hands the wrap its height and lifts
   the cap. */
.global-grid-wrap {
    position: relative;
    isolation: isolate;
    overflow: auto;
    overscroll-behavior: contain;
    max-height: 70vh;
}

.global-grid {
    /* Where text ellipsizes; a drag overrides it per column (shared/js/grid-resize.js). */
    --grid-col-max: 18rem;
    /* The height EVERY row is drawn at, and the name that rides it. These are the
       standard step's own values, so a grid that names no step is still never sized by
       its contents, and --rows-standard needs no rule of its own. */
    --grid-row-h: 3rem;
    --grid-name-size: var(--font-size-lg);
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--font-size-md);
    color: var(--color-text);
    background: var(--color-card-bg);
}

/* The steps that move off the base (property_columns.ROW_HEIGHT_STEPS). A roomier row
   buys a bigger name rather than more empty space, and the face grows with it — the
   atom's own next size up, mounted where the cell is rendered. */
.global-grid--rows-compact {
    --grid-row-h: 2.25rem;
    --grid-name-size: var(--font-size-md);
}

.global-grid--rows-relaxed {
    --grid-row-h: 4rem;
    --grid-name-size: var(--font-size-h4);
}

/* ── The header band ─────────────────────────────────────────────────────── */
.global-grid__head {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
}

.global-grid__head,
.payments-ledger__table thead th,
.reports-canvas .reports-result__table thead th {
    background: var(--color-card-bg);
    border-bottom: 1px solid var(--color-border);
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: left;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-body);
    color: var(--color-text-secondary);
    text-transform: none;
    letter-spacing: normal;
    white-space: nowrap;
    vertical-align: middle;
}

/* The heading the grid is ordered by comes back to the data's own ink. The
   arrow is already on it, so nothing else has to mark it. */
.global-grid__head:has(.global-grid__sort-mark) {
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
}

/* The frozen band. Its headers sit above both the band and the rows, so they
   take the one rung higher (inside the wrap's own stack — see above); how far
   in each sits is a measurement, so
   shared/js/grid-resize.js writes the `left` beside the widths. */
.global-grid__head--pinned {
    z-index: var(--z-dropdown);
}

.global-grid__head--pinned,
.global-grid__cell--pinned {
    position: sticky;
    left: 0;
    background: var(--grid-tone-bg, var(--color-card-bg));
}

.global-grid__cell--pinned {
    z-index: var(--z-raised);
}

/* Only the band's last column draws the seam, so one rule marks where the
   frozen columns end however many of them there are. */
.global-grid__head--edge,
.global-grid__cell--edge {
    border-right: 1px solid var(--color-border-subtle);
}

/* A sortable heading is a button that looks like its label. */
.global-grid__sort {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.global-grid__sort:hover {
    color: var(--color-text-light);
}

.global-grid__sort-mark {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* A property this reader may not see: the column stays (Nick's rule), the lock
   is the whole of what it says. */
.global-grid__lock {
    margin-left: var(--spacing-xs);
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
}

/* ── The drag edge ─────────────────────────────────────────────────────────
   The hit area is wider than the line a reader sees. touch-action lets the drag
   own touch input instead of fighting the wrap's own scrolling. */
.global-grid__resize {
    position: absolute;
    top: 0;
    right: -4px;
    width: 9px;
    height: 100%;
    z-index: var(--z-raised);
    cursor: col-resize;
    user-select: none;
    touch-action: none;
}

.global-grid__resize::after {
    content: "";
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 4px;
    width: 1px;
    background: transparent;
    transition: background var(--transition-fast);
}

.global-grid__head:hover .global-grid__resize::after,
.global-grid__resize:hover::after {
    background: var(--color-text-muted);
}

/* Mid-drag the pointer is often nowhere near the handle, so the cursor and the
   no-select rule move to the page. */
body.global-grid-resizing {
    cursor: col-resize;
    user-select: none;
}

/* The column adder. Its own column, holding the leftover width so the real
   columns stay as narrow as their content. */
.global-grid__adder {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    width: 100%;
    background: var(--color-card-bg);
    border-bottom: 1px solid var(--color-border);
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: left;
}

.global-grid__addbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-card-bg);
    color: var(--color-text-muted);
    cursor: pointer;
}

.global-grid__addbtn:hover {
    background: var(--color-surface-subtle);
    color: var(--color-text);
}

/* The heading's own menu, HubSpot's three dots: out of the way until the
   heading is under the pointer, and always there for the keyboard. */
.global-grid__headbtn {
    margin-left: var(--spacing-xs);
    padding: 0 var(--spacing-2xs);
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    cursor: pointer;
    opacity: 0;
}

.global-grid__head:hover .global-grid__headbtn,
.global-grid__headbtn:focus-visible {
    opacity: 1;
}

.global-grid__headbtn:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

/* ── Rows and cells ────────────────────────────────────────────────────────
   The hover fill is repainted on the frozen cell too: it is its own painted
   surface, so the row's background never shows through it. */
.global-grid__cell {
    height: var(--grid-row-h);
    /* No vertical padding: the height is the whole of the room a row gets, so a
       cell can never be drawn taller than the one beside it. */
    padding: 0 var(--spacing-md);
    border-bottom: 1px solid var(--color-border-subtle);
    vertical-align: middle;
    white-space: nowrap;
}

/* Several small things in one cell — skill pills, a "+2". They ride one line and the
   cell clips what does not fit, rather than wrapping and pushing the row taller. */
.global-grid__chips {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    max-width: var(--grid-col-max);
}

/* The pills are what a narrow column eats, never the count beside them: a cell
   that drops "+3" reads as a worker who holds four skills and no more. */
.global-grid__pills {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    min-width: 0;
    overflow: hidden;
}

.global-grid__pills > *,
.global-grid__chips > .global-chip {
    flex: none;
}

.global-grid__row:nth-child(even) .global-grid__cell,
.global-grid__row:nth-child(even) .global-grid__cell--pinned {
    background: var(--grid-tone-bg, var(--color-surface-subtle));
}

/* The tint, not --color-surface-hover: that grey is the one the cell borders are
   drawn in, so a row filled with it loses the rule under it just as the pointer
   arrives. */
.global-grid__row:hover .global-grid__cell,
.global-grid__row:hover .global-grid__cell--pinned {
    background: var(--grid-tone-bg, var(--color-action-tint));
}

/* Conditional styling — the platform's four semantic slots and nothing else
   (Nick's rule, 2026-09-02). A rule paints one CELL; the zebra and hover fills
   are written against the ROW, which makes them the more specific pair, so
   source order settles nothing between them. Every fill above therefore reads
   the tone first and keeps its own colour as the fallback — otherwise a rule
   paints only the odd rows the pointer is not on, and a filter change
   reshuffles which rows those are (Nick, 2026-09-03). The opportunities table
   (milestones.css, .opportunities-milestone-propcell and the milestone cells,
   .opportunities-milestone-td) wears the same stamp, so its cells share these
   rules rather than repeating the tokens. A rule's tone wins over the late red:
   the rule is the coordinator's own word on that cell. */
.global-grid__cell[data-tone],
.opportunities-milestone-propcell[data-tone],
.opportunities-milestone-td[data-tone] {
    background: var(--grid-tone-bg);
    color: var(--grid-tone-text);
}

.global-grid__cell[data-tone="success"],
.opportunities-milestone-propcell[data-tone="success"],
.opportunities-milestone-td[data-tone="success"] {
    --grid-tone-bg: var(--color-success-bg);
    --grid-tone-text: var(--color-success-text);
}

.global-grid__cell[data-tone="warning"],
.opportunities-milestone-propcell[data-tone="warning"],
.opportunities-milestone-td[data-tone="warning"] {
    --grid-tone-bg: var(--color-warning-bg);
    --grid-tone-text: var(--color-warning-text);
}

.global-grid__cell[data-tone="danger"],
.opportunities-milestone-propcell[data-tone="danger"],
.opportunities-milestone-td[data-tone="danger"] {
    --grid-tone-bg: var(--color-error-subtle);
    --grid-tone-text: var(--color-error-text);
}

.global-grid__cell[data-tone="info"],
.opportunities-milestone-propcell[data-tone="info"],
.opportunities-milestone-td[data-tone="info"] {
    --grid-tone-bg: var(--status-info-bg);
    --grid-tone-text: var(--color-info);
}

/* The last column soaks up the leftover width so nothing else has to stretch. */
.global-grid__cell--filler {
    width: 100%;
}

/* A cell nobody filled in still has to read as a cell. */
.global-grid__empty {
    color: var(--color-text-muted);
}

/* ── An editable cell ──────────────────────────────────────────────────────
   The whole cell is the target, the way HubSpot's is. The pencil's room is held
   whether it shows or not, so nothing shifts as the pointer crosses. */
.global-grid__cell--editable {
    cursor: text;
    padding-right: var(--spacing-lg);
}

/* The frozen column is already sticky, which positions it; relative there would
   unfreeze it. Everywhere else the cell has to become the pencil's anchor. */
.global-grid__cell--editable:not(.global-grid__cell--pinned) {
    position: relative;
}

.global-grid__row:hover .global-grid__cell--editable:hover {
    background: var(--grid-tone-bg, var(--color-card-bg));
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-inset-ring-neutral);
}

/* An outline, not a shadow, so it never trades places with the well above. */
.global-grid__cell--editable:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: -2px;
}

/* Only under the pointer: a column of pencils would be louder than the values. */
.global-grid__pencil {
    position: absolute;
    top: 50%;
    right: var(--spacing-sm);
    transform: translateY(-50%);
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    opacity: 0;
}

.global-grid__cell--editable:hover .global-grid__pencil,
.global-grid__cell--editable:focus-visible .global-grid__pencil {
    opacity: 1;
}

.global-grid__value {
    display: inline-block;
    max-width: var(--grid-col-max);
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}

/* A day already gone — the Skill expires column's lapsed date. The value turns
   the failure red instead of growing a badge, so the column stays one column
   of dates and the red one is the row that needs a hand. */
.global-grid__value--expired {
    color: var(--color-error);
}

/* A link_template cell: "Open ↗" instead of the raw value, so the click reads
   as leaving the page rather than editing the cell. @click.stop (in the
   template) keeps the row's own click-to-edit from also firing. */
.global-grid__link {
    display: inline-flex;
    align-items: center;
    color: var(--color-action);
    text-decoration: none;
}

.global-grid__link:hover,
.global-grid__link:focus-visible {
    text-decoration: underline;
}

.global-grid__link i {
    font-size: var(--font-size-xs);
    margin-left: var(--spacing-xs);
}

/* The first cell is the row's only way into the record, so every other cell stays
   free to be read, selected and edited (HubSpot's list, Nick 09-02). The link itself
   belongs to whatever atom draws that cell — for a person, components/person-chip.css. */
.global-grid .global-person-chip {
    vertical-align: middle;
}

/* The name is the one value in a row that grows with the row, so the grid sizes it
   from its own step rather than taking whichever size the atom was drawn at. It also
   ellipses here: the atom wraps a name it cannot fit, which is right in a card and
   would make one row taller than the next in a grid. */
.global-grid .global-person-chip__name {
    font-size: var(--grid-name-size);
    max-width: var(--grid-col-max);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* A phone: nothing frozen (Nick, 10-16: the columns as on a desk) — the first
   column scrolls with the rest and the seam that marked the band's end goes;
   the cells stay positioned boxes, which the tap overlays below fill. A long
   name still leaves room for the next column to peek in. Rows at the touch
   height. The heading and the name take the whole cell as their tap area
   (each cell is the nearest box that holds them), and so does a link cell's
   link. */
@media (max-width: 767.98px) {
    .global-grid {
        --grid-row-h: var(--control-h-touch);
    }

    /* A wrap that wears the shared edge fade (components/edge-fade.css) is a
       row, so the fade sits beside the grid at the right edge. The fade goes
       over the sticky heading, and the grid keeps its own width. The wrap
       takes its card's round corners, so the fade does not cover them. */
    .global-grid-wrap.global-edge-fade {
        --edge-fade-z: var(--z-sticky);

        display: flex;
        align-items: flex-start;
        border-radius: inherit;
    }

    .global-grid-wrap.global-edge-fade > .global-grid {
        flex: 0 0 auto;
        min-width: 100%;
    }

    .global-grid__head--pinned,
    .global-grid__cell--pinned {
        --grid-col-max: 45vw;

        position: relative;
        left: auto;
    }

    .global-grid__head--edge,
    .global-grid__cell--edge {
        border-right: 0;
    }

    .global-grid__cell:not(.global-grid__cell--pinned):has(> .global-grid__link) {
        position: relative;
    }

    .global-grid__sort::after,
    .global-grid__cell > .global-grid__link::after,
    .global-grid__cell--pinned a.global-person-chip__name::after {
        content: "";
        position: absolute;
        inset: 0;
    }
}

/* What is STORED in an editable cell, which is what a control starts from
   (property_columns.raw_values). Never drawn, and never rendered at all on a
   cell this reader may not change. */
.global-grid__raw {
    display: none;
}

/* ── The editor ────────────────────────────────────────────────────────────
   One editor for the whole grid, laid over whichever cell was clicked and sized
   to that column by shared/js/grid-editor.js, so a change happens in the cell. */
.global-grid-editor {
    position: absolute;
    z-index: var(--z-dropdown);
    padding: var(--spacing-xs);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-card-bg);
    box-shadow: var(--shadow-menu);
}

/* The Ramp vendor cell's editor holds the profile's three-step pick one step at
   a time, so it needs more room than a value box and no more than a phone has.
   grid-cell-panel.js repeats the width (PANEL_WIDTH) for its fit math and
   narrows it on a grid that is narrower still. */
.global-grid-editor--ramp {
    width: 22rem;
    max-width: 100%;
    padding: var(--spacing-sm);
}

/* One area at a time: the arrows in the head replace the profile's numbered
   markers and the line between them. */
.global-grid-editor--ramp .payments-setup-step__marker,
.global-grid-editor--ramp .payments-setup-step__line {
    display: none;
}

.global-grid-editor--ramp .payments-setup-step {
    padding-bottom: 0;
}

.global-grid-editor--ramp .payments-setup-step__control {
    max-width: none;
}

.global-grid-editor--ramp .payments-setup-actions {
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-sm);
}

/* Whose rail the panel works: the Ramp mark at the head's right. */
.global-grid-editor__mark {
    flex: none;
    height: 12px;
    width: auto;
    opacity: .8;
}

/* One person to pay: a check and their name, centred, and nothing else. */
.global-grid-editor__payee {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-md) 0;
    font-weight: var(--font-weight-medium);
    text-align: center;
}

.global-grid-editor__payee .bi {
    font-size: var(--font-size-display);
    line-height: 1;
    color: var(--color-success);
}

.global-grid-editor__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
    font-weight: var(--font-weight-medium);
}

.global-grid-editor__nav {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2xs);
}

.global-grid-editor__count {
    min-width: 3rem;
    text-align: center;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
}

.global-grid-editor__arrow {
    padding: var(--spacing-2xs) var(--spacing-xs);
    line-height: 1;
}

.global-grid-editor__input {
    width: 100%;
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-md);
    color: var(--color-text);
    background: var(--color-card-bg);
}

.global-grid-editor__input:focus {
    outline: none;
    box-shadow: var(--shadow-focus-ring);
}

.global-grid-editor__list {
    max-height: 14rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: 0;
    padding: 0;
    list-style: none;
}

.global-grid-editor__option,
.global-grid-picker__option {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text);
    font-size: var(--font-size-md);
    text-align: left;
    cursor: pointer;
}

.global-grid-editor__option:hover,
.global-grid-editor__option.is-active {
    background: var(--color-surface-subtle);
}

.global-grid-editor__actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-xs);
    padding-top: var(--spacing-xs);
}

/* Neutral ink, not the org's fill: controls on this platform are greyscale
   (Nick, 2026-09-01). */
.global-grid-editor__btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
}

.global-grid-editor__btn:hover {
    color: var(--color-text);
    background: var(--color-surface-subtle);
}

.global-grid-editor__btn--primary,
.global-grid-editor__btn--primary:hover {
    background: var(--color-neutral-ink);
    color: var(--color-neutral-ink-fg);
}

.global-grid-editor__btn:disabled {
    cursor: default;
    opacity: 0.5;
}

/* ── The column picker ───────────────────────────────────────────────────── */
.global-grid-picker {
    position: absolute;
    width: 16rem;
}

.global-grid-picker__list {
    max-height: 16rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: 0;
    padding: 0;
    list-style: none;
}

.global-grid-picker__group {
    margin-top: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-xs);
    border-top: 1px solid var(--color-border-subtle);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    letter-spacing: var(--letter-spacing-accent);
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.global-grid__cell .global-grid__switch {
    width: calc(var(--spacing-xl) + var(--spacing-2xl));
    min-height: var(--spacing-xl);
}

.global-grid__cell--center,
.global-grid__head--center {
    text-align: center;
}

.global-grid__cell--center .global-grid__switch {
    display: flex;
    margin-inline: auto;
}

.global-grid__head--center .global-grid__headbtn {
    position: absolute;
    top: 50%;
    inset-inline-end: var(--spacing-xs);
    margin: 0;
    transform: translateY(-50%);
}

/* The heading menu. Same surface as the picker, narrower, and its rows are the
   picker's own option rows. */
.global-grid-menu {
    position: absolute;
    width: 14rem;
}

/* A group header row: a parent's labeled fields over the rows under it (sticky while scrolling sideways). */
.global-grid__group-cell {
    padding: var(--spacing-sm) 0 var(--spacing-xs);
    background: var(--color-surface-subtle);
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    font-weight: var(--font-weight-body);
}

.global-grid__group-inner {
    position: sticky;
    left: 0;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--spacing-xs) var(--spacing-lg);
    padding: 0 var(--spacing-md);
}

.global-grid__group-pair {
    display: inline-flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
}

.global-grid__group-label {
    color: var(--color-text-muted);
}

.global-grid__group-value {
    color: var(--color-text);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
}

.global-grid__group-count {
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
}

/* ==========================================================================
   Touch target — a control smaller than a fingertip keeps its look on a
   phone, and an unseen square centred on it takes the tap.

   The square is the host's ::before, so the host must leave that pseudo-element
   free and must not clip its overflow. --strip keeps the host's own width and
   only grows the height: a text link whose words already set its width.
   Linked before the feature sheets, so a feature that positions its host
   some other way still wins; any position but static holds the square.
   ========================================================================== */

@media (max-width: 767.98px) {
    .global-touch-target {
        position: relative;
    }

    .global-touch-target::before {
        content: "";
        position: absolute;
        inset: calc((100% - var(--control-h-touch)) / 2);
    }

    .global-touch-target--strip::before {
        inset-inline: 0;
    }
}

/* The stacked table (Nick's pick, 11-09): a settings table is one block per
   row on a phone, so no row runs past the screen and the page stays the
   phone's width. A desk keeps the table as it is.

   The markup says what each cell is. A cell with a data-label is two columns:
   the label on the left, the value on the right. Each part of a value (two
   lines, a link) takes its own line in the value column. A cell with no
   data-label is a whole line, such as the row's name. The actions cell
   (__actions) lays its buttons in a row. Selectors go down from the table so
   they outrank Bootstrap's .table cell rule without !important. */
@media (max-width: 767.98px) {
    .global-stack-table,
    .global-stack-table > tbody {
        display: block;
    }

    .global-stack-table > thead {
        display: none;
    }

    .global-stack-table > tbody > tr {
        display: block;
        padding: var(--spacing-smd) var(--spacing-md);
        border-bottom: 1px solid var(--color-border);
    }

    .global-stack-table > tbody > tr:last-child {
        border-bottom: 0;
    }

    .global-stack-table > tbody > tr > td,
    .global-stack-table > tbody > tr > th {
        display: block;
        padding: var(--spacing-2xs) 0;
        border: 0;
        box-shadow: none;
        overflow-wrap: anywhere;
    }

    .global-stack-table > tbody > tr > td[data-label] {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        column-gap: var(--spacing-md);
        align-items: baseline;
        text-align: right;
    }

    .global-stack-table > tbody > tr > td[data-label]::before {
        content: attr(data-label);
        color: var(--color-text-secondary);
        text-align: left;
    }

    .global-stack-table > tbody > tr > td[data-label] > * {
        grid-column: 2;
        justify-self: end;
        max-width: 100%;
    }

    .global-stack-table > tbody > tr > td.global-stack-table__actions {
        display: flex;
        flex-wrap: wrap;
        gap: var(--spacing-xs);
        padding-top: var(--spacing-sm);
    }
}

/* ==========================================================================
   Edge fade (Nick's pick, 11-09). A strip or a grid that scrolls sideways on
   a phone fades at its right edge, so a cut-off item reads as "more to the
   right".

   The host's ::after is its last item. It stays at the right edge (sticky)
   and paints a gradient. A gradient and never mask-image: a mask on the
   scroller clips a fixed popover that opens from inside it. The host must be
   a flex row that scrolls sideways, and must leave ::after free.

   The two shared tab strips wear it by their own names. Any other host wears
   .global-edge-fade. Knobs on the host: --edge-fade-bg is the colour under
   the host (the card by default). --edge-fade-z lifts the fade over sticky
   cells.
   ========================================================================== */

@media (max-width: 767.98px) {
    .global-edge-fade::after,
    .global-record-header .global-tabs::after,
    .global-tab-card > .global-tabs::after {
        content: "";
        position: sticky;
        top: 0;
        right: 0;
        z-index: var(--edge-fade-z, auto);
        flex: 0 0 var(--spacing-2xl);
        align-self: stretch;
        background: linear-gradient(to right, transparent, var(--edge-fade-bg, var(--color-card-bg)));
        pointer-events: none;
    }
}


:root {
    --calendar-cell-min-height: 100px;
    --calendar-avail-bg: color-mix(in srgb, var(--color-success) 8%, transparent);
    --calendar-today-ring: var(--color-action);
    /* Faint wash behind today's cell so the eye lands on it without hunting;
       pairs with the filled today-ring on the day number. Kept low (6%) so it
       reads as emphasis, not a selection. */
    --calendar-today-bg: color-mix(in srgb, var(--color-action) 6%, transparent);
}

/* Calendar page transitions (content only, nav stays fixed) */
@keyframes calendar-enter-up {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes calendar-enter-left {
    from { opacity: 0; transform: translateX(12px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes calendar-enter-right {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}

.calendar-container {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.calendar-content {
    animation: calendar-enter-up 0.12s ease-out;
}

/* Directional enter (set by JS from sessionStorage) */
.calendar-enter-from-left  { animation: calendar-enter-left  0.12s ease-out; }
.calendar-enter-from-right { animation: calendar-enter-right 0.12s ease-out; }

.calendar-leaving-up {
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.08s ease-in, transform 0.08s ease-in;
}
.calendar-leaving-left {
    opacity: 0;
    transform: translateX(-12px);
    transition: opacity 0.08s ease-in, transform 0.08s ease-in;
}
.calendar-leaving-right {
    opacity: 0;
    transform: translateX(12px);
    transition: opacity 0.08s ease-in, transform 0.08s ease-in;
}

/* Navigation — the view/filter tabs (Events/Tasks split-buttons + Month/Week
   toggles) are x-teleport'd out of the page body into the app header's far-left
   slot (#calendar-header-tabs), sharing the dark bar with the date nav on the
   right. The controls keep the standard .global-header-btn treatment the header already
   supplies (28px height + white-on-dark palette), so the old in-body .calendar-nav
   bar, its uniform-height override, and the date-nav controls are all gone — only
   the bespoke filter chevron (not a .global-header-btn) needs header overrides, below. */
.calendar-header-tabs {
    --calendar-ctrl-h: 28px;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.calendar-nav-views {
    display: flex;
    gap: var(--spacing-xs);
}

.calendar-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day-headers {
    border-bottom: 1px solid var(--color-border);
}

.calendar-day-header {
    padding: var(--spacing-sm);
    text-align: center;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    color: var(--color-text-light);
    letter-spacing: 0.05em;
}

.calendar-day-cell {
    display: flex;
    flex-direction: column;
    height: var(--calendar-cell-min-height);
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    padding: var(--spacing-xs);
    position: relative;
    overflow: hidden;
}

.calendar-day-cell:last-child {
    border-right: none;
}

/* Today: faint wash so the current day stands out at a glance. Today is always
   a current-month cell, so this never collides with .calendar-other-month. */
.calendar-today {
    background: var(--calendar-today-bg);
}

.calendar-other-month {
    background: var(--color-page-bg);
}

.calendar-other-month .calendar-day-number {
    color: var(--color-border);
}

.calendar-day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    border-radius: 50%;
    margin-bottom: var(--spacing-2xs);
}

.calendar-today-ring {
    background: var(--calendar-today-ring);
    color: var(--color-neutral-ink-fg);
    font-weight: var(--font-weight-medium);
}

.calendar-day-events {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.calendar-event-chip {
    display: flex;
    align-items: center;
    gap: var(--spacing-2xs);
    padding: 0 var(--spacing-2xs);
    font-size: var(--font-size-2xs);
    line-height: 1.6;
    border-radius: var(--radius-sm);
    color: var(--color-text);
    text-decoration: none;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.calendar-event-chip:hover {
    background: var(--ink-alpha-05);
    text-decoration: none;
    color: inherit;
}

.calendar-chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--color-action);
}

.calendar-chip-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hover-scroll containers (month day cells + week assignments) */
.calendar-day-scroll-container,
.calendar-week-scroll-container {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.calendar-day-scroll-container .calendar-day-events {
    overflow: hidden auto;
    scrollbar-width: none;
    flex: 1;
}

.calendar-day-scroll-container .calendar-day-events::-webkit-scrollbar {
    display: none;
}

.calendar-week-scroll-container .calendar-week-assignments {
    max-height: 280px;
    overflow: hidden auto;
    scrollbar-width: none;
}

.calendar-week-scroll-container .calendar-week-assignments::-webkit-scrollbar {
    display: none;
}

.calendar-scroll-arrow {
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    z-index: var(--z-raised);
    font-size: var(--font-size-2xs);
    color: var(--color-text-light);
    cursor: pointer;
    user-select: none;
}

.calendar-scroll-arrow:hover {
    opacity: 1;
}

.calendar-scroll-arrow-up {
    top: 0;
}

.calendar-scroll-arrow-down {
    bottom: 0;
}

.calendar-day-scroll-container .calendar-scroll-arrow {
    height: 14px;
}

.calendar-day-scroll-container .calendar-scroll-arrow-up {
    background: linear-gradient(to bottom, var(--color-card-bg) 60%, transparent);
}

.calendar-day-scroll-container .calendar-scroll-arrow-down {
    background: linear-gradient(to top, var(--color-card-bg) 60%, transparent);
}

/* Other-month cells use page-bg instead */
.calendar-other-month .calendar-scroll-arrow-up {
    background: linear-gradient(to bottom, var(--color-page-bg) 60%, transparent);
}

.calendar-other-month .calendar-scroll-arrow-down {
    background: linear-gradient(to top, var(--color-page-bg) 60%, transparent);
}

.calendar-week-scroll-container .calendar-scroll-arrow {
    height: 16px;
}

.calendar-week-scroll-container .calendar-scroll-arrow-up {
    background: linear-gradient(to bottom, var(--color-card-bg) 60%, transparent);
}

.calendar-week-scroll-container .calendar-scroll-arrow-down {
    background: linear-gradient(to top, var(--color-card-bg) 60%, transparent);
}

/* Timeslot event booking styling (Sprint 7.21) — a faint ink wash with ink
   text, so a booking reads as "ours" at a glance. The tint is light enough
   that the label keeps ample contrast. */
.calendar-event-booking {
    background: color-mix(in srgb, var(--color-action) 12%, white);
    color: var(--color-action);
}
.calendar-event-booking:hover {
    background: color-mix(in srgb, var(--color-action) 20%, white);
    color: var(--color-action);
}

/* Due-date chip fill — a faint wash of the due-date gold (was a solid inline
   fill in the grid template), matching the booking chip's tint language. Text
   stays the default ink for contrast on the light wash; the overdue red stripe
   and unfilled amber stripe below still overlay unchanged. */
.calendar-due {
    background: color-mix(in srgb, var(--due-date-color) 12%, white);
}

.calendar-week-view {
    display: flex;
    flex-direction: column;
}

.calendar-week-day {
    border-bottom: 1px solid var(--color-border);
    padding: var(--spacing-smd) var(--spacing-md);
}

.calendar-week-day:last-child {
    border-bottom: none;
}

.calendar-week-day-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.calendar-week-day-name {
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-lg);
}

.calendar-week-day-date {
    color: var(--color-text-light);
    font-size: var(--font-size-md);
}

.calendar-avail-summary {
    font-size: var(--font-size-sm);
    color: var(--color-success);
    margin-bottom: var(--spacing-xsm);
}

.calendar-exception-notice {
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-xsm);
    display: flex;
    align-items: center;
    gap: var(--spacing-xsm);
}

.calendar-exception-unavailable {
    color: var(--color-error);
}

.calendar-exception-available {
    color: var(--color-success);
}

.calendar-week-assignments {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xsm);
}

.calendar-week-assignment {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-smd);
    border-left: 3px solid var(--color-action);
    border-radius: var(--radius-sm);
    background: var(--ink-alpha-05);
    text-decoration: none;
    color: inherit;
    gap: var(--spacing-md);
}

.calendar-week-assignment:hover {
    background: var(--ink-alpha-05);
    text-decoration: none;
    color: inherit;
}

.calendar-week-assignment-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.calendar-week-assignment-title {
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-md);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-week-assignment-role {
    font-size: var(--font-size-sm);
}

.calendar-week-assignment-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    font-size: var(--font-size-sm);
}

.calendar-week-assignment-time {
    white-space: nowrap;
}

.calendar-week-assignment-org {
    font-size: var(--font-size-xs);
}

.calendar-week-assignment.calendar-event-unfilled,
.opportunities-calendar-row.calendar-event-unfilled {
    opacity: var(--calendar-unfilled-opacity);
}

.calendar-week-assignment-worker {
    font-size: var(--font-size-xs);
}

.calendar-week-assignment-unfilled {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
}

/* Today in week view — same faint wash as the month cell for consistency. */
.calendar-week-today {
    background: var(--calendar-today-bg);
}

@media (max-width: 767.98px) {
    .calendar-day-cell {
        height: 44px;
        padding: var(--spacing-2xs);
    }

    .calendar-day-number {
        width: 1.375rem;
        height: 1.375rem;
        font-size: var(--font-size-2xs);
    }

    .calendar-chip-text {
        display: none;
    }

    .calendar-chip-dot {
        display: none;
    }

    .calendar-event-chip {
        width: 8px;
        height: 8px;
        padding: 0;
        border-radius: 50%;
        display: inline-block;
        background: var(--color-action);
        /* The status stripe is meaningless on a collapsed dot — drop it so it
           doesn't render as a sliver arc. */
        box-shadow: none;
        font-weight: inherit;
    }

    .calendar-day-events {
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--spacing-2xs);
    }

    .calendar-scroll-arrow {
        display: none;
    }

    .calendar-day-scroll-container .calendar-day-events {
        overflow: visible;
    }

    .calendar-week-assignment {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }

    .calendar-week-assignment-meta {
        align-items: flex-start;
        flex-direction: row;
        gap: var(--spacing-smd);
    }

    /* Due chips collapse to a solid gold dot (not the light desktop wash, which
       would read as near-white at 8px) so a deadline still stands apart from an
       event dot on a phone. */
    .calendar-event-chip.calendar-due {
        background: var(--due-date-color);
    }

}

.calendar-due.is-done,
.opportunities-calendar-row.is-done {
    text-decoration: line-through;
    opacity: var(--calendar-done-opacity);
}

/* Status stripes — a 3px inset left stripe encodes an item's state so an
   at-risk item reads at a glance without opening it, matching kanban's
   left-stripe language. Painted as an inset box-shadow (not a border) so it
   overlays the due chip's solid fill without insetting it and never shifts the
   chip's layout box. Overdue also gets bold text as a colorblind-safe second
   cue (kanban pairs its stripe with a fire icon for the same reason). */
.calendar-due.is-overdue {
    box-shadow: inset 3px 0 0 0 var(--color-error);
    font-weight: var(--font-weight-medium);
}

/* Unfilled org role = at-risk staffing; warn without demanding as much
   attention as an overdue deliverable. */
.calendar-event-chip.calendar-event-unfilled {
    box-shadow: inset 3px 0 0 0 var(--color-warning);
}

/* ---- Detail popover (feature B) ------------------------------------------
   A single shared, fixed-positioned card opened from a month chip so a
   coordinator can read a booking/deliverable's client, time, workers and state
   without leaving the calendar. Fixed positioning + a high z-index keep it
   above the app header, saved-view tabs, and filter dropdowns while escaping
   the day-cell overflow:hidden clip. */
.calendar-popover {
    position: fixed;
    z-index: 300;
    width: 260px;
    max-width: calc(100vw - 16px);
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-smd) var(--spacing-smd) var(--spacing-smd);
    font-size: var(--font-size-sm);
    color: var(--color-text);
}

.calendar-popover__close {
    position: absolute;
    top: 0.375rem;
    right: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.375rem;
    height: 1.375rem;
    border: none;
    background: none;
    color: var(--color-text-light);
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-base);
    line-height: 1;
}

.calendar-popover__close:hover {
    background: var(--ink-alpha-05);
    color: var(--color-text);
}

.calendar-popover__head {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding-right: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
}

.calendar-popover__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.calendar-popover__title {
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-lg);
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-popover__status {
    display: inline-block;
    margin-bottom: var(--spacing-sm);
    padding: 0.075rem var(--spacing-sm);
    border-radius: var(--radius-pill);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.calendar-popover__status--error {
    background: color-mix(in srgb, var(--color-error) 14%, transparent);
    color: var(--color-error);
}
.calendar-popover__status--warning {
    background: color-mix(in srgb, var(--color-warning) 18%, transparent);
    color: var(--color-warning);
}
.calendar-popover__status--success {
    background: color-mix(in srgb, var(--color-success) 14%, transparent);
    color: var(--color-success);
}
.calendar-popover__status--neutral {
    background: var(--ink-alpha-05);
    color: var(--color-text-light);
}

.calendar-popover__meta {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin: 0 0 var(--spacing-smd);
}

.calendar-popover__row {
    display: grid;
    grid-template-columns: 3.25rem 1fr;
    gap: var(--spacing-sm);
    align-items: baseline;
}

.calendar-popover__row dt {
    font-size: var(--font-size-2xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-light);
    margin: 0;
}

.calendar-popover__row dd {
    margin: 0;
    color: var(--color-text);
    min-width: 0;
    overflow-wrap: anywhere;
}

/* The people row's <dt> is read, not seen (.visually-hidden): the names span both columns. */
.calendar-popover__row--people {
    grid-template-columns: 1fr;
}

.calendar-popover__workers {
    display: flex;
    align-items: center;
    gap: var(--spacing-xsm);
}

.calendar-popover__link {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
    color: var(--color-action);
    text-decoration: none;
}

.calendar-popover__link:hover {
    text-decoration: underline;
    color: var(--color-action);
}

@media (max-width: 767.98px) {
    /* Anchor to the bottom of the screen like the filter dropdown does, so the
       card never runs off a small viewport. */
    .calendar-popover {
        left: 0.5rem !important;
        right: 0.5rem;
        top: auto !important;
        bottom: 0.5rem;
        width: auto;
    }
}

.calendar-worker-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    margin-right: var(--spacing-xs);
}

.calendar-week-assignment-worker {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-xs);
}

.calendar-filter-wrapper {
    position: relative;
}

.calendar-filter-split {
    display: flex;
    align-items: center;
    gap: 0;
}

.calendar-filter-split .global-header-btn {
    border-radius: var(--radius-button) var(--radius-none) var(--radius-none) var(--radius-button);
}

.calendar-filter-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-left: none;
    background: transparent;
    padding: 0 var(--spacing-xsm);
    border-radius: var(--radius-none) var(--radius-button) var(--radius-button) var(--radius-none);
    cursor: pointer;
    color: var(--color-text-light);
    font-size: var(--font-size-2xs);
    height: var(--calendar-ctrl-h);
    transition: transform 0.15s, background var(--transition-fast),
                color var(--transition-fast), border-color var(--transition-fast);
}

/* Active state — share the filled treatment of the sibling button so the
   chevron reads as one continuous segment with the toggle. */
.calendar-filter-split.is-active .calendar-filter-chevron {
    background: var(--color-action);
    color: var(--color-neutral-ink-fg);
    border-color: var(--color-action);
}

.calendar-filter-split.is-active .calendar-filter-chevron:hover {
    /* slight darken on hover while active — an overlay tint over the ink fill */
    background: linear-gradient(var(--ink-alpha-10), var(--ink-alpha-10)),
                var(--color-action);
}

.calendar-filter-chevron.is-open i {
    transform: rotate(180deg);
}

.calendar-filter-chevron:hover {
    background: var(--ink-alpha-05);
}

/* A disabled chevron always means its sibling toggle is OFF, so the two fade
   together as one segment rather than two mismatched greys — 0.55 is the
   toggle's own OFF opacity (.global-header-btn-toggle in main.css), not the 0.4 a
   plain disabled control gets. */
.calendar-filter-chevron:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.calendar-filter-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 180px;
}

.calendar-filter-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xsm) var(--spacing-smd);
    border-bottom: 1px solid var(--color-border);
}

.calendar-filter-search {
    display: flex;
    align-items: center;
    gap: var(--spacing-xsm);
    flex: 1;
    min-width: 0;
    color: var(--color-text-light);
    font-size: var(--font-size-xs);
}

.calendar-filter-search i {
    flex-shrink: 0;
    font-size: var(--font-size-2xs);
}

.calendar-filter-search input {
    border: none;
    background: none;
    outline: none;
    font-size: var(--font-size-sm);
    color: var(--color-text);
    width: 100%;
    padding: 0;
}

.calendar-filter-search input::placeholder {
    color: var(--color-text-light);
}

.calendar-filter-quick {
    display: flex;
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

.calendar-filter-quick button {
    border: none;
    background: none;
    color: var(--color-action);
    font-size: var(--font-size-xs);
    cursor: pointer;
    padding: 0;
    white-space: nowrap;
}

.calendar-filter-quick button:hover {
    text-decoration: underline;
}

.calendar-filter-list {
    max-height: 240px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--spacing-xs) 0;
}

.calendar-filter-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-smd);
    font-size: var(--font-size-sm);
    cursor: pointer;
    white-space: nowrap;
}

.calendar-filter-item:hover {
    background: var(--ink-alpha-05);
}

.calendar-filter-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--color-action);
}

/* Grouped filter lists — the Events dropdown nests service types under their
   category (a toggle-all "group head" checkbox), and the Tasks dropdown nests
   its items under a plain "Role deliverables" / "Opportunity due dates" label.
   A hairline separates groups; the category head reads bold; the task label is a
   small-caps section title; and every leaf checkbox is indented under its head. */
.calendar-filter-group + .calendar-filter-group {
    border-top: 1px solid var(--color-border);
    margin-top: var(--spacing-xs);
    padding-top: var(--spacing-xs);
}

.calendar-filter-group-head {
    font-weight: var(--font-weight-medium);
}

.calendar-filter-group-label {
    padding: var(--spacing-xsm) var(--spacing-smd) var(--spacing-2xs);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-light);
}

.calendar-filter-subitem {
    padding-left: var(--spacing-lg);
}

.global-dropdown-enter { transition: opacity 0.1s ease, transform 0.1s ease; }
.global-dropdown-enter-start { opacity: 0; transform: translateY(-4px); }
.global-dropdown-enter-end { opacity: 1; transform: translateY(0); }
.global-dropdown-leave { transition: opacity 0.075s ease; }
.global-dropdown-leave-start { opacity: 1; }
.global-dropdown-leave-end { opacity: 0; }

@media (max-width: 767.98px) {
    .calendar-filter-dropdown {
        position: fixed;
        left: 0.5rem;
        right: 0.5rem;
        top: auto;
        bottom: calc(var(--bottom-bar-h) + 0.5rem);
        min-width: auto;
        max-height: 50vh;
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    /* 16px, so an iPhone does not zoom on focus. The box keeps its old 13px height. */
    .calendar-filter-search input {
        height: calc(var(--font-size-sm) * var(--line-height-body));
        font-size: var(--font-size-base);
    }

    .global-app-content:has(.opportunities-calendar-view) .global-phone-head {
        flex-wrap: wrap;
    }

    .global-app-content:has(.opportunities-calendar-view) .global-phone-head__nav {
        order: 1;
        flex: 0 0 100%;
        padding-inline: var(--spacing-sm);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-card);
        background: var(--color-card-bg);
    }

    .global-app-content:has(.opportunities-calendar-view) .calendar-filter-chevron {
        min-width: var(--control-h-touch);
        min-height: var(--control-h-touch);
    }

    .opportunities-calendar-view .calendar-month-grid {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }

    .opportunities-calendar-view .calendar-day-header {
        padding-inline: 0;
    }

    .opportunities-calendar-view .calendar-day-cell {
        align-items: center;
        min-height: var(--control-h-touch);
    }

    .opportunities-calendar-view .calendar-day-cell:not(.calendar-other-month) {
        cursor: pointer;
    }

    .opportunities-calendar-view .calendar-day-cell[aria-selected="true"] .calendar-day-number:not(.calendar-today-ring) {
        background: var(--color-action-selected);
    }

    .opportunities-calendar-view .opportunities-calendar-dot {
        width: var(--spacing-xsm);
        height: var(--spacing-xsm);
        border-radius: var(--radius-pill);
        background: var(--color-text);
    }

    .opportunities-calendar-view .opportunities-calendar-days {
        border-top: 1px solid var(--color-border);
    }

    .opportunities-calendar-days section + section {
        border-top: 1px solid var(--color-border);
    }

    .opportunities-calendar-day {
        display: flex;
        align-items: baseline;
        gap: var(--spacing-sm);
        padding: var(--spacing-smd) var(--spacing-md) var(--spacing-xs);
        margin: 0;
        font-size: var(--font-size-sm);
        font-weight: var(--font-weight-medium);
    }

    .opportunities-calendar-row {
        --opportunities-calendar-mark: var(--color-border);
        display: flex;
        align-items: center;
        gap: var(--spacing-smd);
        min-height: var(--control-h-touch);
        padding: var(--spacing-xs) var(--spacing-md);
        color: var(--color-text);
        text-decoration: none;
    }

    .opportunities-calendar-time {
        display: flex;
        flex: 0 0 calc(2 * var(--spacing-2xl));
        flex-direction: column;
        font-variant-numeric: tabular-nums;
        font-size: var(--font-size-sm);
        color: var(--color-text-secondary);
    }

    .opportunities-calendar-detail {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-width: 0;
        padding-inline-start: var(--spacing-smd);
        border-inline-start: var(--spacing-xs) solid var(--opportunities-calendar-mark);
        overflow-wrap: anywhere;
    }

    .opportunities-calendar-title {
        font-size: var(--font-size-md);
        font-weight: var(--font-weight-medium);
    }

    .opportunities-calendar-subtitle {
        font-size: var(--font-size-sm);
        color: var(--color-text-secondary);
    }
}

@media print {
    .global-sidebar, .global-app-header,
    .global-empty-state--inline { display: none !important; }
    .calendar-container { border: none; box-shadow: none; }
    .calendar-chip-text { display: inline !important; }
    .calendar-event-chip { background: none; }
    .calendar-chip-dot { background: #333 !important; }
    .calendar-today-ring { background: none; border: 2px solid #333; }
    .calendar-content { animation: none !important; }
    .global-app-content { padding: 0 !important; }
    .calendar-scroll-arrow { display: none !important; }
    .calendar-day-cell { height: auto !important; }
    .calendar-day-scroll-container .calendar-day-events,
    .calendar-week-scroll-container .calendar-week-assignments {
        overflow: visible !important;
        max-height: none !important;
    }
}


.calendar-avail-rule-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xsm);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--calendar-avail-bg);
    border: 1px solid color-mix(in srgb, var(--color-success) 20%, transparent);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    color: var(--color-text);
}

.calendar-account {
    background: transparent;
}

.calendar-account + .calendar-account {
    margin-top: var(--spacing-xs);
    padding-top: var(--spacing-xs);
    border-top: 1px solid var(--color-grey-100);
}

.calendar-account__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.calendar-account__toggle {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xsm) var(--spacing-xs);
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: inherit;
    font-family: inherit;
    flex: 1;
    min-width: 0;
    transition: background-color 140ms ease;
}

/* The row is a button that opens the account's sub-calendars (the tour asks
   for exactly that click), so it lights under the pointer like every other
   row-shaped control: the action tint, and the house ring on keyboard focus. */
.calendar-account__toggle:hover {
    background-color: var(--color-action-tint);
}

.calendar-account__toggle:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus-ring);
}

.calendar-account__icon {
    color: var(--color-brand-google);
    font-size: var(--font-size-md);
    flex-shrink: 0;
}

/* The address takes whatever the row is not using, so the state badge after it
   lands on the far right instead of against the last letter (Nick 2026-08-19:
   "the synced label should be on the far right, with ..... if the email is too
   long"). `min-width: 0` is the half that makes the ellipsis reachable at all:
   a nowrap span refuses to shrink below its own text without it, so the three
   truncation rules below never fired — AND the card's min-content width became
   the longest address on the account. That second effect is why the Working
   Hours grid beside it in the settings trio was down to 90px of column at
   992px: three `1fr` tracks cannot shrink past their content, so an
   unshrinkable calendars card took its width out of its neighbours.
   `text-align: left` is not a default here: the row is a <button>, whose UA
   stylesheet centres text, and that inherits into this stretched span — so
   without the override every account name floats mid-row between the icon
   and the badge (Nick 2026-08-31: "the calendar names" still not left
   justified) while the calendar rows below sit flush. */
.calendar-account__email {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-md);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Synced / Reconnect needed keeps its full width at the right end of the row.
   It is the one word in the header that must never be what truncates — an
   account whose state reads "Reconnect nee…" has lost the only thing the
   collapsed row was there to say. */
.calendar-account__toggle > .global-badge {
    flex-shrink: 0;
}

.calendar-account__chevron {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.calendar-account__chevron.is-open {
    transform: rotate(180deg);
}

/* Expanded panel.
   Flush with the card's content edge, not indented under the account address.
   Nick, twice: "the calendar names ... should be left" (2026-08-20), then
   "the sycne calendar list still ahs the calendar names not left justified".
   Round 16 read the first of those as a wrap defect and fixed only that, which
   is why nothing he was pointing at moved. The names WERE flush inside their
   own row — the 1.25rem here pushed the whole row in, so every name, and every
   hairline between them, started 20px right of the section title, the hint and
   the divider above them. Against status pills pinned to the right edge, a
   column that starts inboard of everything else in the card reads as floating
   rather than left-aligned. Nesting is still legible without the indent: these
   rows only exist inside their account's open panel, and accounts are already
   separated by a rule. */
.calendar-account__panel {
    padding: var(--spacing-2xs) 0 var(--spacing-xs);
}

.calendar-account__calendar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-xsm) 0;
}

.calendar-account__calendar + .calendar-account__calendar {
    border-top: 1px solid var(--color-grey-100);
}

.calendar-account__cal-left {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

/* One calendar, one line. The account address above these has ellipsized since
   round 14; the names under it never did, so a calendar named longer than the
   card wrapped onto a second line and the row grew to 42px with its status pill
   floating against the wrap (Nick 2026-08-20: "the calendar names ... should be
   left, and the status should be right"). `min-width: 0` is the half that makes
   the ellipsis reachable — a nowrap span refuses to shrink below its own text
   without it — and it is also what keeps a long name out of the card's
   min-content width, the trap .calendar-account__email documents above. */
.calendar-account__cal-name {
    flex: 0 1 auto;
    min-width: 0;
    font-size: var(--font-size-md);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-account__error {
    padding: var(--spacing-2xs) 0;
    font-size: var(--font-size-sm);
}

/* The whole card, not only the sentence inside it: read down a list of
   accounts, the broken one has to be the one that looks different before any
   of it is read. Tinted ground and an amber edge rather than a border, so the
   card keeps its box and the accounts below it do not shift when one breaks. */
.calendar-account--needs-reconnect {
    padding: var(--spacing-xs) var(--spacing-sm);
    border-left: 2px solid var(--status-warning-fg);
    border-radius: var(--radius-sm);
    background: var(--status-warning-bg);
}

/* What a broken account says and the one thing it offers, stacked. Flush with
   the card edge for the same reason the panel below it is: it sits between a
   flush header and a flush calendar list, and the 1.25rem it used to carry
   would now be the only indent left in the card. Left-aligned in a column:
   this card sits in a ~330px rail, and any arrangement that puts the button on
   the header row takes the width out of the account address. */
.calendar-account__repair {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xsm);
    margin: var(--spacing-xs) 0;
}

/* The one plain-English line a broken account gets, in place of the stored
   Google error. Not --color-warning: amber measures 2.15:1 on white, and
   --status-warning-fg is the same hue darkened for exactly this. */
.calendar-account__notice {
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--status-warning-fg);
}

/* Calendars an account can no longer sync. Dimmed rather than hidden — which
   calendars have stopped being covered is the reason the warning matters — and
   the pills inside carry their own `disabled`, so this is appearance only and
   never the thing standing between a click and a write. */
.calendar-account__panel.is-dimmed {
    opacity: 0.55;
}

/* The Planning Center link card: the line that names the link, then the
   button or link that acts on it. The pair stacks and hugs the left edge. */
.calendar-connect {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
}

/* --- Calendar-name row: spacing for warning icon when sync errors persist. --- */
.calendar-account__cal-warn {
    margin-right: var(--spacing-xsm);
    font-size: var(--font-size-sm);
    flex-shrink: 0;
}

/* --- Tri-state "what does this calendar block?" pill ---
   Replaces the prior dual switches (is_active + busy_only). Clicking the pill
   opens a menu (.calendar-block-menu, below) that names the three states and
   what each does. Three independent signals carry the state — color hue, dot
   fill, and label text — so a colorblind or low-contrast user still gets two
   redundant cues. */
.calendar-block-pill {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xsm);
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.calendar-block-pill:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

.calendar-block-pill__dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.calendar-block-pill--off {
    background: var(--color-grey-100);
    border-color: var(--color-grey-200);
    color: var(--color-grey-600);
}
.calendar-block-pill--off:hover {
    background: var(--color-grey-200);
}
.calendar-block-pill__dot--off {
    border: 1.5px solid var(--color-text-muted);
    background: transparent;
}

.calendar-block-pill--busy {
    background: var(--color-warning-bg);
    border-color: var(--color-warning-border);
    color: var(--color-warning-text);
}
.calendar-block-pill--busy:hover {
    background: var(--color-warning-border);
}
.calendar-block-pill__dot--busy {
    background: linear-gradient(90deg, var(--color-warning) 50%, transparent 50%);
    border: 1.5px solid var(--color-warning);
}

.calendar-block-pill--all {
    background: var(--color-success-bg);
    border-color: var(--color-success-border);
    color: var(--color-success-text);
}
.calendar-block-pill--all:hover {
    background: var(--color-success-border);
}
.calendar-block-pill__dot--all {
    background: var(--color-success);
    border: 1.5px solid var(--color-success);
}

/* Dead "+" at the account cap: dimmed like .global-icon-btn's aria-disabled
   state, but it keeps the pointer — its tooltip is the only place that says
   why (Nick, 2026-09-05: on hover, not a line under the hint), and the tooltip
   rides on mouseover. The click is refused in the Alpine binding instead, and
   the hover wash (page.html) skips aria-disabled so a dead control doesn't
   light up. */
.calendar-bucket-panel__settings-btn[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Status menu ---
   The pill's menu wears the shared custom-select menu skin (.global-cs-menu)
   and only changes what that skin assumes: it is teleported to <body> and
   placed with fixed coordinates by calendarBlockMenu, so the anchored
   positioning and the 50-rung z-index give way to the dropdown rung; and its
   items wrap, because each carries a one-line meaning under the label. This
   sheet loads before main.css, so the compound selector is what wins. */
.calendar-block-menu-host {
    display: inline-flex;
}

.global-cs-menu.calendar-block-menu {
    position: fixed;
    top: auto;
    left: auto;
    right: auto;
    width: max-content;
    max-width: min(20rem, calc(100vw - 2rem));
    z-index: var(--z-dropdown);
}

.calendar-block-menu .global-cs-item,
.calendar-block-menu .global-cs-item__label,
.calendar-block-menu .global-cs-item__sub {
    white-space: normal;
}

.calendar-block-menu .global-cs-item {
    width: 100%;
    text-align: left;
}

.calendar-block-menu__dot {
    margin-top: var(--spacing-xsm);
    align-self: flex-start;
}

/* Kept in the layout (not display:none) so the three rows stay the same
   width whichever one is checked. */
.calendar-block-menu__check--hidden {
    visibility: hidden;
}

/* --- Remove account ---
   The one destructive control, at the bottom of an opened account: a quiet
   text link, not a trash can beside the address. */
.calendar-account__remove {
    display: flex;
    justify-content: flex-end;
    padding: var(--spacing-xs) var(--spacing-sm) var(--spacing-xs) 0;
}

.calendar-account__remove-link {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    text-decoration: underline;
    text-underline-offset: 0.15em;
    cursor: pointer;
}

.calendar-account__remove-link:hover,
.calendar-account__remove-link:focus-visible {
    color: var(--color-error);
}

.calendar-account__remove-link:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

/* --- Connect explainer (ADR-131 modal body, header="none") ---
   Its own heading, two matched boxes (what gets shared: a tiny day with only
   Busy blocks; what stays private: a crossed-out list), the four Google
   permissions numbered in the order Google asks, the policy line, and one
   full-width I Understand. Tokens only. */
.calendar-explainer {
    padding-top: var(--spacing-lg);
}

.calendar-explainer__title {
    margin: 0 0 var(--spacing-mdlg);
    font-size: var(--font-size-h4);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    text-align: center;
    text-wrap: balance;
}

.calendar-explainer__split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-smd);
    margin-bottom: var(--spacing-mdlg);
}

@media (max-width: 575.98px) {
    .calendar-explainer__split {
        grid-template-columns: 1fr;
    }
}

.calendar-explainer__box {
    padding: var(--spacing-smd) var(--spacing-md) var(--spacing-smd);
    border-radius: var(--radius-lg);
}

.calendar-explainer__box--shared {
    background: var(--color-availability-bg);
    color: var(--color-availability);
}

.calendar-explainer__box--private {
    background: var(--color-surface-subtle);
    color: var(--color-text);
}

.calendar-explainer__box-title {
    margin: 0 0 var(--spacing-sm);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: inherit;
}

/* The tiny day: four rows, two of them Busy. Nothing on it reads as an event. */
.calendar-explainer__day {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-xs);
    font-variant-numeric: tabular-nums;
}

.calendar-explainer__time {
    text-align: right;
    padding-top: var(--spacing-2xs);
    opacity: 0.75;
}

.calendar-explainer__slot {
    min-height: 1.5rem;
    border: 1px dashed currentColor;
    border-radius: var(--radius-sm);
    opacity: 0.45;
}

.calendar-explainer__slot--busy {
    display: flex;
    align-items: center;
    padding: 0 var(--spacing-sm);
    border: none;
    background: var(--color-text-secondary);
    color: var(--color-neutral-ink-fg);
    font-weight: var(--font-weight-medium);
    opacity: 1;
}

.calendar-explainer__caption {
    margin: var(--spacing-sm) 0 0;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.calendar-explainer__private {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    font-size: var(--font-size-sm);
}

.calendar-explainer__private li {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.calendar-explainer__no {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: var(--radius-pill);
    background: var(--color-text-secondary);
    color: var(--color-neutral-ink-fg);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.calendar-explainer__lead {
    margin: 0 0 var(--spacing-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.calendar-explainer__rows {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.calendar-explainer__row {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
    padding: var(--spacing-sm) var(--spacing-md);
    border-top: 1px solid var(--color-border);
}

.calendar-explainer__row:first-child {
    border-top: none;
}

.calendar-explainer__num {
    width: 1.5rem;
    height: 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.calendar-explainer__label {
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.calendar-explainer__body,
.calendar-explainer__policy {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.calendar-explainer__policy {
    margin: var(--spacing-md) 0 0;
}

.calendar-explainer__link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

/* The one way forward: full width, big enough to be the obvious click. */
.calendar-explainer__footer {
    padding: var(--spacing-smd) var(--spacing-md) var(--spacing-mdlg);
}

.calendar-explainer__cta {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-smd) var(--spacing-md);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-md);
}

.calendar-explainer__logo {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

/* =============================================================================
   Bookings in Google (ADR-259): the one row under the accounts and its popup.
   The entry row reuses .calendar-account__toggle so it reads as one more row
   of the card; the On row's pill is .calendar-block-pill as a label only.
   ============================================================================= */
.calendar-bookings {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--color-border);
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-sm);
}

.calendar-bookings__entry {
    width: 100%;
}

.calendar-bookings__entry-icon {
    font-size: var(--font-size-h4);
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

.calendar-bookings__entry-chevron {
    margin-left: auto;
}

.calendar-bookings__row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 0;
    padding: var(--spacing-xsm) var(--spacing-xs);
}

.calendar-bookings__dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--color-brand-google-basil);
    flex-shrink: 0;
}

.calendar-bookings__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.calendar-bookings__sub {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-bookings-popup__account {
    margin: 0 0 var(--spacing-mdlg);
}


.payments-balance-cards {
    display: flex;
    gap: var(--spacing-smd);
    margin-bottom: var(--spacing-md);
}

.payments-balance-card {
    flex: 1;
    min-width: 0;
    padding: var(--spacing-md) var(--spacing-mdlg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    background: var(--color-card-bg);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    text-align: left;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.payments-balance-card__label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    opacity: 0.85;
    margin-bottom: var(--spacing-xs);
}

.payments-balance-card__amount {
    font-size: var(--font-size-h1);
    font-weight: var(--font-weight-medium);
    line-height: 1.2;
}

.payments-balance-card__detail {
    font-size: var(--font-size-xs);
    opacity: 0.75;
    margin-top: var(--spacing-2xs);
}

.payments-balance-card__indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: transparent;
    transition: background 0.2s;
}

.payments-balance-card--selected .payments-balance-card__indicator {
    background: currentColor;
}

/* Card variants — the fixed action ink + global semantic colors */
.payments-balance-card--earnings {
    background: linear-gradient(135deg, var(--color-action), var(--color-action-hover));
    color: var(--color-neutral-ink-fg);
    /* Raw fallback first for engines without color-mix(); the mix replaces it. */
    border-color: rgba(36, 41, 47, 0.4);
    border-color: color-mix(in srgb, var(--color-action) 40%, transparent);
}

.payments-balance-card--paid {
    background: linear-gradient(135deg, var(--color-success), #20c997);
    color: #fff;
    border-color: rgba(21, 115, 71, 0.3);
}

.payments-balance-card--outstanding {
    background: var(--color-card-bg);
    color: var(--color-text);
    border-color: var(--color-border);
    box-shadow: var(--shadow-sm);
}

.payments-balance-card--outstanding.payments-balance-card--selected {
    border-color: var(--color-text);
}

/* In-Transit card — money already on its way to the worker's bank. Calm blue,
   matching the deposit in-transit accent. */
.payments-balance-card--in-transit {
    background: var(--color-grey-50);
    color: #1e40af;
    border-color: #bfdbfe;
}

.payments-balance-card--in-transit.payments-balance-card--selected {
    border-color: #1e40af;
}

@media (max-width: 767.98px) {
    .payments-balance-cards {
        flex-wrap: wrap;
    }
    .payments-balance-card {
        flex: 1 1 calc(50% - 0.375rem);
        min-width: 140px;
    }
}

@media (max-width: 480px) {
    .payments-balance-card {
        flex: 1 1 100%;
    }
}

/* Copy reference button (inline in cards and details) */
.payments-card__copy-ref {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: var(--spacing-2xs);
    margin-left: var(--spacing-xs);
    font-size: var(--font-size-xs);
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    vertical-align: middle;
}

.payments-card__copy-ref:hover {
    color: var(--color-grey-700);
    background: var(--color-grey-100);
}

.payments-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-smd) var(--spacing-md);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-action);
    border-radius: var(--radius-card);
    margin-bottom: var(--spacing-sm);
    background: var(--color-card-bg);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.payments-card:hover {
    box-shadow: var(--shadow-md);
    border-left-color: var(--color-action-hover);
}

.payments-card__left {
    min-width: 0;
    flex: 1;
}

.payments-card__role {
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-lg);
    color: var(--color-text);
}

.payments-card__opp {
    font-size: var(--font-size-sm);
    color: var(--color-grey-600);
    margin-top: var(--spacing-2xs);
}

.payments-card__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--spacing-xs);
    flex-shrink: 0;
    margin-left: var(--spacing-md);
}

.payments-card__amount {
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-base);
    color: var(--color-text);
}

.payments-card__amount--paid {
    color: var(--color-success);
}

/* Deposit card — a native <details> that expands to the bills inside it */
.payments-deposit-card {
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-text-muted);
    border-radius: var(--radius-card);
    margin-bottom: var(--spacing-smd);
    background: var(--color-card-bg);
    overflow: hidden;
}

.payments-deposit-card--paid { border-left-color: var(--color-success); background: var(--color-grey-50); }
.payments-deposit-card--in_transit { border-left-color: #3b82f6; }
.payments-deposit-card--pending { border-left-color: var(--color-warning); }
.payments-deposit-card--failed { border-left-color: var(--color-error); }
.payments-deposit-card--canceled { border-left-color: var(--color-text-muted); }

.payments-deposit-card--paid .payments-deposit-card__amount { color: var(--color-grey-600); }

.payments-deposit-card__summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-smd);
    padding: var(--spacing-smd) var(--spacing-md);
    cursor: pointer;
    list-style: none;
}

.payments-deposit-card__summary::-webkit-details-marker { display: none; }

.payments-deposit-card__summary-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 0;
}

.payments-deposit-card__chevron {
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.payments-deposit-card[open] .payments-deposit-card__chevron { transform: rotate(90deg); }

.payments-deposit-card__heading {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    min-width: 0;
}

.payments-deposit-card__title {
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-lg);
    color: var(--color-text);
}

.payments-deposit-card__meta {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    font-weight: var(--font-weight-medium);
}

.payments-deposit-card__summary-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

.payments-deposit-card__amount {
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-lg);
    color: var(--color-text);
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}

.payments-deposit-card__bill-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-smd);
    padding: var(--spacing-sm) var(--spacing-md);
}

.payments-deposit-card__bill-row + .payments-deposit-card__bill-row {
    border-top: 1px solid var(--color-grey-50);
}

.payments-deposit-card__bill-info {
    display: flex;
    flex-direction: column;
    gap: 0.0625rem;
    min-width: 0;
}

.payments-deposit-card__bill-role {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-grey-700);
}

.payments-deposit-card__bill-opp {
    font-weight: 400;
    color: var(--color-text-muted);
}

.payments-deposit-card__bill-sub {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

@media (max-width: 767.98px) {
    .payments-deposit-card__summary {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }
    .payments-deposit-card__summary-right {
        width: 100%;
        justify-content: space-between;
    }
    .payments-deposit-card__bill-opp {
        white-space: normal;
    }
}

.payments-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    background: var(--color-scrim);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

.payments-modal {
    background: var(--color-card-bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-modal);
    max-width: 520px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--spacing-lg);
    position: relative;
}

.payments-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    border: none;
    background: none;
    color: var(--color-grey-600);
    cursor: pointer;
    font-size: var(--font-size-base);
    padding: var(--spacing-xs);
    line-height: 1;
}

.payments-modal__close:hover {
    color: var(--color-text);
}

.payments-bill-detail__header {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-smd);
    border-bottom: 1px solid var(--color-grey-100);
}

.payments-bill-detail__title {
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--spacing-xs);
}

.payments-bill-detail__opp {
    font-size: var(--font-size-md);
    color: var(--color-grey-600);
    margin-bottom: var(--spacing-sm);
}

.payments-bill-detail__section-title {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-sm);
}

.payments-bill-detail__items {
    margin-bottom: var(--spacing-md);
}

.payments-bill-detail__item {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-xsm) 0;
    font-size: var(--font-size-md);
    color: var(--color-grey-700);
}

.payments-bill-detail__item--total {
    border-top: 1px solid var(--color-border-hairline);
    margin-top: var(--spacing-xs);
    padding-top: var(--spacing-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.payments-bill-detail__item-amount {
    font-weight: var(--font-weight-medium);
    font-variant-numeric: tabular-nums;
}

.payments-bill-detail__timeline {
    margin-bottom: var(--spacing-md);
}

.payments-bill-detail__event {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-smd);
    padding: var(--spacing-xsm) 0;
    position: relative;
}

.payments-bill-detail__event-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-border);
    margin-top: var(--spacing-xs);
    flex-shrink: 0;
}

.payments-bill-detail__event:first-child .payments-bill-detail__event-dot {
    background: var(--color-action);
}

.payments-bill-detail__event-content {
    display: flex;
    justify-content: space-between;
    flex: 1;
    gap: var(--spacing-sm);
}

.payments-bill-detail__event-main {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    flex: 1;
    min-width: 0;
}

.payments-bill-detail__event-label {
    font-size: var(--font-size-md);
    color: var(--color-grey-700);
}

.payments-bill-detail__event-detail {
    font-size: var(--font-size-xs);
    color: var(--color-grey-600);
    line-height: 1.3;
}

.payments-bill-detail__event-date {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.payments-bill-detail__meta {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--color-grey-100);
}

/* Bill timeline (inline step list in the bill drawer and detail page) */
.payments-bill-timeline {
    position: relative;
    list-style: none;
    margin: 0;
    padding-left: var(--spacing-lg);
}

.payments-bill-timeline__step {
    position: relative;
    padding-bottom: var(--spacing-mdlg);
    padding-left: var(--spacing-md);
}

.payments-bill-timeline__step:last-child {
    padding-bottom: 0;
}

.payments-bill-timeline__step::before {
    content: "";
    position: absolute;
    left: -24px;
    top: 8px;
    bottom: -12px;
    width: 2px;
    background: var(--color-grey-200);
}

.payments-bill-timeline__step:last-child::before {
    display: none;
}

/* The step marker itself is the shared .global-status-dot atom
   (components/status-dot.css); the timeline only positions it on the rail. */
.payments-bill-timeline .global-status-dot {
    position: absolute;
    left: -30px;
    top: 4px;
}

.payments-bill-timeline__label {
    display: block;
    font-weight: var(--font-weight-medium);
}

.payments-bill-timeline__time {
    display: block;
    font-size: var(--font-size-sm);
}

/* ===========================================
   Pipeline indicator (payment progress; the stage count varies by rail)
   =========================================== */
.payments-pipeline-indicator {
    display: flex;
    align-items: flex-start;
    padding: var(--spacing-sm) var(--spacing-md) var(--spacing-sm);
}

/* The rail may shrink: stages give up width, a label folds under its dot and
   a connector closes to a hair, so a squeezed track (a phone row, a row beside
   a pushed drawer) keeps the rail inside its own cell instead of running the
   labels over the money column. With room to spare nothing shrinks, so the
   wide desktop row is unchanged. */
.payments-pipeline-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    flex: 0 1 auto;
    min-width: 0;
}

/* The stage marker is the shared .global-status-dot atom
   (components/status-dot.css); the state class is chosen in the template. The
   pipeline only adds its two decorations on top: the pulse on the live stage
   and the × glyph on a failed one. The drawer rail (.payments-bill-detail__st) carries
   the same atom and shares both decorations, so its dots read exactly like the
   main card's. */
.payments-pipeline-stage .global-status-dot,
.payments-bill-detail__st .global-status-dot {
    position: relative;
}

.payments-pipeline-stage--active .global-status-dot,
.payments-bill-detail__st--active .global-status-dot {
    animation: pipeline-pulse 1.5s ease-in-out infinite;
}

.payments-pipeline-stage--failed .global-status-dot::after,
.payments-bill-detail__st--failed .global-status-dot::after {
    content: "\00d7";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--color-neutral-ink-fg);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    line-height: 1;
}

.payments-pipeline-label {
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
    text-align: center;
}

.payments-pipeline-stage--completed .payments-pipeline-label {
    color: var(--ms-done);
    font-weight: var(--font-weight-medium);
}

.payments-pipeline-stage--active .payments-pipeline-label {
    color: var(--ms-active);
    font-weight: var(--font-weight-medium);
}

.payments-pipeline-stage--failed .payments-pipeline-label {
    color: var(--color-error);
    font-weight: var(--font-weight-medium);
}

.payments-pipeline-connector {
    flex: 1;
    height: 2px;
    background: var(--color-grey-200);
    margin-top: var(--spacing-xsm);
    min-width: var(--spacing-md);
}

.payments-pipeline-connector--completed {
    background: var(--ms-done);
}

.payments-pipeline-connector--active {
    background: linear-gradient(90deg, var(--ms-done), var(--ms-active));
}

/* The halo reads --ms-active, never a fixed blue — the throb has to match
   the dot it wraps. */
@keyframes pipeline-pulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ms-active) 40%, transparent); }
    50% { box-shadow: 0 0 0 4px transparent; }
}

@media (prefers-reduced-motion: reduce) {
    .payments-pipeline-stage--active .global-status-dot,
    .payments-bill-detail__st--active .global-status-dot {
        animation: none;
    }
}

.payments-pipeline-indicator--compact {
    padding: var(--spacing-xs) var(--spacing-sm);
}

.payments-pipeline-indicator--compact .payments-pipeline-label {
    display: none;
}

/* The compact dot size comes from .global-status-dot--sm, applied in the
   template — the surface decides the size, not a descendant override. */
.payments-pipeline-indicator--compact .payments-pipeline-connector {
    margin-top: var(--spacing-xs);
    min-width: 8px;
}

.payments-pipeline-indicator--compact .global-status-dot::after {
    display: none;
}

.payments-card-group {
    margin-bottom: var(--spacing-sm);
}

.payments-card-group .payments-card {
    margin-bottom: 0;
    border-bottom-left-radius: var(--radius-none);
    border-bottom-right-radius: var(--radius-none);
    border-bottom-color: var(--color-grey-100);
}

.payments-card-group > .payments-pipeline-indicator {
    border: 1px solid var(--color-border);
    border-top: none;
    border-left: 3px solid var(--color-action);
    border-bottom-left-radius: var(--radius-card);
    border-bottom-right-radius: var(--radius-card);
    background: var(--color-grey-50);
}

@media (max-width: 480px) {
    .payments-pipeline-label {
        font-size: var(--font-size-2xs);
    }

    .payments-pipeline-indicator {
        padding: var(--spacing-xsm) var(--spacing-smd) var(--spacing-sm);
    }
}

td .payments-pipeline-indicator {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.payments-deposit-card__bills {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-smd);
    background: var(--color-grey-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-grey-100);
}

.payments-deposit-card__bill-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xs) 0;
    font-size: var(--font-size-sm);
}

.payments-deposit-card__bill-row + .payments-deposit-card__bill-row {
    border-top: 1px solid var(--color-border-hairline);
}

.payments-deposit-card__bill-ref {
    color: var(--color-grey-700);
}

.payments-deposit-card__bill-amount {
    font-weight: var(--font-weight-medium);
    font-variant-numeric: tabular-nums;
    color: var(--color-text);
}

.payments-filter-input  { max-width: 200px; }
.payments-filter-select { max-width: 200px; }
.payments-filter-narrow { max-width: 150px; }
.payments-placeholder-sm { height: 80px; }
.payments-placeholder-lg { height: 200px; }

/* Stat cards: inherits from main.css .global-stat-card, .global-stat-card-value, .global-stat-card-label */

/* ====================================   Bank Setup Screen
   The whole My Pay page until a bank is connected, and every state of the
   worker-setup landing page: the shared setup card (_setup_card.html). It
   used to sit bare on the page; Nick asked for a real container (2026-09-23),
   so the card is the house hero surface (.global-card --elevated) with the
   recipe below.
   =========================================== */
.payments-bank-setup {
    padding: 3.5rem var(--spacing-lg);
    text-align: center;
}

/* The card itself: one centered column. .global-card brings the surface
   (fill, radius, --elevated's floating shadow); this brings the layout. */
.payments-setup-card {
    align-items: center;
    max-width: 28rem;
    margin: 0 auto var(--spacing-lg);
    padding: var(--spacing-2xl) var(--spacing-xl);
}

/* The glyph in a soft tinted disc — same dimensions as the empty-state badge
   (main.css), restated here because a setup card is not an empty state: it
   also comes in the success and warning tempers the connect states need. */
.payments-setup-card__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: var(--radius-pill);
    background: var(--color-action-selected);
    color: var(--color-action);
    font-size: var(--font-size-h1);
    line-height: 1;
    margin-bottom: var(--spacing-md);
}

.payments-setup-card__badge--success {
    background: var(--status-success-bg);
    color: var(--color-success);
}

.payments-setup-card__badge--warning {
    background: var(--status-warning-bg);
    color: var(--color-warning-text);
}

.payments-setup-card__title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    margin-bottom: var(--spacing-sm);
}

/* The measure keeps the sentence from running wall to wall inside the card. */
.payments-setup-card__lead,
.payments-setup-card__detail {
    max-width: 36ch;
    margin: 0 auto;
    color: var(--color-text-muted);
    line-height: 1.6;
}

.payments-setup-card__action {
    margin-top: var(--spacing-lg);
}

/* The card's foot: "Powered by" and the Stripe wordmark, nothing else — the
   mark carries the trust (Nick, 2026-09-24). The zeroed bottom margin keeps
   the card's own padding as the only space below it. */
.payments-setup-card__trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    margin: var(--spacing-lg) 0 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    line-height: 1;
}

/* Sized off the em so it tracks the line's own type; a shade taller than the
   words, the way Stripe's own lockup sits. Ink comes from currentColor. */
.payments-setup-card__stripe-mark {
    height: 1.2em;
    width: auto;
}

@media (max-width: 575.98px) {
    .payments-bank-setup {
        padding: var(--spacing-xl) var(--spacing-md);
    }
}

/* ============================================
   Next payout banner — shown at the top only when a payout is in flight
   ============================================ */
.payments-next-payout-banner {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
    flex-wrap: wrap;
    background: var(--color-grey-50);
    border: 1px solid #bfdbfe;
    margin-bottom: var(--spacing-md);
    color: #1e40af;
}

.payments-next-payout-banner__icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(30, 64, 175, 0.1);
    display: grid;
    place-items: center;
    flex: none;
    font-size: var(--font-size-xl);
}

.payments-next-payout-banner__main {
    display: flex;
    flex-direction: column;
    gap: 0.0625rem;
    min-width: 0;
}

.payments-next-payout-banner__label {
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.payments-next-payout-banner__amount {
    font-size: 1.4rem;
    font-weight: var(--font-weight-medium);
    font-variant-numeric: tabular-nums;
}

.payments-next-payout-banner__when {
    margin-left: auto;
    text-align: right;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
}

.payments-next-payout-banner__when small {
    display: block;
    font-weight: 400;
    opacity: 0.8;
}

@media (max-width: 480px) {
    .payments-next-payout-banner__when {
        margin-left: 0;
        text-align: left;
        width: 100%;
    }
}

/* ============================================
   Admin Dashboard — Summary Cards
   ============================================ */

/* The pool strip and the bill-status cards flow as ONE grid so the numbers read
   as even rows instead of a wide bar over a narrow one. Both stay their own htmx
   container (each keeps its own refresh), so the two containers and their inner
   bars drop out of the box tree with display:contents and let every card become
   a direct item of this one grid.

   The column count follows the card count, because a leftover half-row is the
   thing this layout exists to avoid: an off-platform org has 2 pool cards + 4
   status cards, so three across gives two rows of three; a pool org has 4 + 4,
   so four across gives two rows of four. The template picks the modifier off the
   same off-platform flag the pool strip itself branches on. */
.payments-summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-smd);
    margin-bottom: var(--spacing-mdlg);
}

.payments-summary-cards--pool {
    grid-template-columns: repeat(4, 1fr);
}

/* These four are pass-throughs now, not layout. The two containers are htmx swap
   targets and the two bars are what each partial wraps its cards in; all four sit
   between .payments-summary-cards and the cards, and the grid can only place its own
   children, so they step out of the box tree. Scoped under .payments-summary-cards so a
   second page that reuses either partial gets its own layout, not this one. */
.payments-summary-cards #pool-position-container,
.payments-summary-cards #status-cards-container,
.payments-summary-cards .payments-summary-bar,
.payments-summary-cards .payments-summary-bar--pool {
    display: contents;
}

/* A banner or a note is a full-width line, not a card, so it spans every column
   however many there are. Without this the display:contents above would promote
   them into the grid as ordinary one-column items. */
.payments-pool-banner,
.payments-pool-note {
    grid-column: 1 / -1;
}

/* A view with metrics off renders no cards at all, and the grid's bottom margin
   would be left behind as a gap above the table. Keyed on "holds no card" rather
   than on a modifier class the server would have to add, because the cards arrive
   in two htmx swaps that land after the wrapper is already on the page.

   A browser without :has() throws the whole rule out and keeps the gap. That is
   accepted: an empty band above the table looks slightly loose and nothing else
   breaks. */
.payments-summary-cards:not(:has(.payments-summary-card)) {
    margin-bottom: 0;
}

/* The metric strips reload after every card action (refreshBalance /
   refreshStatusCards). Keep them fully opaque while they refetch so the numbers
   just change in place — no dim, no fade. */
#pool-position-container.htmx-request,
#status-cards-container.htmx-request {
    opacity: 1;
}

.payments-summary-card {
    /* Surface, border, 8px radius, and resting shadow now come from the shared
       .global-card the template composes onto this card. Only the summary-specific
       padding, the top accent bar (::before), and the hover lift stay here. */
    padding: var(--spacing-md) var(--spacing-mdlg);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.payments-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.payments-summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.payments-summary-card--total::before,
.payments-summary-card--pending::before,
.payments-summary-card--approved::before,
.payments-summary-card--paid::before,
.payments-summary-card--count::before,
.payments-summary-card--outstanding::before,
.payments-summary-card--pool::before { background: var(--color-border); }

.payments-summary-card__value {
    font-size: 1.5rem;
    font-weight: var(--font-weight-large-title);
    line-height: 1.2;
    letter-spacing: -0.5px;
    color: var(--color-text);
}

.payments-summary-card--total .payments-summary-card__value,
.payments-summary-card--pending .payments-summary-card__value,
.payments-summary-card--approved .payments-summary-card__value,
.payments-summary-card--paid .payments-summary-card__value,
.payments-summary-card--count .payments-summary-card__value,
.payments-summary-card--outstanding .payments-summary-card__value,
.payments-summary-card--pool .payments-summary-card__value { color: var(--color-text); }

/* Runway card renders prose ("Covers all scheduled bills") instead of a dollar
   figure — shrink it so it fits the card; Bootstrap text-* utilities override
   the --pool color via !important for the success/danger states. */
.payments-summary-card__value--text {
    font-size: var(--font-size-lg);
    padding-top: var(--spacing-xs);
}

.payments-summary-card__label {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
    margin-top: var(--spacing-xs);
}

.payments-summary-card__count {
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
    margin-top: var(--spacing-2xs);
}

/* On a phone the wrapper also carries .global-swipe-strip (main.css phone
   block): eight cards two-across pushed the bill list 700px down, so they
   become one sideways row instead. The grid rules above stay for the desktop
   and are inert under the strip. A banner or note sits ABOVE that row at the
   screen's width: as a stop inside the row it left the next card cut off at
   the screen's edge. The strip is a column-flow grid for that, so banners
   stack in the first column's top rows and the cards fill the last row. */
@media (max-width: 767.98px) {
    .payments-summary-cards.global-swipe-strip {
        display: grid;
        grid-auto-flow: column;
        /* --swipe-card-w is a share of the strip; a grid track would read
           that share as "fit the content", so the same share is spelled out
           against the screen. */
        grid-template-columns: none;
        grid-auto-columns: min(calc(0.44 * (100vw - 2 * var(--page-gutter))), 12rem);
        grid-template-rows: repeat(3, auto);
        row-gap: 0;
    }

    .payments-summary-cards .payments-pool-banner,
    .payments-summary-cards .payments-pool-note {
        grid-column: 1;
        width: calc(100vw - 2 * var(--page-gutter));
        position: sticky;
        left: 0;
    }

    /* The status cards often land before the pool cards. The row snaps to
       the first card it has and keeps that card when the pool cards arrive
       in front of it, so the page opened mid-row. The pool's loading bar is
       a stop of its own so the row starts at the beginning. */
    .payments-pool-loading {
        scroll-snap-align: start;
    }

    .payments-summary-cards .global-swipe-strip__item {
        grid-row: 3;
    }

    /* A phone row squeezes the rail; its connectors may close to a hair. */
    .payments-pipeline-connector {
        min-width: var(--spacing-xs);
    }
}

/* Warning banner above the pool cards — leads with the stop (setup not done),
   why only, no instruction. Calm amber, full width. */
.payments-pool-banner {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-warning);
    background: color-mix(in srgb, var(--color-warning) 12%, transparent);
    border-color: color-mix(in srgb, var(--color-warning) 35%, transparent);
}

/* Small note by the pool cards when owed bills carry no due date — they sit
   outside the "due soon" and runway math, so this says so plainly. */
.payments-pool-note {
    display: flex;
    align-items: center;
    gap: var(--spacing-xsm);
    margin: calc(-1 * var(--spacing-sm)) 0 var(--spacing-md);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* One wrapper per tab holds that tab's search box and its dropdowns, so Alpine
   can swap the whole set when you change tabs. The wrapper needs to be a flex row
   of its own or the dropdowns stack under the search box instead of sitting
   beside it. It takes the full toolbar row, and it wraps: an open drawer takes
   480px off the page, and the dropdowns should drop to a second line rather than
   run past the card's right edge. */
.global-page-header__toolbar > .payments-header-filter {
    display: flex;
    align-items: center;
    flex: 1 1 100%;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    min-width: 0;
}

.payments-booking-groups {
    display: grid;
    /* minmax(0, 1fr), not 1fr: a bare 1fr track is min-content wide at its
       narrowest, so one nowrap child (the pipeline rail on a phone) inflated
       the track past the screen and every card's right edge was clipped. */
    grid-template-columns: minmax(0, 1fr);
    gap: var(--spacing-smd);
}

.payments-booking-group {
    background: transparent;
    position: relative;
}

/* Card background — starts halfway through the header pill */
.payments-booking-group::before {
    content: '';
    position: absolute;
    top: 2.1rem;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    z-index: 0;
}

.payments-booking-group__header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-smd) var(--spacing-md) var(--spacing-xsm);
}

.payments-booking-group__icon {
    height: 2.05rem;
    min-width: 2.05rem;
    width: 2.05rem;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-md);
    color: var(--color-neutral-ink-fg);
    /* Literal-rgba fallback for engines without color-mix (rgba alphas >0.5
       have no standard token); the color-mix() line below overrides it and
       stays on the same action ink, so the two lines cannot drift apart. */
    background: linear-gradient(135deg, rgba(36, 41, 47, 0.85), rgba(50, 56, 62, 0.75));
    background: linear-gradient(135deg, color-mix(in srgb, var(--color-action) 85%, transparent), color-mix(in srgb, var(--color-action-hover) 75%, transparent));
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--color-action) 30%, transparent);
    flex-shrink: 0;
}

.payments-booking-group__pill {
    background: var(--color-text);
    color: var(--color-neutral-ink-fg);
    font-weight: var(--font-weight-large-title);
    border-radius: var(--radius-pill);
    padding: var(--spacing-xsm) var(--spacing-md);
    font-size: clamp(0.95rem, 1.3vw, 1.1rem);
    letter-spacing: 0.15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 40%;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}

.payments-booking-group__pill:hover {
    background: var(--color-text);
    color: var(--color-neutral-ink-fg);
    box-shadow: 0 2px 8px var(--ink-alpha-20);
}

/* The unlinked card's pill is a label, not a link — there is no booking behind
   it to open. Same shape as its neighbours, minus the affordances that promise
   a click. */
.payments-booking-group__pill--static,
.payments-booking-group__pill--static:hover {
    cursor: default;
    background: var(--color-text);
    box-shadow: none;
}

.payments-booking-group__date-badge {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-action);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: var(--spacing-xsm);
    background: var(--color-action-tint);
    padding: var(--spacing-xs) var(--spacing-smd);
    border-radius: var(--radius-pill);
}

.payments-booking-group__date-badge i {
    font-size: var(--font-size-md);
    color: var(--color-action);
}

.payments-booking-group__meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

/* The live total wears the shared green money pill (.global-value-pill, the one
   the sign-up dashboard uses) — the call site adds that class, so the green and
   the white text come from its tokens and cannot drift from it. This rule is
   box metrics only: the header sets the total beside a smaller "remaining" chip,
   so the atom's own md text would tower over its neighbour. The voided total is
   NOT that pill — it greys out below — so its box lives here too. */
.payments-booking-group__total-value {
    font-weight: var(--font-weight-large-title);
    padding: var(--spacing-2xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
}

.payments-booking-group__remaining {
    font-weight: var(--font-weight-large-title);
    font-size: var(--font-size-sm);
    padding: var(--spacing-2xs) var(--spacing-sm);
    border-radius: var(--radius-md);
}

.payments-booking-group__remaining--has {
    color: var(--color-warning-text);
    background: var(--color-warning-bg);
}

.payments-booking-group__remaining--zero {
    color: var(--color-success-text);
    background: var(--color-success-bg);
}

.payments-booking-group__remaining--void {
    color: var(--color-grey-700);
    background: var(--color-grey-200);
}

.payments-booking-group__total-value--void {
    color: var(--color-grey-600);
    background: var(--color-grey-100);
    text-decoration: line-through;
}

/* Date + time chip on the group header. Own payments-booking-group__ classes (was a
   borrowed assignments-group__ chip) so the payments dashboard owns its own styling. */
.payments-booking-group__event {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-shrink: 0;
    line-height: 1.2;
    background: var(--color-grey-100);
    border: 1px solid var(--color-grey-200);
    border-radius: var(--radius-pill);
    padding: var(--spacing-xsm) var(--spacing-smd);
    box-shadow: 0 1px 2px var(--ink-alpha-05);
}

.payments-booking-group__event-icon {
    color: var(--color-grey-600);
    font-size: var(--font-size-sm);
    margin-right: -0.1rem;
}

.payments-booking-group__event-sep {
    color: var(--color-text-muted);
    font-weight: var(--font-weight-medium);
}

.payments-booking-group__event-date {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    white-space: nowrap;
}

.payments-booking-group__event-time {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-grey-600);
    white-space: nowrap;
}

/* The whole row opens the bill drawer, so it reads and behaves like a button:
   pointer cursor, hover wash, and a chevron that fades in on hover to cue the
   click. The trailing 18px column holds that chevron without shifting content. */
.payments-bill-row {
    position: relative;
    z-index: 1;
    display: grid;
    /* worker (with onboarding ring) | labeled stage rail | status+amount+meter | actions | chevron */
    grid-template-columns: minmax(180px, 1fr) minmax(300px, 340px) 160px 160px 18px;
    align-items: center;
    gap: 0 var(--spacing-smd);
    /* Comfortable rows: a little more air so the bigger labeled rail and the
       total/remaining block breathe. */
    padding: var(--spacing-smd) var(--spacing-md);
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

/* Left accent bar — the row is a clickable card (opens the bill drawer), so the
   hover has to read as one. The bar reveals on hover in the action ink and
   stays off-screen otherwise, layered above the row's own background tint. */
.payments-bill-row::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--color-action);
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.payments-bill-row:hover {
    /* An ink tint several times stronger than the old near-invisible wash,
       plus a hairline inset ring so the whole row lifts as one card. */
    background: color-mix(in srgb, var(--color-action) 6%, transparent);
    box-shadow: var(--shadow-inset-ring);
}

.payments-bill-row:hover::before {
    opacity: 1;
}

/* Selected: the row whose drawer is open (is-open set by the drawer itself)
   holds the hover look — slightly stronger — so the open bill stays findable
   in the list while the panel is out. */
.payments-bill-row.is-open {
    background: color-mix(in srgb, var(--color-action) 9%, transparent);
    box-shadow: var(--shadow-inset-ring-strong);
}

.payments-bill-row.is-open::before {
    opacity: 1;
}

.payments-bill-row.is-open .payments-bill-row__chevron {
    opacity: 1;
}

.payments-bill-row__avatar-icon {
    font-size: 0.55rem;
}

/* The real, keyboard-focusable opener. Whole-row click is the mouse path; this
   button is how keyboard users open the drawer. It shows on row hover (a mouse
   cue) and whenever it is focused (so a keyboard user can see where they are). */
.payments-bill-row__chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.payments-bill-row:hover .payments-bill-row__chevron,
.payments-bill-row__chevron:focus-visible {
    opacity: 1;
}

.payments-bill-row__chevron:focus-visible {
    outline: none;
    opacity: 1;
    box-shadow: var(--shadow-focus-ring-tight);
    border-radius: var(--radius-md);
}

.payments-bill-row + .payments-bill-row {
    border-top: 1px solid var(--color-grey-100);
}

/* Reimburse mode (ADR-160, Nick 08-31). On a platform-payments org every row
   renders its select cell (_booking_group.html) so entering the mode is a
   class flip, not a repaint — the class rides the bills tab panel
   (dashboard.html), and these rules are the flip's other half: hidden cell
   and the normal five columns outside the mode, a lead checkbox column inside
   it. Off-platform orgs render no cells and can never wear the mode class. */
.payments-bill-row__select {
    display: none;
}

.payments-bills-reimburse-mode .payments-bill-row__select {
    display: flex;
    align-items: center;
    justify-content: center;
}

.payments-bills-reimburse-mode .payments-bill-row {
    /* select box | worker | labeled stage rail | status+amount+meter | actions | chevron */
    grid-template-columns: 28px minmax(180px, 1fr) minmax(300px, 340px) 160px 160px 18px;
    /* The whole-row drawer click is parked in the mode (the row's hx-trigger
       guard), so the row must not promise one. */
    cursor: default;
}

.payments-bill-row__select-box {
    margin: 0;
    cursor: pointer;
}

/* Unpickable: unpaid, exhausted, or unassigned rows keep their box visible so
   the column reads as one rail, dimmed so the eye skips them. */
.payments-bill-row__select-box:disabled {
    cursor: default;
    opacity: 0.35;
}

/* The mode's selection bar — pinned above the list while picking. */
.payments-reimburse-bar {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-smd);
    border: 1px solid color-mix(in srgb, var(--color-action) 25%, transparent);
    border-radius: var(--radius-card);
    background: color-mix(in srgb, var(--color-action) 6%, transparent);
}

.payments-reimburse-bar__summary {
    font-weight: var(--font-weight-medium);
    font-variant-numeric: tabular-nums;
}

.payments-reimburse-bar__actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-left: auto;
}

.payments-bill-row__worker {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.payments-bill-row__name-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-xsm);
    min-width: 0;
}

/* Bill-row face — geometry, fill, and the img variant all moved to the
   `.global-avatar --xs / --soft / --empty` atom (components/avatar.css).
   .bill-row__avatar--img is deleted outright (`img.global-avatar` covers it).
   What survives here is the TOOLTIP HOST only: the positioning context and the
   hover-name bubble, which is a payments-bill-row behaviour, not avatar geometry. */
.payments-bill-row__avatar {
    position: relative;
    cursor: default;
    box-shadow: var(--shadow-sm);
}

/* An unassigned seat is an open outline — a lift would make the empty slot read
   as a real, present person again. */
.payments-bill-row__avatar.global-avatar--empty {
    box-shadow: none;
}

.payments-bill-row__avatar[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-text);
    color: var(--color-neutral-ink-fg);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    padding: var(--spacing-2xs) var(--spacing-xsm);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 10;
}

.payments-bill-row__avatar:hover[data-tip]::after {
    opacity: 1;
}

.payments-bill-row__name {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-large-title);
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.payments-bill-row__role {
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.payments-bill-row__referral-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-action);
    background: var(--color-action-tint);
    padding: var(--spacing-2xs) var(--spacing-xsm);
    border-radius: var(--radius-pill);
    margin-left: var(--spacing-xsm);
    vertical-align: middle;
}

/* Payout marker — a worker the org's pay rail cannot pay yet gets a red dot and
   the words "Payouts disabled" beside their name. The words never name the
   platform; the cause rides the title tooltip, which is why the whole marker is
   one hover target. Replaces the old avatar ring, which said the same thing in
   a color nobody could read without a legend. */
.payments-payout-alert {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    flex-shrink: 0;
    cursor: help;
    color: var(--color-error);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
}

.payments-payout-alert__dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: var(--radius-pill);
    background: var(--color-error);
}

/* Travel pay above the travel charge: the same marker in the warning colour. It
   warns and blocks nothing. Its words shrink first, and the title holds them all. */
.payments-payout-alert--warning {
    flex-shrink: 1;
    min-width: 0;
    color: var(--color-warning-text);
}

.payments-payout-alert--warning .payments-payout-alert__dot {
    background: var(--color-warning);
}

.payments-payout-alert--warning .payments-payout-alert__text {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The middle rung of the ladder: the same words on their own line, standing IN
   for the role line rather than adding to it, so an alerted row is exactly as
   tall as a clean one. Off at the widest and the tightest widths (see the
   responsive block at the end of this file). */
.payments-payout-alert__line {
    display: none;
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-error);
    cursor: help;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.payments-bill-row__amount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--spacing-2xs);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.payments-bill-row__amount-value {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-large-title);
    color: var(--color-text);
}

.payments-bill-row__amount-meter {
    width: 100%;
    max-width: 132px;
    height: 5px;
    border-radius: var(--radius-pill);
    background: var(--color-header-band);
    overflow: hidden;
}

.payments-bill-row__amount-meter-fill {
    display: block;
    height: 100%;
    border-radius: var(--radius-pill);
    background: var(--color-success);
}

/* Payment-status word, sitting at the top of the money column above the total —
   a tone dot + the plain status ("Deposited", "Partially paid", "Approved").
   It's a fact about the money, so it lives with the money; the word itself takes
   the status tone to read at a glance and to stay clearly distinct from the
   worker-readiness chip up by the name. Not a pill — no fill or border. */
.payments-bill-row__amount-status {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    max-width: 100%;
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.01em;
    color: var(--color-text-muted);
}

.payments-bill-row__amount-status-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.payments-bill-row__amount-status-dot {
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-radius: var(--radius-pill);
    /* Neutral default; the tone modifiers below recolor it. Same tone vocabulary
       payment_status_tone emits (success / warning / danger / progress / neutral). */
    background: var(--color-grey-400);
}

.payments-bill-row__amount-status--success {
    color: var(--color-success);
}

.payments-bill-row__amount-status--success .payments-bill-row__amount-status-dot {
    background: var(--color-success);
}

.payments-bill-row__amount-status--warning {
    color: var(--status-warning-fg);
}

.payments-bill-row__amount-status--warning .payments-bill-row__amount-status-dot {
    background: var(--color-warning);
}

.payments-bill-row__amount-status--danger {
    color: var(--color-error);
}

.payments-bill-row__amount-status--danger .payments-bill-row__amount-status-dot {
    background: var(--color-error);
}

.payments-bill-row__amount-status--progress {
    color: var(--color-info);
}

.payments-bill-row__amount-status--progress .payments-bill-row__amount-status-dot {
    background: var(--color-info);
}

.payments-bill-row__amount-status--neutral {
    color: var(--color-text-muted);
}

.payments-bill-row__amount-status--neutral .payments-bill-row__amount-status-dot {
    background: var(--color-grey-400);
}

.payments-bill-row__amount-fee {
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-grey-400);
    font-style: italic;
    text-align: center;
}

/* Stage column — the labeled pipeline rail, centered. The status word that used
   to sit beneath it now lives in the amount column, so this column is just the
   rail (plus an optional off-platform method pill on its own line below). */
.payments-bill-row__progress {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    align-items: center;
    min-width: 0;
}

/* The labeled rail carries its own generous padding on standalone surfaces; in
   the dense bill row it sits flush so the stage names align and the row stays
   one tidy cluster. */
.payments-bill-row__progress .payments-pipeline-indicator {
    width: 100%;
    padding: var(--spacing-2xs) 0 0;
}

.payments-bill-row__actions {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-xs);
    justify-content: flex-end;
}

/* One primary action per wrapper, in the bill rows and the bill sidebar. A
   blocked action explains itself on hover (data-tooltip), never in a caption. */
.payments-action-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    min-width: 0;
}

.payments-btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--control-h-sm);
    height: var(--control-h-sm);
    border: none;
    border-radius: var(--radius-button);
    cursor: pointer;
    font-size: var(--font-size-xs);
    transition: all 0.2s ease;
    text-decoration: none;
}

.payments-btn-action--approve { background: var(--color-success-bg); color: var(--color-success); }
.payments-btn-action--approve:hover { background: var(--color-success); color: #fff; transform: scale(1.1); box-shadow: 0 3px 12px rgba(16, 185, 129, 0.35); }

.payments-btn-action--pay { background: #dbeafe; color: #2563eb; }
.payments-btn-action--pay:hover { background: #3b82f6; color: #fff; transform: scale(1.1); box-shadow: 0 3px 12px rgba(59, 130, 246, 0.35); }

.payments-btn-action--void { background: var(--color-error-subtle); color: var(--color-error); }
.payments-btn-action--void:hover { background: var(--color-error); color: #fff; transform: scale(1.1); box-shadow: 0 3px 12px rgba(217, 0, 43, 0.35); }

.payments-btn-action--disabled { opacity: 0.35; cursor: default; }
.payments-btn-action--disabled:hover { transform: none; box-shadow: none; }

@keyframes statusFlash {
    0% { background-color: var(--color-success-bg); }
    100% { background-color: transparent; }
}

.payments-bill-row--flash {
    animation: statusFlash 1.5s ease-out forwards;
}

.payments-bill-row--worker {
    grid-template-columns: minmax(170px, 1fr) minmax(300px, 340px) 150px 18px;
}

.payments-bill-row--deposit {
    grid-template-columns: minmax(170px, 1fr) 150px 18px;
}

/* The one date line under the amount: green when the money landed, blue while
   the bank has named an arrival day, amber ONLY when the worker's own work is
   what the money waits on, and plain muted for an ordinary future due date. */
.payments-bill-row__when {
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
    white-space: nowrap;
}

.payments-bill-row__when--ok {
    color: var(--color-success);
    font-weight: var(--font-weight-medium);
}

.payments-bill-row__when--wait {
    color: #1e40af;
    font-weight: var(--font-weight-medium);
}

.payments-bill-row__when--due {
    color: var(--color-warning-text);
    font-weight: var(--font-weight-medium);
}

.payments-bill-row__amount-value--void {
    text-decoration: line-through;
    color: var(--color-text-muted);
    font-weight: var(--font-weight-medium);
}

/* A voided/cancelled bill's rail column: a plain word and its reason where
   the dots would be — there is no pipeline to draw for money that will not
   move. */
.payments-bill-row__terminal {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.payments-bill-row__terminal-label {
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-grey-700);
}

.payments-bill-row__terminal-desc {
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Deposit-card extras. position:relative lifts them above the card's ::before
   background layer: the pseudo-element is the card's first child at z-index 0,
   so any later positioned sibling paints over it in tree order — no raw
   z-index needed (the stacking ladder has no rung this low on purpose). */
.payments-booking-group__error {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
    color: var(--color-error);
    background: var(--color-error-subtle);
    border-bottom: 1px solid color-mix(in srgb, var(--color-error) 25%, transparent);
}

@media (max-width: 1023px) {
    .payments-bill-row {
        /* worker | stage rail | amount | actions | chevron */
        grid-template-columns: minmax(160px, 1fr) 200px 110px 140px 18px;
    }

    /* Reimburse mode re-runs this rung with its lead checkbox column: the
       two-class mode selector outranks the bare .payments-bill-row above wherever it
       appears, so without this restatement picking on a tablet would keep
       the desktop's wide tracks and overflow the row. The --worker and
       --deposit variants below are My Pay surfaces — the mode class never
       reaches them, so they need no restatement. */
    .payments-bills-reimburse-mode .payments-bill-row {
        grid-template-columns: 28px minmax(160px, 1fr) 200px 110px 140px 18px;
    }

    /* Worker (My Pay) rows: same shrink, minus the tracks they never had.
       The 768px stack below needs no variants — its area rules already
       address the columns by name. */
    .payments-bill-row--worker {
        grid-template-columns: minmax(160px, 1fr) 200px 130px 18px;
    }

    .payments-bill-row--deposit {
        grid-template-columns: minmax(160px, 1fr) 130px 18px;
    }

    /* Four labels never fit the 200px rail track: before the rail could shrink
       they ran over the money column, and once it could they overlapped each
       other. From this rung down the rail is dots only; the drawer or the row's
       status word names the stage, and the 768px stack below restates the
       labels where the rail gets the full row again. */
    .payments-bill-row .payments-pipeline-label {
        display: none;
    }

    /* Middle rung: the name and the alert words no longer share a line, so the
       words drop under the name and take the role line's place. The dot stays
       put beside the name, and the row keeps its height. */
    .payments-bill-row__worker--alerted .payments-payout-alert__text,
    .payments-bill-row__worker--alerted .payments-bill-row__role {
        display: none;
    }

    .payments-bill-row__worker--alerted .payments-payout-alert__line {
        display: block;
    }
}

@media (max-width: 767.98px) {
    .payments-booking-group__header {
        flex-wrap: wrap;
    }

    .payments-booking-group__meta {
        display: none;
    }

    .payments-booking-group__date-badge {
        font-size: var(--font-size-2xs);
    }

    /* The header wraps here, so the pill has the first line to itself: the
       desktop's 40% cap would leave it a stub beside empty space. */
    .payments-booking-group__pill {
        max-width: 100%;
    }

    .payments-bill-row {
        grid-template-columns: 1fr auto;
        gap: var(--spacing-xs) var(--spacing-sm);
    }

    /* The rail has the whole row to itself again here, so the labels the
       1024px rung hid come back. */
    .payments-bill-row .payments-pipeline-label {
        display: block;
    }

    /* Tightest rung: only the dot fits beside the name. The role line comes
       back and the whole sentence lives in the dot's tooltip. */
    .payments-bill-row__worker--alerted .payments-payout-alert__line {
        display: none;
    }

    .payments-bill-row__worker--alerted .payments-bill-row__role {
        display: block;
    }

    .payments-bill-row__worker { grid-column: 1; grid-row: 1; }
    .payments-bill-row__amount { grid-column: 2; grid-row: 1; text-align: right; }
    .payments-bill-row__progress { grid-column: 1 / -1; }
    .payments-bill-row__actions { grid-column: 1 / -1; justify-content: flex-start; }
    /* No hover on touch — the chevron cue is desktop-only. */
    .payments-bill-row__chevron { display: none; }

    /* The rail's side padding goes on this rung — the row's own padding is
       the gutter, and every pixel of the 361px card is a label's. */
    .payments-pipeline-indicator { padding-inline: 0; }

    /* Reimburse mode on the stacked rung: the checkbox takes a slim lead
       track and row 1 re-places around it. Only grid-column is restated —
       the placements above still supply each cell's row and spans. */
    .payments-bills-reimburse-mode .payments-bill-row {
        grid-template-columns: calc(var(--spacing-lg) + var(--spacing-xs)) 1fr auto;
    }
    .payments-bills-reimburse-mode .payments-bill-row__select { grid-column: 1; grid-row: 1; }
    .payments-bills-reimburse-mode .payments-bill-row__worker { grid-column: 2; }
    .payments-bills-reimburse-mode .payments-bill-row__amount { grid-column: 3; }
}

/* A push drawer takes --drawer-width off the row without changing the window, so
   the rungs above fire too late and the alert words squeeze the worker's name
   down to an initial. These re-run the same two rungs early while a drawer is
   pushing — only above 1200px, since below that the drawer covers the list
   instead of narrowing it. Both push classes are listed together: the bill
   drawer and the saved-view dock push the same distance, so one set of rules
   can't drift from the other. Higher specificity, so they win wherever they
   apply, whatever the order. */
@media (min-width: 1200px) and (max-width: 1504px) {
    .global-app-layout.is-drawer-open .payments-bill-row__worker--alerted .payments-payout-alert__text,
    .global-app-layout.is-dock-drawer-open .payments-bill-row__worker--alerted .payments-payout-alert__text,
    .global-app-layout.is-drawer-open .payments-bill-row__worker--alerted .payments-bill-row__role,
    .global-app-layout.is-dock-drawer-open .payments-bill-row__worker--alerted .payments-bill-row__role {
        display: none;
    }

    .global-app-layout.is-drawer-open .payments-bill-row__worker--alerted .payments-payout-alert__line,
    .global-app-layout.is-dock-drawer-open .payments-bill-row__worker--alerted .payments-payout-alert__line {
        display: block;
    }
}

@media (min-width: 1200px) and (max-width: 1248px) {
    .global-app-layout.is-drawer-open .payments-bill-row__worker--alerted .payments-payout-alert__line,
    .global-app-layout.is-dock-drawer-open .payments-bill-row__worker--alerted .payments-payout-alert__line {
        display: none;
    }

    .global-app-layout.is-drawer-open .payments-bill-row__worker--alerted .payments-bill-row__role,
    .global-app-layout.is-dock-drawer-open .payments-bill-row__worker--alerted .payments-bill-row__role {
        display: block;
    }
}

/* The columns have to come down a rung with them. The widest rung's tracks add
   up to a 898px floor, so inside a pushed 821px track the row keeps its full
   width and the tail — the Approve button among it — sits under the panel, with
   overflow-x visible and no scrollbar to reach it. 1524px is where a pushed row
   still gets the 1024px rung's own width (1024 + --drawer-width), so the switch
   happens exactly when the wide tracks stop fitting rather than after. */
@media (min-width: 1200px) and (max-width: 1524px) {
    /* The rail is dots only at this rung (labels hidden below), so 160px holds
       it. At 200px the five tracks plus gaps needed 676px inside the 645px a
       pushed row gets on a 1280 window, and the chevron hung 15px past the card. */
    .global-app-layout.is-drawer-open .payments-bill-row,
    .global-app-layout.is-dock-drawer-open .payments-bill-row {
        grid-template-columns: minmax(160px, 1fr) 160px 110px 140px 18px;
    }

    /* The push selectors above outrank the reimburse-mode override (three
       classes to its two), and the gear's saved-view dock can be open while
       picking — so the mode's lead column is restated at this rung too. */
    .global-app-layout.is-drawer-open .payments-bills-reimburse-mode .payments-bill-row,
    .global-app-layout.is-dock-drawer-open .payments-bills-reimburse-mode .payments-bill-row {
        grid-template-columns: 28px minmax(160px, 1fr) 160px 110px 140px 18px;
    }

    /* Four labels do not fit a 160px track, so beside a pushed drawer the rail
       is dots only — the open drawer names the stages of the bill in hand. */
    .global-app-layout.is-drawer-open .payments-bill-row .payments-pipeline-label,
    .global-app-layout.is-dock-drawer-open .payments-bill-row .payments-pipeline-label {
        display: none;
    }
}

/* ============================================
   Bill Detail Drawer (the one canonical surface)
   ============================================ */

/* The shell/slide/backdrop come from the shared push-drawer (components/drawer.css:
   .global-drawer-panel + .global-drawer-scrim). .payments-bill-detail is the calm inner panel: header and
   footer stay put, and on a tall screen only the activity feed scrolls, inside its
   own little window (.payments-bill-detail__main picks up the slack on short screens). */
.payments-bill-detail {
    display: flex;
    flex-direction: column;
    background: var(--color-card-bg);
    overflow: hidden;
}

/* The middle of the panel — everything between the header and the pinned footer.
   It gives up height first (min-height: 0) so the footer never leaves the view;
   on a short screen it scrolls as a whole, and the activity feed still keeps its
   own smaller window. */
.payments-bill-detail__main {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

/* Header row: the shared .global-drawer-head / .global-drawer-close (drawer_header.html) with
   this drawer's own reference line in the title slot — "Bill #12 · Booking" is
   richer than a plain name, so the markup stays here. */
.payments-bill-detail__ref {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    letter-spacing: 0.01em;
}
.payments-bill-detail__ref span {
    color: var(--color-grey-500);
    font-weight: 400;
}
.payments-bill-detail__band {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-xs) var(--spacing-mdlg) var(--spacing-md);
}
.payments-bill-detail__who {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
    min-width: 0;
    flex: 1;
}
.payments-bill-detail__av {
    position: relative;
    flex: 0 0 auto;
}
.payments-bill-detail__avatar {
    width: 50px;
    height: 50px;
    font-size: var(--font-size-md);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.payments-bill-detail__avatar--empty {
    color: var(--color-grey-500);
}
.payments-bill-detail__who-text {
    min-width: 0;
}
.payments-bill-detail__name-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-xsm);
    min-width: 0;
}
.payments-bill-detail__name {
    font-weight: var(--font-weight-heading);
    font-size: var(--font-size-lg);
    letter-spacing: -0.015em;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.payments-bill-detail__role {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: var(--spacing-2xs);
}
.payments-bill-detail__role b {
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
}
.payments-bill-detail__money {
    text-align: right;
    flex: 0 0 auto;
}
.payments-bill-detail__amt {
    font-size: var(--font-size-h1);
    font-weight: var(--font-weight-heading);
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}
.payments-bill-detail__pill {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xsm);
    margin-top: var(--spacing-sm);
    white-space: nowrap;
}
.payments-bill-detail__pill-dot {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-pill);
    background: currentColor;
}
.payments-bill-detail__pill--ok {
    background: var(--status-success-bg);
    color: var(--color-success);
}
.payments-bill-detail__pill--ramp {
    background: color-mix(in srgb, var(--color-action) 12%, transparent);
    color: var(--color-action);
}
.payments-bill-detail__pill--wait {
    background: var(--color-grey-100);
    color: var(--color-text-muted);
}
.payments-bill-detail__pill--flag {
    background: var(--status-danger-bg);
    color: var(--color-error);
}

/* "Open in QuickBooks / Ramp" — one quiet bordered brand button per platform,
   shown under the header only when the bill carries that platform's id. */
.payments-bill-detail__links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    padding: 0 var(--spacing-mdlg) var(--spacing-md);
}
/* The payments feature's one chip that opens the outside platform: the bill
   drawer's brand buttons and the profile card's "Open in Ramp" (Nick, 09-02). */
.payments-extlink {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xsm) var(--spacing-smd);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-card-bg);
    color: var(--color-text);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.payments-extlink:hover {
    background: var(--color-grey-50);
    border-color: var(--color-grey-300);
}
.payments-extlink__logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
}
.payments-extlink__ext {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.payments-bill-detail__syncnote {
    display: flex;
    align-items: center;
    gap: var(--spacing-xsm);
    margin: 0 var(--spacing-mdlg) var(--spacing-md);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}
.payments-bill-detail__syncnote-ic {
    font-size: var(--font-size-sm);
}
.payments-bill-detail__syncnote--warning {
    color: var(--color-warning);
}
/* The note row's own door into the match modal — a quiet text link, not a button,
   so it never competes with the footer's money moves. */
.payments-bill-detail__syncnote-act {
    padding: 0;
    border: 0;
    background: none;
    font-size: inherit;
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    text-decoration: underline;
    cursor: pointer;
}
.payments-bill-detail__syncnote-act:hover {
    text-decoration: none;
}
.payments-bill-detail__syncnote-act:disabled {
    cursor: default;
    opacity: 0.5;
}

/* Sync match modal — compact candidate rows, one dot per compared fact */
.payments-sync-match__msg {
    margin-bottom: var(--spacing-smd);
    color: var(--color-text);
}
.payments-sync-match__legend {
    display: flex;
    align-items: center;
    gap: var(--spacing-xsm);
    margin-bottom: var(--spacing-smd);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}
.payments-sync-match__legend .payments-sync-match__dot:not(:first-child) {
    margin-left: var(--spacing-smd);
}
.payments-sync-match__rows {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xsm);
}
.payments-sync-match__row {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-smd);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-card-bg);
    text-align: left;
    cursor: pointer;
}
.payments-sync-match__row:hover:not(:disabled) {
    background: var(--color-surface-subtle);
}
.payments-sync-match__row:disabled {
    cursor: default;
    opacity: 0.6;
}
.payments-sync-match__row-who {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}
.payments-sync-match__row-doc {
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}
.payments-sync-match__row-vendor,
.payments-sync-match__row-date {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}
.payments-sync-match__row-money {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.payments-sync-match__row-amt {
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}
.payments-sync-match__row-tag {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}
.payments-sync-match__dots {
    display: flex;
    gap: var(--spacing-xs);
}
/* Geometry only: all three states set their own fill and edge below. The hollow
   "nothing to compare" look used to live here, which left --skipped as a name with
   no rule and made its appearance an accident of whatever the base happened to say.
   Every dot in the DOM carries exactly one state modifier — the legend writes all
   three, and a row's dot gets one from `'payments-sync-match__dot--' + dot.state`. */
.payments-sync-match__dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-pill);
    border: 1.5px solid transparent;
}
.payments-sync-match__dot--match {
    background: var(--color-success);
    border-color: var(--color-success);
}
.payments-sync-match__dot--differ {
    background: var(--color-warning);
    border-color: var(--color-warning);
}
.payments-sync-match__dot--skipped {
    background: var(--color-card-bg);
    border-color: var(--color-grey-200);
}
/* The shared toggle, but top-aligned: the label runs two lines here, and a
   switch centred against both sits below the sentence it belongs to. */
.payments-sync-match__choice.form-switch {
    align-items: flex-start;
    font-size: var(--font-size-sm);
}
.payments-sync-match__choice-help {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}
.payments-sync-match__error {
    margin: var(--spacing-smd) 0 0;
    font-size: var(--font-size-sm);
    color: var(--color-warning);
}
.payments-sync-match__footer {
    gap: var(--spacing-sm);
}
.payments-sync-match__skip {
    margin-right: auto;
    color: var(--color-text-muted);
}

/* slim drawer pipeline rail — sized for a variable number of dots */
.payments-bill-detail__rail {
    display: flex;
    padding: var(--spacing-md) var(--spacing-mdlg) var(--spacing-mdlg);
}
.payments-bill-detail__st {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}
/* The connector is a ::before so it paints behind the dot (the element's own
   child) with no stacking context needed. Top centres it on the 14px atom. */
.payments-bill-detail__st::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--color-grey-200);
}
.payments-bill-detail__st:last-child::before {
    display: none;
}
.payments-bill-detail__st-lb {
    font-size: var(--font-size-2xs);
    color: var(--color-grey-500);
    white-space: nowrap;
    font-weight: var(--font-weight-medium);
}
/* The day the dot's milestone landed — tucked right under its label, quieter
   than it, tabular figures so the dates line up dot to dot. The column's own
   gap (0.5rem) is sized for dot-to-label; the date sits closer to the label it
   belongs to, so the pair reads as one caption. */
.payments-bill-detail__st-dt {
    font-size: var(--font-size-2xs);
    color: var(--color-grey-500);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    margin-top: calc(-1 * var(--spacing-xsm));
}
.payments-bill-detail__st--completed::before {
    background: var(--color-success);
}
.payments-bill-detail__st--completed .payments-bill-detail__st-lb {
    color: var(--color-text-muted);
    font-weight: var(--font-weight-medium);
}
.payments-bill-detail__st--active .payments-bill-detail__st-lb {
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
}
.payments-bill-detail__st--failed .payments-bill-detail__st-lb {
    color: var(--color-error);
    font-weight: var(--font-weight-medium);
}

.payments-bill-detail__ramp {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    margin: 0 var(--spacing-mdlg) var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-smd);
    border: 1px solid var(--color-grey-200);
    border-radius: var(--radius-md);
    background: var(--color-grey-50);
}
.payments-bill-detail__ramp-head {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}
.payments-bill-detail__ramp-sub {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}
/* The line already computes how the bill is doing; without these it was read out in
   the same grey whether Ramp was paying it or refusing to. The accent is on the left
   edge so the label stays the thing being read and the colour is only the sorting. */
.payments-bill-detail__ramp {
    border-left: 3px solid var(--color-grey-400);
}
.payments-bill-detail__ramp[data-ramp-state="success"] {
    border-left-color: var(--color-success);
}
.payments-bill-detail__ramp[data-ramp-state="attention"] {
    border-left-color: var(--color-warning);
    background: color-mix(in srgb, var(--color-warning) 8%, transparent);
}
.payments-bill-detail__ramp[data-ramp-state="problem"],
.payments-bill-detail__ramp[data-ramp-state="rejected"] {
    border-left-color: var(--color-error);
    background: color-mix(in srgb, var(--color-error) 8%, transparent);
}
.payments-bill-detail__ramp[data-ramp-state="problem"] .payments-bill-detail__ramp-head,
.payments-bill-detail__ramp[data-ramp-state="rejected"] .payments-bill-detail__ramp-head {
    color: var(--color-error);
}
.payments-bill-detail__ramp[data-ramp-state="in_flight"] {
    border-left-color: var(--color-grey-400);
}

.payments-bill-detail__sec {
    padding: var(--spacing-md) var(--spacing-mdlg) var(--spacing-md);
    border-top: 1px solid var(--color-grey-100);
}
.payments-bill-detail__sec-h {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-smd);
}
.payments-bill-detail__sec-ic {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-md);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    font-size: var(--font-size-sm);
}
.payments-bill-detail__sec-ic--clock {
    background: var(--status-success-bg);
    color: var(--color-success);
}
.payments-bill-detail__sec-ic--shield {
    background: color-mix(in srgb, var(--color-action) 12%, transparent);
    color: var(--color-action);
}
.payments-bill-detail__sec-ic--list {
    background: var(--color-grey-100);
    color: var(--color-grey-500);
}
.payments-bill-detail__sec-lbl {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-grey-500);
}
.payments-bill-detail__sec-cnt {
    margin-left: auto;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-grey-500);
}

/* files — pay documents on the bill (receipts, the frozen invoice PDF) */
.payments-bill-detail__files-add {
    margin-left: auto;
    border: 1px solid var(--color-grey-200);
    background: none;
    border-radius: var(--radius-md);
    padding: var(--spacing-2xs) var(--spacing-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-grey-600);
    cursor: pointer;
}
.payments-bill-detail__files-add:hover {
    border-color: var(--color-action);
    color: var(--color-action);
}
.payments-bill-detail__files {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}
.payments-bill-detail__file {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}
.payments-bill-detail__file-txt {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
}
.payments-bill-detail__file-name {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-grey-800);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.payments-bill-detail__file-name:hover {
    color: var(--color-action);
}
.payments-bill-detail__file-meta {
    font-size: var(--font-size-xs);
    color: var(--color-grey-500);
}
.payments-bill-detail__file-del {
    margin-left: auto;
    flex: 0 0 auto;
    border: none;
    background: none;
    padding: var(--spacing-xs) var(--spacing-xsm);
    border-radius: var(--radius-md);
    color: var(--color-grey-400);
    cursor: pointer;
}
.payments-bill-detail__file-del:hover {
    color: var(--color-error);
    background: var(--status-danger-bg);
}
/* activity timeline — the only part that scrolls, inside a fixed window. A CSS
   mask fades an edge only while more events hide past it; at a hard end the
   fade width collapses to 0 so nothing readable is ever dimmed. The is-top /
   is-bottom classes come from the scroll handler on the element. */
.payments-bill-detail__tl-wrap {
    position: relative;
}
.payments-bill-detail__tl-scroll {
    --tl-fade-top: 18px;
    --tl-fade-btm: 18px;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    /* The bottom pad clears the fade mask, so the last line reads in full
       once the list is scrolled to the end. */
    padding: var(--spacing-xsm) var(--spacing-sm) var(--spacing-mdlg) 0;
    scrollbar-width: thin;
    overscroll-behavior: contain;
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0,
        black var(--tl-fade-top),
        black calc(100% - var(--tl-fade-btm)),
        transparent 100%
    );
    mask-image: linear-gradient(
        to bottom,
        transparent 0,
        black var(--tl-fade-top),
        black calc(100% - var(--tl-fade-btm)),
        transparent 100%
    );
}
.payments-bill-detail__tl-scroll.is-top {
    --tl-fade-top: 0px;
}
.payments-bill-detail__tl-scroll.is-bottom {
    --tl-fade-btm: 0px;
}
.payments-bill-detail__tl {
    position: relative;
    padding-left: var(--spacing-mdlg);
    margin: 0;
    list-style: none;
}
.payments-bill-detail__tl::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 5px;
    bottom: 6px;
    width: 2px;
    background: var(--color-grey-200);
}
.payments-bill-detail__ev {
    position: relative;
    padding: 0 0 var(--spacing-md);
}
.payments-bill-detail__ev:last-child {
    padding-bottom: var(--spacing-2xs);
}
/* Two dot colours only: grey for history, red for problems. The old four-way
   palette (green acts, purple org actions) meant nothing to a reader with no
   legend — "nobody knows what that means" (Nick, 2026-08-18). */
.payments-bill-detail__ev-mk {
    position: absolute;
    left: -22px;
    top: 2px;
    width: 13px;
    height: 13px;
    border-radius: var(--radius-pill);
    background: var(--color-grey-500);
    border: 2px solid var(--color-grey-500);
}
.payments-bill-detail__ev--flag .payments-bill-detail__ev-mk {
    border-color: var(--color-error);
    background: var(--color-error);
}
.payments-bill-detail__ev-t {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    letter-spacing: -0.01em;
    color: var(--color-text);
}
.payments-bill-detail__ev-m {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: 0.05rem;
}
.payments-bill-detail__ev time {
    font-size: var(--font-size-xs);
    color: var(--color-grey-500);
    font-variant-numeric: tabular-nums;
}

/* An external bill id (a Ramp id, a document number) is one unbroken token with
   nowhere to wrap, so on a narrow drawer it runs past the panel edge — and
   .global-drawer-body is overflow-x: hidden, which would clip the tail with no way to
   reach it. Scrolling the table inside its own box keeps the id reachable
   without widening the drawer, which is fixed at --drawer-width for every
   drawer in the app (drawer.css). */
.payments-bill-detail__break-scroll {
    overflow-x: auto;
    overscroll-behavior-x: contain;
}

.payments-bill-detail__break-tbl {
    width: 100%;
    font-size: var(--font-size-sm);
    font-variant-numeric: tabular-nums;
}
.payments-bill-detail__break-tbl td {
    padding: var(--spacing-xsm) 0;
    border-bottom: 1px solid var(--color-grey-100);
}
.payments-bill-detail__break-tbl tfoot td {
    border-top: 1px solid var(--color-grey-200);
    border-bottom: none;
    padding-top: var(--spacing-sm);
}

/* Action bar pinned to the bottom of the panel. .global-drawer-panel is a flex column
   (header, scrolling body, then this footer), so the bar stays in view while the
   body scrolls. The primary sits above the pair of deliberate money moves. */
.payments-bill-detail__footer {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-smd);
    padding: var(--spacing-md) var(--spacing-mdlg);
    border-top: 1px solid var(--color-grey-200);
    background: var(--color-grey-50);
}

.payments-bill-detail__adjust {
    display: flex;
    gap: var(--spacing-sm);
    align-items: flex-start;
}
.payments-bill-detail__adjust > .payments-action-button {
    flex: 1 1 0;
}

.payments-deposit-card__icon {
    width: 36px;
    height: 36px;
    background: var(--color-success-bg);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-success);
    font-size: var(--font-size-base);
    flex-shrink: 0;
}

.payments-deposit-card__count {
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
    font-weight: var(--font-weight-medium);
    margin-left: var(--spacing-xsm);
}

.payments-deposit-card__bill-ref {
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
}

/* Ledger register. A flat register on the same surface language as the bill
   cards above it — the register itself uses no Bootstrap table utilities.
   Pending rows pin at the top on a soft tint (not the loud Bootstrap yellow)
   so a settled register still reads calm while in-flight money stays easy to
   spot. */
.payments-ledger-totals {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-smd);
}
.payments-ledger-total {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-xs);
}
.payments-ledger-total__label {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
}
.payments-ledger-total__value {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}
.payments-ledger-total__value--credit {
    color: var(--color-success);
}
.payments-ledger-total__value--debit {
    color: var(--color-error);
}

.payments-ledger {
    overflow-x: auto;
    overscroll-behavior-x: contain;
}
.payments-ledger__table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-md);
}
.payments-ledger__table td {
    padding: var(--spacing-sm) var(--spacing-smd);
    border-top: 1px solid var(--color-border-subtle);
    vertical-align: middle;
}
.payments-ledger-num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.payments-ledger-section > th {
    padding: var(--spacing-smd) var(--spacing-smd) var(--spacing-xs);
    text-align: left;
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-secondary);
    background-color: transparent;
}
.payments-ledger-section__note {
    text-transform: none;
    letter-spacing: 0;
    color: var(--color-text-muted);
}

.payments-ledger-row[data-ledger-toggle] {
    cursor: pointer;
}
.payments-ledger-row:hover > td {
    background-color: var(--color-surface-subtle);
}
.payments-ledger-row__date {
    white-space: nowrap;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}
.payments-ledger-row__chevron {
    display: inline-block;
    margin-right: var(--spacing-xs);
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
    transition: transform 0.15s ease;
}
.payments-ledger-row.is-open .payments-ledger-row__chevron {
    transform: rotate(90deg);
}
.payments-ledger-row__name {
    display: block;
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}
.payments-ledger-row__context {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
}
.payments-ledger-row__dash {
    color: var(--color-text-muted);
}
.payments-ledger-row--pending > td {
    background-color: var(--color-grey-50);
}
.payments-ledger-row--void > td {
    color: var(--color-text-muted);
}
.payments-ledger-amount--debit {
    color: var(--color-error);
}
.payments-ledger-amount--credit {
    color: var(--color-success);
}
.payments-ledger-amount--pending {
    color: var(--color-text-muted);
}
.payments-ledger-amount--void {
    color: var(--color-text-muted);
    text-decoration: line-through;
}

.payments-ledger-detail > td {
    border-top: none;
    padding-top: 0;
}
.payments-ledger-detail__body {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: var(--spacing-smd);
    border-radius: var(--radius-md);
    background-color: var(--color-surface-subtle);
}
.payments-ledger-detail__pairs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs) var(--spacing-lg);
    margin: 0;
}
.payments-ledger-detail__pair {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-xs);
}
.payments-ledger-detail__pair dt {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-body);
    color: var(--color-text-secondary);
}
.payments-ledger-detail__pair dd {
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}
.payments-ledger-detail__link {
    align-self: flex-start;
    padding: 0;
    border: none;
    background: none;
    font-size: var(--font-size-sm);
    color: var(--color-action);
    text-decoration: underline;
    cursor: pointer;
}
.payments-ledger-detail__ids {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs) var(--spacing-smd);
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
}
.payments-ledger-detail__id {
    white-space: nowrap;
}
.payments-ledger-ref-kind {
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-secondary);
}

.payments-ledger-chip--confirmed {
    background-color: var(--color-success-bg);
    color: var(--color-success);
}
.payments-ledger-chip--pending {
    background-color: transparent;
    border: 1px dashed var(--color-grey-300);
    color: var(--color-grey-600);
}
.payments-ledger-chip--void {
    display: inline-block;
    padding: 0.25em 0.6em;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-body);
    line-height: 1.4;
    white-space: nowrap;
    background-color: var(--color-grey-100);
    color: var(--color-grey-600);
}

/* ============================================================
   Payment confirm modals — readiness checklist layout
   (approve_confirm.html / payout_confirm.html). Design tokens
   only, per ADR-125 (the CSS ratchet forbids new raw hex here).
   ============================================================ */
.payments-pay-confirm {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.payments-pay-confirm__payee {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
}
/* Pay-confirm payee face — DELETED, both the disc and its --img twin. It was an
   off-ladder 44px ink circle with a hard-coded `white` foreground; it now
   renders as `.global-avatar .global-avatar--lg .global-avatar--ink`, which
   puts it on the ladder and on the shared foreground token. */
.payments-pay-confirm__payee-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.payments-pay-confirm__payee-name {
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}
.payments-pay-confirm__payee-role {
    font-size: var(--font-size-xs);
    color: var(--color-text-light);
}

.payments-pay-confirm__details {
    margin: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.payments-pay-confirm__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-smd);
}
.payments-pay-confirm__row + .payments-pay-confirm__row {
    border-top: 1px solid var(--color-border-subtle);
}
.payments-pay-confirm__row dt {
    margin: 0;
    font-weight: var(--font-weight-medium);
    color: var(--color-text-light);
}
.payments-pay-confirm__row dd {
    margin: 0;
    text-align: right;
    color: var(--color-text);
}
.payments-pay-confirm__row--amount dt {
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}
.payments-pay-confirm__row--amount dd {
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-lg);
    color: var(--color-text);
}

.payments-pay-confirm__field {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}
.payments-pay-confirm__field-label {
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
    color: var(--color-text);
}
.payments-pay-confirm__field-help {
    font-size: var(--font-size-2xs);
    color: var(--color-text-light);
}

.payments-readiness-checks {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}
.payments-readiness-check {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
}
.payments-readiness-check__mark {
    display: inline-flex;
    flex-shrink: 0;
    line-height: 1.4;
}
.payments-readiness-check--pass .payments-readiness-check__mark {
    color: var(--color-success);
}
.payments-readiness-check--fail .payments-readiness-check__mark {
    color: var(--color-error);
}
.payments-readiness-check__body {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}
.payments-readiness-check__label {
    color: var(--color-text);
}
.payments-readiness-check--fail .payments-readiness-check__label {
    color: var(--color-text-light);
}
.payments-readiness-check__reason {
    font-size: var(--font-size-2xs);
    color: var(--color-text-light);
}

.payments-pay-confirm__pool {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    padding: var(--spacing-smd);
    border-radius: var(--radius-md);
    background: var(--color-surface-subtle);
    border: 1px solid var(--color-border);
}
.payments-pay-confirm__pool--short {
    border-color: var(--color-error);
}
.payments-pay-confirm__pool-title {
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-light);
}
.payments-pay-confirm__pool-row {
    display: flex;
    justify-content: space-between;
    color: var(--color-text);
}
.payments-pay-confirm__pool-row--total {
    font-weight: var(--font-weight-medium);
    padding-top: var(--spacing-xs);
    border-top: 1px solid var(--color-border-subtle);
}
.payments-pay-confirm__pool--short .payments-pay-confirm__pool-row--total {
    color: var(--color-error);
}
/* Pool balance could not be checked: the block reads as a failed check —
   error border, an x mark, and the why-only reason, no pool-math rows. */
.payments-pay-confirm__pool--failed {
    border-color: var(--color-error);
}
.payments-pay-confirm__pool-unknown {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--color-error);
}

/* Always-visible-but-disabled submit (void/adjust modals): the button stays put
   with a why-only reason under it, matching the row/overflow disabled pattern. */
.payments-pay-confirm__submit-block {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
}
.payments-pay-confirm__submit-reason {
    font-size: var(--font-size-2xs);
    color: var(--color-text-light);
    text-align: center;
}

/* Bills/Ledger toggle + saved-view tabs share the header's single tab slot. One
   row with a rule between them, rather than two stacked strips of chrome that
   would read as two sets of tabs and steal a row of body height. */
.payments-bill-tabs-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
    min-width: 0;
}
.payments-bill-tabs-row > nav {
    min-width: 0;
}
.payments-bill-tabs-row > nav + nav {
    padding-left: var(--spacing-smd);
    border-left: 1px solid var(--color-border-hairline);
}

/* ---- Reimbursements status drawer (the kebab's "Reimbursements") ---------- */
/* One list of every minted ask. Rows wear the bill rows' dot-and-word status
   idiom; settled rows (paid/voided) dim as a group below the divider rather
   than per-part, so the whole archive reads quieter at once. */

.payments-reimb-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.payments-reimb-list__count {
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
}

.payments-reimb-divider {
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-smd);
    border-top: 1px solid var(--color-border-hairline);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.payments-reimb-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
}

.payments-reimb-row--settled {
    opacity: 0.55;
}

.payments-reimb-row__who {
    flex: 1;
    min-width: 0;
}

.payments-reimb-row__name {
    font-weight: var(--font-weight-medium);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.payments-reimb-row__meta {
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
}

.payments-reimb-row__amount {
    font-weight: var(--font-weight-medium);
    font-variant-numeric: tabular-nums;
}

/* The bill rows' status treatment, sized for a modal row. Tone vocabulary is
   the same success / warning / progress / neutral the dashboard speaks. */
.payments-reimb-row__status {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    min-width: 4.5rem;
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.01em;
    color: var(--color-text-muted);
}

.payments-reimb-row__status-dot {
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-radius: var(--radius-pill);
    background: var(--color-grey-400);
}

.payments-reimb-row__status--success {
    color: var(--color-success);
}

.payments-reimb-row__status--success .payments-reimb-row__status-dot {
    background: var(--color-success);
}

.payments-reimb-row__status--warning {
    color: var(--status-warning-fg);
}

.payments-reimb-row__status--warning .payments-reimb-row__status-dot {
    background: var(--color-warning);
}

.payments-reimb-row__status--progress {
    color: var(--color-info);
}

.payments-reimb-row__status--progress .payments-reimb-row__status-dot {
    background: var(--color-info);
}

/* Neutral (voided) pinned explicitly, like the bill rows' --neutral: it
   restates the base today so a later change to the default can't reshade it. */
.payments-reimb-row__status--neutral {
    color: var(--color-text-muted);
}

.payments-reimb-row__status--neutral .payments-reimb-row__status-dot {
    background: var(--color-grey-400);
}

/* Danger (payment failed) — the bill rows' error tone: the one state in this
   drawer that needs a human, so it's the one state allowed to shout. */
.payments-reimb-row__status--danger {
    color: var(--color-error);
}

.payments-reimb-row__status--danger .payments-reimb-row__status-dot {
    background: var(--color-error);
}

/* The meta line's payment-signal date (paid <day> / payment failed <day>):
   a shade darker than the rest of the line so the news reads first. */
.payments-reimb-row__meta strong {
    color: var(--color-grey-700);
    font-weight: var(--font-weight-medium);
}

.payments-reimb-row__actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

/* One-off bill drawer. Sticky footer pinned to the foot of the scrolling body
   so the primary action is always reachable without scrolling the form. */
#one-off-bill-drawer .payments-bill-drawer-footer {
    position: sticky;
    bottom: 0;
    background: var(--bs-body-bg, #fff);
    border-top: 1px solid rgba(15, 23, 42, .08);
    padding-top: var(--spacing-smd);
    margin-top: var(--spacing-md);
}

/* ─── Standing pay ───────────────────────────────────────────────────────────
   Two lists, one dress. The seat list (.payments-recurring) is drawn both on
   the admin's Payments card on a worker profile and on that person's own
   Upcoming tab here, from one partial. .payments-watchlist__schedules is the admin's list
   of every recurring payment the org is tracking, on the Repeats tab. A
   row that reads differently on the two sides would be two answers to one
   question.

   Rows are a grid that collapses to stacked lines on a phone rather than
   scrolling sideways: the amount and when it next runs are the two things
   somebody opens this for, and neither may end up off-screen.

   Nothing here redefines .global-badge — the paused tone is the shipped
   singleton, which is also what keeps this list reading the same as every
   other status in the product. */
.payments-recurring,
.payments-watchlist__schedules {
    margin-top: var(--spacing-md);
}

.payments-recurring__title {
    margin: 0 0 var(--spacing-xs);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
}

.payments-recurring__list,
.payments-watchlist__list {
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-subtle);
}

.payments-recurring__row,
.payments-watchlist__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-smd) var(--spacing-md);
}

.payments-recurring__row + .payments-recurring__row,
.payments-watchlist__row + .payments-watchlist__row {
    border-top: 1px solid var(--color-border);
}

.payments-recurring__what,
.payments-watchlist__what {
    min-width: 0;
}

/* The overlay that makes the whole row open the role's settings, the same
   pattern as the role tile's trigger on the opportunity page. */
.payments-watchlist__open {
    position: absolute;
    inset: 0;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

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

.payments-recurring__name,
.payments-watchlist__name {
    display: block;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The reference is how somebody ties a line here to a row in Ramp or
   QuickBooks, so it is quiet but never dropped. */
.payments-recurring__ref,
.payments-watchlist__period {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.payments-recurring__terms {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-xs);
    white-space: nowrap;
}

.payments-recurring__amount,
.payments-watchlist__amount {
    font-weight: var(--font-weight-medium);
    font-variant-numeric: tabular-nums;
    color: var(--color-text);
    white-space: nowrap;
}

.payments-recurring__cadence,
.payments-recurring__next,
.payments-watchlist__cadence,
.payments-watchlist__next {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.payments-recurring__when,
.payments-watchlist__why {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: var(--spacing-xs);
}

/* Why a seat's pay has not started, on its own line across the row, so the
   amount and the badge stay where every other row has them. */
.payments-watchlist__note {
    grid-column: 1 / -1;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    text-align: right;
}

@media (max-width: 36rem) {
    .payments-recurring__row,
    .payments-watchlist__row {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--spacing-xs);
    }

    .payments-recurring__when,
    .payments-watchlist__why {
        justify-content: flex-start;
    }

    .payments-watchlist__note {
        text-align: left;
    }
}

/* Worker profile -> Payments card.
 *
 * Admin-only surface answering "can we pay this person, and what have they
 * earned". One card in the shell's standard dress — card-header with a badge
 * only when the state needs saying, else the kebab that reopens setup — then
 * the earnings stat strip and the Ramp routing facts. A worker who still needs a
 * Ramp vendor and payee gets the inline setup in the facts' place — bills are
 * never listed here (they live on the bills dashboard).
 *
 * The cards, badges, buttons and form controls are the shipped singletons —
 * nothing here redefines .global-card, .global-badge, .btn or .form-select.
 */

.payments-worker-card__hint {
    margin: var(--spacing-xs) 0 var(--spacing-smd);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* The date presets (the sales strips' shared control) right above the
   numbers (Nick, 09-02); no resolved-window label beside them (Nick, 09-03). */
.payments-range {
    margin-bottom: var(--spacing-sm);
}

/* Four presets in one row need about 26rem, wider than a phone's column, and
   the card would run off the right edge with them. Under that, they sit two by
   two across the card. Scoped here because .global-segmented is a shared
   control. */
@media (max-width: 575.98px) {
    .payments-range__group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }
}

/* The same numbers the worker's Earnings page shows, at card scale; four
   tiles fit the profile's narrowest main column. */
.payments-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-smd) var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-subtle);
}

.payments-stats__item {
    min-width: 0;
}

.payments-stats__label {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.payments-stats__value {
    display: block;
    font-size: var(--font-size-h4);
    font-weight: var(--font-weight-medium);
    font-variant-numeric: tabular-nums;
    color: var(--color-text);
}

/* The Ramp routing as one strip (Nick, 09-02): the wordmark, the vendor, who
   gets paid, and the Open in Ramp button.
   Pieces wrap whole; the button drops to its own row on a phone. */
.payments-rail {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-smd);
    padding: var(--spacing-smd) var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-subtle);
}

/* The wordmark (96x26) at text height; the button carries the square logo. */
.payments-rail__mark,
.payments-rail__open-mark {
    width: auto;
    height: 18px;
}

.payments-rail__who {
    flex: 1 1 14rem;
    min-width: 0;
}

.payments-rail__name {
    display: block;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.payments-rail__email {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    overflow-wrap: anywhere;
}

/* Open in Ramp: the round icon button stretched to a pill, the logo and the
   new-tab arrow inside and no words (Nick, 09-03). */
.payments-rail__open {
    margin-left: auto;
    width: auto;
    padding: 0 var(--spacing-smd);
    gap: var(--spacing-sm);
    border-radius: var(--radius-pill);
}

/* The Stripe rail's facts, one size for the whole list (Nick, 09-02): key
   and value both sit on the standard-body step of the ladder; only a
   secondary detail steps down. */
.payments-facts {
    display: grid;
    gap: var(--spacing-2xs);
    font-size: var(--font-size-md);
}

.payments-facts__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) 0;
    border-top: 1px solid var(--color-border);
}

.payments-facts__row:first-child {
    border-top: 0;
}

.payments-facts__key {
    flex-shrink: 0;
    color: var(--color-text-secondary);
}

.payments-facts__value {
    min-width: 0;
    text-align: right;
}

.payments-facts__primary {
    display: block;
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.payments-facts__secondary {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* Bank name and its last-four on one line (Nick, 08-30): the blocks a
   facts row normally stacks become flex items here, keeping their own
   weights while sharing the line. */
.payments-facts__inline {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xsm);
    align-items: baseline;
    justify-content: flex-end;
}

.payments-setup-step {
    position: relative;
    display: flex;
    gap: var(--spacing-smd);
    padding-bottom: var(--spacing-md);
}

.payments-setup-step:last-child {
    padding-bottom: 0;
}

.payments-setup-step__marker {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface-subtle);
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
}

.payments-setup-step.is-done .payments-setup-step__marker {
    border-color: var(--color-success);
    background: var(--color-success);
    color: var(--color-card-bg);
}

.payments-setup-step.is-current .payments-setup-step__marker {
    border-color: var(--color-action);
    background: var(--color-action);
    color: var(--color-card-bg);
}

/* Connector between markers; the last step has nothing to connect to. */
.payments-setup-step__line {
    position: absolute;
    top: 30px;
    bottom: 4px;
    left: 13px;
    width: 1px;
    background: var(--color-border);
}

.payments-setup-step:last-child .payments-setup-step__line {
    display: none;
}

.payments-setup-step__body {
    flex: 1;
    min-width: 0;
}

.payments-setup-step__title {
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.payments-setup-step.is-pending .payments-setup-step__title {
    color: var(--color-text-muted);
}

.payments-setup-step__sub {
    margin: var(--spacing-2xs) 0 var(--spacing-sm);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.payments-setup-step__control {
    width: 100%;
    /* Same cap as the wizard panel's vendor box (.integrations-ramp-match-row__pick .global-cs,
       main.css) — the two doors to the same pick should be the same size. */
    max-width: 20rem;
}

.payments-setup-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border);
}

.payments-note {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-xsm);
    margin: var(--spacing-sm) 0 0;
    font-size: var(--font-size-sm);
}

.payments-note i {
    margin-top: var(--spacing-2xs);
}

.payments-note--warn {
    color: var(--color-warning-text);
}

/* Ramp refusing the vendor outright — the one genuine failure on this card. */
.payments-note--error {
    color: var(--color-error);
}

.payments-note--muted {
    color: var(--color-text-secondary);
}

.payments-note--ok {
    color: var(--color-text-secondary);
}

.payments-note--ok i {
    color: var(--color-success);
}

/* Inbox (ADR-181): the texts on the org's main line, one thread, and the
   smaller panel on a lead's drawer and on a booking.

   The inbox fills the screen under the top bar in three panes: the threads,
   the open thread, and who the person is. The last folds away, and under
   1200px it opens over the thread instead of beside it. On a phone the list
   comes first and a thread opens over it with a back arrow.

   The texts look the way a phone shows them (Nick, 2026-10-03): one from the
   person sits left in light grey with dark words; one from us sits right in
   iMessage blue, or SMS green when Sendblue says it went that way, blue until
   it says. Back-to-back texts from one person share one group beside their
   face: the name once above it, the time once below it, the bubbles' inner
   corners tucked in and a tail on the last. A text that did not send carries
   one red line with Sendblue's reason. */

/* ── The three panes ─────────────────────────────────────────────────── */

/* While the Inbox is on screen a pull down past the top never reloads the
   page, which would drop the open thread and the words in the reply box. */
html:has(#conversations-app),
html:has(#conversations-app) body {
    overscroll-behavior-y: contain;
}

.conversations-app.global-page-fill {
    position: relative;
    display: grid;
    grid-template-columns: 22rem minmax(0, 1fr);
    margin: var(--page-gutter-bleed);
    border-top: 1px solid var(--color-border-subtle);
    background: var(--color-card-bg);
}

.conversations-side {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-right: 1px solid var(--color-border-subtle);
}

.conversations-side__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-md) var(--spacing-sm);
}

.conversations-side__title {
    margin: 0;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-heading);
}

.conversations-side__tools {
    display: flex;
    gap: var(--spacing-2xs);
}

.conversations-filter {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: 0 var(--spacing-md) var(--spacing-smd);
    border-bottom: 1px solid var(--color-border-subtle);
}

.conversations-search {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    height: var(--control-h-base);
    margin: 0;
    padding: 0 var(--spacing-smd);
    border-radius: var(--radius-md);
    background: var(--color-surface-subtle);
    color: var(--color-text-secondary);
    transition: box-shadow var(--transition-fast), background var(--transition-fast);
}

.conversations-search:focus-within {
    background: var(--color-card-bg);
    box-shadow: var(--shadow-inset-ring-neutral);
}

.conversations-search__input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--color-text);
    font-size: var(--font-size-sm);
    outline: none;
}

.conversations-search__key {
    padding: 0 var(--spacing-xsm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-card-bg);
    color: var(--color-text-secondary);
    font-family: inherit;
    font-size: var(--font-size-2xs);
}

.conversations-search:focus-within .conversations-search__key {
    display: none;
}

/* The box shows focus as a whole: one rounded ring, none on the field inside. */
.conversations-search__input:focus-visible {
    outline: none;
}

.conversations-search:has(.conversations-search__input:focus-visible) {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

/* The "/" key hint means nothing on a touch screen. */
@media (hover: none) {
    .conversations-search__key {
        display: none;
    }
}

/* A view never narrows below its word. Four views and More fit the column,
   so the row never scrolls, and nothing More opens is cut at its edge. */
.conversations-views.global-segmented--block {
    grid-auto-columns: minmax(max-content, auto);
}

/* The views fit the list column only at the narrow padding. */
.conversations-views .global-segmented__btn {
    padding-inline: var(--spacing-xs);
    cursor: pointer;
    font-size: var(--font-size-xs);
}

/* The muted grey measured 2.41:1 on this recess; the secondary grey reads at
   about 4.5:1. Hover and the live option keep their own colours. */
.conversations-views .global-segmented__btn:not(.is-active, :hover) {
    color: var(--color-text-secondary);
}

/* The tag chips under the views wear the quick-filter pill: at most one lit; the
   lit one again shows everyone. The box is hidden, so its pill shows the focus,
   drawn on the pill's own edge where the strip's scroll edge cannot cut it. */
.conversations-tags {
    display: flex;
    gap: var(--spacing-xsm);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}

.conversations-tags .global-toolbar__chip:has(input:focus-visible) {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: -2px;
}

/* The list's channel tabs: five short words, spread across the column. */
.conversations-channels {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 0;
    justify-content: space-between;
}

.conversations-channels .global-tab {
    padding-inline: var(--spacing-xsm);
}

/* Its radio is hidden, so the tab shows the keyboard's focus; a tap draws no ring. */
.conversations-channels .global-tab:has(input:focus-visible) {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: -2px;
}

/* Shared tabs and chips wear the pale grey; inside the Inbox they read in
   the secondary grey. Hover and the live one keep their own colours. */
.conversations-channels .global-tab:not(.is-active):not(:hover),
.conversations-person-tabs .global-tab:not(.is-active):not(:hover),
.conversations-tags .global-toolbar__chip--add:not(:hover) {
    color: var(--color-text-secondary);
}

/* On a computer the Filter sheet is no box at all: the channel tabs sit on
   top, then the search, the views and the tag chips. Only a phone shows the
   Filter button, the picked line, the sheet's own head and foot, and the
   inbox picker as the title. */
.conversations-filter__sheet,
.conversations-filter__body {
    display: contents;
}

.conversations-filter__button,
.conversations-filter__picked,
.conversations-filter__shade,
.conversations-filter__grab,
.conversations-filter__head,
.conversations-filter__label,
.conversations-filter__foot,
.conversations-views__check {
    display: none;
}

/* Beats the dropdown's own display; only a phone shows the picker title. */
.conversations-side__head .conversations-side__picker {
    display: none;
}

.conversations-channels {
    order: -1;
}

.conversations-filter__bar {
    display: flex;
    gap: var(--spacing-sm);
}

.conversations-filter__bar .conversations-search {
    flex: 1 1 auto;
    min-width: 0;
}

/* More on the views row: Snoozed, All and Deleted in a small menu. It lights
   up while one of them is the view picked. */
.conversations-views__more {
    position: relative;
    display: flex;
}

.conversations-views__more-button {
    flex: 1 1 auto;
}

.conversations-views__more-button .bi {
    font-size: var(--font-size-2xs);
}

.conversations-views__more:has(input:checked) .conversations-views__more-button {
    background: var(--color-card-bg);
    color: var(--color-action);
    box-shadow: var(--shadow-sm);
}

.conversations-views__menu {
    position: absolute;
    top: calc(100% + var(--spacing-xs));
    right: 0;
    z-index: var(--z-dropdown);
    display: none;
    flex-direction: column;
    min-width: 10rem;
    padding: var(--spacing-xsm);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    background: var(--color-card-bg);
    box-shadow: var(--shadow-lg);
}

.conversations-views__menu.is-open {
    display: flex;
}

.conversations-views__menu .global-segmented__btn {
    justify-content: space-between;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-sm);
}

.conversations-views__menu .global-segmented__btn.is-active {
    background: var(--color-surface-hover);
    box-shadow: none;
}

.conversations-views__menu .is-active .conversations-views__check {
    display: inline-block;
}

.conversations-pane {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

/* ── The thread list ─────────────────────────────────────────────────── */

.conversations-list-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* The list, the texts and their typing bubble read themselves again in the
   background. The global .htmx-request rule (main.css) fades and deadens
   whatever htmx marks, so every read dimmed the whole list and the whole
   thread for a moment: the flicker on each refresh. A background read leaves
   the screen as it is until something new lands. */
.conversations-list-scroll.htmx-request,
.conversations-messages.htmx-request,
.conversations-typing-slot.htmx-request {
    opacity: 1;
    pointer-events: auto;
}

.conversations-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    margin: 0;
    padding: var(--spacing-sm);
    list-style: none;
}

.conversations-row {
    display: flex;
    gap: var(--spacing-smd);
    align-items: center;
    padding: var(--spacing-smd);
    border-radius: var(--radius-md);
    color: inherit;
    text-decoration: none;
    transition: background var(--transition-fast);
}

.conversations-row:hover {
    background: var(--color-surface-subtle);
    color: inherit;
}

.conversations-row.is-selected {
    background: var(--color-grey-100);
}

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

.conversations-row__main {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: var(--spacing-2xs);
    min-width: 0;
}

.conversations-row__top,
.conversations-row__bottom {
    display: flex;
    gap: var(--spacing-xsm);
    align-items: center;
    min-width: 0;
}

.conversations-row__title {
    overflow: hidden;
    color: var(--color-text);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-body);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversations-row.is-unread .conversations-row__title {
    font-weight: var(--font-weight-heading);
}

.conversations-row__mark {
    flex: 0 0 auto;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
}

/* The channel a conversation is on, in its row and header: a bubble, an envelope, or a
   phone when a call was the last thing said. */
.conversations-channel {
    flex: 0 0 auto;
    color: var(--color-text-secondary);
    font-size: var(--font-size-2xs);
}

.conversations-row__when {
    flex: 0 0 auto;
    margin-left: auto;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    white-space: nowrap;
}

.conversations-row.is-unread .conversations-row__when {
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
}

.conversations-row__preview {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversations-row.is-unread .conversations-row__preview {
    color: var(--color-text);
}

.conversations-row__typing {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: color-mix(in srgb, var(--texts-imessage) 70%, var(--color-text));
    font-size: var(--font-size-sm);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversations-row__typing[hidden],
.conversations-row.is-team-typing .conversations-row__preview {
    display: none;
}

.conversations-row__you {
    color: var(--color-text-secondary);
}

/* The words a search typed, in the row that holds them. */
.conversations-row__hit {
    padding: 0;
    background: none;
    color: inherit;
    font-weight: var(--font-weight-heading);
}

/* An email row leads with its subject, the way a mail app does. Only an unread
   row is bold, its subject with its name. With one mailbox the subject takes
   the line the mailbox would have used. */
.conversations-row__subject {
    color: var(--color-text);
    font-weight: var(--font-weight-body);
}

.conversations-row.is-unread .conversations-row__subject {
    font-weight: var(--font-weight-heading);
}

.conversations-row__subject--line {
    overflow: hidden;
    font-size: var(--font-size-sm);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Our last email did not go: said in place of "You:". */
.conversations-row__failed {
    color: var(--color-error-text);
    font-weight: var(--font-weight-medium);
}

.conversations-row__clip {
    flex: 0 0 auto;
    color: var(--color-text-secondary);
    font-size: var(--font-size-2xs);
}

.conversations-row__dash {
    color: var(--color-text-secondary);
}

.conversations-row__holder {
    flex: 0 0 auto;
}

.conversations-row__count {
    flex: 0 0 auto;
    min-width: 20px;
    padding: 0 var(--spacing-xsm);
    border-radius: var(--radius-pill);
    background: black;
    color: white;
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-heading);
    line-height: 20px;
    text-align: center;
}

.conversations-avatar--group {
    background: var(--color-grey-200);
    color: var(--color-grey-700);
}

.conversations-more {
    display: flex;
    gap: var(--spacing-smd);
    align-items: center;
    padding: var(--spacing-smd);
}

/* ── Empty, blank and loading ────────────────────────────────────────── */

.conversations-muted {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
}

.conversations-all-deleted__note {
    margin: 0;
    padding: var(--spacing-xl) var(--spacing-md) var(--spacing-sm);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    text-align: center;
}

/* Clear search and See all, each on its own line under the list's empty title. */
.conversations-empty__link {
    display: block;
    margin: var(--spacing-xs) auto 0;
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.conversations-empty__clear {
    padding: 0;
    border: 0;
    background: none;
}

.conversations-empty__link:hover {
    color: var(--color-text);
    text-decoration-thickness: 2px;
}

.conversations-form__note {
    display: flex;
    flex: 1 1 auto;
    gap: var(--spacing-xsm);
    align-items: center;
    margin: 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
}

.conversations-blank {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: var(--spacing-smd);
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl) var(--spacing-md);
    color: var(--color-text-secondary);
}

.conversations-blank__icon {
    color: var(--color-grey-300);
    font-size: var(--font-size-h1);
}

.conversations-blank__text {
    margin: 0;
    font-size: var(--font-size-md);
}

/* A thread with nothing in it says so the way the empty Inbox does, in the middle. */
.conversations-messages:has(> .conversations-blank) {
    min-height: 100%;
}

.conversations-blank--thread .global-empty-state {
    padding: 0;
}

.conversations-blank--thread .global-empty-state-title {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-body);
}

/* A number's thread with nothing on it yet: who it is, in a small card on top. */
.conversations-no-texts {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    align-items: center;
    margin: var(--spacing-md) auto;
    padding: var(--spacing-md) var(--spacing-lg);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    background: var(--color-card-bg);
    text-align: center;
}

.conversations-no-texts p { margin: 0; }
.conversations-no-texts__name { font-weight: var(--font-weight-heading); }
.conversations-no-texts__number { color: var(--color-text-secondary); }

.conversations-no-texts__note {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.conversations-gallery-refusal {
    display: grid;
    gap: var(--spacing-md);
    justify-items: center;
    max-inline-size: 52ch;
    margin: var(--spacing-xl) auto;
    text-align: center;
}

.conversations-gallery-refusal h1 {
    margin: 0;
    font-size: var(--font-size-xl);
}

.conversations-gallery-refusal p {
    margin: 0;
    color: var(--color-text-secondary);
}

.conversations-gallery-refusal > div {
    width: 100%;
}

/* On an email thread the side card's address opens the reply. */
.conversations-lead-head button.sales-lead-head__chip {
    background: transparent;
    font-family: inherit;
    cursor: pointer;
}

.conversations-lead-head button.sales-lead-head__chip:hover {
    background: var(--color-surface-hover);
}

/* With a drawer open beside it the thread head keeps the person's name: its
   tools fold into More first, as on a phone. */
.global-app-layout.is-drawer-open .conversations-head .conversations-head__tools .conversations-head__desk,
.global-app-layout.is-drawer-open .conversations-head .conversations-head__chips {
    display: none;
}

.global-app-layout.is-drawer-open .conversations-head .conversations-head__phone {
    display: inline-block;
}

.global-app-layout.is-drawer-open .conversations-more .conversations-more__phone {
    display: flex;
}

.global-app-layout.is-drawer-open .conversations-head__who {
    flex: 1 1 auto;
}

/* The head More is a menu, not the next-page row of the list that has the
   same class. From 768 px it gets no padding, so the head keeps its height. */
@media (min-width: 768px) {
    .conversations-head .conversations-head__tools .conversations-more {
        padding: 0;
    }
}

@media (min-width: 1200px) {
    .conversations-head__tools .conversations-more:has([data-mark-unread]) {
        display: inline-block;
    }
}

/* The Video call row of More shows only in the fold below. A phone and a
   wide screen keep Video call in the head. */
.conversations-more .conversations-more__video {
    display: none;
}

/* From 768 to 1199.98 px the head has no room for each tool. Hand to, Tag,
   Snooze, Details and Video call fold into More, and the name gets the room.
   Call, Done or Reopen, and More stay in the head. The fold sets no display
   on Done or on a data-desk row, so the drawer fold above still wins. Three
   classes each: main.css loads later. */
@media (min-width: 768px) and (max-width: 1199.98px) {
    .conversations-head .conversations-head__tools .conversations-head__fold {
        display: none;
    }

    .conversations-head .conversations-head__tools .conversations-more {
        display: inline-block;
    }

    .conversations-head .conversations-more .conversations-more__phone:not([data-desk]),
    .conversations-head .conversations-more:has(.conversations-more__video-choices [role="group"]) .conversations-more__video {
        display: flex;
    }

    .conversations-head .conversations-head__who {
        flex: 1 1 auto;
    }
}

.conversations-skeleton {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
}

.conversations-skeleton__head {
    display: flex;
    gap: var(--spacing-smd);
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.conversations-skeleton__disc,
.conversations-skeleton__bar,
.conversations-skeleton__bubble {
    background: linear-gradient(90deg, var(--color-grey-100), var(--color-grey-50), var(--color-grey-100));
    background-size: 200% 100%;
    animation: conversations-shimmer 1.2s ease-in-out infinite;
}

.conversations-skeleton__disc {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-pill);
}

.conversations-skeleton__bar {
    width: 40%;
    height: 12px;
    border-radius: var(--radius-pill);
}

.conversations-skeleton__bubble {
    width: 45%;
    height: 36px;
    border-radius: var(--radius-lg);
}

.conversations-skeleton__bubble--out {
    align-self: flex-end;
    width: 35%;
}

@keyframes conversations-shimmer {
    from { background-position: 100% 0; }
    to { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .conversations-skeleton__disc,
    .conversations-skeleton__bar,
    .conversations-skeleton__bubble {
        animation: none;
    }
}

/* ── One thread ──────────────────────────────────────────────────────── */

.conversations-thread {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.conversations-head {
    display: flex;
    flex: 0 0 auto;
    gap: var(--spacing-smd);
    align-items: center;
    min-height: 64px;
    padding: var(--spacing-smd) var(--spacing-lg);
    border-bottom: 1px solid var(--color-border-subtle);
}

.conversations-head__back {
    display: none;
}

.conversations-head__who {
    flex: 0 1 auto;
    min-width: 0;
}

.conversations-head__name {
    margin: 0;
    overflow: hidden;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-heading);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversations-head__sub {
    display: flex;
    gap: var(--spacing-xsm);
    margin: 0;
    overflow: hidden;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A number, an email address or a handle with no room shows an ellipsis. */
.conversations-head__contact {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversations-head__state {
    color: var(--color-text-secondary);
}

/* A desk click swaps these in by their ids; their parts sit in the row as before. */
.conversations-head__marks,
.conversations-head__deskset {
    display: contents;
}

.conversations-head__chips {
    display: flex;
    flex: 1 1 auto;
    gap: var(--spacing-xsm);
    min-width: 0;
    overflow: hidden;
}

.conversations-chip {
    display: inline-flex;
    flex: 0 1 auto;
    gap: var(--spacing-xs);
    align-items: center;
    min-width: 0;
    max-width: 16rem;
    height: 26px;
    overflow: hidden;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.conversations-chip:hover {
    background: var(--color-surface-subtle);
    color: var(--color-text);
}

.conversations-head__tools {
    display: flex;
    flex: 0 0 auto;
    gap: var(--spacing-sm);
    align-items: center;
    margin-left: auto;
}

/* One kit for the row (Nick 10-14): every tool a fingertip tall, the word
   buttons pills of the same height as the circles, and the menus at the
   popover level so they open over the Details panel (painted after the head
   from 1200px up) and over the lead drawer. */
.conversations-head__tools .global-icon-btn {
    width: var(--control-h-touch);
    height: var(--control-h-touch);
    font-size: var(--font-size-lg);
}

.conversations-head__tools .btn {
    display: inline-flex;
    gap: var(--spacing-xs);
    align-items: center;
    min-height: var(--control-h-touch);
    padding: 0 var(--spacing-md);
    border-radius: var(--radius-pill);
    font-size: var(--font-size-md);
}

.conversations-head__tools .global-action-dropdown-menu {
    z-index: var(--z-popover);
}

/* The name is a button: on a phone a tap on it opens the details. It reads as
   the heading it sits in. */
.conversations-head__name-btn {
    display: block;
    max-width: 100%;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.conversations-head__name-btn:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* What only a phone shows: the owner's initials under the name, More when it
   holds nothing for a computer, and More's rows for the tools a computer
   already has in its row (two classes each: main.css loads later and gives
   the menu's wrapper and its rows a display of their own, so one class here
   lost and a computer got a More button that opened on nothing). */
.conversations-head__owner,
.conversations-head__tools .conversations-head__phone,
.conversations-more .conversations-more__phone {
    display: none;
}

.conversations-assign {
    white-space: nowrap;
}

.conversations-more__divider {
    margin: var(--spacing-xs) 0;
    border-color: var(--color-border-subtle);
    opacity: 1;
}

.conversations-more__back {
    color: var(--color-text-secondary);
}

/* The person's tabs sit under the thread's header. */
.conversations-person-tabs {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    margin: 0;
    padding: 0 var(--spacing-lg);
}

/* In the lead drawer the header is hidden, so Call and Video call sit at the row's end. */
.conversations-person-tabs__tools {
    display: flex;
    flex: 0 0 auto;
    gap: var(--spacing-xs);
    align-items: center;
    margin-left: auto;
}

.conversations-menu {
    min-width: 15rem;
    padding: var(--spacing-xsm);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
}

.conversations-menu__label {
    margin: 0;
    padding: var(--spacing-xs) var(--spacing-sm);
}

.conversations-menu__item {
    gap: var(--spacing-sm);
    align-items: center;
    width: 100%;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    font-size: var(--font-size-sm);
    text-align: left;
}

.conversations-menu__end {
    margin-left: auto;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
}

.conversations-menu__pick {
    display: flex;
    gap: var(--spacing-xsm);
    padding: var(--spacing-xs) var(--spacing-sm) var(--spacing-sm);
}

/* The trash menu on an email conversation: a row with a second line sits its
   icon on the first line, and a footnote closes the menu. */
.conversations-bin .conversations-menu__item {
    align-items: flex-start;
}

.conversations-bin .conversations-menu__item .bi {
    line-height: inherit;
}

.conversations-menu__sub {
    display: block;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
}

.conversations-menu__foot {
    margin: var(--spacing-xs) var(--spacing-sm) var(--spacing-2xs);
    padding-top: var(--spacing-xs);
    border-top: 1px solid var(--color-border-subtle);
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
}

.conversations-body {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
}

.conversations-main {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

/* texts-inbox.js keeps the reader's place as email frames grow; the browser's
   own place-keeping would move the screen a second time. */
.conversations-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-anchor: none;
    overscroll-behavior: contain;
    padding: var(--spacing-md) var(--spacing-lg);
}

/* ── Texts ───────────────────────────────────────────────────────────── */

/* The thread fills the room it has, edge to edge, on every screen. */
.conversations-messages {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.conversations-earlier {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm);
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
}

.conversations-day {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-smd);
}

.conversations-day__label {
    display: flex;
    gap: var(--spacing-smd);
    align-items: center;
    margin: var(--spacing-sm) 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    text-align: center;
}

.conversations-day__label::before,
.conversations-day__label::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: var(--color-border-subtle);
}

.conversations-group {
    display: flex;
    gap: var(--spacing-sm);
    align-items: flex-end;
}

/* Ours sit on the right with the face outside them, the way theirs mirror it. */
.conversations-group--out {
    flex-direction: row-reverse;
}

/* The face lines up with the group's last bubble, above the time under it. */
.conversations-group__face {
    display: flex;
    flex: 0 0 auto;
    margin-bottom: var(--spacing-mdlg);
}

.conversations-group__stack {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    min-width: 0;
    max-width: min(78%, 38rem);
}

.conversations-group--in .conversations-group__stack {
    align-items: flex-start;
}

.conversations-group--out .conversations-group__stack {
    align-items: flex-end;
}

.conversations-group__name {
    margin: 0 var(--spacing-smd) var(--spacing-2xs);
    color: var(--color-text-secondary);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
}

.conversations-group__meta {
    margin: var(--spacing-2xs) var(--spacing-smd) 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-2xs);
    line-height: var(--line-height-accent);
}

/* Where our newest text got to, quiet beside its time. */
.conversations-receipt {
    font-weight: var(--font-weight-medium);
}

.conversations-receipt::before {
    content: "\00b7";
    margin: 0 var(--spacing-xs);
    font-weight: var(--font-weight-body);
}

/* An email card carries its own time, so its receipt stands alone. */
.conversations-group--email .conversations-receipt::before {
    content: none;
}

/* ── Faces ───────────────────────────────────────────────────────────── */

.conversations-face {
    box-shadow: var(--shadow-sm);
}

.conversations-who {
    color: white;
    font-weight: var(--font-weight-heading);
}

.conversations-who--c1 { background: var(--tag-teal); }
.conversations-who--c2 { background: var(--tag-pink); }
.conversations-who--c3 { background: var(--tag-orange); }
.conversations-who--c4 { background: var(--tag-navy); }
.conversations-who--c5 { background: var(--tag-green); }
.conversations-who--c6 { background: var(--tag-brown); }

/* The org stands in for a staff member with no photo, or a text our line sent
   by itself. A logo keeps its whole shape on a white disc. */
img.conversations-face--org {
    object-fit: contain;
    border: 1px solid var(--color-border-subtle);
    background: var(--color-card-bg);
}

.conversations-face--mark {
    background: var(--color-action);
    color: var(--color-neutral-ink-fg);
    font-weight: var(--font-weight-heading);
}

/* ── Bubbles ─────────────────────────────────────────────────────────── */

.conversations-bubble {
    position: relative;
    max-width: 100%;
    padding: var(--spacing-xsm) var(--spacing-smd);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    line-height: var(--line-height-accent);
    overflow-wrap: anywhere;
}

.conversations-group--in .conversations-bubble {
    background: var(--texts-theirs);
    color: var(--texts-theirs-text);
}

.conversations-bubble--imessage {
    background: var(--texts-imessage);
    color: white;
}

.conversations-bubble--sms {
    background: var(--texts-sms);
    color: white;
}

/* Inside a group the bubbles meet on the sender's side with tighter corners. */
.conversations-group--in .conversations-bubble:has(~ .conversations-bubble) {
    border-bottom-left-radius: var(--radius-sm);
}

.conversations-group--in .conversations-bubble ~ .conversations-bubble {
    border-top-left-radius: var(--radius-sm);
}

.conversations-group--out .conversations-bubble:has(~ .conversations-bubble) {
    border-bottom-right-radius: var(--radius-sm);
}

.conversations-group--out .conversations-bubble ~ .conversations-bubble {
    border-top-right-radius: var(--radius-sm);
}

/* The last bubble of a group grows a tail toward its sender, in its own colour. */
.conversations-bubble.is-tail::after {
    content: "";
    position: absolute;
    bottom: 0;
    width: 12px;
    height: 16px;
    background: inherit;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 16'%3E%3Cpath d='M0 0h5c0 8 2 12.5 7 16C7 16.6 3 15.4 0 12.5z'/%3E%3C/svg%3E") no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 16'%3E%3Cpath d='M0 0h5c0 8 2 12.5 7 16C7 16.6 3 15.4 0 12.5z'/%3E%3C/svg%3E") no-repeat;
}

.conversations-group--out .conversations-bubble.is-tail::after {
    right: -6px;
}

.conversations-group--in .conversations-bubble.is-tail::after {
    left: -6px;
    transform: scaleX(-1);
}

.conversations-group--out .conversations-bubble.is-tail {
    border-bottom-right-radius: var(--radius-lg);
}

.conversations-group--in .conversations-bubble.is-tail {
    border-bottom-left-radius: var(--radius-lg);
}

/* A picture fills its bubble edge to edge, so it goes without a tail. */
.conversations-bubble.is-tail:has(.conversations-picture)::after {
    content: none;
}

.conversations-group--out .conversations-bubble--failed {
    background: var(--color-grey-700);
}

/* ── Calls ───────────────────────────────────────────────────────────── */

/* A call is a quiet card in the middle of the timeline, owned by neither side. */
.conversations-call {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    width: min(100%, 26rem);
    margin: var(--spacing-xs) auto;
    padding: var(--spacing-smd);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-card);
    background: var(--color-card-bg);
    box-shadow: var(--shadow-sm);
}

.conversations-call__head {
    display: flex;
    gap: var(--spacing-smd);
    align-items: center;
}

.conversations-call__icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-pill);
    background: var(--color-success-bg);
    color: var(--color-success-text);
    font-size: var(--font-size-sm);
}

.conversations-call--missed .conversations-call__icon {
    background: var(--color-error-subtle);
    color: var(--color-error-text);
}

.conversations-call__what {
    min-width: 0;
}

.conversations-call__title {
    display: flex;
    gap: var(--spacing-sm);
    align-items: baseline;
    margin: 0;
    color: var(--color-text);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-heading);
}

.conversations-call--missed .conversations-call__title {
    color: var(--color-error-text);
}

.conversations-call__length {
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-body);
    font-variant-numeric: tabular-nums;
}

.conversations-call__meta {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-2xs);
}

.conversations-call__meta > * + *::before {
    content: "\00b7";
    margin: 0 var(--spacing-xs);
}

.conversations-call__recording {
    display: block;
    width: 100%;
    height: 2.25rem;
}

.conversations-call--video .conversations-call__icon {
    background: var(--color-action-tint);
    color: var(--color-action);
}

.conversations-call--listed {
    margin: 0;
}

.conversations-call__join {
    flex: 0 0 auto;
    margin-left: auto;
}

.conversations-call__summary {
    margin: 0;
    color: var(--color-text);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-accent);
    overflow-wrap: anywhere;
}

.conversations-call__video {
    display: block;
    width: 100%;
    border-radius: var(--radius-sm);
    background: var(--color-text);
}

.conversations-call__parts {
    margin-top: var(--spacing-2xs);
}

/* A recording that would not load after every try: said plainly, with Try again. */
.conversations-call__trouble {
    margin: var(--spacing-2xs) 0 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.conversations-call__again {
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-primary);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.conversations-call__more {
    border-top: 1px solid var(--color-border-subtle);
    padding-top: var(--spacing-xsm);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-accent);
}

.conversations-call__more > summary {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
    color: var(--color-text);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    list-style: none;
    cursor: pointer;
}

.conversations-call__more > summary::-webkit-details-marker {
    display: none;
}

.conversations-call__more > summary .bi {
    margin-left: auto;
    color: var(--color-text-secondary);
    font-size: var(--font-size-2xs);
    transition: transform var(--transition-fast);
}

.conversations-call__more[open] > summary .bi {
    transform: rotate(180deg);
}

.conversations-call__more > summary:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.conversations-call__more p {
    margin: var(--spacing-xsm) 0 0;
    max-height: 18rem;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    overflow-wrap: anywhere;
}

/* A text that just came in or went out rises into place. */
.conversations-bubble.is-arriving {
    animation: conversations-arrive 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.conversations-group--out .conversations-bubble.is-arriving {
    transform-origin: bottom right;
}

.conversations-group--in .conversations-bubble.is-arriving {
    transform-origin: bottom left;
}

@keyframes conversations-arrive {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .conversations-bubble.is-arriving {
        animation: none;
    }
}

.conversations-bubble__body {
    margin: 0;
}

/* A link in a text keeps the bubble's colour, underlined the way iMessage shows it. */
.conversations-bubble__body a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.conversations-bubble:has(.conversations-picture) {
    padding: var(--spacing-2xs);
}

.conversations-bubble:has(.conversations-picture) .conversations-bubble__body {
    padding: var(--spacing-xsm) var(--spacing-sm) var(--spacing-xs);
}

.conversations-picture {
    display: block;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.conversations-picture + .conversations-picture {
    margin-top: var(--spacing-2xs);
}

/* A picture holds a square box from the start, so the thread does not grow
   under the reader as pictures load. The tap opens it whole. */
.conversations-picture img {
    display: block;
    width: 16rem;
    max-width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--color-grey-100);
}

.conversations-file {
    display: inline-flex;
    gap: var(--spacing-xs);
    align-items: center;
    color: inherit;
    font-size: var(--font-size-sm);
    text-decoration: underline;
}

.conversations-file:hover {
    color: inherit;
}

/* ── Email cards ─────────────────────────────────────────────────────
   An email reads as a card in the same timeline as the bubbles, on the
   sender's side: the person's on the left, ours on the right. Every card is
   the same plain white, so the only strong blue on the screen is a text
   bubble. A card spans the thread, so a wide desktop shows the whole email. */

.conversations-group--email .conversations-group__stack {
    width: 100%;
    max-width: none;
}

.conversations-email {
    width: 100%;
    padding: var(--spacing-smd) var(--spacing-md) var(--spacing-md);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    background: var(--color-card-bg);
    box-shadow: var(--shadow-sm);
    color: var(--color-text);
    font-size: var(--font-size-base);
    line-height: var(--line-height-body);
    overflow-wrap: anywhere;
}

/* A folded email is one line: who, their first words, and when. Its top
   line keeps the 44px tap height, so the card needs no padding of its own. */
.conversations-email:not([data-open]) {
    padding-block: 0;
}

.conversations-email:not([data-open]) .conversations-email__content,
.conversations-email:not([data-open]) .conversations-email__address {
    display: none;
}

.conversations-group--in .conversations-email:last-of-type {
    border-bottom-left-radius: var(--radius-sm);
}

.conversations-group--out .conversations-email:last-of-type {
    border-bottom-right-radius: var(--radius-sm);
}

.conversations-email--failed {
    border-color: var(--color-error-border);
    background: var(--color-error-subtle);
}

.conversations-email__head {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    min-width: 0;
}

/* The whole top line opens and folds the email. */
.conversations-email__toggle {
    display: flex;
    flex: 1 1 auto;
    gap: var(--spacing-smd);
    align-items: center;
    min-width: 0;
    min-height: var(--control-h-touch);
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    /* Whatever does not fit is cut here, never drawn over the trash button. */
    overflow: hidden;
}

.conversations-email__preview {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    color: var(--color-text-secondary);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* An open card's words are below, so its top line drops the preview. */
.conversations-email[data-open] .conversations-email__preview {
    display: none;
}

/* The name keeps the left and the mark and time the right, preview or not. */
.conversations-email__from {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    gap: 0 var(--spacing-xsm);
    align-items: baseline;
    min-width: 0;
    max-width: 100%;
    margin: 0 auto 0 0;
}

/* A name stays on one line, cut short only when the card is narrower than it. */
.conversations-email__name {
    flex-shrink: 0;
    max-width: 100%;
    overflow: hidden;
    font-weight: var(--font-weight-heading);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A folded card with files says so before its time. */
.conversations-email__clip {
    flex: 0 0 auto;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
}

.conversations-email[data-open] .conversations-email__clip {
    display: none;
}

.conversations-email__address {
    min-width: 0;
    overflow: hidden;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversations-email__when {
    flex: 0 0 auto;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    white-space: nowrap;
}

/* On an email we sent, once it is opened: one quiet mark beside the time,
   its counts and links in the tooltip. */
.conversations-email__looks {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A squeezed folded card (the reply or a drawer open beside it, or a phone)
   keeps the mark and shortens its first words instead. */
.conversations-email:not([data-open]) .conversations-email__looks {
    flex-shrink: 0;
}

.conversations-email__forwarded {
    margin: var(--spacing-2xs) 0 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
}

/* The subject shows on the first email and where it changes. */
.conversations-email__subject {
    margin: var(--spacing-2xs) 0 0;
    color: var(--color-text);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-body);
}

/* The quoted old email folds behind three dots, the way Gmail does it. */
.conversations-email__body,
.conversations-email__quote {
    margin-top: var(--spacing-sm);
}

.conversations-email__body a {
    color: var(--color-action);
}

/* On a card the quoted old email is behind words, so it is easy to find. */
.conversations-email__more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--control-h-sm);
    padding: 0 var(--spacing-sm);
    border-radius: var(--radius-sm);
    color: var(--color-action);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    line-height: 1;
    list-style: none;
    cursor: pointer;
}

.conversations-email__more::-webkit-details-marker {
    display: none;
}

.conversations-email__more:hover {
    background: var(--color-surface-hover);
}

.conversations-email__quote[open] .conversations-email__more-show,
.conversations-email__quote:not([open]) .conversations-email__more-hide {
    display: none;
}

.conversations-email__quoted {
    margin-top: var(--spacing-sm);
    padding-left: var(--spacing-smd);
    border-left: 2px solid var(--color-border);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

/* An email in the sender's own look: its own page in a locked frame, clear
   so the card shows through it, grown to fit by the Inbox script. */
.conversations-email__page {
    margin-top: var(--spacing-sm);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.conversations-email__frame {
    display: block;
    width: 100%;
    min-height: 120px;
    border: 0;
    background: transparent;
}

.conversations-email__whole {
    display: block;
    width: 100%;
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 0;
    border-top: 1px solid var(--color-border-subtle);
    background: var(--color-surface-subtle);
    color: var(--color-action);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
}

.conversations-email__whole:hover {
    background: var(--color-surface-hover);
}

.conversations-email__whole[hidden] {
    display: none;
}

/* The delete and unsubscribe tools: quiet in the card's top line, and a foot
   for what happened (unsubscribed, still in Gmail) with its next step. */
.conversations-email__tools {
    display: inline-flex;
    flex: 0 0 auto;
    gap: var(--spacing-2xs);
    align-items: center;
    align-self: center;
}

/* A tool button and an attached file wear the same pill chip. */
.conversations-email__tool,
.conversations-email__file {
    display: inline-flex;
    gap: var(--spacing-xs);
    align-items: center;
    padding: var(--spacing-2xs) var(--spacing-sm);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-pill);
    background: var(--color-surface-subtle);
    font-size: var(--font-size-xs);
    text-decoration: none;
}

.conversations-email__tool:hover,
.conversations-email__file:hover {
    border-color: var(--color-border);
    background: var(--color-surface-hover);
    color: var(--color-text);
}

.conversations-email__tool {
    color: var(--color-text-secondary);
    line-height: var(--line-height-subheading);
    white-space: nowrap;
    cursor: pointer;
}

.conversations-email__tool:disabled {
    opacity: 0.6;
    cursor: default;
}

.conversations-email__foot {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs) var(--spacing-sm);
    align-items: center;
    margin-top: var(--spacing-smd);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--color-border-subtle);
    font-size: var(--font-size-xs);
}

.conversations-email__done,
.conversations-email__stuck {
    display: inline-flex;
    gap: var(--spacing-xs);
    align-items: center;
    margin-right: auto;
    font-weight: var(--font-weight-medium);
}

.conversations-email__done {
    color: var(--color-success-text);
}

/* Unsubscribe is a pill on a computer and a row of the menu on a phone. The
   menu button's icons name the button too, to beat main.css's icon-button
   glyph rule, which loads after this sheet. */
.conversations-menu .conversations-menu__item--unsub,
.conversations-email__tools .global-icon-btn .conversations-email__menu-more {
    display: none;
}

.conversations-email__stuck {
    color: var(--color-error-text);
}

.conversations-deleted-note {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: var(--spacing-smd) var(--spacing-md);
    border-top: 1px solid var(--color-border-subtle);
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
}

/* Every email on an open thread deleted: Restore where the timeline was, and no reply box. */
.conversations-all-deleted {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: var(--spacing-xl);
}

.conversations-main:has([data-all-deleted]) .conversations-composer,
.conversations-main:has([data-all-deleted]) .conversations-ways {
    display: none;
}

.conversations-email__files {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin: var(--spacing-smd) 0 0;
    padding: 0;
    list-style: none;
}

.conversations-email__files > li {
    min-width: 0;
    max-width: 100%;
}

.conversations-email__file {
    max-width: 100%;
    color: var(--color-text);
}

.conversations-email__file-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversations-email__file-size {
    color: var(--color-text-secondary);
    white-space: nowrap;
}

/* A file we sent that is not a picture or video: a card that downloads. */
.conversations-file--card {
    gap: var(--spacing-smd);
    min-width: 12rem;
    max-width: 16rem;
    padding: var(--spacing-xs) var(--spacing-2xs);
    font-size: var(--font-size-sm);
    text-decoration: none;
}

.conversations-file--card > .bi:first-child {
    font-size: var(--font-size-xl);
}

.conversations-file__name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    font-weight: var(--font-weight-medium);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversations-file__get {
    opacity: 0.8;
}

.conversations-video {
    display: block;
    width: 100%;
    max-width: 16rem;
    max-height: 20rem;
    border-radius: var(--radius-lg);
    background: black;
}

.conversations-bubble:has(.conversations-video) {
    padding: var(--spacing-2xs);
}

.conversations-bubble.is-tail:has(.conversations-video)::after {
    content: none;
}

/* A voice memo or other sound texted to us plays in place. */
.conversations-audio {
    display: block;
    width: 16rem;
    max-width: 100%;
}

.conversations-audio + .conversations-file,
.conversations-picture + .conversations-file {
    margin-top: var(--spacing-2xs);
}

/* "Sent with Slam" under our text, the way iMessage says it. */
.conversations-effect {
    margin: 0 var(--spacing-xs);
    color: var(--color-text-secondary);
    font-size: var(--font-size-2xs);
}

/* ── Tapbacks ────────────────────────────────────────────────────────── */

/* Our tapback sits on the top right corner of their text, ringed in the page. */
.conversations-bubble--tapback {
    margin-top: var(--spacing-smd);
}

.conversations-tapback {
    position: absolute;
    top: -14px;
    right: -12px;
    z-index: var(--z-raised);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 var(--spacing-xs);
    border: 2px solid var(--color-card-bg);
    border-radius: var(--radius-pill);
    background: var(--texts-imessage);
    color: white;
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-heading);
    letter-spacing: -0.02em;
    line-height: 1;
}

.conversations-tapback .bi {
    font-size: var(--font-size-xs);
}

/* Someone else's tapbacks hang off the top left corner of the text they react to,
   mostly outside it, so a wide mark like HA HA never covers the words. */
.conversations-bubble:has(> .conversations-their-tapbacks) {
    margin-top: var(--spacing-smd);
}

.conversations-their-tapbacks {
    position: absolute;
    top: -14px;
    right: calc(100% - 12px);
    z-index: var(--z-raised);
    display: inline-flex;
    gap: var(--spacing-2xs);
    white-space: nowrap;
}

.conversations-names-preview {
    margin-top: var(--spacing-md);
}

.conversations-tapback--theirs {
    position: static;
    background: var(--texts-theirs);
    color: var(--texts-theirs-text);
}

/* The smile beside their text that opens the six tapbacks; always there on touch. */
.conversations-react {
    position: absolute;
    top: 50%;
    left: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: var(--spacing-xs);
    padding: 0;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-text-secondary);
    font-size: var(--font-size-md);
    opacity: 0;
    transform: translateY(-50%);
    transition: opacity var(--transition-fast), background var(--transition-fast);
}

.conversations-bubble:hover .conversations-react,
.conversations-react:focus-visible,
.conversations-react[aria-expanded="true"] {
    opacity: 1;
}

.conversations-react:hover {
    background: var(--color-surface-subtle);
    color: var(--color-text);
}

@media (hover: none) {
    .conversations-react {
        opacity: 1;
    }
}

.conversations-tapbacks {
    position: absolute;
    bottom: calc(100% + var(--spacing-xs));
    left: 0;
    z-index: var(--z-dropdown);
    display: flex;
    gap: var(--spacing-2xs);
    padding: var(--spacing-2xs);
    border-radius: var(--radius-pill);
    background: var(--color-card-bg);
    box-shadow: var(--shadow-md);
}

.conversations-tapbacks__pick {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 var(--spacing-xs);
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-text-secondary);
    white-space: nowrap;
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-heading);
    letter-spacing: -0.02em;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.conversations-tapbacks__pick .bi {
    font-size: var(--font-size-md);
}

.conversations-tapbacks__pick:hover {
    background: var(--color-surface-subtle);
    transform: scale(1.12);
}

.conversations-tapbacks__pick.is-on {
    background: var(--texts-imessage);
    color: white;
}

/* ── Their typing bubble ─────────────────────────────────────────────── */

/* Hidden while nobody types. The first drawing leaves a line break in the slot
   and a morph drops it, so :empty alone made the texts jump on the first read. */
.conversations-typing-slot:not(:has(*)) {
    display: none;
}

.conversations-typing-slot {
    margin-top: var(--spacing-md);
}

/* An empty face keeps the bubble in line with their texts above it. */
.conversations-typing .conversations-group__face {
    width: 32px;
    margin-bottom: 0;
}

.conversations-typing__bubble {
    display: inline-flex;
    gap: var(--spacing-xs);
    align-items: center;
    padding: var(--spacing-smd);
}

.conversations-typing__dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-pill);
    background: var(--color-grey-500);
    animation: conversations-typing 1.2s infinite ease-in-out;
}

.conversations-typing__dot:nth-child(2) {
    animation-delay: 0.15s;
}

.conversations-typing__dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes conversations-typing {
    0%,
    60%,
    100% {
        opacity: 0.35;
        transform: none;
    }

    30% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .conversations-typing__dot {
        animation: none;
        opacity: 0.6;
    }
}

.conversations-typing + .conversations-typing {
    margin-top: var(--spacing-sm);
}

.conversations-typing--team {
    width: fit-content;
    margin-left: auto;
}

.conversations-typing--team .conversations-group__face {
    width: auto;
}

.conversations-typing__bubble--team {
    background: color-mix(in srgb, var(--texts-imessage) 16%, var(--color-card-bg));
}

.conversations-typing__bubble--team .conversations-typing__dot {
    background: var(--texts-imessage);
}

/* A text or email that did not go: a short red label, its reason one tap away. */
.conversations-failed {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    align-items: flex-end;
    margin: 0 var(--spacing-xs);
    color: var(--color-error-text);
    font-size: var(--font-size-2xs);
}

.conversations-failed__head {
    display: inline-flex;
    gap: var(--spacing-xs);
    align-items: center;
}

summary.conversations-failed__head {
    cursor: pointer;
    list-style: none;
}

summary.conversations-failed__head::-webkit-details-marker {
    display: none;
}

.conversations-failed__label {
    font-weight: var(--font-weight-medium);
}

.conversations-failed__more {
    transition: transform var(--transition-fast);
}

.conversations-failed[open] .conversations-failed__more {
    transform: rotate(180deg);
}

.conversations-failed__why {
    max-width: 22rem;
    margin: 0;
    color: var(--color-text-secondary);
    text-align: right;
}

/* An email that did not go: why, on one line under the card, and Try again. */
.conversations-failed--email {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--spacing-xs) var(--spacing-sm);
    align-items: center;
    justify-content: flex-end;
    font-size: var(--font-size-xs);
}

.conversations-failed--email .conversations-failed__why {
    max-width: none;
}

.conversations-failed__again {
    min-height: var(--control-h-sm);
    padding: 0 var(--spacing-smd);
    border: 1px solid var(--color-error-border);
    border-radius: var(--radius-pill);
    background: var(--color-card-bg);
    color: var(--color-error-text);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
    cursor: pointer;
}

.conversations-failed__again:hover {
    background: var(--color-error-subtle);
}

/* A text that did not go: its label, then Try again, on one line at the right. A narrow phone wraps it. */
.conversations-failed-line {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs) var(--spacing-sm);
    align-items: baseline;
    justify-content: flex-end;
    margin: 0 var(--spacing-xs);
}

.conversations-failed-line .conversations-failed {
    margin: 0;
}

.conversations-pill {
    position: absolute;
    bottom: 120px;
    left: 50%;
    z-index: var(--z-raised);
    display: inline-flex;
    gap: var(--spacing-xs);
    align-items: center;
    min-height: var(--control-h-touch);
    padding: var(--spacing-xsm) var(--spacing-md);
    border: 0;
    border-radius: var(--radius-pill);
    background: black;
    box-shadow: var(--shadow-md);
    color: white;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    transform: translateX(-50%);
}

/* Over an email thread the pill sits just above the slim Reply bar. */
.conversations-main:has(.conversations-reply-bar) .conversations-pill {
    bottom: 80px;
}

.conversations-pill[hidden] {
    display: none;
}

/* ── The composer ────────────────────────────────────────────────────── */

.conversations-composer {
    flex: 0 0 auto;
    padding: var(--spacing-sm) var(--spacing-lg) var(--spacing-smd);
}

/* On a wide screen the reply box stops at 80rem and stays on the left, under
   the messages it answers. The reply box holds its side room inside, so it
   gets that room on top to line up with the rest. */
.conversations-reply-bar {
    max-width: 80rem;
}

.conversations-thread .conversations-composer {
    max-width: calc(80rem + 2 * var(--spacing-lg));
}

/* Which way a reply goes, over the reply box, when the person has more than one. */
.conversations-ways {
    flex: 0 0 auto;
    padding: var(--spacing-sm) var(--spacing-lg) 0;
}

.conversations-ways__pick {
    display: flex;
    width: fit-content;
}

.conversations-ways__pick .global-segmented__btn {
    gap: var(--spacing-xs);
    padding-inline: var(--spacing-sm);
    font-size: var(--font-size-xs);
}

.conversations-composer__box {
    display: flex;
    gap: var(--spacing-sm);
    align-items: flex-end;
    padding: var(--spacing-xsm) var(--spacing-xsm) var(--spacing-xsm) var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-card-bg);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.conversations-composer__box:focus-within {
    border-color: var(--color-grey-400);
    box-shadow: var(--shadow-sm);
}

/* The box shows the words' focus as a whole; Send and add-a-photo ring for the
   keyboard. The file box is hidden, so its button wears the ring. */
.conversations-send:focus-visible,
.conversations-composer__box:has([data-texts-file]:focus-visible) .conversations-composer__tool {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

.conversations-composer__input {
    flex: 1 1 auto;
    min-width: 0;
    max-height: 12rem;
    padding: var(--spacing-xsm) 0;
    border: 0;
    background: transparent;
    color: var(--color-text);
    font-size: var(--font-size-base);
    line-height: var(--line-height-accent);
    outline: none;
    resize: none;
}

/* The box rings as a whole, so the words and the subject inside it do not
   draw the site's ring over its edge. */
.conversations-composer__input:focus-visible,
.conversations-composer__subject:focus-visible {
    outline: none;
}

.conversations-composer__input:disabled {
    background: transparent;
    cursor: not-allowed;
}

.conversations-send {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-pill);
    background: black;
    color: white;
    font-size: var(--font-size-base);
}

.conversations-send:disabled {
    background: var(--color-grey-300);
    cursor: not-allowed;
}

/* Once Sendblue says which, the send button is iMessage blue or SMS green. */
[data-service="imessage"] .conversations-send:not(:disabled) {
    background: var(--texts-imessage);
}

[data-service="sms"] .conversations-send:not(:disabled) {
    background: var(--texts-sms);
}

/* The plus (a photo or file) and the stars (an iMessage effect) in the box. */
.conversations-composer__tool {
    display: inline-flex;
    flex: 0 0 auto;
    gap: var(--spacing-2xs);
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    margin: 0;
    padding: 0 var(--spacing-xs);
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-text-secondary);
    font-size: var(--font-size-lg);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.conversations-composer__tool:hover {
    background: var(--color-surface-subtle);
    color: var(--color-text);
}

.conversations-composer__tool.is-off {
    opacity: 0.4;
    pointer-events: none;
}

.conversations-composer__box:has(.conversations-composer__tool) {
    padding-left: var(--spacing-xsm);
}

/* Quick replies (ADR-218): the lightning button's menu opens above the box,
   and a quick reply's texts stack in the box, each its own box with an x. */
.conversations-composer__box:has(.conversations-quick) {
    position: relative;
}

.conversations-composer__tool.is-on {
    background: var(--color-surface-subtle);
    color: var(--color-text);
}

.conversations-quick {
    position: absolute;
    bottom: calc(100% + var(--spacing-xs));
    left: 0;
    width: min(30rem, 100%);
    max-height: 30rem;
    overflow: auto;
    overscroll-behavior: contain;
}

.conversations-quick__row {
    align-items: flex-start;
}

@media (max-width: 767.98px) {
    .conversations-quick {
        max-height: calc(var(--quick-reply-space, 100%) - var(--spacing-xs));
    }

    .conversations-quick > .global-menu__search {
        position: sticky;
        top: 0;
        background: var(--color-card-bg);
        z-index: var(--z-sticky);
    }
}

.conversations-quick__words {
    flex: 1 1 auto;
    min-width: 0;
}

.conversations-quick__name {
    display: block;
    font-weight: var(--font-weight-heading);
}

.conversations-quick__first {
    display: block;
    overflow: hidden;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversations-quick__count {
    flex: 0 0 auto;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    white-space: nowrap;
}

.conversations-quick__empty {
    margin: 0;
    padding: var(--spacing-xsm) var(--spacing-sm);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.conversations-composer__texts {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.conversations-composer__more {
    display: flex;
    gap: var(--spacing-xs);
    align-items: flex-start;
    border-top: 1px dashed var(--color-border);
}

.conversations-composer__more .global-icon-btn {
    margin-top: var(--spacing-xs);
}

.conversations-composer[data-texts-confirmation] .conversations-composer__box {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: var(--spacing-xs);
    align-items: center;
    padding: 0 var(--spacing-xsm) var(--spacing-xsm);
}

[data-texts-confirmation] .conversations-composer__texts {
    grid-column: 1 / -1;
    grid-row: 1;
}

[data-texts-confirmation] .conversations-composer__tool {
    grid-row: 2;
}

.conversations-composer__part {
    display: flex;
    margin-inline: calc(var(--spacing-md) - var(--spacing-xsm));
}

.conversations-composer__part:not([hidden]) ~ .conversations-composer__part {
    border-top: 1px solid var(--color-border);
}

.conversations-composer__part[hidden],
.conversations-composer__input[hidden] {
    display: none;
}

.conversations-composer__part .conversations-composer__input {
    width: 100%;
    min-height: var(--control-h-touch);
    padding-block: var(--spacing-smd);
}

.conversations-composer__part .conversations-composer__input:focus-visible {
    border-radius: var(--radius-sm);
    outline: var(--spacing-2xs) solid var(--color-focus-ring);
    outline-offset: var(--spacing-2xs);
}

[data-texts-confirmation] .conversations-send {
    grid-column: -2 / -1;
    grid-row: 2;
    gap: var(--spacing-xs);
    width: auto;
    min-height: var(--control-h-touch);
    padding-inline: var(--spacing-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-heading);
}

/* A picked file, above the box until it goes or is taken off. */
.conversations-composer__file {
    margin-bottom: var(--spacing-xs);
}

.conversations-composer__file-pill {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
    width: fit-content;
    max-width: min(100%, 24rem);
    padding: var(--spacing-2xs) var(--spacing-2xs) var(--spacing-2xs) var(--spacing-sm);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-pill);
    background: var(--color-surface-subtle);
    font-size: var(--font-size-xs);
}

.conversations-composer__file[hidden] {
    display: none;
}

.conversations-composer__file-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversations-composer__note {
    display: flex;
    gap: var(--spacing-xsm);
    align-items: center;
    margin: 0 0 var(--spacing-sm);
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
}

/* A send that did not go: the reason in the error colour, and Try again. */
.conversations-composer__note--failed {
    flex-wrap: wrap;
    color: var(--color-error-text);
}

.conversations-composer__again {
    min-height: var(--control-h-touch);
    padding: 0 var(--spacing-xs);
    border: 0;
    background: none;
    color: var(--color-primary);
    font: inherit;
    font-weight: var(--font-weight-medium);
    text-decoration: underline;
    cursor: pointer;
}

.conversations-composer.is-blocked .conversations-composer__box {
    background: var(--color-surface-subtle);
}

/* An email reply: the subject on its own line, room to write, the quote
   folded under the words, and Send at the foot. */
.conversations-composer__box--email {
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    padding: 0;
}

.conversations-composer__line {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    padding: var(--spacing-xsm) var(--spacing-md);
    border-bottom: 1px solid var(--color-border-subtle);
}

.conversations-composer__tag {
    flex: 0 0 auto;
    margin: 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
}

.conversations-composer__to {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: var(--color-text);
    font-size: var(--font-size-sm);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A reply's To and Cc lines: chips and a find box, the matches just under. */
.conversations-to__search.conversations-reply-people__search {
    min-width: 8rem;
    min-height: auto;
    font-size: var(--font-size-sm);
}

.conversations-reply-people__found {
    border-bottom: 1px solid var(--color-border-subtle);
}

.conversations-reply-people__keep {
    gap: var(--spacing-xs);
    color: var(--color-text);
    font-size: var(--font-size-sm);
    cursor: pointer;
}

.conversations-reply-people__keep .form-check-input {
    margin: 0;
}

.conversations-composer__subject {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--color-text);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    outline: none;
}

.conversations-composer__input--email {
    max-height: none;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-base);
    line-height: var(--line-height-body);
}

/* The email being answered stays folded behind a plain "Show quoted email". */
.conversations-email-quote {
    margin: 0 var(--spacing-md) var(--spacing-xs);
}

.conversations-email-quote__show {
    display: inline-flex;
    align-items: center;
    min-height: var(--control-h-sm);
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    list-style: none;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.conversations-email-quote__show::-webkit-details-marker {
    display: none;
}

.conversations-email-quote__show:hover {
    color: var(--color-text);
    text-decoration: underline;
}

.conversations-email-quote .conversations-email__quoted {
    max-height: 10rem;
    overflow-y: auto;
    overscroll-behavior-y: contain;
}

/* The signature an email goes out with, under the words, with an x to leave it off. */
.conversations-signature-preview {
    margin: 0 var(--spacing-md) var(--spacing-xs);
}

.conversations-signature-preview[hidden],
.conversations-signature-preview [hidden] {
    display: none;
}

.conversations-signature-preview__card {
    display: flex;
    gap: var(--spacing-sm);
    align-items: flex-start;
    padding: var(--spacing-xsm) 0 0;
    border-top: 1px dashed var(--color-border);
}

.conversations-signature-preview__shown {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    overflow-wrap: anywhere;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    line-height: var(--line-height-body);
}

.conversations-signature-preview__shown img {
    max-width: 100%;
}

/* A logo with no size of its own goes out 64px tall, so it shows that way here. */
.conversations-signature-preview__shown img:not([width]):not([height]):not([style*="width"]):not([style*="height"]) {
    width: auto;
    height: 64px;
}

.conversations-signature-preview__remove,
.conversations-signature-preview__add {
    display: inline-flex;
    gap: var(--spacing-2xs);
    align-items: center;
    padding: var(--spacing-2xs) var(--spacing-xs);
    border: 0;
    border-radius: var(--radius-pill);
    background: none;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.conversations-signature-preview__remove:hover,
.conversations-signature-preview__add:hover {
    background: var(--color-surface-subtle);
    color: var(--color-text);
}

/* An email's foot, as in a text's box: the plus for a file, the picked file,
   and the round Send at the right. */
.conversations-composer__foot {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-xsm);
}

.conversations-composer__foot .conversations-composer__file {
    min-width: 0;
    margin: 0;
}

.conversations-composer__foot .conversations-send {
    margin-left: auto;
}

.conversations-composer__foot:has([data-texts-file]:focus-visible) .conversations-composer__tool {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

/* ── Who the person is ───────────────────────────────────────────────── */

.conversations-context {
    display: flex;
    flex: 0 0 18rem;
    flex-direction: column;
    gap: var(--spacing-sm);
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding: var(--spacing-lg) var(--spacing-mdlg);
    border-left: 1px solid var(--color-border-subtle);
    background: var(--color-card-bg);
}

.conversations-app.is-context-off .conversations-context {
    display: none;
}

/* Between 1200px and 1680px the panel starts shut, so the messages get the
   room; it opens when someone asks (texts-inbox.js keeps the pick). */
@media (min-width: 1200px) and (max-width: 1679.98px) {
    .conversations-app:not(.is-context-on) .conversations-context {
        display: none;
    }
}

/* ── The email reply: a slim bar, then a panel beside the emails ─────── */

.conversations-reply-bar {
    display: flex;
    flex: 0 0 auto;
    gap: var(--spacing-sm);
    align-items: center;
    min-height: var(--control-h-touch);
    margin: var(--spacing-sm) var(--spacing-lg) var(--spacing-smd);
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-card-bg);
    color: var(--color-text-secondary);
    font-size: var(--font-size-base);
    text-align: left;
    cursor: text;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.conversations-reply-bar:hover {
    border-color: var(--color-grey-400);
    box-shadow: var(--shadow-sm);
}

.conversations-thread.is-replying .conversations-reply-bar {
    display: none;
}

.conversations-reply-panel {
    display: none;
    flex: 0 0 min(30rem, 40%);
    flex-direction: column;
    min-height: 0;
    border-left: 1px solid var(--color-border-subtle);
    background: var(--color-card-bg);
}

.conversations-thread.is-replying .conversations-reply-panel {
    display: flex;
}

/* While a reply is open it takes the contact card's place beside the emails. */
.conversations-thread.is-replying .conversations-context {
    display: none;
}

.conversations-reply-panel__head {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-sm) var(--spacing-lg);
    border-bottom: 1px solid var(--color-border-subtle);
}

.conversations-reply-panel__title {
    margin: 0;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-heading);
}

.conversations-reply-panel .conversations-composer {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding: var(--spacing-md) var(--spacing-lg);
}

.conversations-reply-panel .conversations-composer__box--email {
    flex: 1 0 auto;
}

.conversations-reply-panel .conversations-composer__input--email {
    flex: 1 0 auto;
    min-height: 12rem;
}

/* Only shown where the panel covers the thread (under 1200px). */
.conversations-context .conversations-context__close {
    display: none;
}

/* The tab row of the lead drawer's card side (ADR-205), here beside the thread. */
.conversations-context__tabs {
    flex: 0 0 auto;
    margin-bottom: 0;
}

.conversations-context .global-drawer__section:last-child {
    border-bottom: 0;
}

.conversations-context__who {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xsm);
    align-items: center;
    margin-bottom: var(--spacing-sm);
    text-align: center;
}

.conversations-context__name {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-heading);
}

.conversations-facts {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--spacing-sm) var(--spacing-smd);
    margin: 0;
    font-size: var(--font-size-sm);
}

.conversations-facts dt {
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-body);
}

.conversations-facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.conversations-facts a {
    color: inherit;
}

.conversations-context__open {
    align-self: flex-start;
    margin-top: var(--spacing-xs);
}

.conversations-context__label {
    margin: var(--spacing-md) 0 0;
}

.conversations-booking {
    display: flex;
    gap: var(--spacing-smd);
    align-items: flex-start;
    padding: var(--spacing-smd);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    color: var(--color-text);
    text-decoration: none;
    transition: background var(--transition-fast);
}

.conversations-booking:hover {
    background: var(--color-surface-subtle);
    color: var(--color-text);
}

.conversations-booking__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.conversations-booking__title {
    overflow: hidden;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversations-booking__when {
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
}

.conversations-context__people {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin: 0;
    padding: 0;
    font-size: var(--font-size-sm);
    list-style: none;
}

/* Who is on a group, with its name and people changed in place. */
.conversations-context__row {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
    justify-content: space-between;
    margin-top: var(--spacing-md);
}

.conversations-context__row .conversations-context__label {
    margin: 0;
}

.conversations-group-people {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.conversations-inline-form {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
}

.conversations-members {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin: 0;
    padding: 0;
    list-style: none;
}

.conversations-member {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    font-size: var(--font-size-sm);
}

.conversations-member__who {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    line-height: var(--line-height-accent);
}

.conversations-member__who .conversations-muted {
    font-size: var(--font-size-xs);
}

.conversations-member__name {
    overflow: hidden;
    font-weight: var(--font-weight-medium);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversations-member__out {
    color: var(--color-text-secondary);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.conversations-member:hover .conversations-member__out,
.conversations-member__out:focus-visible {
    opacity: 1;
}

@media (hover: none) {
    .conversations-member__out {
        opacity: 1;
    }
}

.conversations-member__add {
    align-self: flex-start;
    padding-inline: 0;
    text-decoration: none;
}

/* ── New text ────────────────────────────────────────────────────────── */

.conversations-new {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    width: 100%;
    max-width: 36rem;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-lg);
}

.conversations-new__title {
    margin: 0;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-heading);
}

/* ── New conversation: who it goes to (ADR-185) ─────────────────────── */

.conversations-to {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.conversations-to__line {
    display: flex;
    gap: var(--spacing-sm);
    align-items: flex-start;
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-card-bg);
}

.conversations-to__line:focus-within {
    box-shadow: var(--shadow-focus-ring);
}

/* As tall as the search's first row, so "To" sits level with what is typed. */
.conversations-to__label {
    line-height: var(--control-h-touch);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.conversations-to__chips {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    min-width: 0;
}

.conversations-to__chips > .global-page-search {
    flex: 1 1 calc(var(--page-search-w) / 2);
    min-width: 0;
}

.conversations-to__chips > .global-page-search .global-filter-control {
    min-width: 0;
}

.conversations-to__search {
    flex: 1;
    min-width: 10rem;
    min-height: var(--control-h-touch);
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--color-text);
    font-size: var(--font-size-md);
}

/* The line shows focus as a whole, so its search draws no ring of its own. */
.conversations-to__search:focus-visible {
    outline: none;
}

.conversations-to__hint {
    margin: 0;
    font-size: var(--font-size-sm);
}

.conversations-to__email {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.conversations-chip {
    display: inline-flex;
    gap: var(--spacing-xs);
    align-items: center;
    max-width: 100%;
}

.conversations-chip__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversations-chip__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-text-secondary);
}

.conversations-chip__remove:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

.conversations-people {
    display: flex;
    flex-direction: column;
}

.conversations-people:empty {
    display: none;
}

.conversations-group-add {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.conversations-group-add__found {
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    max-height: 16rem;
    overflow-y: auto;
    overscroll-behavior-y: contain;
}

.conversations-person-choice {
    display: flex;
    gap: var(--spacing-smd);
    align-items: center;
    width: 100%;
    min-height: var(--control-h-touch);
    padding: var(--spacing-sm) var(--spacing-smd);
    border: 0;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-text);
    text-align: left;
    transition: background var(--transition-fast);
}

.conversations-person-choice:hover,
.conversations-person-choice:focus-visible {
    background: var(--color-surface-subtle);
}

.conversations-person-choice > .bi {
    color: var(--color-text-secondary);
}

.conversations-person-choice__text {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.conversations-person-choice__name {
    font-weight: var(--font-weight-medium);
}

.conversations-person-choice__detail {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

/* The badge naming a teammate keeps its size beside a long name. */
.conversations-person-choice__tag {
    flex-shrink: 0;
}

/* Text or Email on a new conversation; the reply box's own switch is .conversations-ways. */
.conversations-new-ways {
    display: inline-flex;
    align-self: flex-start;
    padding: var(--spacing-2xs);
    border-radius: var(--radius-pill);
    background: var(--color-surface-subtle);
}

.conversations-new-ways__way {
    display: inline-flex;
    gap: var(--spacing-xs);
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-pill);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    cursor: pointer;
}

.conversations-new-ways__way input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.conversations-new-ways__way.is-on {
    background: var(--color-card-bg);
    box-shadow: var(--shadow-sm);
    color: var(--color-text);
}

.conversations-new__foot {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* A new email's plus sits at the left of its foot, Send at the right. */
.conversations-new__foot .conversations-composer__tool {
    margin-right: auto;
}

.conversations-new:has([data-texts-file]:focus-visible) .conversations-composer__tool {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

/* A file picked shows only while the email way, with its plus, is on. */
.conversations-new:not(:has(.conversations-composer__tool)) .conversations-composer__file {
    display: none;
}

/* A new email's Cc line: the reply box's line, in a box like the To line. */
.conversations-new-cc .conversations-composer__line {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-card-bg);
}

.conversations-new-cc .conversations-composer__line:focus-within {
    box-shadow: var(--shadow-focus-ring);
}

.conversations-new-cc .conversations-composer__tag {
    font-size: var(--font-size-sm);
}

/* Its search is the To line's size, so the two boxes match on every screen. */
.conversations-new-cc .conversations-reply-people__search {
    font-size: var(--font-size-md);
}

.conversations-new-cc .conversations-composer__line .conversations-reply-people__search {
    min-height: var(--control-h-touch);
    margin-block: 0;
}

/* ── A person's activity, on their card and page (ADR-185) ───────────── */

.conversations-moments {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin: 0;
    padding: 0;
    list-style: none;
}

.conversations-moment {
    display: flex;
    gap: var(--spacing-smd);
    align-items: flex-start;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--color-border-subtle);
}

.conversations-moment:last-child {
    border-bottom: 0;
}

.conversations-moment__icon {
    padding-top: var(--spacing-2xs);
    color: var(--color-text-secondary);
}

.conversations-moment--missed .conversations-moment__icon {
    color: var(--color-error-text);
}

.conversations-moment__text {
    flex: 1;
    min-width: 0;
}

.conversations-moment__what {
    margin: 0;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.conversations-moment__what a {
    color: var(--color-text);
    text-decoration: none;
}

.conversations-moment__what a:hover {
    text-decoration: underline;
}

.conversations-moment__long {
    margin-left: var(--spacing-xs);
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-body);
}

.conversations-moment__words {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.conversations-moment__when {
    flex-shrink: 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    white-space: nowrap;
}

.conversations-moments--card .conversations-moment {
    flex-wrap: wrap;
}

.conversations-moments--card .conversations-moment__when {
    width: 100%;
    padding-left: calc(var(--spacing-md) + var(--spacing-smd));
}

/* ── Forms and notes (panels and settings) ───────────────────────────── */

.conversations-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.conversations-form .form-label {
    margin-top: var(--spacing-md);
}

.conversations-form__foot {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    align-items: center;
    justify-content: flex-end;
}

.conversations-saved {
    margin: 0;
    color: var(--color-success-text);
    font-size: var(--font-size-sm);
}

.conversations-error {
    margin: 0;
    color: var(--color-error-text);
    font-size: var(--font-size-sm);
}

.conversations-settings {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    max-width: 40rem;
    padding: var(--spacing-md);
}

.conversations-settings__section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-smd);
}

.conversations-settings__section + .conversations-settings__section {
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border-subtle);
}

.conversations-settings__title {
    margin: 0;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-heading);
}

.conversations-settings__switch {
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
}

.conversations-settings__switch-words {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
}

.conversations-settings__label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.conversations-settings__facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: var(--spacing-xs) var(--spacing-md);
    align-items: center;
    margin: 0;
    font-size: var(--font-size-sm);
}

.conversations-settings__facts dt {
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-body);
}

.conversations-settings__facts dd {
    margin: 0;
}

/* Quick replies on Inbox settings (ADR-218): one row per quick reply that
   opens to its form, then New quick reply. */
.conversations-quick-edit {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
}

.conversations-quick-edit__row + .conversations-quick-edit__row {
    border-top: 1px solid var(--color-border-subtle);
}

.conversations-quick-edit__head {
    display: flex;
    gap: var(--spacing-sm);
    align-items: baseline;
    padding: var(--spacing-sm) var(--spacing-smd);
    font-size: var(--font-size-sm);
    cursor: pointer;
}

.conversations-quick-edit__name {
    flex: none;
    font-weight: var(--font-weight-medium);
}

.conversations-quick-edit__first {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    color: var(--color-text-secondary);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversations-quick-edit__count {
    flex: none;
    color: var(--color-text-secondary);
}

.conversations-quick-edit__new {
    color: var(--color-action);
    font-weight: var(--font-weight-medium);
}

.conversations-quick-edit__form {
    padding: 0 var(--spacing-smd) var(--spacing-smd);
}

.conversations-quick-edit__text {
    display: flex;
    gap: var(--spacing-xs);
    align-items: flex-start;
}

.conversations-quick-edit__at {
    flex: none;
    width: var(--spacing-md);
    padding-top: var(--spacing-xs);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    text-align: right;
}

.conversations-quick-edit__add {
    display: inline-flex;
    gap: var(--spacing-xs);
    align-items: center;
    align-self: flex-start;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--color-action);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
}

.conversations-quick-edit__add:hover {
    text-decoration: underline;
}

/* Quiet news from Sendblue about the line, above its facts. */
.conversations-settings__banner {
    margin: 0 0 var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    background: var(--color-surface-subtle);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.conversations-settings__banner--warn {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
}

/* Which Sendblue event types send to SkillBridge, on the line card. */
.conversations-webhooks {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-smd);
    border-top: 1px solid var(--color-border-subtle);
    font-size: var(--font-size-sm);
}

.conversations-webhooks__head {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    align-items: center;
    justify-content: space-between;
    margin: 0;
}

.conversations-webhooks__label {
    color: var(--color-text-secondary);
}

.conversations-webhooks__types {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
    gap: var(--spacing-xs) var(--spacing-md);
    margin: 0;
    padding: 0;
    list-style: none;
}

.conversations-webhooks__type {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
    color: var(--color-text-secondary);
}

.conversations-webhooks__type.is-on {
    color: var(--color-text);
}

.conversations-webhooks__type.is-on .bi {
    color: var(--color-success);
}

.conversations-webhooks__plan {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    padding: var(--spacing-smd);
    border-radius: var(--radius-md);
    background: var(--color-surface-subtle);
}

.conversations-webhooks__plan p {
    margin: 0;
}

/* ── Narrower screens ────────────────────────────────────────────────── */

/* Under 1200px the person's panel opens over the thread, from the header's switch. */
/* Which inbox the list shows: the shared one, or the teammate's own. */
.conversations-inboxes {
    position: relative;
    padding: 0 var(--spacing-md) var(--spacing-sm);
}

.conversations-inboxes__pick {
    display: inline-flex;
    gap: var(--spacing-xs);
    align-items: center;
    padding: var(--spacing-2xs) var(--spacing-sm);
    border-radius: var(--radius-pill);
    background: var(--color-surface-subtle);
    color: var(--color-text);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    list-style: none;
    cursor: pointer;
}

.conversations-inboxes__pick::-webkit-details-marker {
    display: none;
}

.conversations-inboxes__menu {
    position: absolute;
    z-index: var(--z-dropdown);
    min-width: 14rem;
    margin: var(--spacing-2xs) 0 0;
    padding: var(--spacing-xsm);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    background: var(--color-card-bg);
    box-shadow: var(--shadow-lg);
    list-style: none;
}

.conversations-inboxes__item {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: var(--font-size-sm);
    text-decoration: none;
}

.conversations-inboxes__item:hover,
.conversations-inboxes__item.is-active {
    background: var(--color-surface-hover);
}

/* The mailbox an email row came to or went from, shown only when the org has more than one. */
.conversations-row__mailbox {
    overflow: hidden;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The end padding keeps a long address clear of the picker's arrow. */
.conversations-composer__from {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    padding-inline-end: var(--spacing-lg);
    border: 0;
    background: transparent;
    color: var(--color-text);
    font-size: var(--font-size-sm);
}

.conversations-blank__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    justify-content: center;
}

/* One line per mailbox on the settings page: address, status, button. */
.conversations-mailboxes {
    margin: 0;
    padding: 0;
    list-style: none;
}

.conversations-mailboxes__row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    align-items: center;
    padding: var(--spacing-smd) 0;
    border-top: 1px solid var(--color-border-subtle);
}

.conversations-mailboxes__row form {
    margin: 0;
}

.conversations-mailboxes__row--end {
    justify-content: flex-end;
}

.conversations-mailboxes__address {
    flex: 1 1 12rem;
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: var(--font-size-sm);
}

/* A shared mailbox's switch for all mail, on its own line under its row. */
.conversations-mailbox-show {
    flex: 1 0 100%;
}

/* A mailbox's signature, folded under its row until opened. */
.conversations-signature {
    flex: 1 0 100%;
}

.conversations-signature__summary {
    display: inline-flex;
    gap: var(--spacing-xs);
    align-items: center;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    cursor: pointer;
}

.conversations-signature__none {
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
}

.conversations-signature__form {
    margin-top: var(--spacing-sm);
}

.conversations-signature__label {
    margin: var(--spacing-sm) 0 var(--spacing-2xs);
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
}

.conversations-signature__code {
    display: block;
    width: 100%;
    min-height: 14rem;
    padding: var(--spacing-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: white;
    color: var(--color-text);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: var(--font-size-xs);
    line-height: var(--line-height-body);
    resize: vertical;
    tab-size: 2;
}

.conversations-signature__code:focus {
    border-color: var(--color-grey-400);
    outline: none;
    box-shadow: var(--shadow-sm);
}

.conversations-signature__look {
    display: block;
    width: 100%;
    height: 14rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: white;
    resize: vertical;
}

.conversations-signature__tokens {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    align-items: center;
    margin-top: var(--spacing-sm);
}

.conversations-signature__hint {
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
}

.conversations-signature__token {
    padding: var(--spacing-2xs) var(--spacing-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: white;
    color: var(--color-text);
    font-size: var(--font-size-xs);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.conversations-signature__token:hover {
    background: var(--color-surface-subtle);
}

@media (max-width: 1199.98px) {
    .conversations-app.global-page-fill {
        grid-template-columns: 19rem minmax(0, 1fr);
    }

    .conversations-context {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: var(--z-dropdown);
        display: none;
        width: 18rem;
        box-shadow: var(--shadow-lg);
    }

    .conversations-app.is-context-open .conversations-context {
        display: flex;
    }

    .conversations-context .conversations-context__close {
        position: absolute;
        top: var(--spacing-sm);
        right: var(--spacing-sm);
        display: inline-flex;
    }

    .conversations-context__tabs {
        padding-right: var(--control-h-base);
    }

    .conversations-head__chips {
        display: none;
    }

    /* Narrower, the reply rises as a tall sheet over the emails' lower part,
       and its fold button puts it away. */
    .conversations-body {
        position: relative;
    }

    .conversations-reply-panel {
        position: absolute;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: var(--z-raised);
        height: min(85%, 44rem);
        border-top: 1px solid var(--color-border-subtle);
        border-left: 0;
        border-radius: var(--radius-lg) var(--radius-lg) var(--radius-none) var(--radius-none);
        box-shadow: var(--shadow-lg);
    }
}

/* A phone: the list fills the screen; a thread opens over it with a back arrow. */
@media (max-width: 767.98px) {
    .conversations-app.global-page-fill {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Inside a thread the website's bottom bar steps aside: the back arrow
       leads out, and the reply bar takes the bottom of the screen. The page
       turns the thread's white, so the strips behind the notch and the home
       bar match the thread instead of framing it in grey. */
    body:has(.conversations-app.is-thread-open) {
        --bottom-bar-h: var(--safe-bottom);
        background-color: var(--color-card-bg);
    }

    body:has(.conversations-app.is-thread-open) .global-app-header {
        display: none;
    }

    /* The shell can shrink itself or the keyboard can cover it and pan the page.
       The Inbox fits both edges and keeps its own scroll for messages and replies. */
    .global-app-main:has(.conversations-app.global-page-fill),
    :root:has(.global-phone-bar) .global-app-main:has(.conversations-app.global-page-fill) {
        --conversations-top: max(var(--safe-top), var(--phone-covered-top, 0px));
        --conversations-bottom: max(var(--bottom-bar-h), var(--phone-covered-bottom, 0px));
        position: relative;
        top: calc(var(--conversations-top) - var(--safe-top));
        min-height: 0;
        height: calc(100vh - var(--conversations-top) - var(--conversations-bottom));
        height: calc(100dvh - var(--conversations-top) - var(--conversations-bottom));
    }

    /* Under the floating tab capsule (phone-bar.css, look D) the list runs to
       the screen's bottom edge behind the capsule, so no strip of page shows
       under it, and the list keeps the capsule's height as room at its end so
       its last row scrolls clear. A keyboard still takes its height off. */
    :root:has(.global-phone-bar) body:not(:has(.conversations-app.is-thread-open)) .global-app-main:has(.conversations-app.global-page-fill) {
        --conversations-bottom: var(--phone-covered-bottom, 0px);
    }

    :root:has(.global-phone-bar) .conversations-list-scroll {
        padding-bottom: var(--bottom-bar-h);
    }

    /* While an email reply is typed, it fills the space above the keyboard and
       its words box starts about three lines tall, so To through Send fit
       without the To line sliding under the Reply heading. The words box takes
       what is left above the Send row, whatever height it grew to, and
       scrolls inside itself once full, so Send stays above the keyboard. */
    .conversations-reply-panel:focus-within {
        height: 100%;
    }

    .conversations-reply-panel .conversations-composer__input--email {
        flex: 1 1 0;
        min-height: 5rem;
        overflow-y: auto;
        overscroll-behavior-y: contain;
    }

    /* Where From, To, Cc, the signature and the quote leave too little room,
       the reply scrolls and Send sticks to the bottom of what shows. */
    .conversations-reply-panel .conversations-composer__foot {
        position: sticky;
        bottom: 0;
        border-bottom-right-radius: var(--radius-lg);
        border-bottom-left-radius: var(--radius-lg);
        background: var(--color-card-bg);
    }

    /* iPhone zooms into any box under 16px, and a finger needs 44px. */
    .conversations-search {
        height: var(--control-h-touch);
    }

    .conversations-search__input,
    .conversations-to__search,
    .conversations-to__search.conversations-reply-people__search,
    .conversations-composer__input,
    .conversations-composer__subject,
    .conversations-composer__input--email {
        font-size: var(--font-size-base);
    }

    /* The whole search box takes the tap, not just the line of text in it. */
    .conversations-search__input {
        align-self: stretch;
    }

    /* An email's To, Cc and Subject boxes are a finger tall, reaching into
       their line's padding so the line keeps its look. */
    .conversations-to__search,
    .conversations-to__search.conversations-reply-people__search,
    .conversations-composer__subject {
        min-height: var(--control-h-touch);
    }

    .conversations-composer__line .conversations-to__search,
    .conversations-composer__line .conversations-composer__subject {
        margin-block: calc(0px - var(--spacing-xsm));
    }

    .conversations-composer__line .conversations-to__chips {
        align-items: center;
    }

    /* On a new conversation, the find box takes its own line under the
       people picked, so its whole hint shows. */
    .conversations-to__line .conversations-to__chips:has(.conversations-chip) > .global-page-search {
        flex-basis: 100%;
    }

    /* The list's top on a phone (Nick, 10-11): the inbox picker is the title,
       with both New buttons beside it, then the search and a Filter button. */
    .conversations-side__head {
        gap: var(--spacing-xs);
        min-height: calc(var(--control-h-touch) + var(--spacing-smd));
        padding: var(--spacing-xsm) var(--spacing-xs) var(--spacing-xsm) var(--spacing-md);
    }

    .conversations-side__title {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .conversations-side__head .conversations-side__picker {
        display: block;
        min-width: 0;
    }

    .conversations-side__pick {
        display: flex;
        gap: var(--spacing-xs);
        align-items: center;
        max-width: 100%;
        min-height: var(--control-h-touch);
        padding: 0;
        border: 0;
        background: none;
        color: var(--color-text);
        font-size: var(--font-size-xl);
        font-weight: var(--font-weight-heading);
        white-space: nowrap;
    }

    .conversations-side__pick .bi {
        color: var(--color-text-secondary);
        font-size: var(--font-size-md);
    }

    .conversations-side__pick:focus-visible,
    .conversations-filter__button:focus-visible,
    .conversations-filter__words:focus-visible,
    .conversations-filter__clear:focus-visible,
    .conversations-filter__reset:focus-visible {
        outline: 2px solid var(--color-focus-ring);
        outline-offset: 2px;
        border-radius: var(--radius-md);
    }

    .conversations-side__desk,
    .conversations-inboxes {
        display: none;
    }

    .conversations-side__tools .global-icon-btn {
        width: var(--control-h-touch);
        height: var(--control-h-touch);
        border-color: transparent;
        color: var(--color-text);
        font-size: var(--font-size-lg);
    }

    .conversations-filter {
        gap: 0;
        padding: 0 var(--spacing-md) var(--spacing-sm);
    }

    .conversations-filter__button {
        position: relative;
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        width: var(--control-h-touch);
        height: var(--control-h-touch);
        padding: 0;
        border: 0;
        border-radius: var(--radius-md);
        background: var(--color-surface-subtle);
        color: var(--color-text);
        font-size: var(--font-size-lg);
    }

    .conversations-filter.is-filtered .conversations-filter__button {
        background: var(--color-neutral-ink);
        color: var(--color-neutral-ink-fg);
    }

    .conversations-filter__count {
        position: absolute;
        top: var(--spacing-2xs);
        right: var(--spacing-2xs);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: var(--spacing-md);
        height: var(--spacing-md);
        padding: 0 var(--spacing-2xs);
        border-radius: var(--radius-pill);
        background: var(--color-card-bg);
        color: var(--color-neutral-ink);
        font-size: var(--font-size-2xs);
        font-weight: var(--font-weight-heading);
    }

    .conversations-filter__count:empty {
        display: none;
    }

    /* "Mine · Text · Sales" under the search, with Clear at its end. */
    .conversations-filter.is-filtered .conversations-filter__picked {
        display: flex;
        gap: var(--spacing-sm);
        align-items: center;
    }

    .conversations-filter__words,
    .conversations-filter__clear,
    .conversations-filter__reset {
        min-height: var(--control-h-touch);
        padding: 0;
        border: 0;
        background: none;
        font-size: var(--font-size-xs);
    }

    .conversations-filter__words {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        color: var(--color-text-secondary);
        text-align: left;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .conversations-filter__clear,
    .conversations-filter__reset {
        padding-inline: var(--spacing-xs);
        color: var(--color-action);
        font-weight: var(--font-weight-medium);
        text-decoration: underline;
    }

    /* The Filter sheet: a bottom sheet over a shade; a tap on the shade or
       the foot button puts it away, and every pick reads the list at once. */
    .conversations-filter__sheet {
        display: none;
    }

    .conversations-filter.is-filtering .conversations-filter__shade {
        position: fixed;
        inset: 0;
        z-index: var(--z-modal);
        display: block;
        background: var(--color-scrim);
    }

    .conversations-filter.is-filtering .conversations-filter__sheet {
        position: fixed;
        inset: auto 0 var(--sheet-bottom) 0;
        z-index: var(--z-modal);
        display: flex;
        flex-direction: column;
        max-height: 85vh;
        max-height: 85dvh;
        padding-bottom: var(--sheet-pad-bottom);
        border-radius: var(--radius-lg) var(--radius-lg) var(--radius-none) var(--radius-none);
        background: var(--color-card-bg);
        box-shadow: var(--shadow-modal);
    }

    .conversations-filter__grab {
        display: block;
        flex: 0 0 auto;
        width: var(--spacing-2xl);
        height: var(--spacing-xs);
        margin: var(--spacing-sm) auto 0;
        border-radius: var(--radius-pill);
        background: var(--color-border);
    }

    .conversations-filter__head {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: space-between;
        padding: 0 var(--spacing-sm) 0 var(--spacing-md);
    }

    .conversations-filter__title {
        margin: 0;
        font-size: var(--font-size-base);
        font-weight: var(--font-weight-heading);
    }

    .conversations-filter__reset {
        visibility: hidden;
    }

    .conversations-filter.is-filtered .conversations-filter__reset {
        visibility: visible;
    }

    .conversations-filter__body {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
        padding: 0 var(--spacing-md) var(--spacing-md);
        overflow-y: auto;
        overscroll-behavior-y: contain;
    }

    .conversations-filter__label {
        display: block;
        margin: var(--spacing-md) 0 var(--spacing-xs);
        color: var(--color-text-secondary);
    }

    .conversations-filter__foot {
        position: sticky;
        bottom: 0;
        display: block;
        flex: 0 0 auto;
        padding: var(--spacing-sm) var(--spacing-md);
        border-top: 1px solid var(--color-border-subtle);
        background: var(--color-card-bg);
    }

    .conversations-filter__done {
        width: 100%;
    }

    /* Show: one row each, 48px, a check on the picked one, in the phone's
       order (Snoozed before Done). */
    .conversations-views.global-segmented--block {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 0;
        border-radius: var(--radius-none);
        background: none;
    }

    .conversations-views .global-segmented__btn,
    .conversations-views .global-segmented__btn:not(.is-active, :hover) {
        justify-content: space-between;
        min-height: calc(var(--control-h-touch) + var(--spacing-xs));
        padding: 0 var(--spacing-xs);
        border-radius: var(--radius-md);
        color: var(--color-text);
        font-size: var(--font-size-base);
        font-weight: var(--font-weight-body);
    }

    .conversations-views .global-segmented__btn.is-active {
        background: var(--color-surface-subtle);
        box-shadow: none;
        color: var(--color-text);
        font-weight: var(--font-weight-heading);
    }

    .conversations-views .is-active .conversations-views__check {
        display: inline-block;
    }

    .conversations-views__more,
    .conversations-views__menu {
        display: contents;
    }

    .conversations-views__more-button {
        display: none;
    }

    .conversations-views .global-segmented__btn:has(> input[value="closed"]) {
        order: 1;
    }

    .conversations-views__menu .global-segmented__btn:not(:has(> input[value="snoozed"])) {
        order: 2;
    }

    /* Channel: pill chips a finger tall; the picked one is dark. */
    .conversations-channels {
        order: 0;
        flex-wrap: wrap;
        gap: var(--spacing-sm);
        justify-content: flex-start;
        border-bottom: 0;
    }

    .conversations-channels .global-tab {
        min-height: var(--control-h-touch);
        margin: 0;
        padding: 0 var(--spacing-md);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-pill);
        color: var(--color-text);
        font-size: var(--font-size-md);
    }

    .conversations-channels .global-tab.is-active {
        border-color: var(--color-neutral-ink);
        background: var(--color-neutral-ink);
        color: var(--color-neutral-ink-fg);
    }

    .conversations-tags {
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }

    .conversations-send,
    .conversations-composer__tool {
        min-width: var(--control-h-touch);
        height: var(--control-h-touch);
    }

    .conversations-send {
        width: var(--control-h-touch);
    }

    /* The textarea is the whole height of the reply bar, so a tap anywhere
       on the bar lands in it. */
    .conversations-composer__input {
        min-height: var(--control-h-touch);
    }

    /* The small "..." pill, a file's chip, a person's x, "Not sent" and
       "Transcript" keep their look; their tap areas reach 44px. */
    .conversations-email__more,
    .conversations-email__file,
    .conversations-chip__remove,
    .conversations-signature-preview__remove,
    .conversations-signature-preview__add,
    summary.conversations-failed__head,
    .conversations-call__more > summary {
        position: relative;
    }

    .conversations-email__more::after,
    .conversations-email__file::after,
    .conversations-chip__remove::after,
    .conversations-signature-preview__remove::after,
    .conversations-signature-preview__add::after,
    summary.conversations-failed__head::after,
    .conversations-call__more > summary::after {
        content: "";
        position: absolute;
        inset: min(0px, calc((100% - var(--control-h-touch)) / 2));
    }

    /* The sender, the time and the menu keep one top line: Unsubscribe moves
       into the menu, whose button reads ··· then. */
    .conversations-email__unsub,
    .conversations-email__tools .global-icon-btn .conversations-email__menu-trash:has(+ .conversations-email__menu-more) {
        display: none;
    }

    .conversations-email__tools .global-icon-btn .conversations-email__menu-more {
        display: flex;
    }

    .conversations-menu .conversations-menu__item--unsub {
        display: flex;
    }

    /* A folded email stays one line; its tools show once it is open. */
    .conversations-email:not([data-open]) .conversations-email__tools {
        display: none;
    }

    .conversations-pane {
        display: none;
    }

    /* A new conversation scrolls on its own inside the screen, and
       their Send row sticks to the bottom of what shows, over the words, so
       it stays above either keyboard. A box scrolled into view clears it. */
    .conversations-new {
        flex: 1 1 auto;
        min-height: 0;
        padding-bottom: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        scroll-padding-bottom: calc(var(--control-h-touch) + var(--spacing-lg));
    }

    .conversations-new__foot {
        position: sticky;
        bottom: 0;
        padding-block: var(--spacing-sm);
        background: var(--color-card-bg);
    }

    .conversations-app.is-thread-open .conversations-side {
        display: none;
    }

    .conversations-app.is-thread-open .conversations-pane {
        display: flex;
    }

    .conversations-side {
        border-right: 0;
    }

    /* One row (Nick, 10-11): back, the name over the number, Call and More.
       Every other tool lives in the More sheet. */
    .conversations-head {
        flex-wrap: nowrap;
        gap: var(--spacing-2xs);
        min-height: calc(var(--control-h-touch) + 2 * var(--spacing-xsm));
        padding: var(--spacing-xsm) var(--spacing-xs);
    }

    .conversations-head__who {
        position: relative;
        flex: 1 1 0;
    }

    /* A tap anywhere on the name and the line under it opens the details. */
    .conversations-head__name-btn::after {
        content: "";
        position: absolute;
        inset: 0;
    }

    .conversations-head__sub {
        align-items: center;
    }

    .conversations-head__sub .global-chip {
        display: none;
    }

    .conversations-head__owner {
        display: inline-flex;
        flex: 0 0 auto;
        width: var(--spacing-md);
        height: var(--spacing-md);
        font-size: var(--font-size-2xs);
    }

    .conversations-head__tools {
        gap: 0;
    }

    /* Three classes: a phone's .btn rule (main.css) would show Done again. */
    .conversations-head .conversations-head__tools .conversations-head__desk {
        display: none;
    }

    .conversations-head__tools .conversations-head__phone {
        display: inline-block;
    }

    .conversations-more .conversations-more__phone {
        display: flex;
    }

    /* Ghosts in the main ink; a call task's Call keeps its ink fill (main.css). */
    .conversations-head__tools .global-icon-btn:not(.is-task) {
        border-color: transparent;
        color: var(--color-text);
    }

    /* The More sheet: rows a finger and a bit tall, each list opening in the
       same sheet, which scrolls inside itself when a team is long. */
    .conversations-more__level {
        max-height: 85vh;
        max-height: 85dvh;
        overflow-y: auto;
        overscroll-behavior-y: contain;
    }

    .conversations-more__menu .conversations-menu__item {
        gap: var(--spacing-smd);
        min-height: calc(var(--control-h-touch) + var(--spacing-xs));
    }

    .conversations-tags .global-toolbar__chip {
        min-height: var(--control-h-touch);
        padding: 0 var(--spacing-md);
        font-size: var(--font-size-md);
    }

    /* While a reply is typed the keyboard has the bottom half of the screen,
       so everything that is not the messages steps aside: the tools, the
       person's tabs and the ways to answer. Putting the keyboard away brings
       them back. */
    .conversations-thread:has([data-texts-input]:focus) .conversations-head__tools,
    .conversations-thread:has([data-texts-input]:focus) .conversations-person-tabs,
    .conversations-thread:has([data-texts-input]:focus) .conversations-ways {
        display: none;
    }

    /* A finger's width for the buttons on a form, the inbox picker and its
       rows, a file card, and the From picker on an email (16px so the iPhone
       does not zoom in on it). */
    .conversations-form__foot .btn {
        min-width: var(--control-h-touch);
    }

    .conversations-inboxes__pick,
    .conversations-inboxes__item,
    .conversations-file--card {
        min-height: var(--control-h-touch);
    }

    .conversations-composer__from {
        min-height: var(--control-h-touch);
        font-size: var(--font-size-base);
    }

    .conversations-composer__line .conversations-composer__from {
        margin-block: calc(0px - var(--spacing-xsm));
    }

    /* A From address too long to fit beside its tag moves to its own line,
       so the whole address shows. */
    .conversations-composer__line:has(> .conversations-composer__from) {
        flex-wrap: wrap;
    }

    .conversations-composer__line > .conversations-composer__from {
        min-width: auto;
        max-width: 100%;
    }

    .conversations-head__back {
        display: inline-flex;
        flex: 0 0 auto;
        width: var(--control-h-touch);
        height: var(--control-h-touch);
        color: var(--color-text);
        font-size: var(--font-size-lg);
    }

    .conversations-head .global-avatar--md {
        display: none;
    }

    /* A slim 36px row that stays put, and none at all for someone with one
       way to reach and no Book tab (Nick's pick, 2026-10-11). The touch floor
       turns --control-h-base into 44px, so the row is sized off the touch
       height, and each tab's tap area reaches 4px past it on both sides. */
    .conversations-person-tabs {
        height: calc(var(--control-h-touch) - var(--spacing-sm));
        align-items: stretch;
        padding: 0 var(--spacing-sm);
    }

    .conversations-person-tabs--few {
        display: none;
    }

    /* The lead drawer's Video call button needs the full touch height. */
    .conversations-person-tabs:has(.conversations-video-call) {
        height: auto;
    }

    .conversations-person-tabs .global-tab {
        position: relative;
        min-height: 0;
        padding-block: 0;
        padding-inline: var(--spacing-sm);
    }

    .conversations-person-tabs .global-tab::after {
        content: "";
        position: absolute;
        inset: calc(-1 * var(--spacing-xs)) 0;
    }

    .conversations-ways {
        padding: var(--spacing-xs) var(--spacing-sm) 0;
    }

    /* The email reply bar lines up with the Reply row over it. */
    .conversations-reply-bar {
        margin-inline: var(--spacing-sm);
    }

    .conversations-scroll {
        padding: var(--spacing-smd);
    }

    .conversations-composer {
        padding: var(--spacing-xs) var(--spacing-sm) var(--spacing-sm);
    }

    .conversations-group__stack {
        max-width: 82%;
    }

    .conversations-context {
        width: 100%;
    }

    /* Inbox settings: every box and button is a full fingertip tall. */
    .conversations-settings .form-control,
    .conversations-signature__summary,
    .conversations-signature__token {
        min-height: var(--control-h-touch);
    }

    .conversations-signature__code {
        font-size: var(--font-size-base);
    }

    /* The switch keeps its size; an unseen square around it takes the tap. */
    .conversations-settings .form-switch .form-check-input {
        position: relative;
    }

    .conversations-settings .form-switch .form-check-input::before {
        content: "";
        position: absolute;
        inset: calc((100% - var(--control-h-touch)) / 2);
    }

    /* Inside a thread the reply bar holds the bottom of the screen, so a
       note like "Sent." shows at the top instead of over the reply box. */
    body:has(.conversations-app.is-thread-open) .global-toast-container {
        inset: calc(var(--safe-top) + var(--spacing-sm)) var(--page-gutter) auto var(--page-gutter);
    }
}

/* ── The call box on every page (ADR-185) ────────────────────────────
   One room per page (.conversations-call-room): the box (#call-alert), drawn by the server
   while a call rings or this teammate is on it, and the frame beside it where
   the box's buttons open our own pages. call-alert.js marks the room
   data-live while there is a call, data-shrunk once it is folded into its
   slim bar, and data-panel="open" while the frame shows. */

/* The bar's height lives on :root: on a phone the page moves down by it. */
:root {
    --call-bar-height: 3.5rem;
}

.conversations-call-room {
    --call-gap: var(--spacing-lg);
    --call-side-width: 26.25rem;
}

/* The box reads itself every few seconds; main.css's .htmx-request fade would dim it and drop
   a click on Answer mid-read. */
.conversations-call-alert.htmx-request {
    opacity: 1;
    pointer-events: auto;
}

/* Calls ring only in the calls window while it is open; a call this page placed still shows. */
.conversations-call-room[data-calls-window-elsewhere] > .conversations-call-alert:not([data-browser]) {
    display: none;
}

.conversations-call-alert__screen,
.conversations-call-alert__bar,
.conversations-call-panel {
    border: 1px solid var(--color-border);
    background: var(--color-card-bg);
    box-shadow: var(--shadow-modal);
}

/* The page behind sits under a shade while the box is open. */
.conversations-call-alert__shade {
    position: fixed;
    inset: 0;
    z-index: var(--z-scrim);
    background: var(--color-scrim);
}

/* Centred between the notch and the home bar, which read 0 off a phone. */
.conversations-call-alert__screen {
    position: fixed;
    top: calc(50% + (var(--safe-top) - var(--safe-bottom)) / 2);
    left: 50%;
    z-index: var(--z-modal);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    width: min(var(--call-side-width), calc(100vw - 2 * var(--call-gap)));
    max-height: calc(100vh - var(--safe-top) - var(--safe-bottom) - 2 * var(--call-gap));
    max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 2 * var(--call-gap));
    padding: var(--spacing-lg);
    overflow-y: auto;
    overscroll-behavior-y: contain;
    border-radius: var(--radius-xl);
    transform: translate(-50%, -50%);
}

.conversations-call-alert__shrink {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
}

/* Who it is, the clock and the round buttons, centred in what height the box has. */
.conversations-call-alert__centre {
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding-top: var(--spacing-sm);
    text-align: center;
}

.conversations-call-alert__stage {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
    justify-content: center;
    margin: var(--spacing-mdlg) 0 0;
    color: var(--color-success-text);
}

/* A ringing call's dot beats, so the box reads as live at a glance. */
.conversations-call-alert__stage--ringing::before {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: var(--radius-pill);
    background: currentColor;
    content: "";
    animation: call-alert-beat 1.2s ease-in-out infinite;
}

@keyframes call-alert-beat {
    50% { opacity: 0.25; }
}

@media (prefers-reduced-motion: reduce) {
    .conversations-call-alert__stage--ringing::before { animation: none; }
}

.conversations-call-alert__name {
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    color: var(--color-text);
    font-family: var(--font-family-heading);
    font-size: var(--font-size-h2);
    font-weight: var(--font-weight-heading);
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversations-call-alert__number {
    margin: 0;
    color: var(--color-text-secondary);
}

/* Ringing: the big face, the name larger, one muted line on how we know them. */
.conversations-call-alert__screen--ringing .conversations-call-alert__name {
    margin: var(--spacing-xsm) 0 0;
    font-size: var(--font-size-h1);
}

.conversations-call-alert__screen--ringing .conversations-call-alert__number {
    margin: var(--spacing-xs) 0 0;
    font-size: var(--font-size-base);
}

.conversations-call-alert__about {
    margin: var(--spacing-smd) 0 0;
    padding: var(--spacing-xs) var(--spacing-smd);
    border-radius: var(--radius-pill);
    background: var(--color-page-bg-soft);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.conversations-call-alert__clock {
    margin: var(--spacing-md) 0 0;
    color: var(--color-text);
    font-size: var(--font-size-h4);
    font-variant-numeric: tabular-nums;
    font-weight: var(--font-weight-body);
    letter-spacing: 0.02em;
}

/* Taken: a smaller face, then "On a call" and its clock in green. */
.conversations-call-alert__screen:not(.conversations-call-alert__screen--ringing) .global-avatar--xl {
    width: 5.25rem;
    height: 5.25rem;
    font-size: var(--font-size-h1);
}

.conversations-call-alert__screen:not(.conversations-call-alert__screen--ringing) .conversations-call-alert__name {
    margin: var(--spacing-smd) 0 0;
}

.conversations-call-alert__screen:not(.conversations-call-alert__screen--ringing) .conversations-call-alert__number {
    margin: var(--spacing-xs) 0 0;
}

.conversations-call-alert__live {
    display: flex;
    gap: var(--spacing-xsm);
    align-items: center;
    margin: var(--spacing-xs) 0 0;
    color: var(--color-success-text);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-heading);
}

.conversations-call-alert__live [data-call-clock-from] { font-variant-numeric: tabular-nums; }

.conversations-call-alert__live-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: var(--radius-pill);
    background: var(--color-success);
}

/* A call on this computer: four bars for the line, green from Twilio's quality score, and while
   Twilio warns one amber bar and a line under the status (browser-calls.js, ADR-185 §12). */
.conversations-call-alert__signal {
    display: none;
    gap: var(--spacing-2xs);
    align-items: flex-end;
    height: 14px;
    margin-left: var(--spacing-xsm);
}

.conversations-call-alert__signal > i {
    width: 3px;
    background: var(--color-grey-300);
}

.conversations-call-alert__signal > :nth-child(1) { height: 5px; }
.conversations-call-alert__signal > :nth-child(2) { height: 8px; }
.conversations-call-alert__signal > :nth-child(3) { height: 11px; }
.conversations-call-alert__signal > :nth-child(4) { height: 14px; }

.conversations-call-alert[data-browser="on-call"][data-signal] .conversations-call-alert__signal,
.conversations-call-alert[data-browser="on-call"][data-line-trouble] .conversations-call-alert__signal {
    display: inline-flex;
}

.conversations-call-alert:not([data-line-trouble])[data-signal="1"] .conversations-call-alert__signal > :nth-child(-n + 1),
.conversations-call-alert:not([data-line-trouble])[data-signal="2"] .conversations-call-alert__signal > :nth-child(-n + 2),
.conversations-call-alert:not([data-line-trouble])[data-signal="3"] .conversations-call-alert__signal > :nth-child(-n + 3),
.conversations-call-alert:not([data-line-trouble])[data-signal="4"] .conversations-call-alert__signal > :nth-child(-n + 4) {
    background: var(--color-success);
}

.conversations-call-alert[data-line-trouble] .conversations-call-alert__signal > :first-child {
    background: var(--color-warning);
}

.conversations-call-alert__trouble {
    display: inline-flex;
    gap: var(--spacing-xsm);
    align-items: center;
    margin: var(--spacing-sm) 0 0;
    color: var(--color-warning-text);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-body);
}

.conversations-call-alert__trouble > i { color: var(--color-warning); }

.conversations-call-alert:not([data-browser="on-call"]) .conversations-call-alert__trouble,
.conversations-call-alert__trouble:empty {
    display: none;
}

/* The round buttons: a disc with its word under it. */
.conversations-call-alert__rounds {
    display: flex;
    gap: var(--spacing-lg);
    justify-content: center;
    margin-top: var(--spacing-xl);
}

.conversations-call-alert__rounds--ringing {
    gap: calc(var(--spacing-xl) + var(--spacing-lg));
}

.conversations-call-alert__round {
    --call-round-size: 3.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: calc(var(--call-round-size) + var(--spacing-md));
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-text);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-body);
}

.conversations-call-alert__rounds--ringing .conversations-call-alert__round {
    --call-round-size: 4.5rem;
}

.conversations-call-alert .conversations-call-alert__rounds > .conversations-call-alert__round {
    gap: var(--spacing-sm);
}

/* The word under a round button: one line, never squeezed by the disc. */
.conversations-call-alert__word {
    line-height: 1.2;
    white-space: nowrap;
}

.conversations-call-alert__disc {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--call-round-size);
    height: var(--call-round-size);
    border-radius: var(--radius-pill);
    background: var(--color-action-tint);
    color: var(--color-text);
    font-size: var(--font-size-h2);
    transition: filter var(--transition-fast);
}

.conversations-call-alert__rounds--ringing .conversations-call-alert__disc { font-size: var(--font-size-h1); }

.conversations-call-alert__round:hover .conversations-call-alert__disc { filter: brightness(0.94); }

.conversations-call-alert__round:focus-visible { outline: none; }

.conversations-call-alert__round:focus-visible .conversations-call-alert__disc {
    box-shadow: var(--shadow-focus-ring-tight);
}

.conversations-call-alert__round--answer .conversations-call-alert__disc {
    background: var(--color-success);
    box-shadow: var(--shadow-call-answer);
    color: var(--color-neutral-ink-fg);
}

.conversations-call-alert__round--end .conversations-call-alert__disc {
    background: var(--color-error);
    box-shadow: var(--shadow-call-end);
    color: var(--color-neutral-ink-fg);
}

/* Muted, and Audio while its panel is open, read as pressed. */
.conversations-call-alert[data-muted] .conversations-call-alert__round .conversations-call-alert__muted .conversations-call-alert__disc,
.conversations-call-room:has(> .conversations-call-audio--over-call:not([hidden])) .conversations-call-alert__round[data-call-audio-open] .conversations-call-alert__disc {
    background: var(--color-neutral-ink);
    color: var(--color-neutral-ink-fg);
}

/* Mute's two faces each hand the button their disc and word. */
.conversations-call-alert[data-muted] .conversations-call-alert__round .conversations-call-alert__muted,
.conversations-call-alert:not([data-muted]) .conversations-call-alert__round .conversations-call-alert__unmuted {
    display: contents;
}

/* "Ringing on" names the ringer only while it rings here and the browser has named it. */
.conversations-call-alert__ringer {
    display: none;
    gap: var(--spacing-xsm);
    align-items: center;
    margin: var(--spacing-xl) 0 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.conversations-call-alert[data-browser="ringing"] .conversations-call-alert__ringer:not(:has([data-call-ringer-name]:empty)) {
    display: flex;
}

/* What a taken call's caller is to us: where they stand, then their newest leads. */
.conversations-call-alert__card {
    display: grid;
    flex: 0 0 auto;
    gap: var(--spacing-smd);
    margin-top: var(--spacing-sm);
    padding: var(--spacing-smd) var(--spacing-md);
    border-radius: var(--radius-lg);
    background: var(--color-page-bg-soft);
}

.conversations-call-alert__line {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    margin: 0;
    color: var(--color-text);
    font-size: var(--font-size-sm);
}

.conversations-call-alert__line > i { color: var(--color-text-secondary); }

.conversations-call-alert__line b { font-weight: var(--font-weight-heading); }

.conversations-call-alert__line + .conversations-call-alert__leads {
    padding-top: var(--spacing-smd);
    border-top: 1px solid var(--color-border-hairline);
}

.conversations-call-alert__leads .conversations-context__label { margin: 0 0 var(--spacing-xs); }

/* The big buttons: one press to the form, filled in. */
.conversations-call-alert__do {
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: var(--spacing-sm);
}

.conversations-call-alert__big {
    display: inline-flex;
    gap: var(--spacing-sm);
    align-items: center;
    justify-content: center;
    min-height: var(--call-bar-height);
    font-size: var(--font-size-h4);
    white-space: nowrap;
}

/* Calls in the browser: these show only once browser-calls.js says this
   browser is ringing, calling out, talking, or has its microphone blocked. */
.conversations-call-alert .conversations-call-alert__talk,
.conversations-call-alert .conversations-call-alert__mic,
.conversations-call-alert .conversations-call-alert__muted {
    display: none;
}

.conversations-call-alert[data-browser="ringing"] .conversations-call-alert__talk--ringing,
.conversations-call-alert[data-browser="calling"] .conversations-call-alert__talk--on-call,
.conversations-call-alert[data-browser="on-call"] .conversations-call-alert__talk--on-call {
    display: inline-flex;
    gap: var(--spacing-xs);
    align-items: center;
}

/* A round button shown by the same marks stacks its disc over its word, as its neighbours do. */
.conversations-call-alert[data-browser="ringing"] .conversations-call-alert__rounds > .conversations-call-alert__talk--ringing,
.conversations-call-alert[data-browser="calling"] .conversations-call-alert__rounds > .conversations-call-alert__talk--on-call,
.conversations-call-alert[data-browser="on-call"] .conversations-call-alert__rounds > .conversations-call-alert__talk--on-call {
    display: flex;
    gap: var(--spacing-sm);
}

.conversations-call-alert[data-mic] .conversations-call-alert__mic {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
    justify-content: center;
    margin: var(--spacing-md) 0 0;
    color: var(--color-warning-text);
}

.conversations-call-alert:not([data-mic="blocked"]) .conversations-call-alert__mic-blocked,
.conversations-call-alert:not([data-mic="missing"]) .conversations-call-alert__mic-missing {
    display: none;
}

.conversations-call-alert[data-muted] .conversations-call-alert__muted { display: inline; }
.conversations-call-alert[data-muted] .conversations-call-alert__unmuted { display: none; }

/* Shrunk: a slim bar at the top of the page (their name, the clock, the
   talk buttons), the page usable under it. */
.conversations-call-alert__bar {
    position: fixed;
    top: calc(var(--header-bottom) + var(--spacing-sm));
    left: 50%;
    z-index: var(--z-popover);
    display: none;
    gap: var(--spacing-smd);
    align-items: center;
    min-height: var(--call-bar-height);
    padding: var(--spacing-xs) var(--spacing-xs) var(--spacing-xs) var(--spacing-smd);
    border-left: 4px solid var(--color-success);
    border-radius: var(--radius-lg);
    transform: translateX(-50%);
    white-space: nowrap;
}

.conversations-call-alert__bar-name { font-weight: var(--font-weight-heading); }
.conversations-call-alert__bar-clock { color: var(--color-text-secondary); }

.conversations-call-room[data-shrunk] .conversations-call-alert__shade,
.conversations-call-room[data-shrunk] .conversations-call-alert__screen {
    display: none;
}

.conversations-call-room[data-shrunk] .conversations-call-alert__bar { display: flex; }

/* A call placed from this computer: its slim bar sits at the top of the open
   lead drawer, or else the Inbox's thread, or else the page (browser-calls.js,
   _call_bar.html), held there while the thread scrolls, and the box steps
   aside for it. One row, the drawer head's height: face, name, state, then
   Mute, Audio settings and Hang up. Only the live state moves. */
.conversations-call-alert[data-out="bar"] {
    display: none;
}

.conversations-call-bar {
    position: sticky;
    top: 0;
    z-index: var(--z-raised);
    display: flex;
    flex: 0 0 auto;
    gap: var(--spacing-smd);
    align-items: center;
    min-height: var(--call-bar-height);
    padding: var(--spacing-sm) var(--spacing-mdlg);
    border-bottom: 1px solid var(--color-border-subtle);
    background: var(--color-card-bg);
    font-size: var(--font-size-md);
    white-space: nowrap;
}

/* The card-only drawer pads its body: the bar runs to its edges. */
.global-drawer-body > .conversations-call-bar {
    margin: calc(-1 * var(--spacing-mdlg)) calc(-1 * var(--spacing-mdlg)) var(--spacing-mdlg);
}

.global-drawer-panel--wide .global-drawer-body > .conversations-call-bar {
    margin: 0;
}

/* Docked on a page with no drawer or thread open: a card under the header. */
#main-content > .conversations-call-bar {
    top: var(--header-bottom);
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
}

.conversations-call-bar__face {
    position: relative;
    flex: 0 0 auto;
}

/* Calling: a calm ring breathes out from their face until they pick up. */
.conversations-call-bar[data-browser="calling"] .conversations-call-bar__face::after {
    position: absolute;
    inset: 0;
    border: 2px solid var(--color-success);
    border-radius: var(--radius-pill);
    content: "";
    animation: call-bar-ring 1.6s ease-out infinite;
}

@keyframes call-bar-ring {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(1.5); }
}

@media (prefers-reduced-motion: reduce) {
    .conversations-call-bar[data-browser="calling"] .conversations-call-bar__face::after {
        animation: none;
        opacity: 1;
    }
}

.conversations-call-bar__name {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    font-weight: var(--font-weight-heading);
    text-overflow: ellipsis;
}

/* Face, name, then number and stage; on an iPhone app call it opens the lead, else the contact. */
.conversations-call-bar__who {
    display: flex;
    flex: 0 1 auto;
    gap: var(--spacing-smd);
    align-items: center;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.conversations-call-bar__about {
    min-width: 0;
    overflow: hidden;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    text-overflow: ellipsis;
}

.conversations-call-bar__about:empty { display: none; }

/* The phone holds an iPhone app call's sound, so there is no Audio to pick. */
.conversations-call-bar[data-app-call] .conversations-call-bar__audio { display: none; }

.conversations-call-bar__state,
.conversations-call-bar__clock {
    flex: 0 0 auto;
    color: var(--color-text-secondary);
}

.conversations-call-bar[data-browser="on-call"] .conversations-call-bar__state { color: var(--color-success-text); }

.conversations-call-bar__clock {
    margin-left: calc(-1 * var(--spacing-sm));
    font-variant-numeric: tabular-nums;
}

.conversations-call-bar__calling,
.conversations-call-bar__on,
.conversations-call-bar__ended,
.conversations-call-bar__failed,
.conversations-call-bar__clock {
    display: none;
}

.conversations-call-bar:not([data-browser="on-call"], [data-browser="ended"], [data-browser="failed"]) .conversations-call-bar__calling,
.conversations-call-bar[data-browser="on-call"] .conversations-call-bar__on,
.conversations-call-bar[data-browser="ended"] .conversations-call-bar__ended,
.conversations-call-bar[data-browser="failed"] .conversations-call-bar__failed,
.conversations-call-bar[data-browser="on-call"] .conversations-call-bar__clock {
    display: inline;
}

.conversations-call-bar__actions {
    display: flex;
    flex: 0 0 auto;
    gap: var(--spacing-sm);
    align-items: center;
    margin-left: auto;
}

/* Over: the face and words stay a moment, the buttons go. */
.conversations-call-bar:is([data-browser="ended"], [data-browser="failed"]) .conversations-call-bar__actions { visibility: hidden; }
.conversations-call-bar[data-browser="failed"] .conversations-call-bar__state { color: var(--color-error-text); }

/* Three classes, so the icon button sheet's own icon rule never shows both. */
.conversations-call-bar [data-browser-call] .conversations-call-bar__muted,
.conversations-call-bar[data-muted] [data-browser-call] .conversations-call-bar__unmuted {
    display: none;
}

.conversations-call-bar[data-muted] [data-browser-call] .conversations-call-bar__muted {
    display: inline-block;
}

/* Hang up is the one red button. */
.conversations-call-bar .conversations-call-bar__hang-up {
    border-color: var(--color-error);
    background: var(--color-error);
    color: var(--color-neutral-ink-fg);
}

.conversations-call-bar .conversations-call-bar__hang-up:hover,
.conversations-call-bar .conversations-call-bar__hang-up:active {
    border-color: var(--color-error-text);
    background: var(--color-error-text);
    color: var(--color-neutral-ink-fg);
}

/* The microphone note in the bar's place: the words wrap, the buttons hold. */
.conversations-call-bar--note {
    white-space: normal;
}

.conversations-call-bar__note-icon {
    flex: 0 0 auto;
    color: var(--color-warning-text);
}

.conversations-call-bar__note {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}

/* Only the words for this browser's trouble show. */
.conversations-call-mic-words { display: none; }

[data-mic="blocked"] .conversations-call-mic-words--blocked,
[data-mic="missing"] .conversations-call-mic-words--missing {
    display: inline;
}

/* Audio settings: the house menu panel under the button that opened it, its
   title, then Microphone, Speaker (with Play test sound) and Ringer. Opened
   from the call box, it hangs in the call room below the Audio button. */
.conversations-call-audio {
    padding: 0;
    white-space: normal;
}

@media (min-width: 768px) {
    .conversations-call-audio {
        width: 21.25rem;
        max-width: calc(100vw - 2 * var(--spacing-md));
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-menu);
    }

    .conversations-call-audio--over-call {
        position: fixed;
        top: calc(var(--call-audio-top) + var(--spacing-sm));
        left: clamp(var(--spacing-sm), calc(var(--call-audio-centre) - 10.625rem), calc(100vw - 21.25rem - var(--spacing-sm)));
        z-index: var(--z-popover);
        margin: 0;
    }
}

.conversations-call-audio__title {
    margin: 0;
    padding: var(--spacing-smd) var(--spacing-md) 0;
    font-family: var(--font-family-heading);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-heading);
}

.conversations-call-audio__body {
    display: grid;
    gap: var(--spacing-md);
    padding: var(--spacing-smd) var(--spacing-md) var(--spacing-md);
}

.conversations-call-audio:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

.conversations-call-audio__field {
    display: grid;
    gap: var(--spacing-xs);
    margin: 0;
}

.conversations-call-audio__label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-heading);
}

.conversations-call-audio__label-row {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    justify-content: space-between;
    min-height: 1.25rem;
    margin: 0;
}

.conversations-call-audio__test {
    display: inline-flex;
    gap: var(--spacing-xs);
    align-items: center;
    min-height: 0;
    padding: 0;
    border: 0;
    color: var(--color-text);
    font-size: var(--font-size-sm);
    line-height: 1.25rem;
    text-decoration: none;
    white-space: nowrap;
}

.conversations-call-audio__test > span {
    text-decoration: underline;
    text-decoration-color: var(--color-grey-400);
    text-underline-offset: 3px;
}


.conversations-views-pick {
    display: none;
}

.conversations-app .global-page-search .global-filter-control {
    width: 100%;
    padding-inline-end: var(--spacing-2xl);
}

.conversations-app .global-page-search .conversations-search__key {
    position: absolute;
    inset-inline-end: var(--spacing-sm);
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

@media (min-width: 768px) {
    .conversations-app.global-page-fill {
        grid-template-rows: auto minmax(0, 1fr);
    }

    .conversations-top {
        grid-column: 1 / -1;
        min-width: 0;
    }

    .conversations-top .global-page-header--card {
        margin: 0;
        border: 0;
        border-radius: var(--radius-none);
        box-shadow: none;
    }

    .conversations-top .global-page-header__actions {
        display: flex;
        align-items: center;
        gap: var(--spacing-sm);
        padding-bottom: var(--spacing-xsm);
    }

    .conversations-top .conversations-inboxes {
        padding: 0;
    }

    .conversations-top .conversations-inboxes__menu {
        right: 0;
    }

    .conversations-top .global-page-header__toolbar {
        border-bottom: 1px solid var(--color-border-subtle);
    }

    .conversations-app .conversations-side__head,
    .conversations-app:has([data-inbox-desk-search] input) .conversations-filter {
        display: none;
    }

    .conversations-top__search-row {
        display: grid;
        grid-template-columns: minmax(0, var(--page-search-w)) auto minmax(0, 1fr);
        align-items: center;
        gap: var(--spacing-sm);
        width: 100%;
    }

    .conversations-top__search-row .global-toolbar {
        display: contents;
    }

    .conversations-top__search-row .global-toolbar__row {
        grid-column: 2;
    }

    .conversations-top__search-row .global-toolbar__chips {
        grid-column: 1 / -1;
        margin-top: 0;
    }

    .conversations-top .global-toolbar__menu--sort {
        width: max-content;
    }
}

@media (max-width: 767.98px) {
    .conversations-top,
    .conversations-filter .global-toolbar__filter,
    .global-app-main:has(.conversations-app.is-thread-open) > .global-view-bar {
        display: none;
    }

    .conversations-views-pick {
        display: block;
        min-width: 0;
        margin: 0 var(--spacing-md) var(--spacing-sm);
    }

    .conversations-views-pick .global-views-dropdown {
        display: inline-flex;
        max-width: 100%;
    }

    .conversations-views-pick .global-views-dropdown__menu {
        width: min(var(--page-search-w), calc(100% - 2 * var(--spacing-md)));
    }

    .conversations-views-pick .global-views-dropdown__name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    [data-inbox-phone-search] {
        flex: 1 1 auto;
        min-width: 0;
    }

    [data-inbox-phone-search] .global-filter-control {
        min-height: var(--control-h-touch);
        font-size: var(--font-size-base);
    }

    .conversations-filter .conversations-filter__reset {
        visibility: visible;
    }

    .conversations-filter.is-filtering .global-toolbar .global-toolbar__chips {
        display: flex;
    }

    .conversations-filter .global-toolbar__chips > .global-toolbar__menu-wrap:has([aria-expanded="true"]) {
        flex-basis: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .conversations-filter .global-toolbar__menu {
        position: static;
        margin-top: var(--spacing-xs);
    }

    .conversations-filter .global-toolbar__sort {
        flex-direction: column;
    }
}

.conversations-call-audio__test:hover { color: var(--color-text); }

/* With a mouse the text button keeps to its label's line; a finger keeps the taller tap target. */
@media (pointer: fine) {
    .conversations-call-audio .conversations-call-audio__label-row > .conversations-call-audio__test {
        height: 1.25rem;
        min-height: 0;
    }
}

.conversations-call-audio__hint {
    margin: var(--spacing-2xs) 0 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    line-height: 1.4;
}

/* The bar under the microphone moves with what it hears. */
.conversations-call-audio__meter {
    display: block;
    height: var(--spacing-xsm);
    margin-top: var(--spacing-xs);
    overflow: hidden;
    border-radius: var(--radius-pill);
    background: var(--color-grey-200);
}

.conversations-call-audio__meter[hidden],
.conversations-call-audio__speaker[hidden],
.conversations-call-audio__ringer[hidden] { display: none; }

.conversations-call-audio__level {
    display: block;
    height: 100%;
    background: var(--color-success);
    transform: scaleX(var(--call-audio-level, 0));
    transform-origin: left;
}

.conversations-call-audio__note { margin: 0; }

.conversations-call-audio:not([data-mic]) .conversations-call-audio__note,
.conversations-call-audio[data-mic] .conversations-call-audio__field,
.conversations-call-audio[data-mic] .conversations-call-audio__meter {
    display: none;
}

/* Check my setup (call-check.js): the button, then a question at each step, then the result. */
.conversations-call-audio__check {
    display: inline-flex;
    gap: var(--spacing-sm);
    align-items: center;
    justify-content: center;
}

/* Ring a test call sits under Check my setup, in the middle. */
.conversations-call-audio__test-call { justify-self: center; }

.conversations-call-audio__check[hidden],
.conversations-call-check[hidden],
.conversations-call-check__row[hidden],
.conversations-call-check__numbers[hidden] { display: none; }

.conversations-call-check {
    display: grid;
    gap: var(--spacing-sm);
    padding-top: var(--spacing-smd);
    border-top: 1px solid var(--color-border-hairline);
}

.conversations-call-check__ask {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    justify-content: space-between;
}

.conversations-call-check__question {
    margin: 0;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-heading);
}

.conversations-call-check__answers {
    display: flex;
    gap: var(--spacing-xsm);
}

.conversations-call-check:not([data-step="speaker"], [data-step="ring"]) .conversations-call-check__answers,
.conversations-call-check[data-step="done"] .conversations-call-check__ask,
.conversations-call-check:not([data-step="done"]) .conversations-call-check__result {
    display: none;
}

.conversations-call-check__result {
    display: grid;
    gap: var(--spacing-sm);
}

.conversations-call-check__verdict {
    display: flex;
    gap: var(--spacing-smd);
    align-items: center;
    margin: 0;
    padding: var(--spacing-xsm) var(--spacing-smd);
    border: 1px solid var(--color-success-border);
    border-radius: var(--radius-md);
    background: var(--color-success-bg);
    color: var(--color-success-text);
    font-family: var(--font-family-heading);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-heading);
}

.conversations-call-check__verdict-mark {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 1.375rem;
    height: 1.375rem;
    border-radius: var(--radius-pill);
    background: var(--color-success);
    color: var(--color-card-bg);
    font-size: var(--font-size-sm);
}

.conversations-call-check:not([data-verdict="ready"]) .conversations-call-check__verdict {
    border-color: var(--color-warning-border);
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
}

.conversations-call-check:not([data-verdict="ready"]) .conversations-call-check__verdict-mark { background: var(--color-warning); }
.conversations-call-check[data-verdict="ready"] .conversations-call-check__verdict-mark .bi-exclamation-lg,
.conversations-call-check:not([data-verdict="ready"]) .conversations-call-check__verdict-mark .bi-check-lg { display: none; }

.conversations-call-check__rows {
    display: grid;
    gap: var(--spacing-xsm);
    margin: 0;
    padding: 0 var(--spacing-2xs);
    list-style: none;
}

.conversations-call-check__row {
    display: flex;
    gap: var(--spacing-smd);
    align-items: center;
    font-size: var(--font-size-sm);
}

.conversations-call-check__row > i { color: var(--color-success); }
.conversations-call-check__row[data-ok="no"] > i { color: var(--color-warning); }
.conversations-call-check__name { font-weight: var(--font-weight-heading); }

.conversations-call-check__value {
    margin-left: auto;
    color: var(--color-text-secondary);
}

.conversations-call-check__row[data-ok="no"] .conversations-call-check__value {
    color: var(--color-warning-text);
    font-weight: var(--font-weight-heading);
}

.conversations-call-check__numbers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-2xs) var(--spacing-smd);
    margin: 0 var(--spacing-2xs) 0 calc(var(--spacing-md) + var(--spacing-smd));
    padding: var(--spacing-xsm) var(--spacing-smd);
    border-radius: var(--radius-md);
    background: var(--color-page-bg-soft);
    font-size: var(--font-size-xs);
}

.conversations-call-check__numbers > div {
    display: flex;
    gap: var(--spacing-xsm);
    align-items: baseline;
    justify-content: space-between;
    white-space: nowrap;
}

.conversations-call-check__numbers dt {
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-body);
}

.conversations-call-check__numbers dd {
    margin: 0;
    font-variant-numeric: tabular-nums;
    font-weight: var(--font-weight-heading);
}

.conversations-call-check__numbers [data-weak] dd { color: var(--color-warning-text); }

.conversations-call-check__end {
    display: flex;
    gap: var(--spacing-smd);
    align-items: flex-end;
    margin: 0 var(--spacing-2xs) 0 calc(var(--spacing-md) + var(--spacing-smd));
}

.conversations-call-check__fix {
    flex: 1;
    margin: 0;
    font-size: var(--font-size-sm);
    line-height: 1.4;
}

.conversations-call-check__end > .conversations-call-audio__test { margin-left: auto; }

/* A phone: the face and state carry the call, the name steps aside first. */
@media (max-width: 767.98px) {
    .conversations-call-bar {
        gap: var(--spacing-sm);
        padding: var(--spacing-xsm) var(--spacing-smd);
    }

    .conversations-call-bar__name { display: none; }
    .conversations-call-bar__who { gap: var(--spacing-sm); }

    /* The same small space between On call and its clock as on a computer. */
    .conversations-call-bar__clock { margin-left: calc(-1 * var(--spacing-xs)); }

    /* The note's words take the row beside the icon, its buttons the row under. */
    .conversations-call-bar--note { flex-wrap: wrap; }
    .conversations-call-bar--note .conversations-call-bar__note { flex-basis: 0; }

    .conversations-call-bar--note .conversations-call-bar__actions {
        flex-basis: 100%;
        justify-content: flex-end;
    }
}

/* The frame beside the call: our own pages, opened by the box's buttons. */
.conversations-call-panel {
    position: fixed;
    top: var(--call-gap);
    right: var(--call-gap);
    bottom: var(--call-gap);
    left: var(--call-gap);
    z-index: var(--z-modal);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius-xl);
}

.conversations-call-room[data-panel="open"] .conversations-call-panel { display: flex; }

.conversations-call-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-xs) var(--spacing-xs) var(--spacing-xs) var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
}

.conversations-call-panel__title {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.conversations-call-panel__frame {
    flex: 1;
    width: 100%;
    border: 0;
    background: var(--color-page-bg);
}

/* The box moves to the left edge and the frame takes the rest. */
.conversations-call-room[data-live][data-panel="open"]:not([data-shrunk]) .conversations-call-alert__screen {
    top: var(--call-gap);
    left: var(--call-gap);
    width: var(--call-side-width);
    max-height: calc(100vh - 2 * var(--call-gap));
    transform: none;
}

.conversations-call-room[data-live][data-panel="open"]:not([data-shrunk]) .conversations-call-alert__do {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.conversations-call-room[data-live][data-panel="open"]:not([data-shrunk]) .conversations-call-alert__big {
    min-height: auto;
    font-size: var(--font-size-md);
}

.conversations-call-room[data-live][data-panel="open"]:not([data-shrunk]) .conversations-call-panel {
    left: calc(var(--call-side-width) + 2 * var(--call-gap));
}

/* Shrunk, the frame sits under the bar. */
.conversations-call-room[data-shrunk][data-panel="open"] .conversations-call-panel {
    top: calc(var(--header-bottom) + var(--call-bar-height) + 2 * var(--spacing-sm));
}

/* No room for both side by side: the box folds into its bar while the frame shows. */
@media (max-width: 1023px) {
    .conversations-call-room[data-live][data-panel="open"] .conversations-call-alert__shade,
    .conversations-call-room[data-live][data-panel="open"] .conversations-call-alert__screen {
        display: none;
    }

    .conversations-call-room[data-live][data-panel="open"] .conversations-call-alert__bar { display: flex; }

    /* Both selectors, so the side-by-side rule above never squeezes the frame. */
    .conversations-call-room[data-live][data-panel="open"] .conversations-call-panel,
    .conversations-call-room[data-live][data-panel="open"]:not([data-shrunk]) .conversations-call-panel {
        top: calc(var(--header-bottom) + var(--call-bar-height) + 2 * var(--spacing-sm));
        left: var(--call-gap);
    }
}

/* Phone: the bar runs edge to edge just under the notch, and the page moves
   down under it (every top edge reads --safe-top); the frame fills the rest
   of the screen. */
@media (max-width: 767.98px) {
    :root:has(.conversations-call-room[data-live][data-shrunk] > .conversations-call-alert:not([data-out])),
    :root:has(.conversations-call-room[data-live][data-panel="open"] > .conversations-call-alert:not([data-out])) {
        --safe-top: calc(env(safe-area-inset-top, 0px) + var(--call-bar-height) + 2 * var(--spacing-sm));
    }

    .conversations-call-room {
        --call-gap: var(--spacing-sm);
    }

    .conversations-call-alert__screen {
        padding: var(--spacing-md);
    }

    .conversations-call-alert__bar {
        top: calc(env(safe-area-inset-top, 0px) + var(--spacing-sm));
        right: var(--page-gutter);
        left: var(--page-gutter);
        transform: none;
    }

    .conversations-call-alert__bar-name {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .conversations-call-room[data-panel="open"] .conversations-call-panel,
    .conversations-call-room[data-live][data-panel="open"] .conversations-call-panel,
    .conversations-call-room[data-live][data-panel="open"]:not([data-shrunk]) .conversations-call-panel,
    .conversations-call-room[data-shrunk][data-panel="open"] .conversations-call-panel {
        inset: var(--header-bottom) 0 0;
        padding-bottom: var(--safe-bottom);
        border-width: 1px 0 0;
        border-radius: var(--radius-none);
    }
}

/* A page inside the frame draws without the app's sidebar, header and notices,
   and a form without its "Powered by" line: our screens are white label. The
   sidebar and header take no room there (tokens.css). */
.is-framed .global-sidebar,
.is-framed .global-sidebar-scrim,
.is-framed .global-app-header,
.is-framed .global-notice-slot,
:root.is-framed .public-form__footer {
    display: none;
}

.is-framed .global-app-main { margin-left: 0; }

/* ── The Book tab ────────────────────────────────────────────────────── */

/* With the Book tab open the thread shows only the person's tabs and the
   booking form, with the link the form makes under it (Nick, 2026-10-11): the
   texts, the reply box and the email reply step aside, and the form takes all
   the height that is left, on a phone and a computer. */
.conversations-thread.is-book-on .conversations-main > :not(
    .conversations-book, .conversations-book-link, .global-toast-container--inline
),
.conversations-thread.is-book-on .conversations-reply-panel {
    display: none;
}

.conversations-thread.is-book-on .conversations-main {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
}

.conversations-thread.is-book-on .conversations-book {
    min-height: var(--booking-frame-min-height);
}

.conversations-book {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.conversations-book__form {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    border: 0;
}

.conversations-book-link {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm);
    margin: var(--spacing-sm) var(--spacing-lg) 0;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-subtle);
    font-size: var(--font-size-sm);
}

.conversations-book-link__url {
    flex: 1 1 auto;
    overflow-wrap: anywhere;
}

.conversations-thread.is-book-on .conversations-main > .global-toast-container--inline {
    margin-inline: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
}

.conversations-book[hidden],
.conversations-book-link[hidden] {
    display: none;
}

/* A deleted email, in the Deleted view: its card is dimmed, and says when beside Restore. */
.conversations-email:has(.conversations-email__deleted) {
    opacity: 0.7;
}

.conversations-email__deleted {
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
}

/* One company's conversation, a card on its page: everyone at it in one
   timeline, each message with its sender's face on the left, who it went to,
   and a tag that opens its own thread. The people's tabs scroll sideways when
   they do not fit, and the timeline scrolls inside the card. */
.conversations-company__tabs {
    overflow-x: auto;
    overscroll-behavior-x: contain;
}

.conversations-company__scroll {
    max-height: 26rem;
}

/* The same card under a thread's company tab in the Inbox: the tab names the
   company, so the card's head goes, and the timeline takes the column's height. */
.conversations-company-tab > .card-header {
    display: none;
}

.conversations-company-tab .conversations-company__scroll {
    max-height: none;
    flex: 1 1 auto;
}

.conversations-company__reply {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--color-border-subtle);
}

.conversations-company__reply .form-select {
    flex: 1 1 auto;
    min-width: 0;
}

.conversations-company__reply .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.conversations-company__entry {
    align-items: flex-start;
}

/* The stack spans the row so the time sits at its right; what it holds keeps its own width. */
.conversations-company__entry .conversations-group__stack {
    flex: 1 1 auto;
    align-items: flex-start;
    max-width: none;
}

.conversations-company__entry .conversations-bubble,
.conversations-company__email {
    max-width: min(78%, 38rem);
}

/* A call card centres itself in a person's thread; here it lines up under its name. */
.conversations-company__entry .conversations-call {
    margin-inline: 0;
}

/* Ours sit on the left like theirs, so their bubble grows no tail. */
.conversations-company__entry--ours .conversations-bubble.is-tail::after {
    display: none;
}

.conversations-company__email {
    padding: var(--spacing-sm) var(--spacing-md);
}

.conversations-company__subject {
    margin: 0;
    font-weight: var(--font-weight-heading);
}

.conversations-company__words {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.conversations-company__who {
    display: flex;
    flex-wrap: wrap;
    align-self: stretch;
    gap: var(--spacing-xs);
    align-items: center;
    margin: 0 0 var(--spacing-xs);
    font-size: var(--font-size-xs);
}

.conversations-company__name {
    font-weight: var(--font-weight-medium);
}

.conversations-company__to,
.conversations-company__when {
    color: var(--color-text-secondary);
}

.conversations-company__when {
    margin-left: auto;
}

.conversations-company__tag {
    text-decoration: none;
}

.conversations-company__tag:hover {
    border-color: var(--color-action);
    color: var(--color-action);
}

.conversations-head__company {
    color: inherit;
}

/* ── The calls window (ADR-185 addendum) ─────────────────────────────
   A small window of its own: the title and the Audio pill on one row, a
   status line under them, a box when the microphone is blocked, then the
   newest calls. The status line and the box read the marks browser-calls.js
   puts on the call box: no data-voice while it signs in, "ready" once this
   browser can ring, "off" when it can't, data-mic when the microphone is why.
   The Audio panel hangs from the header over a light shade on the rest.
   The page has no app header (tokens.css), so the call box's bar sits at the
   very top, and no room to spare, so no strip is kept for a scrollbar. */
:root:has(body.conversations-calls-window) {
    scrollbar-gutter: auto;
}

.conversations-calls-window {
    background: var(--color-card-bg);
}

.conversations-calls-window__page {
    position: relative;
    padding-bottom: 6rem;
}

.conversations-calls-window__head {
    position: relative;
    z-index: var(--z-dropdown);
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-card-bg);
}

.conversations-calls-window__row {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    justify-content: space-between;
}

.conversations-calls-window__title {
    margin: 0;
    font-size: var(--font-size-h2);
    font-weight: var(--font-weight-heading);
}

/* The pill names the speaker the call plays on; open, it is pressed and its chevron turns.
   Its menu wrapper stays unplaced, so the panel hangs from the header, not from the pill. */
.conversations-calls-window__row > .conversations-calls-window__audio {
    position: static;
    min-width: 0;
}

.conversations-calls-window__pill {
    display: inline-flex;
    gap: var(--spacing-xsm);
    align-items: center;
    max-width: 14rem;
    padding: var(--spacing-xs) var(--spacing-smd);
    border-color: var(--color-border);
    color: var(--color-text);
    font-size: var(--font-size-sm);
    line-height: 1.3;
    white-space: nowrap;
}

.conversations-calls-window__pill > span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversations-calls-window__pill > .bi-headphones {
    font-size: var(--font-size-md);
}

.conversations-calls-window__chevron {
    font-size: var(--font-size-xs);
    transition: transform var(--transition-fast);
}

.conversations-calls-window__pill[aria-expanded="true"] {
    border-color: var(--color-border);
    background: var(--color-grey-100);
    color: var(--color-text);
}

.conversations-calls-window__pill[aria-expanded="true"] .conversations-calls-window__chevron {
    transform: rotate(180deg);
}

/* The panel hangs from the header's right edge on every width, the window being phone-narrow. */
.conversations-calls-window__head .conversations-call-audio {
    position: absolute;
    top: calc(100% - 0.625rem);
    right: var(--spacing-lg);
    bottom: auto;
    left: auto;
    width: 21.25rem;
    max-width: calc(100vw - 2 * var(--spacing-lg));
    margin: 0;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-menu);
    transform: none;
}

.conversations-calls-window__head .conversations-call-audio::before {
    content: none;
}

body:has(.conversations-calls-window__head .conversations-call-audio:not([hidden])) .conversations-calls-window__page::after {
    position: fixed;
    inset: 0;
    z-index: var(--z-raised);
    background: color-mix(in srgb, var(--color-scrim) 25%, transparent);
    content: "";
}

.conversations-calls-window__status {
    display: flex;
    gap: var(--spacing-xsm);
    align-items: center;
    margin: var(--spacing-2xs) 0 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    line-height: 1.4;
}

.conversations-calls-window__dot {
    flex: 0 0 auto;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: var(--radius-pill);
    background: var(--color-text-muted);
}

.conversations-calls-window__state {
    display: none;
}

.conversations-calls-window__label {
    margin: 0;
    padding: var(--spacing-md) var(--spacing-lg) 0;
}

.conversations-calls-window__list .conversations-list {
    padding: 0 var(--spacing-sm);
}

body:not(:has(#call-alert[data-voice], #call-alert[data-mic])) .conversations-calls-window__state--waiting,
body:has(#call-alert[data-voice="ready"]:not([data-mic])) .conversations-calls-window__state--ready,
body:has(#call-alert[data-mic]) .conversations-calls-window__state--mic,
body:has(#call-alert[data-voice="off"]:not([data-mic])) .conversations-calls-window__state--off {
    display: inline;
}

body:has(#call-alert[data-voice="ready"]:not([data-mic])) .conversations-calls-window__dot {
    background: var(--color-success);
}

body:has(#call-alert[data-voice="off"]) .conversations-calls-window__dot,
body:has(#call-alert[data-mic]) .conversations-calls-window__dot {
    background: var(--color-warning);
}

/* The microphone box: why this computer can't take calls, and Try again. */
.conversations-calls-window__mic {
    display: none;
    grid-template-columns: 2.25rem 1fr;
    column-gap: var(--spacing-smd);
    margin: var(--spacing-md) var(--spacing-lg) 0;
    padding: var(--spacing-smd) var(--spacing-md);
    border: 1px solid var(--color-warning-border);
    border-radius: var(--radius-lg);
    background: var(--color-warning-bg);
}

body:has(#call-alert[data-mic]) .conversations-calls-window__mic {
    display: grid;
}

.conversations-calls-window__mic-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--color-warning-border);
    border-radius: var(--radius-pill);
    background: var(--color-card-bg);
    color: var(--color-warning-text);
    font-size: var(--font-size-base);
}

.conversations-calls-window__mic-title {
    display: none;
    margin: 0;
    color: var(--color-text);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-heading);
    line-height: 1.3;
}

body:has(#call-alert[data-mic="blocked"]) .conversations-calls-window__mic-title {
    display: block;
}

.conversations-calls-window__mic-words {
    margin: var(--spacing-2xs) 0 0;
    color: var(--color-text-light);
    font-size: var(--font-size-sm);
    line-height: 1.45;
}

body:has(#call-alert[data-mic="blocked"]) .conversations-calls-window__mic-words .conversations-call-mic-words--blocked,
body:has(#call-alert[data-mic="missing"]) .conversations-calls-window__mic-words .conversations-call-mic-words--missing {
    display: inline;
}

.conversations-calls-window__retry {
    margin-top: var(--spacing-smd);
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--font-size-sm);
}

/* New call (Nick's pick C, 10-21): a dark button held at the bottom opens the
   dial pad as a sheet under the header, in the place of everything below it.
   The page keeps room at its foot so the last call shows above the button. */
.conversations-calls-window__new {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    padding: var(--spacing-xl) var(--spacing-lg) var(--spacing-mdlg);
    background: linear-gradient(to bottom, transparent, var(--color-card-bg) 34%);
}

.conversations-calls-window__new .btn {
    display: flex;
    gap: var(--spacing-smd);
    align-items: center;
    justify-content: center;
}

.conversations-calls-window__page:has(#dial-pad:not([hidden])) > .conversations-calls-window__dial ~ * {
    display: none;
}

/* In its own window the call box takes the window's whole height. */
body.conversations-calls-window .conversations-call-alert__screen {
    height: calc(100vh - var(--safe-top) - var(--safe-bottom) - 2 * var(--call-gap));
}

/* The dial pad (ADR-181 addendum, round 7; dial-pad.js): the sheet New call
   opens under the calls window's header. The field, the keys, the green Call,
   then the business number they see. */
.conversations-dial {
    color: var(--color-text);
    text-align: left;
}

.conversations-dial[hidden] { display: none; }

.conversations-dial__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-md) 0;
}

.conversations-dial__title {
    margin: 0;
    font-size: var(--font-size-h3);
    font-weight: var(--font-weight-medium);
}

.conversations-dial__find { padding: var(--spacing-smd) var(--spacing-md) 0; }

.conversations-dial__field { position: relative; }

.conversations-dial__search {
    position: absolute;
    top: 50%;
    left: 14px;
    color: var(--color-text-secondary);
    font-size: var(--font-size-lg);
    transform: translateY(-50%);
}

.conversations-dial__input.form-control {
    height: var(--control-h-touch);
    padding-right: 40px;
    padding-left: 40px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.01em;
}

.conversations-dial__input.form-control:focus {
    border-color: var(--color-focus-ring);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-focus-ring) 16%, transparent);
}

.conversations-dial__erase {
    position: absolute;
    top: 50%;
    right: 10px;
    display: flex;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--color-text-secondary);
    font-size: var(--font-size-h4);
    transform: translateY(-50%);
}

.conversations-dial__erase[hidden] { display: none; }

.conversations-dial__new,
.conversations-dial__words {
    display: flex;
    gap: var(--spacing-xsm);
    align-items: center;
    margin: var(--spacing-sm) 2px 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.conversations-dial__words { color: var(--color-error-text); }

.conversations-dial__words[hidden] { display: none; }

.conversations-dial__list {
    margin: var(--spacing-xs) 0 0;
    padding: 0;
    list-style: none;
}

.conversations-dial__pick {
    display: flex;
    gap: var(--spacing-sm);
    align-items: baseline;
    justify-content: space-between;
    width: 100%;
    padding: var(--spacing-xsm) var(--spacing-sm);
    border: 0;
    border-radius: var(--radius-md);
    background: none;
    color: var(--color-text);
    font-size: var(--font-size-md);
    text-align: left;
}

.conversations-dial__pick:hover,
.conversations-dial__pick:focus-visible { background: var(--color-page-bg-soft); }

.conversations-dial__pick-number {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    white-space: nowrap;
}

/* The keys: round, a digit over its letters ("+" under 0). */
.conversations-dial-keys {
    display: grid;
    grid-template-columns: repeat(3, var(--dial-key, 46px));
    gap: var(--spacing-sm) var(--spacing-lg);
    justify-content: center;
}

.conversations-dial > .conversations-dial-keys { padding: var(--spacing-md) var(--spacing-md) 0; }

.conversations-dial-key {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: var(--dial-key, 46px);
    height: var(--dial-key, 46px);
    padding: 0;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--color-page-bg-soft);
    color: var(--color-text);
    font-family: Poppins, sans-serif;
}

.conversations-dial-key:hover,
.conversations-dial-key:active { background: var(--color-border); }

.conversations-dial-key__digit {
    font-size: calc(var(--dial-key, 46px) * 0.4);
    font-weight: var(--font-weight-medium);
    line-height: 1;
}

.conversations-dial-key__letters {
    height: 9px;
    margin-top: 2px;
    color: var(--color-text-secondary);
    font-size: 8px;
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.14em;
    line-height: 9px;
}

.conversations-dial__go { padding: var(--spacing-md) var(--spacing-md) 0; }

.conversations-dial__call.btn {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    justify-content: center;
    border-color: var(--color-success);
    background: var(--color-success);
    box-shadow: 0 6px 16px rgba(0, 130, 58, 0.25);
    color: #fff;
    font-weight: var(--font-weight-medium);
}

.conversations-dial__call.btn:hover,
.conversations-dial__call.btn:focus-visible {
    border-color: var(--color-success);
    background: var(--color-success);
    color: #fff;
    filter: brightness(0.94);
}

.conversations-dial__from {
    margin: var(--spacing-sm) 0 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    text-align: center;
    white-space: nowrap;
}

.conversations-dial__from i { margin-right: var(--spacing-xs); }

/* Keypad on a call (browser-calls.js marks the box data-keypad): the digits
   sent, then the keys, above Mute, Keypad and Hang up; Keypad reads as pressed. */
.conversations-call-alert__keypad { display: none; }

.conversations-call-alert[data-keypad]:is([data-browser="calling"], [data-browser="on-call"]) .conversations-call-alert__keypad {
    display: block;
    margin-top: var(--spacing-md);
}

.conversations-call-alert[data-keypad] .conversations-call-alert__rounds { order: 1; }

.conversations-call-alert[data-keypad] [data-browser-call="keypad"] .conversations-call-alert__disc {
    background: var(--color-neutral-ink);
    color: var(--color-neutral-ink-fg);
}

.conversations-call-alert__digits {
    min-height: 1.5em;
    margin: 0 0 var(--spacing-sm);
    font-size: var(--font-size-h3);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.08em;
}

.conversations-dial-keys--call {
    --dial-key: 56px;
    gap: var(--spacing-smd) var(--spacing-xl);
}

.conversations-dial-keys--call .conversations-dial-key__letters {
    height: 11px;
    margin-top: var(--spacing-2xs);
    font-size: 9px;
    line-height: 11px;
}

/* After a call with a number no named contact holds (call-alert.js): the
   number, how long the call was, Create Contact and Not now. The calls window
   shows it above its list; any other page as a card in the middle. */
.conversations-call-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-mdlg) var(--spacing-lg) var(--spacing-md);
    border-bottom: 1px solid var(--color-border-hairline);
    text-align: center;
}

.conversations-call-prompt[hidden] { display: none; }

.conversations-call-room > .conversations-call-prompt {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: var(--z-modal);
    width: min(var(--call-side-width), calc(100vw - 2 * var(--call-gap)));
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    background: var(--color-card-bg);
    box-shadow: var(--shadow-modal);
    transform: translate(-50%, -50%);
}

.conversations-call-prompt__face {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-pill);
    background: var(--color-page-bg-soft);
    color: var(--color-text-secondary);
    font-size: 1.4rem;
}

.conversations-call-prompt__number {
    margin: var(--spacing-sm) 0 0;
    color: var(--color-text);
    font-family: Poppins, sans-serif;
    font-size: 1.375rem;
    font-weight: var(--font-weight-medium);
    line-height: 1.2;
}

.conversations-call-prompt__ended {
    display: flex;
    gap: var(--spacing-xsm);
    align-items: center;
    margin: var(--spacing-xs) 0 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-md);
}

.conversations-call-prompt__add.btn {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    justify-content: center;
    margin-top: var(--spacing-md);
}

.conversations-call-prompt__later {
    margin-top: var(--spacing-sm);
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-text-secondary);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    text-decoration: underline;
    text-decoration-color: var(--color-grey-400);
    text-underline-offset: 3px;
}

/* Contacts, the CRM plugin's pages (ADR-185): the list of an org's people and
   each one's page. Built desktop first at 1440px; on a phone the columns stack
   and nothing runs off the screen. Tokens only. */

/* ── The list ───────────────────────────────────────────────────────────── */
/* Laid out on the creatives list's own pieces (workers list card, global-grid,
   person chip, bottom bar); only what a link header needs over a button one. */

.crm-list .global-grid__sort {
    text-decoration: none;
}

.crm-list .global-grid__sort:hover span {
    text-decoration: underline;
}

.crm-list__muted {
    color: var(--color-text-secondary);
}

/* ── A contact's page ───────────────────────────────────────────────────── */
/* The page is a creative's profile shell (workers.css); this is the wrapper the
   add, change and merge pages still stand in, and what the profile has no card for. */

.crm-contact {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    width: 100%;
    max-width: 72rem;
    margin: 0 auto;
    padding: var(--spacing-lg) var(--page-gutter);
}

.crm-contact__back {
    align-self: flex-start;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    text-decoration: none;
}

/* The timeline in the profile's Activity card, inset like its feed rows. */
.crm-contact__moments {
    padding: 0 var(--spacing-md);
}

/* The money facts in three even columns, so the sixth never wraps on its own. */
.crm-contact__money .global-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--spacing-md);
}

.crm-contact__money .global-facts__item {
    padding: 0;
    border-left: 0;
}

/* ── Galleries, on the page and the card ───────────────────────────────── */

.crm-galleries {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: var(--spacing-md);
}

.crm-gallery {
    overflow: hidden;
}

.crm-gallery__cover {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 3 / 2;
    background: var(--color-surface-subtle);
    color: var(--color-text-secondary);
    font-size: var(--font-size-xl);
}

.crm-gallery__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.crm-gallery__body {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    padding: var(--spacing-smd) var(--spacing-md) var(--spacing-md);
}

.crm-gallery__title {
    display: flex;
    gap: var(--spacing-sm);
    align-items: baseline;
    justify-content: space-between;
    margin: 0;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-heading);
}

.crm-gallery__when {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.crm-gallery__actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-xs);
}

/* ── Adding, changing and merging a contact ─────────────────────────────── */

.crm-form {
    max-width: 40rem;
}

.crm-form__card {
    padding: var(--spacing-lg);
}

.crm-form__title {
    margin: 0 0 var(--spacing-md);
    font-size: var(--font-size-h3);
    font-weight: var(--font-weight-heading);
}

.crm-form fieldset legend {
    float: none;
    width: auto;
    margin-bottom: var(--spacing-xs);
}

.crm-form__box + .crm-form__box {
    margin-top: var(--spacing-sm);
}

.crm-form__merge {
    display: block;
    margin-top: var(--spacing-xs);
}

.crm-contact__same-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.crm-contact__same-row .btn {
    flex-shrink: 0;
}

.crm-form__fixed {
    margin: 0;
    color: var(--color-text-secondary);
}

.crm-form__actions {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
}

.crm-merge__lead {
    margin: 0;
    color: var(--color-text-secondary);
}

.crm-merge__pair {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: var(--spacing-md);
    align-items: start;
}

.crm-merge__side {
    padding: var(--spacing-md);
}

.crm-merge__arrow {
    align-self: center;
    font-size: var(--font-size-xl);
    color: var(--color-text-secondary);
}

.crm-merge__name {
    font-weight: var(--font-weight-heading);
}

.crm-merge__found {
    margin: var(--spacing-md) 0 0;
    padding: 0;
    list-style: none;
}

.crm-merge__found li + li {
    border-top: 1px solid var(--color-border);
}

.crm-merge__found a {
    display: block;
    padding: var(--spacing-sm) 0;
    color: var(--color-text);
    text-decoration: none;
}

.crm-merge__found a:hover .crm-merge__name {
    text-decoration: underline;
}

.crm-merge__found .conversations-muted {
    padding: var(--spacing-sm) 0;
}

/* A company's people list: the initials sit a step under the face's own size. */
.crm-company__face {
    font-size: var(--font-size-xs);
}

/* A company's People card and, on a partner, its Referrals card: one zone the
   Partner switch redraws, spaced like the column it sits in. */
.crm-company__zone {
    display: grid;
    gap: var(--spacing-md);
    min-width: 0;
}

/* A person's row keeps their name and ways to reach them whole: on a narrow
   card the badges and buttons drop to a line of their own. */
.crm-company__person {
    flex-wrap: wrap;
}

.crm-company__person .workers-profile-file-main {
    flex: 1 1 12rem;
    min-width: 0;
}

/* A suggested person's row spaces its tick box, face and name as a person's row does.
   Two classes, so the shared row's own gap (workers.css, loaded later) does not win. */
.crm-company__person.crm-company__suggestion {
    gap: var(--spacing-md);
}

/* The Suggested heading reads as the quiet line it sits in. */
.crm-company__heading {
    margin: 0;
    font-weight: inherit;
    line-height: inherit;
}

/* A person's portal access: quiet text after a small dot, green when on. */
.crm-company__access-state {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
}

.crm-company__access-state::before {
    content: "";
    width: var(--spacing-sm);
    height: var(--spacing-sm);
    border-radius: var(--radius-pill);
    background: var(--color-border);
}

.crm-company__access-state--on::before {
    background: var(--color-success);
}

/* The People card's tick count and its Give access and Remove access buttons, under the people. */
.crm-company__access {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-top: 1px solid var(--color-border);
}

/* ── The record's top card, as HubSpot's contact record does it (Nick, 10-22) ── */
/* No page title over the cards. The top card's own bar carries the way back to
   the list on the left and the record's menu on the right; the face sits beside
   the name with the email and number under it; the ways to reach them are a row
   of round buttons with a word under each. */

.crm-record__bar {
    gap: var(--spacing-sm);
}

.crm-record__back {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2xs);
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
}

.crm-record__back:hover {
    text-decoration: underline;
}

.crm-record .workers-profile-identity-name {
    font-size: var(--font-size-h3);
}

.crm-record__reach {
    font-size: var(--font-size-sm);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-record__quick {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.crm-record__quick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-2xs);
    min-width: 3.25rem;
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    text-decoration: none;
}

.crm-record__quick-circle,
.crm-record__quick-item .global-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--control-h-base);
    height: var(--control-h-base);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-card-bg);
    color: var(--color-text);
    font-size: var(--font-size-md);
}

.crm-record__quick-item:hover .crm-record__quick-circle,
.crm-record__quick-item .global-icon-btn:hover {
    border-color: var(--color-text);
    color: var(--color-text);
}

/* A company's face in the same seat: the building, not initials. */
.crm-record__building {
    font-size: var(--font-size-h2);
}

/* In the rail the money facts stand two to a row, label over value. */
.workers-profile-rail .crm-contact__money .global-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* The My Projects page: one row per project under the shared saved-view tabs
   and toolbar. Look A (Nick, 11-13): the kind icon and the name, the subline
   with the step badge, the team's faces, the next step, then the ⋮. The step
   button is one house button at the header row's pill size, with no caret;
   the other actions sit in the ⋮. Rows read like the Sign Up board's. */

/* The body card hands its height down this flex column, so the rows scroll in
   their own box and the count stays put as the card's footer. */
.opportunities-projects__list {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.opportunities-projects__scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* One grid for the whole list, and each row is a subgrid of it. So the faces,
   the next steps and the ⋮ take one column each, and line up down the list. */
.opportunities-projects__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
}

.opportunities-projects__row {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    align-items: center;
    gap: var(--spacing-md) var(--spacing-lg);
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--color-border-subtle);
}

/* The tint, as on the global grid: the row's rule is drawn in the hover grey. */
.opportunities-projects__row:hover {
    background: var(--color-action-tint);
}

/* An editor is open on the photos: the whole row puts its Edit popup back. */
.opportunities-projects__row.is-locked {
    cursor: pointer;
}

.opportunities-projects__cell {
    min-width: 0;
    white-space: nowrap;
}

.opportunities-projects__cell--name {
    grid-column: 1;
}

/* The kind icon and the name share the top line. */
.opportunities-projects__head {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 0;
    margin-bottom: var(--spacing-xs);
}

.opportunities-projects__kind {
    flex: none;
    color: var(--color-text-muted-cool);
    font-size: var(--font-size-lg);
}

/* The gallery's cover takes the icon's place once the gallery has one. It is
   cropped to its small box, so a photo of any shape keeps the line's height. */
.opportunities-projects__cover-image {
    display: block;
    flex: none;
    width: var(--spacing-2xl);
    height: var(--spacing-xl);
    object-fit: cover;
    border-radius: var(--radius-sm);
}

/* The Shared badge sits after the name, outside it, so a long name never
   pushes it to a line of its own. */
.opportunities-projects__shared {
    flex: none;
}

.opportunities-projects__name {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: var(--color-text);
    font-size: var(--font-size-h4);
    font-weight: var(--font-weight-heading);
    line-height: var(--line-height-heading);
    text-overflow: ellipsis;
    cursor: text;
}

/* The subline, then the step badge. The badge sits outside the status line,
   because the edit script repaints that line. */
.opportunities-projects__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: var(--spacing-xs);
    min-width: 0;
    color: var(--color-text-muted-cool);
    font-size: var(--font-size-md);
}

.opportunities-projects__status {
    min-width: 0;
    overflow: hidden;
    color: var(--color-text-muted-cool);
    font-size: var(--font-size-md);
    text-overflow: ellipsis;
}

/* A row with no date has an empty status line. It takes no room, so the step
   badge starts the line with no gap before it. */
.opportunities-projects__status:empty {
    display: none;
}

.opportunities-projects__people {
    grid-column: 2;
}

/* Look B (Nick, 11-15): the name opens the project drawer. It is a plain
   button that reads as the name, and a click on the rest of the row clicks it
   too (_row.html). */
.opportunities-projects__row:has(.opportunities-projects__open) {
    cursor: pointer;
}

.opportunities-projects__open {
    max-width: 100%;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: start;
    text-overflow: ellipsis;
    cursor: pointer;
}

.opportunities-projects__open:hover,
.opportunities-projects__open:focus-visible {
    text-decoration: underline;
}

/* On a computer the open project drawer takes room from the list. A long
   name then wraps to a second line before it is cut, as on a phone. */
body:has(.opportunities-projects__drawer.is-open) .opportunities-projects__name {
    display: -webkit-box;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* The faces open the drawer on People. The tint on a hover is one step deeper
   than the row's own tint, so it shows on a row under the pointer. */
.opportunities-projects__faces {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    padding: var(--spacing-2xs);
    border: 0;
    border-radius: var(--radius-pill);
    background: none;
    cursor: pointer;
}

.opportunities-projects__faces:hover,
.opportunities-projects__faces:focus-visible {
    background: var(--color-action-tint-pressed);
}

/* The step button, the ⋮ and the waiting line are each a cell of the row. */
.opportunities-projects__actions {
    display: contents;
}

.opportunities-projects__next {
    display: flex;
    grid-column: 3;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm);
}

.opportunities-projects__actions > .global-action-dropdown {
    grid-column: 4;
}

/* Whose turn it is, in grey with that face. */
.opportunities-projects__waiting {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--color-text-muted-cool);
    font-size: var(--font-size-md);
    white-space: nowrap;
}

/* An invite's Accept and Decline, side by side. */
.opportunities-projects__answer {
    display: flex;
    gap: var(--spacing-sm);
}

/* A member the People box may not add for the part picked: greyed, with the reason beside.
   A picked person who no longer matches wears it on the face and the name, so Remove stays live. */
.opportunities-projects__offer--off {
    opacity: 0.45;
}

.opportunities-projects__offer-reason {
    color: var(--color-text-muted-cool);
    font-size: var(--font-size-sm);
    white-space: nowrap;
}

/* The bar under a processing row's status line, capped so it reads as the line's, not the row's. */
.opportunities-projects__progress {
    max-width: 24rem;
    margin-top: var(--spacing-xsm);
}

/* A stop and a failed job read in the error colour, as a menu's Delete does. */
.opportunities-projects__error {
    color: var(--color-error-text);
}

.opportunities-projects__practice {
    grid-column: 1 / -1;
    min-width: 0;
    white-space: normal;
}

.opportunities-projects__practice-tips {
    margin: var(--spacing-sm) 0 0;
    padding-left: var(--spacing-lg);
}

/* Every step button is one fixed width, sized to the longest ("Upload More"),
   so the buttons line up in a column, and one height at the header row's pill
   size, so a Process looks the same as an Upload More. */
.opportunities-projects__step .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 8.75rem;
    height: var(--control-h-base);
    padding-top: 0;
    padding-bottom: 0;
}

/* The Edit popup's card: the modal body spaces it, so it keeps no margin of its own. */
[data-connect-popup] > .global-glass {
    margin-bottom: 0;
}

/* The team part of the New Project drawer. "Just me" turns it off. */
.opportunities-projects__team {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

/* The People box of the New Project drawer: the owner, then each person picked. */
.opportunities-projects__people-list {
    margin: 0 0 var(--spacing-sm);
    padding: 0;
    list-style: none;
}

.opportunities-projects__person {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) 0;
}

/* The name, the part and "Gets an invite". On a narrow drawer the note wraps
   to a line of its own, so no word is cut. */
.opportunities-projects__person-about {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-xs) var(--spacing-sm);
    min-width: 0;
}

.opportunities-projects__person-remove {
    flex: none;
    margin-left: auto;
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-action);
    font-size: var(--font-size-sm);
}

.opportunities-projects__person-remove:hover,
.opportunities-projects__person-remove:focus-visible {
    text-decoration: underline;
}

.opportunities-projects__add-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    margin: var(--spacing-smd) 0 var(--spacing-xs);
}

.opportunities-projects__add-label {
    margin-bottom: 0;
}

.opportunities-projects__search {
    display: flex;
    margin-bottom: var(--spacing-xs);
}

.opportunities-projects__who {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 0;
}

/* The tabs of the project drawer sit under its head, in the look of the
   role panel's tabs (opportunity-form.css). They keep one line. */
.opportunities-projects__tabs {
    flex: none;
    flex-wrap: nowrap;
    padding-inline: var(--spacing-mdlg);
}

/* The People tab (Nick, 11-15): the Search people box, then one line per
   person. The block is a container, so a narrow drawer puts how far a person
   is on the line under the name and the picker. The ⋮ column is as wide as
   the ⋮ itself, a thumb's width on a phone. */
.opportunities-projects__members {
    --projects-menu-w: var(--control-h-base);
    container: project-people / inline-size;
}

.opportunities-projects__member-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.opportunities-projects__find + .opportunities-projects__member-list {
    margin-top: var(--spacing-smd);
    border-top: 1px solid var(--color-border-subtle);
}

.opportunities-projects__member {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
    padding: var(--spacing-smd) 0;
    border-bottom: 1px solid var(--color-border-subtle);
}

.opportunities-projects__member:last-child {
    border-bottom: 0;
}

.opportunities-projects__member-text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: var(--spacing-2xs);
    min-width: 0;
}

.opportunities-projects__member-name {
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
}

/* A line breaks between two pieces, never inside one, so a time stays whole. */
.opportunities-projects__member-state {
    color: var(--color-text-muted-cool);
    font-size: var(--font-size-sm);
}

.opportunities-projects__member-state .opportunities-projects__seg {
    white-space: nowrap;
}

.opportunities-projects__member-parts {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--spacing-xs);
}

/* For the owner or an editor each line is a grid, so each part picker and
   each ⋮ has its own column. A picker is three thumb heights wide. The ⋮
   column keeps its width on the owner's line too, and the owner's badges
   start where the words of a picker start. The owner has no ⋮, so Owner and
   Editor take the ⋮ column too and stay on one line. */
.opportunities-projects__member--part {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) calc(var(--control-h-touch) * 3) var(--projects-menu-w);
    row-gap: var(--spacing-xs);
}

.opportunities-projects__member--part .opportunities-projects__member-parts {
    justify-content: flex-start;
    padding-left: var(--spacing-smd);
}

.opportunities-projects__member--part .opportunities-projects__member-parts:last-child {
    grid-column: 3 / -1;
}

.opportunities-projects__part {
    min-width: 0;
}

/* The Search people box and its list. The list is the house menu, laid over
   the lines under the box. */
.opportunities-projects__find {
    position: relative;
}

.opportunities-projects__find-list {
    position: absolute;
    top: calc(100% + var(--spacing-xs));
    right: 0;
    left: 0;
    max-height: calc(var(--control-h-touch) * 6);
    overflow-y: auto;
    overscroll-behavior-y: contain;
    container: project-find / inline-size;
}

/* A member found: the face and the name, then the part picker and Invite, or
   the reason in grey at the right. The line has the padding of a house menu row. */
.opportunities-projects__found {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xsm) var(--spacing-sm);
}

.opportunities-projects__found--joins {
    grid-template-columns: auto minmax(0, 1fr) calc(var(--control-h-touch) * 3) auto;
}

/* A name breaks between words. Only a word wider than the column breaks inside. */
.opportunities-projects__found-name {
    min-width: 0;
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
    overflow-wrap: break-word;
}

.opportunities-projects__found .opportunities-projects__offer-reason {
    justify-self: end;
}

/* A narrow list puts the picker and Invite on a second line, under the name. */
@container project-find (max-width: 399.98px) {
    .opportunities-projects__found--joins {
        grid-template-columns: auto minmax(0, 1fr) auto;
        row-gap: var(--spacing-xs);
    }

    .opportunities-projects__found--joins > .global-avatar {
        grid-row: 1 / 3;
    }

    .opportunities-projects__found--joins > .opportunities-projects__found-name {
        grid-column: 2 / -1;
    }
}

/* A narrow block puts the name beside the picker, and how far the person is
   on the line under both. */
@container project-people (max-width: 479.98px) {
    .opportunities-projects__member--part {
        gap: var(--spacing-2xs) var(--spacing-sm);
        grid-template-columns: auto minmax(0, 1fr) calc(var(--control-h-touch) * 2.75) var(--projects-menu-w);
    }

    .opportunities-projects__member--part > .opportunities-projects__member-text {
        display: contents;
    }

    .opportunities-projects__member--part > .global-avatar {
        grid-row: 1 / 3;
    }

    .opportunities-projects__member--part .opportunities-projects__member-state {
        grid-row: 2;
        grid-column: 2 / 4;
    }
}

/* The Sign Up board's phone rung: a bigger title that wraps to two lines
   before it cuts, and a subline that wraps between its pieces. Each row is
   its own grid. The name takes the top line beside the ⋮. The faces and the
   next step share the line under it, the next step at the right. */
@media (max-width: 767.98px) {
    /* The icon and the Shared badge line up with the first line of a long name. */
    .opportunities-projects__head {
        align-items: baseline;
    }

    .opportunities-projects__name {
        display: -webkit-box;
        font-size: var(--font-size-h3);
        white-space: normal;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .opportunities-projects__status {
        white-space: normal;
    }

    .opportunities-projects__seg {
        white-space: nowrap;
    }

    .opportunities-projects__grid {
        display: block;
    }

    .opportunities-projects__row {
        grid-template-columns: auto minmax(0, 1fr) auto;
        row-gap: var(--spacing-smd);
    }

    .opportunities-projects__cell--name {
        grid-area: 1 / 1 / 2 / 3;
    }

    .opportunities-projects__row:not(:has(.global-action-dropdown)) .opportunities-projects__cell--name {
        grid-column: 1 / -1;
    }

    .opportunities-projects__actions > .global-action-dropdown {
        grid-area: 1 / 3;
        align-self: start;
    }

    .opportunities-projects__people {
        grid-area: 2 / 1;
    }

    .opportunities-projects__next {
        grid-area: 2 / 2 / 3 / 4;
        justify-content: flex-end;
        min-width: 0;
    }

    /* Accept and Decline share the line beside the faces, so neither covers them. */
    .opportunities-projects__answer {
        flex: 1 1 auto;
        min-width: 0;
    }

    .opportunities-projects__answer .btn {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
    }

    /* Each button in the team part of the drawer is a thumb's height. */
    .opportunities-projects__team .btn,
    .opportunities-projects__person-remove,
    .opportunities-projects__found .btn {
        min-width: var(--control-h-touch);
        min-height: var(--control-h-touch);
    }

    /* A long name wraps to a second line before it is cut. */
    .opportunities-projects__open {
        white-space: normal;
    }

    /* The faces are a thumb's height. They have no padding at the left, so
       they start where the name starts. */
    .opportunities-projects__faces {
        min-height: var(--control-h-touch);
        padding-left: 0;
    }

    .opportunities-projects__members {
        --projects-menu-w: var(--control-h-touch);
    }

    /* The panel slides on a transform, so the house bottom sheet of a ⋮ menu
       would pin to the panel, a second sheet. In the project drawer the ⋮ of
       a person opens its menu in place, under the ⋮, as on a computer. */
    .opportunities-projects__drawer .global-action-dropdown-menu {
        position: absolute;
        inset: 100% 0 auto auto;
        width: max-content;
        margin-top: var(--spacing-xs);
        padding: var(--spacing-xsm);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-lg);
        z-index: var(--z-dropdown);
        overflow: hidden;
    }

    .opportunities-projects__drawer .global-action-dropdown-menu::before {
        display: none;
    }

    /* While a drawer is open, the house toast sits under the top bar
       (toast-notifications.css). The project sheet stops under a toast of
       three lines, so a toast never covers its name and its X. The band holds
       the gaps over and under the toast, its padding, and three lines of its
       words (1.45 is the toast's own line height). */
    .opportunities-projects__drawer.global-drawer-panel {
        max-height: calc(100dvh - var(--header-bottom) - var(--sheet-bottom) - 2 * var(--spacing-sm) - 2 * var(--spacing-md) - 3 * 1.45 * var(--font-size-lg));
    }
}

/* A narrow phone keeps the style on its own line, with no dot. */
@media (max-width: 480px) {
    .opportunities-projects__seg--style {
        display: block;
    }

    .opportunities-projects__dot {
        display: none;
    }
}

/* The Receivables page: one totals line, then one row per balance with one button.
   The table is the shared grid (.global-grid); only the totals line, the paid rows'
   grey, the pay link box and the phone's stacked rows live here. The Owes card on a
   contact's page wears the same button, so its row lives here too. */

.bookings-receivables-read-at {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.bookings-receivables-queue__totals {
    margin: 0 0 var(--spacing-md);
    color: var(--color-text-secondary);
}

.bookings-receivables-queue__totals strong {
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
}

/* The queue is the page, so it grows with the page instead of scrolling in a box,
   and the pay link box it opens sits above the whole page, not just the table. */
.bookings-receivables-queue-wrap {
    max-height: none;
    overflow: visible;
    isolation: auto;
}

.bookings-receivables-queue__client {
    font-weight: var(--font-weight-medium);
}

.bookings-receivables-queue__amt {
    text-align: right;
}

.bookings-receivables-queue__act {
    text-align: right;
}

.bookings-receivables-queue .is-settled .global-grid__cell {
    color: var(--color-text-muted);
}

.bookings-receivables-queue__form {
    display: inline-block;
    flex-shrink: 0;
    text-align: left;
}

.bookings-receivables-queue__form > .btn {
    white-space: nowrap;
}

.bookings-receivables-paylink__note {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.bookings-receivables-paylink__link {
    font-size: var(--font-size-sm);
}

/* The balances sit under the money facts in the same card. */
.crm-contact__money .card-body + .crm-contact__owes {
    border-top: 1px solid var(--color-border);
}

.crm-contact__owes-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.crm-contact__owes-main {
    min-width: 0;
}

.crm-contact__owes-when {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.crm-contact__owes-amt {
    margin-left: auto;
    font-weight: var(--font-weight-medium);
}

/* A phone has no room for five columns: each row becomes a three-line block,
   client and dollars on top, the button on the right. */
@media (max-width: 575.98px) {
    .bookings-receivables-queue thead {
        display: none;
    }

    .bookings-receivables-queue .global-grid__row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "client amt"
            "booking act"
            "when act";
        gap: var(--spacing-2xs) var(--spacing-sm);
        padding: var(--spacing-smd) var(--spacing-md);
        border-bottom: 1px solid var(--color-border-subtle);
    }

    .bookings-receivables-queue tr.global-grid__row td.global-grid__cell {
        display: block;
        height: auto;
        padding: 0;
        border: 0;
        background: transparent;
        white-space: normal;
    }

    .bookings-receivables-queue .global-grid__row:nth-child(even) {
        background: var(--color-surface-subtle);
    }

    .bookings-receivables-queue__client {
        grid-area: client;
    }

    .bookings-receivables-queue__amt {
        grid-area: amt;
    }

    .bookings-receivables-queue__booking {
        grid-area: booking;
    }

    .bookings-receivables-queue__when {
        grid-area: when;
        color: var(--color-text-muted);
    }

    .bookings-receivables-queue__act {
        grid-area: act;
        align-self: center;
    }

    .crm-contact__owes-row {
        flex-wrap: wrap;
    }
}

/* The Reports tab: the list's toolbar, tabs and card, the sharing drawer, the
   builder (the result fills the page; its settings sit in the docked settings
   drawer) and the report page. */

/* ── The list ────────────────────────────────────────────────────────── */

/* The toolbar as the mockup draws it: the pill search, a chip for each filter
   right beside it, and the sort chip at the row's end. A phone keeps the search
   on the list and folds the chips into the drawer (_list_toolbar.html). */
.reports-list__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm);
}

.reports-list__toolbar--desk {
    flex: 1 1 auto;
    min-width: 0;
}

.reports-list__toolbar--stack {
    flex-direction: column;
    align-items: stretch;
}

.reports-list__fold {
    display: none;
}

/* The list's search wears the chips' white fill, hairline ring and height. The
   house search sheet (filter-bar.css) loads before this one, so its hover and
   focus borders are said again here, or the ring above would cover them. */
.reports-list__search .global-filter-control {
    height: var(--control-h-base);
    background: var(--color-card-bg);
    border-color: var(--color-border-hairline);
}

.reports-list__search .global-filter-control:hover {
    border-color: var(--color-grey-400);
}

.reports-list__search .global-filter-control:focus {
    border-color: var(--color-focus-ring);
}

/* The house header sends whatever follows its search to the row's far end
   (page-header.css). The mockup sets the chips right beside the search, so the
   first chip drops that margin (four classes beat its three) and only the sort
   rides the end. */
.global-page-header .reports-list__toolbar .global-page-search + .reports-list__filter {
    margin-left: 0;
}

.reports-list__sort {
    margin-left: auto;
}

.reports-list__toolbar--stack .reports-list__sort {
    margin-left: 0;
}

.reports-list__chip {
    height: var(--control-h-base);
    font-family: var(--font-family);
    cursor: pointer;
}

.reports-list__chip:hover {
    border-color: var(--color-grey-400);
}

.reports-list__chip.is-on {
    background: var(--color-action-tint);
    border-color: var(--color-action);
}

.reports-list__chip .bi-chevron-down {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
}

/* A chip reads its field's word until a pick fills in the value. The value
   span holds no spaces, so it is empty when nothing is picked. */
.reports-list__chip-value:empty {
    display: none;
}

.reports-list__chip-value:not(:empty) + .reports-list__chip-word {
    display: none;
}

/* A filter's menu opens from its chip's left edge, like the dashboard's chips.
   The sort at the row's end keeps the house right edge, and a phone keeps the
   house bottom sheet. */
@media (min-width: 768px) {
    .reports-list__filter .global-action-dropdown-menu {
        left: 0;
        right: auto;
    }
}

/* The drawer's copy. The panel slides on a transform, so a bottom sheet inside
   it would pin to the panel rather than the screen: each menu opens in place
   under its chip instead. The search stays on the list, so the drawer hides its
   own copy, whose value still rides along with a pick. */
.reports-list__toolbar--stack .reports-list__search {
    display: none;
}

.reports-list__toolbar--stack .reports-list__chip {
    width: 100%;
}

.reports-list__toolbar--stack .reports-list__chip .bi-chevron-down {
    margin-left: auto;
}

.reports-list__toolbar--stack .global-action-dropdown-menu {
    position: static;
    width: auto;
    min-width: 0;
    max-width: none;
    margin: var(--spacing-xs) 0 0;
    border: 1px solid var(--color-grey-200);
    border-radius: var(--radius-md);
    box-shadow: none;
    overflow: hidden;
}

.reports-list__toolbar--stack .global-action-dropdown-menu::before {
    display: none;
}

.reports-list__toolbar--stack .global-action-dropdown-item:first-child {
    border-radius: var(--radius-none);
}

.reports-list__star {
    margin-right: var(--spacing-xs);
    font-size: var(--font-size-xs);
    color: var(--color-warning);
}

/* The list stands in its own card with a grey head band, as the mockup draws
   it. The card clips the band to its rounded corners, and the last row drops
   its rule so it never doubles the card's edge. */
.reports-list__card {
    overflow: hidden;
}

.reports-list__card .global-grid__head {
    padding: var(--spacing-smd) var(--spacing-md);
    background: var(--color-grey-50);
    border-bottom-color: var(--color-border-hairline);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.reports-list__card tbody tr:last-child .global-grid__cell {
    border-bottom: 0;
}

/* Each row's menu sits at the row's end. */
.reports-list__card .global-grid__cell--filler {
    text-align: end;
}

.reports-list__name {
    font-weight: var(--font-weight-medium);
}

/* On a desk the grid's scroll box would cut a menu hung under its button, so
   the menu is fixed to the screen at the button's spot (_row_menu.html sets
   it). Both classes, so this beats main.css, which loads after this sheet. A
   phone keeps main.css's bottom sheet, which is fixed already. */
@media (min-width: 768px) {
    .global-action-dropdown-menu.reports-list__menu-panel {
        position: fixed;
        margin: var(--spacing-xs) 0;
    }
}

/* A dashboard's two drawers on a desk with the side menu open: Who sees it and
   View settings. From 1200px up a drawer pushes the page aside (drawer.css),
   and with the side menu open that left a dashboard about 430px in the middle
   at 1200px. So below the side menu (--sidebar-width, 256) + the panel
   (--drawer-width, 500) + the narrowest middle the dashboard's desk layout is
   drawn for (--reports-dash-min-middle, 768: where its phone rules stop, and
   1024 - 256 with the side menu open), 1524 in all, those drawers float over
   the page as every drawer does under 1200px and a side panel does on a phone:
   no push, the scrim, flush under the header, the overlay halo, the page held
   still (Nick, 09-26). Each rule names the drawer's root, whose scrim and panel
   are its children. Who sees it (_saved_view_sharing_dialog.html) is fetched
   into the sharing box that base/app.html draws after the page. View settings
   (_view_controls.html) follows the dashboard. View settings stays in the page
   when it is closed, so the push, the halo and the lock ask for an open panel.
   A closed drawer then changes nothing on the page. Who sees it comes in closed
   and opens two frames later, but View settings is still open in those frames,
   so the page does not move. A media query cannot read a custom property, so
   the query holds the sum, .02 under it, and test_dashboard_page.py pins the
   two together. */
.reports-dash {
    --reports-dash-min-middle: 768px;
}

@media (min-width: 1200px) and (max-width: 1523.98px) {
    .global-app-layout:not(.is-sidebar-collapsed):has(:is(.reports-dash ~ * > .opportunities-sharing,
        .reports-dash ~ .reports-view-drawer) > .global-drawer-panel.is-open) {
        --content-push: var(--content-push-none);
    }

    .global-app-layout:not(.is-sidebar-collapsed) :is(.reports-dash ~ * > .opportunities-sharing,
        .reports-dash ~ .reports-view-drawer) > .global-drawer-scrim {
        display: block;
        left: 0;
    }

    .global-app-layout:not(.is-sidebar-collapsed) :is(.reports-dash ~ * > .opportunities-sharing,
        .reports-dash ~ .reports-view-drawer) > .global-drawer-panel {
        top: var(--drawer-top);
        border-left: 0;
        border-top-left-radius: var(--radius-none);
    }

    .global-app-layout:not(.is-sidebar-collapsed) :is(.reports-dash ~ * > .opportunities-sharing,
        .reports-dash ~ .reports-view-drawer) > .global-drawer-panel.is-open {
        box-shadow: var(--shadow-modal);
    }

    body.is-drawer-lock:has(.global-app-layout:not(.is-sidebar-collapsed) :is(.reports-dash ~ * > .opportunities-sharing,
        .reports-dash ~ .reports-view-drawer) > .global-drawer-panel.is-open) {
        overflow: hidden;
    }
}

@media (max-width: 767.98px) {
    /* Scoped to the actions cluster so it outranks main.css's phone rule that
       turns every .btn:not(.btn-close) into a flex box (main.css loads after
       this sheet, so an equal selector loses); without it the desk-only button
       stayed on and pushed New report off the right edge of the card. */
    .global-page-header__actions .btn.reports-list__new-dashboard {
        display: none;
    }

    /* The phone list keeps its search and folds the chips and the sort into
       the drawer behind the sliders button. */
    .reports-list__toolbar--desk .reports-list__filter,
    .reports-list__toolbar--desk .reports-list__sort {
        display: none;
    }

    .global-page-header .reports-list__toolbar--desk .global-page-search {
        flex: 1 1 auto;
        max-width: none;
    }

    .reports-list__fold {
        display: block;
    }

    /* The house header strip scrolls sideways with its bar hidden, which cut
       the last tab off on a phone. This strip wraps instead (page-header.css). */
    .global-page-header__tabs .global-tabs.reports-list__tabs {
        flex-wrap: wrap;
        overflow-x: visible;
    }
}

/* ── The builder ─────────────────────────────────────────────────────── */

/* The head is one card row: the back arrow, the name read as a title, then the
   actions, pushed to the end by the spacer. The save form draws no box of its
   own, so its name and buttons sit in the row itself. Only the name gives way
   when the row is tight, and on a desk the row itself never wraps. It pads,
   spaces its buttons and stands off the result as the header card on the
   People, Bills and Opps pages does (components/page-header.css). */
.reports-builder__head {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--spacing-xsm);
    padding: var(--spacing-smd) var(--spacing-md);
    margin-bottom: var(--spacing-mdlg);
}

.reports-builder__head > *,
.reports-builder__save > * {
    flex: none;
}

.reports-builder__back {
    margin-right: auto;
    font-size: var(--font-size-sm);
    text-decoration: none;
}

/* The name sits right after the back arrow, the record pages' own
   (global-record-header__back). Its margin and the row's gap keep the space the
   house header bar leaves between the arrow and the title. */
.reports-builder__back-arrow {
    order: -2;
    margin-right: var(--spacing-xsm);
}

.reports-builder__save {
    display: contents;
}

/* The name is a bordered box of a control's height, as option C draws it: the
   name in the heading weight, the empty box's placeholder in the body weight.
   A name longer than its room ends in an ellipsis until it is focused. */
.reports-builder__name {
    order: -1;
    flex: 0 1 22.5rem;
    min-width: 0;
    height: var(--control-h-base);
    text-overflow: ellipsis;
    padding: 0 var(--spacing-smd);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-heading);
    color: var(--color-text);
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.reports-builder__name::placeholder {
    font-weight: var(--font-weight-body);
    color: var(--color-text-muted);
}

/* The hover darkens the border as the house text box does. */
.reports-builder__name:hover {
    border-color: var(--color-text-muted);
}

.reports-builder__name:focus {
    border-color: var(--color-focus-ring);
    outline: 0;
    box-shadow: var(--shadow-focus-ring);
}

.reports-builder__spacer {
    flex: 1 1 auto;
}

/* The More menu's own Add to dashboard is the phone's; a desk has the button.
   The head in the selector outranks the menu item's own display rule. */
.reports-builder__head .reports-builder__more-add {
    display: none;
}

/* On a desk the result card reaches down toward the foot of the window however
   short the result is, so the chart has room to stand; the head card and the gaps
   round it take the rest. Print keeps the card's own height. */
@media screen and (min-width: 768px) {
    .reports-builder__result {
        display: flex;
        flex-direction: column;
        min-height: calc(100vh - var(--drawer-top) - 7.5rem);
    }

    .reports-builder__result > [aria-live] {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
    }

    .reports-builder__result .reports-canvas {
        flex: 1 1 auto;
    }
}

/* ── The settings drawer's doors ─────────────────────────────────────── */

/* A door sits inside the settings list's panel, as the seat editor sits inside
   the opportunity form's drawer. That panel is transformed, so it is the box a
   door is measured from: the door starts at its top edge and ends at its foot. */
.reports-settings [data-builder-door] {
    inset-block: 0;
}

/* The Filters door's built-in switch: one rule's words to a line. The rules
   themselves are the shared sentence builder's (filter-builder.css). */
.reports-panel__built-in-words {
    display: flex;
    flex-direction: column;
}

/* The Values and Group by doors' rows are the filter builder's rows holding the
   compact combobox (filter-builder.css, main.css). A row centres its parts, and what
   it shows takes most of it; how to measure a field, or the step a date groups by,
   takes the rest. */
.reports-panel__row {
    align-items: center;
}

.reports-panel__pick {
    flex: 2 1 0;
    min-width: 0;
}

.reports-panel__split {
    flex: 1 1 0;
    min-width: 0;
}

/* The range's words stay on one line and end in an ellipsis when the drawer is too
   narrow for them. */
.reports-panel__range-btn .global-drawer__rowbtn-value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A fixed popover inside a sliding drawer panel is placed by the panel's edge and
   lands out of sight, and one hung from its row would be cut off by the drawer's
   scroll box with Apply out of sight. So the Date door's range and the Filters
   door's value picker open in the flow under their rows and the drawer's body
   scrolls, on a desk and on a 390-wide phone alike. */
.reports-settings .global-toolbar__menu {
    position: static;
    min-width: 0;
    box-shadow: none;
}

/* The range opens a small step under its Range row. */
.reports-panel__range .global-toolbar__menu {
    margin-top: var(--spacing-xs);
}

/* The narrow panel stacks the presets above the months, so the rail's line runs under it. */
.reports-settings .global-date-range__rail {
    flex: 1 1 100%;
    padding-right: 0;
    padding-bottom: var(--spacing-smd);
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
}

/* Two columns of named ranges, four rows in sight, so the month sits close under them. */
.reports-settings .global-date-range__presets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 8rem;
}

/* The panel has room for one month, across its width. The second month hides and the
   first shows its forward arrow too, which moves the view one month, as the pair's
   arrows do (date-range-calendar.js). */
.reports-settings .global-date-range__month {
    flex: 1 1 100%;
}

.reports-settings .global-date-range__month + .global-date-range__month {
    display: none;
}

.reports-settings .global-date-range__nav.is-blank {
    visibility: visible;
}

.reports-settings .global-date-range__grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

/* Apply stays in sight: while the month runs past the bottom of the drawer, the
   footer holds to that edge and the days scroll under it. */
.reports-settings .global-date-range__footer {
    position: sticky;
    bottom: 0;
    background: var(--color-card-bg);
}

/* ── The result ──────────────────────────────────────────────────────── */

.reports-result__empty {
    color: var(--color-text-muted);
}

.reports-result__callout {
    margin-bottom: var(--spacing-sm);
}

.reports-result__withheld,
.reports-result__unanswered,
.reports-result__note,
.reports-result__how {
    margin: var(--spacing-xs) 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* When the result was worked out, and Refresh beside it. */
.reports-result__run {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    margin: var(--spacing-sm) 0 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.reports-result__refresh-form {
    display: flex;
}

.reports-result__refresh {
    flex: none;
}

.reports-result__scroll {
    overflow-x: auto;
    overscroll-behavior-x: contain;
}

.reports-result__table td,
.reports-result__table th {
    white-space: nowrap;
}

.reports-result__kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: var(--spacing-md);
}

.reports-result__kpi {
    padding: var(--spacing-md);
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.reports-result__kpi-label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-xs) var(--spacing-sm);
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.reports-result__kpi-value {
    margin: 0;
    font-size: var(--font-size-h2);
    font-weight: var(--font-weight-medium);
}

/* The change since the period before: an arrow up or down, then its words. */
.reports-result__kpi-delta {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2xs);
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* The arrow as tall as the words' capitals. */
.reports-result__kpi-delta .bi {
    font-size: var(--font-size-h4);
    line-height: 1;
}

.reports-result__kpi-delta.is-up {
    color: var(--color-success-text);
}

.reports-result__kpi-delta.is-down {
    color: var(--color-error-text);
}

.reports-result__chart {
    position: relative;
    height: 24rem;
    max-height: 60vh;
}

/* A funnel (shared/js/reports/funnel.js) is as tall as its rows make it, so
   its chart's box takes the funnel's height, on a page, in a tile and in
   print, never a fixed one, and funnel.js holds the box at least that tall.
   The drawing takes the page's font, and its text, strokes and fills come from
   here by class; only a segment's colour, on its bar, its ribbons and its
   strands, comes from the --chart-N tokens, through charts.js. */
.reports-result__chart:has(> .reports-funnel),
.reports-tile .reports-result__chart:has(> .reports-funnel) {
    height: auto;
    max-height: none;
}

.reports-funnel__svg {
    display: block;
    width: 100%;
    font-family: inherit;
}

/* Over each bar: its step's name in muted text, then its total in the page's
   ink. */
.reports-funnel__step {
    font-size: var(--font-size-sm);
    fill: var(--color-text-muted);
}

.reports-funnel__total {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-heading);
    font-variant-numeric: tabular-nums;
    fill: var(--color-text);
}

/* At the left of a gap, or on its own line under it: the rate into the next
   step, in the page's ink. */
.reports-funnel__rate {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    fill: var(--color-text);
}

/* A bar's segments with a white hairline between two, and the ribbons that
   carry each segment down its gap toward the next bar, a touch lighter, with
   a thinner hairline between two; a skip's strands and a side entry's too. */
.reports-funnel__bar {
    stroke: var(--color-card-bg);
    stroke-width: 0.8px;
}

.reports-funnel__ribbon {
    fill-opacity: 0.9;
    stroke: var(--color-card-bg);
    stroke-width: 0.5px;
}

/* The pale wedges beside the ribbons where the next bar is narrower, and the
   muted words beside a gap, or on their own line under it, that say what
   dropped off and what came into the next step past the one over it or from
   the side. */
.reports-funnel__wedge {
    fill: var(--color-grey-100);
}

.reports-funnel__drop,
.reports-funnel__move {
    font-size: var(--font-size-xs);
    fill: var(--color-text-muted);
}

/* The end rate, from the first step to the last, in one line of muted text
   under the lowest bar, its percent in the page's ink. */
.reports-funnel__end {
    font-size: var(--font-size-xs);
    fill: var(--color-text-muted);
}

.reports-funnel__end-figure {
    font-weight: var(--font-weight-medium);
    fill: var(--color-text);
}

/* ── The steps grid a funnel with one group draws (_steps.html) ──────── */

.reports-steps__corner {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    font-weight: var(--font-weight-body);
}

.reports-steps__all {
    border-right: 1px solid var(--color-border);
}

.reports-steps__rate {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    font-weight: var(--font-weight-body);
    line-height: var(--line-height-heading);
}

.reports-steps td.is-behind {
    background: var(--color-warning-bg);
}

.reports-steps tfoot td {
    font-weight: var(--font-weight-medium);
}

.reports-steps__note {
    margin: var(--spacing-xs) 0 0;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.reports-steps__fold {
    margin-top: var(--spacing-xs);
}

.reports-steps__fold summary {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    cursor: pointer;
}

/* ── The result card, on the builder and the report page ─────────────── */

/* The head names what the result shows, the body holds it, the foot says when
   it ran. The head and the foot reach the card's edges. */
.reports-canvas {
    padding: 0;
    overflow: hidden;
}

.reports-canvas__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    padding: var(--spacing-smd) var(--spacing-md);
    border-bottom: 1px solid var(--color-border-hairline);
}

.reports-canvas__title {
    margin: 0;
    font-size: var(--font-size-h4);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.reports-canvas__meta {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

/* The body takes whatever height the card has spare, so the foot sits at its bottom. */
.reports-canvas__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: var(--spacing-smd);
    padding: var(--spacing-md);
}

.reports-canvas__body > * {
    margin: 0;
}

/* A number stands in the middle of the room the body has. */
.reports-canvas__body > .reports-result__kpis {
    flex: 1 1 auto;
    align-content: center;
}

/* A report's totals sit on top of its chart at their own height; only a KPI's
   number takes the room the body has spare. */
.reports-canvas__body > .reports-result__kpis--total {
    flex: none;
}

.reports-canvas__foot {
    padding: var(--spacing-sm) var(--spacing-md);
    border-top: 1px solid var(--color-border-hairline);
}

/* When it ran, and Refresh, sit at the foot's right, as option C draws them. */
.reports-canvas__foot .reports-result__run {
    justify-content: flex-end;
    margin: 0;
}

/* One number fills the card: centred and large, its label and date chip above
   it. Several numbers keep a box each. */
.reports-canvas .reports-result__kpi {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    text-align: center;
}

.reports-canvas .reports-result__kpi:only-child {
    padding: var(--spacing-xl) 0 var(--spacing-2xl);
    background: transparent;
    border: 0;
}

.reports-canvas .reports-result__kpi-label {
    justify-content: center;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-heading);
    color: var(--color-text-secondary);
}

.reports-canvas .reports-result__kpi-label .global-chip {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
}

/* On the result card the change reads as a pill: green when the number rose,
   red when it fell, grey when it held. */
.reports-canvas .reports-result__kpi-delta {
    padding: var(--spacing-xs) var(--spacing-smd);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    background: var(--color-surface-subtle);
    border-radius: var(--radius-pill);
}

.reports-canvas .reports-result__kpi-delta.is-up {
    color: var(--color-success-text);
    background: var(--status-success-bg);
}

.reports-canvas .reports-result__kpi-delta.is-down {
    color: var(--color-error-text);
    background: var(--status-danger-bg);
}

.reports-canvas .reports-result__kpi:only-child .reports-result__kpi-value {
    font-size: var(--font-size-display-lg);
    line-height: var(--line-height-heading);
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

/* The table under the chart, in a hairline box of its own. */
.reports-canvas .reports-result__scroll {
    border: 1px solid var(--color-border-hairline);
    border-radius: var(--radius-md);
}

.reports-canvas .reports-result__table {
    margin-bottom: 0;
}

.reports-canvas .reports-result__table td {
    padding: var(--spacing-sm) var(--spacing-smd);
    border-color: var(--color-border-hairline);
}

.reports-canvas .reports-result__table tfoot td {
    font-weight: var(--font-weight-medium);
    background: var(--color-surface-subtle);
}

.reports-canvas .reports-result__table > :last-child > tr:last-child > * {
    border-bottom-width: 0;
}

/* ── The records behind a pick ─────────────────────────────────────────── */

.reports-result__table tr.is-pickable {
    cursor: pointer;
}

.reports-result__table tr.is-pickable:hover > td,
.reports-records__row:hover > td {
    background: var(--color-surface-subtle);
}

.reports-result__table tr.is-pickable:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: -2px;
}

.reports-result__table tr.is-picked > td {
    font-weight: var(--font-weight-medium);
    background: var(--color-action-tint);
}

.reports-records-mount:empty,
.reports-records__foot:empty {
    display: none;
}

.reports-records-mount {
    margin: var(--spacing-md) 0;
}

.reports-records {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: var(--spacing-smd);
    background: var(--color-surface-subtle);
    border: 1px solid var(--color-border-hairline);
    border-radius: var(--radius-md);
}

.reports-records__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm);
}

.reports-records__title {
    min-width: 0;
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-heading);
    overflow-wrap: anywhere;
}

/* The count pushes the open link and the close x to the head's far end. */
.reports-records__count {
    margin-right: auto;
}

.reports-records .reports-result__scroll {
    background: var(--color-card-bg);
}

/* A phone has no room for all four, so the close x keeps the top corner. */
@media (max-width: 575.98px) {
    .reports-records__head {
        position: relative;
        padding-right: var(--control-h-touch);
    }

    .reports-records__close {
        position: absolute;
        top: 0;
        right: 0;
    }
}

.reports-records__row {
    position: relative;
}

.reports-records__link {
    color: inherit;
    text-decoration: none;
}

.reports-records__row:hover .reports-records__link {
    text-decoration: underline;
}

.reports-records__foot {
    display: flex;
    justify-content: center;
}

/* ── The report page ─────────────────────────────────────────────────── */

.reports-page__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.reports-page__title {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 0;
}

/* The name wears the house page title (.global-page-header__title, page-header.css),
   which sets its size; this sheet loads later, so a size here would win over it. */
.reports-page__name {
    margin: 0;
}

.reports-page__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

/* The foot a print shows: the rules the run applied and when it ran. On the
   screen the head's chip and the card's run line say the same. */
.reports-page__foot {
    display: none;
    margin-top: var(--spacing-md);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.reports-page__foot p {
    margin: 0;
}

/* ?print=1: the bare page with no chrome, the same shape a print gets. */
.reports-page--print .reports-page__foot {
    display: block;
}

/* On a phone the head card keeps one row, and the settings drawer's panels slide
   in from the right (global-drawer-panel--side, components/drawer.css) when the
   gear opens them. */
@media (max-width: 767.98px) {
    /* The row keeps the back arrow, the name, Save, More and the gear; Add to
       dashboard moves into More. The name takes what is left, at the body
       size a phone needs so a tap on it never zooms the page. */
    .reports-builder__head {
        gap: var(--spacing-xs) var(--spacing-sm);
        padding: var(--spacing-sm);
    }

    .reports-builder__back-arrow {
        margin-right: 0;
    }

    .reports-builder__name {
        flex: 1 1 0;
        padding: 0 var(--spacing-sm);
        font-size: var(--font-size-base);
    }

    /* Three classes, so main.css's later phone `.btn:not(.btn-close)` flex rule
       does not bring Add to dashboard back. */
    .reports-builder__spacer,
    .reports-builder__head .btn.reports-builder__add {
        display: none;
    }

    .reports-builder__head .reports-builder__more-add {
        display: flex;
    }

    /* A report's Edit button gives a finger the house touch target, as its
       back link does through global-touch-target. */
    .reports-page__actions .btn {
        min-width: var(--control-h-touch);
    }
}

/* A dashboard: its tiles on a twelve-column grid. A small tile takes a third
   of a row, a medium half, a large the whole row; on a phone every tile takes
   the row. The grid is its own, never the Bootstrap row. */
.reports-dash__grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--spacing-md);
}

/* The quick filter chips take a row of their own under the dashboard's title.
   On a desk they wrap across the full width (see the home's rules below); on a
   phone dashboard-filters.js moves them into the Filters drawer, where they
   stack, and the Filters button stands in the action row. */
.reports-dash__chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-xs);
}

/* A dashboard's chips stand at the control height and the body size, as the
   mockup draws them. Each reads its label, a dot, then its value in bold. A
   chip on the dashboard's default reads plain, a hairline over the card; one
   away from it wears the action tint and border, as a set chip does on the
   Reports list. The Filter chip at the end reads solid
   like the rest: the shared toolbar's small dashed offer is the list pages'
   look. */
.reports-dash__chips .global-toolbar__chip {
    height: var(--control-h-base);
    padding: 0 var(--spacing-smd);
    border-color: var(--color-border);
    background: var(--color-card-bg);
    color: var(--color-text);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-body);
}

.reports-dash__chips .global-toolbar__chip strong {
    font-weight: var(--font-weight-medium);
}

.reports-dash__chip-word {
    color: var(--color-text-secondary);
}

.reports-dash__chips .global-toolbar__chip.is-on {
    background: var(--color-action-tint);
    border-color: var(--color-action);
}

.reports-dash__chips .global-toolbar__chip--add {
    border-style: solid;
    border-color: var(--color-border-hairline);
    background: var(--color-card-bg);
}

.reports-dash__chips .global-toolbar__chip--add:hover {
    border-color: var(--color-grey-400);
    color: var(--color-text);
}

.reports-dash__chips .global-toolbar__chip .bi-chevron-down {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    opacity: 1;
}

.reports-dash__chips-home {
    display: contents;
}

/* On a desk screen the chips' home is a full-width row under the name and the
   action row, so five chips never crowd the buttons. The action row takes the
   room the name leaves and its buttons never shrink, so Refresh, Share, Add
   report and More stay on one line at the right. The name keeps its place after
   the back link. A home with no strip in it (no chips, or a phone that moved
   them into the drawer) still draws nothing, and print keeps its own head. */
@media screen and (min-width: 768px) {
    .reports-page__head:has(> .reports-dash__actions) {
        align-items: baseline;
    }

    .reports-page__head:has(> .reports-dash__actions) > .reports-builder__back {
        margin-right: 0;
    }

    .reports-page__head:has(> .reports-dash__actions) > .reports-page__title {
        flex-grow: 0;
    }

    .reports-dash__actions {
        flex: 1 1 0;
        flex-wrap: nowrap;
        align-items: flex-start;
        justify-content: flex-end;
    }

    .reports-dash__chips-home:has(> .reports-dash__chips) {
        display: block;
        flex: 1 0 100%;
        margin-top: var(--spacing-sm);
    }

    .reports-dash__actions > .btn,
    .reports-dash__actions > .global-action-dropdown {
        flex: none;
    }

    /* The buttons keep the chips' height now that the row no longer stretches
       them to it. */
    .reports-dash__actions > .btn {
        min-height: var(--control-h-base);
        white-space: nowrap;
    }
}

/* On a desk each chip's menu opens under its chip, and the date menu holds
   its two months side by side. That is wider than the room a chip near the
   screen's right edge leaves, so a menu that would run off the screen slides
   left until it ends a gap short of the edge. The chip hands its menu's left
   edge in as --reports-menu-left (_dashboard_chips.html); the phone drawer
   keeps the months stacked. */
.reports-dash__chips-home .global-toolbar__menu-wrap {
    --reports-menu-left: 0px;
}

.reports-dash__chips-home .global-toolbar__menu {
    translate: min(0px, calc(100vw - var(--reports-menu-left) - 100% - var(--spacing-md)));
}

.reports-dash__chips-home .global-date-range__body {
    flex-wrap: nowrap;
}

.reports-dash__fold {
    display: none;
}

.reports-dash__chips-drawer .reports-dash__chips {
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-md);
}

/* In the drawer a chip's menu opens in line under its chip. The sliding panel
   would carry a floating menu down by the panel's own top edge. */
.reports-dash__chips-drawer .global-toolbar__menu-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-xs);
}

.reports-dash__chips-drawer .global-toolbar__menu {
    position: static;
    min-width: 0;
    width: 100%;
    box-shadow: none;
}

/* A chip's list of values lies in its menu between the box and Clear, the way
   the toolbar's own chip menus list theirs. The site combobox floats its list,
   and here the list covered Clear, so a click where Clear sat picked the first
   value. The list keeps its height cap and scroll from the site sheet, and it
   drops the border and shadow that drew a second card inside the menu. The up
   class the combobox adds near the screen's foot moves only a floating list.
   In the phone drawer the open list pushes the chips under it down. Each step
   is a direct child, so a combobox the date popover holds deeper stays as is. */
.reports-dash__chips .global-toolbar__menu > .global-cs > .global-cs-menu {
    position: static;
    margin-top: var(--spacing-xs);
    border: 0;
    box-shadow: none;
}

/* A lock after a tab's name says some of that dashboard is hidden from this
   reader. It sits a size under the name so it reads as a mark on the tab. */
.reports-dash__tab-lock {
    font-size: var(--font-size-xs);
}

/* One chip with its label in front. On a desk the label reads inside the chip
   and the row's own label is hidden; in the drawer the row's label sits above
   the chip, the way the mockup's drawer names each field, and the chip drops
   its own. */
.reports-dash__chip-row {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2xs);
}

.reports-dash__chips-drawer .reports-dash__chip-word {
    display: none;
}

/* An editor's rows at the foot of a chip's menu, under a hairline. */
.reports-dash__chip-editor {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: var(--spacing-xsm);
    padding-top: var(--spacing-xsm);
    border-top: 1px solid var(--color-border-hairline);
}

/* Reset ends the row on a desk; the drawer keeps its own in its footer. */
.reports-dash__reset {
    font-size: var(--font-size-sm);
}

.reports-dash__chips-drawer .reports-dash__reset {
    display: none;
}

.reports-dash__chips-drawer .reports-dash__chip-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--spacing-xs) var(--spacing-sm);
}

.reports-dash__chips-drawer .reports-dash__chip-row .global-toolbar__menu-wrap {
    flex: 1 1 0;
    min-width: 0;
}

.reports-dash__chip-label {
    display: none;
}

.reports-dash__chips-drawer .reports-dash__chip-label {
    display: block;
    flex-basis: 100%;
}

/* An editor adds a quick filter from the Filter chip that ends the chip strip
   on a desk, or from the dashed Add filter row at the foot of the drawer, drawn
   like the grid's Add report cell. Each shows only in its own place. */
.reports-dash__chips-drawer .reports-dash__add-chip {
    display: none;
}

.reports-dash__add-filter {
    display: none;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xsm);
    width: 100%;
    padding: var(--spacing-sm);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    background: none;
    border: 1px dashed var(--color-grey-300);
    border-radius: var(--radius-md);
}

.reports-dash__add-filter:hover {
    color: var(--color-text);
    border-color: var(--color-grey-500);
}

.reports-dash__chips-drawer .reports-dash__add-filter {
    display: flex;
}

@media (max-width: 767.98px) {
    .reports-dash__fold {
        display: block;
    }

    /* The actions keep one row, so More never drops onto a line of its own. */
    .reports-dash__actions {
        flex-wrap: nowrap;
    }

    /* The strip keeps one row and scrolls sideways, as the record header's tabs
       do, with no bar under it. Each tab already keeps its own width on a phone
       (page-tabs.css). It wears the shared edge fade (components/edge-fade.css)
       on the canvas the strip sits on. */
    .reports-dash__tabs {
        --edge-fade-bg: var(--color-canvas);

        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
    }

    .reports-dash__tabs::-webkit-scrollbar {
        display: none;
    }
}

/* An empty dashboard's shared empty state spans the whole grid, above the add cell. */
.reports-dash__full-row {
    grid-column: span 12;
}

/* An editor's last cell on the grid, dashed so it never reads as a tile. It
   opens the same dialog as the head's Add report. */
.reports-dash__add-tile {
    display: flex;
    grid-column: span 4;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xsm);
    min-height: 7.5rem;
    font-size: var(--font-size-md);
    color: var(--color-text-secondary);
    background: none;
    border: 1px dashed var(--color-grey-300);
    border-radius: var(--radius-card-lg);
}

.reports-dash__add-tile:hover {
    color: var(--color-text);
    border-color: var(--color-grey-500);
}

/* The tile's menu may hang past the card's edge. The card has no padding of
   its own: its head, body and foot each pad themselves, as the dashboard
   mockup draws a tile. */
.reports-tile {
    grid-column: span 6;
    min-height: 7.5rem;
    overflow: visible;
}

/* A number keeps its own height beside a taller chart instead of stretching
   to the row's height. */
.reports-tile:has(.reports-result__kpis) {
    align-self: start;
}

/* A chart tile with its totals on top still stretches to its row, as every
   chart tile does. */
.reports-tile:has(.reports-result__kpis--total) {
    align-self: auto;
}

.reports-tile--s {
    grid-column: span 4;
}

.reports-tile--m {
    grid-column: span 6;
}

.reports-tile--l {
    grid-column: span 12;
}

/* The name on the left and the tools at the head's right end, as the mockup
   sets a tile's head. */
.reports-tile__head {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-smd) var(--spacing-sm) var(--spacing-xs) var(--spacing-md);
}

/* The name at the body's size. On a desk it is cut short with an ellipsis
   when the tile is narrow, so the tools keep their place; a phone wraps it. */
.reports-tile__title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.reports-tile__title a {
    color: inherit;
    text-decoration: none;
}

/* An editor's tools at the end of the head: the size control, the grip that
   drags the tile, and the tile's menu. */
.reports-tile__tools {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: var(--spacing-xs);
    margin-left: auto;
}

.reports-tile__sizes .global-segmented__btn {
    min-width: 2rem;
    padding: 0 var(--spacing-xs);
    font-size: var(--font-size-xs);
}

.reports-tile__grip {
    color: var(--color-grey-400);
    cursor: grab;
}

.reports-tile__grip:active {
    cursor: grabbing;
}

.reports-tile__menu-rule {
    margin: var(--spacing-xs) 0;
}

/* The Add filter dialog's picks, one full-width button each. */
.reports-move-tile__list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.reports-move-tile__target {
    text-align: left;
}

.reports-tile__body {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 var(--spacing-md) var(--spacing-md);
}

/* In a tile a number stands flat on the card, as the mockup draws it: no box
   of its own, large, with its change under it. One number needs no label,
   since the tile's name says what it counts; several keep theirs. */
.reports-tile .reports-result__kpi {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    padding: 0;
    background: none;
    border: 0;
}

.reports-tile .reports-result__kpi:only-child .reports-result__kpi-label {
    display: none;
}

.reports-tile .reports-result__kpi-value {
    font-size: var(--font-size-display);
    font-weight: var(--font-weight-heading);
    line-height: var(--line-height-heading);
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

/* A chart in a tile is shorter than one on its own page. */
.reports-tile .reports-result__chart {
    height: 16rem;
    max-height: 40vh;
}

/* A tile's table heads read in sentence case on a pale band, as the dashboard
   mockup draws them; the builder's card keeps the house capitals. */
.reports-tile .reports-result__table th {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-body);
    color: var(--color-text-secondary);
    text-transform: none;
    letter-spacing: normal;
    background: var(--color-card-bg);
}

/* The one sentence a tile shows instead of a result, and its button. */
.reports-tile__state {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) 0;
    color: var(--color-text-muted);
}

.reports-tile__message {
    margin: 0;
}

.reports-tile__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0 var(--spacing-md) var(--spacing-sm);
}

/* Each quick filter the tile runs under reads as a small grey pill, the way the
   dashboard mockup draws a tile's foot. */
.reports-tile__filter {
    padding: var(--spacing-2xs) var(--spacing-sm);
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    background: var(--color-grey-100);
    border-radius: var(--radius-pill);
}

/* A note, and the time a kept answer was worked out, read as small muted words. */
.reports-tile__note,
.reports-tile__as-of {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* The grey block a tile shows until its door answers. */
.reports-tile__skeleton {
    flex: 1 1 auto;
    min-height: 10rem;
    margin: var(--spacing-md);
    background: var(--color-border);
    border-radius: var(--radius-sm);
    animation: reports-tile-pulse 1.2s ease-in-out infinite;
}

@keyframes reports-tile-pulse {
    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 0.8;
    }
}

@media (max-width: 767.98px) {
    .reports-tile,
    .reports-tile--s,
    .reports-tile--m,
    .reports-tile--l,
    .reports-dash__add-tile {
        grid-column: span 12;
    }

    /* Each size button and the grip, the one spot a drag starts, give a finger
       the house touch target. The grip's icon keeps its size. */
    .reports-tile__sizes .global-segmented__btn,
    .reports-tile__grip {
        min-width: var(--control-h-touch);
        min-height: var(--control-h-touch);
    }

    .reports-tile__grip {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Beside the tools a name had about 92px, and a word wider than that
       split. So the head wraps: a name that does not fit beside the tools
       takes the first row whole, and the tools go to the row under it, still
       at the head's end. */
    .reports-tile__head {
        flex-wrap: wrap;
    }

    /* The name wraps onto more lines and shows whole, and the tools keep
       their place at the head's end. */
    .reports-tile__title {
        overflow: visible;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    /* The name's link takes the house touch target in an unseen square. */
    .reports-tile__title a {
        position: relative;
        display: block;
    }

    .reports-tile__title a::after {
        content: "";
        position: absolute;
        inset: min(0px, calc((100% - var(--control-h-touch)) / 2)) 0;
    }
}

/* Print (calendar-events.css keeps the same shape): the chrome goes, and so do
   each page's tools. On a report the actions and the run line go, the foot
   shows, and the chart takes the page's width. On the builder the head's tools
   and the settings drawer go, its panels and its scrim with it. On a dashboard
   the tab strip, the chips, any open drawer,
   each tile's tools and the Add report cell go, and a tile prints flat and whole
   on one page. ?print=1 marks the grid data-dash-print and prints once the last
   tile has drawn, which can come a moment before the loading sheet lifts, so
   the sheet goes too. A drawer such as Share lands beside the dashboard in the
   page box, not inside it, so the drawer rules look from the page box down.
   A chart's box takes the page's width at its screen height (shorter in a
   tile) and never the screen's cap, and charts.js redraws each chart to that
   box as the page prints. A canvas not redrawn in time shrinks to the page's
   width rather than running off its edge. A funnel is not redrawn: its drawing
   takes the page's width, and its viewBox scales what it drew on screen to
   fit, as tall as that makes it.
   This block sits after the tile rules so a flat tile wins in print. */
@media print {
    .global-sidebar,
    .global-app-header,
    .global-notice-slot,
    .reports-builder__back,
    .reports-page__actions,
    .reports-builder__head,
    .reports-builder__save,
    .reports-builder .reports-settings,
    .reports-canvas__foot,
    .reports-result__run,
    .reports-result__refresh,
    .reports-dash__tabs,
    .reports-dash__chips,
    .reports-dash__fold,
    .reports-tile__menu,
    .reports-tile__grip,
    .reports-tile__sizes,
    .reports-dash__add-tile,
    .global-app-content:has(> .reports-dash) > .global-loading-screen--gate,
    .global-app-content:has(> .reports-dash) .global-drawer-panel,
    .global-app-content:has(> .reports-dash) .global-drawer-scrim {
        display: none !important;
    }

    .global-app-content {
        padding: 0 !important;
    }

    .reports-page__foot {
        display: block;
    }

    .reports-result__chart {
        width: 100%;
        height: 24rem;
        max-height: none;
    }

    .reports-tile .reports-result__chart {
        height: 16rem;
        max-height: none;
    }

    .reports-result__chart canvas {
        max-width: 100%;
        height: auto !important;
    }

    .reports-result__chart .reports-funnel__svg {
        width: 100%;
        max-width: 100%;
        height: auto;
    }

    .reports-tile {
        break-inside: avoid;
        box-shadow: none;
    }
}

/* The admin's Usage card under the list: the ledger's sums in the result's KPI shape. */
.reports-usage {
    margin-top: var(--spacing-lg);
}

.reports-usage__card {
    padding: var(--spacing-md);
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
}

.reports-usage__title {
    margin: 0 0 var(--spacing-md);
    font-size: var(--font-size-h3);
}

.reports-usage__subtitle {
    margin: var(--spacing-md) 0 var(--spacing-xs);
    font-size: var(--font-size-base);
}

.reports-usage__slowest {
    margin: 0;
    padding-left: var(--spacing-lg);
}

/* One cell per day of the window, oldest first: the count over the day. */
.reports-usage__days {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin: 0;
    padding: 0;
    list-style: none;
}

.reports-usage__day {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 3rem;
    padding: var(--spacing-xs);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.reports-usage__day-runs {
    font-weight: var(--font-weight-medium);
}

.reports-usage__day-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.reports-usage__note {
    margin: var(--spacing-md) 0 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* The admin's Spend grid: a row per channel, a column per month, each cell an amount. */
.reports-spend {
    padding: var(--spacing-md);
}

.reports-spend__lead {
    margin: 0 0 var(--spacing-xs);
    color: var(--color-text-secondary);
}

/* Holds its height while empty, so the grid does not jump when a cell saves. */
.reports-spend__status {
    min-height: 1.25rem;
    margin: 0 0 var(--spacing-sm);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.reports-spend__status--refused {
    color: var(--color-error);
}

.reports-spend__scroll {
    overflow-x: auto;
    overscroll-behavior-x: contain;
}

.reports-spend__grid {
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--font-size-sm);
}

/* The channel column stays put while the months scroll under it. */
.reports-spend__channel {
    position: sticky;
    left: 0;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--color-card-bg);
    font-weight: var(--font-weight-medium);
    text-align: left;
    white-space: nowrap;
}

.reports-spend__month {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    text-align: right;
    white-space: nowrap;
}

.reports-spend__cell {
    padding: var(--spacing-xs);
}

.reports-spend__input {
    width: 7rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.reports-spend__input--saved {
    border-color: var(--color-success);
}

.reports-spend__input[aria-invalid="true"] {
    border-color: var(--color-error);
}

/* On a phone each amount takes a finger, at the body size so a tap on it never
   zooms the page. */
@media (max-width: 767.98px) {
    .reports-spend__input {
        min-height: var(--control-h-touch);
        font-size: var(--font-size-base);
    }
}

/* The shared row's note, under its name: one plain line that may wrap. */
.reports-spend__note {
    display: block;
    max-width: 12rem;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-body);
    color: var(--color-text-muted);
    white-space: normal;
}

/* Under each amount: where it came from, and what the books say when a typed amount differs. */
.reports-spend__source,
.reports-spend__books-say {
    display: block;
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
    text-align: right;
    white-space: nowrap;
}

/* The org's books, under the grid: where their lines go, the pull, and the lines left. */
.reports-spend__books {
    margin: var(--spacing-lg) 0 0;
}

.reports-spend__books-title {
    margin: 0 0 var(--spacing-xs);
    font-size: var(--font-size-h4);
}

.reports-spend__pulled {
    margin: 0 0 var(--spacing-sm);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.reports-spend__group-name {
    margin: var(--spacing-md) 0 var(--spacing-xs);
    font-size: var(--font-size-md);
}

.reports-spend__rules {
    margin: 0 0 var(--spacing-sm);
    padding: 0;
    list-style: none;
}

.reports-spend__rule {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-2xs) 0;
}

.reports-spend__rule-words {
    font-size: var(--font-size-sm);
}

/* The add-rule form: one field over the next, as wide as a long account name needs. */
.reports-spend__add {
    max-width: 28rem;
    margin: var(--spacing-sm) 0 0;
}

/* A line's pick sits beside its words, as wide as its longest place. */
.reports-spend__pick {
    width: auto;
}

.reports-spend__books-off {
    margin: var(--spacing-md) 0 0;
    color: var(--color-text-secondary);
}


.settings-panel {
    display: none;
}

.settings-views-grid {
    --bs-gutter-x: var(--spacing-md);
    --bs-gutter-y: var(--spacing-md);
    margin-top: var(--spacing-xs);
}

.settings-views-card__body {
    padding: var(--spacing-md);
}

.settings-views-card__head {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.settings-views-card__title {
    margin: 0;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
}

.settings-panel.is-active {
    display: block;
}

.settings-section {
    margin-bottom: var(--spacing-xl);
}

.settings-section:last-child {
    margin-bottom: 0;
}

/* Sub-section label inside a .settings-branding-section — matches the monospace
   eyebrow pattern used by .color-row__label, .settings-vocab-row__label,
   .settings-domain-card__heading so micro-typography reads as one system. */
.settings-section-label {
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
}

/* === Vocabulary rows ===
   Card-style rows that mirror `.color-row` from the Colors section: a
   monospace eyebrow label on the left, then the editable inputs on the
   right. Replaces the old Bootstrap table so vocabulary reads as part of
   the same design system as Colors / Typography / Domains. */
.settings-vocab-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.settings-vocab-row {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: var(--spacing-md);
    align-items: center;
    padding: var(--spacing-smd) var(--spacing-smd);
    border: 1px solid color-mix(in srgb, currentColor 8%, transparent);
    border-radius: 12px;
    background: color-mix(in srgb, currentColor 3%, transparent);
    transition: border-color 140ms ease;
}

.settings-vocab-row:hover {
    border-color: color-mix(in srgb, currentColor 14%, transparent);
}

.settings-vocab-row__label {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: var(--font-size-2xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.settings-vocab-row__inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
    min-width: 0;
}

.settings-vocab-row__field {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    min-width: 0;
}

.settings-vocab-row__field-label {
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
}

@media (max-width: 767.98px) {
    .settings-vocab-row {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    /* A row with one field (Public scheduling's "Everyone") had it in half
       the row, its help text a word a line. Stacked, it takes the row. */
    .settings-vocab-row__field:only-child {
        grid-column: 1 / -1;
    }
}

.settings-integration-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-smd);
}

.settings-integration-item:last-child {
    margin-bottom: 0;
}

.settings-integration-info {
    flex: 1;
    min-width: 0;
}

.settings-integration-info strong {
    display: block;
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--spacing-2xs);
}

.settings-integration-info small {
    color: var(--color-grey-600);
}

/* A switch only the platform turns. An org seat reads it as On or Off (#8958). */
.settings-integration-state {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* Integrations catalog: responsive card grid.
   Each service is one card — brand icon, name, and one centered button
   (Connect or Manage). Cards are the same size whatever the service state,
   and the grid auto-fills the full content width so there is no dead space. */
.settings-integration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-smd);
}

/* Chrome (fill, border, radius, resting shadow) comes from `.global-card`;
   this class carries the card's inner layout and spacing. */
.settings-integration-card {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-smd);
    min-height: 118px;
    padding: var(--spacing-md);
}

.settings-integration-card--muted {
    opacity: 0.6;
}

.settings-integration-card-head {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-height: 32px;
}

.settings-integration-card-icon {
    width: 28px;
    height: 28px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-integration-card-icon img {
    max-width: 28px;
    max-height: 28px;
    display: block;
}

.settings-integration-card-icon i {
    font-size: var(--font-size-xl);
}

.settings-integration-card-name {
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-lg);
    color: var(--color-text);
}

.settings-integration-badge {
    margin-left: auto;
    display: inline-block;
    white-space: nowrap;
}

.settings-integration-badge.is-connected {
    color: var(--color-success);
    background: color-mix(in srgb, var(--color-success) 14%, transparent);
}

/* Not --color-warning: amber measures 2.15:1 on white. --status-warning-fg is
   the same hue darkened for exactly this, and the rest of the app uses it. */
.settings-integration-badge.is-attention {
    color: var(--status-warning-fg);
    background: var(--status-warning-bg);
}

/* The handle a feed reads, shown where a connected card shows nothing — a typo
   is the likeliest reason a handle feed breaks, so it stays on the card. */
.settings-integration-card-handle {
    margin: var(--spacing-xsm) 0 0;
    text-align: center;
    font-size: var(--font-size-content-account);
    color: var(--color-text);
}

.settings-integration-card-help {
    margin: var(--spacing-xsm) 0 0;
    font-size: var(--font-size-xs);
    line-height: 1.35;
    color: var(--color-text-muted);
}

.settings-integration-card-help--attention {
    color: var(--status-warning-fg);
}

/* The Instagram card's rows under an account (Connection, Can post): a muted
   label and its value side by side. */
.settings-integration-card-rows {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--spacing-2xs) var(--spacing-sm);
    margin: 0;
    font-size: var(--font-size-content-detail);
}

.settings-integration-card-rows dt {
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
}

.settings-integration-card-rows dd {
    margin: 0;
    color: var(--color-text);
}

/* The Instagram card's one line when it lists no account: "Not connected" or
   "Status unavailable". */
.settings-integration-card-note {
    margin: 0;
    font-size: var(--font-size-content-detail);
    color: var(--color-text);
}

/* One Instagram account per row: its name and badge on one line, its rows
   under them, and its own Disconnect at the right under the rows. */
.settings-integration-accounts {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--spacing-sm);
}

.settings-integration-account {
    display: grid;
    gap: var(--spacing-xs);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--color-border);
}

.settings-integration-account:first-child {
    padding-top: 0;
    border-top: 0;
}

.settings-integration-account-head {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.settings-integration-account-action {
    display: flex;
    justify-content: flex-end;
}

.settings-integration-account-name {
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-content-account);
    color: var(--color-text);
}

/* The Content plugin's own section, below the integrations grid: one wide
   card with one entry per network. An entry is two columns, the network's
   name at the left and its accounts at the right; on a phone they stack. */
.settings-content-section {
    margin-top: var(--spacing-lg);
}

.settings-content-section .settings-section-label {
    margin-bottom: var(--spacing-sm);
}

.settings-content-button {
    --bs-btn-padding-y: var(--spacing-xs);
    --bs-btn-padding-x: var(--spacing-sm);
    --bs-btn-font-size: var(--font-size-md);
}

.settings-content-disconnect {
    --bs-btn-focus-box-shadow: var(--shadow-focus-ring);
    --bs-btn-color: var(--color-error-text);
    --bs-btn-bg: transparent;
    --bs-btn-border-color: var(--color-error);
    --bs-btn-hover-color: var(--color-error-text);
    --bs-btn-hover-bg: var(--color-error-subtle);
    --bs-btn-hover-border-color: var(--color-error);
    --bs-btn-active-color: var(--color-error-text);
    --bs-btn-active-bg: var(--color-error-subtle);
    --bs-btn-active-border-color: var(--color-error);
}

.settings-content-network-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.settings-content-network {
    display: grid;
    grid-template-columns: var(--content-network-label-width) minmax(0, 1fr);
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-top: 1px solid var(--color-border);
}

.settings-content-network:first-child {
    border-top: 0;
}

.settings-content-network-head {
    display: flex;
    align-items: center;
    align-self: start;
    gap: var(--spacing-sm);
    min-height: var(--content-network-label-height);
}

/* The accounts read as a column, not a line across the whole card. */
.settings-content-network-body {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-smd);
    max-width: var(--content-accounts-width);
}

@media (max-width: 767.98px) {
    .settings-content-network {
        grid-template-columns: 1fr;
    }
}

/* Weather rules (Plugins page): the view filters' builder over the weather facts.
   Its property list holds all eight (a heading and eight rows), so it opens whole
   instead of scrolling at the builder's 260px. */
.settings-weather-rules .global-filter-builder-picker__list {
    max-height: 340px;
}

/* One centered action per card, pinned to the bottom so every card's button
   sits on the same line regardless of name length. */
.settings-integration-card-action {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-top: auto;
}

.settings-integration-card-action .btn {
    min-width: 8.5rem;
}

.settings-integration-card-form {
    margin-top: var(--spacing-xs);
}

.settings-connector-instructions {
    color: var(--color-grey-700);
    font-size: var(--font-size-xs);
}

/* === Developer settings: service-account builder ===
   Pills take the org's brand color so the picker matches the white-label theme. */
.settings-scope-builder {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    background: var(--color-card-bg);
}

.settings-scope-scroll {
    max-height: 340px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-smd);
}

.settings-scope-group + .settings-scope-group {
    margin-top: var(--spacing-smd);
}

.settings-scope-group--off,
.settings-scope-row--off {
    opacity: 0.55;
}

/* Group heading matches the monospace eyebrow used across settings. */
.settings-scope-group__heading {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-xs);
}

.settings-scope-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-smd);
    padding: var(--spacing-xs) 0;
}

.settings-scope-row + .settings-scope-row {
    border-top: 1px solid var(--color-border);
}

.settings-scope-row__label {
    font-size: var(--font-size-sm);
    min-width: 0;
}

.settings-scope-row__pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--spacing-xsm);
}

.settings-scope-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4rem;
    cursor: pointer;
    margin-bottom: 0;
    user-select: none;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.settings-scope-pill:hover {
    border-color: var(--color-action);
    color: var(--color-action);
}

.btn-check:checked + .settings-scope-pill {
    background: var(--color-action);
    border-color: var(--color-action);
    color: var(--color-neutral-ink-fg);
}

.btn-check:disabled + .settings-scope-pill {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Money pills read as heavier: dashed outline until picked, then burnt
   orange instead of brand color, so a money grant never looks routine. */
.settings-scope-pill--money {
    border-style: dashed;
}

.btn-check:checked + .settings-scope-pill--money {
    background: #9a3412;
    border-color: #9a3412;
    border-style: solid;
    color: #fff;
}

.settings-scope-full-access {
    border: 1px solid rgba(217, 0, 43, 0.35);
    background: rgba(217, 0, 43, 0.04);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-smd);
}

.settings-money-callout {
    margin-bottom: var(--spacing-sm);
    border: 1px solid rgba(255, 153, 0, 0.5);
    background: rgba(255, 193, 7, 0.08);
}

.settings-cap-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-2xs) var(--spacing-sm);
    border-radius: var(--radius-pill);
    background: var(--color-surface-subtle);
    font-size: var(--font-size-2xs);
    color: var(--color-text);
    white-space: nowrap;
}

.settings-cap-chip--money-on {
    background: rgba(217, 0, 43, 0.12);
    color: var(--color-error);
    font-weight: var(--font-weight-medium);
}

/* Amber pill: the account holds a money power but the money box is off. */
.settings-cap-chip--money-warn {
    background: rgba(255, 193, 7, 0.16);
    color: var(--color-warning-text);
    font-weight: var(--font-weight-medium);
}

/* Quiet "Look only" badge — informative, not a warning. */
.settings-cap-chip--look {
    background: var(--color-surface-subtle);
    color: var(--color-text-muted);
}

/* Resting service-account card — matches the webhook card spacing above.
   Chrome comes from `.global-card`; this class carries only the padding. */
.settings-sa-card {
    padding: var(--spacing-smd);
}

/* Who made a key that is not yours: one quiet line under its summary
   (UI review of #8958, A2). */
.settings-sa-card__maker {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* Developers: a webhook or portal row. The facts come first and the buttons sit
   at the end, on one line. On a phone the buttons go under the facts (see the
   phone block below), so no button runs past the card (Nick, 2026-11-09). */
.settings-item-row {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
}

.settings-item-row__body {
    flex: 1 1 0;
    min-width: 0;
}

.settings-item-row__actions {
    display: flex;
    flex-shrink: 0;
    gap: var(--spacing-xs);
}

/* A portal row centres its one line of facts on the buttons, which sit a
   little further apart. */
.settings-item-row--portal {
    align-items: center;
}

.settings-item-row--portal .settings-item-row__actions {
    gap: var(--spacing-sm);
}

/* === Developer settings: webhook event picker ===
   Same tokens as .scope-*, sized for a checkbox list instead of a pill grid. */
.settings-event-picker {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-smd);
    background: var(--color-card-bg);
}

.settings-event-picker-all {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    font-size: var(--font-size-sm);
    cursor: pointer;
    margin-bottom: 0;
}

.settings-event-picker-groups {
    max-height: 280px;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--color-border);
}

.settings-event-picker-group + .settings-event-picker-group {
    margin-top: var(--spacing-sm);
}

.settings-event-picker-group__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
}

.settings-event-picker-group__toggle {
    display: flex;
    align-items: center;
    gap: var(--spacing-xsm);
    border: none;
    background: transparent;
    padding: var(--spacing-2xs) 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-button);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    cursor: pointer;
}

.settings-event-picker-group__count {
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
}

.settings-event-picker-group__actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

.settings-event-picker-link {
    border: none;
    background: transparent;
    padding: 0;
    font-size: var(--font-size-2xs);
    color: var(--color-action);
    cursor: pointer;
}

.settings-event-picker-link:hover {
    text-decoration: underline;
}

.settings-event-picker-group__rows {
    padding: var(--spacing-xs) 0 var(--spacing-xs) var(--spacing-mdlg);
}

.settings-event-picker-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) 0;
    font-size: var(--font-size-sm);
    cursor: pointer;
    margin-bottom: 0;
}

.settings-event-picker-row__label {
    flex-grow: 1;
}

.settings-event-picker-row__type {
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
}

/* Keyboard focus on pill toggles — the native input is visually hidden by
   .btn-check, so the ring must land on the label. */
.btn-check:focus-visible + .settings-scope-pill {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

/* The webhook event picker's group heads and their Pick all / Clear take a
   full fingertip on a phone. */
@media (max-width: 767.98px) {
    .settings-event-picker-group__toggle,
    .settings-event-picker-link {
        min-height: var(--control-h-touch);
    }

    .settings-event-picker-link {
        min-width: var(--control-h-touch);
        padding-inline: var(--spacing-xs);
    }

    /* A webhook or portal row puts its buttons on a line of their own. */
    .settings-item-row {
        flex-wrap: wrap;
    }

    .settings-item-row__actions {
        flex-basis: 100%;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .settings-scope-row {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }

    .settings-scope-row__pills {
        justify-content: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .settings-scope-pill {
        transition: none;
    }
}

/* Developers, Portals: the small grey line under a portal's name, a field or a
   choice; and the slightly larger small type of a portal's facts and secret. */
.settings-portals__hint {
    font-size: var(--font-size-xs);
}

.settings-portals__small {
    font-size: var(--font-size-sm);
}

/* Developers, Portals: the Menu name box has the same size as the Name box
   next to it. The label rule uses two classes, so it beats the 8px gap of
   .form-label in main.css. The box inset is the same at all widths. Only
   wide screens get the 14px text. Phones keep the 16px text and the 44px
   box of main.css. */
.form-label.settings-portals__label {
    margin-bottom: var(--spacing-xs);
    font-size: var(--font-size-md);
}

.form-control.settings-portals__input {
    padding: var(--spacing-xs) var(--spacing-sm);
}

@media (min-width: 768px) {
    .form-control.settings-portals__input {
        font-size: var(--font-size-md);
    }
}

/* =========================================================================
   Settings hub — HubSpot-style dual-sidebar settings experience.

   Layout: the main app sidebar (unchanged) sits to the left of .global-app-content.
   Inside .global-app-content we render a SECOND sidebar (.settings-hub-nav) flush
   against a content pane (.settings-hub-content). We zero .global-app-content's
   default gutter only on pages that contain .settings-hub — same :has() trick
   milestones.css uses for full-bleed tables — so the secondary sidebar can run
   flush and full-height like HubSpot's.
   ========================================================================= */

.global-app-main:has(.settings-hub) .global-app-content {
    padding: 0;
    display: flex;
    min-height: 0;
}

.settings-hub {
    display: flex;
    align-items: flex-start;
    width: 100%;
}

.settings-hub-nav {
    flex: 0 0 240px;
    width: 240px;
    /* Stretch to the content's full height so the border-right and card
       background read as one continuous full-height rail (HubSpot style). The
       nav LIST inside — not this aside — carries the sticky pin: a stretched
       flex item resolves to the container's (scroll) height, which leaves it
       no room to stick, so pinning it here made the whole rail scroll away and
       took Profile off-screen. Chrome here, pin on the list below. */
    align-self: stretch;
    box-sizing: border-box;
    padding: var(--spacing-mdlg) var(--spacing-smd) var(--spacing-xl);
    border-right: 1px solid var(--color-border);
    background: var(--color-card-bg);
    /* Fill the viewport height even when the page's content is short, so the
       rail never stops mid-screen. */
    min-height: calc(100vh - var(--drawer-top));
}

.settings-hub-nav-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    /* Pin flush under the sticky .global-app-header (top: safe-top + header height) so
       every item stays in view as the page scrolls. Capped to the space below
       the header and scrollable only if a short viewport can't fit all items;
       the scrollbar is hidden to match the rest of the hub chrome. */
    position: sticky;
    top: var(--drawer-top);
    max-height: calc(100vh - var(--drawer-top));
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    overscroll-behavior: contain;
}

.settings-hub-nav-list::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.settings-hub-nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-smd);
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--bs-body-color);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.settings-hub-nav-item:hover {
    background: color-mix(in srgb, var(--color-action) 8%, transparent);
    color: var(--color-action);
}

.settings-hub-nav-item[aria-current="page"] {
    background: color-mix(in srgb, var(--color-action) 12%, transparent);
    color: var(--color-action);
    font-weight: var(--font-weight-medium);
}

.settings-hub-nav-item i {
    font-size: var(--font-size-base);
    width: 1.1rem;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.85;
}

.settings-hub-content {
    flex: 1 1 auto;
    min-width: 0;
    padding: var(--spacing-lg);
    /* clip, NOT hidden — the same trap main.css calls out on .global-app-main. `hidden`
       on one axis computes the other to `auto`, so this pane became a scroll
       container and started clipping vertically too. It is only as tall as its
       content, so on a page whose content had not arrived yet that cut the
       page-ready sheet off at 318px and hid the loading mark at y=482
       completely. `clip` still contains a wide table without ever clipping the
       vertical axis. */
    overflow-x: clip;
}

.core-settings-hub-content-inner {
    max-width: 1120px;
    margin: 0 auto;
    width: 100%;
}

/* The header-clearing offset (start the drawer at the header's bottom edge so a
   full-height offcanvas can't hide its own title behind the sticky header) now
   lives on the shared .global-drawer-offcanvas skin in components/drawer.css, which
   every settings offcanvas here also carries. Nothing settings-specific left. */

/* Wide pages (notifications, permissions, integrations, automations, pipelines)
   opt out of the 1120px reading cap: their rows, tables, and side-by-side cards
   want the room. Other settings keep the narrower cap so forms don't stretch. */
.settings-hub-content-inner--wide {
    max-width: 1440px;
}

/* A .global-tabs strip in the hub column has ~265px less width than a full-width
   page (the 240px second sidebar + its border + gutter), so the shared
   component's flex-wrap:wrap breaks the tab row onto two lines here. Keep the
   strip on one row and let it scroll if it ever runs long. Scoped to the hub
   column so the shared page-tabs component stays ancestor-agnostic. The few
   short strips that land here (worker self-view, properties, templates,
   referrals) fit without a scrollbar; the scrollbar-hiding matches
   .settings-hub-nav above. */
.core-settings-hub-content-inner .global-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.core-settings-hub-content-inner .global-tabs::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

@media (max-width: 767.98px) {
    .settings-hub {
        flex-direction: column;
    }
    .settings-hub-nav {
        flex-basis: auto;
        width: 100%;
        min-height: 0;
        max-height: none;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
    }
    /* One row that scrolls sideways, so the page starts near the top
       instead of under a wall of wrapped chips. */
    .settings-hub-nav-list {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: var(--spacing-xs);
        position: static;
        max-height: none;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
    }
    .settings-hub-nav-list::-webkit-scrollbar {
        display: none;
    }
    .settings-hub-nav-item {
        width: auto;
        min-height: var(--control-h-touch);
        flex-shrink: 0;
        white-space: nowrap;
    }

    /* The nav and the in-page tab strips (Templates, Properties) wear the
       shared edge fade on the right (components/edge-fade.css). */
    /* The mirror fade on the left, shown once the strip has scrolled past
       half its first item (is-scrolled, set by settings_hub_nav.html), so a
       page that opens nudged a few pixels doesn't fade the first tab. The
       negative margin hands
       back its width and the row's gap, so it takes no room. */
    .settings-hub-nav-list::before {
        content: "";
        position: sticky;
        left: 0;
        flex: 0 0 var(--spacing-2xl);
        margin-right: calc(0px - var(--spacing-2xl) - var(--spacing-xs));
        z-index: var(--z-raised);
        align-self: stretch;
        background: linear-gradient(to left, transparent, var(--color-card-bg));
        pointer-events: none;
        opacity: 0;
        transition: opacity var(--transition-fast);
    }
    .settings-hub-nav-list.is-scrolled::before {
        opacity: 1;
    }
    /* Switches, boxes and the small tree toggle keep their look; an unseen
       square around each takes a full fingertip. */
    .settings-hub-content .form-check-input,
    .settings-hub-content .global-checkbox,
    .settings-hub-content .global-tree-toggle {
        position: relative;
    }
    .settings-hub-content .form-check-input::before,
    .settings-hub-content .global-checkbox::before,
    .settings-hub-content .global-tree-toggle::before {
        content: "";
        position: absolute;
        inset: calc((100% - var(--control-h-touch)) / 2);
    }
    /* A row's name opens its editor; it grows to a fingertip tall and the
       row gives back most of its own padding, so the row barely changes. The
       name clips its overflow, so the unseen square above can't work here. */
    .settings-hub-content button.global-skill-row__name {
        min-height: var(--control-h-touch);
    }
    .settings-hub-content .global-skill-row:has(> button.global-skill-row__name) {
        padding-block: var(--spacing-xs);
    }
    /* Stacked layout: the pane must fill the column so its cards clamp to the
       phone width. Without this it sizes to its own widest content, so that
       content never scrolls inside its card and the whole page pans. */
    .settings-hub-content {
        align-self: stretch;
        /* Every card inside adds its own padding; a phone can't also carry
           the desktop gutter. */
        padding-inline: var(--spacing-md);
        padding-top: var(--spacing-md);
        /* The hub zeroes .global-app-content's padding above, which also
           drops the room main.css leaves for the phone's bottom bar. Put
           it back here so the last card never sits under the bar. */
        padding-bottom: calc(var(--bottom-bar-h) + var(--spacing-lg));
    }
}

/* =========================================================================
   Profile / Locations / Skills — the three "Personal" pages in the settings
   hub. Shares the settings-hub tokens (action ink, color-mix tints, 0.5rem/
   0.75rem radii) so these pages rhyme with the hub shell in settings-hub.css.
   Every rule here is namespaced under .profile-* so nothing here can cancel
   or be cancelled by the app's global .card / .form-control styles.
   ========================================================================= */

/* Profile hero face — DELETED. This was a SECOND hero size (132px, with its own
   6px ring and a hard-coded #fff) and it had no call site anywhere in the tree —
   dead CSS holding a size the ladder can't have. The platform hero is one step,
   `.global-avatar--xl` (104px) + `--ring`. */

.settings-profile-name {
    font-size: 1.5rem;
    font-weight: var(--font-weight-medium);
    color: var(--bs-body-color);
    margin: 0;
}

/* Chrome (fill, border, radius, resting shadow) now comes from `.global-card
   --flat`; this class carries only the panel's padding and spacing. */
.settings-profile-card {
    padding: var(--spacing-mdlg) var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

@media (max-width: 767.98px) {
    .settings-profile-card {
        padding: var(--spacing-md);
    }
}

/* Profile top tabs use the canonical `.global-tabs` component in
   components/page-tabs.css. */
.settings-profile-card--flush {
    padding-bottom: var(--spacing-smd);
}

/* "Who can see this" — a property row (workers.css .workers-profile-prop) on the card
   it sits in, edited the way a HubSpot property is (Nick, 08-29): the
   saved level reads as a value with a hover pencil; open, the three
   levels stack as full-width rows (three long labels in one horizontal
   strip wrapped badly at rail width — Nick, 08-28) with Save and Cancel
   under them. */
.workers-visibility-control {
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--color-border);
    border-radius: var(--radius-sm) var(--radius-sm) var(--radius-none) var(--radius-none);
}

.workers-visibility-control__value .bi {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
}

.workers-visibility-control__options {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    background: var(--color-card-bg);
    overflow: hidden;
}

.workers-visibility-option {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-smd);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    cursor: pointer;
    border-bottom: 1px solid var(--color-border);
    margin: 0;
}

.workers-visibility-option:last-child {
    border-bottom: none;
}

.workers-visibility-option:hover {
    background: color-mix(in srgb, var(--color-action) 5%, transparent);
}

.workers-visibility-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.workers-visibility-option__text {
    flex: 1;
    min-width: 0;
}

/* The picked row: an ink tint with ink text and its check shown — never a
   solid fill, which shouted over the whole card. */
.workers-visibility-option__check {
    visibility: hidden;
    flex-shrink: 0;
}

.workers-visibility-option.is-active {
    background: color-mix(in srgb, var(--color-action) 8%, transparent);
    color: var(--color-action);
    font-weight: var(--font-weight-medium);
}

.workers-visibility-option.is-active .workers-visibility-option__check {
    visibility: visible;
}

/* A keyboard on the hidden radio still shows where it is. */
.workers-visibility-option:has(input:focus-visible) {
    outline: 2px solid var(--color-action);
    outline-offset: -2px;
}

.workers-visibility-control__help {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* =========================================================================
   Notifications — the settings-hub "Notifications" page (a reader's own
   alerts, then the organization's read-only half) and the "Slack channels"
   admin page, plus the header bell + unread badge.

   Twins the Profile/Locations/Skills pages: SAME tokens and fallbacks as
   profile.css (--color-action / --surface-raised / --bs-border-color /
   --text-muted, 0.75rem card / 0.5rem control radii, color-mix ink tints) so this page
   rhymes with every other page in the hub. Every rule is namespaced under
   .notifications-* so nothing here can cancel — or be cancelled by — the app's global
   .card / .form-control / .table styles.

   The header bell is the ONE exception: it lives on the dark brand bar, so it
   opts into the shared --header-control-* liquid-glass palette (main.css) the
   same way every other header control does.
   ========================================================================= */

/* The bell <button> also carries .global-header-btn.global-header-btn-icon, so the
   .global-app-header .global-header-btn rules paint it with the white-veil liquid-glass
   treatment (translucent fill, white glyph, hairline border, brightening on
   hover). Here we only add the badge anchor + the unread pill. */
.notifications-bell {
    display: inline-flex;
    align-items: center;
}

.notifications-bell-link {
    position: relative;          /* anchor for the absolutely-placed badge */
}

/* Unread dot — there is something, not how much. A red dot with a ring in
   the bar's own colour, hidden by Alpine (x-show) until a non-zero count
   arrives; the count itself only ever reaches the button's aria-label. */
.notifications-bell-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 9px;
    height: 9px;
    background: var(--color-error);
    border: 1.5px solid var(--color-action);
    border-radius: var(--radius-pill);
    pointer-events: none;
}

/* The outer box is now a Bootstrap offcanvas (.offcanvas.offcanvas-end
   .global-drawer-offcanvas, set in the template) — that shared skin owns position,
   width, height, and the below-the-header top offset, the same idiom every
   other offcanvas drawer in the app uses. .notifications-drawer itself carries no
   box CSS anymore; it stays as a plain, stable hook for the content rules
   below (list/item), all unchanged from the old dropdown box.

   The head row and its X are the shared .global-drawer-head / .global-drawer-head__title /
   .global-drawer-close (components/drawer.css); only the extra tools beside the X —
   mark-all-read and the settings gear — are this drawer's own. */

.notifications-drawer__tools {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.notifications-drawer__mark {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-action);
    background: none;
    border: none;
    padding: var(--spacing-2xs) var(--spacing-xs);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.notifications-drawer__mark:hover {
    background: color-mix(in srgb, var(--color-action) 10%, transparent);
}

.notifications-drawer__gear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: var(--color-text-muted);
    border-radius: var(--radius-sm);
}

.notifications-drawer__gear:hover {
    color: var(--color-text);
    background: var(--color-surface-hover);
}

/* Fills the rest of the offcanvas panel below the head and scrolls on its
   own (the panel itself no longer scrolls — see .global-drawer-offcanvas). */
.notifications-drawer__list {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.notifications-drawer__state {
    padding: var(--spacing-xl) var(--spacing-md);
    text-align: center;
    font-size: var(--font-size-md);
    color: var(--color-text-muted);
    margin: 0;
}

/* One notification row — a full-width link so the whole strip is clickable
   and keyboard-reachable. A row that points somewhere is a real anchor; the
   rest still click to mark read. color/underline are reset so the anchor reads
   like the rest of the text. Unread rows carry a tinted wash and a dot. */
.notifications-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    width: 100%;
    text-align: left;
    padding: var(--spacing-smd) var(--spacing-md);
    background: none;
    border: none;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    color: inherit;
    text-decoration: none;
    transition: background-color 0.12s ease;
}

.notifications-item:last-child {
    border-bottom: none;
}

.notifications-item:hover {
    background: var(--color-surface-hover);
}

.notifications-item.is-unread {
    background: color-mix(in srgb, var(--color-action) 5%, transparent);
}

.notifications-item__dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-top: var(--spacing-xsm);
    border-radius: 50%;
    background: var(--color-action);
}

/* Reserve the dot's width on read rows so titles stay aligned. */
.notifications-item:not(.is-unread) .notifications-item__main {
    padding-left: calc(8px + 0.6rem);
}

.notifications-item__main {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    min-width: 0;
}

.notifications-item__title {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    line-height: 1.35;
}

.notifications-item__text {
    font-size: var(--font-size-sm);
    color: var(--color-grey-600);
    line-height: 1.35;
}

.notifications-item__time {
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
    margin-top: var(--spacing-2xs);
}

/* A group row — one line standing in for a run of same-type notifications,
   e.g. "16 new bills". Reuses the .notifications-item frame, then adds a count pill
   and a chevron on the right. Clicking it expands the run in place. */
.notifications-group {
    align-items: center;
}

.notifications-group__badge {
    flex-shrink: 0;
    margin-left: auto;
    color: var(--color-action);
    background: color-mix(in srgb, var(--color-action) 12%, transparent);
}

.notifications-group__chev {
    flex-shrink: 0;
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
}

/* The individual rows revealed under an expanded group — a faint brand wash
   sets them apart from the top-level list, and each is indented under its
   heading. */
.notifications-group__members {
    background: color-mix(in srgb, var(--color-action) 2%, transparent);
}

.notifications-item--child {
    padding-left: var(--spacing-lg);
}

/* Full width: the wide shell modifier (settings-hub-content-inner--wide) sets
   the outer cap, so the page fills the room the alert rows and the channel
   tables need.

   It also carries the channel column's width. A card's header and its rows do
   share a container now, so the number could sit on .settings-permission-group — but it
   has to be the SAME number in every card or one card's ticks would sit under
   another card's word widths, and one declaration for the page is how that is
   guaranteed rather than reviewed. Read by .notifications-alert-channels below, which
   both the header's words and the rows' boxes wear. */
.notifications-settings {
    margin: 0 auto;
    --notif-channel-col: 3.25rem;
    /* The card's inner gutter (.card-body's padding); the group header
       repeats it to meet the rows, so a phone halves both in one place. */
    --notif-card-gutter: var(--spacing-md);
}

/* "This phone" — the card above the alert cards that signs this browser up for
   phone alerts. One row: the phone glyph in a tinted tile, the name over its
   one line and the iPhone note, the button at the right. Same gap below it as
   between the alert cards, so it reads as the first of them. */
.notifications-phone {
    display: flex;
    /* .global-card stacks its children; this one is a row. */
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-smd);
    padding: var(--spacing-smd) var(--spacing-md);
    margin-bottom: var(--spacing-mdlg);
}

/* The card arrives hidden and the script shows it on a phone alone; the flex
   above would otherwise override the hidden attribute. */
.notifications-phone[hidden] {
    display: none;
}

.notifications-phone__icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-md);
    color: var(--color-action);
    background: color-mix(in srgb, var(--color-action) 10%, transparent);
    font-size: var(--font-size-lg);
}

.notifications-phone__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
}

.notifications-phone__title {
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.notifications-phone__line {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.notifications-phone__hint {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.notifications-phone__hint[hidden],
.notifications-phone__button[hidden] {
    display: none;
}

.notifications-phone__button {
    flex: none;
}

/* The Slack channels page's title block, and only that page's: the
   notifications page itself draws no title of its own any more (it takes
   page_header.html's title_hidden, see app/notifications/settings.html). Kept
   because that page is still reached from Integrations rather than from a
   highlighted nav item, so its name is the only thing saying where you are. */
.notifications-page-title {
    margin-bottom: var(--spacing-md);
}

.notifications-page-h1 {
    font-size: var(--font-size-h2);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    margin: var(--spacing-xs) 0 var(--spacing-xsm);
}

.notifications-page-helper {
    font-size: var(--font-size-md);
    color: var(--color-text-muted);
    margin: 0;
    max-width: 60ch;
}

/* Chrome (fill, hairline border, card radius, resting shadow) now comes from the
   canonical `.global-card` (components/card.css); the template carries both
   classes. This rule keeps only what the canonical card lacks: the section gap
   below each card and the corner clip that keeps the flush link-existing table
   inside the rounded corners. */
.notifications-card {
    margin-bottom: var(--spacing-lg);
    overflow: hidden;            /* clip a flush table to the rounded corners */
}

.notifications-card__header {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-sm) var(--spacing-md);
    flex-wrap: wrap;
    padding: var(--spacing-md) var(--spacing-mdlg);
    border-bottom: 1px solid var(--color-border);
}

.notifications-card__title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    margin: 0;
}

.notifications-card__hint {
    flex-basis: 100%;            /* always drops to its own line under the title */
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin: 0;
}

.notifications-card__body {
    padding: var(--spacing-mdlg) var(--spacing-lg);
}

.notifications-critical {
    display: inline-block;
    margin-left: var(--spacing-sm);
    padding: var(--spacing-2xs) var(--spacing-xsm);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-warning-text);
    background: color-mix(in srgb, var(--color-warning) 18%, transparent);
    border-radius: var(--radius-pill);
    vertical-align: middle;
}

.notifications-cell {
    white-space: nowrap;
}


/* Not a chip — the seam between two OR'd groups of them. Bare and lettered
   rather than filled, so it reads as punctuation between the conditions
   instead of as one more condition. */
.notifications-audience-or {
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}

.notifications-audience-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-smd);
}

/* The shared filter builder, under the hairline the drawer's other blocks
   use, so the conditions read as their own thing and not as more of the
   name field above them. */
.notifications-audience-conditions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding-top: var(--spacing-smd);
    border-top: 1px solid var(--color-border);
}

/* Destructive, so it is set like the other removes in this file — quiet
   until you look for it, never a filled button competing with Save. */
.notifications-audience-delete {
    align-self: flex-start;
    padding: 0;
    font-size: var(--font-size-sm);
    color: var(--color-error);
}

@media (max-width: 575.98px) {
    .notifications-card__header {
        padding: var(--spacing-md) var(--spacing-md);
    }

    .notifications-card__body {
        padding: var(--spacing-md);
    }
}

/* ========================= Review and link ========================= */
/* Not responsive rules — these sit after the Responsive block only because
   they shipped later. The small line under each row of the link-existing
   table saying why it reads the way it does, and the per-booking outcomes
   after a save. */
.notifications-backfill-reason {
    margin: var(--spacing-xsm) 0 0;
    font-size: var(--font-size-sm);
    color: var(--color-grey-600);
}

.notifications-backfill-results {
    margin: var(--spacing-sm) 0 0;
    padding: 0;
    list-style: none;
}

.notifications-backfill-result {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: space-between;
    padding: var(--spacing-xs) 0;
    font-size: var(--font-size-md);
    border-bottom: 1px solid var(--color-border);
}

.notifications-backfill-result__text {
    color: var(--color-grey-600);
}

/* ── Your alerts: a card that names its own columns, then a box per column ──
   Nick, on the coloured pills the rows used to carry:

     "on the selection of the in app versus the email, can you please have
      those be stickey header kind of and then checkboxes? Chekcboxs are just
      more clear than the differnet colloered piull."

   and then, on where those words belong:

     "the in-app email shoudl acutally be sticky in each of the containers,
      like they should be at thet op fot he containers and then stickey as you
      scrol through that container."

   So the words come out of the rows and into the header of the card whose rows
   they name — one heading per card, not one strip above all of them — and the
   rows carry boxes under it. The row itself is still .settings-permission-row
   (settings-hub/permissions.css) on purpose — Nick asked for the Permissions
   page's look, and a second copy of that grid under a different name is how
   two surfaces start to drift. What follows is only what this variant adds.

   Alignment then has to be built rather than assumed, because a tick under
   the wrong word reads as a subscription the person did not choose. Half of
   it is by construction: both sides draw .notifications-alert-channels, a grid of
   FIXED-width columns, inside the same three-column layout, so neither needs
   the other's measurements to put a word over its own boxes. The other half
   is not — the header has to arrive at the same inner edge as a row by
   repeating .settings-permission-row's padding and .card-body's, below, and a repeated
   number is a number that can be wrong. It was, by 15px, until Chromium said
   so; tests/browser/test_notification_self_signup_proof.py now measures both
   centres off real boxes, which is the only thing standing behind this.

   A table would have carried the whole of it for free and is not available:
   the rows are cards in eight separate containers, and no table spans those. */

/* The card's header: the group's name and its rows' column headings on one
   row, sticky.

   Sticky INSIDE the card is the whole of "in each of the containers". A sticky
   box is pinned by the viewport but bounded by its containing block, which
   here is the .global-card — so it pins under the app header while its own
   list scrolls past and leaves with the card, rather than riding the page and
   outliving the rows it names. Two things have to hold for that:

     • .global-card carries no overflow (components/card.css), and a scrolling
       or clipping ancestor would break sticky outright;
     • the settings hub is deliberately not a scroll container either
       (overflow-x: clip, settings-hub.css), so this rides the page's own
       scroll and not a nested one.

   --drawer-top is the platform's single answer for "starts below the app
   header"; do not re-derive it here. The group's own name rides this header
   rather than a band above it precisely because this is the piece still on
   screen when the list is halfway past — a pinned strip reading only "In-app
   Email" would not say which card's.

   Chrome comes from the bare .card-header (main.css): hairline underline,
   medium weight. What is added is the grid, an opaque fill — .card-header is
   transparent, and a pinned transparent header shows the rows sliding under it
   — and the card's own top corners, so the fill does not square off the
   rounded card behind it.

   Written as a descendant of .global-card, and that is load-bearing rather
   than tidy. main.css is linked after every feature sheet (base/base.html), so
   .card-header and a bare .notifications-group-header tie on specificity and the later
   sheet takes it — which silently hands back .card-header's transparent fill
   and its padding. Both were lost exactly that way: the pinned header showed
   the rows through itself, and its words sat 15px off the boxes they name. The
   header only ever hangs inside a .global-card, so the extra class is the truth
   about where it lives and not a weight bolted on to win. */
.global-card .notifications-group-header {
    position: sticky;
    top: var(--drawer-top);
    z-index: var(--z-sticky);
    display: grid;
    /* .settings-permission-row's grid, so the middle column lands in the same place.
       The empty third cell is the row's 18px opener slot. */
    grid-template-columns: minmax(0, 1fr) auto 18px;
    align-items: center;
    gap: var(--spacing-md);
    /* What stands between the card's inner edge and a row's content, summed:
       .card-body's padding, .settings-permission-row's own, and the row's hairline. The
       card's own border is outside this box — the header is inside it, where
       the strip that preceded it was outside — so it is not in the sum.
       Indenting the group's name by the same amount is the other half of the
       point: it lands on the same left edge as the labels of the rows it
       heads. Every term here is repeated from somewhere else and the browser
       proof is what holds them together. */
    padding: var(--spacing-md) calc(var(--notif-card-gutter) + var(--spacing-smd) + 1px);
    background: var(--color-card-bg);
    border-radius: var(--radius-card) var(--radius-card) var(--radius-none) var(--radius-none);
}

/* Icon over word, centred on the column its boxes sit in. */
.notifications-channel-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-2xs);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.04em;
    line-height: 1.3;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

/* The row's boxes, and the header's headings, on one grid. Fixed columns
   rather than flex: a flex row sizes to its content, so "In-app" and "Email"
   would each pull their own column to a different width and the boxes below
   would sit under neither. */
.notifications-alert-channels {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: var(--notif-channel-col);
    justify-items: center;
    align-items: center;
}

/* The control is .global-checkbox (components/checkbox.css) — the platform's
   own box, ADR-131's singleton, already painting its tick in
   --color-neutral-ink-fg. Nothing here restyles it.

   Nick: "we need fo the checkboxes to be bigge rplease". Turned through the
   component's own documented size knob and nothing else. The tick is a
   full-bleed masked ::after sized at 75%, so it re-centres itself at whatever
   edge this says; a width/height pair written here would be the hand-rolled
   lookalike ADR-131's singleton gate exists to stop. 1.25rem is a deliberate
   step up from the component's 1rem default and still leaves room inside the
   3.25rem column, which is what keeps the boxes centred under their words. */
.notifications-alert-channel {
    --global-checkbox-size: 1.25rem;
}

/* In flight (hx-disabled-elt): the shared box goes to not-allowed, which reads
   as "you may not", and this one is only busy. It comes back the moment the
   row swaps in. */
.notifications-alert-channel:disabled {
    cursor: progress;
}

/* Only a row with a filter behind it is a click target. Every row used to wear
   .settings-permission-row's pointer and hover lift while only some had a drawer — Nick:
   "when I click some of the rows that look clickable nothign happens, others
   open the fitler drawer which is great." */
.settings-permission-row--alert {
    cursor: default;
}

.settings-permission-row--alert.is-openable {
    cursor: pointer;
}

/* Taken away, not merely left unset: the lift is .settings-permission-row's own, and a
   row that brightens under the cursor is the promise Nick clicked on. */
.settings-permission-row--alert:not(.is-openable):hover {
    border-color: color-mix(in srgb, currentColor 8%, transparent);
}

/* The funnel at the right. It carries .settings-permission-row__chevron, whose rule is
   to be invisible until the row is hovered — right there, where the row is a
   click target and the chevron only says which way it opens. Here it is the
   mark that the row opens at all, so it is visible at rest. */
.settings-permission-row--alert .notifications-alert-row__narrow {
    opacity: 1;
}

/* Lit once conditions are set, so a narrowed row says so from across the page. */
.notifications-alert-row__narrow.is-set {
    opacity: 1;
    color: var(--color-action);
}

/* The drawer's foot: Clear beside Save, Save primary and last. It reuses the
   drawer footer every saved-view panel uses (.global-drawer__footer, ghost/primary
   buttons — components/drawer-content.css) so both read as one panel language —
   the filter builder inside it is already drawing that button.

   Two departures from the pinned original, both forced. It sits INSIDE the
   panel rather than beside .global-drawer-body, because the panel is what re-renders
   on save (hx-swap="outerHTML" on #self-filter-body) and a footer outside it
   would keep offering Clear on a filter that no longer has one. And it is bled
   back out to the panel's edges — .global-drawer-body's own 1.25rem — so the hairline
   runs the full width the way a pinned footer's does.

   flex-end, not the original's space-between: with nothing saved there is no
   Clear, and space-between would walk Save over to the left on its own.

   Living inside the panel is also what made it float. Below, the panel is a
   full-height column so this can take the slack above it (margin-top: auto)
   and land on the drawer's floor; without that pair it stopped wherever the
   builder stopped, which on an empty filter is a fifth of the way down with
   a full-width hairline across it. Sticky for the other end of the range: a
   builder with a few conditions in it outgrows the drawer, and the way out of
   a question should not be the thing you scroll to find. The bottom offset is
   the bleed, so it comes to rest flush with .global-drawer-body's padding edge rather
   than 1.25rem above it. */
.notifications-self-filter-panel {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.notifications-self-filter-foot {
    justify-content: flex-end;
    margin: auto calc(-1 * var(--spacing-mdlg)) calc(-1 * var(--spacing-mdlg));
    position: sticky;
    bottom: -1.25rem;
}

/* Their own conditions, under the alert's name. One wrapping line: the lead-in
   word and the chips are a sentence and wrap together. */
.notifications-alert-row__narrowed {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-2xs);
}

.notifications-alert-row__narrowed-lead {
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
}

/* Why every button on this row is dark when somebody else put them on it.
   Without this the row is indistinguishable from one nobody ever touched. */
.notifications-alert-row__note {
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
    margin-top: var(--spacing-2xs);
}

/* The Slack channels page stacks its six category groups inside one card,
   rather than the card-per-group the personal alerts page draws — twenty
   switches split six ways is six cards, two of which would hold a single row.

   That stacking is the whole reason this rule exists. On the alerts page the
   space above a group's name is the gap between two cards
   (.settings-permission-groups) and the space under it is .card-header's own padding;
   inside a single card there is neither. Every heading sat flush against
   whatever preceded it — the last row of the group before, or, for the first
   one, the intro line, which carries margin: 0 — and touched the first row of
   its own group. Scoped to this card's body because the alerts page draws the
   same element inside a .card-header, where both spacings are already right.  */
.notifications-card__body .settings-permission-group__header {
    margin-top: var(--spacing-mdlg);
    margin-bottom: var(--spacing-sm);
}

/* A phone: the alert boxes grow through the component's own size knob, and an
   unseen square around each one takes a full fingertip. The channel column
   still holds both, so the boxes stay centred under their words. */
@media (max-width: 767.98px) {
    .notifications-alert-channel {
        --global-checkbox-size: 1.75rem;
    }

    /* The words get the width back. On a phone the desktop padding stacked
       up (card, then row, then the empty opener slot and two wide box
       columns) until an alert's name wrapped one word a line. Each column is
       a fingertip and a little, and the card's inner gutter is halved. */
    .notifications-settings {
        --notif-channel-col: calc(var(--control-h-touch) + var(--spacing-xs));
        --notif-card-gutter: var(--spacing-sm);
    }

    .notifications-channel-head {
        white-space: nowrap;
    }

    .notifications-settings .settings-permission-list {
        padding: var(--notif-card-gutter);
    }

    .notifications-settings .settings-permission-row {
        gap: var(--spacing-sm);
    }

    /* The header's sides follow the halved gutter on their own. */
    .notifications-settings .global-card .notifications-group-header {
        gap: var(--spacing-sm);
        padding-block: var(--spacing-smd);
    }

    /* A card with no row that opens a filter drops the opener slot, on its
       header and every row alike, so the boxes sit at the right edge rather
       than an empty slot in from it. */
    .notifications-settings .settings-permission-group:not(:has(.is-openable))
        :is(.notifications-group-header, .settings-permission-row) {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    /* The bell drawer's Mark all read and gear take a full fingertip. */
    .notifications-drawer__mark {
        min-height: var(--control-h-touch);
    }

    .notifications-drawer__gear {
        width: var(--control-h-touch);
        height: var(--control-h-touch);
    }
}

/* =========================================================================
   Permissions — the settings-hub "Permissions" page: taxonomy groups, each an
   opaque card whose body is a noun table. One row per resource noun, with a
   View cell and an Edit cell — each cell an avatar stack of who holds that
   capability, opening the drawer where grants actually change. One-off powers
   with no read beside them (invite people, complete a milestone) fold into
   tagged action rows below the nouns. A person filter highlights the rows
   someone touches instead of hiding the rest. A presets button sits by the
   filter for granting several rows at once.

   The flat per-capability row classes — .settings-permission-row /
   .settings-permission-list, and .settings-permission-row__chevron, which ports
   .payments-bill-row__chevron (payment-dashboard.css) verbatim for the same
   fade-in-on-hover keyboard opener — are NOT worn by this page any more; the
   Notifications page still wears them (see the two-pages note below), so they
   stay. .settings-preset-chip__open reuses that same opener rule one section
   down. Everything else a row needs (.settings-section, .global-card,
   .global-drawer-body, .global-drawer-scrim/.global-drawer-panel, the
   global-person-chip avatar atom) is already global — nothing here repeats it.

   Two pages wear the flat-row classes, not one. The Notifications page wears
   them over a reader's own alerts (app/notifications/_alert_row.html and
   _channel_default_switch.html): same rows, same avatar stacks, same drawer.
   It reuses these rules rather than copying them under new names, since two
   stylesheets for one look is two chances to drift; the only rules it adds of
   its own are the channel buttons and the funnel opener
   (settings-hub/notifications.css). This file is loaded on every page from
   base/base.html, so that page needs no CSS of its own. A change to a shared
   flat-row rule lands on both; check both.

   Values here sit on the design tokens (tokens.css). The raw sizes left are
   layout geometry with no token: the cell column widths, the 18px chevron
   column, list max-heights, the filter's flex basis and min-width, the 20px
   check icon and the link underline offset.
   ========================================================================= */

.settings-permission-page {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-mdlg);
}

/* .global-filter-bar (filter-bar.css) gives the site's own card-surface look — the
   same idiom the header search/date filters sit in elsewhere; margin-bottom
   is zeroed because .settings-permission-page already spaces its children with its
   own flex gap. No max-width: .global-filter-bar carries none of its own, so this
   stretches the full content width by default — the same top-bar idiom the
   Sign Up dashboard and the other dashboards use, and it now matches the
   permission group cards below it. */
.settings-permission-filter.global-filter-bar {
    margin-bottom: 0;
    /* Pin the search + Presets bar so it stays reachable while the permission
       group cards scroll under it. Sits at --drawer-top — below the header and,
       when a notice band is pinned, below that too — which is the same top edge
       the settings sub-nav sticks to, so the two line up. z lifts it over the
       scrolling cards; the drawer (position: fixed) still sits above it. */
    position: sticky;
    top: var(--drawer-top);
    z-index: var(--z-sticky);
}

/* The picker should sit at the site's standard search width, not
   grow to fill the now-full-width bar. flex: 1 1 260px + min-width: 220px is
   the base contract every search field carries (.global-page-search /
   .global-search-input-wrapper, filter-bar.css:40); max-width: 20rem is the further
   cap a page header settles that same field at
   (.global-page-header .global-page-search, page-header.css) once a header
   has room to let it grow past what it needs. Mirrored here rather than
   reused because this bar is a .global-filter-bar, not a .global-page-header, so
   that rule's selector doesn't reach it. */
.settings-permission-filter .global-cs {
    flex: 1 1 260px;
    min-width: 220px;
    max-width: 20rem;
}

/* With the picker capped, the Presets button would otherwise sit right next
   to it with the rest of the row empty. Same auto-margin idiom page-header.css
   uses to ride its own trailing controls to the right edge once its search is
   capped (.global-page-search + *). */
.settings-permission-filter .global-cs + * {
    margin-left: auto;
}

/* Roman Roads' row: the org box, then the people search (Nick, 2026-11-07).
   The org form adds no box of its own in this row. So the org box is a plain
   item of the row, and the picker size rule above sizes it too. */
.settings-permission-filter__row--orgs {
    flex-wrap: wrap;
}

.settings-permission-filter__row--orgs .settings-permission-org {
    display: contents;
}

/* The btn-sm Presets button reads shorter than the rest of the row — two
   control families in one row. Same fix .worker-add-skill-btn (workers.css)
   uses to match its own 36px neighbor: pin the height to the filter bar's
   own control token (--filter-ctrl-h, filter-bar.css) and zero the vertical
   padding that would otherwise fight it, with inline-flex centering so the
   icon and label stay centered in the taller box. The combobox above is now
   pinned to the same token, so the two controls match. */
.settings-permission-filter .global-filters-row .btn {
    height: var(--filter-ctrl-h, 36px);
    padding-top: 0;
    padding-bottom: 0;
    display: inline-flex;
    align-items: center;
}

/* .global-filters-row (filter-bar.css) sets overflow-x: auto with overflow-y:
   visible for the horizontally-scrolling filter-pill rows it was built for.
   Per the CSS overflow spec, a non-visible value on one axis silently turns
   the other axis's "visible" into "auto" too — so it clips vertically same
   as it scrolls horizontally. That never showed with a bare <select>, whose
   native popup isn't subject to CSS clipping at all, but it cuts the new
   .global-cs-menu combobox popup off clean. This row holds one control and never
   needs to scroll, so opt it out of both axes. */
.settings-permission-filter .global-filters-row {
    overflow: visible;
}

/* Below 576px .global-filters-row already wraps to one control per row (filter-bar.css);
   a 320px-capped picker on its own full-width row reads as a mistake, and the
   auto margin has no slack to ride once the button drops to its own line.
   Release both — same relief page-header.css gives its own search at this
   width. */
@media (max-width: 575.98px) {
    /* Two controls, so they stay on one line: the shared bar's wrap left
       Presets centred alone under the search. */
    .settings-permission-filter .global-filters-row {
        flex-wrap: nowrap;
    }

    .settings-permission-filter .global-cs {
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
    }

    .settings-permission-filter .global-cs + * {
        margin-left: 0;
    }

    /* Give the org box a full line. Keep Search wide enough when the buttons wrap. */
    .settings-permission-filter .settings-permission-filter__row--orgs {
        flex-wrap: wrap;
    }

    .settings-permission-filter__row--orgs .settings-permission-org .global-cs {
        flex-basis: 100%;
    }

    .settings-permission-filter__row--orgs > .global-cs {
        flex: 1 1 50%;
    }
}

/* Each taxonomy group (member_permissions.py::permission_groups) is a real
   .global-card — opaque fill, hairline border, resting shadow — instead of
   the page background showing through. That's the fix for the flat,
   low-contrast list this replaces: a row now sits inside a container, not
   loose on the page. */
.settings-permission-groups {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-mdlg);
}

/* The group name. On the Permissions page it is the first cell of the table's
   head row (.settings-permission-thead, below). The Notifications alerts and
   Slack-channel pages reuse the same label inside a __header of their own
   (app/notifications/_alerts.html, settings_slack_channels.html), so it stays a
   plain shared token. */
.settings-permission-group__label {
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

/* __header and __description are worn only by those two Notifications pages now
   — the Permissions page moved its title into the .settings-permission-thead
   head row and no longer draws a separate description. They stack the group's
   name over its one-line description; this file loads on every settings page
   (see the two-pages note at the top), so the Notifications markup finds them
   here beside the rest of the family. */
.settings-permission-group__header {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
}

.settings-permission-group__description {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-body);
    color: var(--color-text-muted);
}

.settings-permission-setup {
    display: grid;
    gap: var(--spacing-lg);
    max-width: var(--settings-permission-setup-width);
}

.settings-permission-setup__title,
.settings-permission-setup__holder,
.settings-permission-setup__actions,
.settings-permission-setup__controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.settings-permission-setup__title {
    font-family: var(--font-family-heading);
    font-size: var(--font-size-page-title);
    font-weight: var(--font-weight-heading);
    margin-block-end: var(--spacing-xs);
}

.settings-permission-setup__note {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    margin: 0;
}

.settings-permission-setup__open {
    margin-block-end: var(--spacing-lg);
}

.settings-permission-setup > .settings-permission-setup__open {
    margin: 0;
}

.settings-permission-setup__select {
    margin-block-end: var(--spacing-md);
}

.settings-permission-setup__controls > .global-page-search,
.settings-permission-setup__controls > select {
    flex: 1;
    min-width: 0;
}

.settings-permission-setup__holder {
    flex-wrap: wrap;
    justify-content: space-between;
    padding-block: var(--spacing-sm);
}

.settings-permission-setup__holder > span,
.settings-permission-setup__result {
    overflow-wrap: anywhere;
}

.settings-permission-setup__result {
    padding-block: var(--spacing-md);
    border-block-end: 1px solid var(--color-border);
}

.settings-permission-setup__actions {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-block-start: var(--spacing-sm);
}

.settings-permission-setup__actions > form {
    max-width: 100%;
}

.settings-permission-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.settings-permission-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 18px;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-smd) var(--spacing-smd);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, currentColor 3%, transparent);
    cursor: pointer;
    transition: border-color 140ms ease, background 140ms ease, opacity 140ms ease;
}

.settings-permission-row:hover {
    border-color: color-mix(in srgb, currentColor 14%, transparent);
}

/* Label over its one-line explanation — a column since the help lines
   shipped; the label used to sit alone in a wrapping inline row. */
.settings-permission-row__main {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    min-width: 0;
}

.settings-permission-row__label {
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.settings-permission-row__help {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* The real, keyboard-focusable opener — ported from .payments-bill-row__chevron. The
   row itself is not a control (no role/tabindex, see _permissions.html), so
   this is how a keyboard user opens the drawer. */
.settings-permission-row__chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.settings-permission-row:hover .settings-permission-row__chevron,
.settings-permission-row__chevron:focus-visible {
    opacity: 1;
}

.settings-permission-row__chevron:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus-ring-tight);
    border-radius: var(--radius-md);
}

/* ── Noun table: one row per resource, a View cell and an Edit cell ─────────
   The redesigned page body (member_permissions.py::permission_noun_groups):
   each group card holds a noun table, not the flat per-capability list above.
   A resource's :read fills its View cell, its :write fills Edit; a read-only
   noun's Edit and an action's View render the platform dash. The flat
   .settings-permission-row family above is untouched — the Notifications page
   still wears it (see the file header), so these are new names, not edits.

   The card gives no body padding of its own (components/card.css), so the
   head row and rows carry their own horizontal gutter — the same 1rem the
   .card-header above them uses — and rows separate on a hairline rather than
   each sitting in its own bordered box. */
.settings-permission-noun-table {
    /* Width of each View/Edit column. The head row and every row inherit
       it from here, so the two grids stay aligned from one declaration. Wide
       enough to hold a capped face stack (3 faces + "+N") without spilling into
       the neighbouring column. */
    --perm-cell-col: 140px;
    display: flex;
    flex-direction: column;
    /* The narrow layout answers to THIS table's own width, not the viewport, so
       a card in a wide sidebar and one in a narrow column each reflow on their
       own. The @container rule at the foot of this file reads this. */
    container-type: inline-size;
}

/* The table's head row: the group name fills the name column, the View / Edit
   column heads sit beside it — one line, on the same grid every row below uses,
   so the title and the two column heads share a baseline instead of stacking. */
.settings-permission-thead {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--perm-cell-col) var(--perm-cell-col);
    column-gap: var(--spacing-lg);
    align-items: center;
    padding: var(--spacing-md) var(--spacing-md) var(--spacing-smd);
}

/* Name + its optional admin gear, kept together at the start of the head row. */
.settings-permission-thead__name {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    min-width: 0;
}

.settings-permission-thead__gear {
    flex: 0 0 auto;
}

/* "View" / "Edit" — the muted uppercase column heads, centered over their
   columns. aria-hidden in the markup (each cell's button already names its
   column), so a screen reader never doubles them. */
.settings-permission-thead__col {
    text-align: center;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-body);
    text-transform: none;
    color: var(--color-text-secondary);
}

/* "Edit limit" on a limit block: the outline button at the card's small size. */
.settings-permission-card__edit {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-sm);
}

/* The small uppercase labels of the rows, the person card and the drawer
   share one letter spacing, so they read as one kind of label. */
.settings-permission-thead__col,
.settings-permission-card__label,
.settings-permission-card__legend,
.settings-permission-rights-label,
.settings-permission-near__when {
    letter-spacing: 0.08em;
}

.settings-permission-nrow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--perm-cell-col) var(--perm-cell-col);
    column-gap: var(--spacing-lg);
    align-items: center;
    padding: var(--spacing-md);
    border-top: 1px solid var(--color-border-subtle);
    transition: opacity 140ms ease;
}

/* A card part's heading (member_rights.py::CARD_PARTS: the Content card's
   Projects, Galleries and Studio), over the part's first row. It wears the
   column heads' muted uppercase, at the start of the row, so a part reads as a
   small label inside the card and not as a card of its own. It keeps the head
   row's space above it and sits close to its own first row below, so it
   reads as the heading of the rows under it, not the foot of the part above. */
.settings-permission-part {
    padding: var(--spacing-md) var(--spacing-md) 0;
    border-top: 1px solid var(--color-border-subtle);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

/* The heading already draws the hairline above its part, and its first row
   starts close under it. */
.settings-permission-part + .settings-permission-nrow {
    border-top: 0;
    padding-top: var(--spacing-sm);
}

/* The two cells wrap in this, but it dissolves (display: contents) so View and
   Edit sit as the grid's 2nd and 3rd columns. It stays dissolved at every
   width — the narrow layout shrinks the two columns, and on a phone moves
   them to a line under the name (see the @container rules at the foot of
   this file). */
.settings-permission-nrow__cells {
    display: contents;
}

.settings-permission-noun-table--managers :is(.settings-permission-thead, .settings-permission-nrow) {
    grid-template-columns: minmax(0, 1fr) repeat(3, var(--perm-cell-col));
}

.settings-permission-thead__col--manage {
    justify-self: center;
    max-width: 8ch;
    letter-spacing: normal;
}

/* A one-off power with no read beside it (invite people, complete a milestone)
   folds under the noun rows as its own action row — dashed rule, faint fill,
   and a ↳ marking it as tucked beneath. */
.settings-permission-nrow--sub {
    border-top-style: dashed;
    border-top-color: color-mix(in srgb, currentColor 12%, transparent);
    background: color-mix(in srgb, currentColor 2%, transparent);
}

.settings-permission-nrow__name {
    min-width: 0;
    padding-right: var(--spacing-sm);
}

.settings-permission-nrow--sub .settings-permission-nrow__name {
    position: relative;
    padding-left: var(--spacing-mdlg);
}

.settings-permission-nrow--sub .settings-permission-nrow__name::before {
    content: "\21B3"; /* ↳ — this action tucks under the rows above it */
    position: absolute;
    left: 0;
    top: 0;
    color: var(--color-text-muted);
}

/* First row of its card (Sign up for work): only the card head sits above,
   so there is no row to tuck under — no arrow, no indent. */
.settings-permission-thead + .settings-permission-nrow--sub .settings-permission-nrow__name {
    padding-left: 0;
}

.settings-permission-thead + .settings-permission-nrow--sub .settings-permission-nrow__name::before {
    content: none;
}

.settings-permission-nrow__label {
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.settings-permission-nrow--sub .settings-permission-nrow__label {
    font-weight: var(--font-weight-body);
}

.settings-permission-nrow__help {
    display: block;
    margin-top: var(--spacing-2xs);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    line-height: 1.4;
}

:where([data-group-key="styles"]) .settings-permission-nrow__help {
    color: var(--color-text-secondary);
}

/* "action" — a neutral hairline tag on the label of a one-off power (invite
   people, send money out), marking it as a standalone action rather than a
   read/write pair. Not a column. */
.settings-permission-atag {
    display: inline-block;
    margin-left: var(--spacing-sm);
    padding: 0 var(--spacing-xs);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    vertical-align: middle;
    white-space: nowrap;
}

/* One View or Edit cell. Every cell holds a same-size box so View and Edit line
   up: a grantable cell's box is the grant button's holder stack; a cell with
   nothing to grant holds a quiet inert box with a dash. */
.settings-permission-cell {
    display: flex;
    justify-content: center;
    transition: opacity 140ms ease;
}

.settings-permission-cell--na {
    color: var(--color-text-muted);
}

/* The button is only the click/keyboard target — the pill it wraps
   (.settings-permission-stack) carries the visible box, because that span is
   what a grant or revoke swaps out-of-band, so its --on/--empty state must own
   the fill and border or a fresh grant would leave the cell looking empty. */
.settings-permission-grant {
    display: inline-flex;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}

/* The box every cell shows. width:100% makes View and Edit the same size in
   their fixed columns, so a filled cell and an empty one line up. */
.settings-permission-stack {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2xs);
    width: 100%;
    min-height: var(--control-h-base);
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-card-bg);
    box-sizing: border-box;
    transition: border-color 120ms ease, background 120ms ease;
}

/* Held by someone: the green "on" fill. */
.settings-permission-stack--on {
    border-color: var(--color-success-border);
    background: var(--color-success-bg);
}

/* Grantable but empty: a dashed slot in the action colour, with the plus icon
   for an admin (who can grant); everyone else sees a plain dash. */
.settings-permission-stack--empty {
    border-style: dashed;
    border-color: var(--color-action);
    background: none;
}

.settings-permission-stack__plus {
    color: var(--color-action);
    font-size: var(--font-size-base);
    line-height: 1;
}

/* Nothing to grant here (a read-only noun's Edit, an action's View): the same
   size box as its neighbour, but quiet and inert — a light grey fill and a
   dash, no box line (Nick, 2026-11-05) — so the row keeps its two-column
   rhythm without inviting a click. The border stays, unseen, so the box is
   the same size as the pill beside it. */
.settings-permission-stack--none {
    border-style: solid;
    border-color: transparent;
    background: var(--color-grey-50);
    color: var(--color-text-muted);
}

.settings-permission-grant:hover .settings-permission-stack {
    border-style: solid;
    border-color: var(--color-action);
}

.settings-permission-grant:focus-visible {
    outline: none;
}

.settings-permission-grant:focus-visible .settings-permission-stack {
    border-color: var(--color-action);
    box-shadow: var(--shadow-focus-ring-tight);
}

/* ── Person mode (ADR-257) ────────────────────────────────────────────────
   A name picked in the page's search: every box is that person's own switch
   and every row stays at full strength — nothing dims (Nick, 2026-11-05). */

/* The switch: the same box as the stack it stands in for, so the columns
   keep their size. Off is a white box with a solid border; on is the green
   box with a white check; locked is the grey tick nobody can take away. */
.settings-permission-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: var(--control-h-base);
    padding: 0;
    border: 1.5px solid var(--color-grey-400);
    border-radius: var(--radius-sm);
    background: var(--color-card-bg);
    color: transparent;
    box-sizing: border-box;
    cursor: pointer;
    transition: border-color 120ms ease, background 120ms ease;
}

.settings-permission-switch svg {
    width: 20px;
    height: 20px;
}

:where([data-group-key="styles"]) .settings-permission-switch--off {
    border-color: var(--color-text-secondary);
}

.settings-permission-switch:hover {
    border-color: var(--color-action);
}

.settings-permission-switch:focus-visible {
    outline: none;
    border-color: var(--color-action);
    box-shadow: var(--shadow-focus-ring-tight);
}

.settings-permission-switch--on {
    border-color: var(--color-success);
    background: var(--color-success);
    color: var(--color-card-bg);
}

.settings-permission-switch--on:hover {
    border-color: var(--color-success-text);
}

.settings-permission-switch--locked,
.settings-permission-switch--locked:hover {
    border-color: var(--color-grey-300);
    background: var(--color-grey-200);
    color: var(--color-text-muted);
}

/* A reader's switch, and a locked one, show and do not move. */
.settings-permission-switch[aria-disabled="true"] {
    cursor: default;
}

.settings-permission-switch--off[aria-disabled="true"]:hover {
    border-color: var(--color-grey-400);
}

/* Nothing to grant here: blank once a person is picked. */
.settings-permission-page.is-person .settings-permission-cell--na .settings-permission-stack {
    visibility: hidden;
}

/* One mark per row in person mode (design D, ADR-257 Amendment 8): a lock
   where a line limits the row, the warning colour where that line matches
   nothing, a globe where no line applies. The page reads the kind, the icon
   and the word from the card's marks island. On a row it is a button that
   opens the drawer on the row's line. The card wears the same marks. A flex
   box is a block, so the mark sits on its own line under the help text. */
.settings-permission-mark {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    width: fit-content;
    margin-top: var(--spacing-xsm);
    padding: var(--spacing-2xs) var(--spacing-smd) var(--spacing-2xs) var(--spacing-sm);
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    line-height: 1.4;
}

button.settings-permission-mark {
    cursor: pointer;
}

button.settings-permission-mark:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

.settings-permission-mark--limit {
    background: var(--color-action-tint);
    color: var(--color-action);
}

.settings-permission-mark--empty {
    background: var(--status-warning-bg);
    border-color: var(--status-warning-border);
    color: var(--status-warning-fg);
}

.settings-permission-mark--open {
    background: var(--color-grey-100);
    color: var(--color-text-secondary);
}

/* As the table's own width tightens, the View / Edit columns SHRINK and stay
   centered under the one head row — never a label dropped onto each box.
   Answering to the table (@container), not the viewport, keeps a card in a
   narrow column and one in a wide sidebar each adapting on their own. Two
   steps: a narrower column for a tight settings pane, then a phone step
   (below) that gives the name its own line so the two columns keep the tight
   pane's width and a full "3 + N" stack still fits its box. */
@container (max-width: 600px) {
    .settings-permission-thead,
    .settings-permission-nrow {
        --perm-cell-col: 116px;
        column-gap: var(--spacing-md);
    }
}

@container (max-width: 430px) {
    .settings-permission-thead,
    .settings-permission-nrow {
        column-gap: var(--spacing-sm);
        row-gap: var(--spacing-sm);
    }

    /* A phone has no room for a name column beside two box columns: the name
       wrapped a word a line and the head row's gear ran into "View". The name
       (and its help line) takes the full width, and View / Edit drop to a
       line of their own under it, still in the same two columns, still under
       the one head row's words. */
    .settings-permission-thead__name,
    .settings-permission-nrow__name {
        grid-column: 1 / -1;
        padding-right: 0;
    }

    .settings-permission-thead__col:nth-of-type(1),
    .settings-permission-nrow__cells > :nth-child(1) {
        grid-column: 2;
    }

    .settings-permission-thead__col:nth-of-type(2),
    .settings-permission-nrow__cells > :nth-child(2) {
        grid-column: 3;
    }

    /* A full fingertip on every box. */
    .settings-permission-stack {
        min-height: var(--control-h-touch);
    }
}

@container (max-width: 600px) {
    .settings-permission-noun-table--managers :is(.settings-permission-thead, .settings-permission-nrow) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        row-gap: var(--spacing-sm);
    }

    .settings-permission-noun-table--managers :is(.settings-permission-thead__name, .settings-permission-nrow__name) {
        grid-column: 1 / -1;
    }

    .settings-permission-noun-table--managers :is(.settings-permission-thead__col, .settings-permission-nrow__cells > *) {
        grid-column: auto;
    }
}

@container (max-width: 430px) {
    .settings-permission-noun-table:not(.settings-permission-noun-table--managers) :is(.settings-permission-thead, .settings-permission-nrow) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-permission-noun-table :is(.settings-permission-thead__col, .settings-permission-nrow__cells > *) {
        grid-column: auto;
    }
}

/* The drawer body's own column — count line, search, list — on one rhythm,
   instead of each block carrying its own ad-hoc margin. */
.settings-permission-drawer-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-smd);
}

[data-permission-roster] {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-smd);
}

[data-roster-more] {
    min-height: 1px;
}

/* The shared search atom (filter-bar.css) sizes itself for a horizontal
   filter row: flex: 1 1 260px. In this column the main axis is vertical, so
   that basis becomes HEIGHT — a 260px-tall wrapper with the input at its top
   and the icon centered in the empty space below. Pin it to its content. */
.settings-permission-drawer-section .global-page-search {
    flex: none;
}

.settings-permission-drawer-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin: 0;
    padding: 0;
    list-style: none;
}

.settings-permission-drawer-list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-smd);
    /* Pad the row and pull it back out by the same amount so a clickable
       row's hover fill reads as a full-width band to the section's edges.
       Every row wears the same box whether or not it lights up, so the
       checkbox column stays aligned down the list. */
    padding: var(--spacing-xsm) var(--spacing-sm);
    margin: 0 calc(-1 * var(--spacing-sm));
    border-radius: var(--radius-md);
    transition: background-color 0.12s ease;
}

/* Everything that sits in the checkbox column — the chip on a role-locked
   row, the checkbox or the owner's tick — grouped right, so the toggles
   line up down the list no matter which shape a row takes. */
.settings-permission-drawer-list__control {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

/* Where the checked group ends and the unchecked begins. */
.settings-permission-drawer-list__divider {
    border-top: 1px solid var(--color-border-subtle);
    margin: var(--spacing-2xs) 0;
}

/* The owner's slot: the same answer a checked box gives, deliberately not a
   control. Sized to the checkbox so the column stays straight. */
.settings-permission-drawer-tick {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    color: var(--color-action);
}

.settings-permission-drawer-tick svg {
    width: 100%;
    height: 100%;
}

/* The preset editor lists every grantable permission at once — far more than
   the handful of holders a permission drawer shows — so only that one caps
   its height. A modifier rather than a second list family: same list, one
   difference. */
.settings-permission-drawer-list--scroll {
    max-height: 320px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.settings-permission-drawer-list__check {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
}

.settings-permission-drawer-list--scroll input.global-checkbox[name="capabilities"]:is(
    [value="styles:read"],
    [value="personal_style:write"],
    [value="styles:write"]
):not(:checked, :hover, :focus-visible),
:is(
    [data-permission-manager-drawer="styles"],
    [data-permission-manager-drawer="personal_style"]
) input.global-checkbox:not(:checked, :hover, :focus-visible) {
    border-color: var(--color-text-secondary);
}

.settings-permission-drawer-add {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.settings-permission-drawer-add .global-cs {
    flex: 1;
    min-width: 0;
}

/* The presets list now lives inside the Presets drawer
   (_preset_list_drawer.html), on .settings-permission-drawer-section's own rhythm —
   see that class above. Nothing card-shaped is needed here anymore; only
   the chips themselves keep their own look below. */
.settings-preset-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

/* Premium pill: an opaque fill and a resting shadow instead of the flat,
   near-invisible outline it had before, so the row of chips reads as a row
   of real controls rather than ghost text with a border. */
.settings-preset-chip {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-smd);
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-sm);
    max-width: 100%;
    cursor: pointer;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.settings-preset-chip:hover {
    border-color: color-mix(in srgb, currentColor 20%, transparent);
    box-shadow: var(--shadow-md);
}

.settings-preset-chip:focus-within {
    outline: none;
    border-color: var(--color-focus-ring);
    box-shadow: var(--shadow-focus-ring);
}

.settings-preset-chip__text {
    display: flex;
    flex-direction: column;
    gap: 0.0625rem;
    min-width: 0;
}

.settings-preset-chip__name {
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.settings-preset-chip__count {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* The real, keyboard-focusable opener — same fade-in-on-hover pattern as
   .settings-permission-row__chevron above, but resting at partial opacity rather than
   fully invisible: it is the chip's only affordance for "this opens
   something", so hiding it entirely at rest hid the one clue the chip is
   clickable. The chip itself is not a control (no role/tabindex, see
   _presets.html), so this is how a keyboard user opens the drawer. */
.settings-preset-chip__open {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.15s ease;
}

.settings-preset-chip:hover .settings-preset-chip__open,
.settings-preset-chip__open:focus-visible {
    opacity: 1;
}

.settings-preset-chip__open:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus-ring-tight);
    border-radius: var(--radius-md);
}

/* ── The limits step (member scope) ──────────────────────────────────────
   A checked non-admin row grows a Limit affordance, and a limited member's
   row reads its line back as chips under the name; the step itself reuses
   the shared filter builder plus a reach preview. The chips are the shared
   .global-chip that every other condition surface wears, so a condition
   has the same words and the same shape everywhere. */

/* Chip + chip-line column on the left of a row. The chips indent past the
   avatar (32px standard chip + its gap) so the line hangs under the name. */
.settings-permission-drawer-list__who {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    min-width: 0;
}

.settings-permission-scope-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-xs);
    padding-left: var(--spacing-2xl);
}

/* Why a grey box is grey: one short line that hangs under the name, as the
   chips do (UI review of #8958, D2). */
.settings-permission-drawer-list__why {
    padding-left: var(--spacing-2xl);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* The limits-step opener: the row itself is the click target (the drawer
   shell's rosterClick forwards any row click here), and this button is the
   row's keyboard door and hidden-state truth — the same fade-in chevron the
   permission rows wear (.settings-permission-row__chevron above). Hidden (the HTML
   attribute, which Bootstrap's reboot makes win over display) while the row
   is unchecked and unscoped — the affordance follows the box, the list
   never re-sorts mid-session. */
.settings-permission-drawer-list__item:has(.settings-permission-scope-open:not([hidden])) {
    cursor: pointer;
}

/* The clickable-row affordance (Nick, 2026-08: "if someone is clickable,
   there should be a hover effect"): a soft band on hover, matched to the
   same :has() test the cursor uses, so only a row that actually opens the
   limits step lights up — an owner or an unchecked row never does. */
.settings-permission-drawer-list__item:has(.settings-permission-scope-open:not([hidden])):hover {
    background: color-mix(in srgb, currentColor 7%, transparent);
}

.settings-permission-scope-open {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.settings-permission-drawer-list__item:hover .settings-permission-scope-open,
.settings-permission-scope-open:focus-visible {
    opacity: 1;
}

/* What a non-admin reader sees where the button would be: the fact, not
   the control. */

/* The reach preview: how many of the org's upcoming bookings the draft
   leaves this member, then the note about blanks, then the list on demand. */
.settings-permission-scope-reach {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xsm);
    margin-top: var(--spacing-smd);
    padding: var(--spacing-smd);
    background: color-mix(in srgb, var(--color-text-muted) 6%, transparent);
    border-radius: var(--radius-md);
}

.settings-permission-scope-reach__line {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-xsm);
    margin: 0;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.settings-permission-scope-reach__num {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

.settings-permission-scope-reach__note {
    margin: 0;
    padding: var(--spacing-xsm) var(--spacing-sm);
    font-size: var(--font-size-2xs);
    color: var(--color-warning-text);
    background: var(--color-warning-bg);
    border: 1px solid var(--color-warning-border);
    border-radius: var(--radius-sm);
}

.settings-permission-scope-reach__toggle {
    align-self: flex-start;
    padding: 0;
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
    background: none;
    border: none;
    text-decoration: underline;
    cursor: pointer;
}

.settings-permission-scope-reach__list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin: 0;
    padding: 0;
    list-style: none;
    max-height: 240px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.settings-permission-scope-reach__list li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--spacing-smd);
    font-size: var(--font-size-2xs);
    color: var(--color-text);
}

.settings-permission-scope-reach__list li.is-out {
    color: var(--color-text-muted);
}

/* Struck through on the title only — the value labels stay legible, they
   are the reason the row is outside. */
.settings-permission-scope-reach__list li.is-out .settings-permission-scope-reach__title {
    text-decoration: line-through;
    text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
}

.settings-permission-scope-reach__values {
    flex-shrink: 0;
    color: var(--color-text-muted);
}

.settings-permission-scope-reach__more {
    color: var(--color-text-muted);
}

/* Save under the preview — the step's whole answer, then its commit. No
   Remove button: clearing every condition and saving is the removal. */
.settings-permission-scope-commit {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
    margin-top: var(--spacing-smd);
}

/* The booking line's footer: Cancel, then Save, at the end. A clean Save
   stays a live button and sends nothing (ADR-043), so it only looks quiet. */
.settings-permission-scope-commit--end {
    justify-content: flex-end;
}

.settings-permission-scope-commit .is-clean {
    opacity: 0.6;
}

/* ── The person card (design D, ADR-257 Amendment 8) ───────────────────────
   _permission_person_card.html: the head, then two sides. Access holds one
   block per stored line, the rows with no limit and the cards with nothing.
   Own work holds Sign up for work and the person's assigned work. The
   drawer's Applies to, Matches and Closest matches reuse the same parts. */
.settings-permission-card {
    overflow: hidden;
}

.settings-permission-card__head {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
    padding: var(--spacing-md) var(--spacing-mdlg);
}

.settings-permission-card__who {
    min-width: 0;
}

.settings-permission-card__name {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-h4);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    line-height: var(--line-height-subheading);
}

.settings-permission-card__meta {
    display: flex;
    flex-wrap: wrap;
    column-gap: var(--spacing-md);
    margin-top: var(--spacing-2xs);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.settings-permission-card__meta b {
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.settings-permission-card__sides {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 236px;
    border-top: 1px solid var(--color-border-hairline);
}

.settings-permission-card__side {
    min-width: 0;
    padding: var(--spacing-md) var(--spacing-mdlg) var(--spacing-mdlg);
}

.settings-permission-card__side--volunteer {
    border-left: 1px solid var(--color-border-hairline);
    background: var(--color-surface-subtle);
}

.settings-permission-card__label,
.settings-permission-card__legend,
.settings-permission-rights-label {
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.settings-permission-card__label {
    margin-bottom: var(--spacing-smd);
}

.settings-permission-card__legend {
    margin: var(--spacing-smd) 0 var(--spacing-xsm);
}

.settings-permission-rights-label {
    margin: var(--spacing-xs) 0 0 var(--spacing-xs);
}

/* One stored line: its conditions, what it covers, and its counts. A line
   that matches nothing wears the warning edge. */
.settings-permission-limit-block {
    padding: var(--spacing-smd) var(--spacing-md) var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-card-bg);
}

.settings-permission-limit-block + .settings-permission-limit-block {
    margin-top: var(--spacing-smd);
}

.settings-permission-limit-block.is-empty {
    border-left: 3px solid var(--color-warning);
}

.settings-permission-limit-block__head {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.settings-permission-limit-block__head .btn {
    margin-left: auto;
}

.settings-permission-limit-block__title {
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.settings-permission-rule {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-xsm);
    margin-top: var(--spacing-sm);
    font-size: var(--font-size-sm);
}

.settings-permission-rule > .bi {
    color: var(--color-text-muted);
}

.settings-permission-cond {
    padding: var(--spacing-2xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    background: var(--color-grey-100);
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
}

.settings-permission-join {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.settings-permission-covers,
.settings-permission-others {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.settings-permission-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-2xs) var(--spacing-smd);
    border-radius: var(--radius-pill);
    background: var(--color-grey-100);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.settings-permission-chip span {
    font-weight: var(--font-weight-body);
    color: var(--color-text-secondary);
}

.settings-permission-chip [data-work-pay-summary] {
    color: var(--color-text);
}

/* The counts: one tile per item kind. A zero tile wears the warning. */
.settings-permission-tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--spacing-sm);
}

.settings-permission-tiles--stack {
    grid-template-columns: minmax(0, 1fr);
}

.settings-permission-match {
    padding: var(--spacing-sm) var(--spacing-smd);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    background: var(--color-surface-subtle);
}

.settings-permission-match b {
    margin-right: var(--spacing-2xs);
    font-size: var(--font-size-h4);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

.settings-permission-match span {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.settings-permission-match small {
    display: block;
    margin-top: var(--spacing-2xs);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.settings-permission-match.is-zero {
    background: var(--status-warning-bg);
    border-color: var(--status-warning-border);
}

.settings-permission-match.is-zero b,
.settings-permission-match.is-zero span {
    color: var(--status-warning-fg);
}

/* A row no line limits: dashed, with its No limit mark. */
.settings-permission-open-row,
.settings-permission-full {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-smd);
    padding: var(--spacing-sm) var(--spacing-smd);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
}

.settings-permission-full:first-of-type {
    margin-top: 0;
}

.settings-permission-open-row b,
.settings-permission-full b {
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.settings-permission-open-row em {
    margin-left: var(--spacing-xs);
    font-style: normal;
    color: var(--color-text-secondary);
}

.settings-permission-open-row .settings-permission-mark,
.settings-permission-full .settings-permission-mark {
    margin-top: 0;
}

.settings-permission-none {
    margin-top: var(--spacing-sm);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.settings-permission-none b {
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
}

.settings-permission-kv {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) 0;
    border-top: 1px solid var(--color-border-subtle);
    font-size: var(--font-size-sm);
    color: var(--color-text);
}

.settings-permission-kv:first-of-type {
    border-top: none;
}

.settings-permission-kv__key {
    font-weight: var(--font-weight-medium);
}

.settings-permission-kv__value,
.settings-permission-kv--muted {
    color: var(--color-text-secondary);
}

/* The drawer's Applies to: each covered row and the columns held, then the
   rows the line would box where the person holds nothing, muted. A hairline
   sets Applies to apart from Only where under it. */
.settings-permission-cover-rows {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--color-border-subtle);
}

.settings-permission-cover-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-xs) 0;
    font-size: var(--font-size-sm);
    color: var(--color-text);
}

.settings-permission-cover-row.is-muted {
    color: var(--color-text-muted);
}

.settings-permission-held {
    display: inline-flex;
    gap: var(--spacing-xs);
}

.settings-permission-held span {
    padding: var(--spacing-2xs) var(--spacing-sm);
    border-radius: var(--radius-pill);
    background: var(--color-success-bg);
    color: var(--color-success-text);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
}

/* The growth the payout doors would add, once they read the line. */
.settings-permission-payout {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-xsm);
    padding: var(--spacing-2xs) var(--spacing-sm);
    border: 1px solid var(--status-danger-border);
    border-radius: var(--radius-pill);
    background: var(--status-danger-bg);
    color: var(--color-error-text);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
}

/* Closest matches: the items the draft just misses, each condition marked
   met or missed. A hairline sets them apart from the Matches tiles. */
.settings-permission-near {
    margin-top: var(--spacing-md);
    border-top: 1px solid var(--color-border-subtle);
}

.settings-permission-near__kind {
    margin-top: var(--spacing-xs);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
}

.settings-permission-near__row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) 0;
    border-top: 1px solid var(--color-border-subtle);
}

.settings-permission-near__when {
    text-align: center;
    font-size: var(--font-size-2xs);
    text-transform: uppercase;
    color: var(--color-text-muted);
    line-height: var(--line-height-heading);
}

.settings-permission-near__when b {
    display: block;
    font-size: var(--font-size-lg);
    letter-spacing: 0;
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.settings-permission-near__body {
    min-width: 0;
}

.settings-permission-near__title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.settings-permission-near__marks {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-2xs);
    margin-top: var(--spacing-2xs);
}

.settings-permission-near__mark {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2xs);
    padding: 0 var(--spacing-xsm);
    border-radius: var(--radius-pill);
    background: var(--status-warning-bg);
    color: var(--status-warning-fg);
    font-size: var(--font-size-xs);
}

.settings-permission-near__mark.is-met {
    background: var(--color-success-bg);
    color: var(--color-success-text);
}

/* Stack before the Access side gets too narrow for the count text. */
@media (max-width: 991.98px) {
    .settings-permission-card__head {
        padding: var(--spacing-md);
    }

    .settings-permission-card__sides {
        grid-template-columns: minmax(0, 1fr);
    }

    .settings-permission-card__side {
        padding: var(--spacing-md);
    }

    .settings-permission-card__side--volunteer {
        border-left: none;
        border-top: 1px solid var(--color-border-hairline);
    }

    .settings-permission-tiles {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ── Section settings: gear + drawers ──────────────────────────────────────
   Two groups own an org-wide setting rather than per-person grants —
   Opportunities (who may touch a booking's files) and Staffing & Sign-ups
   (what the board shows). Each tucks an admin-only gear right after its name in
   the table's head row (see .settings-permission-thead__gear above), so the
   switch it opens stops sitting loose on the page. */

/* File-actor drawer body: one field, its label over the select. The select
   is the global modern control, not a bare Bootstrap form-select. */
.settings-file-actor-field {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin: 0;
}

.settings-file-actor-field__label {
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

/* Sign Up drawer body: one gate per row, switch opposite its label, a
   hairline between rows instead of a card each. Token type, not ad-hoc
   .small / inline font-size. */
.settings-signup-gate {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--spacing-md);
    padding: var(--spacing-smd) 0;
}

.settings-signup-gate--divided {
    border-top: 1px solid var(--color-border);
}

.settings-signup-gate__text {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    min-width: 0;
}

.settings-signup-gate__label {
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.settings-signup-gate__help {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.settings-signup-matched {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    margin-top: var(--spacing-smd);
    padding-top: var(--spacing-smd);
    border-top: 1px solid var(--color-border);
}

.settings-signup-matched__title {
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.settings-signup-matched__row {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.settings-ppd-panel {
    container-type: inline-size;
}

.settings-ppd-panel,
.settings-ppd-pending .global-drawer-panel {
    background: var(--color-card-bg);
}

.settings-ppd-panel > .global-drawer-body {
    padding: 0;
}

.settings-ppd-panel .global-toast-container--inline {
    margin: var(--spacing-sm) var(--spacing-md);
}

.settings-ppd-tools {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-smd) var(--spacing-md);
    border-bottom: 1px solid var(--color-border-subtle);
    background: var(--color-card-bg);
}

.settings-ppd-tools .global-page-search {
    flex: 1;
    min-width: 0;
}

.settings-ppd-presets {
    position: relative;
}

.settings-ppd-presets .global-menu {
    position: absolute;
    right: 0;
    top: calc(100% + var(--spacing-xs));
    min-width: max-content;
}

.settings-ppd-page {
    display: grid;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--color-surface-subtle);
}

.settings-ppd-group {
    scroll-margin-top: calc(var(--control-h-touch) + 2 * var(--spacing-smd));
}

@container (max-width: 540px) {
    .settings-ppd-page .settings-permission-card__sides,
    .settings-ppd-page .settings-permission-tiles {
        grid-template-columns: minmax(0, 1fr);
    }

    .settings-ppd-page .settings-permission-card__side--volunteer {
        border-left: 0;
        border-top: 1px solid var(--color-border-hairline);
    }
}

.settings-ppd-fold {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.settings-ppd-phone-group,
.settings-ppd-held,
.settings-ppd [hidden] {
    display: none;
}

.settings-ppd-cell {
    margin: 0;
    padding: 0;
    list-style: none;
    min-width: 0;
}

.settings-ppd-cell li {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-2xs);
}

.settings-ppd-check {
    position: relative;
    flex: 1;
    min-width: 0;
}

.settings-ppd .settings-permission-nrow__help,
.settings-ppd .settings-permission-none,
.settings-ppd .settings-permission-atag,
.settings-ppd .settings-permission-card__label,
.settings-ppd .settings-permission-card__legend,
.settings-ppd .settings-permission-rights-label,
.settings-ppd .settings-permission-part,
.settings-ppd .settings-section-label,
.settings-ppd .global-filter-builder-group__add,
.settings-ppd .global-filter-builder-add,
.settings-ppd .global-filter-builder-token--operator,
.settings-ppd .settings-permission-scope-open,
.settings-ppd .global-drawer-head__back,
.settings-ppd .global-drawer-close,
.settings-ppd-pending .global-drawer-close,
.settings-ppd .settings-permission-scope-reach__line,
.settings-ppd .settings-permission-scope-reach__note,
.settings-ppd .settings-permission-scope-reach__toggle,
.settings-ppd-locked {
    color: var(--color-text-secondary);
}

.settings-ppd-tools .global-filter-control::placeholder {
    color: var(--color-text-secondary);
}

.settings-ppd-tools .global-filter-control[type="search"]::-webkit-search-cancel-button {
    background: var(--color-text-secondary);
}

.settings-ppd-check .settings-permission-switch {
    border-color: var(--color-grey-500);
}

.settings-ppd-check input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.settings-ppd-check input:focus-visible + span {
    border-color: var(--color-action);
    box-shadow: var(--shadow-focus-ring-tight);
}

.settings-ppd-check input:checked + span {
    border-color: var(--color-success);
    background: var(--color-success);
    color: var(--color-card-bg);
}

.settings-ppd-check input:disabled + span {
    border-color: var(--color-grey-300);
    background: var(--color-grey-200);
    color: var(--color-text-muted);
    cursor: default;
}

.settings-ppd-cell .settings-permission-scope-open {
    min-height: var(--control-h-base);
    min-width: var(--control-h-base);
    opacity: 1;
}

.settings-ppd-locked {
    width: 100%;
    font-size: var(--font-size-xs);
}

.settings-ppd-limit-panel {
    position: absolute;
    inset: 0;
    z-index: var(--z-sticky);
    display: flex;
    flex-direction: column;
    background: var(--color-card-bg);
    box-shadow: var(--shadow-modal);
}

@media (min-width: 768px) {
    .settings-ppd-group.is-shut .settings-ppd-fold .bi {
        transform: rotate(-90deg);
    }

    .settings-ppd-group.is-shut .settings-permission-thead__col,
    .settings-ppd-group.is-shut .settings-permission-part,
    .settings-ppd-group.is-shut .settings-permission-nrow {
        display: none;
    }

    .settings-ppd-group.is-shut .settings-ppd-held {
        display: flex;
        flex-wrap: wrap;
        gap: var(--spacing-xs);
        padding: var(--spacing-xs) var(--spacing-md) var(--spacing-smd);
        color: var(--color-text-secondary);
    }
}

@media (max-width: 767.98px) {
    .settings-ppd-check .settings-permission-switch,
    .settings-ppd-cell .settings-permission-scope-open {
        min-height: var(--control-h-touch);
    }

    .settings-ppd-fold {
        display: none;
    }

    .settings-ppd-phone-group {
        display: inline;
    }

    .settings-ppd-presets .global-menu {
        min-width: 0;
        width: calc(100vw - (var(--spacing-md) * 2));
    }
}

/* Settings → Referrals, the member's own page — the add-on composer's role row.

   The role choice is a radio-backed pick-chip row, not a <select>: a collapsed
   dropdown shows only the first role alphabetically, so a worker holding six
   roles saw "Creative Lead" and read the other five as missing. Picking ONE
   from a list is the tile/chip idiom (Nick, 2026-08-15); the skin is the
   meeting wizard's chip picks (features/scheduling/meeting-wizard.css) — a
   hidden radio behind a bordered pill that takes the brand ring when checked. */

.settings-referral-role-picks {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.settings-referral-role-pick {
    position: relative;
}

.settings-referral-role-pick input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.settings-referral-role-pick__label {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-card-bg);
    font-size: var(--font-size-sm);
    cursor: pointer;
}

.settings-referral-role-pick input:checked + .settings-referral-role-pick__label {
    border-color: var(--color-action);
    background: var(--color-action-tint-pressed);
    color: var(--color-action);
    font-weight: var(--font-weight-medium);
}

.settings-referral-role-pick input:focus-visible + .settings-referral-role-pick__label {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

/* Properties settings page (_properties.html + _property_drawer.html).

   Runs on the global system (.global-card, .global-tabs, .global-icon-btn,
   .global-drawer-*, .settings-section) + Bootstrap utilities; only the dense
   group/row list, the inline forms and the drawer's own bits live here.
   Bottom-up: the list, its rows, the inline forms, then the drawer. The
   Naming drawer's rules sit with the Templates page it lives on (templates.css). */

/* ── Groups ─────────────────────────────────────────────────────────── */

.settings-prop-groups {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-smd);
}

.settings-prop-group__head {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-height: 2.75rem;
    padding: var(--spacing-xs) var(--spacing-smd) var(--spacing-xs) var(--spacing-md);
}

/* The group's name is a button (click to rename) that looks like a heading.
   A system group's button is disabled: same look, no hand cursor. */
.settings-prop-group__name {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.settings-prop-group__name:disabled {
    cursor: default;
    color: var(--color-text);
    opacity: 1;
}

.settings-prop-group__name > span:first-child {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.settings-prop-group__rename {
    flex: 1 1 auto;
    max-width: 20rem;
}

.settings-prop-group__count {
    font-size: var(--font-size-xs);
    font-variant-numeric: tabular-nums;
    color: var(--color-text-muted);
}

/* "System" beside a group or row name: a quiet word, never a chip. */
.settings-prop-group__note,
.settings-prop-row__note {
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

/* ── Rows ───────────────────────────────────────────────────────────── */

.settings-prop-list {
    border-top: 1px solid var(--color-border-hairline);
}

/* One dense line per property: name, type, and — on hover or focus — the
   settings that are on, right-aligned. Grid, not flex, so the summary gets
   whatever room the name and type leave and never pushes them. */
.settings-prop-row {
    display: grid;
    grid-template-columns: auto minmax(0, max-content) max-content max-content minmax(0, 1fr);
    align-items: center;
    column-gap: var(--spacing-sm);
    min-height: 2.5rem;
    padding: var(--spacing-xs) var(--spacing-md) var(--spacing-xs) var(--spacing-md);
    font-size: var(--font-size-md);
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.settings-prop-row + .settings-prop-row {
    border-top: 1px solid var(--color-border-hairline);
}

.settings-prop-row:hover,
.settings-prop-row:focus-visible {
    background: var(--color-surface-subtle);
}

.settings-prop-row:focus-visible {
    outline: none;
    box-shadow: var(--shadow-inset-ring-strong);
}

.settings-prop-row__label {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--color-text);
}

.settings-prop-row.is-hidden .settings-prop-row__label {
    color: var(--color-text-secondary);
}

.settings-prop-row__type {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* The settings summary rides at the row's right and shows on hover or
   keyboard focus; a device with no hover always shows it. Opacity, not
   display, so the row's height never jumps. */
.settings-prop-row__summary {
    justify-self: end;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    opacity: 0;
    transition: opacity 0.12s ease;
}

.settings-prop-row:hover .settings-prop-row__summary,
.settings-prop-row:focus-visible .settings-prop-row__summary {
    opacity: 1;
}

@media (hover: none) {
    .settings-prop-row__summary {
        opacity: 1;
    }
}

/* Every grip in the list — a group's or a row's — shows on hover only.
   Opacity, never display/visibility, so the handle keeps its hit target
   (SortableJS still grabs it mid-fade, and touch devices, which never hover,
   can still start a drag on the blank cell). The grip column stays in the
   grid even when reordering is off, so names line up across groups. */
.settings-prop-group__grip,
.settings-prop-row__grip {
    width: 1rem;
    color: var(--color-text-muted);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.settings-prop-group__head:hover .settings-prop-group__grip,
.settings-prop-row:hover .settings-prop-row__grip {
    opacity: 1;
}

/* While a search narrows the list there is nothing to drag: the grip goes
   invisible but keeps its column, so the names do not shift as you type. */
.settings-prop-group__grip.is-off,
.settings-prop-row__grip.is-off {
    visibility: hidden;
}

.settings-prop-row.is-sortable-ghost {
    background: var(--color-action-tint);
}

/* Archived rows: no drawer behind them, so no hand cursor; the meta line and
   the two buttons take the summary's place. */
.settings-prop-row--archived {
    grid-template-columns: minmax(0, max-content) max-content max-content minmax(0, 1fr) auto;
    cursor: default;
}

.settings-prop-row--archived:hover {
    background: none;
}

.settings-prop-row__meta {
    justify-self: end;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.settings-prop-row__actions {
    display: flex;
    gap: var(--spacing-sm);
}

/* ── Inline forms ───────────────────────────────────────────────────── */

.settings-prop-newgroup {
    margin-top: var(--spacing-md);
}

.settings-prop-newgroup__form {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    max-width: 26rem;
}

/* ── Drawer ─────────────────────────────────────────────────────────── */

/* The def drawer is a persistent dock panel: closed, it sits translateX'd
   off-screen but stays in the DOM, so without this its ~20 form fields remain
   in the page's tab order (the Bootstrap offcanvas it replaced hid them with
   visibility). Same discrete-visibility recipe as .global-drawer-panel--overlay:
   visibility rides the transition, so the slide-out still paints and the
   panel only goes hidden once it has left the screen. Scoped to this page's
   class — .drawer-panel--dock itself is a documented styles-nothing marker. */
.settings-prop-def-drawer {
    transition: transform .2s ease, visibility .2s ease;
}

.settings-prop-def-drawer:not(.is-open) {
    visibility: hidden;
}

/* Dropdown options: one box per option, a grip to drag, an x to drop. */
.settings-prop-options {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.settings-prop-option {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.settings-prop-option > .form-control {
    flex: 1 1 auto;
}

.settings-prop-option__grip {
    width: 1rem;
    color: var(--color-text-muted);
}

.settings-prop-option.is-sortable-ghost {
    opacity: 0.4;
}

/* What the property looks like on a form, in a quiet box. */
.settings-prop-preview {
    padding: var(--spacing-smd) var(--spacing-md);
    border: 1px solid var(--color-border-hairline);
    border-radius: var(--radius-md);
    background: var(--color-surface-subtle);
}


/* Dock panel. `.drawer-panel--dock` styles nothing on its own; it marks the
   panel so drawer.js leaves this always-present node out of its ephemeral
   reconcile. Because the node never leaves the DOM, a CLOSED panel still keeps
   its inputs and buttons in the tab order — translateX alone moves pixels, not
   focusability — so visibility is taken away too. It is a discrete property, so
   it flips at the far end of the slide rather than blanking the panel on its
   way out. Same recipe as `.settings-prop-def-drawer` in properties.css. The
   Naming drawer behind the gear is the page's second dock panel and wears
   the same rule. */
.settings-tmpl-drawer,
.settings-naming-drawer {
    transition: transform .2s ease, visibility .2s ease;
}

.settings-tmpl-drawer:not(.is-open),
.settings-naming-drawer:not(.is-open) {
    visibility: hidden;
}

/* The shelf under the body. It holds Save on a normal open and the remove
   confirmation when one is running, so it is one border and one rhythm rather
   than two footers that swap. */
.settings-tmpl-foot {
    padding: var(--spacing-md) var(--spacing-mdlg);
    border-top: 1px solid var(--color-border-subtle);
}

/* Remove, confirmed in place. Deliberately NOT a modal: the record being
   removed is the one filling the panel above, and a dialog over the top hides
   exactly the thing the admin is checking before they commit. Both branches —
   the refusal and the go-ahead — wear the same three rows (eyebrow, sentence,
   actions) so the shelf never jumps between them. */
.settings-tmpl-confirm {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* The eyebrow rides the shared `.settings-section-label` for its type; this
   only lays the icon beside it and drops the paragraph margin. */
.settings-tmpl-confirm__label {
    display: flex;
    align-items: center;
    gap: var(--spacing-xsm);
    margin: 0;
}

/* Red is spent on the branch that actually destroys something. A refusal is not
   a failure — nothing went wrong, the record is simply still in use — so it
   keeps the muted eyebrow and says so in words. */
.settings-tmpl-confirm--danger .settings-tmpl-confirm__label {
    color: var(--color-error);
}

.settings-tmpl-confirm__body {
    margin: 0;
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

/* The refusal sentence is the server's own words, verbatim — the same string
   the DELETE answers with. Set on a quiet ground so it reads as a verdict
   handed back rather than as more page copy, which is the difference between
   "the system checked" and "someone wrote a warning here". */
.settings-tmpl-confirm--blocked .settings-tmpl-confirm__body {
    padding: var(--spacing-sm) var(--spacing-sm);
    border-radius: var(--radius-sm);
    background: var(--color-surface-subtle);
}

/* What goes with it. Quieter than the sentence it trails, because it is the
   consequence rather than the question. */
.settings-tmpl-confirm__aside {
    color: var(--color-text-muted);
}

.settings-tmpl-confirm__actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}

/* The default-roles and required-abilities pickers. A scroll box rather than a
   free-growing list: an org with thirty roles would otherwise push Save off the
   bottom of the panel, and the drawer body scrolling instead means the field
   labels above scroll away with it. */
.settings-tmpl-picklist {
    max-height: 180px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--spacing-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

/* A skill requirement carries a level <select> and a remove button inside the
   chip, so it needs a little more vertical room than a resting `.global-chip`
   holding text alone. Padding only — the chip's own fill, radius and type stay
   the component's. */
.settings-tmpl-skill-chip {
    padding-block: var(--spacing-xs);
}

/* The tag-palette picker: one round button per --tag-* hue, replacing the free
   color wheel. Each button's fill is set inline from its token, so this file
   never repeats the palette. background-clip keeps the fill inside the border
   box, so the selected dot gains an ink ring with a clear gap around the
   fill — a mark that reads on every hue, which a check glyph or an accent
   border would not. */
.settings-tmpl-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.settings-tmpl-swatch {
    width: 28px;
    height: 28px;
    padding: var(--spacing-2xs);
    border: 2px solid transparent;
    border-radius: var(--radius-pill);
    background-clip: content-box;
    cursor: pointer;
}

.settings-tmpl-swatch.is-selected {
    border-color: var(--color-neutral-ink);
}

.settings-tmpl-swatch:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus-ring);
}

/* ── Naming drawer (_naming_drawer.html + _naming.html) ─────────────── */

/* The body is four .settings-section blocks straight in the drawer body —
   the two piece lists, the join, the preview — and the sections space
   themselves (settings-controls.css), so there is no wrapper rule here. */
.settings-naming__separator {
    max-width: 14rem;
}

/* The server's answer: each of the newest bookings, reference then name. */
.settings-naming-preview {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    padding: var(--spacing-smd) var(--spacing-md);
    border: 1px solid var(--color-border-hairline);
    border-radius: var(--radius-md);
    background: var(--color-surface-subtle);
}

.settings-naming-preview__spinner {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
}

.settings-naming-preview__row {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: var(--spacing-sm);
    align-items: baseline;
}

.settings-naming-preview__ref {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.settings-naming-preview__name {
    overflow-wrap: anywhere;
}

/* =========================================================================
   Support desk — the header help button and the panel it drops.

   Twins the bell (notifications.css): the button opts into the shared
   --header-control-* liquid-glass palette by carrying .global-header-btn. The panel
   itself is local — it is the one overlay in the app that is neither a drawer
   nor a modal, and its box is written here rather than inherited — but its
   head is still the shared .global-drawer-head, so the way out of it is the way out
   of everything else. Everything is namespaced under .support-* so it cannot
   cancel — or be cancelled by — the app's global .card / .form-control styles.
   ========================================================================= */

.support-desk {
    display: inline-flex;
    align-items: center;
    /* Two buttons live in here, with the same air the header puts between
       its own controls (.global-app-header-actions, main.css). */
    gap: var(--spacing-sm);
}

/* ============================ The float ============================ */

/* The clip. Fixed to the viewport, starting at the top bar's own bottom edge
   (--drawer-top — the one place that offset is computed) and running to the
   floor, with everything above that line cut off.

   That single rule is what makes the panel look like it comes OUT of the bar
   instead of sliding over it: a closed panel is parked above the cut, so it is
   not hidden behind the bar, it is not painted at all. The same box is what
   the drag clamps against (support_button.html), which keeps the panel from
   being shoved somewhere it can never be grabbed back from.

   pointer-events: none because this layer covers the whole page. The panel
   inside turns them back on for itself; nothing else in here is clickable.

   The rung is --z-modal, the same one the drawer sat on, and the partial this
   ships inside settles the rest: .global-app-header is position: sticky with
   z-index 1050, so it is its own stacking context and everything in here
   paints inside it — over the sidebar and the page, under a real modal. */
.support-float {
    position: fixed;
    top: var(--drawer-top);
    right: 0;
    bottom: 0;
    left: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: var(--z-modal);

    /* Support wears the PLATFORM, not the tenant. A ticket goes to SkillBridge,
       not to the org whose page it was filed from, so the popup that files it
       reads the same on every tenant instead of in that tenant's fill — the
       same call main.css already makes for the profile-photo nudge (.global-btn-ink):
       an account-level fact carries the platform ink rather than the org's.

       The re-point lives on the clip rather than on .support-panel because the
       clip is the one ancestor of BOTH halves of the popup — the panel and the
       screenshot editor, which is a sibling of the panel, not a child of it
       (it has to be: a transform on .support-panel would trap the editor's
       position: fixed inside it). Custom properties inherit, so scoping the
       brand family here covers anything in the popup that reaches for a brand
       token — today the plain link color main.css gives every `a`, tomorrow
       whatever a shared partial brings in with it.

       --color-neutral-ink is the platform fill and branding.py never writes
       it, so the org's inline :root style block cannot reach these values.
       Every tenant sets primary/secondary (Roman Roads navy, Fortis pure
       black), so this is a live change on all of them, not a theoretical one.

       --brand-accent is deliberately NOT re-pointed: nothing in the popup
       reads it, and the platform's default accent has no token name to point
       back at, so aliasing it to the ink would assert an accent is the primary
       when it is not. It gets a name the day something in here needs one.

       Typography stops at the face. --font-family is the whole live font leak
       (Fortis is the only tenant setting a body font); the body weight, style,
       transform and letter-spacing tokens are org typography taste that no
       tenant currently moves off the defaults, so they are left inherited
       rather than walled off against a leak nobody has. */
    --brand-primary: var(--color-neutral-ink);
    --brand-secondary: var(--color-neutral-ink);
    --brand-highlight: var(--color-neutral-ink);
    --brand-primary-fg: var(--color-neutral-ink-fg);
    --brand-secondary-fg: var(--color-neutral-ink-fg);
    --brand-highlight-fg: var(--color-neutral-ink-fg);
    /* Flat, not --color-neutral-ink-hover: that token is a color-mix, and on a
       pre-2023 engine a var() resolving to an unsupported color-mix is invalid
       at computed-value time, blanking whatever property took it. .global-btn-ink
       handles its own hover behind an @supports gate; this is only the floor
       for stray brand consumers, so it degrades legibly instead. */
    --brand-primary-hover: var(--color-neutral-ink);
    --brand-primary-on-page-bg: var(--color-neutral-ink);
    --brand-primary-on-card-bg: var(--color-neutral-ink);
    --font-family: var(--platform-font-family);
}

/* The panel. Absolute inside the clip, so its resting place is expressed
   against the clip and the drag can move it by writing left/top in px.

   --support-lift is how far a closed panel has to travel to clear the clip's
   ceiling: its own height, plus wherever it was last left, plus a little air.
   The drag keeps it in step with `top`. Without it, a panel shoved to the
   floor would "close" by sliding up to the middle of the screen and stopping
   there, in full view.

   The closed state IS the base state — a panel nobody has opened must not
   paint — and `visibility` is what takes it out of the tab order and the
   accessibility tree as well as off the screen. It flips at the END of the
   slide out and at the START of the slide in, which is what the two different
   delays are for. SUPPORT_SLIDE_MS in support_button.html mirrors the 320ms;
   the capture flow waits it out so a screenshot is taken with the panel really
   gone. Keep the two in step. */
.support-panel {
    --support-lift: 10px;
    position: absolute;
    top: 10px;
    right: 14px;
    display: flex;
    flex-direction: column;
    width: 372px;
    max-width: calc(100% - 16px);
    max-height: calc(100% - 20px);
    overflow: hidden;
    pointer-events: auto;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    transform: translateY(calc(-100% - var(--support-lift) - 16px));
    opacity: 0;
    visibility: hidden;
    transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1),
                opacity 180ms ease-out,
                visibility 0s linear 320ms;
}

.support-panel.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1),
                opacity 180ms ease-out,
                visibility 0s;
}

/* The panel takes focus on open so Escape has somewhere to land, but it is a
   container, not a control — a ring around the whole card would be the loudest
   thing on screen. The X and everything inside keep their own. */
.support-panel:focus {
    outline: none;
}

/* ── The handle ── the title bar doubles as the grab. The grip is a
   pseudo-element so the shared head partial stays exactly as every other panel
   in the app writes it, and touch-action: none so a drag drags instead of
   scrolling the page underneath. */
.support-panel__grab {
    position: relative;
    flex-shrink: 0;
    cursor: grab;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.support-panel__grab:active {
    cursor: grabbing;
}

/* Sits in the head's own top gutter, above the title — the one mark that says
   this bar is a handle before anyone tries it. */
.support-panel__grab::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 50%;
    width: 28px;
    height: 3px;
    transform: translateX(-50%);
    background: var(--color-border);
    border-radius: var(--radius-pill);
}

/* Fills the rest of the panel and scrolls on its own, so the head stays put at
   the top and the send shelf at the bottom while a long report scrolls between
   them. min-height: 0 because a flex child's default floor is its content —
   without it the body refuses to shrink and the shelf is pushed off the box. */
.support-panel__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--spacing-md);
}

/* ── Docked ── below this width the panel stops floating. A thumb drag fights
   the page scroll, and a window you have to shove is worse than one that
   already knows where it goes: the drop out of the bar stays, the drag goes,
   and the panel spans the width inside an 8px gutter. SUPPORT_DOCK_QUERY in
   support_button.html mirrors this breakpoint — keep the two in step.

   !important because the drag writes left/top as inline styles. A window
   narrowed after a drag would otherwise leave the panel parked wherever the
   pointer last put it, at a width the screen no longer has. */
@media (max-width: 767.98px) {
    /* The clip stops at the bottom bar, and the panel becomes a sheet that
       rises out of the clip's FLOOR instead of dropping from its ceiling:
       the bar it belongs to is at the bottom now. .is-open's translateY(0)
       already outranks this closed transform. */
    .support-float {
        top: max(var(--drawer-top), var(--phone-covered-top, 0px));
        bottom: max(var(--sheet-bottom), var(--phone-covered-bottom, 0px));
    }

    .support-panel {
        top: auto !important;
        right: 0 !important;
        bottom: 0;
        left: 0 !important;
        width: auto;
        max-width: none;
        max-height: calc(100% - var(--spacing-md));
        padding-bottom: var(--sheet-pad-bottom);
        border-radius: var(--radius-lg) var(--radius-lg) var(--radius-none) var(--radius-none);
        transform: translateY(100%);
    }

    .support-panel__grab {
        cursor: default;
        touch-action: auto;
    }

    /* Nothing to grab, so nothing that says grab me. */
    .support-panel__grab::before {
        display: none;
    }
}

/* The panel still goes away, it just stops travelling to get there. Both
   selectors, because .is-open outranks the base rule. */
@media (prefers-reduced-motion: reduce) {
    .support-panel,
    .support-panel.is-open {
        transition: none;
    }
}

/* ============================= The form ============================= */

/* ── The quick pick ── the platform segmented control, bare. The label that
   used to stand over it is gone: three buttons that each name a kind of
   report say it themselves, and the group keeps its accessible name on
   aria-label instead (support_button.html). */

.support-quick {
    margin-bottom: var(--spacing-xs);
}

/* The shared control sizes to its content; the drawer wants the whole row,
   split evenly (--equal does the splitting once there is width to split). */
.support-quick__seg {
    width: 100%;
}

/* ── The add tiles ── the shared list-growing tile (components/add-tile.css),
   layout only: collapsed tiles stack with air between, and the bands they
   open into carry the same top margin so the rhythm holds either way. */
.support-panel .global-add-tile {
    margin-top: var(--spacing-smd);
}

/* ── The bands ── the bordered slot a tile opens into, the opp form's
   Event/Location reveal drawn in the drawer's own vocabulary. */
.support-band {
    margin-top: var(--spacing-smd);
    padding: var(--spacing-smd);
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.support-band__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
}

.support-band__label {
    margin: 0;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

/* Inside a band the head row already spaces the slot. */
.support-band .support-shot {
    margin-top: 0;
}

.support-field__input {
    width: 100%;
    line-height: 1.4;
    resize: vertical;
}

.support-field__input:focus {
    outline: none;
    border-color: var(--color-neutral-ink);
    box-shadow: var(--shadow-focus-ring);
}

/* ── The send shelf ── pinned under the scrolling body, so the one control
   that finishes the job never scrolls away under a long comment. The shelf
   goes whole on a sent ticket (support_button.html): with the form gone there
   is nothing left to send, and a live button under a receipt only invites a
   second copy of the same report. */
.support-panel__foot {
    flex-shrink: 0;
    padding: var(--spacing-smd) var(--spacing-md) var(--spacing-md);
    background: var(--color-card-bg);
    border-top: 1px solid var(--color-border-subtle);
}

/* The button itself is still the same slab as Add Comment and Add Screenshot,
   which is what Nick asked for and what TestSendMatchesTheTiles freezes. Every
   box metric here is .global-add-tile's (components/add-tile.css): the
   md/mdlg padding pair, --font-size-lg text, the 1.5px hairline, the large-panel
   corner.
   Bootstrap's --bs-btn-* vars carry them instead of raw padding/border
   declarations, so the .btn box stays the one thing sizing the button and
   nothing here has to out-specify it. The tiles' 0.75rem of air above is the
   shelf's own top padding now.

   Line height needs no override: .btn pins --bs-btn-line-height to 1.5 and the
   tile inherits the same 1.5 from body, so both compute 15px x 1.5 = 22.5px
   and the two boxes land on the same height. Weight is deliberately NOT
   matched — real buttons read --font-weight-button (main.css) as the one fixed
   source no tenant brand-config can pull apart, and copying the tile's 500
   here would have quietly forked it for one button.

   Flex because the content is two boxes now (headset + label) that centre as a
   pair; the .btn default would only centre the text.

   Colour is NOT restated here any more. This rule used to carry the whole
   brand palette again, because the drawer is included from the header partial
   and so lives INSIDE .global-app-header, where `.global-app-header .btn-primary` re-pointed
   every button at the header's glass palette (white on translucent white —
   right on the dark bar, invisible on a white panel). #5390 deleted that
   descendant rule, which left nine declarations restating exactly what
   main.css's own `.btn-primary` already sets, guarded against a selector that
   no longer exists. main.css loads after Bootstrap and nothing under
   .global-app-header touches .btn-primary now, so `.btn-primary` alone is the
   palette. If a header-scoped button rule ever comes back, fix it there — the
   drawer is not the only thing that would be wearing glass. */
.support-panel .support-see-all.btn,
.support-panel .support-panel__send.btn {
    --bs-btn-padding-y: var(--spacing-md);
    --bs-btn-padding-x: var(--spacing-mdlg);
    --bs-btn-font-size: var(--font-size-lg);
    --bs-btn-border-width: 1.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    width: 100%;
}

/* Matches .global-add-tile i exactly — same size, same flattened line box, so
   the three glyphs in the stack sit on one optical line. */
.support-panel .support-see-all.btn i,
.support-panel .support-panel__send.btn i {
    font-size: var(--font-size-base);
    line-height: 1;
}

/* Above the button, not under it: the shelf ends at the send, and a refusal
   printed below it would sit on the panel's bottom edge. */
.support-panel__error {
    margin: 0 0 var(--spacing-sm);
    font-size: var(--font-size-sm);
    color: var(--color-error);
}

/* =========================== Screenshot =========================== */

.support-shot {
    margin-top: var(--spacing-smd);
}

/* A dashed slot rather than a solid button: it reads as "something can go
   here", which is what an optional attachment is. */
.support-shot__take {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
    justify-content: center;
    padding: var(--spacing-sm) var(--spacing-smd);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
    background: none;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
}

.support-shot__take:hover {
    color: var(--color-neutral-ink);
    border-color: var(--color-neutral-ink);
    background: color-mix(in srgb, var(--color-neutral-ink) 6%, transparent);
}

.support-shot__preview {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
    padding: var(--spacing-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.support-shot__thumb {
    width: 72px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

.support-shot__meta {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    min-width: 0;
}

.support-shot__name {
    font-size: var(--font-size-sm);
    color: var(--color-text);
}

.support-shot__drop {
    align-self: flex-start;
    padding: 0;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
}

.support-shot__drop:hover {
    color: var(--color-text);
}

.support-shot__note {
    margin: var(--spacing-sm) 0 0;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* ============================ The receipt ============================ */

.support-done {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--spacing-xsm);
    padding: var(--spacing-2xl) var(--spacing-md);
}

.support-done__mark {
    font-size: 2rem;
    color: var(--color-success);
}

.support-done__title {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

/* ==================== Screenshot actions ==================== */

/* The thumbnail is itself a button into the markup editor. */
.support-shot__open {
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    line-height: 0;
}

.support-shot__actions {
    display: inline-flex;
    gap: var(--spacing-smd);
}

/* Same quiet link look as the Remove button beside it. */
.support-shot__edit {
    align-self: flex-start;
    padding: 0;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
}

.support-shot__edit:hover {
    color: var(--color-text);
}

/* ======================= Markup editor ======================= */

/* A full-screen room to draw in. Deliberately dark in every theme: it is a
   picture-editing scrim, and the picture supplies the light. Sits above the
   panel (--z-modal) even though the panel slides away while this is open.
   --support-ink mirrors SHOT_INK in shared/js/screenshot-taker.js — the toolbar and
   the canvas wear the same red; keep the two in step. */
.support-markup {
    --support-ink: rgba(229, 72, 77, 1);
    position: fixed;
    inset: 0;
    z-index: var(--z-overlay-top);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-smd);
    padding: var(--spacing-md) var(--spacing-mdlg) var(--spacing-smd);
    background: rgba(10, 13, 16, 0.92);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

/* The controls ride in one glass pill. */
.support-markup__bar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    max-width: 100%;
    padding: var(--spacing-xsm) var(--spacing-sm);
    background: rgba(23, 27, 32, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-modal);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.support-markup__tools,
.support-markup__fixes,
.support-markup__ends {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2xs);
}

.support-markup__ends {
    gap: var(--spacing-xsm);
}

.support-markup__split {
    width: 1px;
    height: 1.25rem;
    background: rgba(255, 255, 255, 0.16);
}

.support-markup__tool,
.support-markup__fix,
.support-markup__cancel {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xsm);
    padding: var(--spacing-sm) var(--spacing-smd);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: rgba(255, 255, 255, 0.82);
    background: none;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background-color 120ms ease, color 120ms ease;
}

.support-markup__tool:hover,
.support-markup__fix:hover,
.support-markup__cancel:hover {
    color: var(--color-neutral-ink-fg);
    background: rgba(255, 255, 255, 0.1);
}

/* The active tool wears the ink. */
.support-markup__tool--on,
.support-markup__tool--on:hover {
    color: var(--color-neutral-ink-fg);
    background: var(--support-ink);
}

.support-markup__done {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xsm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: rgba(18, 22, 26, 0.95);
    background: var(--color-neutral-ink-fg);
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: opacity 120ms ease;
}

.support-markup__done:hover {
    opacity: 0.9;
}

.support-markup__stage {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* touch-action: none — drawing with a finger must draw, not scroll. */
.support-markup__canvas {
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-modal);
    cursor: crosshair;
    touch-action: none;
}

.support-markup__hint {
    margin: 0;
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--font-size-xs);
    color: rgba(255, 255, 255, 0.7);
    background: rgba(23, 27, 32, 0.8);
    border-radius: var(--radius-pill);
    text-align: center;
    transition: opacity 400ms ease;
}

/* The first mark proves the hint landed; it bows out. */
.support-markup__hint--fade {
    opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
    .support-markup {
        animation: support-markup-in 160ms ease-out;
    }

    .support-markup__canvas {
        animation: support-canvas-in 240ms cubic-bezier(0.2, 0.9, 0.3, 1);
    }
}

@keyframes support-markup-in {
    from {
        opacity: 0;
    }
}

@keyframes support-canvas-in {
    from {
        opacity: 0;
        transform: scale(0.97);
    }
}

/* ── Suggestions (Nick's picks, 10-28) ─────────────────────────────────── */

/* Both header buttons say their word at every desk width (Nick, 10-28
   1:55 PM and 9 PM): the same global-header-btn, its label span shown and the
   circle opened into the header's text pill. A fine pointer only, so a tablet
   wearing the phone bar keeps that bar's own icon-and-word columns
   (phone-bar.css), and the phone keeps main.css's. */
@media (min-width: 768px) and (pointer: fine) {
    .global-app-header .support-desk .global-header-btn-icon {
        width: auto;
        padding-inline: var(--spacing-sm);
    }

    .support-desk .global-header-btn__label {
        display: inline;
    }
}

/* The Suggestions board, one suggestion, and the new-suggestion form.

   Built from the shared pieces: the header card, tabs, page search, the
   header pill and one menu look for Sort, global-card side cards, the one
   status pill (status_badge.html), global-chip for tags and the GitHub
   issue, global-avatar, global-status-dot, and the house buttons (the org's
   .btn-primary, .global-btn-ink, .btn-outline-secondary). This sheet only
   lays those out and draws the two things the platform has no piece for:
   the vote pill and the reaction toggles. Every value is a token; the vote
   pill is never narrower than a touch target, and the phone block grows
   every small tap (votes, reactions, tags, the back link) to the control heights,
   which are 44px on a coarse pointer (tokens.css). */

/* ── The board ──────────────────────────────────────────────────────────── */

.support-board {
    padding: 0;
}

/* The picked tag, above the cards so a phone shows it too. */
.support-board-tag {
    display: flex;
    margin-bottom: var(--spacing-smd);
}

/* The phone's tabs row: the shared strip, one line that swipes. A desk has
   them in the header card instead. */
.support-board-phone-tabs {
    display: none;
}

.support-board-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-smd);
    padding: var(--spacing-smd);
}

.support-idea-card {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-mdlg);
    border-bottom: 1px solid var(--color-border-subtle);
    transition: background var(--transition-fast);
}

.support-idea-card:hover {
    background: var(--color-surface-subtle);
}

.support-idea-card:last-of-type {
    border-bottom: 0;
}

.support-idea-card__body {
    flex: 1 1 auto;
    min-width: 0;
}

/* A quiet row (.support-idea-row, on a card and on one suggestion's head):
   the title, its reason and its first line each take the full width, then the
   meta, the tags and the reactions share one line. */
.support-idea-row .support-idea-card__body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-xs) var(--spacing-smd);
}

.support-idea-row .support-idea-card__title,
.support-idea-row .support-idea-card__text,
.support-idea-row .support-idea__title,
.support-idea-row .support-idea__body,
.support-idea-row .support-idea-reason {
    flex: 1 1 100%;
}

.support-idea-row .support-idea-meta {
    order: 1;
    margin-top: 0;
}

.support-idea-card .support-idea-meta {
    font-size: var(--font-size-xs);
}

/* On a phone the meta line wraps a whole piece, never "0" from "comments". */
.support-idea-card .support-idea-meta > * {
    white-space: nowrap;
}

.support-idea-row .support-idea-tags {
    order: 2;
    margin-top: 0;
}

.support-idea-row .support-reactions {
    order: 3;
    margin-left: auto;
}

.support-idea-card__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm);
}

.support-idea-card__link {
    color: var(--color-text);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-heading);
    text-decoration: none;
}

.support-idea-card__link:hover {
    text-decoration: underline;
}

.support-idea-card__text {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    color: var(--color-text-muted);
    font-size: var(--font-size-md);
    line-height: var(--line-height-body);
}

/* ── The vote pill ──────────────────────────────────────────────────────── */

.support-vote-form {
    flex: 0 0 auto;
    margin: 0;
}

.support-vote {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    min-width: calc(var(--control-h-touch) + var(--spacing-smd));
    padding: var(--spacing-xs) var(--spacing-smd);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-card-bg);
    color: var(--color-text);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-heading);
    line-height: 1;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.support-vote:hover {
    background: var(--color-surface-hover);
}

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

.support-vote i {
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
}

/* Voted: the platform ink, the same dark the ink buttons wear. */
.support-vote.is-on {
    border-color: var(--color-neutral-ink);
    background: var(--color-neutral-ink);
    color: var(--color-neutral-ink-fg);
}

.support-vote.is-on i {
    color: var(--color-neutral-ink-fg);
}

.support-vote--lg {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-lg);
}

.support-vote--lg i {
    font-size: var(--font-size-sm);
}

/* ── Small words on a card ──────────────────────────────────────────────── */

.support-idea-reason {
    display: block;
    margin-top: var(--spacing-xs);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.support-idea-reason i {
    margin-right: var(--spacing-xs);
}

.support-idea-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
}

.support-idea-tags .global-chip {
    text-decoration: none;
}

.support-idea-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-smd);
    margin-top: var(--spacing-sm);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.support-idea-meta b {
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
}

/* ── Reactions ──────────────────────────────────────────────────────────────
   Toggles, so not a chip (chip.css keeps chips static): a hairline pill that
   fills in the quiet tint once it is yours. The + opens all sixteen. */

.support-reactions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-xs);
    margin: 0;
}

.support-reaction {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2xs);
    padding: var(--spacing-2xs) var(--spacing-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-card-bg);
    color: var(--color-text);
    font-size: var(--font-size-sm);
    line-height: 1;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.support-reaction:hover {
    background: var(--color-surface-hover);
}

.support-reaction.is-on {
    border-color: var(--color-action);
    background: var(--color-action-tint);
}

.support-reaction--add {
    color: var(--color-text-muted);
}

.support-reactions__add {
    position: relative;
}

/* The sixteen, in the one menu look's own box values. */
.support-reactions__picker {
    position: absolute;
    top: calc(100% + var(--spacing-xs));
    left: 0;
    z-index: var(--z-dropdown);
    display: grid;
    grid-template-columns: repeat(8, auto);
    gap: var(--spacing-2xs);
    padding: var(--spacing-xsm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-card-bg);
    box-shadow: var(--shadow-lg);
}

.support-reactions__pick {
    padding: var(--spacing-xs);
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    font-size: var(--font-size-lg);
    line-height: 1;
    cursor: pointer;
}

.support-reactions__pick:hover {
    background: var(--color-surface-hover);
}

/* ── One suggestion ─────────────────────────────────────────────────────── */

.support-idea-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--suggestion-side-width);
    gap: var(--spacing-lg);
    align-items: start;
}

.support-idea-main,
.support-idea-side {
    min-width: 0;
}

.support-idea-side {
    container: suggestion-side / inline-size;
}

.support-idea-page .global-card {
    margin-bottom: var(--spacing-md);
    border-color: var(--color-border-subtle);
}

/* Each card's header is a quiet small-caps label. */
.support-idea-page .card-header {
    background: transparent;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    letter-spacing: .04em;
    text-transform: uppercase;
}

.support-idea-back {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2xs);
    margin-bottom: var(--spacing-smd);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    text-decoration: none;
}

.support-idea-head {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
}

/* The vote pill sits at the head's right. */
.support-idea-head .support-vote-form,
.support-idea-head > .support-vote {
    order: 2;
    margin-left: auto;
}

.support-idea__title {
    margin: 0 0 var(--spacing-sm);
    font-size: var(--font-size-h2);
    font-weight: var(--font-weight-heading);
    text-transform: var(--text-transform-heading);
    letter-spacing: var(--letter-spacing-heading);
    line-height: var(--line-height-heading);
}

.support-idea__body {
    margin: var(--spacing-smd) 0;
    font-size: var(--font-size-lg);
    line-height: var(--line-height-body);
    overflow-wrap: anywhere;
}

.support-idea__picture {
    display: block;
    max-width: 100%;
    margin: var(--spacing-sm) 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

/* "Completed <date>. Does it do what you asked?" for the poster. */
.support-idea-check {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-smd);
    margin-top: var(--spacing-smd);
    padding: var(--spacing-smd) var(--spacing-md);
    border: 1px solid var(--status-success-border);
    border-radius: var(--radius-md);
    background: var(--status-success-bg);
    color: var(--color-success-text);
}

.support-idea-check__answers {
    display: flex;
    gap: var(--spacing-sm);
}

.support-idea-check__answers form {
    margin: 0;
}

.support-idea-comment {
    display: flex;
    gap: var(--spacing-smd);
    padding: var(--spacing-smd) 0;
    border-bottom: 1px solid var(--color-border-subtle);
}

.support-idea-comment .support-idea-meta {
    margin-top: 0;
}

.support-idea-comment__text {
    margin: var(--spacing-2xs) 0 var(--spacing-sm);
    overflow-wrap: anywhere;
}

.support-idea-comment__text p {
    margin: 0;
}

.support-idea-comment-form {
    margin-top: var(--spacing-smd);
}

.support-idea-comment-form .form-control {
    width: 100%;
    min-height: var(--suggestion-comment-height);
    border-color: transparent;
    background: var(--color-surface-subtle);
}

.support-idea-comment-form .form-control:focus {
    border-color: var(--color-border);
    background: var(--color-card-bg);
}

/* The New suggestion shelf, drawn like the Support panel's send shelf: a
   hairline over it, Cancel, then Post filling the rest. Both buttons take the
   add-tile box (components/add-tile.css), the same pairing the panel's send
   makes, so the three tiles and the two buttons read as one stack. */
.support-idea-form__foot {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-smd);
    border-top: 1px solid var(--color-border-subtle);
}

.support-idea-form__foot .btn {
    --bs-btn-padding-y: var(--spacing-md);
    --bs-btn-padding-x: var(--spacing-mdlg);
    --bs-btn-font-size: var(--font-size-lg);
    --bs-btn-border-width: 1.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.support-idea-form__send.btn {
    flex: 1 1 auto;
    white-space: nowrap;
}

.support-idea-form__send.btn i {
    font-size: var(--font-size-base);
    line-height: 1;
}

.support-idea-info {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: baseline;
    gap: var(--spacing-2xs) var(--spacing-md);
    margin: 0;
    font-size: var(--font-size-md);
}

.support-idea-info dt {
    grid-column: 1;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-body);
}

.support-idea-info dd {
    grid-column: 2;
    margin: 0;
    font-weight: var(--font-weight-heading);
    text-align: right;
}

/* "Where it is" as a stage track: one segment per step, its top bar inked
   once the step is reached. Four to a row where the side has room; two to a
   row in the desk's narrow side column, where four would split "Completed"
   mid-word. */
.support-idea-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--spacing-md) var(--spacing-smd);
    margin: 0;
    padding: 0;
    list-style: none;
}

.support-idea-steps li {
    min-width: 0;
    padding-top: var(--spacing-sm);
    border-top: 4px solid var(--ms-pending);
}

.support-idea-steps li:has(.global-status-dot--done),
.support-idea-steps li:has(.global-status-dot--active),
.support-idea-steps li:has(.global-status-dot--current) {
    border-top-color: var(--color-neutral-ink);
}

.support-idea-steps .global-status-dot {
    display: none;
}

.support-idea-steps b,
.support-idea-steps small {
    display: block;
    overflow-wrap: break-word;
}

.support-idea-steps b {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-heading);
    line-height: 1.2;
}

.support-idea-steps small {
    color: var(--color-text-muted);
    font-size: var(--font-size-2xs);
}

/* The side column's two-across breakpoint, 360px (named beside
   --suggestion-side-width in tokens.css; a container query cannot read a var). */
@container suggestion-side (max-width: 359.98px) {
    .support-idea-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Staff's status control. */
.support-status-control .card-body {
    display: flex;
    flex-direction: column;
}

.support-status-control__moves {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.support-status-control__moves form {
    margin: 0;
}

.support-status-control__row {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-smd);
}

.support-status-control__row .form-control,
.support-status-control__row .form-select {
    flex: 1 1 auto;
    min-width: 0;
}

/* ── A new suggestion ───────────────────────────────────────────────────── */

/* One readable column. */
.support-idea-form {
    max-width: var(--suggestion-form-width);
    margin: 0 auto;
}

.support-idea-form__heading {
    margin: var(--spacing-smd) 0 var(--spacing-md);
    font-size: var(--font-size-h3);
    font-weight: var(--font-weight-heading);
    text-transform: var(--text-transform-heading);
    letter-spacing: var(--letter-spacing-heading);
}

.support-idea-form__error {
    margin: var(--spacing-xs) 0 0;
    color: var(--color-error-text);
    font-size: var(--font-size-sm);
}

/* The add tiles stack with the same air as the bands they open into. */
.support-idea-form .global-add-tile {
    margin-top: var(--spacing-smd);
}

/* ── The New suggestion panel ─────────────────────────────────────────────
   The Support panel's own frame and slide (support-desk.css); the only thing
   it adds is a form between the head and the shelf, which has to pass the
   card's flex column on so the body scrolls and the shelf stays put. */
.support-suggest-panel__form {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}

/* The panel's root holds only the fixed clip and the markup editor, so it
   takes no room of its own: the header's row of buttons would otherwise space
   an empty box beside them. */
.support-suggest-panel {
    display: contents;
}

/* ── The top suggestion and the way to the board ────────────────────────── */
.support-top {
    flex-shrink: 0;
    border-top: 1px solid var(--color-border-subtle);
}

/* The title's link covers the row; the vote sits above the cover. */
.support-top-card {
    position: relative;
}

.support-top-card .support-idea-card__link {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.support-top-card .support-idea-card__link::after {
    content: "";
    position: absolute;
    inset: 0;
}

.support-top-card .support-vote-form {
    position: relative;
    z-index: var(--z-raised);
}

/* ── Phone ──────────────────────────────────────────────────────────────── */

@media (max-width: 767.98px) {
    /* The keyboard is up: the form gets the room. */
    .support-suggest-panel__form:focus-within ~ .support-top {
        display: none;
    }

    .support-board-phone-tabs {
        display: block;
        margin-bottom: var(--spacing-smd);
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
    }

    .support-board-phone-tabs .global-tabs {
        flex-wrap: nowrap;
    }

    .support-board-phone-tabs .global-tab {
        white-space: nowrap;
    }

    .support-idea-card {
        gap: var(--spacing-smd);
        padding: var(--spacing-smd);
    }

    .support-idea-card .support-vote {
        min-height: var(--control-h-sm);
    }

    .support-idea-card__link {
        font-size: var(--font-size-md);
    }

    .support-idea-card__text {
        font-size: var(--font-size-sm);
    }

    .support-idea-page {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--spacing-md);
    }

    .support-idea-head {
        gap: var(--spacing-smd);
    }

    .support-vote--lg {
        min-height: var(--control-h-sm);
    }

    .support-idea-back {
        min-height: var(--control-h-sm);
    }

    /* Every small tap grows to a control height: the reaction pills, the
       tag chips, and the sixteen in the picker. */
    .support-reaction {
        min-height: var(--control-h-sm);
        padding: var(--spacing-xs) var(--spacing-smd);
        font-size: var(--font-size-md);
    }

    .support-idea-tags .global-chip,
    .support-idea-card a.global-chip,
    .support-idea-page a.global-chip,
    .global-phone-head__fold a.global-chip {
        min-height: var(--control-h-sm);
        padding-inline: var(--spacing-smd);
        font-size: var(--font-size-sm);
    }

    /* The picker spans the reactions row instead of hanging off the + button
       (hung off a + near the right edge it ran off the screen), four to a row
       so each of the sixteen is a thumb's width. */
    .support-reactions {
        position: relative;
    }

    .support-reactions__add {
        position: static;
    }

    .support-reactions__picker {
        right: 0;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: var(--spacing-xs);
    }

    .support-reactions__pick {
        min-height: var(--control-h-sm);
        padding: var(--spacing-xs) 0;
        font-size: var(--font-size-xl);
    }

    /* Staff's status rows stack: the box, then its button at the row's width. */
    .support-status-control__row {
        flex-direction: column;
        align-items: stretch;
    }
}

/* =========================================================================
   Booking notification overrides — the "Notifications" block inside the
   opportunity detail-page gear drawer (shared .global-drawer-panel, ~380px wide).

   Reuses the SAME settings-hub tokens as notifications.css (--color-action,
   --surface-raised, --bs-border-color, --text-muted, color-mix ink tints,
   --radius-pill) so the drawer block rhymes with the hub's own alert rows.
   Everything is namespaced under .opportunities-notif-* so nothing here can cancel — or
   be cancelled by — the app's global styles. The layout is a single column:
   the drawer is narrow, so each alert stacks its channels rather than sitting
   in a wide row that would scroll sideways.
   ========================================================================= */

/* Whole block — sits inside the drawer body, under the top-bar toggles, with a
   hairline to set it apart from them. */
.opportunities-notif {
    border-top: 1px solid var(--bs-border-color);
    margin-top: var(--spacing-mdlg);
    padding-top: var(--spacing-md);
}

.opportunities-notif-title {
    margin: 0 0 var(--spacing-xsm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-grey-600);
}

.opportunities-notif-hint {
    margin: 0 0 var(--spacing-md);
    font-size: var(--font-size-sm);
    color: var(--color-grey-600);
}

/* Sits at the top of the block: the channel column below depends on it. Soft
   ink-tinted card, in the same wash language the hub uses for a block that
   needs an integration linked before it can do anything. */
.opportunities-notif-chan {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: var(--spacing-smd) var(--spacing-md);
    margin-bottom: var(--spacing-md);
    background: color-mix(in srgb, var(--color-action) 6%, var(--color-card-bg));
    border: 1px solid color-mix(in srgb, var(--color-action) 20%, transparent);
    border-radius: var(--radius-card);
}

.opportunities-notif-chan__name {
    margin: 0;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    color: var(--bs-body-color);
    word-break: break-word;
}

.opportunities-notif-chan__note {
    margin: 0;
    font-size: var(--font-size-xs);
    color: var(--color-grey-600);
}

.opportunities-notif-chan__link,
.opportunities-notif-chan__btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xsm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-button);
    line-height: 1;
    padding: var(--spacing-xsm) var(--spacing-smd);
    border-radius: var(--radius-pill);
    cursor: pointer;
    text-decoration: none;
}

.opportunities-notif-chan__link {
    color: var(--color-action);
    border: 1px solid color-mix(in srgb, var(--color-action) 35%, transparent);
    background: var(--color-card-bg);
}

.opportunities-notif-chan__link:hover {
    background: color-mix(in srgb, var(--color-action) 8%, var(--color-card-bg));
}

.opportunities-notif-chan__btn {
    color: var(--color-neutral-ink-fg);
    background: var(--color-action);
    border: 1px solid var(--color-action);
}

.opportunities-notif-chan__btn:hover {
    background: color-mix(in srgb, var(--color-action) 88%, #000);
}

/* HTMX spinner: hidden until the request is in flight (htmx-request class). */
.opportunities-notif-chan__spin {
    display: none;
    margin-left: var(--spacing-xsm);
}

.opportunities-notif-chan__btn.htmx-request .opportunities-notif-chan__spin {
    display: inline-block;
}

.opportunities-notif-chan__btn.htmx-request {
    opacity: 0.7;
    pointer-events: none;
}

/* A category band between families — the label in ink on a faint tint, so it
   reads as a divider, the way the hub's taxonomy group headers do. */
.opportunities-notif-fam {
    margin-top: var(--spacing-sm);
}

.opportunities-notif-fam__label {
    margin: 0 0 var(--spacing-xsm);
    padding: var(--spacing-xsm) var(--spacing-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-action);
    background: color-mix(in srgb, var(--color-action) 6%, transparent);
    border-radius: var(--radius-md) var(--radius-md) var(--radius-none) var(--radius-none);
}

.opportunities-notif-alert {
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--bs-border-color);
}

.opportunities-notif-alert:last-child {
    border-bottom: none;
}

.opportunities-notif-alert__name {
    margin: 0 0 var(--spacing-xsm);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    color: var(--bs-body-color);
}

.opportunities-notif-alert__channels {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xsm);
}

/* Channel name on the left, the segmented control on the right, on one row.
   At very narrow widths (~320px) the longest label plus a reconnect chip and
   the 3-segment pill can't share one row, so the row wraps the pill under the
   label instead of crowding or clipping it. */
.opportunities-notif-cell {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-xsm) var(--spacing-sm);
}

.opportunities-notif-cell__ch {
    font-size: var(--font-size-sm);
    color: var(--color-grey-600);
    min-width: 0;
}

.opportunities-notif-need {
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-error);
    margin-left: var(--spacing-xsm);
}

/* The centerpiece: an Inherit / On / Off segmented control. Every state is
   visible at once, one click sets any state, and the active one is colour-coded
   — ink for On, red-tint for Off, neutral for Inherit. */
.opportunities-notif-seg {
    display: inline-flex;
    flex: 0 0 auto;
    padding: var(--spacing-2xs);
    background: var(--color-surface-subtle);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.opportunities-notif-seg button {
    appearance: none;
    border: none;
    background: transparent;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-button);
    line-height: 1;
    color: var(--color-grey-600);
    padding: var(--spacing-2xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.opportunities-notif-seg button.is-active--inherit {
    background: var(--color-surface-hover);
    color: var(--bs-body-color);
}

.opportunities-notif-seg button.is-active--on {
    background: var(--color-action);
    color: var(--color-neutral-ink-fg);
}

.opportunities-notif-seg button.is-active--off {
    background: color-mix(in srgb, var(--color-error) 12%, transparent);
    color: var(--color-error);
}

.opportunities-notif-seg button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--color-focus-ring-alpha);
}

.opportunities-notif-seg button:disabled,
.opportunities-notif-seg.is-disabled button {
    opacity: 0.5;
    cursor: not-allowed;
}

.opportunities-notif-seg__hint {
    font-weight: 400;
    opacity: 0.7;
    margin-left: var(--spacing-xs);
}

.integrations-ig-wrap {
    padding: 0;
    width: 100%;
    margin: 0;
    position: relative;
}

/* The gap belongs to the hero-then-feed pairing, not to the feed on its own.
   Any org without a core-home-hero logo — most of them — has the feed as the first
   thing inside .global-app-content, where a top margin stacked on that element's
   padding and made the gap above the grid twice the one beside it. Same token
   as the padding, so the two cannot drift apart again. The admin reconnect
   notice on home.html is a .integrations-ig-wrap in this same slot, so the selector reaches
   it as well; only the feed case is measured by a test. */
.core-home-hero + .integrations-ig-wrap {
    margin-top: var(--page-gutter);
}

/* The shared inline ring (components/loading.css), shown only while a page is on
   its way. It stays in the markup rather than being put in and taken out, so it
   cannot shift the grid as it comes and goes — and it is hidden here rather than
   with the `hidden` attribute, which the panel's own display would win against. */
.integrations-ig-wrap .global-loading-panel {
    display: none;
}

.integrations-ig-wrap--loading .global-loading-panel {
    display: flex;
}

/* The columns of the masonry, and the only place their number is written down —
   the script reads the tracks back rather than keeping its own copy of 5/3/2. */
.integrations-ig-grid {
    --ig-gap: 16px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--ig-gap);
    align-items: start;
}

/* One column of it. Posts keep their own heights, so the columns end ragged at
   the bottom. min-width lets a track be narrower than the photo inside it: an
   Instagram photo is about 1080px wide and would otherwise set the track's
   floor and push the row off the page. */
.integrations-ig-column {
    display: flex;
    flex-direction: column;
    gap: var(--ig-gap);
    min-width: 0;
}

@media (max-width: 991.98px) {
    .integrations-ig-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 576px) {
    .integrations-ig-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Chrome (fill, radius, elevated shadow) comes from .global-card--elevated; the
   tile only adds the corner clip that crops each photo to the rounded card. */
.integrations-ig-card {
    overflow: hidden;
}

/* No ratio of our own. Every post is shown at the shape it was posted in —
   square square, reels tall, landscape wide — so nothing is ever cut off. The
   height comes from the photo: give the image the full width of its column and
   let it set its own height, and the tile is whatever shape the post is. */
.integrations-ig-imgwrap {
    position: relative;
    overflow: hidden;
    display: block;
}

.integrations-ig-imgwrap img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.2s ease;
}

.integrations-ig-imgwrap:hover img {
    transform: scale(1.03);
}

.integrations-ig-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--color-neutral-ink-fg);
    font-size: var(--font-size-xs);
    padding: var(--spacing-xs) var(--spacing-xsm);
    border-radius: var(--radius-md);
}

.integrations-ig-status {
    margin-top: var(--spacing-md);
    text-align: center;
    font-size: var(--font-size-lg);
    color: rgba(0, 0, 0, 0.55);
}

.integrations-ig-status--error {
    color: var(--color-error);
}

.integrations-ig-sentinel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    pointer-events: none;
}

/* ============================================
   Availability Calendar + Slots (shared)
   Used by: booking page, availability modal preview tab, the reschedule
   page and a lead's dates link (scheduling/partials/_pick_calendar.html).
   ============================================ */

.calendar-avail-preview-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

/* Bucket switcher — sits above the preview split when the org has
   multiple bookable EventTypes. Lets admins inspect what each public
   booking page actually shows the customer. */
.calendar-avail-bucket-switcher {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
    padding: var(--spacing-smd) var(--spacing-xl);
    background: linear-gradient(180deg, var(--color-grey-50) 0%, var(--color-grey-100) 100%);
    border-bottom: 1px solid var(--color-border-hairline);
}

.calendar-avail-bucket-label {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xsm);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: #5b6b7d;
    margin: 0;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.calendar-avail-bucket-label i {
    font-size: var(--font-size-lg);
    color: #8a99a8;
}

.calendar-avail-bucket-select.form-select.form-select-sm {
    flex: 1;
    max-width: 360px;
    border-color: var(--color-grey-200);
    background-color: var(--color-card-bg);
    font-size: var(--font-size-md);
    color: #2a3441;
    box-shadow: var(--shadow-sm);
}

.calendar-avail-bucket-select.form-select.form-select-sm:focus {
    border-color: var(--color-focus-ring);
    box-shadow: 0 0 0 0.15rem var(--color-focus-ring-alpha);
}

.calendar-avail-panel {
    padding: var(--spacing-xl) var(--spacing-xl);
    display: flex;
    flex-direction: column;
    background: var(--color-card-bg);
}

.calendar-avail-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}
.calendar-avail-label {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    letter-spacing: -0.01em;
}
.calendar-avail-arrows {
    display: flex;
    gap: var(--spacing-xsm);
}
.calendar-avail-btn {
    width: var(--control-h-sm);
    height: var(--control-h-sm);
    border: 1px solid var(--color-grey-200);
    border-radius: var(--radius-button);
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
    color: var(--color-grey-500);
    font-size: var(--font-size-md);
    line-height: 1;
    padding: 0;
}
.calendar-avail-btn i {
    display: flex;
    line-height: 1;
}
.calendar-avail-btn:hover { background: var(--color-action); color: var(--color-neutral-ink-fg); border-color: var(--color-action); }
.calendar-avail-btn:disabled { opacity: 0.35; cursor: default; }
.calendar-avail-btn:disabled:hover { background: transparent; color: var(--color-grey-500); border-color: var(--color-grey-200); }

.calendar-avail-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--spacing-xs);
    text-align: center;
}
.calendar-avail-dow {
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-grey-400);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: var(--spacing-sm) 0 var(--spacing-smd);
    transition: color var(--transition-fast), background var(--transition-fast);
}
.calendar-avail-dow:hover {
    color: var(--color-action);
    background: color-mix(in srgb, var(--color-action) 8%, transparent);
    border-radius: var(--radius-sm);
}
.calendar-avail-dow.is-active {
    color: var(--color-action);
    font-weight: var(--font-weight-medium);
}
/* A day is a real button: the grid is walked with Tab and picked with
   Enter or Space; a day with nothing open is disabled, not just styled. */
.calendar-avail-cell {
    appearance: none;
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--color-text);
    position: relative;
    font-weight: var(--font-weight-body);
}
.calendar-avail-cell:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}
.calendar-avail-cell:disabled {
    cursor: default;
}
.calendar-avail-cell:hover:not(.is-empty):not(.is-unavailable):not(.is-selected):not(.is-past) {
    background: var(--color-page-bg);
}
.calendar-avail-cell.is-empty {
    cursor: default;
    visibility: hidden;
}
.calendar-avail-cell.is-unavailable {
    color: var(--color-text-muted);
    cursor: default;
}
.calendar-avail-cell.is-unavailable:hover { background: none; }
.calendar-avail-cell.is-past {
    color: var(--color-text-muted);
    cursor: default;
}
.calendar-avail-cell.is-past:hover { background: none; }
.calendar-avail-cell.is-today {
    font-weight: var(--font-weight-medium);
    color: var(--color-action);
}
.calendar-avail-cell.is-today::after {
    content: '';
    position: absolute;
    bottom: 3px;
    width: var(--spacing-xs);
    height: var(--spacing-xs);
    border-radius: var(--radius-pill);
    background: var(--color-action);
}
.calendar-avail-cell.is-available {
    font-weight: var(--font-weight-medium);
    color: var(--color-action);
    background: color-mix(in srgb, var(--color-action) 10%, transparent);
}
.calendar-avail-cell.is-available:hover:not(.is-selected) {
    background: color-mix(in srgb, var(--color-action) 18%, transparent);
}
.calendar-avail-cell.is-selected {
    background: var(--color-action);
    color: var(--color-neutral-ink-fg);
    font-weight: var(--font-weight-medium);
}
.calendar-avail-cell.is-today.is-selected::after {
    background: var(--color-neutral-ink-fg);
}
.calendar-avail-cell.is-selected:hover {
    background: var(--color-action);
}

/* Slots panel — height:0 prevents it from growing the grid row;
   min-height:100% stretches it to match the calendar column */
.calendar-avail-slots-panel {
    border-left: 1px solid var(--color-border-hairline);
    padding: var(--spacing-xl) var(--spacing-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 0;
    min-height: 100%;
    background: var(--color-card-bg);
}

.calendar-avail-slots-scroll-container {
    position: relative;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.calendar-avail-slots-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    overflow-y: auto;
    overscroll-behavior: contain;
    flex: 1;
    padding: var(--spacing-xs) 0 var(--spacing-md);
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color var(--transition-normal);
}
.calendar-avail-slots-list:hover,
.calendar-avail-slots-list:focus-within {
    scrollbar-color: var(--ink-alpha-20) transparent;
}
.calendar-avail-slots-list::-webkit-scrollbar { width: 6px; }
.calendar-avail-slots-list::-webkit-scrollbar-track { background: transparent; }
.calendar-avail-slots-list::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: var(--radius-sm);
    transition: background var(--transition-normal);
}
.calendar-avail-slots-list:hover::-webkit-scrollbar-thumb,
.calendar-avail-slots-list:focus-within::-webkit-scrollbar-thumb {
    background: var(--ink-alpha-20);
}

.calendar-avail-slots-arrow {
    position: absolute;
    left: 0;
    right: 0;
    height: var(--spacing-mdlg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-raised);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
    color: #999;
    font-size: var(--font-size-base);
    user-select: none;
}
.calendar-avail-slots-arrow:hover { opacity: 1; }
.calendar-avail-slots-arrow-up {
    top: 0;
    background: linear-gradient(to bottom, var(--color-card-bg) 60%, transparent);
}
.calendar-avail-slots-arrow-down {
    bottom: 0;
    background: linear-gradient(to top, var(--color-card-bg) 60%, transparent);
}

.calendar-avail-slot-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xsm);
    width: 80%;
    padding: var(--spacing-sm) var(--spacing-smd);
    border: 1px solid var(--color-border-hairline);
    border-radius: var(--radius-md);
    background: var(--color-card-bg);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-button);
    color: var(--color-grey-800);
    cursor: pointer;
    text-decoration: none;
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
    font-family: inherit;
}
.calendar-avail-slot-btn:hover {
    border-color: var(--color-action);
    box-shadow: 0 0 0 1px var(--color-action);
    color: var(--color-grey-800);
}
.calendar-avail-slot-btn.is-selected-slot {
    border-color: var(--color-action);
    background: var(--color-action);
    color: var(--color-neutral-ink-fg);
    box-shadow: 0 0 0 2px var(--color-action);
}
.calendar-avail-slot-btn.is-selected-slot .calendar-avail-slot-dot {
    background: var(--color-card-bg);
}
.calendar-avail-slot-dot {
    width: 7px;
    height: 7px;
    border-radius: var(--radius-pill);
    background: var(--color-success);
    flex-shrink: 0;
}
.calendar-avail-slot-label {
    font-variant-numeric: tabular-nums;
}

.calendar-avail-time {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xsm);
    white-space: nowrap;
}

.calendar-avail-weather-day {
    margin-bottom: var(--spacing-xsm);
    color: var(--color-grey-700);
    font-size: var(--font-size-xs);
    line-height: var(--line-height);
    font-variant-numeric: tabular-nums;
}

.calendar-avail-weather-day p {
    margin: 0;
}

.calendar-avail-weather-date {
    color: var(--color-grey-800);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-heading);
}

.calendar-avail-slots-panel[data-booking-weather] {
    height: auto;
    min-height: 0;
    max-height: calc(10 * var(--control-h-touch));
}

[data-slot-weather] .calendar-avail-slot-btn {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    flex: none;
    width: 100%;
    min-height: var(--control-h-touch);
    gap: var(--spacing-sm);
    padding: var(--spacing-xsm) var(--spacing-smd);
    text-align: left;
}

.calendar-avail-weather,
.calendar-avail-weather-main {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: var(--spacing-xs);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-subheading);
}

.calendar-avail-weather {
    flex-direction: column;
    align-items: flex-end;
    gap: var(--spacing-2xs);
    text-align: right;
}

.calendar-avail-weather-sky { font-weight: var(--font-weight-medium); }
.calendar-avail-weather-main i { flex: none; }
.calendar-avail-weather-main [data-tone="sun"] { color: var(--color-warning-text); }
.calendar-avail-weather-main [data-tone="rain"],
.calendar-avail-weather-main [data-tone="storm"] { color: var(--color-text-secondary); }
.is-selected-slot .calendar-avail-weather-main i { color: inherit; }

.calendar-avail-weather-temperature {
    flex: none;
    font-size: var(--font-size-xs);
    font-variant-numeric: tabular-nums;
}

.calendar-avail-weather-note { font-size: var(--font-size-xs); }

.calendar-avail-empty {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-md);
    color: #999;
    font-size: var(--font-size-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}
.calendar-avail-empty i {
    font-size: var(--font-size-h2);
    color: var(--color-grey-200);
    margin-bottom: var(--spacing-sm);
    display: block;
}
/* Not a spinner fork — it already wraps the same .global-spinner. It keeps its
   own box for `flex: 1`: the slots column is a flex column and the wait has to
   take the leftover height so the ring lands mid-panel, not pinned to the top.
   It also lives on public booking pages, which hand-link their CSS and do not
   pull components/loading.css. */
.calendar-avail-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    flex: 1;
}
.calendar-avail-error {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-md);
    color: var(--color-error);
    font-size: var(--font-size-sm);
}
/* Not an error fork — the calendar below it works, it just belongs to the whole
   team instead of the named lead. Quiet on purpose. */
.calendar-avail-note {
    text-align: center;
    padding: var(--spacing-smd) var(--spacing-md) 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

/* ── Troubleshooter mode ──────────────────────────────────────────────
   The switch above the split, the closed stretches mixed into the slot
   list, and the card one of them opens. The mode is off until someone
   turns it on, so none of this is on screen by default. Nothing here
   changes the slots panel's height, so its inner scroll still works. */

.calendar-avail-ts-head {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
    padding: var(--spacing-smd) var(--spacing-xl);
    border-bottom: 1px solid var(--color-border-hairline);
}
.calendar-avail-ts-switch {
    gap: var(--spacing-xsm);
    margin: 0;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-cool);
    cursor: pointer;
}
.calendar-avail-ts-private {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

/* A closed stretch is a plain grey row, never a red one, and it never
   looks like a time you could pick. */
.calendar-avail-slot-btn--closed {
    background: var(--color-surface-subtle);
    border-style: dashed;
    color: var(--color-text-secondary);
}
.calendar-avail-slot-btn--closed:hover {
    border-color: var(--color-border);
    box-shadow: none;
    color: var(--color-text-secondary);
}
.calendar-avail-slot-btn--closed .calendar-avail-slot-dot {
    background: var(--color-text-muted);
}
.calendar-avail-ts-chip {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.calendar-avail-ts-card {
    margin: var(--spacing-smd) var(--spacing-xl);
    padding: var(--spacing-smd) var(--spacing-md);
    border: 1px solid var(--color-border-hairline);
    border-radius: var(--radius-card);
    background: var(--color-card-bg);
}
.calendar-avail-ts-card-head {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}
.calendar-avail-ts-card-title {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}
.calendar-avail-ts-card-close {
    margin-left: auto;
    border: none;
    background: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: var(--spacing-2xs);
}
.calendar-avail-ts-card-cal {
    margin-top: var(--spacing-smd);
}

.calendar-avail-ts-cals {
    padding: var(--spacing-smd) var(--spacing-xl) var(--spacing-md);
    border-top: 1px solid var(--color-border-hairline);
}
.calendar-avail-ts-cal {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding-top: var(--spacing-xsm);
    font-size: var(--font-size-sm);
}
.calendar-avail-ts-cal-name {
    color: var(--color-text);
}
.calendar-avail-ts-cal-meta {
    margin-left: auto;
    color: var(--color-text-secondary);
}

@media (max-width: 575.98px) {
    [data-booking-availability] .calendar-avail-preview-split {
        grid-template-columns: minmax(0, 1fr);
    }
    [data-booking-availability] .calendar-avail-grid {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }
    [data-booking-availability] .calendar-avail-cell {
        aspect-ratio: auto;
    }
    .calendar-avail-preview-split {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    /* A phone (Nick, 10-18): every press a fingertip, a time the whole row. */
    .calendar-avail-panel { padding: var(--spacing-md) var(--spacing-sm) var(--spacing-sm); }
    .calendar-avail-btn {
        width: var(--control-h-touch);
        height: var(--control-h-touch);
    }
    .calendar-avail-cell {
        min-height: var(--control-h-touch);
    }
    .calendar-avail-slots-panel {
        border-left: none;
        border-top: 1px solid var(--color-border-hairline);
        padding: var(--spacing-md) var(--spacing-sm);
        height: auto;
        min-height: auto;
        max-height: 50vh;
    }
    .calendar-avail-slot-btn {
        width: 100%;
        min-height: var(--control-h-touch);
    }
}


.calendar-avail-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 95%;
    max-width: 1040px;
    height: min(720px, 90vh);
    background: var(--color-card-bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-modal);
    z-index: 1071;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    overflow: hidden;
}

.calendar-avail-modal.is-open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.calendar-avail-mode-select {
    padding: var(--spacing-2xs) var(--spacing-xsm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-family: var(--font-family);
    background: var(--color-card-bg);
    color: var(--color-grey-700);
}

.calendar-avail-mode-select:focus {
    outline: none;
    border-color: var(--color-focus-ring);
    box-shadow: 0 0 0 2px var(--color-focus-ring-alpha);
}

.calendar-avail-day-toggle {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 110px;
    flex-shrink: 0;
}

.calendar-avail-day-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-action);
    cursor: pointer;
}

@media (max-width: 991.98px) {
    .calendar-avail-modal {
        height: min(720px, 95vh);
    }

    .calendar-avail-preview-split {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .calendar-avail-modal {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: var(--radius-none);
        top: 0;
        left: 0;
        transform: translateY(100%);
    }

    .calendar-avail-modal.is-open {
        transform: translateY(0);
    }

    .calendar-avail-day-toggle {
        width: 90px;
    }
}

.calendar-avail-exc-radios {
    display: flex;
    gap: var(--spacing-md);
}

.calendar-avail-exc-radio {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    cursor: pointer;
    font-size: var(--font-size-md);
}

/* Working-hours day grid (.calendar-uavail__*)
   Shared between personal mode (_user_availability.html) and org-page
   settings (_availability.html). */

.calendar-uavail__columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--spacing-lg) var(--spacing-xl);
}

.calendar-uavail__column {
    min-width: 0;
    /* The row's compact treatment keys off THIS box, not the viewport. The
       grid sits in a third of the settings band (the three cards are even),
       so at a 1440px desktop it has ~424px — narrower than
       the phone case the sizing was first written for, and a viewport query
       cannot see that. Naming the container lets the query below target this
       element specifically rather than whatever nearest ancestor happens to
       be sized. */
    container: uavail-column / inline-size;
}

.calendar-uavail__row {
    display: grid;
    /* Fixed 92px label track (box + 3-letter day) so every row's time
       cell starts at the same x — horizontally aligned across all 7 rows
       and never overflows the narrow col-lg-4 panel. */
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: center;
    column-gap: var(--spacing-smd);
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--color-grey-100);
    transition: opacity 0.15s ease;
}

.calendar-uavail__row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.calendar-uavail__row--off .calendar-uavail__time-cell {
    opacity: 0.35;
    pointer-events: none;
}

.calendar-uavail__label-cell {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 0;
}

/* The day box. `.global-checkbox` (components/checkbox.css) brings the whole
   recipe — ink fill, masked tick, focus ring — so all this sets is the size
   knob the component exposes: 18px, up from its 16px default, because these sit
   alone in a rail rather than in a dense table row. */
.calendar-uavail__check {
    --global-checkbox-size: 18px;
}

.calendar-uavail__day {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    margin: 0;
    cursor: pointer;
    white-space: nowrap;
}

/* The time track: fills full width so the two pickers can split it evenly. */
.calendar-uavail__time-cell {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 0;
}

/* One start or end picker: the three hour / minute / AM-PM comboboxes of
   shared/components/_time_select.html (the control the wedding-day timeline
   form already uses). `flex: 1 1 0` splits the track
   evenly between start and end so the six boxes land on the same six x
   positions in all seven rows, instead of each row sizing to its own text. */
.calendar-uavail__time-block {
    flex: 1 1 0;
    min-width: 0;
}

/* A time is ONE field, not three. Seven rows of six bordered pills put
   forty-two boxes on a card whose entire content is fourteen times: the
   border, the ground and the corner belong to the TIME, and the hour /
   minute / AM-PM comboboxes inside it are bare. Fourteen boxes instead of
   forty-two — and every border and inner padding the merge deletes goes
   back to the value, freeing up room so the numbers are no longer cut off.

   Deliberately NOT `overflow: hidden`: each part's own .global-cs-menu drops out of
   this box and would be clipped by it.

   Scoped to THIS grid rather than done in the component: _time_select.html is
   shared with the opportunity form and the segment drawer, which both want the
   three separate fields the component ships with.

   The selector is the component's own layout class, .global-time-select
   (main.css), not a Bootstrap utility: a `!important` utility like `.gap-2`
   or `.flex-fill` cannot be overridden by `gap: 0` or `flex: 1 1 0` below —
   an override needs something to override, not a utility that cannot lose. */
.calendar-uavail__time-block > .global-time-select {
    height: var(--control-h-base);
    align-items: center;
    gap: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-button);
    background: var(--color-card-bg);
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Hover and focus move up to the field for the same reason the border did: the
   three parts are one control now, and a ring around a third of it reads as a
   seam. Same two states and the same tokens as .global-form-control-modern in
   main.css, so the field answers a pointer exactly like every other input. */
.calendar-uavail__time-block > .global-time-select:hover {
    background: var(--color-grey-50);
    border-color: var(--color-text-muted);
}

.calendar-uavail__time-block > .global-time-select:focus-within {
    border-color: var(--color-focus-ring);
    box-shadow: var(--shadow-focus-ring);
    background: var(--color-card-bg);
}

/* Hairlines, not boxes. The eye still has to see where the hour ends and the
   minute begins; 1px between the parts says it without handing each one its own
   frame back. */
.calendar-uavail__time-block > .global-time-select > .global-cs + .global-cs {
    border-left: 1px solid var(--color-border-subtle);
}

/* Equal thirds, so the six values land on six fixed x positions down all seven
   rows. The component's own row ships `1 1 auto`, which sizes each part to its
   own text and staggers the column row by row. */
.calendar-uavail__time-block > .global-time-select > .global-cs {
    flex: 1 1 0;
    min-width: 0;
}

/* The parts, stripped: the field around them now carries every pixel of chrome
   they each used to carry. Centring is the .global-cs-date-row recipe from main.css
   and is why the padding has to be symmetric — centring inside the base
   control's asymmetric box (1rem/2rem, cut for a chevron that is gone here)
   drifts the value left of true centre. */
.calendar-uavail__time-block .global-cs-input {
    height: 100%;
    padding: 0 var(--spacing-xs);
    border: 0;
    background: transparent;
    text-align: center;
    font-size: var(--font-size-md);
    font-variant-numeric: tabular-nums;
}

.calendar-uavail__time-block .global-cs-input:focus {
    border: 0;
    box-shadow: none;
    background: transparent;
}

/* A disabled part paints its own grey (main.css .global-cs-input:disabled), which
   inside a shared field is a grey block over one third of a time. The row
   already says "off" — .calendar-uavail__row--off dims the whole cell — so the parts
   say nothing. */
.calendar-uavail__time-block .global-cs-input:disabled {
    background: transparent;
}

/* No chevron. Six of them across a row was the single loudest thing on the
   card, and the compact case had already dropped them for space; the field's
   own border, ground and hover are the affordance, the same one every other
   control on the page uses. */
.calendar-uavail__time-block .global-cs-control .global-cs-toggle__chev {
    display: none;
}

/* A row whose end is not after its start. Nothing was sent — the panel holds
   the autosave until it is fixed (skillbridge.invalidWorkingHourDays) — so the
   row has to show which one is wrong; the card header says it in words. The
   end picker is the one marked: its own list has already dropped every time
   that is not after the start, so the field and the list say the same thing.
   The mark is on the field, not on a part of it, for the same reason the
   border is. */
.calendar-uavail__row--invalid .calendar-uavail__time-block:last-child > .global-time-select {
    border-color: var(--color-error);
    background: var(--status-danger-bg);
}

.calendar-uavail__row--invalid .calendar-uavail__time-block:last-child > .global-time-select:focus-within {
    border-color: var(--color-error);
    box-shadow: 0 0 0 3px var(--status-danger-bg);
}

.calendar-uavail__sep {
    color: var(--color-text-muted);
    font-size: var(--font-size-md);
    line-height: 1;
    flex-shrink: 0;
}

/* Under 470px of card the six comboboxes no longer fit beside the day label,
   so everything that is not the value gives way. This is the width the trio
   column has on any desktop under ~1590px as well as every phone, so it is the
   normal case now, not the edge one. */
@container uavail-column (max-width: 470px) {
    .calendar-uavail__row {
        column-gap: var(--spacing-sm);
        grid-template-columns: 62px minmax(0, 1fr);
    }
    /* 62px holds the 18px box, its gap and a 3-letter day ("Wed") at the
       smaller step. The label track is the only width in the row that is not
       a control, so it is the one that gives. */
    .calendar-uavail__day {
        font-size: var(--font-size-sm);
    }
    /* The gap BETWEEN the two fields closes up, and the padding inside the
       parts falls to what the widest label ("AM") needs. Nothing else is left
       to give: the field merge already took the chrome that used to be the
       first thing cut here. */
    .calendar-uavail__time-cell {
        gap: var(--spacing-xs);
    }
    .calendar-uavail__time-block .global-cs-input {
        padding: 0 var(--spacing-2xs);
    }
}

/* Under 310px there is no sharing left to do: six boxes beside even a 3-letter
   day leaves each about 25px, which is less than the "AM" it has to show, and
   the values clip to nothing. The cell takes the row to itself and the day
   label sits above it. Two lines a day makes the card taller — the other two
   cards stretch to match, which is the whole point of the band being one
   height — and that is the trade for the times staying readable. This is the
   trio's third column between roughly 992px and 1180px of viewport; a phone
   never reaches it, because the band is one column by then and each card has
   the full width. */
@container uavail-column (max-width: 310px) {
    .calendar-uavail__row {
        grid-template-columns: minmax(0, 1fr);
        row-gap: var(--spacing-xsm);
    }
    .calendar-uavail__time-cell {
        padding-left: var(--spacing-xsm);
    }
}

/* ── Phone (<768px) ─────────────────────────────────────────────────────────
   A finger needs 44px each way. Six 44px parts and the dash do not fit beside
   the day on a phone, so the day sits above its times (the 310px case above),
   the time fields grow to the touch height, and the values are 16px so iOS
   does not zoom when one is tapped. The day's word covers its whole line, box
   included, so a tap anywhere on it turns the day on or off. LAST. */
@media (max-width: 767.98px) {
    .calendar-uavail__row {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 0;
        padding: var(--spacing-xs) 0;
    }
    .calendar-uavail__label-cell {
        position: relative;
        justify-self: start;
        min-height: var(--control-h-touch);
    }
    .calendar-uavail__day::after {
        content: "";
        position: absolute;
        inset: 0;
    }
    .calendar-uavail__time-cell {
        padding-left: 0;
    }
    .calendar-uavail__time-block > .global-time-select {
        height: var(--control-h-touch);
    }
    .calendar-uavail__time-block .global-cs,
    .calendar-uavail__time-block .global-cs-control {
        height: 100%;
    }
    .calendar-uavail__time-block .global-cs-input {
        font-size: var(--font-size-base);
    }
}

/* Shared .calendar-exc-list* chrome for the Exceptions card. Used by both the personal
   availability surface (Django-rendered via _exceptions_list.html) and the
   org availability surface (Alpine-rendered via _org_exceptions.html). Loaded
   from base/base.html so it's in scope for both page.html and the settings exceptions page. */

.calendar-exc-list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--color-grey-100);
}
.calendar-exc-list__item:last-child { border-bottom: 0; }

.calendar-exc-list__info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-xsm);
    min-width: 0;
}

.calendar-exc-list__date {
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-md);
    color: var(--color-text);
}

.calendar-exc-list__time {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    font-variant-numeric: tabular-nums;
}

/* The Open / Blocked / Override tags on an exception row are the shared
   .global-badge (components/badge.css) in its dense --sm size. The old local
   .exc-list__badge clone, its three hairline-bordered colour pairs, and the
   never-rendered --mode variant are all gone. */

.calendar-exc-list__note {
    font-size: var(--font-size-sm);
    color: var(--color-grey-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.calendar-exc-list__remove {
    appearance: none;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-card);
    color: var(--color-grey-500);
    font-size: var(--font-size-sm);
    width: 1.75rem;
    height: 1.75rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}
.calendar-exc-list__remove:hover {
    color: var(--color-error);
    background: var(--color-error-subtle);
    border-color: var(--color-error-subtle);
}
.calendar-exc-list__remove:focus-visible {
    outline: 2px solid var(--color-error);
    outline-offset: 2px;
}

/* The add-exception drawer chrome moved to the shared overlay-drawer primitive
   (.global-drawer-panel--overlay + .global-drawer-overlay-scrim) in components/drawer.css. */

/* Scheduling page chrome added in the Scheduling redesign (PR2): the five-step
   New meeting wizard, its result panel, the header button that opens it, and
   the Meetings tab's list of links. Loaded from base/base.html because the
   wizard mounts as a drawer on the Scheduling page and the list renders on the
   Meetings tab — two templates, one stylesheet.

   Only tokens here. The drawer shell itself (scrim, panel, body padding) comes
   from the shared drawer component; everything below styles what sits inside. */

/* This button moved onto the tab strip in the redesign, where it sits a tab's
   width away from the Availability tab's own controls — and a Bootstrap `.btn`
   is 38px against their 36. Take the same token they take rather than the same
   number: on a coarse pointer every control on this strip grows to a 44px tap
   target (tokens.css), and this one has to grow with them. Padding-sized
   buttons need the flex centering to go with a fixed height. */
.scheduling-new-meeting-btn {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    height: var(--control-h-base);
}

/* Step bar on top, the shown step in the middle, footer last — a column, so a
   short step still leaves the footer at the bottom of what's on screen. */
.scheduling-wizard {
    display: flex;
    flex-direction: column;
}

.scheduling-wizard-steps {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    list-style: none;
    margin: 0 0 var(--spacing-lg);
    padding: 0;
}

.scheduling-wizard-step {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    flex: 1 1 0;
    min-width: 0;
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
}

.scheduling-wizard-step__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-card-bg);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    line-height: 1;
}

.scheduling-wizard-step__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scheduling-wizard-step.is-here {
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
}

.scheduling-wizard-step.is-here .scheduling-wizard-step__num {
    border-color: var(--color-action);
    background: var(--color-action);
    color: var(--color-card-bg);
}

.scheduling-wizard-step.is-done .scheduling-wizard-step__num {
    border-color: var(--color-action);
    background: var(--color-action-tint-pressed);
    color: var(--color-action);
}

.scheduling-wizard-panel {
    min-height: 12rem;
}

.scheduling-wizard-hint {
    margin: 0 0 var(--spacing-md);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.scheduling-wizard-field {
    margin-top: var(--spacing-lg);
}

.scheduling-wizard-people {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    overflow: hidden;
}

.scheduling-wizard-person {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
}

.scheduling-wizard-person:last-child {
    border-bottom: 0;
}

/* A teammate with no working hours can't be picked, so the row reads as
   inactive — the plain reason next to the name says why. */
.scheduling-wizard-person.is-off {
    background: var(--color-surface-subtle);
    color: var(--color-text-muted);
}

.scheduling-wizard-person__pick {
    flex-shrink: 0;
}

.scheduling-wizard-person__note {
    margin-left: auto;
    padding-left: var(--spacing-sm);
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
    text-align: right;
}

.scheduling-wizard-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.scheduling-wizard-chip {
    position: relative;
}

.scheduling-wizard-chip input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.scheduling-wizard-chip__label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4.5rem;
    padding: var(--spacing-xs) var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-card-bg);
    font-size: var(--font-size-sm);
    cursor: pointer;
}

.scheduling-wizard-chip input:checked + .scheduling-wizard-chip__label {
    border-color: var(--color-action);
    background: var(--color-action-tint-pressed);
    color: var(--color-action);
    font-weight: var(--font-weight-medium);
}

.scheduling-wizard-chip input:focus-visible + .scheduling-wizard-chip__label {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

/* A saved meeting is a button, not a radio — picking one fills two fields
   rather than holding a value of its own. Stripped back to nothing so the
   shared __label pill inside is what shows. */
.scheduling-wizard-chip--pick {
    padding: 0;
    border: 0;
    background: none;
}

.scheduling-wizard-chip--pick.is-picked .scheduling-wizard-chip__label {
    border-color: var(--color-action);
    background: var(--color-action-tint-pressed);
    color: var(--color-action);
    font-weight: var(--font-weight-medium);
}

.scheduling-wizard-chip--pick:focus-visible .scheduling-wizard-chip__label {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

/* Sits in the chip row, so it lines up with the chips rather than the text. */
.scheduling-wizard-chip-link {
    align-self: center;
    font-size: var(--font-size-sm);
    color: var(--color-action);
}

.scheduling-wizard-picks {
    display: grid;
    gap: var(--spacing-sm);
}

.scheduling-wizard-pick {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    cursor: pointer;
}

.scheduling-wizard-pick:has(input:checked) {
    border-color: var(--color-action);
    background: var(--color-action-tint-pressed);
}

.scheduling-wizard-pick__body {
    min-width: 0;
}

.scheduling-wizard-pick__title {
    display: block;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.scheduling-wizard-pick__note {
    display: block;
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
}

.scheduling-wizard-saved {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
}

.scheduling-wizard-saved__pick {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-card-bg);
    font-size: var(--font-size-2xs);
    cursor: pointer;
}

.scheduling-wizard-when__title {
    margin: 0 0 var(--spacing-xs);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-heading);
    color: var(--color-text);
}

.scheduling-wizard-when__error {
    margin: var(--spacing-sm) 0 0;
    font-size: var(--font-size-xs);
    color: var(--color-error);
}

/* The preview inside is the shared availability picker markup — it brings its
   own rules; this wrapper only gives it room and a boundary. */
.scheduling-wizard-when__preview {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border);
}

.scheduling-wizard-review {
    padding: var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    background: var(--color-surface-subtle);
}

.scheduling-wizard-review__row {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--color-border);
}

.scheduling-wizard-review__row:last-child {
    border-bottom: 0;
}

.scheduling-wizard-review__label {
    flex: 0 0 6rem;
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
}

.scheduling-wizard-review__value {
    min-width: 0;
    font-size: var(--font-size-sm);
    color: var(--color-text);
}

.scheduling-wizard-review__people {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

/* Sticky inside .global-drawer-body (the scroll container) so Back/Next stay in reach
   on a long step. Negative side/bottom margins cancel the body's 1.25rem
   padding so the bar spans edge to edge — same recipe as .ml-drawer-footer. */
.scheduling-wizard-footer {
    position: sticky;
    bottom: -1.25rem;
    margin: var(--spacing-lg) calc(-1 * var(--spacing-mdlg)) calc(-1 * var(--spacing-mdlg));
    padding: var(--spacing-smd) var(--spacing-mdlg);
    background: var(--bs-body-bg);
    border-top: 1px solid var(--color-grey-200);
}

.scheduling-wizard-footer__row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}

/* Back is the quiet way out, so it sits apart from the primary button. */
.scheduling-wizard-back {
    margin-right: auto;
}

.scheduling-wizard-footer__note {
    margin: var(--spacing-xs) 0 0;
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
    text-align: right;
}

.scheduling-wizard-done {
    padding: var(--spacing-lg) 0;
    text-align: center;
}

.scheduling-wizard-done__mark {
    font-size: var(--font-size-xl);
    color: var(--color-success);
}

.scheduling-wizard-done__title {
    margin: var(--spacing-sm) 0 var(--spacing-md);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-heading);
    color: var(--color-text);
}

.scheduling-wizard-done__url {
    text-align: center;
}

.scheduling-wizard-done__actions {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

/* The account rows sit in .scheduling-wizard-people, the wizard's own boxed
   list, so a worker reads two pickers with one shape. Only the row and its
   label are ours — and there is no is-off state, because an account that cannot
   host is never listed rather than listed and greyed. */
.scheduling-my-link-hosts__row {
    border-bottom: 1px solid var(--color-border);
}

.scheduling-my-link-hosts__row:last-child {
    border-bottom: 0;
}

/* The label is the row: a worker aiming at a 13px address should not have to
   find the circle beside it. */
.scheduling-my-link-hosts__pick {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
}

/* An address has no spaces to wrap at, so a long one would push the card
   sideways on a phone. */
.scheduling-my-link-hosts__email {
    font-size: var(--font-size-sm);
    color: var(--color-text);
    word-break: break-all;
}

/* An empty state is prose plus one door. The paragraph gives back its own bottom
   room so the button sits with the sentence that explains it. */
.scheduling-my-link__note {
    padding-bottom: var(--spacing-sm);
}

.scheduling-my-link__actions {
    display: flex;
    justify-content: center;
    padding-bottom: var(--spacing-md);
}

.scheduling-my-link-form {
    padding-top: var(--spacing-sm);
}

/* Sits where the wizard puts its people picker, saying there is nobody to pick. */
.scheduling-my-link-form__solo {
    margin-bottom: var(--spacing-sm);
}

.scheduling-my-link-form__actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

@media (max-width: 575.98px) {
    /* On a phone the step labels don't fit next to five numbers, so the bar
       keeps the numbers and drops the words. */
    .scheduling-wizard-step__label {
        display: none;
    }

    .scheduling-wizard-step {
        flex: 0 0 auto;
    }

    .scheduling-wizard-steps {
        justify-content: space-between;
    }
}

/* Scheduling → Meetings tab.
 *
 * A sibling of meeting-wizard.css, loaded straight after it: the wizard drawer
 * is its own screen and did not want any of this, and the tab is a page shape
 * (a toolbar, a two-column body, a day-grouped list) rather than a form.
 *
 * Tokens only. The tenant's own brand paints the today marks and the count
 * chips, so a white-labeled org gets its colour here without a line changing.
 */

/* Seated in the tab strip's actions slot, the same as the Availability tab's.
   No margin of its own: the strip's card supplies the box and the gap below. */
.scheduling-meetings-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 0;
}

/* The seam between "which tab" and "whose meetings". Sized off the control
   height rather than a flat pixel count, because a coarse pointer grows every
   control on this row and a fixed rule would come out half their height. */
.scheduling-meetings-toolbar__divider {
    flex: 0 0 auto;
    width: 1px;
    height: calc(var(--control-h-base) - 14px);
    margin: 0 var(--spacing-xs) 0 0;
    background: var(--color-border);
}

.scheduling-meetings-toolbar__right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-left: auto;
    min-width: 0;
}

/* ── Contrast on the strip ──
   The segmented half of this used to live here, as a hand-copy of the
   Availability tab's block; both copies now sit in components/segmented.css
   under `.global-tab-card__actions`, the actions cluster of a tab strip, which
   is the surface the contrast argument was always about. The tab half below
   stays here: `.global-tab` mounts on strips this argument has not been made
   for, so it is scoped to this toolbar the way it always was. */
.global-tab-card--row:has(.scheduling-meetings-toolbar) .global-tab:not(.is-active) {
    color: var(--color-grey-700);
}

.global-tab-card--row:has(.scheduling-meetings-toolbar) .global-tab:not(.is-active):hover {
    color: var(--color-text);
}

/* An org with no meetings add-on draws no tabs, so this cluster is the whole
   card. The strip carries no padding of its own — a tab's own inset is what
   holds it off the edges — so borrow that inset and sit where a tab would. */
.global-tab-card--row:not(:has(.global-tabs)) .scheduling-meetings-toolbar {
    padding: var(--spacing-sm) var(--spacing-md);
}

/* Above the phone stack the cluster stops being a box: the strip centres its
   children against each other, and a wrapped cluster is a tall box that drags
   the tab labels down beside it. `display: contents` hands the divider, the
   switch and the right cluster to the strip as items of ONE line. */
@media (min-width: 576px) {
    .global-tab-card--row:has(.global-tabs) > .scheduling-meetings-toolbar {
        display: contents;
    }

    .global-tab-card--row:has(.global-tabs):has(.scheduling-meetings-toolbar) {
        flex-wrap: wrap;
        row-gap: var(--spacing-sm);
        justify-content: flex-start;
        padding-right: var(--spacing-md);
    }

    /* Both sides of the seam are the strip's own gap now, so the hairline's
       right margin would land on top of a gap that is already wide enough. */
    .global-tab-card--row:has(.global-tabs) .scheduling-meetings-toolbar__divider {
        margin-right: 0;
    }
}

@media (max-width: 575.98px) {
    .global-tab-card--row:has(.scheduling-meetings-toolbar) {
        flex-wrap: wrap;
    }

    .global-tab-card--row .scheduling-meetings-toolbar {
        flex: 1 1 100%;
        padding-left: var(--spacing-md);
        padding-bottom: var(--spacing-smd);
    }

    /* A hairline says something only while the tabs and the switch share a
       line. Down here the switch leads a row with nothing to its left. */
    .global-tab-card--row .scheduling-meetings-toolbar__divider {
        display: none;
    }

    .scheduling-meetings-toolbar__right {
        flex: 1 1 100%;
        justify-content: flex-end;
    }
}

.scheduling-meetings-card {
    padding: var(--spacing-md);
}

/* The grid's own gutter only reaches between columns; the rail stacks its own
   cards and .card carries no margin. */
.scheduling-meetings-rail > * + * {
    margin-top: var(--spacing-md);
}

/* Quiet: the tab strip above is this page's header, so a loud card title would
   be a second one. The count beside it is the shared tab chip. */
.scheduling-meetings-card__title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin: 0 0 var(--spacing-sm);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
}

.scheduling-booked {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* A day heading and the hairline that runs off the end of it. The rule is an
   ::after so it takes whatever width the words leave, at any zoom. */
.scheduling-booked-day {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin: var(--spacing-md) 0 var(--spacing-xs);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-grey-500);
}

.scheduling-booked-day::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--color-grey-200);
}

.scheduling-booked-day--today {
    color: var(--color-action);
}

.scheduling-booked-meeting {
    padding: var(--spacing-smd) var(--spacing-xs);
    border-bottom: 1px solid var(--color-border-hairline);
}

/* The row's one line. The panels are the row's other children and are plain
   blocks under it, so they never share this line and never take width off the
   meeting to do it. */
.scheduling-booked-meeting__line {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-smd);
}

.scheduling-booked-meeting:last-child {
    border-bottom: 0;
}

/* Times line up against each other, so the column is fixed-width, right-aligned
   and tabular — 9:00 and 11:30 have to share an edge or the list reads ragged. */
.scheduling-booked-meeting__time {
    flex: 0 0 74px;
    text-align: right;
}

.scheduling-booked-meeting__at {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    font-variant-numeric: tabular-nums;
    color: var(--color-text);
}

.scheduling-booked-meeting__len {
    display: block;
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
}

.scheduling-booked-meeting__bar {
    flex: 0 0 3px;
    align-self: stretch;
    margin-top: var(--spacing-2xs);
    border-radius: var(--radius-pill);
    background: var(--color-grey-200);
}

.scheduling-booked-meeting--today .scheduling-booked-meeting__bar {
    background: var(--color-action);
    opacity: 0.55;
}

.scheduling-booked-meeting__main {
    flex: 1 1 auto;
    min-width: 0;
}

.scheduling-booked-meeting__title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.scheduling-booked-meeting__sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-xs) var(--spacing-smd);
    margin-top: var(--spacing-xs);
}

.scheduling-booked-meeting__who {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    min-width: 0;
}

/* The place reads as a pill, so an unknown place shows no pill rather than an
   empty one. Rows made before the wizard stamped this have nothing to say. */
.scheduling-booked-meeting__where {
    padding: 0.05rem var(--spacing-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
}

.scheduling-booked-meeting__host {
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
}

.scheduling-booked-meeting__status {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
}

.scheduling-booked-meeting__dot {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-pill);
    background: var(--color-success);
}

.scheduling-booked-meeting__status--warn {
    color: var(--color-warning-hover);
}

.scheduling-booked-meeting__status--warn .scheduling-booked-meeting__dot {
    background: var(--color-warning);
}

/* The booker is a person on the meeting, not a member of the roster, so they
   get a line rather than a chip — a step darker than the guest line beneath,
   because this is the one name on the row the host may not already know. */
.scheduling-booked-meeting__booker {
    margin-top: var(--spacing-xs);
    font-size: var(--font-size-2xs);
    color: var(--color-text);
}

.scheduling-booked-meeting__guests {
    margin-top: var(--spacing-xs);
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
}

.scheduling-booked-meeting__actions {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: var(--spacing-xs);
    margin-left: auto;
}

/* One line each, always. A control that breaks its own words is read as two. */
.scheduling-booked-meeting__open,
.scheduling-booked-meeting__action {
    white-space: nowrap;
}

/* Quiet by default so four controls a row do not shout over the meetings they
   belong to. Only Open in Calendar keeps a box, and it keeps the platform's
   own small outline button. */
.scheduling-booked-meeting__action {
    border: 0;
    background: none;
    /* Sized off the control scale, which grows to the 44px tap floor on a
       coarse pointer (tokens.css). Padding alone left Cancel the smallest
       thing on the row, on the one pointer least able to hit it. */
    display: inline-flex;
    align-items: center;
    min-height: var(--control-h-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    color: var(--color-grey-700);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.scheduling-booked-meeting__action:hover,
.scheduling-booked-meeting__action:focus-visible {
    background: var(--color-grey-100);
    color: var(--color-text);
}

/* A control with nothing to act on reads as off rather than as one more
   button, and it does not light up under the pointer either — a hover state on
   a dead control is the whole reason the old no-calendar row felt clickable. */
.scheduling-booked-meeting__action:disabled {
    opacity: 0.45;
    cursor: default;
}

.scheduling-booked-meeting__action:disabled:hover {
    background: none;
    color: var(--color-grey-700);
}

/* Cancel is the one that cannot be undone, so it reds only under the pointer —
   a row of standing red would read as four warnings a meeting. */
.scheduling-booked-meeting__action--danger:hover,
.scheduling-booked-meeting__action--danger:focus-visible {
    background: var(--status-danger-bg);
    color: var(--color-error);
}

/* ── The actions come out on hover ──
   Not on a coarse pointer, where there is no hover to come out on: the phone
   block at the bottom hands them back. focus-within is what keeps them
   reachable from the keyboard — opacity leaves them tabbable, and without this
   they would take focus while invisible. */
@media (hover: hover) {
    .scheduling-booked-meeting__actions {
        opacity: 0;
        transition: opacity var(--transition-fast);
    }

    .scheduling-booked-meeting:hover .scheduling-booked-meeting__actions,
    .scheduling-booked-meeting:focus-within .scheduling-booked-meeting__actions {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .scheduling-booked-meeting__actions {
        transition: none;
    }
}

/* Move and Add guests open under the row they belong to, full width, so the
   picker's month grid has room and the row above it stays readable. */
.scheduling-booked-meeting__panel {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-smd);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-subtle);
}

.scheduling-booked-meeting__panel-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-smd);
}

/* The way back to this morning. Centred and quiet: it is a second thought
   about a card that answers "what's on today". */
.scheduling-booked-past {
    padding-top: var(--spacing-smd);
    text-align: center;
}

.scheduling-booked-past__btn {
    border: 0;
    background: none;
    /* Same tap floor as the row's own buttons. */
    display: inline-flex;
    align-items: center;
    min-height: var(--control-h-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    cursor: pointer;
}

.scheduling-booked-past__btn:hover,
.scheduling-booked-past__btn:focus-visible {
    color: var(--color-text);
    text-decoration: underline;
}

.scheduling-waiting {
    list-style: none;
    margin: 0;
    padding: 0;
}

.scheduling-waiting__row {
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--color-border-hairline);
}

.scheduling-waiting__row:last-child {
    border-bottom: 0;
}

.scheduling-waiting__title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.scheduling-waiting__meta {
    margin: var(--spacing-2xs) 0 var(--spacing-xs);
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
}

.scheduling-waiting__actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.scheduling-my-link__title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.scheduling-my-link__meta {
    margin-top: var(--spacing-2xs);
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
}

/* The URL is the thing a worker came to this card to copy, so it gets a box of
   its own and wraps rather than truncating — a half-shown link is a wrong one. */
.scheduling-my-link__url {
    display: block;
    margin: var(--spacing-sm) 0;
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-page-bg);
    font-size: var(--font-size-2xs);
    color: var(--color-text);
    word-break: break-all;
}

.scheduling-my-link__calendar {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-xs);
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
}

/* Sits on the calendar line above, so it has to stop being a paragraph link on a
   row of meta text: undressed it measures 14px with 4px 8px of padding and a 1px
   border inside an 11px row, and Bootstrap's .btn-link underlines it
   permanently, which at this size thickens the whole line. Hence no underline
   until hover. */
.scheduling-my-link__change-host {
    padding: 0;
    border: 0;
    font-size: var(--font-size-2xs);
    text-decoration: none;
    vertical-align: baseline;
}

.scheduling-my-link__change-host:hover {
    text-decoration: underline;
}

.scheduling-my-link__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
}

@media (max-width: 575.98px) {
    /* The one width the line is allowed to break at. */
    .scheduling-booked-meeting__line {
        flex-wrap: wrap;
    }

    /* Left-aligned down here: with the row this narrow a right-aligned column
       leaves a gutter between the time and the meeting it belongs to. */
    .scheduling-booked-meeting__time {
        flex-basis: 60px;
        text-align: left;
    }

    /* Basis 0 so the meeting stays beside its time. On its own width it does
       not fit at 390px, drops to the next line, and leaves the time standing
       alone above it next to a bar with nothing to mark. */
    .scheduling-booked-meeting__main {
        flex-basis: 0;
    }

    /* Always visible — there is no hover on a phone to bring them out with —
       and on a line of their own, because four controls do not fit beside a
       meeting's name at 390px. */
    .scheduling-booked-meeting__actions {
        flex-basis: 100%;
        flex-wrap: wrap;
        justify-content: flex-end;
        padding-top: var(--spacing-xs);
        opacity: 1;
    }
}


/* The plain list's scroll box inside the viewport-fit roster card — the list
   layout's .global-grid-wrap. The card (#list-container) is a .global-page-fill
   flex column (main.css), so this wrap takes the height flex hands it and
   scrolls the rows inside; a short roster leaves the card reaching the bottom
   of the screen with room to spare. */
.workers-list-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.workers-list-table .workers-col-name {
    white-space: nowrap;
    width: 1%;  /* Shrink to fit content */
    font-size: var(--font-size-base);
}

/* A row that opens the person's page when clicked anywhere. */
.workers-list-table .workers-row--clickable {
    cursor: pointer;
}

/* ── The person cell ── photo, name, and everything true *about* the person.
   Work status is a dot on the photo and a payout problem is a chip beside the
   name, so neither fact costs a column of its own; the same arrangement the
   bills dashboard uses, kept identical so a state means one thing everywhere. */
.workers-list-table .workers-row__person {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
}

.workers-list-table .workers-row__portrait {
    position: relative;
    flex: 0 0 auto;
    display: flex;
}

/* Tucked into the photo's lower-right, with a card-coloured collar so the dot
   reads as its own mark instead of a smudge on the edge of the picture. The
   collar is an outline, not a border: the dot component already spends its
   border on the state colour, and an outline costs the layout nothing. */
.workers-list-table .workers-row__status-dot {
    position: absolute;
    right: -1px;
    bottom: -1px;
    outline: 2px solid var(--color-card-bg);
    outline-offset: 0;
}

.workers-list-table .workers-row__ident {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    min-width: 0;
}

.workers-list-table .workers-row__name-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-xsm);
}

.workers-list-table .workers-row__email {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.workers-list-table .workers-col-skills {
}

.workers-list-table .workers-col-skills .badge {
    font-size: var(--font-size-sm);
    padding: 0.35em 0.65em;
}

.workers-list-table .workers-col-contact {
    width: 80px;
    white-space: nowrap;
}

.workers-list-table .workers-col-contact .global-btn-icon-copy,
.workers-list-table .workers-col-contact .global-btn-icon-placeholder {
    width: var(--control-h-sm);
    height: var(--control-h-sm);
    font-size: var(--font-size-base);
}

/* Placeholder icon for missing contact info */
.global-btn-icon-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--control-h-sm);
    height: var(--control-h-sm);
    color: var(--color-border);
    opacity: 0.4;
}

@media (max-width: 767.98px) {
    .workers-list-table .workers-col-name {
        width: auto;
        white-space: normal;
        min-width: 0;
    }

    /* On a phone the skills drop under the person and wrap. */
    .workers-list-table,
    .workers-list-table tbody {
        display: block;
    }

    .workers-list-table tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        align-items: center;
        border-bottom: 1px solid var(--color-border-subtle);
    }

    .workers-list-table td {
        border-bottom-width: 0;
    }

    .workers-list-table .workers-col-skills {
        grid-column: 1 / -1;
        grid-row: 2;
        padding-top: 0;
    }

    /* A grid row has one height, so a long email ends in "…" rather than
       breaking onto a line the row has no room for. */
    .workers-list-table .workers-row__email {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* A long name drops the payout chip to its own line instead of under the call button. */
    .workers-list-table .workers-row__name-row {
        flex-wrap: wrap;
    }

    /* Under the phone head a row is the person (name, chip, email) and their
       machine: the skills stay on the person's page. The cell grows to what
       the name row wraps to, instead of the grid's one fixed height clipping
       the chip. */
    .global-page-header--phonehead ~ .workers-list-card-body .workers-list-table tr {
        align-items: stretch;
    }

    .global-page-header--phonehead ~ .workers-list-card-body .workers-list-table .global-grid__cell {
        display: flex;
        align-items: center;
        height: auto;
        min-height: var(--control-h-touch);
        padding-block: var(--spacing-xs);
    }

    /* The call and the machine keep their right edge; a stretched cell carries
       the row's stripe to the row's full height. */
    .global-page-header--phonehead ~ .workers-list-card-body .workers-list-table .workers-col-contact,
    .global-page-header--phonehead ~ .workers-list-card-body .workers-list-table .workers-col-remote {
        justify-content: flex-end;
    }

    .global-page-header--phonehead ~ .workers-list-card-body .workers-list-table .global-grid__cell.workers-col-skills {
        display: none;
    }

    /* The person fills the name cell, so a long email ends in "…" at the cell's
       edge instead of running under the call button. */
    .global-page-header--phonehead ~ .workers-list-card-body .workers-row__person,
    .global-page-header--phonehead ~ .workers-list-card-body .workers-row__ident {
        flex: 1 1 auto;
        min-width: 0;
    }
}

/* Card chrome comes from the canonical .card recipe in main.css; only the
   detail page's roomier header padding and brand icon tint live here. */
.workers-detail .card-header {
    padding: var(--spacing-smd) var(--spacing-mdlg);
}

.workers-detail .card-header .bi {
    color: var(--color-action);
}

.workers-hero-body {
    display: flex;
    align-items: center;
    gap: var(--spacing-mdlg);
    padding: var(--spacing-lg) var(--spacing-lg);
}

/* Worker hero face — DELETED. The 104px circle, its img cascade, the brand
   gradient behind the initials, and the halo ring all moved to the atom:
   `.global-avatar .global-avatar--xl .global-avatar--ring` (+ `--gradient` for
   the initials case). 104px IS the platform's single --xl hero step, so the
   hero renders unchanged. Only the lightbox button reset stays — that is button
   chrome, not avatar geometry. */
.workers-hero-avatar--button {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.workers-hero-meta {
    min-width: 0;
    flex: 1;
}

.workers-hero-name-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.workers-hero-name {
    font-size: var(--font-size-h1);
    font-weight: var(--font-weight-medium);
    margin: 0;
}

.workers-hero-eyebrow {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-top: var(--spacing-xsm);
    font-size: var(--font-size-md);
    color: var(--color-text-muted);
}

.workers-bio {
    font-size: var(--font-size-md);
    color: var(--color-text-muted);
}

.workers-hero-actions {
    margin-left: auto;
    /* Sit at the top of the meta block so the buttons line up with the name
       row, not the centered bio. */
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 0 0 auto;
}

.workers-hero-actions #worker-status-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.workers-tabs {
    margin-top: var(--spacing-lg);
}

/* The name on a skill row. */
.workers-ability-name {
    font-weight: var(--font-weight-medium);
}

/* The add row sits under the rows as a quiet footer strip. */
.workers-ability-add {
    padding-top: var(--spacing-smd);
    border-top: 1px solid var(--color-border);
}

@media (max-width: 575.98px) {
    .workers-hero-body {
        flex-wrap: wrap;
    }

    .workers-hero-actions {
        margin-left: 0;
        width: 100%;
    }
}

.workers-files-help {
    padding: var(--spacing-sm) var(--spacing-md) 0;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* ===== Worker profile shell (one-scroll admin layout) ==================
   Three zones: rail (who they are) / feed (what happened) / side (what
   they can do + files). The rails stick and scroll on their own so the
   feed column owns the page's scrollbar.

   Columns follow the shell's own width, never the window's (the container
   blocks under Breakpoints): under 1200px of room the side cards stack
   under the rail; under 768px everything is one column.

   The Details toggle is a different rule and reads the window: on a phone
   (under 768px) the rail's detail cards collapse behind it. Wider screens
   hold them open whatever Alpine last set (the min-width block), so a
   one-column shell beside a drawer on a desktop still shows every card. */

.workers-profile-shell {
    display: grid;
    /* Rails grow with the screen (keeping their 264:300 proportion) so a
       wide monitor widens all three zones instead of handing every spare
       pixel to the feed column. */
    grid-template-columns: minmax(264px, 1fr) minmax(560px, 2fr) minmax(300px, 1.15fr);
    gap: var(--spacing-md);
    align-items: start;
}

.workers-profile-rail,
.workers-profile-side {
    position: sticky;
    /* Pin exactly where the column rests — the sticky header's own offset
       plus .global-app-content's top padding — so scrolling never visibly slides
       the columns before they stick. The bottom reserve must equal the
       content gutter too: a shorter reserve makes the column outrun its
       grid slack by the difference, and the page's last few scrolled
       pixels drag the rails up by exactly that much. */
    top: calc(var(--header-bottom) + var(--page-gutter));
    max-height: calc(100vh - var(--header-bottom) - var(--bottom-bar-h) - 2 * var(--page-gutter));
    max-height: calc(100dvh - var(--header-bottom) - var(--bottom-bar-h) - 2 * var(--page-gutter));
    overflow-y: auto;
}

/* One gap for the whole page (Nick, 09-03): each column stacks its cards on
   the shell's own gap, so no card carries a bottom margin. */
.workers-profile-rail,
.workers-profile-rail-details,
.workers-profile-main,
.workers-profile-side {
    display: grid;
    gap: var(--spacing-md);
    min-width: 0;
}

/* Every top bar the same height: the title line stands as tall as the small
   round button some bars carry (.global-icon-btn--sm, 28px). */
.workers-profile-shell .card-header {
    line-height: 28px;
}

/* The three-dot menu's wrapper is inline-block by default, which seats the
   button on the text baseline and adds a descender's worth of height. */
.workers-profile-shell .card-header .global-action-dropdown {
    display: flex;
}

/* --- Photo card (the record highlight) --------------------------------- */
/* Laid out like the top of a HubSpot contact record (Nick, 08-29): a
   header naming the section — Profile — with the three-dot Actions menu
   riding in it (Nick, 08-30), then the face beside the name with the
   status chip and the classification word stacked under it. */

.workers-profile-identity-actions {
    flex-shrink: 0;
}

/* The Merge row is a link among buttons: it reads as a menu row, not as a
   link, so Bootstrap's anchor underline stays off it. */
.workers-profile-identity-actions .global-action-dropdown-item {
    text-decoration: none;
}

.workers-profile-record {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
    min-width: 0;
}

/* The portrait — bigger than a list avatar, smaller than the old hero, so
   the name sits beside it. profile-photo.css's frame and its edit / add
   affordances shrink-wrap this size. */
.workers-profile-photo-face {
    width: 80px;
    height: 80px;
    font-size: var(--font-size-h1);
    flex-shrink: 0;
}

button.workers-profile-photo-face {
    padding: 0;
    border: 0;
    cursor: zoom-in;
}

/* Wraps whichever face arm renders so the status dot has a box to sit on. */
.workers-profile-photo-wrap {
    position: relative;
    flex: 0 0 auto;
    display: flex;
}

/* The roster's dot, tucked into the photo's lower-right with the same
   card-coloured collar. The include hardcodes the 10px --sm the roster
   rows want; at the 80px face that reads as a fleck, so this surface
   buys back the component's base 14px geometry. */
.workers-profile-photo-dot {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 14px;
    height: 14px;
    border-width: 2px;
    outline: 2px solid var(--color-card-bg);
    outline-offset: 0;
}

.workers-profile-identity {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    min-width: 0;
    flex: 1;
}

/* A value line: the text and, for a viewer who may edit, a pencil that
   appears on hover / focus — the HubSpot property affordance. */
.workers-profile-identity-line {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    min-width: 0;
}

.workers-profile-identity-line--editable {
    cursor: pointer;
}

.workers-profile-identity-pencil {
    opacity: 0;
    flex-shrink: 0;
}

.workers-profile-identity-line--editable:hover .workers-profile-identity-pencil,
.workers-profile-identity-line--editable:focus-within .workers-profile-identity-pencil {
    opacity: 1;
}

.workers-profile-identity-name {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    line-height: 1.3;
    margin: 0;
    color: var(--color-text);
    overflow-wrap: anywhere;
}

.workers-profile-identity-sub {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.4;
}

/* Open in Rock under the name: button-sized, not stretched by the column. */
.workers-profile-identity-door {
    align-self: flex-start;
    margin-top: var(--spacing-xsm);
}

.workers-profile-identity-classline {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    min-width: 0;
}

.workers-profile-identity-edit,
.workers-profile-identity-class {
    width: 100%;
}

/* --- Property rows (HubSpot "About this contact") ----------------------- */
/* A small label over a value. Hover a row and its tools appear at the top
   right; an editable row is a pointer and tints on hover; an open row
   holds its editor (fields + Save / Cancel) in place of the value. */
.workers-profile-props {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
}

.workers-profile-prop {
    position: relative;
    padding: var(--spacing-xs) var(--spacing-sm);
    margin: 0 calc(-1 * var(--spacing-sm));
    border-radius: var(--radius-sm);
}

.workers-profile-prop--editable {
    cursor: pointer;
}

.workers-profile-prop--editable:hover,
.workers-profile-prop--editable:focus-within {
    background: var(--color-grey-50);
}

.workers-profile-prop--open {
    cursor: default;
}

.workers-profile-prop-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    line-height: 1.4;
    padding-right: 3.5rem;
}

/* The "still owed" marker beside a required-and-blank label. */
.workers-profile-prop-required {
    margin-left: var(--spacing-xs);
    vertical-align: middle;
}

.workers-profile-prop-value {
    font-size: var(--font-size-sm);
    color: var(--color-text);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

/* A value that is a link (the email) reads as plain text, like the phone
   beside it; the underline comes on hover. */
.workers-profile-prop-value a {
    text-decoration: none;
}

.workers-profile-prop-value a:hover {
    text-decoration: underline;
}

.workers-profile-prop-value--empty {
    color: var(--color-text-muted);
}

.workers-profile-prop--nolabel {
    padding-right: var(--spacing-xl);
}

.workers-profile-prop-tools {
    position: absolute;
    top: 2px;
    right: var(--spacing-xs);
    display: inline-flex;
    gap: var(--spacing-2xs);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.workers-profile-prop:hover .workers-profile-prop-tools,
.workers-profile-prop:focus-within .workers-profile-prop-tools {
    opacity: 1;
}

/* The tools themselves are .global-icon-btn --ghost --sm (icon-button.css). */

/* No hover on a touch screen — the tools stay put. */
@media (hover: none) {
    .workers-profile-prop-tools,
    .workers-profile-identity-pencil,
    .workers-profile-email-tools {
        opacity: 1;
        pointer-events: auto;
    }
}

.workers-profile-prop-editor {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-xs);
}

.workers-profile-prop-editor__actions {
    display: flex;
    gap: var(--spacing-sm);
}

/* "+ Add email" — a text button in brand ink. */
.workers-profile-prop-add {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--color-action);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
}

.workers-profile-prop-add:hover {
    text-decoration: underline;
}

/* Locations card rows — the label line leaves room for the three hover
   tools (make primary, edit, delete: 3 × 28px + gaps ≈ 96px), spelled as
   scale steps (2.5 + 2.5 + 1 rem) so the row stays on the spacing scale. */
.workers-profile-address-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding-right: calc(var(--spacing-2xl) + var(--spacing-2xl) + var(--spacing-md));
}

/* Their own About blurb, read formatted until its pencil opens the editor.
   The paragraphs are the HTML's own (bio_html), so no pre-line. */
.workers-profile-about-text {
    margin: 0;
    font-size: var(--font-size-sm);
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.workers-profile-about-text p,
.workers-page-bio p {
    margin: 0 0 var(--spacing-xs);
}
.workers-profile-about-text p:last-child,
.workers-page-bio p:last-child {
    margin-bottom: 0;
}

/* --- Mobile details toggle --------------------------------------------- */

.workers-profile-details-toggle {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-xs);
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    padding: var(--spacing-sm) var(--spacing-smd);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    text-align: left;
}

.workers-profile-details-toggle-hint {
    color: var(--color-text-muted);
    font-weight: var(--font-weight-body);
}

@media (min-width: 768px) {
    /* Wider screens keep the rail's cards open; the toggle only exists on
       phones, so its Alpine state must not hide anything here. */
    .workers-profile-rail-details {
        display: grid !important;
    }
}

/* The rail is 264px, so the contact card's side-by-side label/value columns
   left a value ~170px wide — emails wrapped mid-word. Stack the label over
   the value at every width, and keep each value to one line: a too-long
   email ellipsizes instead of wrapping. The margin overrides beat the mt-2
   utilities that aligned the old side-by-side rows. */
.workers-profile-rail-details dt[class*="col-sm"],
.workers-profile-rail-details dd[class*="col-sm"] {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
}

.workers-profile-rail-details dt[class*="col-sm"] {
    margin-bottom: var(--spacing-2xs);
}

.workers-profile-rail-details dd[class*="col-sm"] {
    margin-top: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Address lines in the Locations card keep to one line each too. Only those:
   a muted sentence elsewhere in the rail (the add-email hint) must wrap. */
.workers-profile-rail-details .workers-profile-address-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Contact card (property rows: email, phone, locations) -------------- */

.workers-profile-contact-body {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

/* A row the worker's privacy setting hides from this viewer — the label
   stays, the value is the lock. */
.workers-profile-group-blocked {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    opacity: 0.7;
}

/* Emails: one row per address — the address (mailto), its icon flags, and
   its tools at the right: copy at rest; with the row's editor open, the
   per-address actions instead. */
.workers-profile-email-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
}

.workers-profile-email-row {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    min-width: 0;
}

/* A long address wraps, so the flags and tools hold to its first line. */
.workers-profile-email-line {
    position: relative;
    display: flex;
    align-items: first baseline;
    gap: var(--spacing-xs);
    min-width: 0;
    min-height: 1.625rem;
}

/* Icon flags beside the address — a star (Primary — mail goes here) and
   a warning triangle (Unconfirmed), each explained by its tooltip. Words
   in a row still crowded the rows (Nick, 08-28); the envelope flag left
   with the per-org mail action (round 22). */
.workers-profile-email-flags {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    flex-shrink: 0;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.workers-profile-email-flag {
    display: inline-flex;
    align-items: center;
}

/* Unconfirmed is the one flag that asks for action, so it carries the
   warning ink instead of the muted grey. */
.workers-profile-email-flag--warn {
    color: var(--color-warning-text);
}

/* The row's tools, pushed to the right; they show on hover and whenever
   the Email row's editor is open. */
.workers-profile-email-tools {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2xs);
    margin-left: auto;
    flex-shrink: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.workers-profile-email-row:hover .workers-profile-email-tools,
.workers-profile-email-row:focus-within .workers-profile-email-tools,
.workers-profile-prop--open .workers-profile-email-tools {
    opacity: 1;
    pointer-events: auto;
}

/* Where the tools hide until hover, they keep no room beside the address:
   they float over the end of its last line, where a wrapped address leaves
   space, so the address gets the whole row and the flag never moves. Open
   in the editor, or always shown on a touch screen, they keep their room. */
@media (hover: hover) {
    .workers-profile-prop:not(.workers-profile-prop--open) .workers-profile-email-tools {
        position: absolute;
        right: 0;
        bottom: 0;
    }
}

/* The armed "Remove this address?" strip, in the row's place. */
.workers-profile-email-confirm {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) 0;
}

.workers-profile-email-confirm__actions,
.workers-profile-email-form__actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

/* The add-email form, under the rows inside the editor. Add and Cancel
   move as one: beside the box when the rail is wide, under it when not. */
.workers-profile-email-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

/* The box and its refusal, so the reason sits right under the box. */
.workers-profile-email-form__field {
    display: flex;
    flex-direction: column;
    flex: 1 1 12rem;
    min-width: 0;
}

.workers-profile-email-addr {
    min-width: 0;
    overflow-wrap: anywhere;
    /* The dense secondary size — full-size addresses truncated constantly
       (Nick, 08-28: "the font on the email might just need to be smaller"). */
    font-size: var(--font-size-sm);
    color: var(--color-text);
    text-decoration: none;
}

.workers-profile-email-addr:hover {
    text-decoration: underline;
}

.workers-profile-phone-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    max-width: 100%;
}

.workers-profile-phone-row--edit .form-control {
    flex: 1 1 auto;
    min-width: 0;
}

/* The plain email editor a no-login person's address gets (Nick, 08-30). */
.workers-profile-email-plain-edit .form-control {
    flex: 1 1 auto;
    min-width: 0;
}

/* --- Activity feed ----------------------------------------------------- */

.workers-profile-activity {
    overflow: hidden;
}

/* The feed scrolls inside the card. Scrollbar hidden; the hover arrows
   below are the affordance (sidebar nav convention — sidebar.css). */
.workers-profile-activity-scroll {
    position: relative;
}

.workers-profile-activity-body {
    padding: var(--spacing-xs) 0;
    max-height: 26rem;
    overflow: hidden auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
}

.workers-profile-activity-body::-webkit-scrollbar {
    display: none;
}

/* The gradients fade into the card surface — keep them on the same token as
   .global-card's background or the fade shows a seam. --z-raised lifts the up
   arrow over the rows that follow it in the DOM. */
.workers-profile-activity-arrow {
    position: absolute;
    left: 0;
    right: 0;
    height: 28px;
    z-index: var(--z-raised);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    cursor: pointer;
    color: var(--color-text-muted);
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.workers-profile-activity-arrow:hover {
    opacity: 1;
}

.workers-profile-activity-arrow--up {
    top: 0;
    background: linear-gradient(to bottom, var(--color-card-bg) 40%, transparent);
}

.workers-profile-activity-arrow--down {
    bottom: 0;
    background: linear-gradient(to top, var(--color-card-bg) 40%, transparent);
}

.workers-profile-led-coming {
    border-bottom: 1px solid var(--color-border);
}

.workers-profile-led-list {
    display: block;
}

.workers-profile-led {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-smd);
    font-size: var(--font-size-sm);
    color: inherit;
    text-decoration: none;
}

.workers-profile-led + .workers-profile-led {
    border-top: 1px solid var(--color-border);
}

/* A day's caps label above its rows. It carries the group's top rule (the
   adjacent-row rule above can't see across it), except when it opens the
   list. Paging swaps the sentinel for more rows INSIDE .workers-profile-led-list, so a
   later page's first label is never :first-child and keeps its rule. */
.workers-profile-led-day {
    padding: var(--spacing-sm) var(--spacing-smd) 0;
    border-top: 1px solid var(--color-border);
}

.workers-profile-led-list > .workers-profile-led-day:first-child {
    border-top: 0;
}

/* The kind dot. Money = the payments card's paid tone; abilities wear the
   brand on a quiet ground; work and files stay neutral. */
.workers-profile-led-glyph {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: var(--radius-pill);
    font-size: var(--font-size-2xs);
    background: var(--color-surface-subtle);
    color: var(--color-text-secondary);
}

.workers-profile-led-glyph--money {
    background: var(--status-success-bg);
    color: var(--color-success);
}

.workers-profile-led-glyph--abilities {
    color: var(--color-action);
}

.workers-profile-led-time {
    flex-shrink: 0;
    margin-left: auto;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

/* Who did it — a micro person chip just left of the time. The chip takes
   the auto margin when present (one auto margin per row, or the free space
   would split between them). */
.workers-profile-led-actor {
    flex-shrink: 0;
    margin-left: auto;
}

.workers-profile-led-actor .global-person-chip__name {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow-wrap: normal;
}

.workers-profile-led-actor + .workers-profile-led-time {
    margin-left: 0;
}

.workers-profile-led--link:hover {
    background: var(--color-grey-50);
    color: inherit;
}

.workers-profile-led--up {
    background: var(--status-success-bg);
}

.workers-profile-led--up.workers-profile-led--link:hover {
    background: var(--status-success-bg);
    filter: brightness(0.98);
}

.workers-profile-led-date {
    flex-shrink: 0;
    width: 3.25rem;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

.workers-profile-led-text {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workers-profile-led-obj {
    color: var(--color-text-muted);
}

.workers-profile-led-amt {
    flex-shrink: 0;
    margin-left: auto;
    font-weight: var(--font-weight-medium);
    font-variant-numeric: tabular-nums;
}

.workers-profile-led-sentinel {
    padding: var(--spacing-sm) var(--spacing-smd);
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    text-align: center;
}

/* --- Blocked sections --------------------------------------------------- */

/* A section this viewer can't read (_blocked_card.html): the real card's
   header, then one quiet centered mark. The lock is the whole message —
   the words sit in its tooltip and a screen-reader line — so it stands a
   step larger. */
.workers-profile-blocked-body {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
}

.workers-profile-blocked-body .bi-lock {
    font-size: var(--font-size-md);
}

/* --- Payments (an open section, not a fold) ----------------------------- */

.workers-profile-payments {
    margin-bottom: var(--spacing-md);
}

/* --- Abilities card (one row per holding, A-Z) --------------------------- */

.workers-profile-ability-body {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-smd);
}

.workers-skill-rows {
    display: flex;
    flex-direction: column;
    /* One step back out to the card edge, spelled from the scale (0 - step)
       so the rhythm ratchet reads it as on-token. */
    margin-inline: calc(0px - var(--spacing-sm));
}

.workers-skill-row {
    padding: var(--spacing-xs) var(--spacing-sm);
}

.workers-skill-row + .workers-skill-row {
    border-top: 1px solid var(--color-border-hairline);
}

/* The row head: name, then level and standing, the chevron at the far
   right when the row is a door. The door is a real button drawn as the
   row (no button chrome), with the hover the property rows use. */
.workers-skill-row__head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-xs) var(--spacing-sm);
    width: 100%;
    min-height: 1.75rem;
    font-size: var(--font-size-sm);
    color: var(--color-text);
    text-align: left;
}

.workers-skill-row__head--door {
    padding: 0;
    margin-inline: calc(0px - var(--spacing-sm));
    width: calc(100% + 2 * var(--spacing-sm));
    padding-inline: var(--spacing-sm);
    border: 0;
    background: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.workers-skill-row__head--door:hover,
.workers-skill-row__head--door:focus-visible {
    background: var(--color-grey-50);
}

.workers-skill-row__head--door:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: -2px;
}

.workers-skill-row__level {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.workers-skill-row__go {
    margin-left: auto;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* The checklist under a row (ADR-165): one line per property that speaks
   to the holding, its mark at the left. Done in success ink, optional in
   muted ink, the two states that want a look — missing and lapsed — in
   the warning ink the standing badge uses. */
.workers-skill-checks {
    list-style: none;
    margin: var(--spacing-2xs) 0 0;
    padding: 0 0 var(--spacing-2xs) var(--spacing-2xs);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    font-size: var(--font-size-xs);
}

.workers-skill-check {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-xs);
    color: var(--color-text-secondary);
}

.workers-skill-check .bi {
    flex: 0 0 auto;
    color: var(--color-text-muted);
}

.workers-skill-check--done .bi {
    color: var(--color-success);
}

.workers-skill-check--missing,
.workers-skill-check--lapsed {
    color: var(--color-warning-text);
}

.workers-skill-check--missing .bi,
.workers-skill-check--lapsed .bi {
    color: var(--color-warning-text);
}

.workers-skill-check__label {
    flex: 0 0 auto;
}

.workers-skill-check__text {
    color: var(--color-text-muted);
    overflow-wrap: anywhere;
}

.workers-skill-check--missing .workers-skill-check__text,
.workers-skill-check--lapsed .workers-skill-check__text {
    color: inherit;
}

/* Competency ratings (a coordinator's read) under the checklist. */
.workers-skill-ratings {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    margin-top: var(--spacing-2xs);
    padding-left: var(--spacing-2xs);
    font-size: var(--font-size-xs);
}

.workers-skill-ratings .workers-ability-rating {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
}

/* --- Right rail file rows ---------------------------------------------- */

.workers-profile-file-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.workers-profile-file-main {
    min-width: 0;
    flex: 1;
}

.workers-profile-file-name {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
}

.workers-profile-file-name:hover {
    text-decoration: underline;
}

.workers-profile-file-sub {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.workers-profile-file-remove {
    flex-shrink: 0;
}

/* --- Right rail away rows (ADR-269): the dates, then the reason under them */

.workers-profile-away-row {
    display: flex;
    flex-direction: column;
}

.workers-profile-away-dates {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.workers-profile-away-reason {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    overflow-wrap: anywhere;
}

/* Empty files card: an icon-only add tile spanning the card, drawn as the
   slot a first file would land in. Full width, not a square hugging the
   left edge (Nick, 08-27). */
.workers-profile-file-drop {
    display: flex;
    width: 100%;
    height: 96px;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    font-size: var(--font-size-lg);
    cursor: pointer;
    transition: border-color var(--transition-fast), color var(--transition-fast);
}

.workers-profile-file-drop:hover,
.workers-profile-file-drop:focus-visible {
    border-color: var(--color-action);
    color: var(--color-action);
}

/* --- Breakpoints -------------------------------------------------------- */

/* The columns answer to the width the shell actually has, never the window's.
   A drawer pushes the page 500px over with the window unchanged
   (components/drawer.css), the settings hub's nav takes 240px off the self
   profile, and the sidebar comes and goes — the window misjudged all three,
   and the side column ran under an open drawer (Nick, 09-04). One container
   on the shell's wrapper answers them together, at the ladder's own 1200 and
   768 tiers (ADR-125 rule 7) read in the shell's space. The container makes
   .workers-detail the anchor for any position: fixed descendant — keep
   drawers, lightboxes and toasts outside it (they are, today). */
.workers-detail {
    container-type: inline-size;
    container-name: profile;
}

/* Two columns, a 1/3–2/3 split (Nick, 09-03): the side cards stack UNDER
   the rail on the left, and the feed takes the right on its own. Both left
   columns scroll with the page. The line sits 44px over the three columns'
   minimums, so the third never appears already squeezed. */
@container profile (max-width: 1199.98px) {
    /* The second row takes the slack of a tall right column, so the side
       cards sit right under the rail instead of drifting down the page. */
    .workers-profile-shell {
        grid-template-columns: minmax(264px, 1fr) minmax(0, 2fr);
        grid-template-rows: auto 1fr;
    }

    .workers-profile-rail,
    .workers-profile-side {
        grid-column: 1;
        position: static;
        max-height: none;
        overflow-y: visible;
    }

    .workers-profile-rail {
        grid-row: 1;
    }

    .workers-profile-side {
        grid-row: 2;
    }

    .workers-profile-main {
        grid-column: 2;
        grid-row: 1 / 3;
    }
}

/* One column: the phone's shape, the shell beside an open drawer on a 1440
   screen, and the self profile in the settings hub on a ~1024 window (a
   680px pane split 264 + 400 left the feed cramped). */
@container profile (max-width: 767.98px) {
    .workers-profile-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .workers-profile-rail,
    .workers-profile-side,
    .workers-profile-main {
        grid-column: auto;
        grid-row: auto;
    }
}

/* The Details toggle is the phone's, so it keeps reading the window: a
   one-column shell beside a drawer on a desktop still shows every card. */
@media (max-width: 767.98px) {
    .workers-profile-details-toggle {
        display: flex;
        min-height: var(--control-h-touch);
    }

    /* A file or booking row's name takes the whole row as its tap area (the
       list item is the nearest box that holds it); Remove stays on top. */
    a.workers-profile-file-name::after {
        content: "";
        position: absolute;
        inset: 0;
    }

    .workers-profile-file-remove {
        position: relative;
    }

    /* Add phone, Add email and Add to a company in the contact form take a thumb. */
    .workers-profile-prop-add--touch {
        min-height: var(--control-h-touch);
    }
}

/* --- Avatar lightbox --------------------------------------------------- */
/* Layout lives here, never inline: Alpine's x-show rewrites the element's
   inline display on every toggle, so an inline "display: flex" survived
   only until the first open and the photo rendered at the top left. The
   class keeps the flex centering through every toggle (Nick, 08-30), and
   the photo shows as the circle it is cropped to on the card. */
.workers-avatar-lightbox-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--z-overlay-top);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    background: var(--color-scrim);
    cursor: zoom-out;
}

.workers-avatar-lightbox-img {
    width: min(70vmin, 26rem);
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-modal);
    cursor: default;
}

.workers-avatar-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-neutral-ink-fg);
    font-size: var(--font-size-h2);
    line-height: 1;
    cursor: pointer;
}

/* --- Properties card --------------------------------------------------- */
/* Group labels between fields — rendered only when the org sorts its
   worker properties into more than one group, so a single-group org's
   card is not headed by a label that names nothing. */
.workers-profile-props-group {
    margin-bottom: var(--spacing-xs);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

/* Inside the tight row stack a later group's heading needs its own air —
   the rows above it sit only the stack's 2px gap away. */
.workers-profile-props > .workers-profile-props-group:not(:first-child) {
    margin-top: var(--spacing-sm);
}

/* A calculated value: shown like a saved answer, never an editor. */
.workers-profile-prop-readonly {
    color: var(--color-text);
}

/* The holding drawer (_skill_drawer.html): the standing badge and the
   level control on one line up top, then the checklist rows. The level is
   the site's segmented control; a holder who may see the level and not
   move it reads it as a word. */
.workers-skill-drawer-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.workers-skill-drawer-level {
    margin-left: auto;
}

.workers-skill-drawer-levelword {
    margin-left: auto;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

/* A drawer row leads with its checklist mark: the row keeps the property
   row's own layout and makes room at the left for the mark, which sits on
   the label's line. Same inks as the card's checklist. */
.workers-profile-prop--marked {
    padding-left: calc(var(--spacing-sm) + var(--spacing-mdlg));
}

.workers-skill-mark {
    position: absolute;
    left: var(--spacing-sm);
    top: calc(var(--spacing-xs) + 1px);
    font-size: var(--font-size-sm);
    line-height: 1;
    color: var(--color-text-muted);
}

.workers-skill-mark--done {
    color: var(--color-success);
}

.workers-skill-mark--missing,
.workers-skill-mark--lapsed {
    color: var(--color-warning-text);
}

/* Merge review — the side-by-side compare grid. Column 1 is the field
   label; columns 2 and 3 are the two accounts (Stays / Folds in). A
   pickable row renders a radio in each account cell; the note row under
   it spans the grid and says where the unpicked value goes. */
.workers-merge-compare {
    display: grid;
    grid-template-columns: minmax(5rem, 8rem) 1fr 1fr;
    column-gap: var(--spacing-md);
    row-gap: var(--spacing-xs);
    align-items: start;
}

.workers-merge-compare__head {
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--spacing-xs);
}

.workers-merge-compare__who {
    margin-top: var(--spacing-xs);
    font-weight: var(--font-weight-medium);
}

.workers-merge-compare__meta {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    overflow-wrap: anywhere;
}

.workers-merge-compare__label {
    padding-top: var(--spacing-xsm);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
}

.workers-merge-compare__choice {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-sm);
    margin: 0;
    padding: var(--spacing-xsm) var(--spacing-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
}

.workers-merge-compare__choice--on {
    border-color: var(--color-action);
    background: color-mix(in srgb, var(--color-action) 6%, transparent);
}

.workers-merge-compare__cell {
    padding: var(--spacing-xsm) var(--spacing-sm);
}

.workers-merge-compare__value {
    overflow-wrap: anywhere;
}

.workers-merge-compare__rownote {
    grid-column: 2 / -1;
    padding: 0 var(--spacing-sm) var(--spacing-xs);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

/* Quiet footer line under a card: the "same on both" note on the merge
   review, and the contact card's line naming who this profile absorbed. */
.workers-merge-compare__same,
.workers-profile-merged-from {
    margin-top: var(--spacing-smd);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--color-border);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

/* My Profile's "Your page" card (_page_card.html): the checklist of what the
   creative's public page needs, then the words it shows. */
.workers-page-card {
    margin-bottom: var(--spacing-md);
}
.workers-page-card__hidden {
    margin-bottom: var(--spacing-md);
}
.workers-page-list {
    list-style: none;
    margin: 0 0 var(--spacing-md);
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
    gap: var(--spacing-smd);
}
.workers-page-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-smd);
    padding: var(--spacing-smd);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-card-bg);
}
.workers-page-item.is-missing {
    background: var(--color-surface-subtle);
}
.workers-page-item__icon {
    font-size: var(--font-size-h4);
    line-height: 1.3rem;
    color: var(--color-grey-400);
    flex-shrink: 0;
}
.workers-page-item__icon.is-done {
    color: var(--color-success);
}
.workers-page-item--auto .workers-page-item__icon {
    color: var(--color-text-muted);
}
.workers-page-item__body {
    flex: 1 1 auto;
    min-width: 0;
}
.workers-page-item__label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    line-height: 1.3rem;
}
.workers-page-item__detail {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}
.workers-page-item__hint {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}
.workers-page-item__add {
    flex-shrink: 0;
    align-self: center;
}
.workers-page-words {
    border-top: 1px solid var(--color-border);
    padding-top: var(--spacing-sm);
}
.workers-page-bio {
    font-size: var(--font-size-sm);
    line-height: 1.5;
}
.workers-page-bio-editor {
    min-height: 9rem;
}
.workers-page-words__hint {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* Add person's answer when the person is already here, under the Add button.
   Empty, it takes no room. */
.workers-invite-result:not(:empty) {
    margin-top: var(--spacing-md);
}

/* "My rates" — the creative's own page (interface/templates/app/rates/).
 *
 * Only the parts utility classes cannot draw live here: the rate band (a dark
 * panel carrying the worker's name, their per-hour extras, and the keep-share
 * bar) and the bar itself. The rest of the page is global-card plus utility
 * classes, the way the member settings page is built.
 *
 * The bar's two halves are sized from the stored keep-share, so a 100/0 org
 * truthfully draws one full-width half and no second one.
 */

.workers-rate-band {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    border-radius: var(--radius-card);
    background: var(--color-surface-inverse);
    color: var(--color-neutral-ink-fg);
}

.workers-rate-band__name {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
}

.workers-rate-band__roles,
.workers-rate-band__note {
    font-size: var(--font-size-sm);
    color: var(--color-neutral-ink-muted-fg);
}

.workers-rate-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.workers-rate-tile {
    display: flex;
    flex-direction: column;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--color-neutral-ink-fg) 12%, transparent);
}

.workers-rate-tile__amount {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
}

.workers-rate-tile__label {
    font-size: var(--font-size-xs);
    color: var(--color-neutral-ink-muted-fg);
}

.workers-rate-split {
    display: flex;
    overflow: hidden;
    border-radius: var(--radius-pill);
}

.workers-rate-split__mine,
.workers-rate-split__theirs {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
}

.workers-rate-split__mine {
    background: var(--color-success);
    color: var(--color-neutral-ink-fg);
}

.workers-rate-split__theirs {
    background: color-mix(in srgb, var(--color-neutral-ink-fg) 25%, transparent);
    color: var(--color-neutral-ink-fg);
}

/*
 * Opportunities milestone matrix (Table view). Light weights, 1px hairlines,
 * tight radii, opt-in zebra; colour is reserved for meaning (the status hues)
 * and the selected saved-view tab stays greyscale, so the table reads as a
 * data grid, not a branded surface.
 */

/* The saved-view tab strip is the canonical .global-tabs--neutral component now,
   rendered in the page header's tabs slot (interface/templates/app/assignments/
   _view_tabs.html, mounted via shared/components/page_header.html). It carries no
   opportunities-specific CSS — the greyscale HubSpot skin lives entirely in the
   shared component (components/page-tabs.css). */

/* Page card: the house .global-card (components/card.css) — white surface,
   1px --color-border edge, --radius-card, --shadow-sm — the same container every
   other page puts its content in (Nick 2026-09-19). overflow:hidden clips the
   table's corners to the card radius.

   Viewport fit — the table scrolling inside its own box while the page never
   scrolls — is the shared .global-page-fill chain now (main.css), which this
   card also carries in _table_body.html. The card and its body are flex
   columns so that chain reaches .opportunities-milestone-table-wrap unbroken
   (.global-card is already a flex column; the body is re-asserted here). The card view keeps normal page scroll on purpose: its paginator is
   tied to the window — infinite-scroll.js builds its IntersectionObserver with
   no `root`, and its fallback listens on window 'scroll' — so it pins its
   header instead (pinned=True on the page_header include; rules in
   page-header.css). */
.opportunities-table-card {
    overflow: hidden;
}
.opportunities-table-card > .card-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
}

.opportunities-milestone-table-wrap {
    /* Both axes scroll inside the bounded wrap (HubSpot pattern), so the
       horizontal scrollbar rides the bottom of the box, not the bottom of the
       full table where it would sit below the fold. */
    overflow: auto;
    overscroll-behavior: contain;
    /* The editor popover measures from here; without it a scrolled table would
       position the popover off some other ancestor and miss the cell. */
    position: relative;
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    background: var(--color-card-bg);
    /* Persistent scrollbars. macOS "overlay" scrollbars stay hidden until the
       user is actively scrolling, so the horizontal bar on this wide grid would
       vanish. Styling the
       track + thumb forces an always-visible bar on WebKit/Blink and a thin one on
       Firefox; on platforms that already show a bar this is just a cosmetic skin. */
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}
.opportunities-milestone-table-wrap::-webkit-scrollbar { width: 12px; height: 12px; }
.opportunities-milestone-table-wrap::-webkit-scrollbar-track { background: var(--color-surface-subtle); }
.opportunities-milestone-table-wrap::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: var(--radius-md);
    border: 3px solid var(--color-surface-subtle); /* inset the thumb so it reads as a rounded pill */
}
.opportunities-milestone-table-wrap::-webkit-scrollbar-corner { background: var(--color-surface-subtle); }

/* Inside the page card the wrap is only the scroll viewport — the card is the
   visible surface, so drop the wrap's own border/radius to avoid a double edge,
   and let it flex to fill the card body. min-height:0 is what lets a flex child
   shrink below its content height so it scrolls instead of growing the page. */
.opportunities-table-card .opportunities-milestone-table-wrap {
    border: none;
    border-radius: var(--radius-none);
    flex: 1 1 auto;
    min-height: 0;
}

.opportunities-milestone-table {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content;
    min-width: 100%;
    font-size: var(--font-size-sm);
}

.opportunities-milestone-table th,
.opportunities-milestone-table td {
    border-bottom: 1px solid var(--color-border-subtle);
    border-right: 1px solid var(--color-surface-subtle);
    /* No blanket padding reset here: at (0,1,1) it outranks every per-cell
       padding class (.opportunities-milestone-td, .opportunities-milestone-propcell at (0,1,0)) and
       would clamp them to 0. Each cell class owns its own padding instead. */
}

/* Header band. position: sticky pins the header to the top of the bounded
   .opportunities-milestone-table-wrap as rows scroll under it (HubSpot pattern) AND still anchors each
   column's absolutely-positioned resize handle — sticky is a positioned value, so
   it establishes the same containing block `relative` did. z-index 3 is the band's
   own stacking context — nothing in the body scrolls above it.
   The band paints the card's own white with a --color-border hairline under it, the
   house grid header (.global-grid__head) — a grey band read as one more zebra stripe
   (Nick 2026-09-19). No per-stage colours; the table is a neutral data grid. */
.opportunities-milestone-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--color-card-bg);
    /* One head type for the whole band. It reads the same tokens as
       .global-grid__head, so every table head looks the same (Nick's
       pick 4A, 2026-11-07). Every head cell inherits it. */
    color: var(--color-text-secondary);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-body);
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid var(--color-border);
}

/* Stage context for a milestone lives in its tooltip (milestone · stage); the
   header itself carries no stage colour (the stage band row was removed for
   crowding the header, and per-org colours were dropped for a clean grid). */
.opportunities-milestone-table__milestone {
    position: relative; /* anchor for the resize handle */
    padding: var(--spacing-sm) var(--spacing-smd);
    min-width: 110px;
    max-width: 320px;
    height: 36px; /* HubSpot header band height */
}

/* HubSpot pattern: header labels WRAP (white-space: normal) instead of being
   truncated with an ellipsis, and the whole table scrolls horizontally. This is
   what stops the column headers from being cut off. The header type comes
   from .opportunities-milestone-table thead th, which owns it for the whole
   band — only layout props live here. */
.opportunities-milestone-table__milestone-label {
    display: block;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.3;
}

.opportunities-milestone-table__milestone--required .opportunities-milestone-table__milestone-label {
    font-weight: var(--font-weight-medium);
}

/* Drag-to-resize handle: a thin hit-area on the column's right edge. The visible
   1px rule only appears on hover, HubSpot-style. touch-action: none lets the
   pointer-events drag own touch input instead of fighting the wrap's scroll. */
.opportunities-milestone-resize {
    position: absolute;
    top: 0;
    right: -4px;
    width: 9px;
    height: 100%;
    cursor: col-resize;
    z-index: 4;
    user-select: none;
    touch-action: none;
}

.opportunities-milestone-resize::after {
    content: "";
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 4px;
    width: 1px;
    background: transparent;
    transition: background var(--transition-fast);
}

.opportunities-milestone-table thead th:hover .opportunities-milestone-resize::after,
.opportunities-milestone-resize:hover::after {
    background: var(--color-text-muted);
}

/* Reference's small style: font-size-sm / medium weight, no underline until
   hover. Kept regardless of which column lands first — the "row's only way in"
   link (.opportunities-milestone-row-link, below) wraps whichever cell that is,
   so Reference no longer needs to be a link itself to earn this look. */
.opportunities-milestone-ref-link {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    text-decoration: none;
    white-space: nowrap;
}

.opportunities-milestone-ref-link:hover {
    text-decoration: underline;
}

/* The record's only way into the detail page (object-grid.css: "the first cell
   is the row's only way into the record"). Whichever property column an org has
   picked first wraps its content in this link, so the anchor never depends on
   which key that turns out to be. */
.opportunities-milestone-row-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.opportunities-milestone-row-link:hover {
    text-decoration: underline;
}

/* Property columns: org-selectable facts rendered before the milestone grid —
   Booking, Reference, Stage, service date, status, location, team, etc. All
   centered alike; none is pinned or left-aligned as a fixed identity anchor. */
.opportunities-milestone-table thead th.opportunities-milestone-table__propcol {
    padding: var(--spacing-sm) var(--spacing-smd);
    min-width: 120px;
    max-width: 240px;
}

.opportunities-milestone-propcell {
    height: var(--ms-row-h, 84px);
    padding: var(--spacing-sm) var(--spacing-smd);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-body);
    color: var(--color-text);
    text-align: center;
    vertical-align: middle;
    max-width: 240px;
    /* Clip when a column is dragged narrower than its nowrap content — without
       this the widest cell floors the resize and the drag appears to "stick". */
    overflow: hidden;
}

/* Frozen first column (HubSpot pattern), ported from the old booking-only rule.
   Whichever property column renders first is the row's own link
   (opportunities-milestone-propcell--first, _milestone_rows.html) — pin it to
   the left edge on both header and body so it never scrolls out from under a
   wide grid. Selectors are written at the same specificity as the base rules
   above (and placed after them) so the override actually lands. z-index 2
   keeps the body cell above the scrolling rows beneath it; the header corner
   (below) climbs to z-index 5 to also outrank the sticky header band
   (z-index 3, above) and the resize handle (z-index 4).
   Conditional styling: a saved view's rules stamp data-tone on a property cell
   and object-grid.css paints it with the roster's tokens. This fill, the zebra
   and the hover fill below all read the tone first and keep their own colour as
   the fallback — otherwise a rule paints only the rows the pointer is not on. */
.opportunities-milestone-propcell.opportunities-milestone-propcell--first {
    position: sticky;
    left: 0;
    z-index: var(--z-raised);
    background: var(--grid-tone-bg, var(--color-card-bg));
    min-width: 180px;
    text-align: left;
    padding: var(--spacing-smd) var(--spacing-md) var(--spacing-smd) var(--spacing-mdlg);
    vertical-align: middle;
    box-shadow: 1px 0 0 var(--color-border-subtle);
}

.opportunities-milestone-table thead th.opportunities-milestone-table__propcol--first {
    position: sticky;
    left: 0;
    z-index: 5;
    background: var(--color-card-bg);
    min-width: 180px;
    text-align: left;
    padding: var(--spacing-smd) var(--spacing-md) var(--spacing-smd) var(--spacing-mdlg);
    box-shadow: 1px 0 0 var(--color-border-subtle);
}

.opportunities-milestone-propcell--editable {
    cursor: text;
}

.opportunities-milestone-propcell--editable:hover .global-grid__pencil {
    opacity: 1;
}

.opportunities-milestone-prop__main {
    display: block;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.opportunities-milestone-prop__sub {
    display: block;
    margin-top: 1px;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The Worker cost cell, when it opens that booking's bills dashboard. Reads as
   the same figure as every other money cell — the underline only shows up on
   hover, which is what marks it as a link instead of plain text. */
a.opportunities-milestone-prop__main--link {
    color: inherit;
    text-decoration: none;
}

a.opportunities-milestone-prop__main--link:hover {
    text-decoration: underline;
}

/* Team column — one compact "Role · Worker" line per role; an unfilled role reads
   as a muted "Open" so staffing gaps surface in the same glance. */
.opportunities-milestone-team {
    margin: 0;
    padding: 0;
    list-style: none;
    /* A booking with more roles than fit the row would stretch the row taller than
       its neighbours (the team list is the only body cell that grows vertically).
       Cap it to the row's inner height and let the overflow scroll INSIDE the cell
       — same hidden-scrollbar pattern as the sidebar nav and the
       calendar day containers. 18px = the 16px
       of vertical padding on .opportunities-milestone-propcell (padding: 8px 12px → 8px top + 8px
       bottom), plus 2px of headroom: a scroll container otherwise picks up a 1px
       rounding artifact that would push the capped row a pixel taller than its
       neighbours (breaking uniformity). Keep this in step with .opportunities-milestone-propcell's
       padding. */
    max-height: calc(var(--ms-row-h, 84px) - 18px);
    overflow: hidden auto;
    overscroll-behavior: contain;
    scrollbar-width: none;            /* Firefox — wheel/trackpad scrolls, no bar */
}

.opportunities-milestone-team::-webkit-scrollbar { display: none; }   /* Chrome / Safari */

.opportunities-milestone-team__member {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: var(--spacing-xsm);
    line-height: 1.35;
    white-space: nowrap;
}

.opportunities-milestone-team__role {
    font-size: var(--font-size-2xs);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--color-text-muted);
}

.opportunities-milestone-team__worker {
    font-size: var(--font-size-sm);
    overflow: hidden;
    text-overflow: ellipsis;
}

.opportunities-milestone-team__member--open .opportunities-milestone-team__worker {
    color: var(--color-warning-text);
    font-style: italic;
}

/* Status pill — tinted per OpportunityStatus, a neutral tinted grid chip. */
.opportunities-milestone-status {
    display: inline-block;
    padding: var(--spacing-2xs) var(--spacing-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-body);
    border-radius: var(--radius-sm);
    background: var(--color-surface-subtle);
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.opportunities-milestone-status--draft {
    background: var(--color-surface-subtle);
    color: var(--color-text-muted);
}

.opportunities-milestone-status--open {
    background: var(--color-grey-100);
    color: #0091ae;
}

.opportunities-milestone-status--filled {
    background: #ece9fb;
    color: #6a78d1;
}

.opportunities-milestone-status--paused {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
}

.opportunities-milestone-status--in_progress {
    background: var(--color-grey-100);
    color: #007a91;
}

.opportunities-milestone-status--completed {
    background: var(--color-availability-bg);
    color: var(--color-success);
}

.opportunities-milestone-status--cancelled {
    background: var(--color-error-subtle);
    color: var(--color-error-text);
}

/* Row-height tiers. The view picks a density in the settings drawer; the matching .ms-rh-* class on the scroll wrapper supplies --ms-row-h,
   so the choice paints server-side and Alpine never touches cell styles. Every
   tier is floored at the booking cell's ~73px three-line content so the identity
   (template / service / title) is never clipped at any density; the team list
   scrolls within the row when a booking has more roles than fit. The old 40/56/72
   values sat BELOW that floor, so the booking cell overrode them and 2-line vs
   3-line bookings rendered at different heights — the non-uniformity this guards against.
   There is deliberately no .ms-rh-standard rule: the standard tier IS the base
   value below, so the JS-added ms-rh-standard class just inherits it; compact and
   relaxed are the only overrides. */
.opportunities-milestone-table-wrap {
    --ms-row-h: 84px; /* standard tier — the default */
}

.opportunities-milestone-table-wrap.opportunities-milestone-rh-compact {
    --ms-row-h: 76px; /* a few px above the ~73px three-line booking floor */
}

.opportunities-milestone-table-wrap.opportunities-milestone-rh-relaxed {
    --ms-row-h: 104px;
}

.opportunities-milestone-td {
    height: var(--ms-row-h, 84px);
    padding: var(--spacing-sm) var(--spacing-smd);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-body);
    color: var(--color-text);
    text-align: center;
    vertical-align: middle;
}

/* Zebra striping — opt-in via the drawer. The row's first
   cell is a <th>, not a <td> (see .opportunities-milestone-row-link), so it
   needs its own selector alongside td to pick up the stripe too. */
.opportunities-milestone-table-wrap.opportunities-milestone-zebra tbody tr:nth-child(even) td,
.opportunities-milestone-table-wrap.opportunities-milestone-zebra tbody tr:nth-child(even) th {
    background: var(--grid-tone-bg, var(--color-surface-subtle));
}

/* Row hover — HubSpot highlights the row under the cursor so the eye can track a
   booking straight across a wide grid. The row's <th> first cell gets the tint
   too; placed after .opportunities-milestone-zebra and matched at equal
   specificity so it wins on striped rows. */
.opportunities-milestone-table-wrap .opportunities-milestone-table tbody tr:hover > td,
.opportunities-milestone-table-wrap .opportunities-milestone-table tbody tr:hover > th {
    background: var(--grid-tone-bg, var(--color-grey-100));
}

.opportunities-milestone-blank {
    color: var(--color-border);
}

/* Conditional formatting: a cell whose milestone is past its due day and still
   not done or skipped. Nick, 2026-09-17: "use the table view in skillbridge
   along with conditional formatting to highlight things red that meet certain
   criteria like this" — so lateness is a property of the CELL, tinted in place,
   rather than a digest posted somewhere else.

   Tinted with the error token rather than a flat red so the zebra stripe and the
   row hover above still read through it; the solid left bar is what carries at a
   glance across a wide grid. The bar is the first stop of the background gradient
   rather than an inset box-shadow so the cell keeps its own shadow slot free.
   Placed after the zebra and hover rules and matched at higher specificity so a
   late cell stays red on a striped, hovered row. The fill reads the view's own
   styling tone first (object-grid.css, data-tone) and keeps the error tint as
   its fallback, so a rule on a late cell still shows; the red bar stays. */
.opportunities-milestone-table-wrap .opportunities-milestone-table tbody tr > .opportunities-milestone-td--late,
.opportunities-milestone-table-wrap .opportunities-milestone-table tbody tr:hover > .opportunities-milestone-td--late {
    background: linear-gradient(
        to right,
        var(--color-error) 0,
        var(--color-error) 3px,
        var(--grid-tone-bg, var(--color-error-subtle)) 3px
    );
}

/* The due day, under the complete/skip buttons. Only milestones that carry a
   due-date policy (or a stored per-booking date) render one at all, so this is a
   quiet line in two columns rather than noise in every one. */
.opportunities-milestone-due {
    display: block;
    margin-top: var(--spacing-2xs);
    color: var(--color-text-muted);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
}

.opportunities-milestone-due--late,
.opportunities-milestone-td--late .opportunities-milestone-pending {
    color: var(--color-error-text);
}

/* Read-only "pending" marker shown to non-coordinators in place of the
   complete/skip buttons (they may view the matrix but not mutate it). Reads as a
   state — the canonical pending dot plus the word — not a bare middot. */
.opportunities-milestone-pending {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
}

/* Editable cell wrapper — carries data-org/data-opp/data-instance for
   window.__sbMilestone, on both the not-yet-done buttons row and a
   done/skipped stamp that an editor can undo. */
.opportunities-milestone-cell {
    display: inline-flex;
}

/* Not-yet-done — a Done pill, and (optional milestones only) a quiet Skip
   text button beside it. */
.opportunities-milestone-act {
    align-items: center;
    gap: var(--spacing-xs);
}

.opportunities-milestone-do {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    height: 26px;
    padding: 0 var(--spacing-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-button);
    background: var(--color-card-bg);
    color: var(--color-text);
    cursor: pointer;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.opportunities-milestone-do:hover {
    background: var(--color-success-bg);
    border-color: var(--color-success-border);
    color: var(--color-success-text);
}

.opportunities-milestone-do:disabled {
    opacity: 0.5;
    cursor: default;
}

.opportunities-milestone-skip {
    height: 26px;
    padding: 0 var(--spacing-xs);
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: var(--font-size-xs);
    transition: background 0.12s ease, color 0.12s ease;
}

.opportunities-milestone-skip:hover {
    background: var(--color-action-tint);
    color: var(--color-text);
}

.opportunities-milestone-skip:disabled {
    opacity: 0.5;
    cursor: default;
}

/* The "Send Confirmation Text" cell's Open group text button, above its
   Done/Skip pair; greyed, its reason sits under it. */
.opportunities-milestone-group-text-form {
    display: block;
    margin: 0 0 var(--spacing-xs);
}

.opportunities-milestone-group-text-off {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-2xs);
    margin-bottom: var(--spacing-xs);
}

.opportunities-milestone-group-text-off .btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
}

.opportunities-milestone-group-text-why {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
}

/* Done/skipped stamp — an icon and a word, a muted when-line, and (an editor
   only, on hover or keyboard focus) an Undo pill below. The JS optimistic
   handler in my_assignments_table.html builds this same markup, so it must
   keep matching _milestone_stamp.html class-for-class. */
.opportunities-milestone-stamp {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.25;
}

.opportunities-milestone-stamp__top {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
}

/* Done reads in the success colour; skipped stays neutral grey — a skip is a
   deliberate choice, not a failure, so it never reads as an error/red state. */
.opportunities-milestone-stamp--done .opportunities-milestone-stamp__top {
    color: var(--color-success);
}

.opportunities-milestone-stamp--skip .opportunities-milestone-stamp__top {
    color: var(--color-text-muted);
}

/* A deliverable cell's two lines sit the same distance apart wherever they
   happen to live. A button and the line under it are BOTH inside the stamp,
   while the who line is outside it, so __main's gap only ever reaches one of
   the two pairs — the stamp needs the same number for the other. One token, so
   there is still only one number to change. A milestone cell keeps its own
   tight stack: its word and its time read as one stamp, not as two lines. */
.opportunities-milestone-delivcell .opportunities-milestone-stamp {
    gap: var(--spacing-xsm);
}

/* A role-deliverable cell reuses this stacked shape and NOTHING else from here:
   its state is the platform's global-badge, so its colour comes from
   STATUS_VARIANTS (apps/core/templatetags/ui_tags.py) and this file gives it
   none. There is deliberately no --handed rule any more — it painted a
   waiting deliverable in warning ink, and amber is not a colour this product
   uses (Nick, 2026-09-22). See _milestone_delivcell_content.html. */

/* The state pill is a link into the role it names, which is the only way three
   of the four states lead anywhere: handing work in is the worker's own step
   and can never be a table button, so without this those cells were somewhere
   to read and nowhere to go. The pill keeps the state's own colour and gains
   none of its own — an arrow appears beside it once the cell is hovered or the
   link takes keyboard focus, the same opacity/pointer-events reveal the Undo
   pill uses, so Tab still reaches it. */
/* A role-deliverable cell is the stacked stamp with the way into the role
   BESIDE it, not tacked onto the end of its words: the state, the button and
   the day read down the left, and the link reads as its own control on the
   right. */
.opportunities-milestone-delivcell {
    display: inline-flex;
    align-items: stretch;
    gap: var(--spacing-sm);
}

/* Everything the way in stands beside: the stack, and the line saying who is
   on the seat. One column, so the link has a single thing to match.

   🚨 CAPPED, and it has to be. .opportunities-milestone-propcell's `height` is a
   MINIMUM in table layout, so a cell taller than the tier pushes its whole row
   taller and the row-height tiers stop meaning anything — compact would render
   as tall as relaxed, and only on rows that happen to carry a deliverable. The
   team list solved this first (see .opportunities-milestone-team above) and its
   comment used to call itself "the only body cell that grows vertically"; this
   is now the second, so it takes the same treatment and the same 18px. Keep
   both in step with .opportunities-milestone-propcell's padding.

   The cell shows two lines and never three, so its tallest state is the button
   (26px) over the gap over the day (18px) — 50px against the 68px a standard
   row leaves once the cell's own padding comes off. No state drags a row
   taller, and the cap is here for the row tiers a reader can shrink to. */
.opportunities-milestone-delivcell__main {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    /* The air between the two lines. Settled by eye against the shipped cell's
       2px hairline (Nick, 2026-09-22: 24px "way too much", 8px "still a little
       too much"). */
    gap: var(--spacing-xsm);
    max-height: calc(var(--ms-row-h, 84px) - 18px);
    overflow: hidden auto;
    overscroll-behavior: contain;
    scrollbar-width: none;            /* Firefox — wheel/trackpad scrolls, no bar */
}

.opportunities-milestone-delivcell__main::-webkit-scrollbar { display: none; }

/* Who is holding the role. A column, because two people on one role read as
   two lines rather than a wrapped run.

   🚨 It must stay OUTSIDE .opportunities-milestone-stamp: every optimistic
   repaint in my_assignments_table.html overwrites that stack's innerHTML, so a
   face moved inside would vanish the moment somebody ticked the cell done.

   No margin of its own: the two lines are spaced by __main's gap, so the cell
   has ONE number deciding how far apart they sit. */
.opportunities-milestone-who {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-2xs);
    /* Dragged into the first column the cell sits inside the row's own link,
       which underlines everything under the pointer — a person's name reading
       as a link to that person, when the row goes to the booking. */
    text-decoration: none;
}

/* A cell holding a button hides this line rather than dropping it, so the
   repaint that takes the button away has a name to put back (see
   my_assignments_table.html). `display` above would otherwise beat the
   browser's own rule for the attribute, and the line would show through. */
.opportunities-milestone-who[hidden] {
    display: none;
}

/* The way into the role, as tall as everything it sits beside. `stretch` gives
   it the column's OWN height rather than a guessed one, so it runs the two lines
   it sits beside end to end (Nick, 2026-09-22: "new tab icon
   needs be the same height as the button and due date combined") and a cell
   that gains or loses a line still lines up top and bottom, with no number here
   to keep in step. It holds its space whether or not it is showing, so the
   stack beside it never shifts under the pointer. */
.opportunities-milestone-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    padding: 0 var(--spacing-xs);
    border-radius: var(--radius-button);
    color: inherit;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.12s ease, background 0.12s ease;
}

/* Full height means the whole right edge of the cell is the click, so it says
   so under the pointer — without a tint a tall target reads as empty space. */
.opportunities-milestone-open:hover {
    background: var(--color-action-tint);
}

.opportunities-milestone-open:hover .opportunities-milestone-open__go {
    color: var(--color-text);
}

.opportunities-milestone-open__go {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* Hovering ANYWHERE in the cell shows it — the propcell is the whole table
   cell, so the reader does not have to find the words first. */
.opportunities-milestone-propcell:hover .opportunities-milestone-open,
.opportunities-milestone-propcell:focus-within .opportunities-milestone-open,
.opportunities-milestone-open:focus-visible {
    opacity: 1;
}

/* A touch screen has no hover to reveal it with, so it is simply there. */
@media (hover: none) {
    .opportunities-milestone-open {
        opacity: 1;
    }
}

/* The buttons in a deliverable stamp sit UNDER the state rather than beside
   it, which is the only thing that differs from the pill's use in a
   not-yet-done milestone cell. */
.opportunities-milestone-do--stamped {
    margin-top: var(--spacing-2xs);
}

/* Anything that LEADS the stack has nothing above it to be pushed away from.
   A cell whose Mark done button stands in for its word starts with that
   button, and a cell with no button and no word starts with the day. */
.opportunities-milestone-stamp > :first-child.opportunities-milestone-do--stamped,
.opportunities-milestone-stamp > :first-child.opportunities-milestone-due {
    margin-top: 0;
}

.opportunities-milestone-stamp__when {
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* Hidden until the cell is hovered or the pill itself takes keyboard focus —
   opacity/pointer-events rather than display:none, so Tab can still reach it. */
.opportunities-milestone-undo {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2xs);
    height: 20px;
    margin-top: var(--spacing-2xs);
    padding: 0 var(--spacing-xs);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-button);
    background: var(--color-card-bg);
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: var(--font-size-2xs);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.opportunities-milestone-td:hover .opportunities-milestone-undo,
.opportunities-milestone-td:focus-within .opportunities-milestone-undo,
.opportunities-milestone-undo:focus-visible {
    opacity: 1;
    pointer-events: auto;
}

.opportunities-milestone-undo:hover {
    color: var(--color-text);
    border-color: var(--color-text-muted);
}

.opportunities-milestone-undo:disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

/* Infinite-scroll sentinel: the table defaults to infinite scroll — a sentinel row at the tail fetches the
   next page when revealed (HTMX hx-trigger="revealed"). It spans every column and
   shows a quiet loading line; htmx swaps the next batch of rows in its place. */
.opportunities-milestone-scroll-sentinel td {
    padding: var(--spacing-smd) var(--spacing-smd);
    text-align: center;
    border-bottom: none;
}

/* The phone table keeps the same columns. The header sticks only at the top. */
@media (max-width: 767.98px) {
    .opportunities-milestone-table-wrap,
    .opportunities-milestone-table-wrap.opportunities-milestone-rh-compact,
    .opportunities-milestone-table-wrap.opportunities-milestone-rh-relaxed {
        --ms-row-h: var(--control-h-touch);
    }

    .opportunities-milestone-table thead th {
        font-size: var(--font-size-sm);
    }

    .opportunities-milestone-table thead th.opportunities-milestone-table__propcol,
    .opportunities-milestone-table__milestone {
        min-width: calc(2 * var(--spacing-2xl));
        padding-inline: var(--spacing-sm);
    }

    .opportunities-milestone-propcell.opportunities-milestone-propcell--first {
        position: relative;
    }

    .opportunities-milestone-table thead th.opportunities-milestone-table__propcol--first {
        position: sticky;
    }

    .opportunities-milestone-propcell.opportunities-milestone-propcell--first,
    .opportunities-milestone-table thead th.opportunities-milestone-table__propcol--first {
        left: auto;
        padding-block: 0;
        padding-inline: var(--spacing-md) var(--spacing-sm);
        min-width: calc(3 * var(--spacing-2xl));
        max-width: calc(4 * var(--spacing-2xl));
        box-shadow: none;
    }

    .opportunities-milestone-propcell,
    .opportunities-milestone-td {
        padding-block: 0;
        padding-inline: var(--spacing-sm);
        font-size: var(--font-size-sm);
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .opportunities-milestone-row-link {
        display: flex;
        align-items: center;
        column-gap: var(--spacing-xs);
    }

    .opportunities-milestone-table a.opportunities-milestone-prop__main--link {
        line-height: var(--control-h-touch);
    }

    .opportunities-milestone-row-link,
    .opportunities-milestone-table a.opportunities-milestone-prop__main--link,
    .opportunities-milestone-do,
    .opportunities-milestone-skip,
    .opportunities-milestone-undo {
        min-height: var(--control-h-touch);
    }

    .opportunities-milestone-undo {
        opacity: 1;
        pointer-events: auto;
    }

    .opportunities-milestone-delivcell__main {
        max-height: none;
    }

    .opportunities-milestone-propcell > * {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .opportunities-milestone-team {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: var(--spacing-sm);
        max-height: none;
        overflow: hidden;
    }

    .opportunities-milestone-team__member {
        flex: 0 0 auto;
        display: inline-flex;
    }

    .opportunities-milestone-team__role {
        display: none;
    }

    .opportunities-milestone-team__member + .opportunities-milestone-team__member::before {
        content: "·";
        margin-right: var(--spacing-sm);
        color: var(--color-text-muted);
    }
}

/* Create / Edit opportunity drawer (app/opportunities/_opportunity_form.html).
   Tokens only (ADR-125); its either/or switches are segmented.css variants. */

/* Details and Roles, under the drawer's title (Nick 11-05). Negative margins cancel
   the body's padding so the strip runs edge to edge under the head; sticky, so the
   tabs stay in reach on a long form, the way the footer does at the bottom. */
#opp-form > .opportunities-form-tabs {
    position: sticky;
    top: calc(0px - var(--spacing-mdlg));
    z-index: var(--z-raised);
    flex-wrap: nowrap;
    margin: calc(0px - var(--spacing-mdlg)) calc(0px - var(--spacing-mdlg)) var(--spacing-smd);
    padding-inline: var(--spacing-mdlg);
    background: var(--color-card-bg);
}

/* A short tab (a few seats) still keeps Cancel and Save on the drawer's bottom
   edge: the form fills the body and the shown tab takes the slack. */
#opp-drawer > .global-drawer-panel > .global-drawer-body {
    display: flex;
    flex-direction: column;
}
#opp-drawer #opp-form {
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
}
#opp-form > [role="tabpanel"] { flex: 1 0 auto; }

.opportunities-fixed-properties {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.opportunities-fixed-properties dt {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.opportunities-fixed-properties dd {
    margin-bottom: 0;
    font-weight: var(--font-weight-medium);
}

/* Add Role sits on top of the rows. Its list keeps the house fixed-height box
   (.global-drawer__cols) and scrolls inside it. */
#opp-roles .opportunities-role-adder { margin-bottom: var(--spacing-md); }
#opp-roles .opportunities-role-adder .global-cs-menu { max-height: 260px; }

/* One role per row. The card draws the surface; the .global-drawer__rowbtn inside
   fills it, so a click anywhere on the row opens the role drawer, and the
   three-dot sits on the card's right as the door's sibling. */
#opp-roles .opportunities-role-card {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: background var(--transition-fast), border-color var(--transition-fast);
}
#opp-roles .opportunities-role-card:hover { background: var(--color-surface-hover); }
#opp-roles .opportunities-role-card:has(> .global-drawer__rowbtn:active) {
    background: var(--color-surface-hover);
    border-color: var(--color-text-muted);
}
#opp-roles .opportunities-role-card + .opportunities-role-card { margin-top: var(--spacing-sm); }
#opp-roles .opportunities-role-icon { font-size: var(--font-size-base); line-height: 1; }
/* A role row is a card in the Add Role tile's family: about its height, its corner,
   its type size, so the roster and the tile under it read as one stack. The right
   padding keeps the text clear of the three-dot. */
#opp-roles .opportunities-role-card > .global-drawer__rowbtn {
    min-width: 0;
    min-height: calc(var(--control-h-touch) + var(--spacing-smd));
    padding: var(--spacing-smd) calc(var(--control-h-touch) + var(--spacing-sm)) var(--spacing-smd) var(--spacing-md);
    font-size: var(--font-size-lg);
    background: transparent;
    border-color: transparent;
    border-radius: var(--radius-lg);
}

/* The three-dot, right of the middle. No transform here: one would trap its
   fixed menu (menu-button.js) under the next row. */
#opp-roles .opportunities-role-more {
    position: absolute;
    top: 0;
    right: var(--spacing-xs);
    bottom: 0;
    display: flex;
    align-items: center;
}
#opp-roles .opportunities-role-more__menu {
    position: fixed;
    white-space: nowrap;
}

/* A row that says it: the role and its badges, then who · Detail · skills, then the
   scope of work on one line. */
#opp-roles .opportunities-seat {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: var(--spacing-2xs);
    min-width: 0;
    text-align: left;
}
/* The role name is never cut: on a narrow row the badge chips wrap under it.
   Each chip carries the house ms-2 (0.5rem); the name carries the same and the
   line pulls back by it, so a wrapped chip lines up under the name. */
#opp-roles .opportunities-seat__top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-xs);
    min-width: 0;
    margin-left: calc(-1 * var(--spacing-sm));
}
#opp-roles .opportunities-seat__top > .global-drawer__rowbtn-label {
    flex: 0 0 auto;
    max-width: calc(100% - 0.5rem);
    margin-left: var(--spacing-sm);
    white-space: normal;
}
#opp-roles .opportunities-seat__top > .opportunities-role-icon { margin-left: var(--spacing-sm); }
#opp-roles .opportunities-seat__top > [data-seat-badge] { flex-shrink: 0; }
/* Its grey is the .text-muted class the picked look used. */
#opp-roles .opportunities-seat__scope {
    font-size: var(--font-size-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The second line never squeezes a piece: it folds instead (fitSeatLine,
   opportunity-form.js), skills to +N first, then the name, so Detail is never cut.
   A piece with data-show shows only at the folds it lists. */
#opp-roles .opportunities-seat__line { overflow: hidden; }
#opp-roles .opportunities-seat__line > * { flex-shrink: 0; }
#opp-roles .opportunities-seat__line [data-show] { display: none; }
#opp-roles .opportunities-seat__line[data-fold="0"] > [data-show~="0"],
#opp-roles .opportunities-seat__line[data-fold="1"] > [data-show~="1"],
#opp-roles .opportunities-seat__line[data-fold="2"] > [data-show~="2"],
#opp-roles .opportunities-seat__line[data-fold="3"] > [data-show~="3"] { display: inline-block; }
/* Past the last fold the line wraps rather than cut the Detail. */
#opp-roles .opportunities-seat__line[data-fold="3"] { flex-wrap: wrap; }

/* The drawer is transformed, so this fixed panel measures from the drawer, which
   already sits under the app header. */
#opp-role-panel { top: 0; }

/* Details and People across the top of one seat's editor (Nick 11-05). */
#opp-role-panel .opportunities-seat-tabs {
    flex-wrap: nowrap;
    margin-bottom: var(--spacing-smd);
}

/* The People tab wears the phone seat's rows (signup-phone.css); its chips sit
   beside the name and the Sign Up button keeps to its own width. */
#opp-role-panel .opportunities-role-people .global-badge { flex-shrink: 0; }
#opp-role-panel .opportunities-role-people__self {
    display: flex;
    padding-top: var(--spacing-md);
}
/* A People row (Nick 11-05): the face, the name with its status word small under
   it, and at the row's end the Sign Up board's red x (Remove, Cancel invite) or,
   for a sign-up, Approve and Deny as small pills. Nothing runs full width. */
#opp-role-panel .opportunities-role-people .assignments-seat-sheet__person { flex-wrap: nowrap; }
#opp-role-panel .opportunities-role-people .assignments-seat-sheet__who { gap: var(--spacing-2xs); }
#opp-role-panel .opportunities-role-people .assignments-seat-sheet__who .global-badge { align-self: flex-start; }
#opp-role-panel .opportunities-role-people__pills {
    display: flex;
    flex-shrink: 0;
    gap: var(--spacing-xsm);
}
#opp-role-panel .opportunities-role-people__pills .assignments-seat-sheet__btn {
    flex: 0 0 auto;
    min-height: var(--control-h-sm);
    padding: 0 var(--spacing-smd);
    font-size: var(--font-size-sm);
}
#opp-role-panel .opportunities-role-people__x {
    flex-shrink: 0;
    min-width: var(--control-h-sm);
    height: var(--control-h-sm);
    margin-left: 0;
    font-size: var(--font-size-sm);
}

/* Band headings wear the small-caps legend, so they never read as a field label. */
#opp-form .opportunities-band-title { margin: 0; }

/* Hairlines split the role editor into the questions a coordinator answers in turn. */
#opp-role-panel .opportunities-panel-rule {
    margin: var(--spacing-md) 0;
    border: 0;
    border-top: 1px solid var(--color-border-hairline);
    opacity: 1;
}
/* Dates and pay may both be absent, so a rule of their own would double the next one. */
#opp-role-panel .opportunities-section { border-top: 0; padding-top: 0; }

/* The role editor lives in #opp-role-panel, a sibling of #opp-roles, so scope to it. */

/* Base, travel and total read as one unit. */
#opp-role-panel .opportunities-pay-block {
    background: var(--color-surface-subtle);
    border: 1px solid var(--color-border-hairline);
    border-radius: var(--radius-md);
    padding: var(--spacing-smd) var(--spacing-md);
}
#opp-role-panel .opportunities-pay-total {
    border-top: 1px dashed var(--color-border-hairline);
    padding-top: var(--spacing-sm);
}

#opp-role-panel .opportunities-skill-row,
#opp-role-panel .opportunities-choice-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-smd);
    border: 1px solid var(--color-border-hairline);
    border-radius: var(--radius-md);
    background: var(--color-surface-subtle);
}
#opp-role-panel .opportunities-skill-row + .opportunities-skill-row { margin-top: var(--spacing-sm); }
#opp-role-panel .opportunities-skill-name,
#opp-role-panel .opportunities-choice-row > .form-check-label {
    font-weight: var(--font-weight-body);
}
/* The skill name is the one thing in the row that can shrink and still be read. */
#opp-role-panel .opportunities-skill-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* Fixed-size targets: shrinking either one breaks the row. */
#opp-role-panel .opportunities-skill-row > .global-icon-btn { flex: 0 0 auto; }
/* The skill rows carry their own borders; margin, not a rule, keeps them off
   the visibility toggle above. */
#opp-role-panel .opportunities-access-skills:not(:empty) { margin-top: var(--spacing-sm); }

/* A yes-or-no question as a row: the skill row's surface (set above), whole width tappable. */
#opp-role-panel .opportunities-choice-row { gap: var(--spacing-smd); }
#opp-role-panel .opportunities-choice-row > .form-check-label {
    flex: 1 1 auto;
    min-width: 0;
    cursor: pointer;
    margin: 0;
}
/* The tick sits at the right edge, where every other control in the panel ends. */
#opp-role-panel .opportunities-choice-row > .form-check-input {
    flex: 0 0 auto;
    order: 2;
    float: none;
    margin: 0;
    width: 1.15rem;
    height: 1.15rem;
    cursor: pointer;
}
#opp-role-panel .opportunities-choice-row + .opportunities-choice-row {
    margin-top: var(--spacing-sm);
}
/* The ticked question's follow-up hangs off a rule, so it reads as part of that row. */
#opp-role-panel .opportunities-choice-follow {
    margin: var(--spacing-sm) 0 0 var(--spacing-smd);
    padding-left: var(--spacing-smd);
    border-left: 2px solid var(--color-border-hairline);
}

/* Opt-in bands: one top line per open band and one closing line for the group, so
   two open bands never show a doubled line (x-if <template> nodes defeat a
   sibling rule). No closing line while every band is closed. */
#opp-form .opportunities-optins.is-bands-open { border-bottom: 1px solid var(--color-border-hairline); }
#opp-form .opportunities-section {
    border-top: 1px solid var(--color-border-hairline);
    padding: var(--spacing-md) 0;
}
/* Collapsed tiles breathe; expanded bands butt flush so a band's top divider
   doubles as the divider below the band above it. */
#opp-form .opportunities-optins .global-add-tile { margin: var(--spacing-smd) 0; }
/* The properties' own line would double the group's closing line; hidden (not
   removed) so the gap stays the same open or closed. */
#opp-form .opportunities-optins.is-bands-open + .opportunities-props > hr { visibility: hidden; }

/* "[− 7 +] days [before|after] the event": the −/+ buttons are the stepper, so the
   native spinners are hidden; corners match the switch beside it. */
#opp-form .opportunities-rel-due {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm) var(--spacing-smd);
}
#opp-form .opportunities-rel-due__stepper {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-card-bg);
}
#opp-form .opportunities-rel-due__step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    border: 0;
    background: var(--color-surface-subtle);
    color: var(--color-text-cool);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}
#opp-form .opportunities-rel-due__step:hover { background: var(--color-surface-hover); color: var(--color-text); }
#opp-form .opportunities-rel-due__step:active { background: var(--color-surface-hover); }
#opp-form .opportunities-rel-due__num {
    width: 3.25rem;
    border: 0;
    border-left: 1px solid var(--color-border-subtle);
    border-right: 1px solid var(--color-border-subtle);
    text-align: center;
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-base);
    color: var(--color-text-cool);
    background: var(--color-card-bg);
    -moz-appearance: textfield;
}
#opp-form .opportunities-rel-due__num:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: -2px;
}
#opp-form .opportunities-rel-due__num::-webkit-outer-spin-button,
#opp-form .opportunities-rel-due__num::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
#opp-form .opportunities-rel-due__unit,
#opp-form .opportunities-rel-due__suffix {
    font-size: var(--font-size-md);
    color: var(--color-grey-700);
}
#opp-form .opportunities-rel-due__unit { min-width: 2.25rem; }
#opp-form .opportunities-rel-due__dir { flex: 0 0 auto; }

/* Sticky footer: negative margins cancel the drawer body's padding so the bar sits
   edge to edge and flush with the bottom. */
#opp-form .opportunities-drawer-footer {
    position: sticky;
    bottom: calc(0px - var(--spacing-mdlg));
    z-index: var(--z-raised);
    margin: var(--spacing-lg) calc(0px - var(--spacing-mdlg)) calc(0px - var(--spacing-mdlg));
    padding: var(--spacing-md) var(--spacing-mdlg);
    background: var(--color-card-bg);
    border-top: 1px solid var(--color-border-hairline);
}

/* The due-date info icon. Its sentence shows in the shared tooltip bubble. */
#opp-form .opportunities-due-info {
    color: var(--color-text-muted);
    cursor: help;
    font-size: var(--font-size-sm);
    margin-left: var(--spacing-2xs);
    vertical-align: baseline;
}

/* A fixed level-picker width keeps the skill rows lined up. */
#opp-form .opportunities-skill-level { flex: 0 0 9rem; }

/* Locked mid-save buttons use aria-disabled (so a tap can explain), which Bootstrap never dims. */
#opp-form .btn[aria-disabled="true"] { opacity: .65; cursor: default; }

/* Phone: a full-width footer at touch height that keeps the base sticky offsets
   (bottom: 0 lands 20px short) and clears the home indicator. Last in the file:
   base rules never follow a media block. */
@media (max-width: 767.98px) {
    body:has(.opportunities-editor-panel.is-open) .global-toast-container:has(.global-toast-error) {
        top: auto;
        bottom: calc(max(var(--bottom-bar-h), var(--phone-covered-bottom, 0px))
            + var(--control-h-touch) + var(--spacing-lg));
    }

    #opp-form .opportunities-drawer-footer {
        padding: var(--spacing-sm) var(--spacing-md);
        padding-bottom: calc(var(--safe-bottom) + var(--spacing-sm));
        background: var(--color-card-bg);
        border-top: 1px solid var(--color-border-subtle);
    }
    #opp-form .opportunities-drawer-footer .btn {
        flex: 1 1 0;
        min-height: var(--control-h-touch);
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* New Booking is one long sheet that fills the phone screen (Nick, round 4):
       over the header and the bottom bar, square corners, and the body below
       the head is the one thing that scrolls. Editing keeps the bottom sheet.
       clip, not hidden: opening a band scrolls it into view, and a hidden box
       still scrolls when asked to, which slid the head off the top. */
    #opp-drawer > .opportunities-new-sheet {
        inset: var(--phone-covered-top, 0px) 0 var(--phone-covered-bottom, 0px);
        height: auto;
        max-height: none;
        padding-bottom: 0;
        overflow: clip;
        border-radius: var(--radius-none);
    }

    #opp-drawer > .opportunities-new-sheet > .global-drawer-body {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior-y: contain;
    }

    /* A short form still keeps Cancel and Create on the bottom edge. */
    #opp-drawer > .opportunities-new-sheet #opp-form {
        display: flex;
        flex-direction: column;
        flex: 1 0 auto;
    }

    #opp-drawer > .opportunities-new-sheet #opp-form .opportunities-drawer-footer {
        margin-top: auto;
    }

    /* Nothing to drag on a sheet that fills the screen; the X clears the notch. */
    #opp-drawer > .opportunities-new-sheet > .global-drawer-head {
        padding-top: calc(var(--safe-top) + var(--spacing-md));
    }

    #opp-drawer > .opportunities-new-sheet > .global-drawer-head::before {
        display: none;
    }

    /* The email and phone buttons and the due-date switch get a thumb's room. */
    #opp-drawer > .opportunities-new-sheet #recipient_name ~ .btn {
        min-width: var(--control-h-touch);
    }

    #opp-drawer > .opportunities-new-sheet #opp-form .global-segmented__btn {
        min-height: var(--control-h-touch);
    }
}

/* Dashboard toolbar — row 2 of the dashboard header (arrangement C): the search
   box, Sort by, the page's own extra controls, and the quick-filter pill strip
   underneath.

   Canonical markup: shared/components/toolbar/_toolbar_row.html plus its pill
   strip (_condition_chips.html) and value picker. All five dashboards mount
   those — the opportunity dashboard, the bills dashboard, both lead boards and
   the workers roster — and a page adopting this toolbar mounts them too rather
   than copying the classes. The opportunity dashboard the row was lifted from
   wears it through a mapping file (app/assignments/_opps_toolbar_row.html); its
   card view's pinned header, which used to live here, is the shared --pinned
   variant now (pinned=True on the page_header include; rules in page-header.css).

   The buttons themselves are the platform components — .global-header-btn for
   Sort by, .global-segmented for the sort direction — so this file only supplies
   the layout, the pill strip, and the popovers. Pills are their own shape rather
   than .global-chip: a pill is an interactive control that opens a picker, and the
   charter reserves .global-chip for the static label. */

/* ── Layout ── one wrapper inside .global-page-header__toolbar so the chip row can
   sit full-width below the controls. It takes the whole flex line and re-creates the
   toolbar's own row inside it; page-header.css reaches the search box and the date
   nav through descendant selectors, so both keep their shipped placement. */
.global-toolbar {
    flex: 1 1 100%;
    min-width: 0;
}

.global-toolbar__row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* page-header.css sends whatever follows the search to the far right — search on the
   left, the page's own cluster on the right. These controls are the search's OWN row,
   so that rule has to stop at this component's edge: on the roster's no-tabs header,
   the one mount it reaches, it stranded Sort by against the far side of the page. The
   actions cluster is the exception, because riding the far right is its whole job. */
.global-page-header .global-toolbar__row .global-page-search + *:not(.global-toolbar__actions) {
    margin-left: 0;
}

/* ── Actions ── the gear and whatever a page keeps beside it, at the end of the row
   the search box owns. They sit here rather than on the tabs line above so the tabs
   get that line to themselves. */
.global-toolbar__actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xsm);
    margin-left: auto;
}

/* Filter, Sort by and the views pill carry a label beside the icon, so they need
   more side padding than the icon-only .global-header-btn default. Both classes,
   because main.css loads later and would win a tie. */
.global-header-btn.global-toolbar__btn {
    padding: 0 var(--spacing-sm);
}

/* Filter is a toggle for the quick-filter row; pressed, it reads
   as held down from the moment the row shows, so it skips the button's fade in.
   Scoped to the toolbar to outrank main.css's .global-header-btn. */
.global-toolbar .global-toolbar__filter[aria-pressed="true"] {
    background: var(--color-surface-hover);
    border-color: var(--color-text-secondary);
    color: var(--color-text);
    transition: none;
}

/* How many filters are in play, on the Filter button. Rendered only above
   zero, so there is no empty-state size to hold. */
.global-toolbar__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.125rem;
    padding: 0 var(--spacing-xs);
    border-radius: var(--radius-pill);
    background: var(--color-action);
    color: var(--color-neutral-ink-fg);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
}

/* ── Popovers ── each control opens its own, placed from the button's rect by the
   factory. They are position:FIXED because the header card clips what is inside it
   (page-header.css sets overflow:hidden to keep the rounded corners), so an
   absolutely positioned menu would be cut off at the header's bottom edge. Fixed
   escapes that clip, the same way the settings drawer already does. */
.global-toolbar__menu-wrap {
    display: inline-flex;
}

.global-toolbar__menu {
    position: fixed;
    min-width: 16rem;
}

@media (max-width: 767.98px) {
    .global-toolbar__menu:not(:has(.global-cs)) {
        overflow-y: auto;
        overscroll-behavior-y: contain;
    }
}

/* Sort is one row — property, then direction — so it sizes to its contents. */
.global-toolbar__menu--sort {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 0;
    white-space: nowrap;
}

.global-toolbar__search,
.global-toolbar__select {
    width: 100%;
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-card-bg);
    color: var(--color-text);
    font-size: var(--font-size-sm);
}

/* The property combobox would otherwise size to its input's own default width. */
.global-toolbar__menu--sort .global-cs {
    flex: 0 0 auto;
    width: 14rem;
}

.global-toolbar__search:focus-visible,
.global-toolbar__select:focus-visible,
.global-toolbar__option:focus-visible,
.global-toolbar__chip:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 1px;
}

/* The list under a pinned search box: scrolls on its own so a long worker list
   never grows the popover past the fold. */
.global-toolbar__options {
    display: flex;
    flex-direction: column;
    max-height: 15rem;
    margin-top: var(--spacing-xsm);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.global-toolbar__option {
    display: flex;
    align-items: center;
    gap: var(--spacing-xsm);
    width: 100%;
    padding: var(--spacing-xsm) var(--spacing-sm);
    border: 0;
    background: none;
    font-size: var(--font-size-sm);
    text-align: left;
    cursor: pointer;
}

/* The option the pill already holds, so the picker reads as "this is what you
   have". menu.css paints its fill and weight. */
.global-toolbar__option.is-active {
    color: var(--color-action);
}

/* The pencil's popover: a small caption over a list of ticks. The rows are the
   same shape as a pill's options so the two popovers read as one family; only
   the box in front says these are choices that stay, not one-shot picks. */
.global-toolbar__menu-title {
    margin: 0;
    padding: var(--spacing-2xs) var(--spacing-sm);
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.global-toolbar__option--check {
    gap: var(--spacing-sm);
}

.global-toolbar__option--check .global-checkbox {
    margin: 0;
}

/* Date and free-text pickers — a small stack that ends in its own Apply, since
   neither is done being typed until the person says so. */
.global-toolbar__dates {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xsm);
}

.global-toolbar__apply {
    align-self: flex-end;
    padding: var(--spacing-xs) var(--spacing-smd);
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--color-action);
    color: var(--color-neutral-ink-fg);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
}

.global-toolbar__apply:disabled {
    opacity: 0.5;
    cursor: default;
}


.global-toolbar__chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-xsm);
    margin-top: var(--spacing-sm);
}

/* The strip always renders — it is the repaint target and carries the counts the
   Filter button reads — but shows only while Filter is pressed. */
.global-toolbar:not(.is-filter-open) .global-toolbar__chips {
    display: none;
}

/* The line between the pills and Advanced filters. */
.global-toolbar__sep {
    flex: 0 0 auto;
    width: 1px;
    height: var(--hairline-h);
    margin: 0 var(--spacing-2xs);
    background: var(--color-border);
}

/* With no pill before it, the line divides nothing. */
.global-toolbar__chips > .global-toolbar__sep:first-child {
    display: none;
}

/* The way into the drawer's All filters panel, with how many rules it holds
   beyond the pills. */
.global-toolbar__adv {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-2xs) var(--spacing-xs);
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--color-text);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
    cursor: pointer;
}

.global-toolbar__adv:hover {
    background: var(--color-surface-hover);
}

.global-toolbar__adv:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 1px;
}

/* A SET pill wears the action ink: it is the state doing the filtering, and the
   empty pills beside it are only offers. Every pill is a button that opens its
   picker (or the drawer), hence the pointer. */
.global-toolbar__chip {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--color-action);
    border-radius: var(--radius-pill);
    background: var(--color-action-tint);
    color: var(--color-action);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
    white-space: nowrap;
    cursor: pointer;
}

/* An EMPTY pill reads as an OFFER, not a state: a dashed outline over nothing,
   the shape HubSpot uses for "you could filter by this". */
.global-toolbar__chip--add,
.global-toolbar__chip--round {
    border-color: var(--color-border);
    border-style: dashed;
    background: none;
    color: var(--color-text-muted);
    font-weight: var(--font-weight-body);
}

.global-toolbar__chip--add:hover,
.global-toolbar__chip--round:hover {
    border-color: var(--color-action);
    color: var(--color-action);
}

/* The pencil that picks which fields wear a pill stays an icon — the pills beside
   it already say what the row is for. */
.global-toolbar__chip--round {
    padding: 0;
    width: 1.5rem;
    height: 1.5rem;
    justify-content: center;
}

.global-toolbar__chip .bi-chevron-down,
.global-toolbar__caret {
    font-size: var(--font-size-2xs);
    opacity: 0.7;
}

/* The way out to the full builder — a text link, so it never competes with the
   chips for the eye. */
.global-toolbar__link {
    padding: var(--spacing-xs) var(--spacing-xs);
    border: 0;
    background: none;
    color: var(--color-action);
    font-size: var(--font-size-xs);
    cursor: pointer;
}

.global-toolbar__link:hover {
    text-decoration: underline;
}

/* A set pill's way out, at the foot of its picker. It keeps the link colour
   above, the token main.css's link rule uses (Nick, 09-26: darken it everywhere). */
.global-toolbar__link--clear {
    display: block;
    margin-top: var(--spacing-xsm);
}

/* ── Bottom bar ── (_view_bar.html) the count, Refresh, Reset to last save,
   Clone to new view and Save, at the foot of the screen on every saved-view
   board. It is the last child of .global-app-main, so sticky
   holds it to the bottom however far the page scrolls; on a phone it stands on
   the bottom nav, and beside a pushed drawer it stops at the drawer's edge.
   One rung under the pinned header card: a drawer that lives inside that card
   paints at the card's --z-sticky, and on a phone it covers the whole screen,
   so a bar at the same rung later in the page would sit on top of its buttons.
   Smaller since 10-11, when Nick found it too big: 40px tall, 28px buttons. */
.global-view-bar {
    --view-bar-height: 40px;
    --view-bar-save-width: 64px;

    position: sticky;
    bottom: var(--bottom-bar-h);
    z-index: var(--z-under-sticky);
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-smd);
    height: var(--view-bar-height);
    margin-right: var(--content-push);
    padding: 0 var(--spacing-md);
    background: var(--color-card-bg);
    border-top: 1px solid var(--color-border);
}

.global-view-bar .global-icon-btn {
    width: var(--control-h-sm);
    height: var(--control-h-sm);
}

.global-view-bar__count {
    padding: var(--spacing-2xs) var(--spacing-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-card-bg);
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
}

.global-view-bar__actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-left: auto;
}

/* Reset and Clone share one pill with a line between them. */
.global-view-bar__pair {
    display: inline-flex;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
}

.global-view-bar__pair .global-icon-btn {
    border: 0;
    border-radius: var(--radius-pill) var(--radius-none) var(--radius-none) var(--radius-pill);
}

.global-view-bar__pair .global-clone .global-icon-btn {
    border-left: 1px solid var(--color-border);
    border-radius: var(--radius-none) var(--radius-pill) var(--radius-pill) var(--radius-none);
}

.global-view-bar__save {
    min-width: var(--view-bar-save-width);
    min-height: 28px;
    padding: 0 var(--spacing-sm);
    justify-content: center;
    font-size: var(--font-size-sm);
}

/* ── Clone to new view ── (_clone_menu.html) its name box and who-sees-it
   picks. In the bar it opens upward from the button; in the drawer, under
   its row. */
.global-clone {
    position: relative;
    display: inline-flex;
}

.global-clone--drawer {
    display: block;
}

.global-clone__menu {
    min-width: 16rem;
    padding: var(--spacing-xsm);
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.global-view-bar .global-clone__menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + var(--spacing-sm));
    z-index: var(--z-dropdown);
    box-shadow: var(--shadow-lg);
}

.global-clone--drawer .global-clone__menu {
    margin-top: var(--spacing-xs);
}

.global-clone__menu .global-toolbar__search {
    margin: var(--spacing-xs) 0;
}

.global-toolbar__link .global-toolbar__count,
.global-toolbar__adv .global-toolbar__count {
    margin-left: var(--spacing-2xs);
}

@media (max-width: 767.98px) {
    /* The pill row keeps the base wrap, so Advanced filters drops to a second
       line instead of sliding off the right edge. */
    .global-view-bar {
        padding: 0 var(--spacing-smd);
    }

    /* The same controls as on a desktop, only tall enough for a thumb.
       Advanced filters has no border and no fill, so it keeps its look. */
    .global-toolbar .global-toolbar__btn,
    .global-toolbar .global-toolbar__chip,
    .global-toolbar .global-toolbar__option,
    .global-toolbar .global-toolbar__adv,
    .global-toolbar .global-filter-builder-group__add {
        min-height: var(--control-h-touch);
    }

    .global-toolbar .global-icon-btn {
        width: var(--control-h-touch);
        height: var(--control-h-touch);
    }

    /* Sort wraps on a phone. 16rem is MENU_WIDTH in quick-filters.js. */
    .global-toolbar__menu--sort {
        flex-wrap: wrap;
        width: 16rem;
    }

    .global-toolbar__menu--sort .global-cs {
        flex: 1 1 auto;
    }
}

/* ── In the phone head's fold ── (page-header.css) the toolbar stands as one
   column: the chips always out (the Filter button that shows them has nothing
   left to toggle) at the top, then Sort by at the row's width, the page's own
   filters, the gear at the foot. The chips are the row's sibling, so the
   toolbar itself stacks and lifts them above the row. */
@media (max-width: 767.98px) {
    .global-phone-head__fold .global-toolbar {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-smd);
    }

    .global-phone-head__fold .global-toolbar .global-toolbar__chips {
        order: -1;
        margin-top: 0;
    }

    .global-phone-head__fold .global-toolbar__row {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-smd);
    }

    .global-phone-head__fold .global-toolbar__filter {
        display: none;
    }

    .global-phone-head__fold .global-toolbar .global-toolbar__chips {
        display: flex;
    }

    .global-phone-head__fold .global-toolbar__menu-wrap {
        display: flex;
    }

    .global-phone-head__fold .global-toolbar__menu-wrap > .global-toolbar__btn {
        flex: 1 1 auto;
        justify-content: flex-start;
    }

    .global-phone-head__fold .global-toolbar__actions {
        margin-left: 0;
    }

    /* The foot bar (the count, Refresh, Save) stays off a phone that wears the
       head until there is something to save: the rows get its height. */
    :root:has(.global-phone-head) .global-view-bar {
        display: none;
    }

    :root:has(.global-phone-head) .global-view-bar:has([data-view-bar-control="save"]:not([x-cloak]):not([style*="display: none"])) {
        display: flex;
    }
}

/* Who sees it — the saved-view sharing drawer (_saved_view_sharing_dialog.html)
   and the settings drawer row's avatar stack (_opps_drawer_actions.html).

   Almost everything inside the drawer is borrowed whole: the drawer shell and
   its row buttons (drawer.css, drawer-content.css), the people rows and tick
   (settings-hub/permissions.css), the person chips (person-chip), the builder
   (filter-builder.css) — all global on base.html. This file is only what none
   of them carry: the view line, the search field's column fix, the reach line
   and the row's avatar stack.
   Every color, radius, and shadow resolves to a token (ADR-125). */

/* ── Drawer body ── */

.opportunities-sharing__body {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-smd);
}

/* The view being decided — name · kind, one quiet line under the title. */
.opportunities-sharing__view {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin: 0;
    font-size: var(--font-size-md);
    color: var(--color-text-secondary);
}

.opportunities-sharing__people {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-smd);
    min-width: 0;
}

/* Two corrections the shared search field needs in this column, both because
   its base contract was written for a horizontal filter bar:

   flex — the field ships with a horizontal basis: `flex: 1 1 260px` from
   filter-bar.css, and inside the page header (below) `flex: 0 1 20rem` from
   page-header.css, which is the one that actually wins here. Stood on end
   either basis is a HEIGHT, so the moment the panel left any slack the field
   ate it and the magnifier floated into the middle of the gap. The slack
   belongs to the list. permissions.css:285 carries this same correction for
   the same reason, which is the case for promoting it into filter-bar.css.

   max-width — the drawer's container is rendered inside the page header
   (_opps_view_controls.html sits in the header actions block), so
   `.global-page-header .global-page-search`'s 20rem cap reaches in and pins
   the field at 320px, ending it short of the rows it searches. That cap is a
   header rule about a header row; the drawer is neither, and lifting it here
   is what lines the field's right edge up with the list. */
.opportunities-sharing__people > .global-page-search {
    flex: 0 0 auto;
    max-width: none;
}

/* Row skins come from settings-permission-drawer-list (global); the drawer
   body is the scroller. The padding is the checkbox column's gutter, so a
   row's focus ring is never cut off at the edge. */
.opportunities-sharing__list {
    padding: var(--spacing-2xs) var(--spacing-xs);
    /* No font-size here on purpose. person-chip.css gives the name none of its
       own at this rung, and nothing between here and <html> sets one either, so
       the names already render at the 16px root — the largest type in a drawer
       whose other lines are 14px. Measured at 16px on 08-28; a token size here
       would have to be --font-size-lg, and that is 15px, so the "step up" this
       list looked like it wanted would have made it smaller. */
}

/* The builder, then the match line under it. */
.opportunities-sharing__filter {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-smd);
}

/* The live match line under the builder — the count alone, which is the
   whole of what it knows. */
.opportunities-sharing__match {
    margin: 0;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
}

/* ── The reach line — who ends up with the tab, and the drawer's ONE
   headcount. The old preview restated the picker's own list beside a second,
   differently-counted number; this is one sentence and one face stack. */

.opportunities-sharing__reach {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin: 0;
    padding-top: var(--spacing-smd);
    font-size: var(--font-size-md);
    color: var(--color-text-secondary);
    border-top: 1px solid var(--color-border-subtle);
}

/* Everyone and Just for me have nothing to count, and a rule across nothing
   reads as a glitch. */
.opportunities-sharing__reach--silent {
    display: none;
}

/* The sentence takes what the stack leaves, and wraps rather than widening
   the drawer on a long roster. */
.opportunities-sharing__reach-text {
    min-width: 0;
}

/* ── The drawer row's avatar stack ── faces overlap left-to-right, each
   ringed in the card's own bg so the overlap reads as a stack and not a
   blob; the "+N" chip folds the rest. */

.opportunities-sharing-stack {
    display: inline-flex;
    align-items: center;
}

.opportunities-sharing-stack__avatar {
    box-shadow: var(--shadow-avatar-ring);
}

.opportunities-sharing-stack__avatar:not(:first-child),
.opportunities-sharing-stack__more {
    margin-left: -8px;
}

.opportunities-sharing-stack__more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: var(--font-size-2xs);
    color: var(--color-text-secondary);
    background: var(--color-surface-subtle);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-avatar-ring);
}


.opportunities-role-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: var(--role-tile-height);
    padding: var(--spacing-xsm) var(--spacing-sm);
    border-radius: var(--radius-card);
    border: 1px solid var(--role-tile-open-border);
    background: var(--role-tile-open-bg);
    text-align: center;
    transition: border-color 0.15s;
}

/* Shrink icon buttons inside role tiles so $ + location stack without overlap */
.opportunities-role-tile .global-header-btn.global-header-btn-icon {
    height: 20px !important;
    width: 20px !important;
    min-width: 20px !important;
    padding: 0 !important;
    border-radius: var(--radius-button);
}

.opportunities-role-tile .global-header-btn.global-header-btn-icon i {
    font-size: var(--font-size-2xs);
}

.opportunities-role-tile .opportunities-role-tile__location {
    position: absolute !important;
    bottom: 0.1875rem !important;
    right: 0.1875rem !important;
    top: auto !important;
    left: auto !important;
    z-index: 1;
}

.opportunities-role-tile__location .bi-geo-alt-fill {
    color: var(--color-error);
}

.opportunities-role-tile__location:hover .bi-geo-alt-fill {
    /* Hover icon sits on the light tile bg, so the ink itself is the
       accent — not the white foreground meant for a filled control. */
    color: var(--color-action);
}

.opportunities-role-tile--filled {
    background: var(--role-tile-filled-bg);
    border-color: var(--role-tile-filled-border);
}

.opportunities-role-tile--mine {
    background: var(--role-tile-mine-bg);
    border-color: var(--role-tile-mine-border);
    position: relative;
    text-decoration: none;
}

.opportunities-role-tile--mine[role="link"],
a.opportunities-role-tile--mine {
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.opportunities-role-tile--mine[role="link"]:hover,
a.opportunities-role-tile--mine:hover {
    background: color-mix(in srgb, var(--color-action) 18%, white);
    border-color: var(--color-action);
}

.opportunities-role-tile__name {
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-grey-700);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.opportunities-role-tile__status {
    font-size: var(--font-size-2xs);
    margin-top: var(--spacing-2xs);
}

.opportunities-role-tile__status--open {
    color: var(--color-text-muted);
}

.opportunities-role-tile__status--filled {
    color: var(--color-action-pressed);
}


/* One step a person ticks before a job is done, as it is written on a role.
   A numbered row: the words get the width, the tools stay ghost until pointed
   at. Both role drawers (Settings → Roles, the booking's role panel) draw it. */
.global-steps {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
}

.global-step {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-xs) var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--color-border-hairline);
    border-radius: var(--radius-md);
    background: var(--color-card-bg);
}

.global-step:focus-within {
    border-color: var(--color-action);
}

.global-step__num {
    flex: 0 0 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-surface-subtle);
    color: var(--color-text-light);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.global-step__num--done {
    background: var(--color-action-tint);
    color: var(--color-success);
}

.global-step__text {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: var(--spacing-xs) 0;
    font: inherit;
    line-height: 1.4;
    color: var(--color-text);
    resize: none;
    overflow: hidden;
}

.global-step__text:focus {
    outline: none;
}

.global-step__text:read-only {
    color: var(--color-text-light);
}

.global-step__tools {
    display: flex;
    gap: 2px;
    flex: 0 0 auto;
}

/* The row that adds the next item: a dashed slot the same height as the rows
   above it, a + and nothing else (Nick, 10-13). It sits inside .global-steps
   so it shares the list's gap; the full-width .global-add-tile stays the tile
   for everything that is not a checklist. */
.global-step--add {
    justify-content: center;
    width: 100%;
    border-style: dashed;
    border-color: var(--color-border);
    background: transparent;
    color: var(--color-text-light);
    font: inherit;
    cursor: pointer;
    transition:
        border-color 0.12s ease,
        background-color 0.12s ease,
        color 0.12s ease;
}

/* The glyph takes the text line's box, so the row lands on the rows' height. */
.global-step--add i {
    font-size: var(--font-size-md);
    line-height: 1.4;
    padding: var(--spacing-xs) 0;
}

.global-step--add:hover {
    border-color: var(--color-action);
    background: var(--color-action-tint);
    color: var(--color-text);
}

.global-step--add:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

/* ==========================================================================
   In-page record header (round 7) — back · identity · stage chip · actions,
   with the tab bar built into its bottom edge. The main app header carries
   none of it: the record identity sits at the top of the content surface with
   the tab strip beneath it, left justified. The global dark global-app-header is left empty for this page;
   everything below sits on the light content surface. The bar, back link,
   heading, actions cluster, and tab strip now come from the canonical
   shared/components/record_header.html (styled in components/page-header.css)
   — this file keeps only opportunity's own inner-element styling: the stage
   chip, the actions cluster's buttons/divider, and the description slot.
   ========================================================================== */
/* The whole record reads as ONE card. The shell (.opportunities-tabs-shell) draws the only
   border, radius, and background; the header, the tab strip, and the active pane
   are borderless sections inside it, so there is a single continuous surface with
   no stacked-box seam. overflow:hidden clips those sections to the rounded corners. */
.opportunities-tabs-shell {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: var(--spacing-mdlg);
}

/* The canonical record header draws its own card frame — dropped here so it sits
   flush on the shell above, the same "first-level loses its own chrome" treatment
   as the pane cards below (.opportunities-tab-pane > .card). */
.opportunities-tabs-shell > .global-record-header {
    background: transparent;
    border: none;
    border-radius: var(--radius-none);
    margin-bottom: 0;
}

/* Actions cluster — Invite (solid) · Add role (outline) · divider · edit/gear/trash. */
.opportunities-record-header__actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xsm);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.opportunities-record-header__cta {
    white-space: nowrap;
}

.opportunities-record-header__divider {
    width: 1px;
    align-self: stretch;
    min-height: 24px;
    margin: 0 var(--spacing-xs);
    background: var(--color-grey-200);
}

/* Edit / gear / trash — light-surface icon buttons (the on-dark header twins are gone). */
.opportunities-record-header__icon-btn {
    font-size: var(--font-size-md);
    transition: background 0.15s ease, color 0.15s ease;
}

/* Open in Scheduling (Page N): beside the three-dot at the house control size. */
.opportunities-record-header__icon-btn--house {
    width: var(--control-h-base);
    height: var(--control-h-base);
}

.opportunities-record-header__icon-btn:hover,
.opportunities-record-header__icon-btn:focus-visible {
    background: var(--color-action-tint-pressed);
    color: var(--color-action);
}

.opportunities-record-header__icon-btn--danger:hover,
.opportunities-record-header__icon-btn--danger:focus-visible {
    background: color-mix(in srgb, var(--color-error) 10%, transparent);
    color: var(--color-error);
}

.opportunities-record-header__icon-btn i {
    display: flex;
    line-height: 1;
}

/* Optional description, sitting under the identity bar and above the tabs. Muted
   and indented to line up with the identity, so it reads as record context. */
.opportunities-record-header__desc {
    padding: 0 var(--spacing-md) var(--spacing-smd);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.opportunities-record-header__desc :last-child {
    margin-bottom: 0;
}

/* Opportunity identity — service · detail · recipient. Shared by the in-page record
   header and the gear drawer's out-of-band refresh. All three items share the
   service-type heading font so the line reads as one title; a dimmed · separates them. */
.opportunities-detail__identity {
    display: inline-flex;
    align-items: baseline;
    gap: var(--spacing-sm);
    min-width: 0;
    overflow: hidden;
    vertical-align: middle;
    color: var(--sidebar-text);
}

/* On the light content surface (round 7) the identity uses the normal text color and
   is free to use the full width the record header gives it. */
.opportunities-detail__identity--inpage {
    color: var(--color-text);
    max-width: none;
}

/* One uniform treatment for all three items — same heading font as the service type
   (Nick, 2026-06: "use the service type font for everything"). */
.opportunities-detail__identity-service,
.opportunities-detail__identity-detail,
.opportunities-detail__identity-recipient {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-large-title);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: var(--font-size-page-title);
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* The service type never truncates; the detail and recipient yield first when narrow. */
.opportunities-detail__identity-service {
    flex-shrink: 0;
}

/* Dimmed · before every item after the service type (always first), so any present
   subset of {detail, recipient} stays correctly punctuated with no leading dot. */
.opportunities-detail__identity > span:not(:first-child)::before {
    content: "·";
    margin-right: var(--spacing-sm);
    opacity: 0.5;
}

/* The two sentence-case title styles (title_style client_over_service and
   service_over_client): a big line, then a small muted line under it, no dot.
   Keyed on the big line being there, so the wrapper keeps the one class it has
   in the header and in the gear's out-of-band refresh. Each selector is two
   classes deep, which outranks the phone block's running-text rule for the caps
   line without a phone rule of its own. */
.opportunities-detail__identity:has(> .opportunities-detail__identity-big) {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    max-width: 100%;
}

.opportunities-detail__identity > .opportunities-detail__identity-big,
.opportunities-detail__identity > .opportunities-detail__identity-small {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: none;
    letter-spacing: normal;
}

.opportunities-detail__identity > .opportunities-detail__identity-big {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-heading);
    font-size: var(--font-size-h3);
    line-height: var(--line-height-heading);
    color: var(--color-text);
}

.opportunities-detail__identity > .opportunities-detail__identity-small {
    font-family: inherit;
    font-weight: normal;
    font-size: var(--font-size-sm);
    line-height: var(--line-height);
    color: var(--color-text-secondary);
}

.opportunities-detail__identity > .opportunities-detail__identity-small:not(:first-child)::before {
    content: none;
}

/* Role roster — one tidy list: a row per role, split by hairlines, no card around
   each row (Nick's pick for the booking page redesign). */
.opportunities-detail__roles {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    padding: var(--spacing-xs) var(--spacing-md);
}

/* Each role is one row: a face + name on the left, a due/open pill in the middle,
   the pay number and Remove on the right. Any warning wraps to a full-width line
   beneath. Appearance (flex internals, colors, fonts) lives in the per-part rules
   further down; only layout is grouped here. */
.opportunities-detail__role-tile {
    /* Containing block for .opportunities-detail__role-trigger, the overlay that makes the
       whole row open the edit drawer. */
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    column-gap: var(--spacing-sm);
    row-gap: var(--spacing-xsm);
    padding: var(--spacing-smd) var(--spacing-xs);
    border: 0;
    border-bottom: 1px solid var(--color-grey-100);
    background: var(--color-card-bg);
    transition: background-color 0.15s ease;
}

.opportunities-detail__role-tile:last-child {
    border-bottom: 0;
}

/* ── The row as a control ─────────────────────────────────────────────────
   A coordinator's roster row opens the edit drawer focused on its own role, so
   the row itself has to look and behave like something you can click — the two
   far-right buttons that used to do this are gone (Nick, 07-31).

   The trigger is a real, empty <button> stretched over the tile by inset: 0.
   Absolutely positioned, so it takes no grid cell; transparent, so the row still
   reads as a row. It comes FIRST in the tile's source order, which is what lets
   every positioned thing after it — the name link, the waiting link, the bill
   pill, Remove — paint on top and keep its own click without a z-index anywhere.
   Anything in the row that is NOT positioned falls through to this on purpose. */
.opportunities-role-tile--clickable {
    cursor: pointer;
}

/* The hover has to be legible, not merely present: the row is now the only way
   into a role's details, so a tinted border alone (which is all the base tile
   hover a few rules up gives every row, clickable or not) does not say "this
   one opens". Selector carries the tile class as well so it outranks the
   --filled / --open / --mine background rules further down the file.

   The tint is LAYERED, not swapped: background-image paints above
   background-color, so hovering a row that already carries a state colour —
   mine, available — tints it without costing it that colour. */
.opportunities-detail__role-tile.opportunities-role-tile--clickable:hover {
    background-image: linear-gradient(
        var(--ink-alpha-05),
        var(--ink-alpha-05)
    );
}

.opportunities-detail__role-trigger {
    position: absolute;
    inset: 0;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

/* The ring belongs on the tile's outline, not on a transparent rectangle nobody
   can see — inheriting the radius is what makes the two agree. */
.opportunities-detail__role-trigger:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
    border-radius: inherit;
}

/* Above the overlay (paint order, no z-index): each of these goes somewhere the
   edit drawer does not. The static pay pill is deliberately absent — clicking a
   number that nothing else owns should open the row like the rest of it.
   (The tooltip bubble itself is the shared portal, position:fixed on <body> —
   it neither needs nor is affected by these positioning contexts.) */
.opportunities-detail__role-namelink,
.opportunities-detail__role-waiting,
.opportunities-detail__role-pay.global-value-pill--interactive {
    position: relative;
}

.opportunities-detail__role-identity {
    grid-column: 1;
    grid-row: 1;
}

/* The status pill (a filled role's due date, an open role's waiting count)
   sits between the identity and the actions. */
.opportunities-detail__role-due,
.opportunities-detail__role-waiting {
    grid-column: 2;
    grid-row: 1;
}

.opportunities-detail__role-actions {
    grid-column: 3;
    grid-row: 1;
}

/* The coordinator's overflow kebab takes a FOURTH column, which the tile never
   declares. That is deliberate: an implicit track only exists on the rows that put
   something in it, so a role with no kebab — open, worker view, no approved
   assignment — keeps the three-column tile it had and no fourth gap opens under it.
   Declaring a fourth `auto` column up in grid-template-columns instead would spend a
   column-gap on every roster row whether or not it had a menu.

   It needs no `position: relative` of its own to clear the stretched row overlay:
   .global-action-dropdown already sets it, which is also what its menu positions against.
   The two are one dependency, not two — if that ever went static the menu would
   escape its anchor at the same moment the kebab fell behind the overlay. */
.opportunities-detail__role-menu {
    grid-column: 4;
    grid-row: 1;
}

.opportunities-detail__role-warning {
    grid-column: 1 / -1;
}

.opportunities-detail__role-tile.opportunities-role-tile--filled {
    background: var(--color-card-bg);
}

.opportunities-detail__role-tile.opportunities-role-tile--mine {
    background: var(--role-tile-mine-bg, color-mix(in srgb, var(--color-action) 10%, white));
    border-color: color-mix(in srgb, var(--color-action) 30%, var(--color-grey-200));
}

.opportunities-detail__role-tile.opportunities-role-tile--open {
    background: var(--color-card-bg);
}

.opportunities-detail__role-identity {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 0;
    flex: 1;
}

.opportunities-detail__role-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.opportunities-detail__role-name {
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-md);
    color: var(--color-text);
    line-height: 1.2;
}

.opportunities-detail__role-worker-name {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The name goes to the role's own assignment page. It sits above the tile's
   trigger overlay (see .opportunities-detail__role-trigger) so the two destinations stay
   distinct: the name for this role's page, the rest of the row for the drawer. */
.opportunities-detail__role-namelink {
    display: inline-flex;
    flex-direction: column;
    min-width: 0;
    text-decoration: none;
    color: inherit;
    border-radius: 4px;
}

.opportunities-detail__role-namelink:hover .opportunities-detail__role-name,
.opportunities-detail__role-namelink:focus-visible .opportunities-detail__role-name {
    color: var(--color-action);
    text-decoration: underline;
}

.opportunities-detail__role-namelink:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

/* ── Roster avatars — a 52px face leads each row ─────────────────────────── */
.opportunities-detail__role-avatar {
    width: 52px;
    height: 52px;
    font-size: var(--font-size-lg);
    flex-shrink: 0;
}

/* No photo on file → ink-tinted initials. */
.opportunities-detail__role-avatar--initials {
    background: var(--color-action-tint-pressed);
    color: var(--color-action);
}

/* A teammate's filled role in the worker view — a neutral check, never a face. */
.opportunities-detail__role-avatar--filled {
    background: var(--color-action-tint-pressed);
    color: var(--color-action);
    font-size: var(--font-size-xl);
}

/* Open role — a dashed empty circle with a plus. */
.opportunities-detail__role-avatar--empty {
    background: transparent;
    border: 2px dashed var(--role-tile-open-border, #d1d5db);
    color: var(--color-grey-500);
    font-size: var(--font-size-xl);
}

/* Filled row: worker name is the primary bold line, role name the muted line beneath. */
.opportunities-detail__role-worker-name--primary {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.opportunities-detail__role-name--primary {
    font-size: var(--font-size-lg);
}

.opportunities-detail__role-name--secondary {
    font-weight: 400;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* Due-date pill on a filled row — fully written out (day, month, year, time). */
.opportunities-detail__role-due {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* Open role: skill-requirement chips in brand tokens. */
.opportunities-detail__role-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-xs);
}

/* One quiet count of who's waiting for approval — amber/pending token, no names.
   A plain link to the signup dashboard, where approvals actually happen. */
.opportunities-detail__role-waiting {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0.0625rem var(--spacing-xsm);
    border-radius: 0.625rem;
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
    text-decoration: none;
    color: var(--color-warning);
    background: color-mix(in srgb, var(--color-warning) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-warning) 25%, transparent);
}

.opportunities-detail__role-waiting:hover,
.opportunities-detail__role-waiting:focus-visible {
    background: color-mix(in srgb, var(--color-warning) 20%, transparent);
}

.opportunities-detail__role-waiting:focus-visible {
    outline: 2px solid var(--color-warning);
    outline-offset: 2px;
}

/* An unfilled role with nobody waiting: state, not a destination. Same pill shape
   as the waiting count so the middle column keeps one silhouette, in muted tokens
   because there is nothing here to act on — the row itself is the action. */
.opportunities-detail__role-status {
    grid-column: 2;
    grid-row: 1;
    display: inline-flex;
    align-items: center;
    padding: 0.0625rem var(--spacing-xsm);
    border-radius: var(--radius-pill);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
    color: var(--color-text-muted);
    background: var(--ink-alpha-05);
    border: 1px solid var(--color-grey-200);
}

/* Round 7 Option B: a plain footer link from the pure-display roster to the signup
   dashboard, where open roles get filled and pending sign-ups are reviewed. */
.opportunities-detail__roster-manage {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xsm);
    margin: var(--spacing-xs) var(--spacing-smd) var(--spacing-smd);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    color: var(--color-action);
}

.opportunities-detail__roster-manage:hover,
.opportunities-detail__roster-manage:focus-visible {
    text-decoration: underline;
}

.opportunities-detail__roster-manage:focus-visible {
    outline: 2px solid var(--color-action);
    outline-offset: 2px;
    border-radius: var(--radius-md);
}

/* Availability highlight (worker view, plugin-gated) — soft tint + "Available" tag. */
.opportunities-detail__role-tile.opportunities-role-tile--available {
    background: var(--color-availability-bg);
    border-color: var(--color-availability);
}

.opportunities-role-tile__available-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-2xs);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-availability);
}

.opportunities-detail__role-warning {
    font-size: var(--font-size-xs);
    color: var(--color-warning);
}

/* Right-side cell: the pay pill, alone. The pill is a static number unless the role
   has a bill, in which case it opens that bill's drawer; setting pay is what clicking
   the row does now, so no "Set pay" button lives here. Shared with the referrer card,
   which still uses the icon buttons.

   Remove came back on 08-07 but not into this cell — it is an item inside the kebab
   in the next column over, which is gated on the coordinator rather than on the
   payments plugin this container is gated on. */
.opportunities-detail__role-actions {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
    flex-shrink: 0;
}

/* How often an ongoing seat pays, beside its pay: "$200 Monthly". A quiet word so
   the number stays the thing the eye lands on. */
.opportunities-detail__role-cadence {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    white-space: nowrap;
}

/* Quiet by default, chrome on hover. The row itself is the loud affordance here —
   a kebab wearing the component's default white fill and border would read as the
   tile's primary control and compete with it. Borrowed from the pipeline band's
   kebab, which sits on a busy surface for the same reason. Border stays declared at
   full width in both states so gaining chrome on hover does not shift the row. */
.opportunities-detail__role-menu-toggle {
    background: transparent;
    border-color: transparent;
    color: var(--color-text-light);
    line-height: 1;
}

.opportunities-detail__role-menu-toggle:hover,
.opportunities-detail__role-menu-toggle[aria-expanded="true"] {
    background: var(--color-grey-50);
    border-color: var(--color-border);
    color: var(--color-text-muted);
}

/* The muted second line — "role · pay" (filled) or "pay · skill chips" (open). */
.opportunities-detail__role-subline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-xsm);
    min-width: 0;
}

/* The row's extra facts from the gear's Roster rows (time, where, scope of work):
   a quiet third line of small label and value pairs. Empty when the role template
   shows none of them. */
.opportunities-detail__role-facts {
    display: flex;
    flex-wrap: wrap;
    column-gap: var(--spacing-smd);
    row-gap: var(--spacing-2xs);
    margin-top: var(--spacing-2xs);
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    min-width: 0;
}

.opportunities-detail__role-facts:empty {
    display: none;
}

.opportunities-detail__role-fact {
    min-width: 0;
    overflow-wrap: anywhere;
}

.opportunities-detail__role-fact-label {
    color: var(--color-text-muted);
}

/* Icon button base. The referrer card is the only consumer left: the roster tile's
   copy/edit buttons went in round 7 Option B, and Remove — its last one — went on
   08-01. Kept because the referrer card still renders two of these. */
.opportunities-detail__role-icon-btn {
    font-size: var(--font-size-md);
    transition: color 0.15s ease, background 0.15s ease;
}

.opportunities-detail__role-icon-btn:hover,
.opportunities-detail__role-icon-btn:focus-visible {
    color: var(--color-action);
    background: var(--color-action-tint-pressed);
}

.opportunities-detail__role-icon-btn:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 1px;
}

.opportunities-props__section-label {
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.8px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    margin-bottom: var(--spacing-smd);
    padding-bottom: var(--spacing-xsm);
    border-bottom: 1px solid var(--color-grey-100);
}

.opportunities-props__field-group {
    margin-bottom: var(--spacing-xs);
}

.opportunities-props__field-label {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-grey-500);
    margin-bottom: var(--spacing-2xs);
}

.opportunities-props__field-readonly {
    font-size: var(--font-size-md);
    color: var(--color-grey-800);
    padding: var(--spacing-xsm) var(--spacing-sm);
    min-height: var(--control-h-base);
    display: flex;
    align-items: center;
    cursor: default;
}

/* A read-only value that points somewhere -- an order number that opens the
   order it names. It has to read as a link, and the block above paints every
   read-only value flat grey with a default cursor, so this says otherwise. */
.opportunities-props__field-readonly--link {
    color: var(--color-action);
    cursor: pointer;
    text-decoration: underline;
    gap: var(--spacing-2xs);
}

.opportunities-props__field-readonly--link:hover {
    color: var(--color-action-hover);
}

.opportunities-props__field-readonly--link .bi {
    font-size: var(--font-size-xs);
    text-decoration: none;
}

/* Properties fixed by the member's access (opportunity form). A quiet
   read-only block: lock + heading, then label/value pairs. */
.opportunities-pinned {
    border: 1px solid var(--color-border-subtle);
    background: var(--color-surface-subtle);
    border-radius: var(--radius-md);
    padding: var(--spacing-smd) var(--spacing-smd);
}

.opportunities-pinned__head {
    display: flex;
    align-items: center;
    gap: var(--spacing-xsm);
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-sm);
}

.opportunities-pinned__rows {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm) var(--spacing-mdlg);
}

.opportunities-pinned__row {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
}

.opportunities-pinned__label {
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.opportunities-pinned__value {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
}

.opportunities-props__field-editable {
    font-size: var(--font-size-md);
    color: var(--color-grey-800);
    padding: var(--spacing-2xs) var(--spacing-xs);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: text;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    min-height: var(--control-h-base);
    display: flex;
    align-items: center;
}

.opportunities-props__field-editable:hover {
    background: var(--color-grey-100);
    border-color: var(--color-grey-200);
}

.opportunities-props__field-editable:focus-within {
    background: white;
    border-color: var(--color-action-hover);
    box-shadow: 0 0 0 2px var(--ink-alpha-15);
}

.opportunities-props__field-editable input,
.opportunities-props__field-editable select,
.opportunities-props__field-editable textarea {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-size: var(--font-size-md);
    color: var(--color-grey-800);
    padding: var(--spacing-xs) var(--spacing-xs);
    font-family: inherit;
}

.opportunities-props__field-editable textarea {
    resize: vertical;
    min-height: 60px;
    padding-top: var(--spacing-xsm);
}

/* Save indicator — copied exactly from public-form.css (lines 614-668) */
.opportunities-save-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xsm);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    transition: color 0.25s ease;
}

.opportunities-save-indicator::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-text-muted);
    flex-shrink: 0;
    transition: background 0.25s ease;
}

.opportunities-save-indicator--saving {
    color: var(--color-text-muted);
}

.opportunities-save-indicator--saving::before {
    background: var(--color-text-muted);
    animation: pulse-save 1.2s ease-in-out infinite;
}

.opportunities-save-indicator--saved {
    color: var(--color-success);
}

.opportunities-save-indicator--saved::before {
    background: var(--color-success);
}

.opportunities-save-indicator--error {
    color: var(--color-error);
}

.opportunities-save-indicator--error::before {
    background: var(--color-error);
}

@keyframes pulse-save {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.4; transform: scale(0.8); }
}

/* ── Pipeline stage band (PR2 detail redesign) ─────────────────────────────
   Slim advance band at the top of the Pipeline card. Markup lives in
   app/opportunities/_pipeline_stage_band.html. */
.opportunities-pipe-band {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
    flex-wrap: wrap;
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--color-grey-100);
}
.opportunities-pipe-band__action {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}
/* Force Advance is demoted into an overflow menu — a quiet kebab, never a primary
   affordance. Resolving the blocker is the loud path (the blocked list below). */
.opportunities-pipe-band__overflow-toggle {
    padding: var(--spacing-xs) var(--spacing-xsm);
    line-height: 1;
}
/* Blocked callout takes the full band width (it wraps under the progress readout)
   and lists the exact steps left, each a link that jumps to it in the checklist. */
.opportunities-pipe-band__blocked {
    flex-basis: 100%;
    font-size: var(--font-size-xs);
    color: var(--color-warning);
    background: color-mix(in srgb, var(--color-warning) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-warning) 25%, transparent);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-sm);
}
.opportunities-pipe-band__blocked-head {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}
.opportunities-pipe-band__blocked-head strong {
    color: var(--color-warning);
}
.opportunities-pipe-band__blockers {
    list-style: none;
    margin: var(--spacing-xsm) 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}
.opportunities-pipe-band__blocker {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--spacing-xsm);
}
.opportunities-pipe-band__blocker-link {
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    text-decoration: underline;
}
.opportunities-pipe-band__blocker-hint {
    color: var(--color-text-muted);
}
/* The :target highlight for a blocked step lives with the checklist's own
   rules in components/milestone-checklist.css. */

/* ── Gallery export strip ────────────────────────────────────────────────────
   One quiet line at the top of the Pipeline card: where the gallery export
   stands, and a button wearing the export automation's name when a person
   may ask again.
   Markup lives in app/opportunities/_gallery_export_strip.html. */
.opportunities-export-strip {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--color-grey-100);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}
.opportunities-export-strip__text {
    margin: 0;
    flex: 1 1 12rem;
    min-width: 0;
}
.opportunities-export-strip__button {
    margin-left: auto;
}
.opportunities-export-strip__dot {
    flex: 0 0 auto;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: var(--radius-pill);
    background: var(--color-grey-300);
}
.opportunities-export-strip--queued .opportunities-export-strip__dot,
.opportunities-export-strip--exporting .opportunities-export-strip__dot {
    background: var(--color-warning);
}
.opportunities-export-strip--done .opportunities-export-strip__dot {
    background: var(--color-success);
}
.opportunities-export-strip--failed {
    color: var(--color-error);
}
.opportunities-export-strip--failed .opportunities-export-strip__dot {
    background: var(--color-error);
}
/* Every export so far, folded under the strip; rows are the shared
   global-run-history component. */
.opportunities-export-strip__history {
    padding: 0 var(--spacing-md) var(--spacing-sm);
    border-bottom: 1px solid var(--color-grey-100);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}
.opportunities-export-strip__history > summary {
    cursor: pointer;
    padding: var(--spacing-xs) 0;
}

/* ── Pipeline Milestones card — clickable stage band (PR4) ──────────────────
   Every stage is a real, keyboard-focusable button; clicking one shows that
   stage's milestone pane (Alpine x-show). Brand tokens only per ADR-124; no
   disabled state per ADR-043 — future stages stay clickable, just read-only. */
.opportunities-stageflow {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xsm);
    padding: var(--spacing-sm) var(--spacing-smd);
    border-bottom: 1px solid var(--color-grey-100);
}
.opportunities-stageflow__stage {
    /* Reset the native button so it reads as a stage chip. */
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--color-border);
    background: var(--color-card-bg);
    border-radius: var(--radius-pill);
    /* 44px minimum tap target — accessible on touch. */
    min-height: var(--control-h-touch);
    padding: var(--spacing-xs) var(--spacing-smd);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    color: var(--color-text);
    text-align: left;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.opportunities-stageflow__stage:hover {
    border-color: var(--color-action);
}
.opportunities-stageflow__stage:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}
.opportunities-stageflow__stage--selected {
    background: var(--ms-active-soft);
    border-color: var(--ms-active);
    box-shadow: 0 0 0 3px var(--ms-active-ring);
}
.opportunities-stageflow__marker {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    border: 1.5px solid var(--ms-pending);
    background: var(--color-card-bg);
    color: var(--color-grey-600);
}
.opportunities-stageflow__stage--done .opportunities-stageflow__marker {
    background: var(--ms-done);
    border-color: var(--ms-done);
    color: var(--color-card-bg);
}
.opportunities-stageflow__stage--current .opportunities-stageflow__marker {
    border-color: var(--ms-active);
    background: var(--ms-active-soft);
}
.opportunities-stageflow__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ms-active);
    box-shadow: 0 0 0 3px var(--ms-active-ring);
}
.opportunities-stageflow__body {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}
.opportunities-stageflow__name {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    letter-spacing: .01em;
}
.opportunities-stageflow__stage--future .opportunities-stageflow__name {
    color: var(--color-grey-500);
}
/* The current stage's pane holds full-bleed components (the advance band and
   the milestone list, which self-pad), so the pane itself stays flush. */
.opportunities-stage-pane {
    padding: 0;
}
.opportunities-stage-milestone-list {
    list-style: none;
    padding: var(--spacing-sm) var(--spacing-md);
    margin: 0;
}
.opportunities-stage-milestone-row {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-xsm) 0;
}
.opportunities-stage-milestone-row--done {
    opacity: .6;
}
/* Read-only status circle — the canonical .global-status-dot atom (--sm);
   only its optical alignment with the first line of the name is local. */
.opportunities-stage-milestone-row__dot {
    margin-top: var(--spacing-2xs);
}
.opportunities-stage-milestone-body {
    flex: 1;
    min-width: 0;
}
.opportunities-stage-milestone-name {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: var(--spacing-xsm);
    flex-wrap: wrap;
}
.opportunities-stage-milestone-row--done .opportunities-stage-milestone-name {
    color: var(--color-grey-600);
}
.opportunities-stage-milestone-row--skipped .opportunities-stage-milestone-name {
    text-decoration: line-through;
    text-decoration-color: var(--color-grey-500);
}
.opportunities-stage-milestone-meta {
    font-size: var(--font-size-2xs);
    margin-top: .0625rem;
}

.opportunities-stage-milestone-optional {
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--color-grey-500);
    background: var(--color-grey-100);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    padding: .0625rem var(--spacing-xsm);
    line-height: 1.4;
}

/* ── Event reschedule history timeline (Events card) ────────────────────────
   Moved out of the detail.html inline <style> block; hardcoded hex converted to
   brand tokens per ADR-124. A dotted vertical track of past/current bookings. */
.global-hist {
    margin-left: var(--spacing-2xs);
}
.global-hist__row {
    display: flex;
    gap: var(--spacing-sm);
    min-height: 1.375rem;
}
.global-hist__track {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 0.625rem;
    flex-shrink: 0;
}
.global-hist__dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: var(--spacing-xs);
}
.global-hist__line {
    width: 1px;
    flex: 1;
    background: var(--color-grey-200);
    margin: 0.0625rem 0;
}
.global-hist__dot--ok {
    background: var(--color-success);
}
.global-hist__dot--moved {
    background: var(--color-warning);
}
.global-hist__dot--cancel {
    background: var(--color-error);
}
.global-hist__dot--pending {
    background: var(--event-color);
}
.global-hist__body {
    font-size: var(--font-size-xs);
    color: var(--color-text);
    padding-bottom: var(--spacing-2xs);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-xs);
}
.global-hist__date {
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
}
.global-hist__time {
    color: var(--color-grey-600);
}
.global-hist__actor {
    font-size: var(--font-size-2xs);
    color: var(--color-text-muted);
}

/* ==========================================================================
   Sidebar cards — Contact · Events · Forms · Attachments (PR4 detail redesign)
   Restyled onto the roster's card + type-scale language: brand tokens only
   (ADR-124), the --font-size-* scale (no ad-hoc rem), and ≥44px tap targets
   for anything a finger touches.
   ========================================================================== */

/* Email + phone are tappable rows — 44px tall so a finger lands them cleanly. */
.opportunities-detail__contact-link {
    display: flex;
    align-items: center;
    min-height: var(--control-h-touch);
    font-size: var(--font-size-lg);
    text-decoration: none;
}

.opportunities-detail__events {
    overflow: hidden;
}

/* Every finger control in the events list clears 44px; icon-only ones stay square. */
.opportunities-detail__events .btn {
    min-height: var(--control-h-touch);
}

.opportunities-detail__events .global-header-btn-icon {
    min-width: 44px;
    min-height: var(--control-h-touch);
}

/* ── Meeting card (round 7) ─────────────────────────────────────────────────
   A meeting row is now a proper card: a stacked month/day date block on the
   left, title · time · location in the middle, and tidy icon actions on the
   right. Replaces the old dense row (2xs mini-buttons + address-as-a-button). */
.opportunities-meeting {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-smd);
}

/* Left date block — brand-tinted, month abbreviation over the day number. */
.opportunities-meeting__date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 3rem;
    padding: var(--spacing-xsm) 0;
    border-radius: var(--radius-md);
    background: var(--color-action-tint-pressed);
    color: var(--color-action);
    line-height: 1.05;
}

.opportunities-meeting__date-mon {
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.opportunities-meeting__date-day {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
}

.opportunities-meeting__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
}

.opportunities-meeting__title {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.opportunities-meeting__time {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xsm);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.opportunities-meeting__time i {
    font-size: 0.85em;
    opacity: 0.75;
}

/* Location — muted text a coordinator taps to edit (opens the address modal).
   Reads as a plain line, not a button; underlines on hover to signal it's editable.
   A reader who cannot edit it — a planner here on agenda:write — gets the same
   line as a <span> carrying --static, which takes the affordances back off. */
.opportunities-meeting__loc {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xsm);
    align-self: flex-start;
    min-height: 32px;
    max-width: 100%;
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    cursor: pointer;
}

.opportunities-meeting__loc i {
    font-size: 0.85em;
    opacity: 0.75;
    flex-shrink: 0;
}

.opportunities-meeting__loc span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Hover says "this is editable", so it is written to exclude the static line
   rather than to be undone below it — an override would be one rule move away
   from silently offering an edit that is not on the page. */
.opportunities-meeting__loc:not(.opportunities-meeting__loc--static):hover {
    color: var(--color-text);
}

.opportunities-meeting__loc:not(.opportunities-meeting__loc--static):hover span {
    text-decoration: underline;
}

.opportunities-meeting__loc--static {
    cursor: default;
}

/* Right-side actions — status pills plus square 44px icon buttons for Meet /
   Reschedule. Icon-only (no more 2xs text mini-buttons). */
.opportunities-meeting__actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xsm);
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.opportunities-meeting__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: var(--control-h-touch);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-grey-200);
    background: var(--color-card-bg);
    color: var(--color-text-muted);
    font-size: var(--font-size-md);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.opportunities-meeting__action:hover,
.opportunities-meeting__action:focus-visible {
    background: var(--color-action-tint-pressed);
    border-color: var(--color-action);
    color: var(--color-action);
}

/* Event + history pills reuse the shared .global-badge family, sized down and
   left in normal case to fit these dense rows. */
.opportunities-meeting__actions .global-badge,
.global-hist__body .global-badge {
    font-size: var(--font-size-2xs);
    padding: 0.0625rem var(--spacing-xsm);
    text-transform: none;
}

/* One card per assigned form, stacked full-width so each reads as its own
   surface — matches the role roster's card language. */
.opportunities-detail__form-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-smd);
    padding: var(--spacing-md);
}

.opportunities-detail__form-card {
    padding: var(--spacing-smd);
    border: 1px solid var(--color-grey-200);
    border-radius: var(--radius-md);
    background: var(--color-card-bg);
}

.opportunities-detail__form-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-sm);
}

.opportunities-detail__form-name {
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-md);
    color: var(--color-text);
}

/* The recipient line is a global-person-chip --micro (components/person-chip.css).
   Only the type scale is local: this card reads its recipient one step larger. */
.opportunities-detail__form-recipient {
    font-size: var(--font-size-sm);
}

/* The boxed "Goes to" recipient email on the assign form. This rule was
   co-deleted when the forms card absorbed the chip, but the assign-form markup
   still renders `.opportunities-detail__form-email` (its stray chip edit was reverted as
   out-of-scope), so the rule is restored to keep the email small + grey. */
.opportunities-detail__form-email {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--color-grey-500);
}

.opportunities-detail__form-tag {
    display: inline-flex;
    align-items: center;
}

.opportunities-detail__form-tag--contact {
    background: color-mix(in srgb, var(--color-info) 12%, transparent);
    color: var(--color-info);
}

.opportunities-detail__form-tag--role {
    background: color-mix(in srgb, var(--color-success) 12%, transparent);
    color: var(--color-success);
}

.opportunities-detail__form-state {
    margin-top: var(--spacing-sm);
    font-size: var(--font-size-xs);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.opportunities-detail__form-state-label {
    font-weight: var(--font-weight-medium);
}

.opportunities-detail__form-state-label--done {
    color: var(--color-success);
}

.opportunities-detail__form-state-label--progress {
    color: var(--color-action);
}

.opportunities-detail__form-state-label--waiting {
    color: var(--color-warning);
}

/* Progress track for the in-progress "N of M answered" bar. */
.opportunities-detail__form-progress {
    margin-top: var(--spacing-sm);
    height: 6px;
    border-radius: var(--radius-pill);
    background: var(--color-grey-200);
    overflow: hidden;
}

.opportunities-detail__form-progress-fill {
    display: block;
    height: 100%;
    border-radius: var(--radius-pill);
    background: var(--color-action);
}

.opportunities-detail__form-sub {
    margin-top: var(--spacing-xsm);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.opportunities-detail__form-action {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-action);
    text-decoration: none;
}

.opportunities-detail__form-action:hover {
    text-decoration: underline;
}

/* Read-only "Goes to: client" row in the assign drawer. */
.opportunities-assign__goesto {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-smd);
    border: 1px solid var(--color-grey-200);
    border-radius: var(--radius-md);
    background: var(--color-surface-subtle);
    font-size: var(--font-size-sm);
    color: var(--color-text);
}

.opportunities-detail__form-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: var(--spacing-xsm);
}

.opportunities-detail__form-dot--submitted {
    background: var(--color-success);
}

.opportunities-detail__form-dot--pending {
    background: var(--color-warning);
}

/* ── Files card (round 7) ───────────────────────────────────────────────────
   Nick: the files area is centered, with a generous drag-and-drop upload band at
   the top and the file cards centered below. The whole area is capped and centered
   inside the card. */
.opportunities-detail__files {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--spacing-md);
}

/* Upload band — a big dashed dropzone that opens the existing add-files modal
   (click/drop both route to the same flow; no new upload backend). Generous height
   so it reads as a real drop target, not the old cramped add-card. */
.opportunities-detail__file-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xsm);
    width: 100%;
    min-height: 168px;
    padding: var(--spacing-lg);
    border: 2px dashed var(--color-grey-300);
    border-radius: var(--radius-card);
    background: var(--color-surface-subtle);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.opportunities-detail__file-dropzone:hover,
.opportunities-detail__file-dropzone:focus-visible {
    border-color: var(--color-action);
    background: var(--color-action-tint-pressed);
    color: var(--color-action);
}

.opportunities-detail__file-dropzone-icon {
    font-size: 2rem;
    line-height: 1;
}

.opportunities-detail__file-dropzone-label {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.opportunities-detail__file-dropzone:hover .opportunities-detail__file-dropzone-label,
.opportunities-detail__file-dropzone:focus-visible .opportunities-detail__file-dropzone-label {
    color: var(--color-action);
}

.opportunities-detail__file-dropzone-hint {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* Matches the Forms-tab card language (grid of bordered cards). Each file card
   leads with a type-tinted preview band whose glyph carries the meaning; the
   tint just groups by kind, mapped onto existing semantic tokens (no new hex
   per ADR-124). Base rule is shared with the workers files card, so it is left
   unchanged; the opportunity Files tab tweaks layout via the scoped rule below. */
.opportunities-detail__file-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-smd);
    padding: var(--spacing-md);
}

/* On the opportunity Files tab the cards sit inside the centered .opportunities-detail__files
   wrapper (which supplies the padding), below the upload band. */
.opportunities-detail__files .opportunities-detail__file-cards {
    padding: 0;
    margin-top: var(--spacing-md);
}

.opportunities-detail__file-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-grey-200);
    border-radius: var(--radius-md);
    background: var(--color-card-bg);
    overflow: hidden;
}

.opportunities-detail__file-preview {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xl);
    background: var(--color-grey-100);
    color: var(--color-grey-600);
}

.opportunities-detail__file-preview--pdf {
    background: color-mix(in srgb, var(--color-error) 10%, transparent);
    color: var(--color-error);
}

.opportunities-detail__file-preview--image,
.opportunities-detail__file-preview--sheet {
    background: color-mix(in srgb, var(--color-success) 10%, transparent);
    color: var(--color-success);
}

.opportunities-detail__file-preview--doc {
    background: color-mix(in srgb, var(--color-info) 10%, transparent);
    color: var(--color-info);
}

.opportunities-detail__file-preview--link {
    background: color-mix(in srgb, var(--color-action) 10%, transparent);
    color: var(--color-action);
}

.opportunities-detail__file-preview--other {
    background: var(--color-grey-100);
    color: var(--color-grey-600);
}

.opportunities-detail__file-body {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    padding: var(--spacing-smd);
}

.opportunities-detail__file-name {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The uploader line is a global-person-chip --micro (components/person-chip.css);
   the atom carries the whole layout, so nothing is left to declare here. */

.opportunities-detail__file-sub {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.opportunities-detail__file-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-xsm);
}

.opportunities-detail__file-action {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-action);
    text-decoration: none;
}

.opportunities-detail__file-action:hover {
    text-decoration: underline;
}

/* Remove stays a full-color action here (unlike the old hover-reveal row) —
   the card already scopes it, and it never disables per ADR-043. */
.opportunities-detail__file-remove {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    border: none;
    background: none;
    padding: 0;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-error);
    cursor: pointer;
}

.opportunities-detail__file-remove:hover {
    text-decoration: underline;
}

/* ── Event address modal — mobile-safe widths + tap targets ────────────────── */
.opportunities-detail__modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--color-scrim);
    z-index: var(--z-popover);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* No fixed px width — fill the viewport up to a cap, with a margin so the card
   never touches the screen edge on a phone. */
.opportunities-detail__modal-card {
    width: 100%;
    max-width: 460px;
    margin: var(--spacing-md);
    border-radius: var(--radius-lg);
}

/* ==========================================================================
   Tab shell (opportunity detail redesign)
   The old two-column card stack now sits behind six tabs in one column. The tab
   strip is the platform-wide `.global-tabs` component (components/page-tabs.css);
   the record header, the strip, and the active pane read as ONE bordered card.
   ========================================================================== */

/* The active pane is the content section of the one card — no frame of its own;
   the shell supplies the border and rounded bottom. Hidden panes are display:none,
   so only the open one draws. */
.opportunities-tab-pane {
    display: flex;
    flex-direction: column;
}

/* The first-level card inside a pane loses its own chrome so it sits flush on the
   shell surface — no box-in-a-box, no stray inner border. It keeps its background
   and its card-body padding, so content still breathes. Nested sub-cards (role
   tiles, etc.) keep theirs. */
.opportunities-tab-pane > .card {
    border: none;
    box-shadow: none;
    border-radius: var(--radius-none);
    margin-bottom: 0;
}

/* Slim per-pane toolbar — the tab already names the pane, so this row drops the
   old card-header title and carries only the pane's actions, right-aligned. */
.opportunities-pane-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: var(--spacing-xsm);
    padding: var(--spacing-sm) var(--spacing-smd);
}

/* Schedule toolbar runs switch / summary / actions. The summary takes the slack
   so the bar has no gutter to leave empty: `space-between` across two items on a
   wide pane pushed them to opposite walls with ~1000px of nothing between. */
.opportunities-pane-toolbar--split {
    justify-content: flex-start;
}

/* The line that fills that space. It yields to both neighbours — they are fixed
   controls and it is prose, so it is the one that should ellipsize on a narrow
   pane rather than wrapping the buttons onto a second row. */
.opportunities-pane-toolbar__summary {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0 var(--spacing-sm);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.opportunities-pane-toolbar__actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xsm);
    flex-shrink: 0;
}

/* Schedule view switch — a segmented control that flips the pane between
   Calendar (the default) and List. Built as a track that holds more than one
   pill; when the timeslot plugin is off the calendar payload is absent and List
   is the lone segment. */
.opportunities-segview {
    display: inline-flex;
    flex-shrink: 0;
    gap: var(--spacing-2xs);
    padding: var(--spacing-2xs);
    /* The shared segmented track (.global-segmented). The thumb rides above it
       on its own shadow. */
    background: var(--color-surface-subtle);
    border-radius: var(--radius-md);
}

/* Full text colour, not muted: these are the two places you can go, and a
   greyed-out word reads as a door that is shut. Only the thumb says which one
   you are on. */
.opportunities-segview__btn {
    padding: var(--spacing-xs) var(--spacing-smd);
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-button);
    cursor: pointer;
}

.opportunities-segview__btn:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
    border-radius: 4px;
}

/* The thumb: lifted off the track by shadow alone. A border would draw a second
   edge inside the track's own and the control would read as a box in a box. */
.opportunities-segview__btn--active {
    background: var(--color-card-bg);
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
}

/* Booking links: one list under the sessions, client links then team links.
   Each row is the link's name and a muted line, with Copy and remove on the
   right. The address is one muted line that cuts off rather than wraps. */
.opportunities-detail__links {
    padding: var(--spacing-smd);
}

.opportunities-detail__links-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.opportunities-detail__link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) 0;
}

.opportunities-detail__link + .opportunities-detail__link {
    border-top: 1px solid var(--color-border-hairline);
}

.opportunities-detail__link-text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.opportunities-detail__link-name {
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.opportunities-detail__link-meta,
.opportunities-detail__link-url {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.opportunities-detail__link-url {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.opportunities-detail__link-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    flex-shrink: 0;
}

/* The Add menu opens under its button, lined up with the pane's right edge. */
.opportunities-schedule-add {
    flex-shrink: 0;
}

/* Details pane: fields on the left, the people and money on the right. */
.opportunities-detail__details {
    align-items: start;
}

/* A section head already pads itself, so the save status inside it does not. */
.global-section__head > .opportunities-pane-toolbar {
    padding: 0;
}

/* Field group title in sentence case: a quiet label over each group. */
.opportunities-detail__field-group + .opportunities-detail__field-group {
    margin-top: var(--spacing-md);
}

.opportunities-detail__field-group-title {
    margin: 0 0 var(--spacing-xs);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
}

/* Schedule → Calendar view. The shared month grid (calendar.js) is loaded above
   this compact nav row; the page-wide toolbar and date-nav partials teleport to
   header slots this page doesn't have, so month nav is a small local ‹ Today ›
   group that reloads with cal_year/cal_month + the #schedule hash. */
.opportunities-schedule-calendar__nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
    padding: var(--spacing-xs) var(--spacing-smd) var(--spacing-smd);
}

/* One merged segmented control: ‹ Today › (round 7 — was three loose buttons). */
.opportunities-calnav {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--color-grey-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-card-bg);
}

.opportunities-calnav__btn,
.opportunities-calnav__today {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--control-h-base);
    padding: 0 var(--spacing-smd);
    background: transparent;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.opportunities-calnav__btn {
    padding: 0 var(--spacing-sm);
    font-size: var(--font-size-md);
}

.opportunities-calnav__today {
    border-left: 1px solid var(--color-grey-200);
    border-right: 1px solid var(--color-grey-200);
}

.opportunities-calnav__btn:hover,
.opportunities-calnav__today:hover,
.opportunities-calnav__btn:focus-visible,
.opportunities-calnav__today:focus-visible {
    background: var(--color-action-tint-pressed);
    color: var(--color-action);
}

/* Already on the current month. Marked as where you are, not switched off: this
   was grey-on-grey between two chevrons, and it took the chevrons down with it —
   readers stopped trying to move months at all. Full text colour, a tinted seat
   under the word, and hover still answers. */
.opportunities-calnav__today--current {
    background: var(--color-action-tint-pressed);
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
}

.opportunities-schedule-calendar__label {
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

/* The grid ships its own padding via the shared calendar CSS; drop the card's
   default gutter so the month fills the pane width (capped at 1000px upstream). */
.opportunities-schedule-calendar__body {
    padding: 0 var(--spacing-smd) var(--spacing-smd);
}

/* ==========================================================================
   Sessions view — the rail
   The job's sessions down the left, the selected one's card and its agenda on
   the right. Ported from the approved mockup (Nick 2026-08-03, picked over the
   horizontal strip: that strip is reserved for choosing workers inside an agenda).
   ========================================================================== */
.opportunities-schedule-split {
    display: grid;
    grid-template-columns: 13.5rem 1fr;
}

/* A tint and a hairline are the whole separation — the rail is navigation, and
   a second card frame inside the pane's card would read as a nested box. */
.opportunities-schedule-rail {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    border-right: 1px solid var(--color-border-hairline);
    background: var(--color-grey-50);
}

/* Under the breakpoint the two columns stack, so the divider that was on the
   rail's right edge has to move to its bottom — same hairline, the side that
   now faces the panel. */
/* The tabs stay a group of their own inside the column even though they are now
   the only thing in it: the wrapper is what bounds the tablist, and a tablist
   that swallows the column would read anything added beside it out as a tab.
   Same axis and gap as the column, so the split is only there for assistive
   tech. */
.opportunities-schedule-rail__tabs {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.opportunities-schedule-rail__item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    padding: var(--spacing-sm) var(--spacing-sm);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: none;
    text-align: left;
    cursor: pointer;
}

.opportunities-schedule-rail__item b {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.opportunities-schedule-rail__item span {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.6875rem;
    color: var(--color-grey-600);
}

.opportunities-schedule-rail__item:hover {
    background: var(--color-grey-100);
}

/* The selected session is lifted onto the panel's own surface, so the rail
   reads as one continuous shape with what it opened. */
.opportunities-schedule-rail__item--on {
    border-color: var(--color-border);
    background: var(--color-card-bg);
}

.opportunities-schedule-rail__foot {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

/* Grey until the plan is shared with the workers, green once it is — the same
   judgement the agenda's own header makes, small enough to read at a glance
   down the column. */
.opportunities-schedule-rail__dot {
    flex: 0 0 auto;
    width: 0.375rem;
    height: 0.375rem;
    border-radius: var(--radius-pill);
    background: var(--color-grey-400);
}

.opportunities-schedule-rail__dot--shared {
    background: var(--color-success);
}

.opportunities-schedule-panel {
    min-width: 0;
}

/* One session's card. It used to be a Bootstrap list item in a stack of them;
   the rail took the stack away, so the row keeps its gutter and loses the
   dividing line it no longer sits above. */
.opportunities-detail__session {
    position: relative;
    padding: var(--spacing-smd);
}

/* Planning Center card. One button does the send and, after it, the re-check,
   so there is one spinner rule to write. Hidden until HTMX marks the button
   in-flight: the send runs inside the request and takes a few seconds against
   Planning Center's rate limit, so something has to be moving. */
.opportunities-pco__spin {
    display: none;
    margin-left: var(--spacing-xsm);
}

.opportunities-pco__btn.htmx-request .opportunities-pco__spin {
    display: inline-block;
}

.opportunities-pco__btn.htmx-request {
    opacity: 0.7;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Phone-first header and roster — the BASE (wide) half. The header's actions
   slot renders two branches at every width: --wide is the desktop cluster,
   --narrow is one primary and a "more" menu. This half shows the cluster and
   hides everything phone-only; the @media block at the end of the file flips
   them. Every phone-only class still gets a base rule here so a reader (and
   the template-class gate) finds its home without opening the media block.
   ═══════════════════════════════════════════════════════════════════════════ */
.opportunities-record-header__actions--wide {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-xsm);
}

.opportunities-record-header__actions--narrow {
    display: none;
    align-items: center;
    gap: var(--spacing-xs);
}

.opportunities-record-header__primary {
    min-height: var(--control-h-touch);
    white-space: nowrap;
}

.opportunities-record-header__menu {
    flex-shrink: 0;
}

.opportunities-record-header__menu-toggle {
    width: var(--control-h-touch);
    height: var(--control-h-touch);
}

/* Description: the text sits in its own box so a phone can clamp it; the
   More / Less toggle never shows on a wide screen. */
.opportunities-record-header__desc-text {
    min-width: 0;
}

.opportunities-record-header__desc-toggle {
    display: none;
}

.opportunities-detail__phone-name {
    display: none;
}

/* Pay shows cents on a wide screen and whole dollars on a phone: two spans,
   one visible. */
.opportunities-detail__role-pay-exact {
    display: inline;
}

.opportunities-detail__role-pay-whole {
    display: none;
}

/* ── Details: contacts card — hooks the phone block sizes ─────────────────── */
.opportunities-contact-row__note {
    font-size: var(--font-size-2xs);
}

/* The row's layout lives here, not in utility classes on the markup: a
   utility is !important, so the phone block could only answer with !important. */
.opportunities-contact-row__actions {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    gap: var(--spacing-xs);
}

.opportunities-contact-row__action {
    padding: 0;
    text-align: right;
}

.opportunities-contact-row__actions,
.opportunities-contact-form__actions,
.opportunities-contact-form__input,
.opportunities-contact-add {
    min-width: 0;
}

/* ── Schedule: meeting card hooks ───────────────────────────────────────────
   The time is one span so a phone can wrap it as one line of text; the action
   chips carry a word that only the phone shows (an icon alone is a guess). */
.opportunities-meeting__time-text {
    min-width: 0;
}

.opportunities-meeting__action-label {
    display: none;
}

.opportunities-meeting__hist {
    margin-top: var(--spacing-xsm);
}

.opportunities-meeting__hist-toggle {
    font-size: var(--font-size-xs);
}

.opportunities-meeting__hist-chevron {
    font-size: var(--font-size-2xs);
}

/* ── Pipeline: phone-only progress line and the current stage's hook ──────── */
.opportunities-pipe-band__left {
    display: none;
    margin: 0;
    flex-basis: 100%;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.opportunities-stageflow__stage.is-current {
    scroll-snap-align: center;
}

/* ── Forms: hooks the phone block sizes ─────────────────────────────────────── */
.opportunities-detail__form-assign,
.opportunities-detail__form-button {
    white-space: nowrap;
}

.opportunities-detail__form-button--remove {
    padding: 0;
    text-decoration: none;
}

/* ── Files: dropzone label per width, actor picker hooks ─────────────────────── */
.opportunities-detail__file-add {
    display: none;
}

.opportunities-detail__file-actor-form {
    align-items: center;
    min-width: 0;
}

.opportunities-detail__file-actor {
    width: auto;
    min-width: 0;
}

/* ── The Money card (admin only) ────────────────────────────────────────────
   Revenue over cost over the bottom line, read top to bottom. Labels sit
   left, figures right and tabular, so a column of dollars lines up on the
   decimal point instead of wandering with the digit widths. */
.opportunities-finance__note {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-md);
}

.opportunities-finance__section {
    margin-bottom: var(--spacing-md);
}

/* The last section already has the bottom line's own rule under it. */
.opportunities-finance__section:last-of-type {
    margin-bottom: 0;
}

.opportunities-finance__heading {
    color: var(--color-text-muted);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    margin-bottom: var(--spacing-xs);
}

.opportunities-finance__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--spacing-md);
    padding: var(--spacing-2xs) 0;
    font-size: var(--font-size-sm);
}

/* The subtotal closes its section, so it carries the rule above it rather
   than a heavier weight — one line does the job of a border and a bold. */
.opportunities-finance__row--total {
    border-top: 1px solid var(--color-border-hairline);
    margin-top: var(--spacing-2xs);
    padding-top: var(--spacing-xs);
    font-weight: var(--font-weight-medium);
}

.opportunities-finance__label {
    color: var(--color-text-secondary);
}

.opportunities-finance__amount {
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* The Cost total, when it opens the bills dashboard for this booking. Reads
   as the same figure as every other total — the underline only shows up on
   hover, which is what marks it as a link instead of a plain number. */
a.opportunities-finance__amount--link {
    color: inherit;
    font-weight: inherit;
    text-decoration: none;
}

a.opportunities-finance__amount--link:hover {
    text-decoration: underline;
}

.opportunities-finance__bottom {
    display: flex;
    gap: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
    padding-top: var(--spacing-md);
}

.opportunities-finance__figure {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
}

.opportunities-finance__figure-label {
    color: var(--color-text-muted);
    font-size: var(--font-size-2xs);
    text-transform: uppercase;
}

.opportunities-finance__figure-value {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-medium);
    font-variant-numeric: tabular-nums;
}

/* Money made, money lost, and neither. A booking that came out even, or one
   nobody priced, gets the plain ink colour — colour here means a direction,
   so it must not appear when there is no direction to report. */
.opportunities-finance__figure--good .opportunities-finance__figure-value {
    color: var(--color-success);
}

.opportunities-finance__figure--bad .opportunities-finance__figure-value {
    color: var(--color-error);
}

.opportunities-finance__figure--flat .opportunities-finance__figure-value {
    color: var(--color-text);
}

/* ═══════════════════════════════════════════════════════════════════════════
   PHONE (under 768px). Source order is the override: this block stays LAST
   in the file (tests/interface/test_phone_block_last.py), and every phone
   rule for this page — header, description, roster, schedule — lives inside
   it. Append here; never add a base rule below it.
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
    /* Header: one primary and a menu instead of the five-button cluster. */
    .opportunities-record-header__actions--wide {
        display: none;
    }

    /* The narrow branch is the only child the shared actions wrapper renders
       here, so it spans the wrapper's two columns and lays the row out itself:
       the primary takes the width, the ⋯ keeps its square on the right. */
    .opportunities-record-header__actions--narrow {
        display: grid;
        grid-template-columns: minmax(0, 1fr) var(--control-h-touch);
        grid-column: 1 / -1;
        gap: var(--spacing-sm);
    }

    .opportunities-record-header__primary {
        width: 100%;
    }

    .opportunities-record-header__menu {
        grid-column: 2;
    }

    /* The identity reads as running text on a phone so the title's two-line
       clamp can break between its parts instead of clipping the recipient. */
    .opportunities-detail__identity--inpage,
    .opportunities-detail__identity--inpage > span {
        display: inline;
        white-space: normal;
        overflow: visible;
    }

    /* Its parts take the large title's own size and case (page-header.css). */
    .opportunities-detail__identity--inpage > span {
        font-size: inherit;
        font-weight: inherit;
        letter-spacing: inherit;
        text-transform: inherit;
    }

    .opportunities-detail__identity--inpage > span:not(:first-child)::before {
        margin-left: var(--spacing-xs);
    }

    /* Description: three lines, then More / Less. */
    .opportunities-record-header__desc-text {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        overflow: hidden;
    }

    .opportunities-record-header__desc.is-open .opportunities-record-header__desc-text {
        display: block;
        -webkit-line-clamp: none;
        overflow: visible;
    }

    .opportunities-record-header__desc-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: flex-start;
        min-width: var(--control-h-touch);
        min-height: var(--control-h-touch);
        padding: 0;
        border: 0;
        background: none;
        color: var(--color-action);
        font: inherit;
        font-weight: var(--font-weight-medium);
        cursor: pointer;
    }

    /* Roster: the "Manage roster" link is a thumb target on a phone. */
    .opportunities-detail__roster-manage {
        min-height: var(--control-h-touch);
    }

    /* Roster tile: identity and kebab on the first line, status on the second,
       pay on the third — nothing squeezed beside the name. */
    .opportunities-detail__role-tile {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "identity menu"
            "meta meta"
            "actions actions";
        row-gap: var(--spacing-sm);
        padding: var(--spacing-smd) var(--page-gutter);
    }

    .opportunities-detail__role-identity {
        grid-area: identity;
    }

    .opportunities-detail__role-menu {
        grid-area: menu;
    }

    .opportunities-detail__role-due,
    .opportunities-detail__role-waiting,
    .opportunities-detail__role-status {
        grid-area: meta;
        justify-self: start;
    }

    .opportunities-detail__role-actions {
        grid-area: actions;
        justify-content: flex-start;
    }

    .opportunities-detail__role-warning {
        grid-column: 1 / -1;
    }

    /* Names read at body size and may wrap; the name link is a full tap target. */
    .opportunities-detail__role-worker-name {
        font-size: var(--font-size-base);
        white-space: normal;
    }

    .opportunities-detail__role-namelink {
        min-height: var(--control-h-touch);
        justify-content: center;
    }

    .opportunities-detail__role-menu-toggle {
        min-width: var(--control-h-touch);
        min-height: var(--control-h-touch);
    }

    /* Whole dollars only. */
    .opportunities-detail__role-pay-exact {
        display: none;
    }

    .opportunities-detail__role-pay-whole {
        display: inline;
    }

    /* Schedule tab: the rail stacks above the panel. */
    .opportunities-schedule-split {
        grid-template-columns: 1fr;
    }

    .opportunities-schedule-rail {
        border-right: none;
        border-bottom: 1px solid var(--color-border-hairline);
    }

    /* ── Details: contacts — thumb-height row actions, 16px inputs. ─────────── */
    .opportunities-contact-row {
        flex-wrap: wrap;
    }

    .opportunities-contact-row__actions {
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
        gap: var(--spacing-sm);
        margin-top: var(--spacing-xs);
    }

    .opportunities-contact-row__action {
        min-height: var(--control-h-touch);
        display: inline-flex;
        align-items: center;
        padding: 0 var(--spacing-sm);
        font-size: var(--font-size-md);
        text-align: left;
    }

    .opportunities-contact-row .form-check-input {
        width: var(--spacing-2xl);
        height: var(--spacing-lg);
        margin-top: 0;
    }

    .opportunities-contact-row .form-check {
        display: flex;
        align-items: center;
        gap: var(--spacing-sm);
        min-height: var(--control-h-touch);
    }

    .opportunities-contact-add {
        min-height: var(--control-h-touch);
    }

    .opportunities-contact-form__input {
        min-height: var(--control-h-touch);
        font-size: var(--font-size-base);
    }

    .opportunities-contact-form__actions .btn {
        flex: 1 1 0;
        min-height: var(--control-h-touch);
    }

    /* ── Schedule: toolbar stacks, the view switch spans the width. ─────────── */
    .opportunities-pane-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm);
        padding: var(--spacing-sm) var(--page-gutter);
    }

    .opportunities-pane-toolbar__summary {
        white-space: normal;
        padding: 0;
    }

    .opportunities-pane-toolbar__actions {
        flex-wrap: wrap;
    }

    .opportunities-pane-toolbar__actions .btn,
    .opportunities-detail__form-assign {
        flex: 1 1 auto;
        min-height: var(--control-h-touch);
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .opportunities-segview {
        display: flex;
        width: 100%;
    }

    .opportunities-segview__btn {
        flex: 1 1 0;
        min-height: var(--control-h-touch);
    }

    /* ── Schedule: the rail is one horizontal row of chips. ── */
    .opportunities-schedule-rail {
        position: relative;
        padding: var(--spacing-sm) 0 var(--spacing-sm) var(--page-gutter);
    }

    .opportunities-schedule-rail__tabs {
        flex-direction: row;
        gap: var(--spacing-sm);
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-right: var(--spacing-xl);
    }

    .opportunities-schedule-rail__tabs::-webkit-scrollbar {
        display: none;
    }

    .opportunities-schedule-rail__item {
        flex: 0 0 auto;
        scroll-snap-align: start;
        min-height: var(--control-h-touch);
        justify-content: center;
        border-color: var(--color-border-subtle);
        background: var(--color-card-bg);
    }

    .opportunities-schedule-rail__item b,
    .opportunities-schedule-rail__item span {
        font-size: var(--font-size-sm);
    }

    /* ── Schedule: meeting card — text wraps, chips are labelled and 44px. ──── */
    .opportunities-meeting {
        flex-wrap: wrap;
    }

    .opportunities-meeting__time {
        align-items: flex-start;
    }

    .opportunities-meeting__time-text {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .opportunities-meeting__loc {
        min-height: var(--control-h-touch);
        align-items: flex-start;
        padding-top: var(--spacing-xs);
    }

    .opportunities-meeting__loc span {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .opportunities-meeting__actions {
        width: 100%;
        justify-content: flex-start;
        gap: var(--spacing-sm);
    }

    .opportunities-meeting__action {
        width: auto;
        min-height: var(--control-h-touch);
        padding: 0 var(--spacing-smd);
        gap: var(--spacing-xs);
        color: var(--color-text);
    }

    .opportunities-meeting__action-label {
        display: inline;
        font-size: var(--font-size-sm);
    }

    .opportunities-meeting__hist-toggle {
        min-height: var(--control-h-touch);
        font-size: var(--font-size-sm);
    }

    .global-hist__body,
    .global-hist__date,
    .global-hist__time,
    .global-hist__actor {
        font-size: var(--font-size-sm);
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .opportunities-detail__session {
        padding: var(--spacing-smd) var(--page-gutter);
    }

    /* ── Pipeline: the stage band is a horizontal rail, current stage centred. ── */
    .opportunities-stageflow {
        position: relative;
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: var(--spacing-sm) var(--page-gutter);
        gap: var(--spacing-sm);
    }

    .opportunities-stageflow::-webkit-scrollbar {
        display: none;
    }

    /* The band wears the shared edge fade (components/edge-fade.css). */

    .opportunities-stageflow__stage {
        flex: 0 0 72%;
        scroll-snap-align: center;
        min-height: var(--control-h-touch);
    }

    .opportunities-stageflow__name {
        white-space: normal;
    }

    /* ── Pipeline: band — full-width advance, one progress line, 44px rows. ──── */
    .opportunities-pipe-band {
        padding: var(--spacing-sm) var(--page-gutter);
    }

    .opportunities-pipe-band__left {
        display: block;
    }

    .opportunities-pipe-band__action {
        width: 100%;
        margin-left: 0;
    }

    .opportunities-pipe-band__advance {
        flex: 1 1 auto;
        min-height: var(--control-h-touch);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: var(--font-size-md);
    }

    .opportunities-pipe-band__overflow-toggle {
        min-width: var(--control-h-touch);
        min-height: var(--control-h-touch);
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .opportunities-pipe-band__blocked {
        font-size: var(--font-size-sm);
        padding: var(--spacing-sm) var(--spacing-smd);
    }

    .opportunities-pipe-band__blockers {
        gap: 0;
    }

    .opportunities-pipe-band__blocker {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-2xs);
        min-height: var(--control-h-touch);
        justify-content: center;
        padding: var(--spacing-xs) 0;
        border-top: 1px solid color-mix(in srgb, var(--color-warning) 20%, transparent);
    }

    .opportunities-pipe-band__blocker:first-child {
        border-top: none;
    }

    .opportunities-pipe-band__blocker-link {
        display: inline-flex;
        align-items: center;
        min-height: var(--control-h-touch);
        font-size: var(--font-size-md);
    }

    /* ── Forms: toolbar button spans the width; each card's actions are 44px. ── */
    .opportunities-detail__form-cards {
        grid-template-columns: 1fr;
        padding: var(--spacing-smd) var(--page-gutter);
    }

    .opportunities-detail__form-action,
    .opportunities-detail__form-button {
        display: inline-flex;
        align-items: center;
        min-height: var(--control-h-touch);
        font-size: var(--font-size-md);
    }

    .opportunities-detail__form-button {
        padding: 0 var(--spacing-smd);
    }

    .opportunities-detail__form-resend,
    .opportunities-detail__form-remove {
        display: flex;
    }

    .opportunities-detail__form-resend .opportunities-detail__form-button {
        flex: 1 1 auto;
        justify-content: center;
    }

    /* ── Files: the pane fills the width; one button, one column, 44px rows. ── */
    .opportunities-detail__files {
        width: 100%;
        max-width: none;
        min-width: 0;
        padding: var(--spacing-smd) var(--page-gutter);
    }

    .opportunities-detail__file-dropzone,
    .opportunities-detail__files:has(> .opportunities-detail__file-add) > .global-empty-state {
        display: none;
    }

    .opportunities-detail__file-add {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: var(--spacing-xs);
    }

    .opportunities-detail__file-actor-form {
        flex-direction: column;
        align-items: stretch;
    }

    .opportunities-detail__file-actor {
        width: 100%;
        min-height: var(--control-h-touch);
        font-size: var(--font-size-base);
    }

    .opportunities-detail__files .opportunities-detail__file-cards,
    .opportunities-detail__file-cards {
        grid-template-columns: 1fr;
    }

    .opportunities-detail__file-preview {
        height: calc(var(--control-h-touch) + var(--spacing-smd));
    }

    .opportunities-detail__file-actions {
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }

    .opportunities-detail__file-action,
    .opportunities-detail__file-remove {
        min-height: var(--control-h-touch);
        padding: 0 var(--spacing-sm);
        font-size: var(--font-size-md);
    }

    /* An admin's pay pill opens the bill drawer, so on a phone it is a 44px
       target like the row's other controls; the plain pay figure stays a pill. */
    .opportunities-detail__role-actions .global-value-pill--interactive {
        min-height: var(--control-h-touch);
        padding-inline: var(--spacing-md);
    }

    .opportunities-tabs-shell .global-record-header__bar {
        grid-template-areas: "back heading actions";
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: start;
        column-gap: var(--spacing-smd);
        padding-block: var(--spacing-smd) var(--spacing-sm);
    }

    .opportunities-tabs-shell .global-record-header__actions,
    .opportunities-tabs-shell .opportunities-record-header__actions--narrow {
        display: flex;
        grid-column: auto;
    }

    .opportunities-tabs-shell .global-record-header__title {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-2xs);
        font-size: var(--font-size-h3);
        -webkit-line-clamp: none;
        overflow: visible;
        overflow-wrap: anywhere;
    }

    .opportunities-detail__phone-name {
        display: block;
    }

    .opportunities-detail__phone-name + .opportunities-detail__identity--inpage {
        color: var(--color-text-secondary);
        font-size: var(--font-size-sm);
        font-weight: var(--font-weight-body);
        letter-spacing: normal;
    }

    .opportunities-tabs-shell .global-record-header__summary {
        gap: var(--spacing-xs);
        padding-block: var(--spacing-sm);
    }

    .opportunities-tabs-shell .global-facts {
        grid-template-columns: max-content minmax(0, 1fr);
        gap: 0 var(--spacing-md);
        align-items: center;
    }

    .opportunities-tabs-shell .global-facts__item {
        display: contents;
    }

    .opportunities-tabs-shell .global-facts__label {
        font-size: var(--font-size-sm);
    }

    .opportunities-tabs-shell .global-facts__value {
        padding-block: var(--spacing-2xs);
        font-size: var(--font-size-md);
    }

    .opportunities-tabs-shell .global-record-header__summary > .global-stage-track {
        display: grid;
        grid-template-columns: max-content minmax(0, 1fr);
        gap: var(--spacing-2xs) var(--spacing-md);
        align-items: center;
    }

    .opportunities-tabs-shell .global-stage-track__next {
        grid-column: 1 / -1;
        white-space: normal;
    }

    .opportunities-tabs-shell .opportunities-record-header__desc {
        padding-bottom: 0;
    }

    .opportunities-tabs-shell .global-record-header .global-tabs {
        gap: 0;
        padding-inline: var(--spacing-xs);
    }

    .opportunities-tabs-shell .global-record-header .global-tab {
        padding-inline: var(--spacing-smd);
    }

    .opportunities-tabs-shell .global-record-header .global-tab.is-active {
        border-bottom-width: var(--spacing-xs);
        font-weight: var(--font-weight-heading);
    }

    .opportunities-tabs-shell {
        margin-bottom: calc(var(--control-h-touch) + var(--spacing-md));
    }

    .opportunities-tabs-shell:not([data-tab="roster"]) .opportunities-record-header__primary {
        display: none;
    }

    .opportunities-tabs-shell .opportunities-record-header__primary,
    .opportunities-tabs-shell .opportunities-pipe-band__advance,
    .opportunities-tabs-shell .opportunities-schedule-add,
    .opportunities-tabs-shell .opportunities-detail__form-assign,
    .opportunities-tabs-shell .tasks-tab__bar .tasks-actions,
    .opportunities-tabs-shell .opportunities-detail__file-add,
    .opportunities-tab-pane[aria-labelledby="opptab-forms"] .global-empty-state > .btn {
        position: fixed;
        inset-inline: var(--spacing-lg);
        bottom: calc(var(--bottom-bar-h) + var(--spacing-sm));
        z-index: var(--z-sticky);
        width: auto;
        min-height: var(--control-h-touch);
        margin: 0;
        box-shadow: var(--shadow-lg);
    }

    .opportunities-tabs-shell[data-tab="roster"]:has([data-holds-phone-bar]:not([hidden])) {
        margin-bottom: calc(var(--control-h-touch) + var(--control-h-touch) + var(--spacing-2xl));
    }

    .opportunities-tabs-shell [data-holds-phone-bar] {
        bottom: calc(var(--bottom-bar-h) + var(--spacing-sm));
    }

    .opportunities-tabs-shell:has([data-holds-phone-bar]:not([hidden])) .opportunities-record-header__primary {
        bottom: calc(var(--bottom-bar-h) + var(--control-h-touch) + var(--spacing-xl));
    }

    .opportunities-tabs-shell [data-holds-invite] {
        min-height: var(--control-h-touch);
    }

    .opportunities-tabs-shell .opportunities-schedule-add,
    .opportunities-tabs-shell .tasks-tab__bar .tasks-actions {
        box-shadow: none;
    }

    .opportunities-tabs-shell .opportunities-schedule-add > .btn,
    .opportunities-tabs-shell .tasks-tab__bar .tasks-actions > .btn {
        width: 100%;
        min-height: var(--control-h-touch);
        box-shadow: var(--shadow-lg);
    }

    .opportunities-tabs-shell .opportunities-detail__form-assign,
    .opportunities-tab-pane[aria-labelledby="opptab-forms"] .global-empty-state > .btn {
        background: var(--color-card-bg);
    }

    .opportunities-tabs-shell .opportunities-detail__file-card {
        display: grid;
        grid-template-columns: var(--spacing-2xl) minmax(0, 1fr);
        align-items: center;
        gap: var(--spacing-smd);
        border: 0;
        border-bottom: 1px solid var(--color-border-hairline);
        border-radius: var(--radius-none);
        box-shadow: none;
    }

    .opportunities-tabs-shell .opportunities-detail__file-preview {
        width: var(--spacing-2xl);
        height: var(--spacing-2xl);
        border-radius: var(--radius-md);
        font-size: var(--font-size-md);
    }

    .opportunities-tabs-shell .opportunities-detail__file-card .opportunities-detail__file-body {
        display: grid;
        min-width: 0;
        padding: var(--spacing-xs) 0;
    }

    .opportunities-tabs-shell .opportunities-detail__file-name {
        text-overflow: clip;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .opportunities-tabs-shell .opportunities-detail__file-actor-form .settings-permission-group__label,
    .opportunities-tabs-shell a.opportunities-finance__amount--link {
        display: inline-flex;
        align-items: center;
        min-height: var(--control-h-touch);
    }
}


.bookings-role-page__header {
    background: linear-gradient(135deg, var(--color-action), var(--color-action-hover));
    color: var(--color-neutral-ink-fg);
    padding: var(--spacing-mdlg) var(--spacing-lg);
    border-radius: var(--radius-card);
    margin-bottom: var(--spacing-md);
}

/* Team roster — one column of person chips (ADR-125/131); the row just
   frames the chip and carries the you/open state the chip itself can't. */
.bookings-role-page__team-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
}

.bookings-role-page__team-member {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    padding: var(--spacing-xsm) var(--spacing-sm);
    border-radius: var(--radius-card);
    border: 1px solid var(--role-tile-open-border, #d1d5db);
    background: var(--role-tile-open-bg, var(--color-page-bg));
}

.bookings-role-page__team-member--you {
    background: var(--role-tile-mine-bg, color-mix(in srgb, var(--color-action) 10%, white));
    border-color: var(--role-tile-mine-border, var(--color-action));
}

/* The viewer's own row: real face and name on the chip, the tint above and
   this tag carrying the "that's me" the old bespoke span used to. */
.bookings-role-page__team-you {
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-action);
}

/* An unfilled role wears the chip shape but not a person's weight. */
.bookings-role-page__team-member--open .global-person-chip__name {
    color: var(--color-text-muted);
}


/* ── Your Work: the pay periods of a standing seat ─────────────────────────
   A booking role's deliverable is one button in the middle column. A seat is
   the same job repeated, so the column carries one row per period and the
   button moves inside the row. The rows wear the Job card's own divided-row
   shape — same gutter, same hairline between rows — so the two cards read as
   one page rather than a list bolted onto it. Every value here is a token;
   the row tint is the action ramp's wash, the one a hovered or selected row
   takes everywhere else in the app. */
.bookings-role-periods {
    padding: var(--spacing-xs) 0 var(--spacing-sm);
}

.bookings-role-periods [x-cloak] { display: none !important; }

.bookings-role-period + .bookings-role-period {
    border-top: 1px solid var(--color-border-subtle);
}

.bookings-role-period__row {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    display: grid;
    align-items: center;
    gap: var(--spacing-sm);
    /* dot · date · what happened · pay · amount · chevron. The middle column
       is the only elastic one, so a long badge never squeezes the date. */
    grid-template-columns: 14px 5.75rem minmax(6.875rem, 1fr) auto 4.125rem 1rem;
    padding: var(--spacing-sm) var(--spacing-lg);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.bookings-role-period__row:hover,
.bookings-role-period--expanded > .bookings-role-period__row {
    background: var(--color-action-tint);
}

.bookings-role-period__date {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.bookings-role-period__work {
    font-size: var(--font-size-md);
    color: var(--color-text-light);
}

/* A period that came and went unmarked says so in the same amber the rest of
   the product uses for "this is waiting on you". */
.bookings-role-period--late .bookings-role-period__work {
    color: var(--color-warning);
    font-weight: var(--font-weight-medium);
}

/* Marked in this session: the amber has to go with the word it described.
   After this rule so it wins on equal specificity. */
.bookings-role-period--marked .bookings-role-period__work {
    color: var(--color-text-light);
    font-weight: var(--font-weight-body);
}

/* A period nobody has been billed for yet is a fact, not a task. */
.bookings-role-period--upcoming .bookings-role-period__date,
.bookings-role-period--upcoming .bookings-role-period__work,
.bookings-role-period--upcoming .bookings-role-period__amount {
    opacity: 0.55;
}

.bookings-role-period__amount {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    text-align: right;
    color: var(--color-text);
}

.bookings-role-period__chev {
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
    opacity: 0.5;
    transition: transform var(--transition-fast);
}

.bookings-role-period--expanded .bookings-role-period__chev {
    transform: rotate(90deg);
    opacity: 0.9;
}

.bookings-role-period__panel {
    padding: 0 var(--spacing-lg) var(--spacing-md);
    background: var(--color-action-tint);
}

/* Each upload card is at least 15rem wide, so a long count shows in full and a
   phone stacks the cards (#9256). */
.bookings-role-page__upload-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(var(--role-upload-card-min-width), 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-mdlg);
}

/* On a phone the pay badge and the amount cannot both sit on the row, so the
   badge steps out and the amount keeps its place: what it pays is the fact a
   worker scans for, and the badge's answer is inside the row anyway. */
@media (max-width: 575.98px) {
    .bookings-role-period__row {
        grid-template-columns: 14px 4.5rem minmax(0, 1fr) 3.75rem 1rem;
        padding: var(--spacing-sm) var(--spacing-md);
        gap: var(--spacing-xsm);
    }
    .bookings-role-period__pay { display: none; }
    .bookings-role-period__panel { padding: 0 var(--spacing-md) var(--spacing-md); }
}

/* Page settings drawer (app/opportunities/_header_settings_drawer.html).
   The admin Gear's twin of the Edit drawer: the title style radios, then a list
   of checkbox rows, one per header fact, grouped under small sentence-case
   headings, then the roster-row choices per role template, then a pointer to
   where the name-composing properties live. Every row is a full-width touch target; on a
   phone the box grows and the label reads at body size so a thumb can land on
   it without zooming. Tokens only — this file sits at ratchet zero. */

#opp-header-settings-drawer .opportunities-header-settings__hint {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    margin: 0 0 var(--spacing-smd);
}

#opp-header-settings-drawer .opportunities-header-settings__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
}

#opp-header-settings-drawer .opportunities-header-settings__group {
    margin: var(--spacing-smd) 0 var(--spacing-2xs);
    padding: 0 var(--spacing-sm);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
}

/* A section of the drawer (Title style, Roster rows): a heading a step above the
   groups inside it. */
#opp-header-settings-drawer .opportunities-header-settings__section {
    margin: var(--spacing-md) 0 var(--spacing-xs);
    padding: 0 var(--spacing-sm);
    font-family: var(--font-family-heading);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-heading);
    color: var(--color-text);
}

#opp-header-settings-drawer .opportunities-header-settings__fieldset {
    margin: 0 0 var(--spacing-smd);
    padding: 0;
    border: 0;
    min-width: 0;
}

#opp-header-settings-drawer .opportunities-header-settings__fieldset:first-of-type > .opportunities-header-settings__section {
    margin-top: 0;
}

/* A title style reads as its name over a one-line hint. */
.opportunities-header-settings__option {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    padding: var(--spacing-xs) 0;
}

.opportunities-header-settings__option-hint {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

/* The roster-row choices sit below the header ones, split by a hairline. */
#opp-header-settings-drawer .opportunities-header-settings__roster {
    margin-top: var(--spacing-smd);
    padding-top: var(--spacing-xs);
    border-top: 1px solid var(--color-border);
}

#opp-header-settings-drawer .opportunities-header-settings__group:first-child {
    margin-top: 0;
}

/* The whole row is the tap target: the label takes the row's slack, so a tap
   anywhere right of the icon toggles the box. */
.opportunities-header-settings__row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-height: var(--control-h-touch);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
}

.opportunities-header-settings__row:hover {
    background: var(--color-grey-50);
}

.opportunities-header-settings__box {
    width: var(--spacing-md);
    height: var(--spacing-md);
    cursor: pointer;
    flex: 0 0 auto;
}

.opportunities-header-settings__icon {
    color: var(--color-text-secondary);
    width: var(--spacing-md);
    text-align: center;
    flex: 0 0 auto;
}

.opportunities-header-settings__name {
    margin: 0;
    cursor: pointer;
    flex: 1 1 auto;
    align-self: stretch;
    display: flex;
    align-items: center;
}

#opp-header-settings-drawer .opportunities-header-settings__name-props {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    margin: var(--spacing-smd) 0 0;
    padding-top: var(--spacing-smd);
    border-top: 1px solid var(--color-border);
}

/* The pointer to the properties page reads as a row, not a bare link: full
   width, touch height, chevron on the right. */
.opportunities-header-settings__name-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    min-height: var(--control-h-touch);
    margin-top: var(--spacing-xs);
    text-decoration: none;
}

/* Phone: a bigger box and body-size label; the row already has touch height. */
@media (max-width: 767.98px) {
    .opportunities-header-settings__box {
        width: var(--spacing-lg);
        height: var(--spacing-lg);
    }

    .opportunities-header-settings__name,
    .opportunities-header-settings__name-link {
        font-size: var(--font-size-base);
    }
}

.core-impersonate-modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--color-scrim);
    z-index: var(--z-popover);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.core-impersonate-modal-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.core-impersonate-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 520px;
    max-height: 80vh;
    background: var(--color-card-bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-modal);
    z-index: var(--z-overlay-top);
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.core-impersonate-modal.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.core-impersonate-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-smd) var(--spacing-mdlg);
    background: var(--color-error);
    color: #fff;
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-none) var(--radius-none);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-lg);
}

.core-impersonate-modal-header-left {
    display: flex;
    align-items: center;
}

.core-impersonate-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: var(--spacing-xs);
    font-size: var(--font-size-base);
    line-height: 1;
}

.core-impersonate-modal-close:hover {
    color: #fff;
}

/* The base header is impersonation-red (danger) on purpose. The skill-assign
   modal is a routine action, so it wears the calm action ink instead —
   same chrome, non-alarming tone. */
.workers-skill-assign-modal .core-impersonate-modal-header,
.global-people-picker .core-impersonate-modal-header {
    background: var(--color-action);
    color: var(--color-neutral-ink-fg);
}

.core-impersonate-modal-filters {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-smd) var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
}

.core-impersonate-modal-filters .global-search-input-wrapper {
    flex: 1;
    min-width: 0;
}

.core-impersonate-modal-body {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--spacing-sm);
    flex: 1;
    min-height: 0;
}

.core-impersonate-member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-smd);
    padding: var(--spacing-sm) var(--spacing-smd);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background 0.1s ease;
}

.core-impersonate-member-row:hover {
    background: var(--color-grey-50);
    color: inherit;
    text-decoration: none;
}

/* Rows rendered as <button> (click-to-assign) rather than <a> need the native
   button chrome stripped so they match the link rows exactly. */
.core-impersonate-member-row--button {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    font: inherit;
}

.core-impersonate-member-row:disabled {
    opacity: 0.6;
    cursor: default;
}

.core-impersonate-member-row:disabled:hover {
    background: transparent;
}

.core-impersonate-member-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.core-impersonate-member-name {
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-md);
    color: var(--color-text);
}

.core-impersonate-member-email {
    font-size: var(--font-size-xs);
    color: var(--color-text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.core-impersonate-empty-state {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-md);
    color: var(--color-text-light);
    font-size: var(--font-size-md);
}

@media (max-width: 575.98px) {
    .core-impersonate-modal-close {
        min-width: var(--control-h-touch);
        min-height: var(--control-h-touch);
    }

    /* Edge to edge; header and list pay the phone's insets (--safe-*). */
    .core-impersonate-modal {
        inset: 0;
        width: auto;
        height: auto;
        max-width: none;
        max-height: none;
        border-radius: var(--radius-none);
        transform: none;
    }

    .core-impersonate-modal.is-open {
        transform: none;
    }

    .core-impersonate-modal-header {
        border-radius: var(--radius-none);
        padding-top: calc(var(--spacing-smd) + var(--safe-top));
    }

    .core-impersonate-modal-body {
        padding-bottom: calc(var(--spacing-sm) + var(--safe-bottom));
    }
}


.assignments-day-preview-backdrop {
    position: fixed;
    inset: 0;
    background: var(--color-scrim);
    z-index: var(--z-popover);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.assignments-day-preview-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.assignments-day-preview {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    background: var(--color-card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: var(--z-overlay-top);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    overflow: hidden;
}

.assignments-day-preview.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.assignments-day-preview__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-smd) var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.assignments-day-preview__label {
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-lg);
    color: var(--color-text);
}

.assignments-day-preview__close {
    background: none;
    border: none;
    font-size: 1.35rem;
    line-height: 1;
    color: var(--color-text-light);
    cursor: pointer;
    padding: var(--spacing-2xs) var(--spacing-xs);
    border-radius: var(--radius-sm);
}

.assignments-day-preview__close:hover {
    color: var(--color-text);
    background: var(--color-surface-hover);
}

.assignments-day-preview__timeline {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--spacing-xs) 0;
    flex: 1;
}

.assignments-day-preview__row {
    display: flex;
    align-items: stretch;
    min-height: 2.25rem;
}

.assignments-day-preview__hour {
    flex-shrink: 0;
    width: 3.25rem;
    padding: var(--spacing-xsm) var(--spacing-sm) var(--spacing-xsm) var(--spacing-smd);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-light);
    text-align: right;
    line-height: 1;
    white-space: nowrap;
}

.assignments-day-preview__slot {
    flex: 1;
    border-top: 1px solid var(--color-border);
    padding: var(--spacing-2xs) var(--spacing-sm) var(--spacing-2xs) var(--spacing-sm);
    min-height: 2.25rem;
}

.assignments-day-preview__row:last-child .assignments-day-preview__slot {
    border-bottom: 1px solid var(--color-border);
}

.assignments-day-preview__event {
    display: flex;
    align-items: center;
    gap: var(--spacing-xsm);
    padding: var(--spacing-xs) var(--spacing-sm);
    margin: var(--spacing-2xs) 0;
    border-radius: var(--radius-md);
    background: var(--color-grey-100);
    font-size: var(--font-size-xs);
    line-height: 1.3;
    border-left: 3px solid var(--color-text-muted);
}

.assignments-day-preview__event--target {
    background: color-mix(in srgb, var(--color-action) 10%, transparent);
    border-left-color: var(--color-action);
}

.assignments-day-preview__event-time {
    flex-shrink: 0;
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    font-size: var(--font-size-xs);
}

.assignments-day-preview__event--target .assignments-day-preview__event-time {
    color: var(--color-action);
}

.assignments-day-preview__event-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
}

.assignments-day-preview__event--target .assignments-day-preview__event-label {
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
}

@media (max-width: 480px) {
    .assignments-day-preview {
        width: 95%;
        max-height: 85vh;
    }
}

/* ── Phone (<768px) ─────────────────────────────────────────────────────────
   The centred card becomes a full sheet under the header: no translate, so
   the open transition is opacity only. Stays LAST in the file. */
@media (max-width: 767.98px) {
    .assignments-day-preview {
        inset: var(--header-bottom) 0 0 0;
        width: auto;
        max-height: none;
        transform: none;
        border-radius: var(--radius-none);
    }

    .assignments-day-preview.is-open {
        transform: none;
    }

    .assignments-day-preview__close {
        min-width: var(--control-h-touch);
        min-height: var(--control-h-touch);
    }
}

/* ============================================
   Google Places Autocomplete (Classic API)
   Style the .pac-container dropdown to match Bootstrap.
   Uses google.maps.places.Autocomplete which attaches
   to an existing <input> — no web component needed.
   ============================================ */
.pac-container {
    border: 1px solid var(--color-grey-200);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem var(--ink-alpha-15);
    margin-top: var(--spacing-xs);
    background-color: var(--color-card-bg);
    font-family: inherit;
    z-index: var(--z-portal);
}
.pac-item {
    padding: var(--spacing-sm) var(--spacing-smd);
    font-size: var(--font-size-md);
    color: var(--color-text);
    cursor: pointer;
    border-top: 1px solid var(--color-page-bg);
}
.pac-item:first-child {
    border-top: none;
}
.pac-item:hover,
.pac-item-selected {
    background-color: var(--color-surface-hover);
}

/* SkillBridge - Main Styles
 *
 * Layout, base element styles, responsive rules, and utilities.
 * The :root design tokens this sheet reads live in tokens.css, loaded
 * just before this file (see the app + public base templates).
 */

*, *::before, *::after {
    box-sizing: border-box;
}

/* A double tap never zooms the page. A two-finger zoom still works. */
:where(*) {
    touch-action: manipulation;
}

html {
    font-size: var(--font-size-base);
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    font-family: var(--font-family);
    color: var(--color-text);
    background-color: var(--color-page-bg);
    padding-top: var(--safe-top);
}

.global-app-layout {
    min-height: 100vh;
}

.global-app-layout.global-no-sidebar .global-app-main {
    margin-left: 0;
}

.global-app-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* clip, NOT hidden: overflow-x hidden makes this element the nearest
       scroll container for descendants, and since .global-app-main itself never
       scrolls (the body does), the sticky .global-app-header silently stops
       sticking and rides off-screen. clip cuts horizontal overflow without
       creating a scroll container, so the header stays frozen. */
    overflow-x: clip;
    margin-left: var(--sidebar-width);
    /* transition margin (not just margin-left) to animate the sidebar collapse.
       The push-drawer resize now animates on .global-app-content, not here — see
       .global-app-content below and the drawer.css PUSH block. */
    transition: margin var(--transition-normal);
}

.global-app-content {
    flex: 1;
    /* Uniform --page-gutter on all four sides: the side padding matches the gap
       under the header instead of being inflated by a centered max-width cap
       that wasted L/R space on wide screens. */
    padding: var(--page-gutter);
    width: 100%;
    /* Animate the push-drawer resize (margin-right + max-width) the same way the
       old .global-app-main margin push animated — see drawer.css PUSH block. */
    transition: margin var(--transition-normal), max-width var(--transition-normal);
}

/* Viewport-fit pages. A page opts in by putting .global-page-fill on its main
   body container (workers table, opportunities table): the layout column locks
   to the viewport, the header card keeps its natural height, and the fill
   container takes the rest, scrolling internally — HubSpot's table treatment,
   where the container always reaches the bottom of the screen (Nick, 09-03).
   Generalized from the opportunities-table rules milestones.css shipped first.

   What the lock does not hold becomes page scroll, and a shell one screen tall
   scrolls its own sticky header off the top (Nick, 09-05). clip, not hidden —
   same reason as the overflow-x line above.

   dvh follows the phone's toolbar as it comes and goes; 100vh is the screen
   with it retracted, so it overflows whenever the toolbar shows. vh stays on
   top as the fallback for browsers without dvh, as in stream.css. Minus
   --safe-top, which body already pads.

   Both min-heights above have to come off, or none of that height work runs:
   used height is the LARGER of height and min-height, so a leftover
   min-height:100vh silently wins and the page scrolls by the notch again
   (measured: --safe-top 40px gave the document back 40px of scroll). The
   min-height:0 chain below earns its keep twice — it is also what shrinks the
   fill container enough to keep the infinite-scroll sentinel inside the clip,
   and the sentinel going out of view fails silently: the list just stops
   loading page 2.

   Browsers without :has() skip the height lock and degrade to today's page
   scroll — everything still readable, nothing clipped. */
.global-app-layout:has(.global-page-fill) {
    min-height: 0;
}

.global-app-main:has(.global-page-fill) {
    min-height: 0;
    height: calc(100vh - var(--safe-top));
    height: calc(100dvh - var(--safe-top));
    overflow: clip;
}

.global-app-main:has(.global-page-fill) .global-app-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Everything else on the page — the header card, view-control drawers, the
   scroll sentinel — keeps its natural height and never gets squeezed; only
   .global-page-fill below grows. */
.global-app-main:has(.global-page-fill) .global-app-content > :not(.global-page-fill) {
    flex: 0 0 auto;
}

.global-page-fill {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

/* Inside a fill container the grid drops its 70vh fallback cap and takes the
   space flex handed it. */
.global-page-fill .global-grid-wrap {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
}

.global-app-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
    /* Vertical padding is the header's gutter: 6px top/bottom around the 28px
       controls = the 40px --header-height (border-box). Keep these in lockstep —
       see the --header-height comment for why. Horizontal padding is independent. */
    padding: var(--spacing-xsm) var(--spacing-md);
    background: var(--header-bg);
    border-bottom: 1px solid var(--sidebar-border);
    height: var(--header-height);
    position: sticky;
    top: var(--safe-top);
    z-index: var(--z-modal-backdrop);
}

h1, .h1 {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-heading);
    font-style: var(--font-style-heading);
    text-transform: var(--text-transform-heading);
    letter-spacing: var(--letter-spacing-heading);
    line-height: var(--line-height-heading);
    font-size: var(--font-size-h1);
}

h2, h3, .h2, .h3 {
    font-family: var(--font-family-subheading);
    font-weight: var(--font-weight-subheading);
    font-style: var(--font-style-subheading);
    text-transform: var(--text-transform-subheading);
    letter-spacing: var(--letter-spacing-subheading);
    line-height: var(--line-height-subheading);
}

h2, .h2 {
    font-size: var(--font-size-h2);
}

h3, .h3 {
    font-size: var(--font-size-h3);
}

/* h4-h6 — body cascade for everything but size. Sizes are pinned on every
   heading level (here and above) so Bootstrap's reboot scale never reaches the
   render; below h4 the scale rejoins the body ladder. */
h4, h5, h6, .h4, .h5, .h6 {
    font-family: var(--font-family);
    font-weight: var(--font-weight-body);
    font-style: var(--font-style-body);
    letter-spacing: var(--letter-spacing-body);
    line-height: var(--line-height-body);
}

h4, .h4 {
    font-size: var(--font-size-h4);
}

h5, .h5 {
    font-size: var(--font-size-lg);
}

h6, .h6 {
    font-size: var(--font-size-md);
}

.global-text-accent {
    font-family: var(--font-accent, inherit);
    font-weight: var(--font-weight-accent);
    font-style: var(--font-style-accent);
    text-transform: var(--text-transform-accent);
    letter-spacing: var(--letter-spacing-accent);
    line-height: var(--line-height-accent);
}

body {
    /* 14px standard body. Set here, not on html — html stays at
       --font-size-base (16px) so the rem scale keeps its anchor. */
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-body);
    font-style: var(--font-style-body);
    letter-spacing: var(--letter-spacing-body);
    line-height: var(--line-height-body);
}

.global-app-header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    position: relative;
    z-index: 1;
    margin-left: auto;
    /* Never compress the right-hand cluster. The header is a single fixed-height
       row (no wrap), and the payments dashboard packs filter pills (fixed width)
       next to the tab nav in here. If this box is allowed to shrink, it squeezes
       the filter wrapper while its pills stay rigid — so the pills spill out and
       overlap the tabs. Holding it at natural width pushes any deficit onto the
       left search box (.global-search-input-wrapper: flex 0 1 320px, min 160px), which
       shrinks gracefully instead. */
    flex-shrink: 0;
}

/* Header button base — 36px tall, transparent, border, neutral-darken hover.
   Text buttons stay pill-shaped (auto width via padding); the icon-only variant
   below squares this to 36×36. */
.global-header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--control-h-base);
    min-width: 36px;
    padding: 0 var(--spacing-xsm);
    border-radius: var(--radius-button);
    color: var(--color-text-light);
    background: transparent;
    border: 1px solid var(--color-border);
    cursor: pointer;
    flex-shrink: 0;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-button);
    line-height: 1;
    text-decoration: none;
    gap: var(--spacing-xs);
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.global-header-btn:hover {
    background: var(--color-surface-hover);
}

.global-header-btn i {
    font-size: var(--font-size-base);
}

/* Icon-only variant — 36×36 circle, matched to the
   36px text pill so icon and text buttons align in the header row. */
.global-header-btn-icon {
    padding: 0;
    width: var(--control-h-base);
    height: var(--control-h-base);
    border-radius: var(--radius-pill);
}

/* The word under a bar icon (Menu / Search / Notifications / Support). Phone
   only: the phone block at the end of this file shows it. Off the phone the
   bar stays icons and tooltips. */
.global-header-btn__label {
    display: none;
}

/* The tap-away scrim behind the phone Search sheet. Phone only, same block. */
.global-topbar-search__scrim {
    display: none;
}

/* Circle alias — the icon-button family is a 36px circle. Kept as an alias so the
   templates that still carry .global-header-btn-circle need no markup change; .global-header-btn-icon
   already gives the circle, this just reasserts it for the few standalone uses. */
.global-header-btn-circle {
    width: var(--control-h-base);
    height: var(--control-h-base);
    border-radius: var(--radius-pill);
}

.global-header-btn-active {
    background: var(--color-action);
    color: var(--color-neutral-ink-fg);
    border-color: var(--color-action);
}

/* Pressed AND under the pointer. A click leaves the mouse on the button, and the
   neutral .global-header-btn:hover wash above outranked the pressed fill (a pseudo-class
   beats a bare class): every dashboard's Filter button opened its chip row and then
   sat there white text on pale grey until the mouse moved. Pressed keeps its ink
   and darkens the way a primary button does. */
.global-header-btn-active:hover {
    background: var(--color-action-hover);
    color: var(--color-neutral-ink-fg);
    border-color: var(--color-action-hover);
}

/* Destructive variant: only the hover fill leaves the icon-button family, so a
   delete keeps its cue without becoming a different button. */
.global-header-btn-danger:hover,
.global-header-btn-danger:focus-visible {
    background: var(--color-error);
    color: var(--color-neutral-ink-fg);
    border-color: var(--color-error);
}

/* Settings button — alias for backwards compat. Same 36×36 circle and
   neutral-darken hover as the shared icon-button family. */
.global-header-settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--control-h-base);
    height: var(--control-h-base);
    border-radius: var(--radius-pill);
    color: var(--color-text-light);
    background: transparent;
    border: 1px solid var(--color-border);
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.global-header-settings-btn:hover {
    background: var(--color-surface-hover);
}

.global-header-settings-btn i {
    font-size: var(--font-size-base);
}

/* ── Standardized header controls ──────────────────────────────────────────
   The header shares the sidebar (brand) surface, so per-org tints made every
   tenant's top bar look different — and washed out on light brands. Instead,
   EVERY control on the header (icon buttons, Bootstrap buttons, selects, the
   sidebar toggle, and the bespoke per-dashboard pickers below) renders from
   ONE fixed palette: a translucent white veil over the brand bar, white text,
   hairline white border, brightening on hover (mirrors the sidebar org-toggle).
   Org-independent by design — the --header-control-* tokens in tokens.css carry
   the exact values and the "no saturate()" note. New header widgets only need
   to opt into these selectors; they do NOT need their own header overrides.

   These lists are short because the bar is a closed set: it renders exactly what
   app_header.html includes — .global-sidebar-toggle, topbar_search, and the bell. So
   adding a class below does nothing unless the markup goes in that include too.
   #5388 is what happens when a name outlives its markup. */

/* One height for every control on the bar. The classes above are 36px on a
   page, but the bar is only 40px tall with 6px gutters, so a 36px control fills
   it edge to edge — the bell's unread badge was being clipped off the top of
   the screen. --filter-ctrl-h is the bar's own control height (28px, set on
   .global-app-header in filter-bar.css) and the number the 40px bar was derived from
   (tokens.css), so read it here. Scoped to .global-app-header, which leaves the same
   classes at 36px on role tiles and the opportunity detail page. The 28px
   fallback keeps the ref whole on pages that link main.css without
   filter-bar.css, like the standalone error pages. */
.global-app-header .global-header-btn,
.global-app-header .global-header-btn-icon,
.global-app-header .global-sidebar-toggle {
    height: var(--filter-ctrl-h, 28px);
    min-height: var(--filter-ctrl-h, 28px);
    min-width: var(--filter-ctrl-h, 28px);
}

/* The icon-only members are square; .global-header-btn keeps its automatic width so
   text buttons still grow with their label. */
.global-app-header .global-header-btn-icon,
.global-app-header .global-sidebar-toggle {
    width: var(--filter-ctrl-h, 28px);
}

/* The search-reveal icon exists for the compact shell only; the 1023px block
   below turns it on. On a wide bar the field itself is always in view. */
.global-topbar-search__reveal {
    display: none;
}

.global-app-header .global-header-btn i,
.global-app-header .global-sidebar-toggle i {
    font-size: var(--font-size-md);
}

.global-app-header .global-header-btn,
.global-app-header .global-sidebar-toggle {
    background: var(--header-control-bg);
    color: var(--header-control-fg);
    border-color: var(--header-control-border);
}

.global-app-header .global-header-btn:hover,
.global-app-header .global-sidebar-toggle:hover,
.global-app-header .global-header-btn:focus-visible,
.global-app-header .global-sidebar-toggle:focus-visible {
    background: var(--header-control-hover-bg);
    color: var(--header-control-hover-fg);
    border-color: var(--header-control-hover-bg);
}

/* ── Icon glyph centring ─────────────────────────────────────────────────────
   One cause, one cure, one place. Bootstrap Icons ships
   `.bi::before { display: inline-block; line-height: 1; vertical-align: -.125em }`
   — correct for an icon sitting in a line of text, wrong for an icon that IS a
   control's whole content. Flex-centring the button centres the <i>'s BOX
   (measured: the box offset is 0.0px in every family below), but the glyph ink
   still rides ~1-2px high inside that box, because the ::before is an inline
   box hanging off a baseline nothing else in the button shares.

   Making the <i> a flex container hands the ::before to flex centring too, and
   that is the only thing that moves the ink. Measured at 8x zoom against a
   flex-centred reference: the families below started anywhere from +0.5px to
   -2.0px off centre and all of them land at 0.0px (worst residual 0.5px, which
   is half a CSS pixel of rounding in an even-sized box).

   Three things that look like the fix and are not. `vertical-align: 0`,
   `vertical-align: baseline` and `line-height: 1` on the ::before each move the
   ink EXACTLY zero — the app carried the `vertical-align: 0` version on
   .global-icon-btn (230 call sites) for months and it never did anything.

   Two rules decide whether a family belongs here, and both are checkable:

   1. The control is itself a flex/grid container WITH an explicit width and
      height. Then the change is box-neutral twice over: the <i> is already
      blockified to `display: block` by its flex parent, so block -> flex is
      layout-identical, and the button's size is stated rather than derived. On
      a borderless auto-height control, `display: flex` collapses the <i>'s own
      inline strut and the button loses height — measured across the whole
      audit, applying this to every icon button in the app would have resized
      19 of them, by up to 8px. Those are also the borderless ones: no painted
      box for the glyph to sit off-centre in, so nothing there to fix. And
      `inline-flex` is not the way around it — over the same 65 specimens it
      measures worse than flex on both counts (mean |dy| 0.64 vs 0.20, worst
      4.19 vs 2.00) while still moving 14 boxes.

   2. The glyph is the control's ENTIRE content. A button that carries an icon
      NEXT TO text wants Bootstrap's -.125em, which optically seats the glyph on
      the text's baseline; centring it independently pulls it off that text.
      This is why .global-header-btn is deliberately absent (it has a "Top up" usage),
      and why .global-icon-btn is safe despite its one icon+"Edit" call site —
      that selector is scoped to .bi, and the flex parent had already blockified
      it. .assignments-role-row__chip-cancel qualifies because confirm-action.js
      swaps the whole child list out via textContent, taking the <i> with it.

   A new icon-only control with a fixed box belongs on this list; a rule that
   quietly puts one back into a stylesheet of its own is what
   tests/interface/test_icon_glyph_centring.py exists to catch. */
.global-icon-btn .bi,
.global-header-btn-icon i,
.global-header-btn-circle i,
.global-header-settings-btn i,
.global-drawer-close i,
.global-drawer-head__back i,
.global-btn-icon-copy i,
.global-btn-icon-placeholder i,
.global-sidebar-toggle i,
.global-sidebar-brand-logo-placeholder i,
.calendar-popover__close i,
.assignments-role-row__card-arrow i,
.assignments-role-row__chip-cancel i,
.assignments-terms__chip i,
.opportunities-meeting__action i,
.opportunities-calnav__btn i,
.opportunities-card__milestone-btn i,
.opportunities-card__role-tick i,
.global-toolbar__chip--round i,
.global-filter-builder-row__remove i,
.notifications-drawer__gear i,
.calendar-exc-list__remove i,
.payments-next-payout-banner__icon i,
.workers-photo-hero__edit i,
.settings-brand-section__info-toggle i,
.calendar-bucket-panel__delete-btn-cta i {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Three of the families above are used on <a> as well as <button>. Bootstrap's
   Reboot underlines anchors and the app has never reset that globally — the
   underline simply never PAINTED, because the <i> its flex parent had
   blockified swallowed the propagation. A flex <i> draws it: measured at 8x,
   the ink box on an anchor grows from 12x12 (glyph only) to a full 16x16 as
   soon as the rule above applies. The reset has to sit on the anchor itself; a
   propagated text decoration cannot be turned off from a descendant, so
   putting `text-decoration: none` on the <i> would do nothing.
   .opportunities-calnav__btn is the fourth anchor family and already resets its own.
   The header's support links (support_button.html) are the fifth. */
a.global-icon-btn,
a.global-btn-icon-copy,
a.global-header-btn-icon,
a.global-drawer-close,
a.notifications-drawer__gear {
    text-decoration: none;
}

/* ── Stateful toggles (dim = off, full = on) ─────────────────────────────────
   A .global-header-btn that carries an ON/OFF state — the calendar's Events and Tasks
   filters, the skills-detail edit toggle — opts in with .global-header-btn-toggle.
   When OFF it RECEDES — faded but still clickable; on hover it returns to full
   so it reads as "you can turn me on"; when ON it fills via .global-header-btn-active.
   Plain ACTION buttons (Today, Save, page actions) do NOT carry this class, so
   they keep full strength at rest. Opacity only, so it composes with whatever
   the base rules already set.

   Deliberately NOT scoped to .global-app-header. It was, and that is exactly why the
   dim went dark: blanking the top bar moved every one of these toggles into a
   page toolbar, and the scoped selector stopped matching anything. #4474 gave
   the calendar pair the page-body slot they teleport into; #4479 took the
   skills toggle off {% block header_actions %}. Nothing carries this class
   inside the bar today.

   Two names mean ON, because the toggles wear two button families: .global-header-btn
   fills via .global-header-btn-active, and a .global-icon-btn fills via .is-active
   (components/icon-button.css). A toggle that carried only one of them in this
   :not() would stay faded while it was on.

   Both values below are read off the live page by
   tests/browser/test_calendar_filter_dim_proof.py — the CSS gates check the
   sheet, so they stay green whatever these actually render as. Run it before
   retuning or deleting either. */
.global-header-btn-toggle:not(.global-header-btn-active):not(.is-active) {
    opacity: 0.55;
}
.global-header-btn-toggle:not(.global-header-btn-active):not(.is-active):hover,
.global-header-btn-toggle:not(.global-header-btn-active):not(.is-active):focus-visible {
    opacity: 1;
}

/* Route every real Bootstrap button's weight through the fixed --font-weight-button
   token. Bootstrap already defaults --bs-btn-font-weight to 400, so this is zero
   visual change — its purpose is to make real buttons and the bespoke button-like
   controls (which also read --font-weight-button) share ONE fixed source that no
   tenant brand-config can pull apart.

   The radius line rides the same rule: this sheet loads after Bootstrap, so it
   also beats .btn-sm/.btn-lg's own --bs-btn-border-radius and every button
   size wears the one shared shape. */
.btn {
    --bs-btn-font-weight: var(--font-weight-button);
    --bs-btn-border-radius: var(--radius-button);
}

.btn-sm {
    --bs-btn-padding-y: var(--spacing-xs);
    --bs-btn-padding-x: var(--spacing-sm);
    --bs-btn-font-size: var(--font-size-md);
}

/* A locked button is never `disabled`: it keeps taking the tap so it can say
   why in a toast. It only looks quiet. */
.btn[aria-disabled="true"] {
    opacity: 0.6;
    cursor: default;
    pointer-events: auto;
}

/* Same for a switch: the primary contact's correspondence toggle is locked on
   and explains itself in a toast, so it keeps the quiet look Bootstrap gave
   :disabled without giving up the tap. */
.form-check-input[aria-disabled="true"] {
    opacity: 0.6;
    cursor: default;
    pointer-events: auto;
}

@media (max-width: 1023px) {
    .global-app-main {
        margin-left: 0;
    }

    .global-sidebar {
        transform: translateX(-100%);
        width: 100vw;
        max-width: 320px;
    }

    .global-sidebar.is-open {
        transform: translateX(0);
    }

    .global-sidebar.is-open + .global-sidebar-scrim {
        opacity: 1;
        pointer-events: auto;
    }

    .global-sidebar-toggle {
        display: inline-flex;
    }

    .global-sidebar-close {
        display: inline-flex;
    }

    /* Compact nav items on mobile to prevent scrollbar */
    .global-sidebar-nav a {
        padding: var(--spacing-xsm) 0;
    }

    .global-sidebar-nav a i,
    .global-sidebar-nav a .bi {
        font-size: var(--font-size-base);
        width: 48px;
    }

    .global-sidebar-icon-rail {
        width: 48px;
    }

    /* The bar is 56px here (--header-height-touch on :root, tokens.css) and
       every control in it grows to the 44px touch target. Wins over the
       28px --filter-ctrl-h rule above by source order. */
    .global-app-header .global-header-btn-icon,
    .global-app-header .global-sidebar-toggle {
        width: var(--control-h-touch);
        height: var(--control-h-touch);
        min-width: var(--control-h-touch);
        min-height: var(--control-h-touch);
    }

    .global-app-header .global-header-btn {
        height: var(--control-h-touch);
        min-height: var(--control-h-touch);
    }

    /* Search collapses to one icon; the field drops in as a full-width row
       under the bar when tapped (topbar_search.html toggles is-revealed).
       The header is position: sticky, so top: 100% hangs off its bottom edge.
       Qualified with the header so it beats topbar-search.css's 600px rule. */
    .global-app-header .global-topbar-search {
        flex: 0 0 auto;
        min-width: 0;
        max-width: none;
    }

    .global-topbar-search__reveal {
        display: inline-flex;
    }

    .global-topbar-search__form {
        display: none;
        position: absolute;
        top: 100%;
        inset-inline: 0;
        padding: var(--spacing-sm) var(--page-gutter);
        background: var(--header-bg);
    }

    .global-topbar-search.is-revealed .global-topbar-search__form {
        display: flex;
    }

    /* 16px stops iOS zooming the page on focus; 44px is the touch target. */
    .global-topbar-search__form .global-filter-control {
        font-size: var(--font-size-base);
        min-height: var(--control-h-touch);
    }
}

@media (min-width: 1024px) {
    .global-sidebar-toggle {
        display: none;
    }

    .global-sidebar-scrim {
        display: none;
    }

    .global-sidebar-collapse-btn {
        display: flex;
    }

    /* Show header on desktop for settings gear and page title */
    .global-app-header {
        display: flex;
        padding-left: var(--spacing-sm);
    }

    /* Inverted corner where the sidebar meets the header: a chrome-colored
       square hanging off the header's bottom-left with a quarter-circle cut,
       so the L-shaped top strip curves into the content instead of meeting
       it at a hard right angle. Rides the sticky header (and the collapsing
       sidebar edge, since the header starts where the sidebar ends), staying
       pinned while content scrolls beneath. Desktop-only — without the
       sidebar there is no inner corner to soften. */
    .global-app-header::before {
        content: "";
        position: absolute;
        /* Pin to the header's VISUAL bottom (Y = --header-height). Subtlety:
           for an absolutely-positioned child, `top:100%` resolves against the
           header's PADDING box, which is 1px shorter than its border-box
           because of the 1px `border-bottom`. So `top:100%` sits at Y=39 on a
           40px header — exactly over that border line. The box then runs down
           (R+1)px to Y = 39 + R + 1 = 40 + R, putting the gradient center at
           the true bottom-right corner (256+R, 40+R). With the circle there,
           the arc's apex lands at Y=40 — flush with the flat header bottom to
           the right, no 1px step. The box's top 1px (Y=39→40) overlays the
           faint-white border-bottom (--sidebar-border) with the wine fill so
           it never paints a white line across the top of the curve.
           (The prior `calc(100% - 1px)` mistook the padding box for the
           border-box and centered the circle 1px high, leaving a visible lip
           where the curve met the flat edge.) */
        top: 100%;
        left: 0;
        width: var(--radius-lg);
        height: calc(var(--radius-lg) + 1px);
        /* The fill is a SOLID, opaque brand color; the quarter-circle is
           carved out with a MASK, not painted with a second gradient color.
           Why a mask: the old fill baked one specific "behind" color into the
           arc's inner stop, so it only matched pages whose content area WAS
           that color — any page with a different background (the org home
           color, the black stream shell, anything future) flashed the stale
           inner color as a white/mismatched square in the corner. A mask
           touches only the alpha channel: the disc is genuinely cut away so
           WHATEVER sits behind this corner shows through unchanged, on every
           page, with zero per-page setup. And because the visible pixels are
           always pure --header-bg (never a color interpolated toward
           `transparent`), the anti-aliased arc has no gray/black halo — the
           exact "white line on the curve" the color-gradient version risked.
           Track --header-bg (not --sidebar-bg): this pseudo hangs off the
           header's bottom edge, and stream.css overrides --header-bg on its
           own, so the corner must follow the header it's attached to.

           Two background layers: on TOP, a 1px --sidebar-border hairline ring
           at exactly the cut radius; below it, the solid --header-bg. The ring
           traces the concave arc, so the divider hairline is continuous around
           the corner — its top meets the header's bottom border, its bottom
           meets the sidebar's vertical ::after hairline (which starts at the
           arc's lower tangent, header-height + radius). Without it the border
           just stopped at the curve and the rounded corner read as unfinished.
           The ring is an ARC (radial), not a straight line through the curve —
           that straight-line version is the ugly "white line on the left of
           the radius" the sidebar::after offset was added to avoid. */
        background:
            radial-gradient(
                circle at 100% 100%,
                transparent var(--radius-lg),
                var(--sidebar-border) var(--radius-lg),
                var(--sidebar-border) calc(var(--radius-lg) + 1px),
                transparent calc(var(--radius-lg) + 1px)
            ),
            var(--header-bg);
        -webkit-mask: radial-gradient(
            circle at 100% 100%,
            transparent var(--radius-lg),
            #000 calc(var(--radius-lg) + 0.5px)
        );
        mask: radial-gradient(
            circle at 100% 100%,
            transparent var(--radius-lg),
            #000 calc(var(--radius-lg) + 0.5px)
        );
        pointer-events: none;
    }

    /* Start the sidebar's right-edge hairline BELOW the inverted corner. The
       base rule (sidebar.css) starts it at the header bottom (Y = header-bottom)
       so the top strip reads seamless on mobile — but on desktop the corner
       fillet above curves down the sidebar edge for --radius-lg px, and a
       straight hairline through that zone paints a faint-white line flanked by
       wine on both sides (sidebar left, fillet right) = a visible line on the
       left of the radius. Pushing the start down by --radius-lg lands it exactly
       at the fillet's tangent point (Y = header-bottom + radius), so the curve
       owns the rounded zone and the hairline picks up cleanly below it. */
    .global-sidebar::after {
        top: calc(var(--header-bottom) + var(--radius-lg));
    }

    /* On desktop the sidebar sits in its fixed column; global-app-main pushes right via
       margin-left so the sidebar never overlays content. Bootstrap modals are
       z-index 1040 (backdrop) / 1050 (dialog). Keeping sidebar at 1060 here
       caused modals to render behind it. 1030 is below the modal stack. */
    .global-sidebar {
        z-index: var(--z-dropdown);
    }
}

/* The focus ring is the platform's, not Bootstrap's: without this the ring a
   focused button wears is Bootstrap's own blue (--bs-btn-focus-shadow-rgb is
   hard-typed per variant, so repointing --bs-primary never reaches it). */
.btn-primary {
    --bs-btn-focus-box-shadow: var(--shadow-focus-ring);
    --bs-btn-bg: var(--brand-primary);
    --bs-btn-border-color: var(--brand-primary);
    --bs-btn-color: var(--brand-primary-fg);
    --bs-btn-hover-bg: var(--brand-secondary);
    --bs-btn-hover-border-color: var(--brand-secondary);
    --bs-btn-hover-color: var(--brand-secondary-fg);
    --bs-btn-active-bg: var(--brand-highlight);
    --bs-btn-active-border-color: var(--brand-highlight);
    --bs-btn-active-color: var(--brand-highlight-fg);
    --bs-btn-disabled-bg: var(--brand-primary);
    --bs-btn-disabled-border-color: var(--brand-primary);
    --bs-btn-disabled-color: var(--brand-primary-fg);
}

/* Neutral-ink primary CTA — public auth, invite, and error surfaces.
   A fixed dark neutral that carries the SAME weight for every tenant (holds
   zero brand or status color), reusing the --color-neutral-ink token set.
   Applied via .global-btn-ink on those specific public CTAs only; the signed-in app
   shell keeps .btn-primary (brand) for org work. The one exception inside the
   shell is the profile-photo nudge strip: a missing profile picture is an
   account-level fact that reads the same on every tenant, so its CTA carries
   the platform ink rather than the org's fill. It travels with the button
   regardless of which public base wraps it, so it survives the pending
   error-page unification onto public.html. */
.global-btn-ink {
    --bs-btn-bg: var(--color-neutral-ink);
    --bs-btn-border-color: var(--color-neutral-ink);
    --bs-btn-color: var(--color-neutral-ink-fg);
    /* Base hover/active use the FLAT ink token, not the color-mix-derived
       press ink. On engines without color-mix (pre-2023 Safari/Chrome/Firefox)
       a var() that resolves to an unsupported color-mix would be invalid at
       computed-value time, blanking --bs-btn-hover-bg to transparent while the
       white hover text stays — invisible text. The flat token degrades safely
       (filled button, no enrichment); the @supports block below restores the
       darker press ink on modern engines. */
    --bs-btn-hover-bg: var(--color-neutral-ink);
    --bs-btn-hover-border-color: var(--color-neutral-ink);
    --bs-btn-hover-color: var(--color-neutral-ink-fg);
    --bs-btn-active-bg: var(--color-neutral-ink);
    --bs-btn-active-border-color: var(--color-neutral-ink);
    --bs-btn-active-color: var(--color-neutral-ink-fg);
    --bs-btn-disabled-bg: var(--color-neutral-ink);
    --bs-btn-disabled-border-color: var(--color-neutral-ink);
    --bs-btn-disabled-color: var(--color-neutral-ink-fg);
}

/* Visible, accessible focus ring. Base ring is the solid ink token (universally
   supported); the transparent outline surfaces a ring under forced-colors /
   Windows High Contrast Mode where box-shadow is dropped. */
.global-btn-ink:focus-visible {
    box-shadow: 0 0 0 0.25rem var(--color-neutral-ink);
    outline: 2px solid transparent;
    outline-offset: 2px;
}

/* Enrichment for engines that support color-mix (2023+): the darker press ink
   on hover/active and the softer translucent focus ring. Gated so old engines
   never substitute an unsupported color-mix value into a real property. */
@supports (color: color-mix(in srgb, red, blue)) {
    .global-btn-ink {
        --bs-btn-hover-bg: var(--color-neutral-ink-hover);
        --bs-btn-hover-border-color: var(--color-neutral-ink-hover);
        --bs-btn-active-bg: var(--color-neutral-ink-hover);
        --bs-btn-active-border-color: var(--color-neutral-ink-hover);
    }
    .global-btn-ink:focus-visible {
        box-shadow: 0 0 0 0.25rem var(--neutral-ink-focus-ring);
    }
}

/* An icon button is not a .btn, so it ignores the --bs-btn-* colors. Paint them
   on it here. */
.global-icon-btn.global-btn-ink {
    border-color: var(--bs-btn-border-color);
    background: var(--bs-btn-bg);
    color: var(--bs-btn-color);
}

.global-icon-btn.global-btn-ink:hover {
    border-color: var(--bs-btn-hover-border-color);
    background: var(--bs-btn-hover-bg);
    color: var(--bs-btn-hover-color);
}

/* Outline buttons are quiet controls, so they wear the action ink ramp, not
   the tenant's brand: ink label, neutral hairline, and a warm tint wash on
   hover instead of a fill flip — the filled .btn-primary above stays the one
   brand-colored button. This is a one-token default: point these at
   --brand-primary again to restore branded outlines everywhere. */
.btn-outline-primary {
    --bs-btn-focus-box-shadow: var(--shadow-focus-ring);
    --bs-btn-color: var(--color-action);
    --bs-btn-border-color: var(--color-border);
    --bs-btn-hover-bg: var(--color-action-tint);
    --bs-btn-hover-border-color: var(--color-action-hover);
    --bs-btn-hover-color: var(--color-action);
    --bs-btn-active-bg: var(--color-action-tint-pressed);
    --bs-btn-active-border-color: var(--color-action-pressed);
    --bs-btn-active-color: var(--color-action);
}

.btn-secondary {
    --bs-btn-color: var(--color-card-bg);
    --bs-btn-bg: var(--color-grey-600);
    --bs-btn-border-color: var(--color-grey-600);
    --bs-btn-hover-color: var(--color-card-bg);
    --bs-btn-hover-bg: var(--color-grey-700);
    --bs-btn-hover-border-color: var(--color-grey-700);
    --bs-btn-active-color: var(--color-card-bg);
    --bs-btn-active-bg: var(--color-grey-700);
    --bs-btn-active-border-color: var(--color-grey-700);
    --bs-btn-disabled-color: var(--color-card-bg);
    --bs-btn-disabled-bg: var(--color-grey-600);
    --bs-btn-disabled-border-color: var(--color-grey-600);
    --bs-btn-focus-box-shadow: var(--shadow-focus-ring);
}

.btn-danger {
    --bs-btn-color: var(--color-card-bg);
    --bs-btn-bg: var(--color-error);
    --bs-btn-border-color: var(--color-error);
    --bs-btn-hover-color: var(--color-card-bg);
    --bs-btn-hover-bg: var(--color-error-text);
    --bs-btn-hover-border-color: var(--color-error-text);
    --bs-btn-active-color: var(--color-card-bg);
    --bs-btn-active-bg: var(--color-error-text);
    --bs-btn-active-border-color: var(--color-error-text);
    --bs-btn-disabled-color: var(--color-card-bg);
    --bs-btn-disabled-bg: var(--color-error);
    --bs-btn-disabled-border-color: var(--color-error);
    --bs-btn-focus-box-shadow: var(--shadow-focus-ring);
}

.btn-outline-secondary {
    --bs-btn-color: var(--color-grey-600);
    --bs-btn-border-color: var(--color-grey-600);
    --bs-btn-hover-bg: var(--color-grey-600);
    --bs-btn-hover-border-color: var(--color-grey-600);
    --bs-btn-hover-color: var(--color-card-bg);
    --bs-btn-active-bg: var(--color-grey-700);
    --bs-btn-active-border-color: var(--color-grey-700);
    --bs-btn-active-color: var(--color-card-bg);
    --bs-btn-disabled-color: var(--color-grey-600);
    --bs-btn-disabled-border-color: var(--color-grey-600);
    --bs-btn-focus-box-shadow: var(--shadow-focus-ring);
}

/* Monochrome brand hover signal.
   When primary and accent are perceptually identical (Fortis-style black
   palette, or any tenant with brand colors that don't differ visibly),
   the standard primary→accent color flip on hover produces no feedback.
   The body.core-brand-monochrome class is set server-side from
   brand_tokens.is_monochrome and engages an alternative signal model:
   an elevation lift and a perceptible-hover background using the
   HSL-shifted brand variant.

   Only the two controls still painting brand need the rescue — the filled
   .btn-primary and the sidebar toggle. Every other control hovers in the
   fixed action ink, which is always distinct from itself. */

body.core-brand-monochrome .btn-primary:hover,
body.core-brand-monochrome .global-sidebar-toggle:hover {
    background: var(--brand-primary-hover);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    transform: translateY(-1px);
}

body.core-brand-monochrome .btn-primary:active,
body.core-brand-monochrome .btn-primary.active {
    background: var(--brand-primary);
    transform: translateY(0);
    box-shadow: inset 0 2px 4px var(--ink-alpha-15);
}

/* Reduce motion: keep the elevation but drop the translateY. */
@media (prefers-reduced-motion: reduce) {
    body.core-brand-monochrome .btn-primary:hover,
    body.core-brand-monochrome .global-sidebar-toggle:hover {
        transform: none;
    }
}

/* Bootstrap's own idea of "primary" and "link", pointed at ours.

   We theme Bootstrap through custom properties rather than a Sass build, so
   every colour it ships in :root is a colour this app has to consciously aim
   somewhere. The ones below are the ones nobody aimed, and they are upstream
   of more surfaces than their names suggest: --bs-link-color paints .btn-link
   (50 uses across 37 templates), and --bs-primary/-rgb paint .text-primary
   (25), .bg-primary (18), .border-primary, .text-bg-primary, .badge and the
   active row of a dropdown or list group. All of them rendered #0d6efd — a
   blue that belongs to no tenant and to no token here.

   Aimed at the fixed action ink, the same pair `a` uses below, so a link is
   one colour whether it is an anchor, a .btn-link or a .page-link — and the
   same colour on every tenant. The -rgb triples exist because these
   utilities build their own opacity (`rgba(var(--bs-primary-rgb),
   var(--bs-bg-opacity))`) and a hex cannot go there; test_css_standards pins
   each triple to its hex twin so they cannot drift.

   :root, not .btn-link, deliberately: a per-component override fixes one
   component and leaves the next one to be found by eye. */
:root {
    --bs-primary: var(--color-action);
    --bs-primary-rgb: var(--color-action-rgb);
    --bs-link-color: var(--color-action);
    --bs-link-color-rgb: var(--color-action-rgb);
    --bs-link-hover-color: var(--color-action-hover);
    --bs-link-hover-color-rgb: var(--color-action-hover-rgb);
    /* Bootstrap's tint/shade pair for the same colour. It ships them as three
       more flat hexes (#cfe2ff, #9ec5fe, #052c65) rather than deriving them,
       so repointing --bs-primary above leaves them behind — which is how the
       seven "Write" badges on the payment settings page stayed stock blue
       while the rest of the page moved. A warm tint reads as "subtle" behind
       the ink, the standard hairline holds the border, and the ink itself is
       legible on any app surface. */
    --bs-primary-bg-subtle: var(--color-action-tint-pressed);
    --bs-primary-border-subtle: var(--color-border);
    --bs-primary-text-emphasis: var(--color-action);
    /* Bootstrap builds this one itself out of --bs-primary-rgb, which would
       now be right — but the app's focus ring is its own platform token, not
       the brand, so that it stays a constant signal across every tenant. */
    --bs-focus-ring-color: var(--color-focus-ring-alpha);
}

/* The components Bootstrap does NOT build out of --bs-primary. Each of these
   bakes the literal #0d6efd into its own component property, so repointing the
   root token above does nothing for them and they have to be named. Listed
   together rather than filed next to each component so the whole stock-blue
   surface is one screenful — tests/browser/test_no_stock_bootstrap_blue.py
   walks the same list and fails if a new one appears.

   Almost none of this is on a page today. Counting exact class tokens inside
   class attributes across interface/templates and apps: zero .dropdown-menu,
   zero .dropdown-item, zero .nav-pills, zero .nav-link, zero .progress-bar,
   zero .accordion, and no .list-group-item that is ever .active. .pagination is
   the one that ships (22 uses) and its active-page fill is already brand further
   down — only the focus glow is still Bootstrap's. That is exactly why the rest
   are here: the fix is cheap now and invisible, and the alternative is finding
   them one at a time, in blue, after someone ships a page that uses one. */
.dropdown-menu {
    --bs-dropdown-link-active-bg: var(--color-action);
    --bs-dropdown-link-active-color: var(--color-neutral-ink-fg);
}

.nav-pills {
    --bs-nav-pills-link-active-bg: var(--color-action);
    --bs-nav-pills-link-active-color: var(--color-neutral-ink-fg);
}

.list-group {
    --bs-list-group-active-bg: var(--color-action);
    --bs-list-group-active-border-color: var(--color-action);
    --bs-list-group-active-color: var(--color-neutral-ink-fg);
}

.progress {
    --bs-progress-bar-bg: var(--color-action);
}

.accordion {
    --bs-accordion-btn-focus-box-shadow: var(--shadow-focus-ring);
}

.pagination {
    /* The active-page fill is already brand, further down with the rest of the
       pagination rules; this is only the focus glow, which is a separate
       baked-in property. */
    --bs-pagination-focus-box-shadow: var(--shadow-focus-ring);
}

/* The one that is not a custom property: Bootstrap writes this shadow straight
   into the rule, so there is nothing to repoint and it takes a real override. */
.nav-link:focus-visible {
    box-shadow: var(--shadow-focus-ring);
}

/* Link color for main content: ink, like the text around it — the underline
   Bootstrap already draws is what says "link". One-token default: point these
   back at --brand-primary to restore branded links everywhere. */
a {
    color: var(--color-action);
}

a:hover {
    color: var(--color-action-hover);
}

/* .btn-close is the one control that opts out of the app's focus outline:
   Bootstrap gives it `outline: 0` plus a box-shadow glow, at a specificity
   the global :focus-visible rule cannot reach. Left as a glow on purpose —
   an outline around a 12px X reads as a box, not a ring — but recoloured to
   the platform focus ring so the 20 close buttons in the app stop flashing
   Bootstrap blue at keyboard users. */
.btn-close {
    --bs-btn-close-focus-shadow: var(--shadow-focus-ring);
}

/* Sidebar links: text color depends on the underlying surface.
   - Inactive items sit on --sidebar-bg (= --brand-primary), so they use --sidebar-text.
   - Active items sit on --sidebar-active-bg (= --brand-secondary), so they use --brand-secondary-fg.
   The :not([aria-current="page"]) selector ensures the override below only forces the
   "inactive" text color on inactive links — active links keep the more-specific
   .global-sidebar-nav a[aria-current="page"] rule (which sets brand-secondary-fg). Without this split,
   a tenant with a light primary + dark secondary (Fortis) would render active text
   in the inactive (light-bg) foreground, which collapses to invisibility. */
.global-sidebar a:not([aria-current="page"]),
.global-sidebar a:link:not([aria-current="page"]),
.global-sidebar a:visited:not([aria-current="page"]),
.global-sidebar a:hover:not([aria-current="page"]),
.global-sidebar a:focus:not([aria-current="page"]),
.global-sidebar a:active:not([aria-current="page"]) {
    color: var(--sidebar-text) !important;
    text-decoration: none;
}
.global-sidebar a[aria-current="page"] {
    color: var(--brand-secondary-fg) !important;
    text-decoration: none;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-focus-ring);
    box-shadow: 0 0 0 0.2rem var(--color-focus-ring-alpha);
}

/* Checked fill is the fixed action ink, not the tenant's brand: check/radio/
   switch marks are quiet controls and read identically on every org. */
.form-check-input:checked {
    background-color: var(--color-action);
    border-color: var(--color-action);
}

.form-check-input:focus {
    border-color: var(--color-focus-ring);
    box-shadow: 0 0 0 0.2rem var(--color-focus-ring-alpha);
}

/* The bare fill utility. Bootstrap gives it a background and no foreground;
   pair the ink fill with its fixed white so the next bare
   `<div class="bg-primary">` is legible without anyone having to remember.
   Not !important, so an explicit .text-white or .text-dark still wins. */
.bg-primary {
    color: var(--color-neutral-ink-fg);
}

/* .badge fills, pinned to the same fixed pair so the two spellings of
   "primary badge" cannot diverge. */
.badge.bg-primary {
    background-color: var(--color-action) !important;
    color: var(--color-neutral-ink-fg) !important;
}

.badge.text-bg-primary {
    color: var(--color-neutral-ink-fg) !important;
}

.badge.bg-success {
    background-color: var(--color-success) !important;
}

.badge.bg-warning {
    background-color: var(--color-warning) !important;
    color: var(--color-text) !important;
}

.badge.bg-danger {
    background-color: var(--color-error) !important;
}

.badge.bg-info {
    background-color: var(--color-info) !important;
}

.page-link {
    color: var(--color-action);
}

.page-link:hover {
    color: var(--color-action-hover);
}

.page-item.active .page-link {
    background-color: var(--color-action);
    border-color: var(--color-action);
}

.navbar-brand {
    color: var(--color-action);
}

.card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
}

.global-list-clickable .list-group-item[data-href] {
    cursor: pointer;
    transition: background-color 0.1s ease;
}

.global-list-clickable .list-group-item[data-href]:hover {
    background-color: var(--color-surface-subtle);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--color-border);
    padding: var(--spacing-md);
    font-weight: var(--font-weight-medium);
}

.card-body {
    padding: var(--spacing-md);
}

.global-stat-card {
    padding: var(--spacing-lg);
    text-align: center;
}

.global-stat-card-value {
    font-size: 2.5rem;
    font-weight: var(--font-weight-medium);
    color: var(--color-action);
    line-height: 1;
    margin-bottom: var(--spacing-xs);
}

.global-stat-card-label {
    font-size: var(--font-size-md);
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.global-action-dropdown {
    position: relative;
    display: inline-block;
}

/* Icon-only 3-dot kebab. Sized off the same padding/line-height as a primary
   button so a row's kebab and its primary action share one control height. */
.global-action-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm) var(--spacing-sm);
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-md);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-family);
    line-height: 1.4;
}

.global-action-dropdown-toggle:hover {
    border-color: var(--color-text-muted);
    background: var(--color-grey-50);
    color: var(--color-text);
}

.global-action-dropdown-toggle:focus {
    outline: none;
    border-color: var(--color-focus-ring);
    box-shadow: var(--shadow-focus-ring);
}

.global-action-dropdown-toggle--sm {
    padding: var(--spacing-xs) var(--spacing-xsm);
    font-size: var(--font-size-sm);
}

.global-action-dropdown-toggle--outline {
    background: transparent;
}

/* Still worn by the skill-level dropdown (and any other labelled toggle); the
   payments kebab went icon-only and no longer emits these, but they stay for
   the toggles that do. */
.global-action-dropdown-label {
    white-space: nowrap;
}

.global-action-dropdown-chevron {
    width: 1rem;
    height: 1rem;
    opacity: 0.5;
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

.global-action-dropdown-chevron.global-rotate-180 {
    transform: rotate(180deg);
}

.global-action-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--spacing-xs);
    /* A menu sizes itself to its rows: 10rem is the floor, max-content is the
       ask, and the ceiling keeps it on screen. Without max-content a label
       longer than the floor wraps mid-phrase; without the ceiling an org that
       types a 50-character word for its people (the vocabulary field allows it)
       pushes the panel off the left edge of a phone. Over the ceiling it wraps
       again, which is the right thing to do at that length. */
    min-width: 10rem;
    width: max-content;
    max-width: min(20rem, calc(100vw - 2rem));
    overflow: hidden;
}

.global-action-dropdown-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-smd);
    background: none;
    border: none;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-body);
    text-align: left;
    /* Some rows are links among the buttons, and Bootstrap underlines a link. */
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition-fast);
    font-family: var(--font-family);
    /* A label can be one unbroken token an org typed itself, and a token with no
       spaces has nowhere to wrap — it would run under the panel's clipped edge.
       anywhere rather than break-word because the label is an anonymous flex
       item, and only anywhere lets it shrink below the token's own width.
       Normal labels are unaffected: max-content ignores soft-wrap opportunities,
       so they still size the panel exactly as before. */
    overflow-wrap: anywhere;
}

/* menu.css paints the row's hover, its chosen fill and the red of a
   destructive row (--danger, which replaces per-page `text-danger`). */
.global-action-dropdown-item.is-active {
    color: var(--color-action);
}

.global-action-dropdown-item .bi-check2 {
    color: var(--color-success);
}

/* A listed-but-blocked overflow action: greyed, unclickable, with a why-only
   reason line under its label (no hover, no pointer). */
.global-action-dropdown-item--disabled {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xs);
    cursor: default;
    opacity: 0.6;
}

.global-action-dropdown-item--disabled:hover {
    background: none;
}

.global-action-dropdown-item__row {
    display: flex;
    align-items: center;
}

.global-action-dropdown-item__reason {
    font-size: var(--font-size-2xs);
    color: var(--color-text-light);
    line-height: 1.2;
}

/* Outbound brand link row: the platform's own logo on the left, a new-tab
   arrow pushed to the right. The logo is the label (aria-label carries the
   words), so the marks get a fixed height and keep their own width. */
.global-action-dropdown-item--brand {
    justify-content: space-between;
    gap: var(--spacing-smd);
}

.global-action-dropdown-item__brand-img {
    height: 18px;
    width: auto;
    display: block;
}

.global-action-dropdown-item__ext {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* Custom single-select (skillbridge.customSelect).
   A styled replacement for a native <select>: a full-width form-control
   toggle plus an own-painted option list. Mirrors .global-action-dropdown's look
   (white menu, soft shadow, ink-tinted active row) but is sized like a
   .global-form-control-modern so it sits flush beside real inputs in the form. */
.global-cs {
    position: relative;
}

/* Editable combobox control: a text <input> (carrying .global-form-control-modern for
   height/border/radius) with the chevron overlaid on the right. The input is a
   real search field — focus opens the list, typing filters it. */
.global-cs-control {
    position: relative;
}

.global-cs-input {
    /* Leave room on the right so typed text never slides under the chevron. */
    width: 100%;
    padding-right: var(--spacing-xl);
    /* An I-beam cursor signals "you can type here", not just "click to open". */
    cursor: text;
}

.global-cs-input:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    background: var(--bs-secondary-bg);
}

/* A combobox whose job is searching (the Ramp vendor box) wears the global
   page-search glyph inside the field (filter-bar.css .global-search-icon), so
   the text starts past it — the same 2.5rem the page search input keeps. */
.global-cs--search .global-cs-input {
    padding-left: var(--spacing-2xl);
}

/* Centered date pickers (shared/components/_date_select.html — the month/day/year
   comboboxes in the Create-Opportunity drawer and any other dateSelect host),
   centered like the header month/year pills. The box is padded the same on
   both sides, so the centered value lands at true center. Both sides are set
   here: .global-form-control-modern comes later in this file and its 1rem
   padding beats the 2rem right padding .global-cs-input asks for, which let
   "September" run under the chevron. 1.75rem a side clears the chevron (it
   ends about 1.6rem in from the right edge) and still fits "September" in a
   drawer's narrow boxes, where 2rem a side cut it short. */
.global-cs-date-row .global-cs-input {
    padding-inline: calc(var(--spacing-lg) + var(--spacing-xs));
    text-align: center;
}

/* Phone: the month takes its own line and the day and year share the next,
   so the longest month ("September") is never cut short. The row's Bootstrap
   utilities fix flex with !important, so each box sizes through width, which
   flex-basis: auto reads. */
@media (max-width: 767.98px) {
    .global-cs-date-row {
        flex-wrap: wrap;
    }

    .global-cs-date-row > .global-cs {
        width: 0;
    }

    .global-cs-date-row > .global-cs:first-child {
        width: 100%;
    }
}

/* The three parts of shared/components/_time_select.html (hour / minute / AM-PM),
   laid out by a class of our own rather than Bootstrap's `.d-flex .gap-2` on the
   row and `.flex-fill` on each part. Those utilities declare `!important`, so a
   host that wants the three parts merged into ONE field cannot override them: the
   working-hours grid's `gap: 0` and `flex: 1 1 0` (features/working-hours.css)
   were dead from the day they were written. The 8px the gap never removed landed
   INSIDE each value's cell — the hairline between parts is a border ON the part,
   so the gap sits inside the cell it appears to separate — and pushed every
   number ~4px left of its centre. These are
   the declarations the utilities produced, so every host renders as it did. */
.global-time-select {
    display: flex;
    gap: var(--spacing-sm);
}

.global-time-select > .global-cs {
    flex: 1 1 auto;
}

/* A part is narrow — an hour cell inside the merged working-hours field measures
   ~35px on a 1280px screen — and .global-cs-menu is pinned to its anchor's width
   (left: 0; right: 0). Take the menu's own --spacing-xsm padding and each item's
   own side padding out of that and the label box was 3px wide: every option was
   built, painted and unreadable. The anchor's width stays the FLOOR, so a wide
   host — the opportunity form, the segment drawer — is unchanged and only a menu
   narrower than its own options grows. */
.global-time-select .global-cs-menu {
    min-width: max(100%, 4rem);
    width: max-content;
}

/* Grown past its anchor, the last part's menu would hang off the right edge of
   the field it belongs to, so that one opens leftward. */
.global-time-select > .global-cs:last-child .global-cs-menu {
    left: auto;
    right: 0;
}

.global-cs-control .global-cs-toggle__chev {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    /* The chevron is decoration over the input — clicks should land on the
       input (which opens the menu), not get swallowed by the icon. */
    pointer-events: none;
}

.global-cs-control .global-cs-toggle__chev.is-open {
    transform: translateY(-50%) rotate(180deg);
}

/* Picked-option face (opt-in — only drawn when the option carries a photo or
   initials, see _custom_select.html): overlaid on the input's left edge the
   same way the chevron overlays its right edge. pointer-events: none for the
   same reason as the chevron — it's decoration over the input, not a target. */
.global-cs-control__avatar {
    position: absolute;
    top: 50%;
    left: 0.5rem;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Room for the avatar so typed/picked text never renders under it. */
.global-cs-input.global-cs-input--avatar {
    padding-left: var(--spacing-xl);
}

/* Clear button (opt-in — cs.clearable): sits in the chevron's own slot,
   swapped in when a value is picked (see the x-show pair in
   _custom_select.html) rather than stacked beside it, so the 36px control
   never has to fit two icons at once. */
.global-cs-clear {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xs);
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    line-height: 1;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.global-cs-clear:hover {
    background-color: var(--color-grey-50);
    color: var(--color-text);
}

.global-cs-clear:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 1px;
}

/* Clear button for a whole date or time row (opt-in — cs_clearable on
   _date_select.html / _time_select.html): one round x after the row, shown
   once any part is picked, that empties every part. It sits beside the row,
   not inside a block, because it clears the date, not the month. */
.global-cs-clearable {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.global-cs-clearable > .global-cs-date-row,
.global-cs-clearable > .global-time-select {
    flex: 1 1 auto;
    min-width: 0;
}

.global-cs-clearable__btn {
    flex: 0 0 auto;
}

/* The x takes the room "September" needed, so on a wide screen the month
   starts 2rem ahead of the day and year and they share what is left (width is
   the basis .flex-fill reads, as in the phone rule above, which still wins
   there). */
@media (min-width: 768px) {
    .global-cs-clearable > .global-cs-date-row > .global-cs {
        width: 0;
    }

    .global-cs-clearable > .global-cs-date-row > .global-cs:first-child {
        width: 2rem;
    }
}

/* Mirror Bootstrap's .is-invalid red ring on the combobox input. */
.global-cs--invalid .global-cs-input {
    border-color: var(--color-error);
}

.global-cs--invalid .global-cs-input:focus {
    box-shadow: 0 0 0 3px var(--status-danger-bg);
}

.global-cs-toggle__chev {
    flex-shrink: 0;
    opacity: 0.5;
    transition: transform var(--transition-fast);
}

.global-cs-toggle__chev.is-open {
    transform: rotate(180deg);
}

.global-cs-menu {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    /* Tall option lists scroll inside the popup rather than pushing the drawer
       — keeps the menu inside the panel even near the bottom edge. */
    max-height: 16rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Opens upward when the menu would drop past the bottom of whatever clips it —
   customSelect sets csDrop at open time; see dropDirection() in custom-select.js.
   max-height alone does not save a menu near a fold: it caps the height, but a
   256px popup hung off a control 40px from the bottom of the drawer is still
   216px of options painted where nobody can see them. The shadow lifts the other
   way so the menu still reads as sitting above the page, not under it. */
.global-cs-menu--up {
    top: auto;
    bottom: calc(100% + 0.25rem);
    box-shadow: var(--shadow-menu-up);
}

.global-cs-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-sm);
    background: none;
    border: none;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-body);
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--transition-fast);
    font-family: var(--font-family);
}

/* Groups an option's optional avatar with its text so .global-cs-item's own
   space-between still only splits two things — this block and the check —
   instead of spreading a third avatar child away from the label it belongs
   next to. Empty of any avatar (every existing customSelect caller), this is
   a single-child flex row and lays out exactly as .global-cs-item__text did alone. */
/* Multi-pick mode (customSelect({ multiple: true })): each option carries a
   box the pick state fills — display only, the row is the button — and the
   picks stack as chips under the field, between it and where the menu hangs. */
.global-cs-item__box {
    margin: 0;
    flex-shrink: 0;
    pointer-events: none;
}

.global-cs-picks {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-xs);
}

.global-cs-item__main {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 0;
}

/* The option's own face — .global-cs-item is nowrap, so without this a long label
   could shrink the circle rather than ellipsis first. */
.global-cs-item__avatar {
    flex-shrink: 0;
}

/* Two-line option: the label on top, an optional muted sublabel under it (e.g. a
   vendor name over its email). Callers that pass no sublabel render one line, so
   this wrapper is safe for every existing single-line combobox. */
.global-cs-item__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 0.05rem;
}

.global-cs-item__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-cs-item__sub {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A group's name over its options (options that carry a group field). Not an
   option: nothing to hover or pick, so it keeps the default cursor. */
.global-cs-group-label {
    padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-xs);
    color: var(--color-text-muted);
    font-weight: var(--font-weight-medium);
    cursor: default;
}

/* The Ramp match panel — wizard step 4 on the connect page.

   A row is a person with their two picks stacked underneath: which Ramp vendor
   they are, and which contact at that vendor gets the money. The picks used to
   sit beside the name at a fixed 300px, which fitted while there was only one of
   them; the second box pushed the row past the 500px side drawer that used to
   host this panel, and the payee picker scrolled off a screen with no horizontal
   scrollbar to bring it back. Stacking is what makes two boxes fit, and the
   stacked fields carry a max-width so the wide wizard card does not stretch a
   combobox across the page. Nothing in here may set a fixed width — a width in
   px is the defect this block was rewritten to remove. */
/* The person filter is the global page search (ADR-131 — wrapper, glyph and
   .global-filter-control all come from filter-bar.css); this wrapper only spaces it
   off the first row. */
.integrations-ramp-match-filter {
    margin: 0 0 var(--spacing-sm);
}
.integrations-ramp-match-row {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    min-width: 0;
    padding: var(--spacing-smd) 0;
    border-top: 1px solid var(--color-border);
}
.integrations-ramp-match-row:first-of-type {
    border-top: 0;
}
.integrations-ramp-match-row__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    min-width: 0;
}
.integrations-ramp-match-row__who {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 1;
    min-width: 0;
}
.integrations-ramp-match-row__person {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.integrations-ramp-match-row__name {
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.integrations-ramp-match-row__email {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* The chip keeps its own width whatever the name does, so a long name ellipses
   instead of squeezing the one word that says where this person has got to. */
.integrations-ramp-match-row__chip {
    flex-shrink: 0;
}
.integrations-ramp-match-row__fields {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    min-width: 0;
    max-width: 28rem;
}
.integrations-ramp-match-row__field {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    min-width: 0;
}
.integrations-ramp-match-row__label {
    color: var(--color-text-muted);
}
/* The payee label says required exactly while a save would refuse the row. */
.integrations-ramp-match-row__label--required {
    color: var(--color-warning-text);
}
.integrations-ramp-match-row__field .global-cs {
    width: 100%;
    min-width: 0;
}
/* The vendor box and this person's own Save, side by side. The box takes the
   room and the button keeps its size — a Save squeezed to a sliver by a long
   vendor name is a button nobody can find. */
.integrations-ramp-match-row__pick {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    min-width: 0;
}
/* The box takes the room up to a search-bar's worth of it — a vendor picker
   stretched across the whole drawer reads as a form field, not a search. */
.integrations-ramp-match-row__pick .global-cs {
    flex: 1;
    width: auto;
    max-width: 20rem;
}
.integrations-ramp-match-row__save {
    flex-shrink: 0;
}
.integrations-ramp-match-row__fact {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-sm);
    flex: 1 1 100%;
    min-width: 0;
}
.integrations-ramp-match-row__fact--foot {
    justify-content: flex-end;
}
.integrations-ramp-match-row__error {
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--color-error);
}
/* A quiet in-row line for read failures and facts: "we couldn't read who can
   be paid", "only person there". Softer than an error, but still worth words. */
.integrations-ramp-match-row__hint {
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}
.integrations-ramp-match-row__out {
    white-space: nowrap;
}
.integrations-ramp-match__note {
    margin: 0;
    color: var(--color-text-muted);
}
/* Try again rides inside a sentence, so it must sit on its baseline
   instead of the padded island btn-sm puts it on. */
.integrations-ramp-match__inline-link {
    padding: 0;
    font-size: var(--font-size-sm);
    vertical-align: baseline;
}
.integrations-ramp-match__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-smd);
    margin-top: var(--spacing-md);
    flex-wrap: wrap;
}
.integrations-ramp-match__foot--end {
    justify-content: flex-end;
}

/* Keyboard cursor — the item the arrow keys have landed on. Visually matches
   hover so mouse and keyboard navigation read identically; distinct from
   .is-active, which marks the already-committed selection (ink tint + check).
   @mouseenter keeps this in sync with the pointer. */
.global-cs-item--cursor {
    background: var(--color-surface-hover);
}

.global-cs-item.is-active {
    color: var(--color-action);
}

.global-cs-item__check {
    flex-shrink: 0;
    color: var(--color-success);
}

/* Enter transition for the popup (x-transition classes on .global-cs-menu). */
.global-cs-fade-enter {
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.global-cs-fade-enter-start {
    opacity: 0;
    transform: translateY(-0.25rem);
}

.global-cs-fade-enter-end {
    opacity: 1;
    transform: translateY(0);
}

.global-status-toggle {
    display: flex;
    gap: var(--spacing-xs);
    margin-left: var(--spacing-xs);
}

.global-status-toggle__btn {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-light);
    border-radius: var(--radius-md);
    padding: 0 var(--spacing-smd);
    min-width: 5.5rem;
    text-align: center;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-button);
    font-family: var(--font-family);
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
    height: var(--filter-ctrl-h, 36px);
    line-height: 1;
    box-sizing: border-box;
    cursor: pointer;
}

/* Quiet toggle: a tint wash on hover, the solid action ink only once chosen —
   the same ramp as .btn-outline-primary above. */
.global-status-toggle__btn:hover {
    background: var(--color-action-tint);
    color: var(--color-action);
    border-color: var(--color-action-hover);
}

.global-status-toggle__btn--active {
    background: var(--color-action);
    color: var(--color-neutral-ink-fg);
    border-color: var(--color-action);
}

.global-status-toggle__btn--active:hover {
    background: var(--color-action-hover);
    color: var(--color-neutral-ink-fg);
    border-color: var(--color-action-hover);
}

.global-form-control-modern,
.global-form-select-modern {
    height: var(--control-h-touch);
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-grey-50);
    color: var(--color-text);
    font-size: var(--font-size-lg);
    font-family: var(--font-family);
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.global-form-control-modern:hover,
.global-form-select-modern:hover {
    background: var(--color-grey-100);
    border-color: var(--color-text-muted);
}

.global-form-control-modern:focus,
.global-form-select-modern:focus {
    outline: none;
    border-color: var(--color-focus-ring);
    box-shadow: 0 0 0 3px var(--color-focus-ring-alpha);
    background: var(--color-card-bg);
}

.global-form-control-modern::placeholder {
    color: var(--color-text-muted);
}

/* Compact combobox: the control-height pill every filter control wears (.global-filter-select,
   the drawer's row buttons) — page-header pickers, the saved-view drawers' Sort by,
   the permissions person box, the Ramp vendor search. :where() keeps it at one
   class of weight, so a host's own two-class tweak (date-nav centres its text)
   still wins even though main.css loads last. */
:where(.global-cs--compact) .global-cs-input {
    height: var(--filter-ctrl-h, var(--control-h-base));
    min-height: var(--filter-ctrl-h, var(--control-h-base));
    padding: 0 var(--spacing-xl) 0 var(--spacing-smd);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-button);
    background-color: var(--color-card-bg);
    color: var(--color-text);
    font-size: var(--font-size-md);
    line-height: 1;
}

:where(.global-cs--compact) .global-cs-input:hover {
    background-color: var(--color-grey-50);
    border-color: var(--color-text-muted);
}

:where(.global-cs--compact) .global-cs-input:focus {
    outline: none;
    border-color: var(--color-focus-ring);
    box-shadow: var(--shadow-focus-ring);
    background-color: var(--color-card-bg);
}

/* A pick-only combobox (month, year, calendar view): the list is the whole
   input, so it shows a hand, not a text caret. */
:where(.global-cs--pick) .global-cs-input {
    cursor: pointer;
    caret-color: transparent;
}

.global-form-select-modern {
    padding-right: var(--spacing-2xl);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25rem;
}

.form-control,
.form-select {
    border-radius: var(--radius-md);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:hover,
.form-select:hover {
    border-color: var(--color-text-muted);
}

.form-label {
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-md);
    color: var(--color-text);
    margin-bottom: var(--spacing-sm);
}

.form-text {
    font-size: var(--font-size-md);
    color: var(--color-grey-600);
    margin-top: var(--spacing-xsm);
}

.form-check-input {
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 4px;
    cursor: pointer;
}

.form-check-label {
    font-size: var(--font-size-lg);
    cursor: pointer;
}

.form-switch .form-check-input {
    width: 2.5rem;
    height: 1.35rem;
    border-radius: var(--radius-pill);
    background-color: var(--color-grey-200);
    border: none;
    transition: background-color 0.2s ease;
}

.form-switch .form-check-input:checked {
    background-color: var(--color-action);
}

.form-switch .form-check-input:focus {
    box-shadow: 0 0 0 3px var(--color-focus-ring-alpha);
}

.global-empty-state {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-md);
}

/* The message and the CTA both carry a bottom margin for when something follows
   them. Whatever ends up last has nothing following it, so its margin is just
   dead space stacked on the panel's own bottom padding — most visible now that
   the standing call is to ship empty states with NO CTA, leaving the message
   last. Zero it on the last child so the panel is padded evenly top and bottom. */
.global-empty-state > :last-child {
    margin-bottom: 0;
}

.global-empty-state-icon {
    font-size: 3rem;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-md);
}

/* --badge: the glyph in a soft ink-tinted disc instead of running bare. For
   the empty states that are the whole page rather than a gap in one — a setup
   screen the worker has to act on, where the muted 3rem glyph reads as an
   absence rather than an invitation. */
.global-empty-state-icon--badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: var(--radius-pill);
    background: var(--color-action-selected);
    color: var(--color-action);
    font-size: 1.75rem;
    line-height: 1;
}

.global-empty-state-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    margin-bottom: var(--spacing-sm);
}

.global-empty-state-message {
    color: var(--color-text-light);
    margin-bottom: var(--spacing-lg);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.global-empty-state-title--typed {
    overflow-wrap: anywhere;
}

.global-empty-state-fit {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    max-inline-size: 100%;
}

.global-empty-state-fit > .bi {
    flex: none;
}

.global-empty-state-fit__label {
    min-inline-size: 0;
    overflow: hidden;
    text-align: start;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --inline: a compact empty state for inside a card, panel, or list — the
   "nothing here yet" note that shouldn't take the full-page hero treatment.
   Same centered layout, smaller icon / type / padding. */
.global-empty-state--inline {
    padding: var(--spacing-md) var(--spacing-sm);
}

.global-empty-state--inline .global-empty-state-icon {
    font-size: 1.75rem;
    margin-bottom: var(--spacing-sm);
}

.global-empty-state--inline .global-empty-state-title {
    font-size: var(--font-size-md);
}

.global-empty-state--inline .global-empty-state-message {
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-md);
}

/* Table empty row: the canonical "no rows yet" line inside a data table. One
   full-width, centered, muted cell — rendered by the _empty_row.html partial.
   A separate root class, NOT a child of .global-empty-state (different DOM shape: a
   <td>, not the <div> hero). Uses --color-text-light — the same token this
   repo's .text-muted utility resolves to (main.css) — so migrating the
   hand-rolled `text-center text-muted` table empties onto this class is a
   visual no-op, and the pending --color-text-light -> grey-600 retoken
   (separate gated PR) lifts the contrast on all of them at once. */
.global-empty-state-row {
    text-align: center;
    color: var(--color-text-light);
    padding: var(--spacing-md);
}

/* Bootstrap paints --bs-table-bg on every cell, and the cells cover the whole
   header band — so a `background` on the thead paints nothing. To tint a band,
   set --bs-table-bg on the thead; the cells inherit it. */
.table {
    --bs-table-bg: var(--color-card-bg);
}

.table > thead th {
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-light);
    border-bottom-width: 1px;
}

.table-hover > tbody > tr:hover {
    --bs-table-hover-bg: rgba(0, 0, 0, 0.02);
}

/* The compact table. It is the house copy of Bootstrap's table-sm, on the
   spacing tokens, so a table that gets a new class can drop table-sm. */
.global-table-compact > :not(caption) > * > * {
    padding: var(--spacing-xs);
}

.table-responsive {
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

/* The loading ring is the shared .global-spinner
   (components/spinner.css). */

.global-skeleton {
    background: linear-gradient(90deg, var(--color-border) 25%, var(--color-page-bg) 50%, var(--color-border) 75%);
    background-size: 200% 100%;
    border-radius: var(--radius-sm);
}

/* The shimmer is motion a reader may have asked never to see; the static
   gradient block still reads as "loading" without it. */
@media (prefers-reduced-motion: no-preference) {
    .global-skeleton {
        animation: skeleton-loading 1.5s ease-in-out infinite;
    }
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.visually-hidden-focusable:not(:focus):not(:focus-within) {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

.global-skip-link {
    position: absolute;
    top: -100%;
    left: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-neutral-ink);
    color: var(--color-neutral-ink-fg);
    border-radius: var(--radius-md);
    z-index: 9999;
    transition: top var(--transition-fast);
}

.global-skip-link:focus-visible {
    top: var(--spacing-md);
}

.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-info { color: var(--color-info); }
.text-muted { color: var(--color-text-light); }

.global-btn-icon-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--control-h-sm);
    height: var(--control-h-sm);
    padding: 0;
    border: none;
    border-radius: var(--radius-button);
    background: transparent;
    color: var(--color-text-light);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.global-btn-icon-copy:hover {
    background: var(--color-action);
    color: var(--color-neutral-ink-fg);
}

.global-btn-icon-copy:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

.global-scroll-sentinel {
    height: 1px;
    width: 100%;
    visibility: hidden;
}

/* The sentinel a page of rows ends on (shared/components/_more_rows.html): one
   row of nothing, so a list never shows a ring or a word while its next page
   comes (ADR-249). Only a page that did not come shows, with Try again. */
.global-scroll-more {
    min-height: var(--control-h-touch);
    visibility: hidden;
}

.global-scroll-more > td {
    height: var(--grid-row-h, var(--control-h-touch));
    padding: 0;
    border: 0;
}

.global-scroll-more.is-stuck {
    visibility: visible;
    text-align: center;
}

.global-scroll-status {
    text-align: center;
    padding: var(--spacing-md);
}

@media (min-width: 1024px) {
    .global-sidebar-collapse-btn {
        display: flex;
    }
}

/* Sidebar Collapsed State (Desktop).
   Icon rail pattern: only sidebar width changes.
   Icons sit in fixed 56px columns and never move.
   Text clips naturally via overflow: hidden on .global-sidebar. */

@media (min-width: 1024px) {
    .global-app-layout.is-sidebar-collapsed .global-app-main {
        margin-left: var(--sidebar-collapsed-width);
    }

    .global-app-layout.is-sidebar-collapsed .global-sidebar {
        width: var(--sidebar-collapsed-width);
        overflow: hidden;
    }

    .global-app-layout.is-sidebar-collapsed .global-sidebar-org-toggle,
    .global-app-layout.is-sidebar-collapsed .global-sidebar-org-dropdown {
        display: none;
    }

    /* Footer actions: stack, because the rail is only as wide as one control.
       Side by side the Skool mark and the chevron want 56px + 28px + gap in a
       56px rail, so the second one would be clipped by the sidebar's
       overflow: hidden. Padding drops for the same reason — the Skool mark
       already carries the full 56px rail width. */
    .global-app-layout.is-sidebar-collapsed .global-sidebar-footer-actions {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0;
    }

    /* Hide every footer-action child in collapsed mode EXCEPT the chevron
       toggle and the Skool link, which has its own collapsed form (the "sk"
       mark, swapped in by .is-sidebar-collapsed .global-sidebar-skool-rail). Selector
       matches on static aria-label values (NOT Alpine-bound) so the rule
       applies on the very first paint via the synchronously-set
       .is-sidebar-collapsed class. Add a new entry here for any new footer
       button — never use Alpine x-show for collapse visibility (causes a
       flash on refresh while Alpine boots). */
    .global-app-layout.is-sidebar-collapsed .global-sidebar-footer-actions a:not(.global-sidebar-skool),
    .global-app-layout.is-sidebar-collapsed .global-sidebar-footer-actions button[aria-label="Settings"],
    .global-app-layout.is-sidebar-collapsed .global-sidebar-footer-actions button[aria-label="Properties"],
    .global-app-layout.is-sidebar-collapsed .global-sidebar-footer-actions button[aria-label="Availability"] {
        display: none;
    }

    /* Collapsed: settings button aligns with logo center (28px in 56px rail).
       18px = half the 36px button. */
    .global-app-layout.is-sidebar-collapsed .global-header-settings-btn {
        margin-left: calc(28px - 18px - var(--spacing-sm));
    }

    /* Collapsed footer: stack the profile row so the profile button keeps its
       full rail width and the avatar centering carries over unchanged (the
       bell used to share this row; it now lives in the header bar). */
    .global-app-layout.is-sidebar-collapsed .global-sidebar-profile-row {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-xs);
    }

}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .global-toast {
        transform: none;
        opacity: 1;
    }

    .is-toast-show {
        transform: none;
    }

    .is-toast-hiding {
        transform: none;
        opacity: 0;
    }
}

.is-form-loading {
    pointer-events: none;
    opacity: 0.7;
}

.is-form-loading input,
.is-form-loading select,
.is-form-loading textarea {
    background-color: var(--color-page-bg);
}

.global-form-error {
    margin-bottom: var(--spacing-md);
}

.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-request {
    pointer-events: none;
    opacity: 0.7;
}

/* The page itself never dims. htmx marks the element that asked for the
   request, and a request made from no element — htmx.ajax() with no source,
   which is how a saved-view tab repaints the list (place.js), the lead drawer
   redraws and the Inbox refreshes its list — is marked on <body>, so the rule
   above faded the whole screen to 70% and deadened every click until the
   answer came (Nick 11-06: "a light grey flash on the whole screen"). The
   shell's own containers are named with it, so a repaint that names the
   middle as its source does not bring the flash back. The control that asked
   still dims. Pinned by tests/js/page-never-dims-while-loading.test.js. */
html.htmx-request,
body.htmx-request,
.global-app-layout.htmx-request,
.global-app-main.htmx-request,
.global-app-content.htmx-request {
    pointer-events: auto;
    opacity: 1;
}

.is-sortable-ghost {
    opacity: 0.4;
    background-color: var(--bs-light);
}

.is-sortable-chosen {
    background-color: var(--color-card-bg);
}

.is-sortable-drag {
    opacity: 0.9;
}

.global-drag-handle {
    cursor: grab;
}

.global-drag-handle:active {
    cursor: grabbing;
}

.global-drag-handle:hover {
    color: var(--color-action) !important;
}

/* Skills dashboard — separated cards.
   A single-column list where each skill is its own .card laid out as ONE
   horizontal row: name | worker count | level badges | menu. */
.global-skills-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-smd);
}

/* The Templates page (settings_templates.html) is the global-skills-list's one
   card-shape consumer (page_header.html shape="card", ADR-131 controls-canon
   skin pass) — page-header.css doesn't pad body_template generically, so the
   page-owned wrapper carries the card's own 1rem rhythm here. */
.settings-template-list-card-body {
    padding: var(--spacing-md);
}

/* Properties (settings_properties.html) is a card-shape consumer too (ADR-131
   controls-canon skin pass, Lane 4) — same reason: page-header.css doesn't pad
   body_template generically, so the page-owned wrapper carries the 1rem rhythm. */
.settings-properties-card-body {
    padding: var(--spacing-md);
}

/* Meetings settings list is a card-shape consumer too (ADR-131 controls-canon
   skin pass, Lane 4) — same reason: page-header.css doesn't pad body_template
   generically, so the page-owned wrapper carries the 1rem rhythm. The inner
   .list-group-flush rides flush inside it, same as the intro paragraph. */
.settings-meeting-list-card-body {
    padding: var(--spacing-md);
}

/* Worker roster (workers/list.html) — a toolbar-shape consumer since the
   filters moved into their own controls card: the list body stands on the page
   background as its own .global-card, and this wrapper carries the 1rem rhythm
   page-header.css doesn't pad generically. */
.workers-list-card-body {
    padding: var(--spacing-md);
}

/* File request list (storage/file_request_list.html) is a card-shape consumer
   too (ADR-131 controls-canon skin pass, Lane 5) — same reason: page-header.css
   doesn't pad body_template generically, so the page-owned wrapper carries the
   1rem rhythm. */
.storage-file-request-list-card-body {
    padding: var(--spacing-md);
}

/* Folder template list (storage/folder_template_list.html) is a card-shape
   consumer too (ADR-131 controls-canon skin pass, Lane 5) — same reason:
   page-header.css doesn't pad body_template generically, so the page-owned
   wrapper carries the 1rem rhythm. */
.storage-folder-template-list-card-body {
    padding: var(--spacing-md);
}

/* Remote board (editing/remote_work.html) is a card-shape consumer too
   (ADR-131 controls-canon skin pass, Lane 6) — same reason: page-header.css
   doesn't pad body_template generically, so the page-owned wrapper carries
   the 1rem rhythm. */
.streaming-remote-work-card-body {
    padding: var(--spacing-md);
}

.global-skill-row {
    display: flex;
    /* Bootstrap's base .card sets flex-direction: column; we share the
       .card class, so this MUST be re-asserted or every child stacks. */
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-smd) var(--spacing-mdlg);
    transition: border-color var(--transition-fast);
}

/* Subtle hover: just a faint border tint, no lift or heavy shadow. */
.global-skill-row:hover {
    border-color: var(--color-grey-400);
}

/* Name takes the slack; everything after it hugs the right edge. */
.global-skill-row__name {
    flex: 1;
    min-width: 0;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-skill-row__name:hover {
    color: var(--color-action);
    text-decoration: underline;
}

/* One global-skills-list row opening onto the rows it owns.
   The Templates page's categories tab: a category row with its service rows
   nested under it. The wrapper each row now sits in is what .global-skills-list gaps,
   so the child block carries its own top margin rather than a second gap. */
.global-tree-toggle {
    flex-shrink: 0;
    padding: 0;
    border: 0;
    background: transparent;
    line-height: 1;
    color: var(--color-text-muted);
}

.global-tree-toggle:hover {
    color: var(--color-text);
}

/* The rail is the ownership: it runs from the parent row down past the last
   child, so which rows belong to which category survives a long list. */
.global-tree-children {
    margin: var(--spacing-sm) 0 0 var(--spacing-lg);
    padding-left: var(--spacing-md);
    border-left: 2px solid var(--color-border);
}

/* Quieter than the row that owns them — a service is read as part of its
   category, not as a peer of one. */
.global-tree-child {
    margin-bottom: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-surface-subtle);
}

.global-tree-child .global-skill-row__name {
    font-size: var(--font-size-md);
}

/* Home Page — Hero Slot.
   The org's own logo at the top of the home page, above the Instagram feed
   when there is one. The container is transparent and borderless — the org's
   homepage background colour shows through, and the logo's max-height is the
   only thing that sets the hero's size. */

.core-home-hero {
    /* Borderless full-bleed container. No min-height — the logo's
       viewport-anchored max-height is the actual size driver. Setting
       min-height here was confusing the cascade for square logos. */
    width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-none);
    display: flex;
    align-items: center;
    justify-content: center;
}

.core-home-hero__inner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

.core-home-hero__logo {
    /* With the Instagram feed under it the logo is a header, not a hero, so
       it caps at a compact fixed height — a tall or square org logo must
       leave the feed visible on first load rather than filling the viewport
       and pushing it below the fold. `--solo` below is the other case. */
    max-width: 100%;
    max-height: 140px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* No feed: the logo is the whole home page, so it goes back to the full-page
   size it had before the feed shipped — these are the exact values #4508
   replaced, not a fresh budget. Cap against the VIEWPORT, not the parent — a
   flex parent with no resolved height doesn't propagate one to its children,
   so `max-height: 100%` let square logos overflow. The subtracted pixels are
   rough slack for the chrome above and below, deliberately generous so the
   bottom edge never clips; don't tune them to a token. */
.core-home-hero--solo .core-home-hero__logo {
    max-height: calc(100vh - 240px);
}

@media (max-width: 576px) {
    .core-home-hero__inner {
        padding: var(--spacing-sm);
    }
    .core-home-hero__logo {
        max-height: 96px;
    }
    /* Restated because `.core-home-hero--solo .core-home-hero__logo` outranks the
       single-class rule above no matter the source order. */
    .core-home-hero--solo .core-home-hero__logo {
        max-height: calc(100vh - 200px);
    }
}

.global-hide-spinners::-webkit-outer-spin-button,
.global-hide-spinners::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.global-hide-spinners { -moz-appearance: textfield; }

/* Must load after .card and .global-filter-bar's border shorthand (main.css / filter-bar.css)
   or the thicker high-contrast border loses on source order. */
@media (prefers-contrast: more) {
    .card,
    .global-filter-bar {
        border-width: 2px;
    }
}

/* Settings → Templates → Badges: the badge's name, then where it shows and
   what it needs on a quieter line under it, wrapping rather than cut off. */
.settings-badge-row {
    display: flex;
    flex-direction: column;
    white-space: normal;
}

.settings-badge-row__line {
    margin-top: var(--spacing-xs);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-body);
    color: var(--color-text-muted);
}

/* ── Phone (<768px) ─────────────────────────────────────────────────────────
   The two shared singletons main.css owns, restyled for a thumb. This block
   stays LAST in the file: a base rule written after it wins the cascade back. */
@media (max-width: 767.98px) {
    .global-empty-state {
        padding: var(--spacing-lg) var(--page-gutter);
    }

    /* Swipe strip. Opt-in, phone only: a grid of cards that stacked into a
       tall column becomes ONE sideways row the thumb flicks through, so the
       thing the page is for (the list under the cards) stays above the fold.
       Off the phone the class is inert and the page's own grid rule stands —
       this sheet loads after every feature sheet, so on the phone the flex
       here wins their `display: grid` by source order alone, no `!important`.
       The row bleeds into both page gutters and pads them back, so the first
       card lines up with the page and the last one scrolls to the screen's
       edge. Cards mark themselves with the __item class: an htmx container
       between the strip and its cards is `display: contents`, so a `> *`
       child rule would land on the wrapper, not the cards. */
    .global-swipe-strip {
        display: flex;
        flex-wrap: nowrap;
        gap: var(--spacing-sm);
        margin-inline: var(--page-gutter-bleed);
        padding-inline: var(--page-gutter);
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: var(--page-gutter);
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .global-swipe-strip::-webkit-scrollbar {
        display: none;
    }

    .global-swipe-strip__item {
        flex: 0 0 var(--swipe-card-w);
        min-width: 0;
        scroll-snap-align: start;
    }

    /* The ⋯ menu becomes a bottom sheet: fixed to the viewport's bottom edge,
       full width, 44px rows. It stays in its own tree (Alpine state and the
       rows' hx-* attributes keep working) — no ancestor on this page is
       transformed, so `fixed` resolves against the viewport with no portal.
       Overflow is visible so the ::before scrim below can stand outside it. */
    .global-action-dropdown-menu {
        position: fixed;
        inset: auto 0 var(--sheet-bottom) 0;
        margin: 0;
        width: auto;
        min-width: 0;
        max-width: none;
        border: 0;
        border-radius: var(--radius-lg) var(--radius-lg) var(--radius-none) var(--radius-none);
        /* Rows run edge to edge on the sheet. Where it stands on the bar,
           the bar pays the home indicator; where it covers the tab capsule,
           the sheet pays it. */
        padding: 0 0 var(--sheet-pad-bottom);
        box-shadow: var(--shadow-modal);
        z-index: var(--z-modal);
        overflow: visible;
    }

    /* The scrim stands ON the sheet's top edge (bottom: 100%) and reaches up
       a full screen, so it dims the page without tinting the sheet and needs
       no z-index of its own. It belongs to the menu, so a tap on it is a
       click outside the toggle — Alpine's click.outside closes the menu —
       and the page under it never sees the tap. A menu whose click.outside
       sits on the menu itself sees the tap as its own, so it also closes on
       click.self (the Inbox's menus). */
    .global-action-dropdown-menu::before {
        content: "";
        position: absolute;
        top: auto;
        right: 0;
        bottom: 100%;
        left: 0;
        height: 100vh;
        background: var(--color-scrim);
    }

    .global-action-dropdown-item {
        min-height: var(--control-h-touch);
        padding: var(--spacing-sm) var(--page-gutter);
        border-radius: var(--radius-none);
        font-size: var(--font-size-base);
    }

    /* With overflow visible the first row's hover wash would square off the
       sheet's rounded top; give it the same corners. */
    .global-action-dropdown-item:first-child {
        border-radius: var(--radius-lg) var(--radius-lg) var(--radius-none) var(--radius-none);
    }

    /* Every button is a 44px tap target on a phone. Flex centres the label
       in the taller box; the gap stands in for the space flex drops between
       an icon and its words. */
    .btn:not(.btn-close) {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: var(--spacing-xs);
        min-height: var(--control-h-touch);
    }

    /* iOS zooms into any field under 16px, so every typed field is body size
       on a phone. Buttons and labels keep their own sizes. */
    .form-control,
    .form-select,
    .global-form-control-modern,
    .global-form-select-modern,
    .global-cs-input,
    .global-filter-control,
    .global-filter-select,
    .global-toolbar__search,
    .global-drawer__input,
    .support-field__input {
        font-size: var(--font-size-base);
    }

    /* And every form field in the team's app and its sign-in page is a
       finger tall. The pages clients fill keep their own size; :where()
       keeps a page's own height winning. */
    :where(body:has(.global-app-layout:not(.global-no-sidebar), .global-sign-in)) :is(
        .form-control,
        .form-select,
        .global-form-control-modern,
        .global-form-select-modern,
        .global-cs-input
    ) {
        min-height: var(--control-h-touch);
    }

    /* ── The bottom bar ─────────────────────────────────────────────────────
       The app bar is not hidden and not duplicated: .global-app-header ITSELF
       is re-pinned to the bottom edge, so the four controls in it keep the
       Alpine state they already own and the bell drawer, the support panel
       and the search field, which all live inside it, keep rendering.
       tokens.css zeroes --header-height for this query, so --header-bottom
       and --drawer-top already read "just under the notch". The bar's own
       seat is --bottom-bar-h. Same 1050 as the base rule: above the Bootstrap
       offcanvas backdrop (1040) and the sidebar scrim (--z-scrim), so a lit
       button stays tappable while its sheet is up. */
    .global-app-header {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        height: var(--bottom-bar-h);
        padding-top: 0;
        padding-bottom: var(--safe-bottom);
        padding-inline: 0;
        gap: 0;
        border-bottom: 0;
        border-top: 1px solid var(--sidebar-border);
        overflow: visible;
    }

    /* Five equal columns. The right-hand controls sit in a wrapper that the
       desktop bar pushes right, and the two support buttons in a wrapper of
       their own; display: contents lifts them out so every control is a direct
       flex item and takes a fifth of the bar.
       Order: Menu, Search, Support, Suggestions, Notifications (DOM order, no `order`). */
    .global-app-header .global-app-header-actions,
    .global-app-header .support-desk {
        display: contents;
    }

    .global-app-header .global-topbar-search,
    .global-app-header .notifications-bell {
        display: flex;
        flex: 1 1 0;
        min-width: 0;
        align-self: stretch;
    }

    /* Each control: icon over its word, the full column wide and the touch
       height tall. No circle and no hairline; the column is the target. */
    .global-app-header .global-sidebar-toggle,
    .global-app-header .global-header-btn-icon {
        flex: 1 1 0;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: var(--spacing-2xs);
        width: 100%;
        min-width: 0;
        height: auto;
        min-height: var(--control-h-touch);
        padding: var(--spacing-xs) 0;
        border: 0;
        border-radius: var(--radius-none);
        background: transparent;
    }

    .global-app-header .global-sidebar-toggle i,
    .global-app-header .global-header-btn-icon i {
        font-size: var(--font-size-xl);
    }

    /* A word grows with the phone's text size only until it fills its
       fifth of the bar ("Notifications" is the longest); past that the
       words would run into each other. */
    .global-header-btn__label {
        display: block;
        font-size: min(var(--font-size-2xs), 2.9vw);
        line-height: 1;
        white-space: nowrap;
    }

    /* The calls window is for a computer. Watch Tutorials shows on a phone
       only in the top bar of phone-bar.css. So this bar keeps its five columns. */
    .global-app-header .global-header-calls,
    .global-app-header .global-watch-tutorials {
        display: none;
    }

    /* The unread dot rides the bell glyph, not the column's corner. */
    .global-app-header .notifications-bell-badge {
        top: var(--spacing-xs);
        right: calc(50% - var(--spacing-md));
    }

    /* The page keeps its last row out from under the bar. */
    .global-app-content {
        padding-bottom: calc(var(--bottom-bar-h) + var(--page-gutter));
    }

    /* ── The strip behind the notch ─────────────────────────────────────────
       In the iPhone app the page runs under the notch. body pads by
       --safe-top, but padding scrolls away with the page, and the cards then
       slide up under the clock. This strip stays put over that space and
       wears the page's own colour, so nothing reads under the clock. It is
       0px tall where the screen has no notch. Same rung as the bar. */
    body::before {
        content: "";
        position: fixed;
        inset: 0 0 auto;
        height: var(--safe-top);
        background: inherit;
        z-index: var(--z-modal-backdrop);
    }

    /* The viewport-fit lock (base rule above) stops at the bar, and a locked
       page's content does not ALSO pad for the bar: the lock already left
       the room. */
    .global-app-main:has(.global-page-fill) {
        min-height: 0;
        height: calc(100vh - var(--safe-top) - var(--bottom-bar-h));
        height: calc(100dvh - var(--safe-top) - var(--bottom-bar-h));
    }

    .global-app-main:has(.global-page-fill) .global-app-content {
        padding-bottom: var(--page-gutter);
    }

    /* ── The Menu sheet ─────────────────────────────────────────────────────
       The sidebar rises from the bar instead of sliding in from the left.
       Same class, same is-open, same scrim (--z-scrim, under the bar); only
       the geometry changes. Wins over the <1024 translateX rules above by
       source order. Where the sheet stands on the bar, the bar pays
       --safe-bottom; where it covers the capsule, it pays it itself. */
    .global-sidebar {
        top: auto;
        bottom: var(--sheet-bottom);
        left: 0;
        right: 0;
        width: auto;
        max-width: none;
        height: auto;
        max-height: calc(100dvh - var(--header-bottom) - var(--sheet-bottom));
        overflow-y: auto;
        overscroll-behavior-y: contain;
        padding-top: var(--spacing-sm);
        padding-bottom: var(--sheet-pad-bottom);
        border-radius: var(--radius-lg) var(--radius-lg) var(--radius-none) var(--radius-none);
        box-shadow: var(--shadow-modal);
        transform: translateY(100%);
        /* translateY(100%) parks the closed sheet exactly over the bar (not
           off the screen the way translateX(-100%) did), where it would catch
           every tap meant for the bar. Hidden until open; visibility waits
           out the slide on close so the sheet is seen leaving. */
        visibility: hidden;
        transition: transform var(--transition-normal), visibility var(--transition-normal);
    }

    .global-sidebar.is-open {
        transform: translateY(0);
        visibility: visible;
    }

    /* ── The Search sheet ───────────────────────────────────────────────────
       On a phone the search fills the screen, with Cancel beside the field
       (Nick, 11-10). The field sits at the TOP of the screen, not the bar:
       the phone keyboard rises over the bottom half the moment the field
       takes focus, and a fixed bottom sheet does not move with it on iOS.
       The sheet is a grid: the field and Cancel on the first row, and the
       results or the recent records under them on the second. The sheet runs
       down to the keyboard's top, or to the bar when the keyboard is down
       (Nick, 11-09). The keyboard does not shrink 100dvh, so the height comes
       from the part still in view (--search-view-height, topbar-search.js).
       The field stays put and the list scrolls inside. The field's row keeps
       the bar's colour, and the rest is the page's white. The first shadow is
       a solid copy of the sheet lifted by --safe-top: it fills the notch in
       the sheet's colour. The sheet's top follows the part of the screen
       still in view (--search-view-top), so it stays in sight when iOS moves
       the page up under the keyboard. */
    .global-topbar-search.is-revealed .global-topbar-search__form {
        position: fixed;
        top: calc(var(--search-view-top, 0px) + var(--safe-top));
        bottom: auto;
        inset-inline: 0;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto minmax(0, 1fr);
        align-items: center;
        column-gap: var(--spacing-smd);
        height: min(
            calc(var(--search-view-height, 100dvh) - var(--safe-top)),
            calc(100dvh - var(--search-view-top, 0px) - var(--safe-top) - var(--bottom-bar-h))
        );
        overflow: hidden;
        padding: var(--spacing-sm) var(--page-gutter) 0;
        background: linear-gradient(
            var(--header-bg) 0 calc(var(--spacing-sm) + var(--control-h-touch) + var(--spacing-sm)),
            var(--color-card-bg) 0
        );
        border-radius: var(--radius-none);
        box-shadow: var(--shadow-notch-fill), var(--shadow-modal);
        z-index: var(--z-raised);
    }

    /* The magnifier and the spinner hang off the sheet, so top: 50% put them
       in the middle of the list. They stay on the field row: the sheet's top
       padding and one field, a finger tall. They sit inside the field's left
       end, not on its edge. */
    .global-topbar-search.is-revealed .global-topbar-search__form .global-search-icon,
    .global-topbar-search.is-revealed .global-topbar-search__form .global-search-spinner {
        top: calc(var(--spacing-sm) + var(--control-h-touch) / 2);
        left: calc(var(--page-gutter) + var(--spacing-smd));
    }

    .global-topbar-search.is-revealed .global-topbar-search__cancel {
        display: inline-flex;
        align-items: center;
        min-height: var(--control-h-touch);
        padding: 0;
        border: 0;
        background: none;
        font: inherit;
        font-size: var(--font-size-base);
        color: var(--header-control-fg);
        cursor: pointer;
    }

    .global-topbar-search__panel {
        position: static;
        grid-column: 1 / -1;
        align-self: stretch;
        width: 100%;
        min-height: 0;
        max-height: none;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        margin-top: var(--spacing-sm);
        border: 0;
        border-radius: var(--radius-none);
        box-shadow: none;
    }

    /* Every row is a finger tall. A one-line row (a recent search, See all)
       was about 30px. */
    .global-topbar-search__row {
        min-height: var(--control-h-touch);
    }

    /* A link in a person's card and Clear take a finger too. */
    .global-topbar-search__chip,
    .global-topbar-search__clear {
        min-height: var(--control-h-touch);
    }

    .global-topbar-search__scrim {
        display: block;
        position: fixed;
        inset: 0 0 var(--bottom-bar-h) 0;
        background: var(--color-scrim);
    }
}

/* ============================================
   Platform-wide frosted surface. `.global-glass` is the ONE frosted-glass
   treatment — a translucent fill, a blur behind it, a hairline rim and the
   inset top highlight that sells the material.

   It is a SURFACE TREATMENT, not a container: it carries no padding, no
   layout and (except on --strong, which owns a modal panel's whole shell)
   no radius. That is deliberate — it composes ONTO an existing card, panel
   or modal rather than replacing it:

       <div class="global-glass global-glass--static role-detail__card">
       <div class="modal global-modal-chrome global-modal-chrome--glass">

   Nick kept glass in the design language, so this is a real primitive, not
   a retirement. It stays allow-list only though (see the styleguide): full
   screen "moment" screens, premium reveal modals and the ink-tinted
   balance surface — never everyday list or filter chrome, which belongs on
   the opaque `.global-card`.

   `.global-glass` is a locked singleton (test_css_standards.py) — a second
   base definition fails the build.

   Variants: --primary / --success (ink + semantic tint), --strong
   (near-opaque modal panel frost), --static (non-interactive: no hover
   lift). Elevation is carried on two custom properties rather than
   hard-coded per rule, so a variant retunes the material by overriding the
   properties and the shared :hover rule follows it automatically.
   ============================================ */

/* ── Material tokens ── the rgba() alphas have no platform token (every
   --color-* is opaque), so the translucent film is defined once here and
   every rule below reads it through var(). Declared on both entry points —
   the standalone treatment and the modal-chrome opt-in — so the opt-in
   resolves the same material without depending on `.global-glass` also
   being present on the element. */
.global-glass,
.global-modal-chrome--glass .modal-content {
    --global-glass-blur: 16px;
    --global-glass-fill: rgba(255, 255, 255, 0.55);
    --global-glass-rim: rgba(255, 255, 255, 0.35);
    /* Base for the tint variants' color-mix: the white film the ink or
       semantic color is mixed INTO, for fill and rim respectively. */
    --global-glass-tint-base: rgba(255, 255, 255, 0.5);
    --global-glass-tint-rim-base: rgba(255, 255, 255, 0.3);
    --global-glass-shadow-resting:
        0 4px 24px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    --global-glass-shadow-raised:
        0 8px 32px var(--ink-alpha-10),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.global-glass {
    background: var(--global-glass-fill);
    backdrop-filter: blur(var(--global-glass-blur));
    -webkit-backdrop-filter: blur(var(--global-glass-blur));
    border: 1px solid var(--global-glass-rim);
    box-shadow: var(--global-glass-shadow-resting);
}

/* ── Tint variants ── the tint derives from the fixed action ink (or the
   platform semantic color) via color-mix — the same on every tenant. */

.global-glass--primary {
    background: color-mix(in srgb, var(--color-action) 18%, var(--global-glass-tint-base));
    border-color: color-mix(in srgb, var(--color-action) 20%, var(--global-glass-tint-rim-base));
}

.global-glass--success {
    background: color-mix(in srgb, var(--color-success) 18%, var(--global-glass-tint-base));
    border-color: color-mix(in srgb, var(--color-success) 20%, var(--global-glass-tint-rim-base));
}

/* --strong: a near-opaque, heavily-blurred panel frost for a reveal modal
   that must stay readable over arbitrary page content. Unlike the tint
   variants this owns the whole panel shell, so it also sets the radius and
   drops the hairline rim in favour of the inset ring inside its shadow.
   Overriding the material PROPERTIES (not the declarations) is what keeps
   the shared :hover rule below correct for this variant too. */
.global-glass--strong {
    --global-glass-blur: 24px;
    --global-glass-fill: rgba(255, 255, 255, 0.94);
    --global-glass-shadow-resting:
        0 24px 60px -16px rgba(15, 23, 42, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    --global-glass-shadow-raised:
        0 24px 60px -16px rgba(15, 23, 42, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;

    backdrop-filter: blur(var(--global-glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--global-glass-blur)) saturate(180%);
    border: 0;
    border-radius: var(--radius-xl);
}

/* ── Interaction ── the lift reads off the custom property, so a variant
   that retuned its elevation lifts from ITS OWN resting value. --static is
   the opt-out for a display-only surface (a details card, a modal panel):
   the pointer passing over it must not imply it is clickable. */
.global-glass:hover {
    box-shadow: var(--global-glass-shadow-raised);
}

.global-glass--static:hover {
    box-shadow: var(--global-glass-shadow-resting);
}

/* ── Composition hook ── lets a persistent Bootstrap dialog wearing the
   shared panel chrome opt into the frosted material without every modal
   paying for it. Pairs with `.global-modal-chrome` in components/modal.css,
   which still owns the panel radius and the elevation ladder. */
.global-modal-chrome--glass .modal-content {
    background: var(--global-glass-fill);
    backdrop-filter: blur(var(--global-glass-blur));
    -webkit-backdrop-filter: blur(var(--global-glass-blur));
}


.global-phone-input-container {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    overflow: hidden;
    min-height: var(--control-h-touch);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.global-phone-input-container:focus-within {
    border-color: var(--color-focus-ring);
    box-shadow: 0 0 0 0.2rem var(--color-focus-ring-alpha);
}

.global-phone-input-container.is-invalid {
    border-color: var(--color-error);
}

.global-phone-input-container.is-invalid:focus-within {
    box-shadow: 0 0 0 0.2rem rgba(217, 0, 43, 0.25);
}

/* Fixed country code display (+1 USA only) */
.global-phone-input__country-fixed {
    display: flex;
    align-items: center;
    padding: 0 var(--spacing-sm);
    background: var(--color-surface-subtle);
    border: none;
    border-right: 1px solid var(--color-border);
    font-size: var(--font-size-md);
    color: var(--color-text-muted);
    font-family: var(--font-family);
    user-select: none;
}

/* The width in percent lets the box shrink in a tight row, such as a phone
   row with a trash button. A browser lets a typed box with a percent width
   shrink to nothing. Without it the box keeps its 20-letter width and runs
   past the row. flex still sets its real width. */
.global-phone-input__number {
    flex: 1;
    width: 100%;
    border: none;
    padding: var(--spacing-sm) var(--spacing-smd);
    font-size: var(--font-size-lg);
    font-family: var(--font-family);
    color: var(--color-text);
    background: transparent;
    min-width: 0;
}

.global-phone-input__number:focus {
    outline: none;
}

.global-phone-input__number::placeholder {
    color: var(--color-text-muted);
    font-weight: 400;
}

.global-phone-input__error {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--color-error);
    margin-top: var(--spacing-xs);
}

/* This sheet loads after main.css, so main.css's phone rule for typed fields
   cannot reach the number box; it says so itself. 16px stops iOS zooming. */
@media (max-width: 767.98px) {
    .global-phone-input__number {
        font-size: var(--font-size-base);
    }
}


.global-file-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-subtle);
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    min-height: var(--control-h-touch);
    text-align: center;
}

/* Hover is an ordinary control state, so it takes the action ink; is-dragging
   is the drop target announcing it will receive the drop — the same promise a
   focus ring makes — so that one state keeps the focus purple. */
.global-file-upload-zone:hover {
    border-color: var(--color-action-hover);
    background: var(--color-action-tint);
}

.global-file-upload-zone.is-dragging {
    border-color: var(--color-focus-ring);
    background: color-mix(in srgb, var(--color-focus-ring) 8%, transparent);
    border-style: solid;
}

.global-file-upload-zone.is-invalid {
    border-color: var(--color-error);
}

.global-file-upload__icon {
    font-size: 1.5rem;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-sm);
}

.global-file-upload__text {
    font-size: var(--font-size-md);
    color: var(--color-text-muted);
}

.global-file-upload__text strong {
    color: var(--color-action);
}

.global-file-upload__hint {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: var(--spacing-xs);
}

.global-file-upload__preview {
    list-style: none;
    margin: var(--spacing-sm) 0 0;
    padding: 0;
}

.global-file-upload__preview-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-xsm) var(--spacing-sm);
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-xs);
}

.global-file-upload__preview-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

.global-file-upload__preview-size {
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    margin-left: var(--spacing-sm);
    flex-shrink: 0;
}

.global-file-upload__preview-remove {
    background: none;
    border: none;
    color: var(--color-error);
    cursor: pointer;
    padding: 0 var(--spacing-xs);
    font-size: var(--font-size-base);
    line-height: 1;
    margin-left: var(--spacing-sm);
    flex-shrink: 0;
}

.global-file-upload__preview-remove:hover {
    opacity: 0.7;
}

.global-file-upload__error {
    font-size: var(--font-size-sm);
    color: var(--color-error);
    margin-top: var(--spacing-xs);
}

/*
 * Profile photo — the cropper modal the add-a-photo nudge opens. The nudge
 * itself wears the shared .global-notice strip (components/notice-strip.css).
 *
 * The cropper is a modal body, named for the workers domain because that is
 * whose face it sets. Every value that has a token comes from one — color,
 * type, spacing, radius, shadow, motion — so the feature moves when the
 * platform's scale moves. What is left as a literal is geometry with no scale
 * behind it (the 320px crop stage, the 32px pencil disc, hairline borders),
 * called out where it appears. Raw hex, radius, shadow, and font-weight are
 * additionally gated by ADR-125.
 */

/* The crop stage's cap. No scale token stands behind it — it is a component
   dimension like the 104px hero face, not a step on the spacing ladder — and
   `width: 100%` shrinks the stage under it inside a narrow modal. Declared
   once here and read by both the stage and the zoom row beneath it, so the two
   cannot drift apart and leave the slider wider than the picture. */
.workers-photo-cropper {
    --workers-photo-stage-width: 320px;
}

.workers-photo-cropper__stage {
    position: relative;
    width: 100%;
    max-width: var(--workers-photo-stage-width);
    margin: 0 auto;
}

.workers-photo-cropper__canvas {
    display: block;
    width: 100%;
    height: auto;
    /* Pan and pinch belong to the crop, not to the page scrolling underneath. */
    touch-action: none;
    cursor: grab;
    background-color: var(--color-surface-subtle);
    border-radius: var(--radius-md);
}

.workers-photo-cropper__canvas:active {
    cursor: grabbing;
}

.workers-photo-cropper__zoom {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
    max-width: var(--workers-photo-stage-width);
    margin: var(--spacing-smd) auto 0;
    color: var(--color-text-secondary);
}

/* Bootstrap 5.3 bakes #0d6efd straight into the range thumb's pseudo-element
   with no --bs-* hook to aim at, so the stock blue is the only way it ships and
   restating the two vendor selectors is the only way to move it. It follows the
   same action token the checked checkbox and radio already use in main.css. */
.workers-photo-cropper__zoom .form-range::-webkit-slider-thumb {
    background-color: var(--color-action);
}

.workers-photo-cropper__zoom .form-range::-moz-range-thumb {
    background-color: var(--color-action);
}

.workers-photo-cropper__zoom .form-range::-webkit-slider-thumb:active {
    background-color: var(--color-action-hover);
}

.workers-photo-cropper__zoom .form-range::-moz-range-thumb:active {
    background-color: var(--color-action-hover);
}

.workers-photo-cropper__hint {
    margin-top: var(--spacing-sm);
    text-align: center;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

/* The way back to the picker. .btn-link inherits the action ink through
   --bs-link-color (main.css aims Bootstrap's link tokens at --color-action),
   so this is no longer un-blueing it — it is muting it. Recolored through the
   button's custom properties rather than a `color:` override so the hover and
   active states move with it: this is a way out of the crop, not a second
   Save, and it should not read as loud as the link beside it. */
.workers-photo-cropper__reset {
    --bs-btn-color: var(--color-text-secondary);
    --bs-btn-hover-color: var(--color-text);
    --bs-btn-active-color: var(--color-text);
}

.workers-photo-cropper__error {
    margin-top: var(--spacing-smd);
    text-align: center;
    color: var(--color-error);
    font-size: var(--font-size-sm);
}

/* Only offered where a camera is the obvious source. On a desktop the capture
   attribute is ignored and the button would just be a second file dialog. */
.workers-photo-cropper__camera {
    display: none;
}

@media (pointer: coarse) {
    .workers-photo-cropper__camera {
        display: inline-flex;
        align-items: center;
        /* Flex drops the whitespace text node between the icon and the label,
           so the gap has to be declared or they run together. */
        gap: var(--spacing-xs);
    }
}

/* Hero face on the profile page. The row it sits in (.workers-hero-body) is a
   flex row, so the face and its control have to be one child. */
.workers-photo-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
}

/* Positioning context for the edit badge. Shrink-wraps the circle, so the
   badge's corner is the CIRCLE's corner and not the column's. */
.workers-photo-hero__frame {
    position: relative;
    display: inline-flex;
}

/* The way back to the cropper once the nudge banner is gone: a pencil disc on
   the face's bottom-right corner, the way every app that lets you change a
   photo puts it there. Resting state is invisible — a profile that is already
   set up should show a face, not a control — and it comes up on hovering the
   FRAME, not the badge, so the whole 104px circle is the hover target rather
   than a 32px dot someone has to find. */
.workers-photo-hero__edit {
    position: absolute;
    right: 2px;
    bottom: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background-color: var(--color-card-bg);
    /* --color-text-secondary (#64748b) is 4.76:1 on the white card; the muted
       grey one step down is 2.57:1 and would fail the glyph's 3:1 floor. */
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    /* Above the status dot that shares this corner, so the revealed
       affordance covers the mark instead of wearing it. */
    z-index: var(--z-raised);
    opacity: 0;
    transform: scale(0.85);
    transition: opacity var(--transition-fast), transform var(--transition-fast),
                color var(--transition-fast), border-color var(--transition-fast);
}

/* :focus-within, not :focus — a keyboard tabbing onto a control it cannot see
   is the classic way a hover-revealed affordance becomes unreachable. */
.workers-photo-hero__frame:hover .workers-photo-hero__edit,
.workers-photo-hero__frame:focus-within .workers-photo-hero__edit {
    opacity: 1;
    transform: none;
}

.workers-photo-hero__edit:hover,
.workers-photo-hero__edit:focus-visible {
    border-color: var(--color-action);
    color: var(--color-action);
}

/* A touch screen has no hover, so the badge would never appear and the profile
   page would lose its only door to the cropper. There it just stays up. */
@media (hover: none) {
    .workers-photo-hero__edit {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .workers-photo-hero__edit {
        transition: none;
    }
}

/* No face yet: the whole circle IS the add control. Dashed and unfilled so it
   reads as a slot waiting to be filled rather than a photo that failed to
   load, and sized/clipped by .global-avatar--xl like every other hero face.
   The hover treatment is an ink-tinted RING, not a solid background — a solid
   fill would put ink on ink and vanish the glyph. */
.workers-photo-hero__add {
    padding: 0;
    border: 1.5px dashed var(--color-text-secondary);
    background-color: var(--color-surface-subtle);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: color var(--transition-fast), border-color var(--transition-fast),
                box-shadow var(--transition-fast);
}

.workers-photo-hero__add:hover,
.workers-photo-hero__add:focus-visible {
    border-color: var(--color-action);
    color: var(--color-action);
    box-shadow: var(--shadow-avatar-ring);
}

@media (prefers-reduced-motion: reduce) {
    .workers-photo-hero__add {
        transition: none;
    }
}

/* ==========================================================================
   global-tooltip — the platform hover / focus bubble (ADR-131 atom)
   ==========================================================================

   ONE dark glass bubble, two renderers, so the look is declared once:

     1. .global-tooltip — a single <div> appended to <body> by accessibility.js,
        which owns every [data-tooltip] element via delegated listeners. It is
        position:fixed, so no overflow:hidden ancestor can clip it and no
        stacking context can trap it, and the JS flips it to the opposite side
        and clamps it to the viewport when the preferred side would run off the
        page. The 300ms hover dwell is a setTimeout in the JS, so the fade here
        carries no delay of its own.
     2. .global-tooltip--rich — a Bootstrap tooltip carrying a header plus
        label/value rows (skill ratings). Applied via data-bs-custom-class.

   Everything below is on tokens: no raw hex, no raw radius, no raw shadow.
   Geometry rides --radius-card and elevation rides --shadow-modal (the shared
   overlay tokens), so the bubble can't drift from every other floating surface.
   The bubble's own glass fill lives in the custom properties here so the two
   renderers cannot drift apart from each other again.
   ========================================================================== */

:root {
    --global-tooltip-bg: rgba(15, 15, 15, 0.92);
    --global-tooltip-bg-rich: rgba(15, 15, 15, 0.95);

    --global-tooltip-border-color: rgba(255, 255, 255, 0.08);
    --global-tooltip-rule: rgba(255, 255, 255, 0.2);

    /* Text on the glass. The bright value is the ink-surface foreground token;
       the two dimmed steps stay alpha-based so they read through the blur. */
    --global-tooltip-fg-muted: rgba(255, 255, 255, 0.85);
    --global-tooltip-fg-faint: rgba(255, 255, 255, 0.6);

    --global-tooltip-blur: 12px;

    --global-tooltip-pad-y: var(--spacing-xsm);
    --global-tooltip-pad-x: var(--spacing-smd);
    --global-tooltip-weight: 500;
    --global-tooltip-leading: 1.4;
    --global-tooltip-max-w: 16rem;

    --global-tooltip-fade: 150ms;
}

.global-tooltip {
    position: fixed;
    z-index: var(--z-portal);
    width: max-content;
    max-width: var(--global-tooltip-max-w);
    padding: var(--global-tooltip-pad-y) var(--global-tooltip-pad-x);
    font-size: var(--font-size-sm);
    font-weight: var(--global-tooltip-weight);
    line-height: var(--global-tooltip-leading);
    color: var(--color-neutral-ink-fg);
    /* Shrink-to-fit but capped: short tips stay on one tight line, long ones
       wrap into a box instead of running off the side of a drawer. Multi-line
       tooltips (a name over its roles) arrive as "\n" in the attribute, so
       honour it and centre the stack. */
    white-space: pre-line;
    text-align: center;
    overflow-wrap: break-word;
    background: var(--global-tooltip-bg);
    backdrop-filter: blur(var(--global-tooltip-blur));
    -webkit-backdrop-filter: blur(var(--global-tooltip-blur));
    border: 1px solid var(--global-tooltip-border-color);
    border-radius: var(--radius-card);
    /* Overlay/drawer elevation token — the tooltip floats over app chrome. */
    box-shadow: var(--shadow-modal);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity var(--global-tooltip-fade) ease-out,
        visibility var(--global-tooltip-fade) ease-out;
}

.global-tooltip--visible {
    opacity: 1;
    visibility: visible;
}

.tooltip.global-tooltip--rich {
    --bs-tooltip-max-width: 280px;
    --bs-tooltip-bg: var(--global-tooltip-bg-rich);
    --bs-tooltip-padding-x: 0.875rem;
    --bs-tooltip-padding-y: 0.75rem;
}

.tooltip.global-tooltip--rich .tooltip-inner {
    max-width: var(--bs-tooltip-max-width);
    text-align: left;
}

.global-tooltip__body {
    min-width: 180px;
}

.global-tooltip__header {
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-xsm);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-neutral-ink-fg);
    border-bottom: 1px solid var(--global-tooltip-rule);
}

.global-tooltip__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xs) 0;
    font-size: var(--font-size-xs);
}

.global-tooltip__label {
    margin-right: var(--spacing-smd);
    color: var(--global-tooltip-fg-muted);
}

.global-tooltip__value {
    white-space: nowrap;
}

.global-tooltip__value .workers-rating-value {
    margin-right: var(--spacing-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-neutral-ink-fg);
}

.global-tooltip__value .workers-rating-stars {
    color: var(--color-warning);
    letter-spacing: 0;
}

.global-tooltip__value .workers-rating-count {
    margin-left: var(--spacing-xs);
    color: var(--global-tooltip-fg-faint);
}

/* The bottom bar of doors (shared/components/phone_bar.html), on a phone and
   on a touch screen of any size. A computer with a mouse never sees it.

   While the bar is on the page, the app bar goes back to the top of a phone,
   icons only (Search, Support, Notifications), and its Menu button gives way
   to the bar's More. A page without the bar keeps main.css's phone rules,
   where the app bar itself is the bottom bar. Loaded after main.css, so these
   rules win where they tie. */
.global-phone-bar {
    display: none;
}

/* The page's name in the app bar shows only on a phone (look D, below). */
.global-app-header__title {
    display: none;
}

@media (max-width: 767.98px), (hover: none) and (pointer: coarse) {
    /* The one number every page reads to keep its last row clear of the bar. */
    :root:has(.global-phone-bar) {
        --bottom-bar-h: calc(var(--header-height-touch) + var(--safe-bottom));
    }

    /* Above the side menu's scrim, so More still answers while the menu is up. */
    .global-phone-bar {
        display: flex;
        position: fixed;
        inset: auto 0 0;
        z-index: var(--z-modal-backdrop);
        height: var(--bottom-bar-h);
        padding-bottom: var(--safe-bottom);
        background: var(--header-bg);
        border-top: 1px solid var(--sidebar-border);
    }

    .global-phone-bar__door {
        position: relative;
        display: flex;
        flex: 1 1 0;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: var(--spacing-2xs);
        min-width: 0;
        min-height: var(--control-h-touch);
        padding: var(--spacing-xs) 0;
        border: 0;
        background: transparent;
        color: var(--header-control-fg);
        opacity: 0.72;
        text-decoration: none;
    }

    .global-phone-bar__door:hover,
    .global-phone-bar__door:focus-visible {
        color: var(--header-control-fg);
        opacity: 1;
    }

    .global-phone-bar__door i {
        font-size: var(--font-size-xl);
        line-height: 1;
    }

    /* A word stays on one line. On a phone its door grows to fit it (below). */
    .global-phone-bar__word {
        font-size: var(--font-size-xs);
        line-height: 1;
        white-space: nowrap;
    }

    .global-phone-bar__door[aria-current="page"] {
        opacity: 1;
        font-weight: var(--font-weight-medium);
    }

    .global-phone-bar__door[aria-current="page"] i {
        padding: var(--spacing-2xs) var(--spacing-md);
        border-radius: var(--radius-pill);
        background: var(--sidebar-hover-bg);
    }

    /* The count rides the icon, not the door's corner. */
    .global-phone-bar__badge {
        position: absolute;
        top: var(--spacing-2xs);
        left: calc(50% + var(--spacing-xs));
        min-width: 18px;
        height: 18px;
        padding: 0 var(--spacing-xs);
        border-radius: var(--radius-pill);
        background: var(--color-error);
        color: var(--header-control-fg);
        font-size: var(--font-size-xs);
        font-weight: var(--font-weight-heading);
        line-height: 18px;
        text-align: center;
    }

    :root:has(.global-phone-bar) .global-app-header .global-sidebar-toggle {
        display: none;
    }

    :root:has(.global-phone-bar) .global-app-header .global-topbar-search {
        margin-left: auto;
    }

    :root:has(.global-phone-bar) .global-app-content {
        padding-bottom: calc(var(--bottom-bar-h) + var(--page-gutter));
    }

    /* A page locked to the screen stops at the bar, and does not pad for it
       a second time. */
    :root:has(.global-phone-bar) .global-app-main:has(.global-page-fill) {
        min-height: 0;
        height: calc(100vh - var(--safe-top) - var(--bottom-bar-h));
        height: calc(100dvh - var(--safe-top) - var(--bottom-bar-h));
    }

    :root:has(.global-phone-bar) .global-app-main:has(.global-page-fill) .global-app-content {
        padding-bottom: var(--page-gutter);
    }

    /* Inside a text thread the reply box takes the bottom of the screen
       (texts.css), so the bar steps aside the way the app bar always has. */
    body:has(.conversations-app.is-thread-open) .global-phone-bar {
        display: none;
    }
}

/* A phone: Nick's look D (10-31), the way an iPhone app looks. The app bar is
   back at the top, a row of icons, and runs from the screen's top edge, notch
   included. It is clear while the page sits at the top, under the page's own
   large title; once the page scrolls (page-scrolled.js marks html) it turns to
   glass with the page's name small in it. The tabs float as a glass capsule
   over the home bar. */
@media (max-width: 767.98px) {
    /* The app bar's height is in tokens.css, beside --header-bottom. */
    :root:has(.global-phone-bar) {
        --sheet-bottom: 0px;
        --sheet-pad-bottom: var(--safe-bottom);
        --bottom-bar-h: calc(var(--header-height-touch) + var(--glass-capsule-lift));
    }

    /* The bar itself covers the notch, so the strip behind it (main.css) goes. */
    :root:has(.global-phone-bar) body:not(:has(.conversations-app.is-thread-open))::before {
        display: none;
    }

    /* body pads by the notch; the bar steps back up over that padding. Its
       buttons wear the page's text colour, not the dark bar's white. */
    :root:has(.global-phone-bar) .global-app-header {
        --header-control-fg: var(--color-text);
        --header-control-bg: transparent;
        --header-control-border: transparent;
        --header-control-hover-bg: var(--glass-bar-pill);
        --header-control-hover-fg: var(--color-text);
        --header-control-focus-ring: var(--glass-bar-rim);
        position: sticky;
        top: 0;
        bottom: auto;
        height: calc(var(--safe-top) + var(--control-h-touch));
        margin-top: var(--safe-top-bleed);
        padding: var(--safe-top) var(--spacing-xs) 0 var(--spacing-md);
        gap: 0;
        border-top: 0;
        border-bottom: 1px solid transparent;
        background: transparent;
        color: var(--color-text);
        transition: border-color var(--transition-normal);
    }

    /* The glass is a layer behind the bar's buttons, not the bar's own
       background: a blur on the bar would trap the sheets that live inside it
       (search, its scrim) inside the bar's box. */
    :root:has(.global-phone-bar) .global-app-header::after {
        content: "";
        position: absolute;
        inset: 0;
        z-index: var(--z-behind);
        background: var(--glass-bar-fill);
        -webkit-backdrop-filter: var(--glass-bar-blur);
        backdrop-filter: var(--glass-bar-blur);
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--transition-normal);
    }

    :root.is-scrolled:has(.global-phone-bar) .global-app-header {
        border-bottom-color: var(--glass-bar-rim);
    }

    :root.is-scrolled:has(.global-phone-bar) .global-app-header::after,
    :root.is-scrolled:has(.global-phone-bar) .global-app-header__title {
        opacity: 1;
    }

    /* The page's name, small, once its large title has scrolled away. */
    :root:has(.global-phone-bar) .global-app-header__title {
        display: block;
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: var(--font-size-base);
        font-weight: var(--font-weight-large-title);
        opacity: 0;
        transition: opacity var(--transition-normal);
    }

    /* The search sheet drops from under the notch in the card colour, and
       fills the notch above itself in that colour too. Its scrim dims the
       whole screen; the capsule stays lit above it. */
    :root:has(.global-phone-bar) .global-topbar-search.is-revealed .global-topbar-search__form {
        background: var(--color-card-bg);
        box-shadow: var(--shadow-notch-fill-card), var(--shadow-modal);
    }

    :root:has(.global-phone-bar) .global-topbar-search__scrim {
        inset: 0;
    }

    /* The tabs: a glass capsule, inset from the sides, floating over the home
       bar. The current tab sits in a soft pill and wears its filled icon
       (phone_bar.html). */
    /* One rung under the top bar, so the sheets that live in it (the bell,
       Support, search) cover the capsule like every other sheet does. */
    :root:has(.global-phone-bar) .global-phone-bar {
        z-index: var(--z-scrim);
        inset: auto var(--spacing-lg) var(--glass-capsule-lift);
        height: var(--header-height-touch);
        padding: var(--spacing-xs);
        border: 1px solid var(--glass-bar-rim);
        border-radius: var(--radius-pill);
        background: var(--glass-bar-fill);
        -webkit-backdrop-filter: var(--glass-bar-blur);
        backdrop-filter: var(--glass-bar-blur);
        box-shadow: var(--shadow-glass-capsule);
    }

    /* A door is never narrower than its word, plus a little room each side.
       A long word (Opportunities) takes the room it needs, and the other
       doors share the rest, so no two words touch on a small phone. */
    :root:has(.global-phone-bar) .global-phone-bar__door {
        min-width: min-content;
        min-height: 0;
        padding: 0 var(--spacing-xs);
        border-radius: var(--radius-pill);
        color: var(--color-text-secondary);
        opacity: 1;
    }

    :root:has(.global-phone-bar) .global-phone-bar__word {
        font-weight: var(--font-weight-medium);
    }

    :root:has(.global-phone-bar) .global-phone-bar__door:hover,
    :root:has(.global-phone-bar) .global-phone-bar__door:focus-visible,
    :root:has(.global-phone-bar) .global-phone-bar__door[aria-current="page"] {
        color: var(--color-text);
    }

    :root:has(.global-phone-bar) .global-phone-bar__door[aria-current="page"] {
        background: var(--glass-bar-pill);
    }

    :root:has(.global-phone-bar) .global-phone-bar__door[aria-current="page"] i {
        padding: 0;
        background: none;
    }

    :root:has(.global-phone-bar) .global-app-header .global-app-header-actions {
        display: flex;
        align-items: center;
        gap: var(--spacing-xs);
        margin-left: 0;
    }

    :root:has(.global-phone-bar) .global-app-header .global-topbar-search,
    :root:has(.global-phone-bar) .global-app-header .notifications-bell,
    :root:has(.global-phone-bar) .global-app-header .support-desk {
        flex: 0 0 auto;
        align-self: center;
    }

    /* main.css hides it in the bottom bar of a page with no doors. */
    :root:has(.global-phone-bar) .global-app-header .global-watch-tutorials {
        display: inline-flex;
    }

    :root:has(.global-phone-bar) .global-app-header .global-header-btn-icon {
        flex: 0 0 auto;
        flex-direction: row;
        width: var(--control-h-touch);
        height: var(--control-h-touch);
        min-height: var(--control-h-touch);
        padding: 0;
    }

    :root:has(.global-phone-bar) .global-app-header .global-header-btn__label {
        display: none;
    }

    :root:has(.global-phone-bar) .global-app-header .notifications-bell-badge {
        top: var(--spacing-2xs);
        right: var(--spacing-2xs);
    }
}

/* Inside the iPhone app (the app marks html with global-in-native-app) the
   app draws its own glass tab bar in this bar's spot. This one stays in the
   page, unseen and untouchable, so the app can still read its doors and click
   them, and the page still pads for it. A browser never has the mark. */
:root.global-in-native-app .global-phone-bar {
    opacity: 0;
    pointer-events: none;
}

/* A wide touch screen (an iPad held sideways): the side menu leaves its column
   and slides in over the page when More is pressed, the way it does on a
   narrower screen. A computer with a mouse keeps its side menu. */
@media (min-width: 1024px) and (hover: none) and (pointer: coarse) {
    :root:has(.global-phone-bar) .global-app-layout .global-app-main {
        margin-left: 0;
    }

    :root:has(.global-phone-bar) .global-sidebar {
        z-index: var(--z-modal);
        width: 100vw;
        max-width: 320px;
        transform: translateX(-100%);
    }

    :root:has(.global-phone-bar) .global-sidebar.is-open {
        transform: translateX(0);
    }

    :root:has(.global-phone-bar) .global-sidebar-scrim {
        display: block;
    }

    :root:has(.global-phone-bar) .global-sidebar.is-open + .global-sidebar-scrim {
        opacity: 1;
        pointer-events: auto;
    }

    :root:has(.global-phone-bar) .global-app-header::before {
        display: none;
    }
}

/* Parts that open on a computer alone (Nick's pick, 11-10: Scheduling).

   .global-computer-only goes away below 768px: the side menu's Scheduling row
   and a booking's Open in Scheduling.

   .global-computer-note is a page's phone note: the house empty state with one
   line ("Scheduling opens on a computer"). It shows below 768px alone, and the
   parts after it go away there, so a phone draws no grid. The bottom bar goes
   too: x-teleport puts it at the end of the page, out of the note's reach. At
   768px and wider the note stays hidden and the page does not change. */
.global-computer-note {
    display: none;
}

@media (max-width: 767.98px) {
    .global-computer-only,
    .global-computer-note ~ :not(.global-computer-note),
    :root:has(.global-computer-note) .global-view-bar {
        display: none;
    }

    .global-computer-note {
        display: block;
    }
}

/* The Scheduling page's Availability tab — every rule the page used to carry
   in its five inline <style> blocks, extracted verbatim (2026-09-03). Loaded
   last in base.html so the cascade order the inline blocks had (after every
   linked sheet) is preserved. Sections below keep the blocks' original order:
   tab toolbar, shared card chrome, the mode-shared body, org mode, personal
   mode. */

/* ── Tab toolbar (bucket picker + mode toggle) ── */
/* Seated in the tab strip's actions slot, so the strip's own card supplies  */
/* the layout box and the gap below it. No margin here: an empty cluster —   */
/* a coordinator with no bucket renders no controls — would otherwise push   */
/* the tab content down for nothing.                                         */
/* `min-width: 0` is the load-bearing line here, not housekeeping. A flex item */
/* defaults to `min-width: auto`, which means it may not shrink below its own  */
/* min-content — so with a 46-character schedule name this cluster measured    */
/* 393px inside a 327px card at 390px, and everything it contains was handed   */
/* that too-wide box. The label's `max-width: 100%` then resolved against 364  */
/* and never ellipsized, and the mode switch painted 52px past the card's      */
/* rounded corner onto the page. Both are the same one refusal to shrink.      */
/* Every box between the card and the text needs this, or the last one in the  */
/* chain is measuring against a lie.                                           */
/* `flex-wrap: wrap` belongs here and not in a media query. It was a phone     */
/* rule until 2026-07-29, so between 576 and 767 — where the cluster has a row */
/* of its own but the card is only 513px wide and the three controls ask for   */
/* 559 — nowrap held, and the picker painted on top of the Personal segment,   */
/* which read "ersonal". Nothing about that band is special; it is just the    */
/* first width where they do not fit, and the same three controls with a long  */
/* name run out of room at other widths too. A row that may wrap has no such   */
/* band: the controls take the next line wherever they stop fitting, and above */
/* that they fit and it never fires.                                           */
.calendar-avail-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 0;
}
.calendar-avail-header-bucket-picker {
    position: relative;
    z-index: 1;
    min-width: 0;
}
/* ── Mockup A (2026-07-29): the mode switch rides beside the tabs ──         */
/* Personal|Organization answers "whose schedule am I looking at", which is   */
/* the same question the tabs answer — it belongs with them, not 556px away   */
/* at the other end of the strip with the two controls that ACT on a          */
/* schedule. The cluster keeps its one DOM location and everything below is   */
/* about where that lands on screen; the `min-width: 576px` block further     */
/* down is where the switch is actually put beside the tabs.                  */
/* The seam between "which tab" and "whose schedule". The strip's own 0.75rem */
/* gap already sits to its left, so only the right side needs making up to    */
/* the 12px the mockup asks for — the toolbar's 8px gap does the rest. Above  */
/* 576 the row supplies both sides and takes this margin back off; see there. */
/* Height is the switch's height less 7px of air top and bottom, not a flat   */
/* 22px: on a coarse pointer every control on this row grows to a 44px tap    */
/* target (tokens.css), and a fixed rule would come out half the height of    */
/* the thing it is dividing.                                                  */
.calendar-avail-toolbar__divider {
    flex: 0 0 auto;
    width: 1px;
    height: calc(var(--control-h-base) - 14px);
    margin: 0 var(--spacing-xs) 0 0;
    background: var(--color-border);
}
.calendar-avail-toolbar__right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-left: auto;
    min-width: 0;
}
/* The shared combobox owns the field, menu and focus styles. */
.calendar-avail-header-bucket-picker .global-cs-input {
    text-overflow: ellipsis;
}
.calendar-avail-header-add-btn {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: var(--control-h-touch);
    height: var(--control-h-touch);
    padding: 0;
    border-radius: var(--radius-pill);
    font-size: var(--font-size-xl);
}
/* ── Strip with no tabs on it ──                                           */
/* An org without the meetings add-on gets `scheduling_tabs = []`, so the   */
/* card holds this cluster and nothing else. The shell carries no padding   */
/* of its own — a tab's own 0.6rem/0.9rem is what insets the strip — so     */
/* with the tabs gone the controls sat flat against all four card edges.    */
/* Borrow the tab's padding so the lone cluster sits where the first tab    */
/* label would have. Every width: the cluster is the whole card here, so    */
/* there is no wide-screen case where the tabs put it back.                 */
.global-tab-card--row:not(:has(.global-tabs)) .calendar-avail-toolbar {
    padding: var(--spacing-sm) var(--spacing-md);
}
/* ── Contrast on the strip ──                                              */
/* Scoped to this page on purpose. The tab and segmented components are     */
/* shared and locked (ADR-125/ADR-131), and their muted grey is legible     */
/* enough on the surfaces they usually sit on; on this strip the two land   */
/* side by side and both read as disabled. Fixing them platform-wide is a   */
/* design review of every page that mounts them, not a line in this file.   */

/* The segmented half of that is no longer here: the Meetings tab had grown */
/* a hand-copy of it, so both moved to components/segmented.css under       */
/* `.global-tab-card__actions` — the actions cluster of a tab strip, which  */
/* is the surface the contrast argument is actually about. That widens the  */
/* rule to any segmented control seated in a strip, and to nothing else.    */
/* The tab half below stays page-scoped: `.global-tab` mounts on strips     */
/* this argument has not been made for.                                     */

/* 2.54:1 for the tab you are not on. The live tab has to be excluded by    */
/* hand, and the hover darkening restated, for the same reason: this block  */
/* is inline and comes after the stylesheet, so at equal specificity it     */
/* would otherwise take the colour off the tab you are standing on.         */
.global-tab-card--row:has(.calendar-avail-toolbar) .global-tab:not(.is-active) {
    color: var(--color-grey-700);
}
.global-tab-card--row:has(.calendar-avail-toolbar) .global-tab:not(.is-active):hover {
    color: var(--color-text);
}
/* ── Narrow desktop: the schedule PAIR takes a row of its own ──           */
/* One DOM location, wrapped — not a second copy of the controls for small  */
/* screens. Two copies means two ids, two Alpine scopes and two things to   */
/* keep in step, and the picker carries an id the rename endpoint swaps.    */
/*                                                                          */
/* What drops is the pair that acts on a schedule, not the switch. The      */
/* switch answers the same question the tabs do (mockup A), so it holds its */
/* place beside them, hairline included, for as long as it fits: tabs ask   */
/* 204px and the switch 246, 463 with the seam, against the 513px card a    */
/* 576px viewport draws. Sending the whole cluster down instead — which is  */
/* what this block did until 2026-07-29 — left the tabs alone on a row with */
/* 309px of nothing beside them and made the page three rows deep.          */
/*                                                                          */
/* Below 576 the phone block takes over and stacks all three; above 991 the */
/* strip has ~724px free and the whole cluster asks ~446, so it all sits on */
/* one line and this never fires.                                           */
@media (max-width: 991.98px) {
    /* Full basis, so the pair takes a line of its own and the switch is left */
    /* on the tabs'. That line is then the row's full width, so the pair also */
    /* needs telling to sit at the far end of it — its auto margin only       */
    /* reaches the free space on a line it shares with something, and here it */
    /* shares with nothing. Measured 2026-07-29: removing the alignment costs */
    /* 23px at 768 and 246px at 991, and is the one width-dependent thing on  */
    /* this rule — at 576 the pair fills its line and there is nothing to     */
    /* align.                                                                 */
    .calendar-avail-toolbar .calendar-avail-toolbar__right {
        flex: 1 1 100%;
        justify-content: flex-end;
    }
}
/* ── Above the phone stack, the cluster is not a box ──                     */
/* The card row centres its children against each other. A cluster that has  */
/* wrapped is an 80px box, so the 41px tab strip centred against the whole   */
/* of it and came out 22px BELOW the switch — straddling both of the         */
/* cluster's rows, 16px into each, with the hairline drawn beside the switch */
/* instead of beside the tab labels it divides. Nothing inside either box    */
/* was misaligned. The problem was that they were two boxes, and it showed   */
/* at every width where the cluster wrapped: 576 to 991, pushed 1200 and     */
/* 1440, and 992 itself once a schedule name is long enough to wrap it.      */
/*                                                                           */
/* So the cluster stops being a box. `display: contents` hands its children  */
/* to the card row, which makes the tabs, the hairline and the switch three  */
/* items of ONE flex line, centred by the same `align-items` the strip has   */
/* always had — measured at 0px stagger, the same as the single-row layout   */
/* it now matches at every width. The card row does the wrapping and takes   */
/* over the 0.9rem right inset that went with the cluster's own box.         */
/*                                                                           */
/* `justify-content` has to be restated: the row's shipped `space-between`   */
/* is inert while a full-width cluster is the only thing beside the tabs,    */
/* and would spread the tabs, hairline and switch across the line the moment */
/* they became separate items of it.                                         */
/*                                                                           */
/* Not on a phone: down there all three stack and the cluster's box is what  */
/* holds them, with its own inset and its own bottom padding.                */
/*                                                                           */
/* And not on a card with no tabs on it (the no-meetings-add-on org, above).  */
/* There is nothing for the cluster to align WITH there, and its box is the   */
/* only thing holding the padding that keeps those controls off the card's    */
/* edges — dissolving it would push them flat against all four.               */
@media (min-width: 576px) {
    .global-tab-card--row:has(.global-tabs) > .calendar-avail-toolbar {
        display: contents;
    }
    .global-tab-card--row:has(.global-tabs):has(.calendar-avail-toolbar) {
        flex-wrap: wrap;
        row-gap: var(--spacing-sm);
        justify-content: flex-start;
        padding-right: var(--spacing-md);
    }
    /* Both sides of the seam are the row's 0.75rem gap now. The hairline's own */
    /* right margin exists to make the toolbar's narrower 8px gap up to 12, and */
    /* on the row it lands on top of a gap that is already 12 — measured as a   */
    /* 12/16 seam, leaning right.                                               */
    .global-tab-card--row:has(.global-tabs) .calendar-avail-toolbar__divider {
        margin-right: 0;
    }
}
/* ── Phone toolbar: stack it into two rows ──                             */
/* These controls used to sit in the page header, and this block used to   */
/* stack them there. They live in the toolbar now, so every rule below     */
/* names the toolbar — pointed at the header they would either miss        */
/* entirely or move the wrong thing.                                       */
/* On one row they run past a 390px screen: the row does not wrap and a    */
/* bucket name is a nowrap span, so the picker keeps the full width of its */
/* text and pushes the mode switch off the right edge, where it cannot be  */
/* reached at all. Rows here:                                              */
/*   1. New availability and the schedule picker, which takes the rest     */
/*   2. the Personal | Organization switch, full width                     */
/* The label needs a cap of its own: an ellipsis only forms when something */
/* bounds the text, and every box between it and the row can still grow    */
/* unless each one is told it may shrink.                                  */
/* The tab strip needs no rule of its own: a cluster with a 100% basis      */
/* cannot share the tabs' line, so the tabs keep the first row by default.  */
@media (max-width: 575.98px) {
    /* The one width where the strip has to break: a 100%-basis cluster is    */
    /* the only thing that cannot share the tabs' line, and without this the  */
    /* row holds it there anyway — measured at 390 as the tabs crushed to     */
    /* 116px and the switch painting 28px past the card's right edge.         */
    .global-tab-card--row:has(.calendar-avail-toolbar) {
        flex-wrap: wrap;
    }
    /* The whole cluster comes down here, switch included — 204px of tabs    */
    /* plus a 246px switch does not fit a 342px card, and the switch is the  */
    /* one of the three that has somewhere else to be. Inset to the first    */
    /* tab label's own 0.9rem, and air below so the last row is not flush    */
    /* against the card's bottom edge.                                       */
    .global-tab-card--row .calendar-avail-toolbar {
        flex: 1 1 100%;
        padding-left: var(--spacing-md);
        padding-bottom: var(--spacing-smd);
    }
    /* A hairline between the tabs and the switch says something only while  */
    /* they share a line. Down here the switch leads a row of its own with   */
    /* nothing to its left to be divided from.                              */
    .global-tab-card--row .calendar-avail-toolbar__divider {
        display: none;
    }
    .calendar-avail-toolbar .calendar-avail-header-bucket-picker {
        flex: 1 1 auto;
    }
    /* Scoped to this toolbar on purpose: .global-segmented is a locked shared */
    /* component (ADR-125 singleton gate), so only the copy inside the         */
    /* availability toolbar moves to its own row.                             */
    .calendar-avail-toolbar .global-segmented {
        flex: 0 0 100%;
    }
    /* The two rows a phone has always had, in the order it has always had     */
    /* them: the schedule and the way to add one first, the mode switch under  */
    /* them. Mockup A puts the switch FIRST in source so it can sit beside the */
    /* tabs on a wide screen; `order` is what keeps that from reshuffling the  */
    /* phone, which never shares a line with the tabs at all.                  */
    .calendar-avail-toolbar .calendar-avail-toolbar__right {
        order: -1;
        flex: 1 1 100%;
        gap: var(--spacing-sm);
    }
}

.calendar-avail-preview-card.calendar-avail-personal-card {
    padding: var(--spacing-md) var(--spacing-mdlg) var(--spacing-sm);
}
.calendar-avail-personal-card .calendar-avail-personal-card-header,
.calendar-avail-personal-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--color-grey-100);
    padding: var(--spacing-xs) 0 var(--spacing-smd) 0;
    margin: 0 0 var(--spacing-md) 0;
}
.calendar-avail-personal-card .calendar-avail-personal-card-title,
.calendar-avail-personal-card .card-header h5 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    color: #111;
    margin: 0;
    letter-spacing: -0.01em;
}
/* The autosave status rides the right end of the working-hours header, beside */
/* the title. min-width keeps "Saving…" and "Saved" from resizing the row as   */
/* they swap; it is the only element in the header whose text changes.         */
.calendar-avail-personal-card .calendar-avail-hours-status {
    min-width: 90px;
    text-align: right;
}
.calendar-avail-personal-card .card-body {
    padding: 0;
}
/* ── What each of the three cards is FOR (2026-08-19) ──────────────────────  */
/* The trio is an equation, not three peer settings: working hours ADD time,   */
/* connected calendars SUBTRACT it, exceptions OVERRIDE it. Equal thirds at    */
/* one height cannot say that on their own, so each card says it in one line   */
/* under its own title, and the page stops needing somebody to explain it.     */
.calendar-avail-settings-trio .calendar-avail-personal-card-header {
    /* The hint takes a row of its own, under the title and its buttons. */
    flex-wrap: wrap;
}
.calendar-avail-card-hint {
    flex: 0 0 100%;
    margin: 0;
    font-size: var(--font-size-sm);
    line-height: 1.35;
    color: var(--color-text-secondary);
}

/* ── Bucket panel + timing stepper + service-type chip chrome (both modes) ── */
/* ── Settings band — every control for the selected schedule, on the page ──  */
/*                                                                            */
/* Until 2026-08-18 this card was a summary of the settings and a gear that    */
/* opened them in a drawer. Now the settings show all the time. The            */
/* summary chrome that described them (the hours strip, the read-only chips,   */
/* the gear's focus ring) went with the drawer — everything it reported is on  */
/* screen.                                                                    */
/*                                                                            */
/* Round 10 (2026-08-19) split it in two: the name and location sit in the top */
/* section on the left, with a delete icon on the right. Below that, the       */
/* min/max notice and timezone take the left third of the row, and the service */
/* types take the right two-thirds.                                            */
/*                                                                            */
/* So a full-width top row, then a 1/3 : 2/3 row under it. The lower row still  */
/* has one fixed height set by its left column, and the service-type list takes */
/* that height and scrolls inside it. The band still cannot grow: add a field   */
/* to the left and the list gets shorter, which is the trade on purpose.       */
#bucket-settings-band {
    /* One height for every control in here. This card had four — a 28px name  */
    /* field, 31px comboboxes, 30px stepper parts and a 32px timezone select — */
    /* which read as four different kinds of control rather than one form.     */
    --settings-control-h: 34px;
    /* Two widths that used to be "whatever is left in the column", which is   */
    /* how a three-letter unit ended up in a 348px dropdown. Both are sized by */
    /* their longest content instead: "minutes" for the unit, an American time */
    /* zone name for the picker. Both may shrink in a narrow column; neither   */
    /* may grow. The unit is the house dropdown since 2026-11-04, and          */
    /* "minutes" in its 15px face plus the chevron measures 95px.              */
    --settings-unit-w: 6rem;
    --settings-tz-w: 17rem;
}
/* Name, location, delete. Capped, not fluid: the name and location fields do   */
/* not need to be excessively long — a name is a handful of words and an        */
/* address one line, so a field spanning half the band only advertises room     */
/* nobody needs. The third track is the slack that pushes delete right.         */
/* align-items: end so the icon sits on the field baseline, not on the labels.  */
.scheduling-bucket-settings-band__top {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    align-items: end;
    padding-bottom: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--color-grey-200);
}
@media (min-width: 768px) {
    .scheduling-bucket-settings-band__top {
        grid-template-columns: minmax(0, 18rem) minmax(0, 24rem) 1fr;
    }
}
/* The gap between the rows already separates these, so the per-group margin    */
/* that spaces a stacked column would double it.                               */
#bucket-settings-band .scheduling-bucket-settings-band__top .scheduling-bucket-settings-band__group {
    margin-bottom: 0;
    min-width: 0;
}
.scheduling-bucket-settings-band__group--name,
.scheduling-bucket-settings-band__group--location {
    min-width: 0;
}
.scheduling-bucket-settings-band__del {
    justify-self: end;
}
/* A Virtual schedule's top row carries the name and nothing else, so it takes */
/* the name track alone rather than reserving the location and delete tracks   */
/* beside it.                                                                  */
.scheduling-bucket-settings-band__top--name-only {
    grid-template-columns: minmax(0, 18rem);
}
/* Read-only name (Virtual). Grey fill and a no-entry cursor so it reads as a  */
/* value being reported, not a field waiting to be typed in — the meetings     */
/* add-on owns this name and nothing on this page may change it.               */
#bucket-settings-band .form-control[readonly] {
    background: var(--color-grey-50);
    color: var(--color-text-secondary);
    cursor: not-allowed;
}
.scheduling-bucket-settings-band__cols {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 var(--spacing-xl);
}
/* A Virtual schedule has notice and time zone and nothing else — no service   */
/* types to put beside them. One 1fr track let the pair stretch the full band, */
/* and because the unit select takes a stepper's slack (see __unit below) that */
/* landed as two dropdowns the width of the page (2026-08-19). Capping the     */
/* track is the fix: the column is the same width it is in every other band,   */
/* with empty space beside it instead of stretched controls inside it.         */
.scheduling-bucket-settings-band__cols--single {
    grid-template-columns: minmax(0, 30rem);
}
@media (min-width: 992px) {
    .scheduling-bucket-settings-band__cols {
        /* ~1/3 notice + time zone, ~2/3 service types. minmax(0, …) on both   */
        /* because a grid item defaults to min-width: auto — one long time-zone */
        /* name would otherwise widen the left track past its share.           */
        grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
        /* The row is as tall as the left column, and the right column is       */
        /* stretched to match it. See __scrollhost for why the list itself      */
        /* contributes nothing to that measurement.                             */
        align-items: stretch;
    }
    .scheduling-bucket-settings-band__cols--single {
        grid-template-columns: minmax(0, 30rem);
    }
}
/* Section headers step back. At 12px/700 they were competing with the field   */
/* labels under them for the same job; quiet and small says "this is a         */
/* heading" without shouting it.                                              */
#bucket-settings-band .scheduling-bucket-settings-band__label {
    display: block;
    margin-bottom: var(--spacing-xsm);
    font-size: 11px;
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-grey-600);
}
#bucket-settings-band .scheduling-bucket-settings-band__group {
    margin-bottom: var(--spacing-mdlg);
}
/* The card's own bottom padding closes the band, so the last field does not   */
/* carry a margin of its own.                                                 */
#bucket-settings-band .scheduling-bucket-settings-band__group:last-child {
    margin-bottom: 0;
}

/* ── One control height ──────────────────────────────────────────────────── */
/* The name field, both comboboxes (location, time zone), and every piece of   */
/* both steppers.                                                             */
/*                                                                            */
/* A fixed height is right for a control that holds one line and wrong for one */
/* that holds several, and this band renders from two templates (personal and  */
/* org) — so the day a textarea lands in the org body, this would crush it to  */
/* a single line. Name the one element that must never take the height rather  */
/* than trusting whoever adds it to notice.                                    */
#bucket-settings-band .form-control:not(textarea),
#bucket-settings-band .global-cs-input,
#bucket-settings-band .scheduling-bucket-timing-stepper,
#bucket-settings-band .scheduling-bucket-timing-stepper__btn,
#bucket-settings-band .scheduling-bucket-timing-stepper__input,
#bucket-settings-band .scheduling-bucket-timing-stepper__unit {
    height: var(--settings-control-h);
}
#bucket-settings-band .scheduling-bucket-timing-stepper__btn {
    width: var(--settings-control-h);
}

/* Field labels — the two inside the Notice row and the time zone's. Ink, so   */
/* they read as the name of the thing you are about to set, not as chrome.     */
#bucket-settings-band .scheduling-bucket-timing-field__label,
#bucket-settings-band .scheduling-bucket-settings-band__field-label {
    font-size: 13px;
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

/* The two steppers end on the same right edge and neither is wider than the   */
/* words in it (2026-08-19: the min/max and notice dropdowns were still much   */
/* too wide and looked out of place).                                          */
/*                                                                             */
/* They got that way honestly: each stepper is inline-flex at its own          */
/* intrinsic width, "min/hr/day/wk" and "day/wk/mo" are different widths, so   */
/* the two ended short of their columns by different amounts and the fix was   */
/* to fill the column and hand the slack to the unit select. That lands both   */
/* edges on one line, but the line is the column's — 348px of dropdown around  */
/* the word "day" at 1920. Fixing the select's width instead gets the same     */
/* two equal steppers out of the widest word either list holds, and the band   */
/* can be as wide as it likes without the controls following it.               */
#bucket-settings-band .scheduling-bucket-timing-stepper {
    display: flex;
    width: auto;
}
#bucket-settings-band .scheduling-bucket-timing-stepper__unit {
    flex: 0 1 var(--settings-unit-w);
    width: var(--settings-unit-w);
    min-width: 0;
}
/* The unit is the house dropdown (Nick, 2026-11-04), so it is a global-cs     */
/* combobox like the Time zone beside it. Its stock padding is sized for a    */
/* wide field and left "minutes" no room; a tighter left edge and the chevron */
/* pulled in keep the box as narrow as its widest word.                       */
#bucket-settings-band .scheduling-bucket-timing-stepper__unit .global-cs-input {
    padding: 0 var(--spacing-lg) 0 var(--spacing-sm);
}
#bucket-settings-band .scheduling-bucket-timing-stepper__unit .global-cs-toggle__chev {
    right: var(--spacing-sm);
}
/* The menu is pinned to its box's width, and the box is only one word wide — */
/* so the list may grow past it to fit its own words and check mark.          */
#bucket-settings-band .scheduling-bucket-timing-stepper__unit .global-cs-menu {
    min-width: 100%;
    width: max-content;
}

/* "Add a location" is the only way forward when a worker has no addresses     */
/* yet, and it was dressed as a disabled input — grey fill, input border,      */
/* muted text. A dashed add button says the same thing the dashed             */
/* service-type chips already say on this page: nothing here yet, this is      */
/* where you add it.                                                          */
#bucket-settings-band .scheduling-bucket-settings-band__add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xsm);
    width: 100%;
    height: var(--settings-control-h);
    padding: 0 var(--spacing-smd);
    border: 1.5px dashed var(--color-grey-400);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-text);
    font-size: var(--font-size-sm);
    text-decoration: none;
}
#bucket-settings-band .scheduling-bucket-settings-band__add:hover {
    border-color: var(--color-action);
    color: var(--color-text);
}
#bucket-settings-band .scheduling-bucket-settings-band__add:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

/* A locked chip has to stay readable — it is the one chip carrying a tooltip  */
/* you are meant to go read. #94a3b8 on the muted fill was 2.34:1; the grey    */
/* token is 5.2:1 and still clearly the quiet chip. Muting stays on color,     */
/* never opacity: opacity here would composite the data-tooltip bubble along   */
/* with it (2026-07-02).                                                      */
#bucket-settings-band .scheduling-service-type-chip--used-elsewhere,
#bucket-settings-band .scheduling-service-type-chip.is-used-elsewhere {
    color: var(--color-grey-600);
}

/* ── The service-type column ─────────────────────────────────────────────── */
/* Label on top, list under it taking whatever is left.                       */
/* A grid item defaults to min-width: auto, which is "never shrink below your  */
/* content" — one long location label or time-zone name would push the column  */
/* past its 1fr and take the row with it.                                     */
.scheduling-bucket-settings-band__col {
    min-width: 0;
}
/* The notice/time-zone column measures itself so the time-zone row knows when */
/* it has run out of room for a label beside the control. The list column is   */
/* left out on purpose: `container-type` brings layout containment with it,    */
/* and that column's whole trick is an absolutely positioned list that reports */
/* no height (see __scrollhost).                                               */
.scheduling-bucket-settings-band__col:not(.scheduling-bucket-settings-band__col--fill) {
    container: settings-col / inline-size;
}
/* Under ~352px of column the label and a readable zone name no longer fit on  */
/* one line, and the name is the half that would lose — "Central Time (Chicag… */
/* So the label steps back above the control, which is the shape this row had  */
/* everywhere before. Side by side is the ask; unreadable is not. 352 and not   */
/* 330 because a phone draws the field at 16px, where "Central Time (Chicago)"  */
/* needs a 221px box; the label, the save tell and two gaps take 126px more.   */
/* At 430 wide the column is 341px and the old 330 left the name cut off       */
/* (2026-11-04). Desktop columns sit above 352 or already below 330.           */
@container settings-col (max-width: 352px) {
    .scheduling-bucket-settings-band__group--tz {
        flex-wrap: wrap;
        gap: var(--spacing-xsm) var(--spacing-sm);
    }
    .scheduling-bucket-settings-band__group--tz form {
        flex: 1 1 100%;
    }
}
.scheduling-bucket-settings-band__col--fill {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
}
/* The list is absolutely positioned inside here, which is the whole trick: an */
/* absolute child contributes nothing to its parent's height, so this column   */
/* never argues with the left one about how tall the row should be. The left   */
/* column wins by default and the list takes what that leaves. Position it     */
/* statically and a long list would make the band as tall as itself.          */
.scheduling-bucket-settings-band__scrollhost {
    position: relative;
    min-height: 0;
}
.scheduling-bucket-settings-band__scroll {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    /* The chevrons and the fade are the affordance — hide the native bar. */
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* Per-edge fade depth, raised by the --fade-* classes (bound to the same  */
    /* Alpine state as the chevrons). Kept at 0 here so a fully-scrolled edge  */
    /* renders crisp to the card boundary.                                     */
    --band-fade-top: 0rem;
    --band-fade-bottom: 0rem;
}
.scheduling-bucket-settings-band__scroll::-webkit-scrollbar {
    display: none;
}
/* Overflow fade — a mask on the scroll cell, not a wash painted over it. The  */
/* same treatment the signup role cards use, for the reason given there        */
/* (08-17, twice): a white scrim sits ON TOP of clipped text, so however eased */
/* its ramp is, its outer edge always meets full-strength letters in a visible */
/* line. Masking makes the chips themselves dissolve into the card: there is   */
/* no painted layer to end anywhere. The -webkit- copy is the same ramp        */
/* verbatim (Safari before 15.4 knows only the prefixed property) — edit the   */
/* two together or the mask layers drift.                                      */
.scheduling-bucket-settings-band__scroll--fade-top,
.scheduling-bucket-settings-band__scroll--fade-bottom,
.calendar-avail-card-scroll--fade-top,
.calendar-avail-card-scroll--fade-bottom {
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent,
        rgba(0, 0, 0, 0.3) calc(var(--band-fade-top) * 0.35),
        rgba(0, 0, 0, 0.75) calc(var(--band-fade-top) * 0.7),
        rgba(0, 0, 0, 0.95) calc(var(--band-fade-top) * 0.88),
        black var(--band-fade-top),
        black calc(100% - var(--band-fade-bottom)),
        rgba(0, 0, 0, 0.95) calc(100% - var(--band-fade-bottom) * 0.88),
        rgba(0, 0, 0, 0.75) calc(100% - var(--band-fade-bottom) * 0.7),
        rgba(0, 0, 0, 0.3) calc(100% - var(--band-fade-bottom) * 0.35),
        transparent
    );
    mask-image: linear-gradient(
        to bottom,
        transparent,
        rgba(0, 0, 0, 0.3) calc(var(--band-fade-top) * 0.35),
        rgba(0, 0, 0, 0.75) calc(var(--band-fade-top) * 0.7),
        rgba(0, 0, 0, 0.95) calc(var(--band-fade-top) * 0.88),
        black var(--band-fade-top),
        black calc(100% - var(--band-fade-bottom)),
        rgba(0, 0, 0, 0.95) calc(100% - var(--band-fade-bottom) * 0.88),
        rgba(0, 0, 0, 0.75) calc(100% - var(--band-fade-bottom) * 0.7),
        rgba(0, 0, 0, 0.3) calc(100% - var(--band-fade-bottom) * 0.35),
        transparent
    );
}
.scheduling-bucket-settings-band__scroll--fade-top,
.calendar-avail-card-scroll--fade-top {
    --band-fade-top: 0.75rem;
}
.scheduling-bucket-settings-band__scroll--fade-bottom,
.calendar-avail-card-scroll--fade-bottom {
    --band-fade-bottom: 0.75rem;
}
/* Hover-scroll chevrons — shown (via x-show) only when the chips overflow.    */
/* The "scroll for more" affordance is the mask fade; the chevron just names   */
/* the direction. A sliver, so the chips run almost to the cell's edges, and   */
/* no background: the mask already dissolves what sits under it, and any       */
/* painted wash here would put back the cutoff line the mask removed.          */
.scheduling-bucket-settings-band__scroll-arrow {
    position: absolute;
    left: 0;
    right: 0;
    height: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    color: var(--color-action);
    /* Below the type scale on purpose — the chevron is an ornament, not text, */
    /* and must fit inside the 0.5rem sliver without spilling onto the chips.  */
    font-size: 0.5rem;
    opacity: 0.75;
    z-index: var(--z-raised);
    transition: opacity var(--transition-fast, 0.15s);
}
.scheduling-bucket-settings-band__scroll-arrow:hover {
    opacity: 1;
}
.scheduling-bucket-settings-band__scroll-arrow--up {
    top: 0;
}
.scheduling-bucket-settings-band__scroll-arrow--down {
    bottom: 0;
}
/* ── Connected calendars + exceptions scroll inside their own card ─────────  */
/* Same treatment as the band directly above them, deliberately: one scroll    */
/* idiom on the page, not two. Only the sizing differs, and only in where the  */
/* height comes from: the band's cell takes it from the left column beside it, */
/* a card's list takes it from the working-hours card across the row.          */
/*                                                                            */
/* Either way the point is that a list never sets a height. Left to grow, the  */
/* trio is as tall as whichever list is fullest, so a worker with thirty       */
/* exceptions pushes the live preview — the one thing that tells them the      */
/* change took — off the bottom of the screen. That fails worst for the most   */
/* complicated schedules, which is exactly backwards.                          */
/*                                                                            */
/* No chevron slivers here, unlike the band: those exist because the chips are */
/* a hover-scroll strip with no other way to move, while a list under the      */
/* pointer already scrolls on the wheel. hoverScroll is still what drives the  */
/* fade — its observers are what notice a list growing or emptying.            */
.calendar-avail-card-scrollhost {
    position: relative;
    min-height: 0;
}
.calendar-avail-card-scroll {
    overflow-y: auto;
    /* A capped list inside a scrolling page: stop at its own end rather than  */
    /* handing the rest of the gesture to the page behind it.                  */
    overscroll-behavior: contain;
    /* The mask fade is the affordance — hide the native bar, as the band does. */
    scrollbar-width: none;
    -ms-overflow-style: none;
    --band-fade-top: 0rem;
    --band-fade-bottom: 0rem;
}
.calendar-avail-card-scroll::-webkit-scrollbar {
    display: none;
}
/* Three across, one height. Each card is a flex column and each list is a     */
/* flex item with a ZERO basis, so a list contributes nothing to how tall its  */
/* card wants to be: the row is as tall as working hours (seven day rows,      */
/* never an eighth) and both lists take exactly what that leaves.              */
/*                                                                            */
/* This replaces a 20rem cap, which could not do the job from either side. Any */
/* cap is a guess at a height the row has not been asked for yet: 20rem was    */
/* TALLER than the row, so expanding a calendar account grew the card, the     */
/* trio, and the page under it — this was caught in review (2026-08-19: the    */
/* calendar container should not expand in size when the collapsables are      */
/* expanded, it should just scroll cleanly) — and a cap short enough to never  */
/* do that would end every card in dead space instead. Deriving the height     */
/* from the row is the only version with no wrong number in it.                */
/*                                                                            */
/* Stacked (below 992) the cards are full width with nothing beside them to    */
/* stay level with, so the lists go back to their natural height rather than   */
/* becoming scroll boxes inside a scrolling page.                              */
@media (min-width: 992px) {
    .calendar-avail-settings-trio > .calendar-avail-preview-card {
        display: flex;
        flex-direction: column;
    }
    /* The calendars card wraps its header and its list in an HTMX swap target */
    /* (#connected-calendars-card), so the flex chain has to pass THROUGH that */
    /* wrapper — otherwise the list inside measures against a box that never   */
    /* received the row's height.                                              */
    .calendar-avail-settings-trio .calendar-avail-preview-card #connected-calendars-card {
        display: flex;
        flex-direction: column;
        flex: 1 1 0;
        min-height: 0;
    }
    /* Three classes deep on purpose: the org exceptions host also wears       */
    /* `.settings-panel.is-active`, whose `display: block` matches at the same */
    /* weight from a stylesheet we do not control the order of.                */
    .calendar-avail-settings-trio .calendar-avail-preview-card .calendar-avail-card-scrollhost {
        display: flex;
        flex-direction: column;
        flex: 1 1 0;
        min-height: 0;
    }
    .calendar-avail-settings-trio .calendar-avail-preview-card .calendar-avail-card-scroll {
        flex: 1 1 0;
        min-height: 0;
    }
}
/* Stacked, the list has no left column to take its height from, so it goes    */
/* back to sizing itself and caps instead.                                     */
@media (max-width: 991.98px) {
    .scheduling-bucket-settings-band__col--fill {
        display: block;
        margin-top: var(--spacing-mdlg);
    }
    .scheduling-bucket-settings-band__scroll {
        position: static;
        max-height: 16rem;
    }
}
/* Bootstrap Icons paint their ink high inside the em box (the library ships   */
/* ::before { vertical-align: -.125em } to compensate in text flow), so        */
/* em-box centering (display:block + line-height:1) still leaves the glyph     */
/* ~1px high. Flex-centering the ::before box centers the ink itself.          */
.calendar-bucket-panel__settings-btn i {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 1rem;
}
/* ── Bucket panel ── */
/* Notice row: two timing steppers (min + max notice) side-by-side in the      */
/* settings band. Grid 1fr 1fr guarantees equal column widths so the steppers  */
/* visually align regardless of unit-label width (min/hr/day vs day/wk/mo).    */
/* Two rows, name on the left and the stepper beside it. Round 10 gave this     */
/* pair a third of the band instead of a half, which is too narrow to sit them  */
/* side by side; stacking them also drops the labels from their own line, so    */
/* the pair takes about the height it did across two columns.                   */
/*                                                                            */
/* The label track is fixed rather than auto so both steppers start at the same */
/* x — ragged left edges were the reason the drawer version read as two         */
/* unrelated controls. Nothing here lets a stepper stretch: the stepper is      */
/* inline-flex and sized by its parts (08-18: keep them from ballooning).       */
.scheduling-bucket-settings-band__notice-row {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-smd);
}
.scheduling-bucket-settings-band__notice-row .scheduling-bucket-timing-field {
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-sm);
}
.scheduling-bucket-settings-band__notice-row .scheduling-bucket-timing-field__label {
    flex: 0 0 5.5rem;
    margin: 0;
    font-size: var(--font-size-sm);
}

/* Two-step delete, round 10: a trash icon at the end of the band's top row     */
/* that opens a small confirm anchored under it — still no browser popup. An    */
/* icon has no room to relabel itself the way the old full-width button did     */
/* ("Delete availability" → "Are you sure?"), and a bare icon that deletes on   */
/* two quick clicks is the one control here where a slip costs a whole          */
/* availability.                                                                */
/*                                                                            */
/* The popover is absolute so opening it cannot reflow the row it hangs off,    */
/* and right-anchored so it opens inward from the band's edge instead of off    */
/* the card.                                                                    */
.calendar-bucket-panel__delete-area {
    position: relative;
}
.calendar-bucket-panel__delete-confirm {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: var(--z-dropdown);
    width: 17rem;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: var(--spacing-smd);
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-menu);
    text-align: left;
}
.calendar-bucket-panel__delete-confirm-copy {
    font-size: var(--font-size-md);
    color: var(--color-error);
}
.calendar-bucket-panel__delete-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}
/* Time zone is one more row of the same form: its label sits to the left of   */
/* the control, on the track the Min/Max Notice labels use, and the control is */
/* only as wide as a time-zone name (2026-08-19: the timezone label should sit */
/* to the left of the dropdown so the dropdown itself can be narrower). It was */
/* a stacked label over a dropdown as wide as the column —                     */
/* 576px at 1920 for a line of text a third of that.                           */
.scheduling-bucket-settings-band__group--tz {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}
#bucket-settings-band .scheduling-bucket-settings-band__group--tz .scheduling-bucket-settings-band__field-label {
    flex: 0 0 5.5rem;
    margin: 0;
}
/* The form is the control's box here — the combobox fills it, so capping the  */
/* form is what makes the dropdown skinny. It shrinks with a narrow column and */
/* never grows past a zone name.                                               */
.scheduling-bucket-settings-band__group--tz form {
    flex: 0 1 var(--settings-tz-w);
    min-width: 0;
}
/* Save tell beside the settings band's time zone dropdown. */
.scheduling-bucket-settings-band__tz-inline-status {
    min-width: 18px;
}
/* Square, one control height, so it lines up with the name and location fields */
/* it shares the row with. Danger lives in the glyph, not in a filled button —  */
/* a solid red square at the top of the page would read as an alert.            */
.calendar-bucket-panel__delete-btn-cta {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--settings-control-h);
    height: var(--settings-control-h);
    padding: 0;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-error);
    line-height: 1;
}
.calendar-bucket-panel__delete-btn-cta:hover,
.calendar-bucket-panel__delete-btn-cta[aria-expanded="true"] {
    background: var(--color-grey-100);
    border-color: var(--color-grey-300);
}
/* Small square icon button — the Exceptions "add" and the connected-calendars */
/* controls. Mirrors the brand-tab logos-panel "+" button: hover swaps to      */
/* brand-primary bg/fg; the open tell is that color holding (no rotation —     */
/* 2026-07-02: it must not spin). 140ms easing matches that component so       */
/* the muscle-memory across pages stays consistent.                            */
.calendar-bucket-panel__settings-btn {
    appearance: none;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border-hairline);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    line-height: 1;
    width: var(--control-h-sm);
    height: var(--control-h-sm);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
@media (max-width: 767.98px) {
    .calendar-bucket-panel__settings-btn {
        width: var(--control-h-touch);
        height: var(--control-h-touch);
    }
}
/* A dead control (aria-disabled, the "+" at the account cap) keeps the      */
/* pointer for its tooltip but must not light up under it.                    */
.calendar-bucket-panel__settings-btn:not([aria-disabled="true"]):hover,
.calendar-bucket-panel__settings-btn:not([aria-disabled="true"]):focus-visible {
    background: var(--color-action);
    color: var(--color-neutral-ink-fg);
    border-color: var(--color-action);
}
/* Keyboard focus gets the house ring on top of the fill, like global-icon-btn. */
.calendar-bucket-panel__settings-btn:not([aria-disabled="true"]):focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}
.calendar-bucket-panel__settings-btn[aria-expanded="true"] {
    /* Open tell is color only — no rotation anywhere (2026-07-02: it        */
    /* must not spin), and no transform on the button (it would drag the      */
    /* ::before/::after tooltip pseudo-elements along and tilt the tooltip).  */
    background: var(--color-action);
    color: var(--color-neutral-ink-fg);
    border-color: var(--color-action);
}
.calendar-bucket-panel__settings-btn[data-tooltip=""]::before,
.calendar-bucket-panel__settings-btn[data-tooltip=""]::after {
    display: none !important;
}
/* Sync-in-progress: the refresh arrow rotates in place at a calm, steady    */
/* pace. linear keeps the loop seamless (no pulse at the cycle boundary).     */
.calendar-bucket-panel__settings-btn .calendar-sync-spin {
    animation: bucket-sync-spin 0.8s linear infinite;
}
@keyframes bucket-sync-spin {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .calendar-bucket-panel__settings-btn .calendar-sync-spin { animation: none; }
}

/* ── Bucket timing stepper (Session length / Buffer / Lead time / Bookable) ── */
.scheduling-bucket-timing-field {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xsm);
    min-width: 0;
}
.scheduling-bucket-timing-field__label {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    margin: 0 0 var(--spacing-2xs) 0;
    letter-spacing: 0.005em;
}
.scheduling-bucket-timing-stepper {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xsm);
    height: 2rem;
    width: auto;
    max-width: 100%;
}
.scheduling-bucket-timing-stepper__btn {
    appearance: none;
    background: var(--color-grey-50);
    border: 1px solid var(--color-grey-200);
    border-radius: 50%;
    color: var(--color-grey-700);
    font-size: var(--font-size-md);
    line-height: 1;
    font-weight: var(--font-weight-button);
    width: var(--control-h-sm);
    height: var(--control-h-sm);
    flex-shrink: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.1s ease, color 0.1s ease, border-color 0.1s ease;
}
.scheduling-bucket-timing-stepper__btn:hover:not(:disabled) {
    background: color-mix(in srgb, var(--color-action) 8%, white);
    color: var(--color-action);
    border-color: color-mix(in srgb, var(--color-action) 30%, var(--color-grey-200));
}
.scheduling-bucket-timing-stepper__btn:active:not(:disabled) {
    background: color-mix(in srgb, var(--color-action) 16%, white);
}
.scheduling-bucket-timing-stepper__btn:disabled {
    color: var(--color-grey-300);
    cursor: not-allowed;
    background: var(--color-grey-50);
}
.scheduling-bucket-timing-stepper__input {
    flex: 0 0 auto;
    width: 2.75rem;
    min-width: 0;
    border: 1px solid var(--color-grey-200);
    border-radius: 0.375rem;
    background: var(--color-card-bg);
    text-align: center;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
    padding: var(--spacing-xs) 0.15rem;
    height: var(--control-h-sm);
    outline: none;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
    -moz-appearance: textfield;
}
.scheduling-bucket-timing-stepper__input:focus {
    border-color: var(--color-focus-ring);
    box-shadow: 0 0 0 2px var(--color-focus-ring-alpha);
}
.scheduling-bucket-timing-stepper__input::-webkit-outer-spin-button,
.scheduling-bucket-timing-stepper__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
/*
 * Autosave feedback states. Driven by the global wireBucketTimingAutosave-
 * Feedback IIFE in _availability_panels.html. `.is-saving` is added by the
 * stepper's commit() and removed by htmx:afterRequest. `.is-save-failed`
 * persists until the next successful save or refresh — paired with the
 * global error toast so the user has both a glance signal (red border) and
 * a banner signal (toast).
 */
.scheduling-bucket-timing-field.is-saving .scheduling-bucket-timing-stepper__input {
    border-color: var(--color-action);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-action) 16%, transparent);
}
.scheduling-bucket-timing-field.is-save-failed .scheduling-bucket-timing-stepper__input {
    border-color: var(--color-error);
    box-shadow: 0 0 0 2px rgba(217, 0, 43, 0.18);
}
.scheduling-bucket-timing-field.is-save-failed .scheduling-bucket-timing-field__label {
    color: var(--color-error);
}

/* ── Service-type chip editor (PR-5) ── */
.scheduling-service-type-group {
    margin-bottom: var(--spacing-md);
}
.scheduling-service-type-group:last-child {
    margin-bottom: 0;
}
.scheduling-service-type-group__header {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}
.scheduling-service-type-group__title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-grey-700);
}
.scheduling-service-type-group__chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xsm);
}
.scheduling-service-type-chip-wrap {
    display: inline-flex;
}
.scheduling-service-type-chip {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.scheduling-service-type-chip:hover {
    background: var(--color-grey-50);
    border-color: var(--color-grey-300);
}
.scheduling-service-type-chip--assigned {
    background: var(--color-action);
    border-color: var(--color-action);
    color: var(--color-neutral-ink-fg);
}
.scheduling-service-type-chip--assigned:hover {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #fff;
}
.scheduling-service-type-chip--available {
    border-style: dashed;
    /* Inherits #475569 from .scheduling-service-type-chip — dashed border alone signals
       "click to add"; no accent needed. */
}
.scheduling-service-type-chip--used-elsewhere,
.scheduling-service-type-chip.is-used-elsewhere {
    /* Muted via explicit colors, NOT opacity — opacity on the chip composites  */
    /* its ::before/::after data-tooltip bubble at the same 55%, making the     */
    /* "Used by …" tooltip unreadably transparent (2026-07-02).                 */
    cursor: not-allowed;
    background: var(--color-grey-100);
    border-color: var(--color-grey-200);
    color: var(--color-grey-500);
}

/* ── Page layout under the band ──────────────────────────────────────────── */
/* The band's own header holds a name and, on an org schedule, the "All        */
/* workers" badge. They belong together on the left; the cards below are the   */
/* ones with a control on the far right.                                      */
.calendar-bucket-panel .calendar-avail-personal-card-header {
    justify-content: flex-start;
}
/* The name still gives way rather than pushing: a 46-character schedule name  */
/* ran past the card at 375px in round 6, and a header that is now a plain     */
/* flex row would do it again. min-width:0 is the link that lets the span      */
/* shrink below its own text so the ellipsis has something to fire against.    */
.calendar-bucket-panel .calendar-avail-personal-card-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* Working hours, calendars and exceptions: equal thirds at one height. They   */
/* were a stacked rail beside the band until 2026-08-18, which is why the      */
/* page needed 1500px before the preview stopped being a sliver.               */
.calendar-avail-settings-trio {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
    align-items: stretch;
}
/* A grid track sized `1fr` is `minmax(auto, 1fr)`, and a grid item's automatic */
/* minimum size is its MIN-CONTENT size — which one `white-space: nowrap`      */
/* descendant sets outright, no matter that the descendant itself clips with   */
/* `overflow: hidden`. A long connected-calendar address therefore froze the   */
/* middle track at 627px and left the other two thirds to split what was over: */
/* at 992 Working Hours got 132px of the row and each time combobox came out   */
/* 5px wide (2026-08-19: the dropdowns were cut off, so the numbers were not   */
/* visible). Stacked, the same min-content ran the single track wider          */
/* than the phone. `min-width: 0` opts the cards out of that automatic         */
/* minimum, so the tracks are equal thirds (or the screen) at every width and  */
/* the address ellipsizes inside its own card instead of sizing the page.      */
.calendar-avail-settings-trio > .calendar-avail-preview-card {
    min-width: 0;
}
@media (min-width: 992px) {
    .calendar-avail-settings-trio {
        grid-template-columns: repeat(3, 1fr);
    }
}
/* Card padding (2026-08-19: the working hours card padding was cleaned up as  */
/* much as possible). Two things were adding space nobody asked for. The grid  */
/* is wrapped in `.settings-section`, whose 2rem bottom margin is right in a   */
/* stacked settings form and is dead space at the foot of a card; and the      */
/* card's own bottom padding was half its top, set when that margin was making */
/* up the difference. The last row already ends flush                          */
/* (.calendar-uavail__row:last-child), so the card closes on its own padding and reads  */
/* the same top and bottom.                                                    */
#page-working-hours-card.calendar-avail-preview-card,
#page-personal-schedule-card.calendar-avail-preview-card {
    padding-bottom: var(--spacing-md);
}
#page-working-hours-card .settings-section,
#page-personal-schedule-card .settings-section {
    margin-bottom: 0;
}

.calendar-avail-preview-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-sm) var(--spacing-lg) var(--spacing-smd);
}
/* ── Filter bar: one quiet row of filter pills (org team view, left       */
/* column, above the live preview). A pill is ink-tinted `is-active`       */
/* when its filter is applied — there are no enable switches; picking a    */
/* value activates a filter, clearing deactivates it.                      */
.calendar-avail-filter-section {
    padding: var(--spacing-sm) var(--spacing-md);
}
.calendar-avail-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm) var(--spacing-sm);
}
/* Row = dropdown anchor */
.calendar-avail-filter-row {
    position: relative;
    display: flex;
}

.calendar-avail-filter-trigger {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xsm) var(--spacing-smd);
    background: var(--color-grey-50);
    border: 1px solid var(--color-grey-200);
    border-radius: var(--radius-md);
    font-size: var(--font-size-md);
    color: var(--color-text);
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.calendar-avail-filter-trigger:hover {
    background: var(--color-grey-100);
    border-color: var(--color-grey-300);
}
.calendar-avail-filter-trigger:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}
.calendar-avail-filter-trigger.is-active {
    background: color-mix(in srgb, var(--color-action) 7%, var(--color-card-bg));
    border-color: color-mix(in srgb, var(--color-action) 35%, var(--color-grey-200));
}

.calendar-avail-filter-trigger-icon {
    flex-shrink: 0;
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
}
.calendar-avail-filter-trigger-label {
    flex-shrink: 0;
    font-weight: var(--font-weight-medium);
}
.calendar-avail-filter-trigger-summary {
    max-width: 16ch;
    font-size: var(--font-size-sm);
    color: var(--color-action);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* The Service summary always renders ('Virtual' is the default view) —
   neutral until a real pick, so only active filters read brand-colored. */
.calendar-avail-filter-trigger-summary.is-default {
    color: var(--color-text-secondary);
    font-weight: 400;
}
.calendar-avail-filter-trigger-chevron {
    flex-shrink: 0;
    font-size: var(--font-size-xs);
    color: var(--color-grey-500);
    transition: transform 0.2s ease;
}
.calendar-avail-filter-trigger-chevron.is-open {
    transform: rotate(180deg);
}

/* ── Dropdown panel ── */
.calendar-avail-filter-dropdown {
    position: absolute;
    top: calc(100% + 0.25rem);
    /* Pills are narrow; the dropdown anchors left and takes its own width. */
    left: 0;
    min-width: 280px;
    max-width: 340px;
    z-index: 60;
    background: var(--color-card-bg);
    border: 1px solid var(--color-grey-200);
    border-radius: var(--radius-md);
    box-shadow:
        var(--shadow-lg);
    overflow: hidden;
}
.calendar-avail-filter-dropdown-search {
    position: relative;
    padding: var(--spacing-sm) var(--spacing-smd);
    border-bottom: 1px solid var(--color-grey-100);
}
.calendar-avail-filter-dropdown-search i {
    position: absolute;
    top: 50%;
    left: 1.25rem;
    transform: translateY(-50%);
    color: var(--color-grey-500);
    pointer-events: none;
    font-size: var(--font-size-md);
}
.calendar-avail-filter-dropdown-search input {
    width: 100%;
    padding: var(--spacing-xsm) var(--spacing-sm) var(--spacing-xsm) var(--spacing-xl);
    border: 1px solid var(--color-grey-200);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    color: var(--color-text);
    background: var(--color-grey-50);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.calendar-avail-filter-dropdown-search input:focus {
    outline: none;
    border-color: var(--color-focus-ring);
    background: var(--color-card-bg);
}

.calendar-avail-filter-dropdown-list {
    max-height: 280px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--spacing-xs) 0;
}
.calendar-avail-filter-option {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-smd);
    cursor: pointer;
    transition: background-color 0.1s ease;
    margin: 0;
}
.calendar-avail-filter-option:hover {
    background: var(--color-grey-50);
}
.calendar-avail-filter-option .form-check-input {
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
}
.calendar-avail-filter-option input[type="radio"]:checked,
.calendar-avail-filter-option input[type="checkbox"]:checked {
    background-color: var(--color-action);
    border-color: var(--color-action);
}
.calendar-avail-filter-option-label {
    flex: 1;
    font-size: var(--font-size-md);
    color: var(--color-text);
    user-select: none;
}
/* The Virtual default block: set apart from the service list below it so  */
/* the no-service default can't read as a service type.                    */
.calendar-avail-filter-option--default {
    flex-wrap: wrap;
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--color-grey-100);
}
.calendar-avail-filter-option-caption {
    flex-basis: 100%;
    padding-left: var(--spacing-lg);
    font-size: var(--font-size-xs);
    color: var(--color-grey-500);
    user-select: none;
}
.calendar-avail-filter-group-label {
    padding: var(--spacing-sm) var(--spacing-smd) var(--spacing-2xs);
    font-size: 0.6875rem;
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-grey-500);
}
.calendar-avail-filter-dropdown-footer {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-smd);
    border-top: 1px solid var(--color-grey-100);
    background: var(--color-grey-50);
}
.calendar-avail-filter-clear-btn {
    background: none;
    border: none;
    padding: var(--spacing-2xs) var(--spacing-xsm);
    margin-left: auto;
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.1s ease, color 0.1s ease;
}
.calendar-avail-filter-clear-btn:hover {
    background: var(--color-grey-100);
    color: var(--color-text);
}

.calendar-avail-level-select {
    flex: 1;
    font-size: var(--font-size-sm);
    border: 1px solid var(--color-grey-200);
    border-radius: var(--radius-md);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--color-card-bg);
}

/* ── Alpine x-transition keyframes ── */
.global-dropdown-enter, .global-dropdown-leave {
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.global-dropdown-enter-start, .global-dropdown-leave-end {
    opacity: 0;
    transform: translateY(-4px);
}
.global-dropdown-enter-end, .global-dropdown-leave-start {
    opacity: 1;
    transform: translateY(0);
}

/* ── Org-mode bucket switcher (PR 2) ── */
/* The personal-mode .scheduling-bucket-chip rules below are scoped to that branch only. */
/* We mirror the chip visual here so admins on the org tab get the same look. */
.scheduling-bucket-switcher {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm);
}
.scheduling-bucket-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xsm);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.scheduling-bucket-chip:hover { background: var(--color-grey-100); border-color: var(--color-grey-300); color: var(--color-text); }
.scheduling-bucket-chip--selected {
    background: var(--color-action);
    border-color: var(--color-action);
    color: var(--color-neutral-ink-fg);
}
.scheduling-bucket-chip__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.0625rem var(--spacing-xsm);
    border-radius: var(--radius-pill);
    font-size: 0.6875rem;
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.02em;
    background: rgba(99, 102, 241, 0.12);
    color: #4338ca;
    text-transform: uppercase;
    line-height: 1.4;
}
.scheduling-bucket-chip--selected .scheduling-bucket-chip__badge {
    background: rgba(255, 255, 255, 0.22);
    color: var(--color-neutral-ink-fg);
}
.scheduling-bucket-chip__badge--inline {
    background: rgba(99, 102, 241, 0.14);
    color: #4338ca;
}


/* ── Personal mode: white card chrome + header/body styling ── */
/* Base rule (matches org-mode side; without this the personal cards have */
/* no background/border-radius/shadow and the page reads as bare divs). */
.calendar-avail-preview-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-sm) var(--spacing-lg) var(--spacing-smd);
}
/* `.calendar-avail-personal-card` cascade (padding, header divider, title typography,  */
/* disabled banner) was hoisted to a shared <style> block above the mode-if   */
/* near line 282 so org cards inherit the same chrome. Do not re-add those     */
/* rules here — keeping them in one place prevents drift. See test file        */
/* tests/interface/templates/app/test_availability_card_chrome_shared.py.      */
/* Personal-mode top-bar: tighter padding, single row, no header chrome. */
.calendar-avail-preview-card.calendar-avail-personal-topbar {
    padding: var(--spacing-smd) var(--spacing-mdlg);
}
.calendar-avail-preview-card.calendar-avail-personal-topbar form {
    margin: 0;
}

/* ── Bucket switcher (chip strip) ── */
.scheduling-bucket-switcher {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm);
}
.scheduling-bucket-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xsm);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.scheduling-bucket-chip:hover:not(.scheduling-bucket-chip--disabled) {
    background: var(--color-grey-100);
    border-color: var(--color-grey-300);
    color: var(--color-text);
}
.scheduling-bucket-chip--selected {
    background: var(--color-action);
    border-color: var(--color-action);
    color: var(--color-neutral-ink-fg);
}
.scheduling-bucket-chip--selected:hover {
    background: color-mix(in srgb, var(--color-action) 85%, #000);
    border-color: color-mix(in srgb, var(--color-action) 85%, #000);
}
.scheduling-bucket-chip:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}
.scheduling-bucket-chip--add {
    background: var(--color-card-bg);
    border-style: dashed;
    color: var(--color-action);
}
.scheduling-bucket-chip--disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* The .calendar-bucket-panel__*, .scheduling-bucket-timing-* and
   .scheduling-service-type-* cascade lives in the shared part of this sheet,
   above the org/personal split. Do not re-add it here.
   See test_availability_org_bucket_css_shared.py. */

/* ── Timezone row inside Working Hours card ── */
.calendar-wh-tz-divider {
    margin: var(--spacing-md) 0 var(--spacing-smd);
    border-color: var(--color-grey-100);
    opacity: 1;
}
.calendar-wh-tz-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
    padding-bottom: var(--spacing-xs);
}
.calendar-wh-tz-label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Calendar card: header wraps so the reveal drops below title + buttons */
#page-personal-calendars-card .calendar-avail-personal-card-header {
    flex-wrap: wrap;
}

/* ── First-bucket setup ── */
.scheduling-bucket-setup {
    padding: var(--spacing-xl) var(--spacing-md);
    text-align: center;
}
.scheduling-bucket-setup__form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-width: 320px;
    margin: 0 auto;
}
/* The name sits in the middle of its box, like the button under it. */
.scheduling-bucket-setup__form .form-control {
    text-align: center;
}
@media (max-width: 767.98px) {
    .scheduling-bucket-setup__form .form-control {
        min-height: var(--control-h-touch);
    }
}

/* Exception list styles moved to features/exceptions-list.css so they're in
   scope on both this page AND the standalone settings page that includes
   _org_exceptions.html. */

/* ── A kept chip the worker's skills no longer fit (Nick, 2026-11-04) ───── */
/* The chip's own locked look with the skill it needs under it. Unlike a     */
/* chip used by another bucket it answers a tap with a toast (ADR-043), so   */
/* it keeps a pointer cursor.                                                 */
.scheduling-service-type-chip-locked {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-2xs);
}
.scheduling-service-type-chip-locked__note {
    font-size: var(--font-size-2xs);
    line-height: 1.2;
    color: var(--color-grey-600);
}
#bucket-settings-band .scheduling-service-type-chip--needs-skill {
    cursor: pointer;
}

/* ── Chips to review (org mode) ───────────────────────────────────────────── */
/* One row per worker chip that no longer fits: who, the type, what it needs. */
.calendar-avail-chip-review {
    list-style: none;
    margin: 0;
    padding: 0;
}
.calendar-avail-chip-review__row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs) var(--spacing-smd);
    padding: var(--spacing-sm) 0;
    border-top: 1px solid var(--color-grey-100);
    font-size: var(--font-size-sm);
}
.calendar-avail-chip-review__row:first-child {
    border-top: 0;
}
.calendar-avail-chip-review__worker {
    font-weight: var(--font-weight-medium);
}
.calendar-avail-chip-review__needs {
    color: var(--color-grey-600);
}

/* Kanban board (Opportunities third view) — extracted from the inline block in
   my_assignments_kanban.html in board+cal v2 Phase 3. Card v2 adds the milestone
   dots, the neutral-ink dot tooltip, and the red "Overdue" pill. The dots
   themselves are the shared .global-status-dot atom (components/status-dot.css),
   whose states resolve to the same --ms-* milestone family the milestone matrix
   uses, so a status means the same colour everywhere. */

/* Boards are dense surfaces: cards keep the structural leading, not the reading
   body's 1.65 — the equal-card-height proof budgets its rows on it. */
.pipelines-board { display: flex; flex-direction: column; gap: var(--spacing-smd); line-height: var(--line-height); }
.pipelines-columns, .pipelines-columns-skeleton__row { display: flex; gap: var(--spacing-smd); align-items: flex-start; overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: var(--spacing-sm); }
/* max-height caps each column at "100vh minus everything above the board"
   (the merged tabs+actions row + the row-2 toolbar + .global-page-header--card's
   own border/padding/hairline), so the page itself never scrolls and
   .pipelines-column__cards's own overflow-y:auto below does the internal scrolling
   instead. 224 (was 240 under the 24px gutter): the content-separation layout
   stood the header up as its own card whose margin-bottom gap pushes the board
   down from the viewport top, and .global-app-content puts a --page-gutter
   below the board; the constant is that top plus that bottom gutter (plus the
   .pipelines-columns 8px pad and a few px of slack), originally measured in a
   real browser against a full seeded column so the page itself never scrolls,
   then moved 16px when the gutter went 24px → 16px on both ends. Unlike the
   viewport-fit flex chain (.global-page-fill, main.css), this is still a fixed
   constant — a future header/toolbar/gutter change will need re-tuning it the
   same way. */
/* Column: HubSpot board geometry — a 280px soft-grey lane. The board now sits
   directly on the page background (content-separation layout), so the lane uses
   grey-200 to read as a recessed lane against the lighter page bg; the old
   page-bg token would vanish grey-on-grey. White cards inside still pop. */
.pipelines-column, .pipelines-column--skeleton { flex: 0 0 280px; width: 280px; background: var(--color-grey-200); border-radius: var(--radius-card); display: flex; flex-direction: column; max-height: calc(100vh - 224px); }
.pipelines-column__head { display: flex; align-items: center; gap: var(--spacing-sm); padding: var(--spacing-sm) var(--spacing-smd); border-bottom: 1px solid var(--color-border); }
/* Grey stands in for a column the org gave no colour — the leads board's
   off-pipeline column has no stage behind it to take one from. Any column that
   does have a colour sets it inline, which wins over this. */
.pipelines-column__dot { width: 8px; height: 8px; border-radius: var(--radius-pill); flex: 0 0 auto; background: var(--color-grey-500); }
/* Stage name reads as a small header — same 12px/500/uppercase family as the
   Table skin's column heads (milestones.css thead th). */
.pipelines-column__name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--font-size-xs); font-weight: var(--font-weight-medium); text-transform: uppercase; letter-spacing: 0.02em; color: var(--color-grey-700); }
.pipelines-column__count { flex: 0 0 auto; color: var(--color-grey-600); font-size: var(--font-size-xs); font-weight: var(--font-weight-medium); font-variant-numeric: tabular-nums; }
.pipelines-column__cards { display: flex; flex-direction: column; gap: var(--spacing-sm); padding: var(--spacing-sm); overflow-y: auto; min-height: 40px; }
.pipelines-card, .pipelines-card--skeleton { background: var(--color-card-bg); border: 1px solid var(--color-border); border-radius: var(--radius-card); padding: var(--spacing-smd); box-shadow: var(--shadow-sm); }
.pipelines-card--overdue { border-left: 3px solid var(--color-error); }
.pipelines-card__head { display: flex; align-items: center; gap: var(--spacing-xsm); cursor: grab; }
/* Anchor, span or button: a card title is a link on the opportunities board, a
   plain name where there is nowhere to go, and a button where the click opens a
   drawer rather than a page. The reset makes the button shape match the other
   two — without it a UA-styled button breaks the head row's alignment. */
.pipelines-card__title { flex: 1 1 auto; min-width: 0; font: inherit; font-weight: var(--font-weight-medium); color: var(--color-text); text-align: left; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pipelines-card__title:hover { text-decoration: underline; }
/* Second line, under the title — the same quiet grey the field labels use, so it
   reads as context for the name rather than another field. Truncates like the
   title: a card is a fixed-width tile and a long service name must not reflow it. */
.pipelines-card__subtitle { margin-top: var(--spacing-2xs); font-size: var(--font-size-sm); color: var(--color-grey-600); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pipelines-card__overdue { flex: 0 0 auto; font-size: var(--font-size-2xs); font-weight: var(--font-weight-medium); line-height: 1; padding: var(--spacing-2xs) var(--spacing-xsm); border-radius: var(--radius-pill); background: var(--color-error); color: var(--color-neutral-ink-fg); text-transform: uppercase; letter-spacing: .02em; }
.pipelines-card__field { display: flex; align-items: baseline; gap: var(--spacing-xsm); margin-top: var(--spacing-xsm); }
.pipelines-card__field-label { flex: 0 0 auto; font-size: var(--font-size-2xs); font-weight: var(--font-weight-medium); text-transform: uppercase; letter-spacing: 0.02em; color: var(--color-grey-600); }
.pipelines-card__field-value { flex: 1 1 auto; min-width: 0; font-size: var(--font-size-sm); color: var(--color-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pipelines-card__progress { margin-top: var(--spacing-sm); }
.pipelines-card__dots { display: flex; gap: var(--spacing-xsm); margin-top: var(--spacing-sm); flex-wrap: wrap; }
/* Milestone dots are the shared .global-status-dot atom (components/status-dot.css)
   — same 14px circle and same --ms-* state colours; --ring marks a required one.
   The board only adds the non-text cursor on its <pb-card-dot> custom element. */
.pipelines-card__dots .global-status-dot { cursor: default; }
.pipelines-agent-badge { display: inline-flex; align-items: center; gap: var(--spacing-xs); margin-top: var(--spacing-sm); font-size: var(--font-size-xs); color: var(--color-grey-600); }
.pipelines-ghost { opacity: .4; }
.pipelines-chosen { box-shadow: 0 0 0 2px var(--color-action); }
.pipelines-column__sentinel { text-align: center; color: var(--color-grey-600); font-size: var(--font-size-sm); padding: var(--spacing-xsm); }

/* Rail: a closed stage (Lost) holding nothing narrows to this instead of an
   empty 280px lane. It is a <details> element, so the browser gives the
   expand/collapse for free — the CSS below only needs to react to the [open]
   state it already sets, no JS anywhere on either lead board.
   :has() reads as "this column's own <details> is open", so the column
   widens back to the normal lane the moment someone expands it, and a poll
   re-render that puts the same lead-free column back still starts collapsed
   again — a closed stage is a rail exactly when it is empty, nothing more. */
.pipelines-column--rail { flex: 0 0 44px; width: 44px; }
.pipelines-column--rail > details { display: flex; flex-direction: column; height: 100%; }
.pipelines-column--rail:has(> details[open]) { flex: 0 0 280px; width: 280px; }
.pipelines-column__rail-head { display: flex; flex-direction: column; align-items: center; gap: var(--spacing-xsm); padding: var(--spacing-sm) var(--spacing-xsm); cursor: pointer; list-style: none; writing-mode: vertical-rl; }
.pipelines-column__rail-head::-webkit-details-marker { display: none; }
.pipelines-column--rail:has(> details[open]) .pipelines-column__rail-head { flex-direction: row; writing-mode: horizontal-tb; padding: var(--spacing-sm) var(--spacing-smd); border-bottom: 1px solid var(--color-border); }
.pipelines-column--rail .pipelines-column__cards { display: none; }
.pipelines-column--rail:has(> details[open]) .pipelines-column__cards { display: flex; }

/* Dot tooltip (custom element pb-card-dot) — neutral-ink surface, brand-free, so
   it reads the same for every tenant. Completed dots show the completer avatar +
   full name; any dated dot shows its due / completed date. */
.pipelines-dot-tip { position: fixed; z-index: var(--z-toast); max-width: 220px; background: var(--color-neutral-ink); color: var(--color-neutral-ink-fg); border: 1px solid var(--neutral-ink-border); border-radius: var(--radius-md); box-shadow: 0 4px 16px var(--ink-alpha-20); padding: var(--spacing-sm) var(--spacing-sm); font-size: var(--font-size-xs); line-height: 1.35; pointer-events: none; }
.pipelines-dot-tip__name { font-weight: var(--font-weight-medium); }
.pipelines-dot-tip__status { color: var(--color-neutral-ink-muted-fg); text-transform: capitalize; }
.pipelines-dot-tip__meta { color: var(--color-neutral-ink-muted-fg); margin-top: var(--spacing-xs); }
.pipelines-dot-tip__who { display: flex; align-items: center; gap: var(--spacing-xsm); margin-top: var(--spacing-xsm); }
.pipelines-dot-tip__avatar { flex: 0 0 auto; width: 20px; height: 20px; border-radius: var(--radius-pill); background: var(--neutral-ink-border); color: var(--color-neutral-ink-fg); font-size: var(--font-size-2xs); font-weight: var(--font-weight-medium); display: flex; align-items: center; justify-content: center; }

.pipelines-move-confirm { position: fixed; z-index: var(--z-overlay-top); max-width: 240px; background: var(--color-card-bg); border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: 0 4px 16px var(--ink-alpha-20); padding: var(--spacing-smd); }
.pipelines-move-confirm__text { margin: 0 0 var(--spacing-sm); font-size: var(--font-size-md); }
.pipelines-move-confirm__actions { display: flex; justify-content: flex-end; gap: var(--spacing-sm); }
.pipelines-move-confirm__btn { border-radius: var(--radius-button); padding: var(--spacing-xs) var(--spacing-smd); font-size: var(--font-size-sm); border: 1px solid transparent; cursor: pointer; }
.pipelines-move-confirm__btn--ghost { background: transparent; border-color: var(--color-border); color: inherit; }
.pipelines-move-confirm__btn--primary { background: var(--color-neutral-ink); color: var(--color-neutral-ink-fg); }

/* Loading skeleton (_leads_columns_skeleton.html) — hidden by default, shown
   only for the duration of the 20s poll's own request (hx-indicator="#kanban-
   columns" / "#admin-leads-live" on _leads_board.html / _admin_leads_body.html).
   Not wired to a filter/search swap: page_search.html's hx-indicator is a load-
   bearing contract of its own (see its own doc comment) and stays untouched.
   A lead's link draws the board with no columns yet (--waiting,
   _admin_leads_body.html), so its skeleton shows from the first paint. */
.pipelines-columns-skeleton { display: none; }
.pipelines-columns-live--waiting > .pipelines-columns-skeleton { display: block; }
#kanban-columns.htmx-request .pipelines-columns-skeleton,
#admin-leads-live.htmx-request .pipelines-columns-skeleton { display: block; }
#kanban-columns.htmx-request .pipelines-columns-live > .pipelines-columns,
#admin-leads-live.htmx-request .pipelines-columns-live > .pipelines-columns,
#kanban-columns.htmx-request .pipelines-columns-placeholder,
#admin-leads-live.htmx-request .pipelines-columns-placeholder { display: none; }
/* The global .htmx-request rule (main.css) dims and disables the indicator
   element for the length of the request; the skeleton already says "loading",
   so the extra dimming on top of it would only look muddy. Same override
   payment-dashboard.css uses for its own poll targets. */
#kanban-columns.htmx-request,
#admin-leads-live.htmx-request { opacity: 1; }

/* The fake column and card wear --skeleton modifier classes rather than the
   bare .pipelines-column / .pipelines-card a real one carries (.pipelines-column--skeleton's own
   box shares .pipelines-column's layout rule above). A DOM query for "how many
   stage columns" or "how many cards" is exactly this class, and it matches a
   hidden node the same as a shown one — a bare class here would always count
   3 columns and 9 cards too many, skeleton or not, on screen or not. */
.pipelines-card--skeleton { display: flex; flex-direction: column; gap: var(--spacing-xsm); }
.pipelines-skeleton-line { display: block; height: 10px; }
.pipelines-skeleton-line--label { width: 60%; height: 12px; }
.pipelines-skeleton-line--title { width: 80%; height: 14px; }
.pipelines-skeleton-line--field { width: 45%; }

/* Honest empty state (_leads_columns.html / _admin_leads_columns.html) — the
   columns stand as normal until :has() can confirm two things at once: the
   template judged there is no filter in play (it only renders
   .pipelines-columns-placeholder in that case — a filter matching zero still stands the
   columns, unchanged, per the invariant both templates document), AND the
   board holds not a single real card. Without that second check, a filter
   that matched zero real cards but rendered no .pipelines-columns-placeholder block would
   still trip on ":not(:has(.pipelines-card))" alone and hide the columns with
   nothing to replace them. Browsers without :has() just keep showing the
   columns, each reading zero — the same as before this landed.

   :has() reads the DOM whether or not what it finds is on screen, so the
   skeleton's fake cards (_leads_columns_skeleton.html) carry .pipelines-card--skeleton
   only — never .pipelines-card — or a hidden skeleton would count as a real one and
   this would never trip on a genuinely empty board. */
.pipelines-columns-placeholder { display: none; }
.pipelines-columns-live:has(.pipelines-columns-placeholder):not(:has(.pipelines-card)) .pipelines-columns { display: none; }
.pipelines-columns-live:has(.pipelines-columns-placeholder):not(:has(.pipelines-card)) .pipelines-columns-placeholder { display: block; }

/* ── Phone: one lane per screen ──────────────────────────────────────────
   Desktop's 280px lane barely showed a lane and a half on a 393px phone,
   with no signal that swiping revealed the rest. Worse, the max-height
   above (line 12's comment) is tuned against a desktop header/toolbar
   stack and never left room for the phone bottom bar (main.css,
   --bottom-bar-h): measured against a 15-card lane on an 852px-tall phone,
   the lane's own bottom edge sat 132px behind the bar's top edge, so the
   bottom cards were hidden under the bar with no way to scroll them into
   view (the column's own max-height capped it there before the page could
   help). Rather than tune a second constant against a stack about to
   change shape again (the toolbar collapses to one icon on phone), drop
   the cap: a lane fills the screen width, one swipe per stage
   (scroll-snap), and grows tall with its own cards the same as every other
   phone list, so .global-app-content's phone padding-bottom (main.css)
   protects the true last card the same way it already does for the card
   grid. The padding-bottom below buys the same reserve one lane down, so a
   card never sits flush against the lane's own bottom edge either.
   Nick's pick, 11-09: a lane leaves room after the gap, so a strip of the
   next stage shows at the right edge. A swipe still moves one stage. */
@media (max-width: 767.98px) {
    .pipelines-columns, .pipelines-columns-skeleton__row {
        scroll-snap-type: x mandatory;
    }

    .pipelines-column, .pipelines-column--skeleton {
        flex: 0 0 calc(100% - var(--spacing-2xl) - var(--spacing-smd));
        width: calc(100% - var(--spacing-2xl) - var(--spacing-smd));
        max-height: none;
        scroll-snap-align: start;
    }

    .pipelines-column__cards {
        overflow-y: visible;
        padding-bottom: calc(var(--spacing-sm) + var(--bottom-bar-h));
    }

    .global-app-main:has(.pipelines-board:not(.global-page-fill)) {
        min-height: 0;
        height: calc(100dvh - var(--safe-top) - var(--bottom-bar-h));
        overflow: clip;
    }

    .global-app-main:has(.pipelines-board:not(.global-page-fill)) .global-app-content {
        display: flex;
        flex-direction: column;
        min-height: 0;
        padding-bottom: var(--page-gutter);
    }

    .global-app-main:has(.pipelines-board:not(.global-page-fill)) .global-app-content > :not(.pipelines-board) {
        flex: 0 0 auto;
    }

    .pipelines-board:not(.global-page-fill),
    .pipelines-board:not(.global-page-fill) :has(.pipelines-columns) {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
    }

    .pipelines-board:not(.global-page-fill) .pipelines-columns {
        flex: 1 1 auto;
        min-height: 0;
        padding-bottom: 0;
    }

    .pipelines-board:not(.global-page-fill) .pipelines-column {
        flex-basis: calc(100% - var(--spacing-smd) - var(--spacing-lg));
        width: calc(100% - var(--spacing-smd) - var(--spacing-lg));
        max-height: 100%;
        scroll-snap-stop: always;
    }

    .pipelines-board:not(.global-page-fill) .pipelines-column__head {
        position: sticky;
        top: 0;
        flex-shrink: 0;
        min-height: var(--control-h-touch);
    }

    .pipelines-board:not(.global-page-fill) .pipelines-column__cards {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        padding-bottom: var(--spacing-sm);
    }

    .pipelines-board:not(.global-page-fill) .pipelines-card {
        padding-top: 0;
    }

    .pipelines-board:not(.global-page-fill) .pipelines-card__title {
        display: flex;
        align-items: center;
        min-height: var(--control-h-touch);
        white-space: normal;
        overflow-wrap: anywhere;
    }

    [data-phone-head-fold] select[name="template"] {
        min-height: var(--control-h-touch);
        font-size: var(--font-size-base);
    }
}

/* The leads board's columns and cards — layout only.
 *
 * Every rule here is scoped under .pipelines-leads-board, which only the two
 * leads column strips write (app/sales/_leads_columns.html and
 * _admin_leads_columns.html). pipelines/css/board.css is shared with the
 * opportunities kanban, so restyling .pipelines-column and .pipelines-card there would have
 * moved a board nobody asked us to touch. The scope is what lets this file
 * override the shared frame — 0,2,0 beats 0,1,0 whatever the load order — and
 * it is why the leads markup keeps every .pb-* class it had: the drag JS, the
 * skeleton and the :has()-gated empty state all read a board by those names.
 *
 * This file declares no type. Size, weight, case, tracking and tabular figures
 * all come from the shared atoms the markup wears — .global-label-caps,
 * .global-num, .global-status-dot, .global-divider — the same components the
 * metrics strip above this board is built from. What is left is the part that
 * genuinely belongs to a board: which things sit on a row, what colour a figure
 * is, and where the white stops.
 *
 * Load it AFTER board.css (both pages link it last in their extra_css block).
 */

/* Every lane runs to the same floor. board.css sets align-items: flex-start, so
   each lane stops wherever its own stack of cards ran out — on a board whose
   stages hold 5, 2 and 3 leads that draws three grey rectangles of three
   different lengths and a ragged bottom edge across the page. Stretching them
   is what makes the strip read as one board with columns in it. The lanes stay
   bounded: the screen-filling board below sets their height, and every lane
   matches it. */
.pipelines-leads-board .pipelines-columns {
    align-items: stretch;
}

/* And the cards area takes the slack, rather than the lane growing an inert
   grey tail below it. It is the drop target — SortableJS is bound to this
   element, not to the lane — so a stretched lane whose cards area stopped at
   its last card would look droppable for its whole height and only accept a
   card in the top third of it. */
.pipelines-leads-board .pipelines-column__cards {
    flex: 1 1 auto;
}

/* ── The board fills the screen ──
   Nick, 10-11: the page should act like the Bookings table, where the page
   itself never scrolls. The board wears .global-page-fill (main.css's
   viewport-fit chain), so every wrapper down to the lanes passes the height on,
   the lanes drop board.css's fixed 100vh cap and run to the foot, and each
   lane's cards scroll inside it. Scoped under the fill so the Bookings kanban,
   which shares board.css, keeps its own frame. */
.pipelines-board.global-page-fill > div,
.pipelines-board.global-page-fill #kanban-columns,
.pipelines-board.global-page-fill .pipelines-columns-live {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.pipelines-board.global-page-fill .pipelines-columns {
    flex: 1 1 auto;
    min-height: 0;
}

.pipelines-board.global-page-fill .pipelines-column,
.pipelines-board.global-page-fill .pipelines-column--skeleton {
    max-height: none;
    min-height: 0;
}

.pipelines-board.global-page-fill .pipelines-column__cards {
    min-height: 0;
}

/* The worker's page wraps its header and body in one div (my_leads.html), so
   that div is on the chain too, and its header keeps its height the way
   main.css keeps a header that sits straight in the page. */
.sales-leads-page > :not(.global-page-fill) {
    flex: 0 0 auto;
}

/* The worker's list kind: the card holding the table scrolls, not the page. */
.global-page-fill > .global-card.table-responsive {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
}

/* A card that cannot be dragged does not offer to be. board.css puts the grab
   cursor on every .pipelines-card__head, which is right on the opportunities board
   where every column takes a drop; here Booked, Lost and the off-board column
   deliberately do not, and SortableJS was never bound to them — the absence of
   data-stage-id is exactly that fact, which is what this selector reads. A hand
   that closes over a card and then refuses to move it is the worst version of
   this rule: it reads as a broken board rather than as a deliberate one. The
   title keeps its own pointer from board.css, because opening the drawer is
   still what a click there does. */
.pipelines-leads-board .pipelines-column__cards:not([data-stage-id]) .pipelines-card__head {
    cursor: default;
}

/* The head sits on white rather than on the lane's grey. A grey label on a grey
   lane is what made this strip read as a wall of nothing; white is what the
   cards below it already are, so the column reads as a stack with a header
   instead of one flat block.
   .pipelines-column carries the radius, so the white bar needs the column to clip it —
   overflow rather than a corner-by-corner radius here, which keeps this file
   free of raw radius literals (ADR-125) and keeps the two spellings from
   drifting apart if --radius-card ever moves. */
.pipelines-leads-board .pipelines-column {
    overflow: hidden;
}

/* The head's content starts where the cards' content starts. board.css indents
   the head by its own 12px, while a card's text sits at the lane's 8px gutter
   plus the card's 1px border plus its own 12px — so the head's leading edge, its
   colour dot, sat 9px left of every lead name under it. The eye reads that long
   before it can name it, and neither number is knowable from the other
   stylesheet: this is the one place the two are stated together.
   The white bar itself stays full-bleed. It is a header band; what has to line
   up is the column of content inside it. */
.pipelines-leads-board .pipelines-column__head {
    background: var(--color-card-bg);
    padding-right: calc(var(--spacing-sm) + var(--spacing-smd) + 1px);
    padding-left: calc(var(--spacing-sm) + var(--spacing-smd) + 1px);
}

/* An expanded rail is a full column, so its head is the same bar, on the same
   indent — board.css writes the two heads as separate rules and this one would
   otherwise keep the 12px the other just gave up, leaving one head in the row
   standing 9px left of its neighbours. The collapsed rail stays on the lane grey
   on purpose: it is a closed, empty stage, and the quieter it reads the better. */
.pipelines-leads-board .pipelines-column--rail:has(> details[open]) .pipelines-column__rail-head {
    background: var(--color-card-bg);
    padding-right: calc(var(--spacing-sm) + var(--spacing-smd) + 1px);
    padding-left: calc(var(--spacing-sm) + var(--spacing-smd) + 1px);
}

/* ── The collapsed rail ──
   board.css lays this head out with `flex-direction: column` under
   `writing-mode: vertical-rl`. Those two fight: vertical-rl turns the block
   axis sideways, so `column` flows the dot and the name ACROSS a 44px lane
   instead of down it, and the name — which carries board.css's nowrap +
   ellipsis — gets an inline size of nothing and ellipsizes away entirely. The
   result was a 44x50 grey stub with one clipped glyph in it.
   `row` is the spelling that stacks under vertical-rl, because vertical-rl's
   inline direction runs top to bottom. With the axis right the name has the
   lane's full height to run down and needs no clipping at all. */
.pipelines-leads-board .pipelines-column--rail:not(:has(> details[open])) .pipelines-column__rail-head {
    flex: 1 1 auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-smd) 0;
    /* A tab, not a stub. flex does the work now that the lanes stretch — the
       rail runs the same floor-to-ceiling as the stages beside it, which is
       what makes a collapsed stage read as a closed lane rather than as
       something that fell off the board. min-height is the floor for the case
       stretch cannot cover: a board short enough that full height is still
       barely taller than the label. */
    min-height: 148px;
}

/* Let the name run. The ellipsis board.css sets is for a 280px head with a long
   stage name in it; down a rail there is nothing to truncate against. */
.pipelines-leads-board .pipelines-column--rail:not(:has(> details[open])) .pipelines-column__name {
    flex: 0 0 auto;
    overflow: visible;
    text-overflow: clip;
}

/* The count stays upright while the name turns. A rotated numeral reads as
   damage; the name reads as a tab. */
.pipelines-leads-board .pipelines-column--rail:not(:has(> details[open])) .pipelines-leads-column__count {
    writing-mode: horizontal-tb;
}

/* Full ink for the stage name. board.css sets grey-700 for the opportunities
   board, where the column head is the quiet part; here the name is the thing
   you scan the strip by. */
.pipelines-leads-board .pipelines-column__name {
    color: var(--color-text);
}

/* .global-status-dot's own default background is --ms-pending, a milestone
   colour that means nothing on this board. A stage with a colour overrides this
   inline; a stage that has never been given one lands on neutral grey rather
   than on someone else's semantic. */
.pipelines-leads-column__dot {
    background: var(--color-grey-400);
}

/* The name span exists so the type can come from .global-label-caps on a child:
   a class on .pipelines-column__name itself would lose to board.css, which base.html
   loads after the component sheets. It keeps board.css's own ellipsis and
   flex-grow, so it needs nothing here beyond staying out of the way. */
.pipelines-leads-column__name {
    min-width: 0;
}

/* The count is a pill so it reads as a tally rather than as another figure
   sitting next to the money. */
.pipelines-leads-column__count {
    flex: 0 0 auto;
    padding: 1px var(--spacing-xsm);
    border-radius: var(--radius-pill);
    background: var(--color-grey-200);
    color: var(--color-grey-700);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
}

.pipelines-leads-column__total {
    flex: 0 0 auto;
    color: var(--color-text);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
}

/* The card is a column of blocks with one gap between them, so the divider and
   the figures need no margins of their own — .global-divider--flush is exactly
   the "caller owns the spacing" spelling for this.

   min-height is the floor a short card keeps, so a lead with little on it still
   reads as a card and its money still sits at the bottom. A card with sessions
   grows past it as far as its sessions list allows; the list caps itself (see
   .pipelines-leads-card__sessions below), so no card runs down the column.

   flex: none because the column's card list is itself a flex column. Without
   it, a stage taller than its column squeezes every card down to this floor
   and the sessions list inside collapses to a sliver. */
.pipelines-leads-card {
    display: flex;
    flex: none;
    flex-direction: column;
    gap: var(--spacing-xsm);
    min-height: 167px;
}

/* With a floor under the card, the slack has to go somewhere deliberate. The
   money falls to the bottom of every card that has any, so the figures line up
   across a stage instead of floating at whatever height the rows above them
   happened to end. A card with no money keeps its slack at the bottom, which is
   what says there is nothing there yet. The rule pushes the divider rather than
   the figures so the pair stays together. */
.pipelines-leads-card > .global-divider {
    margin-top: auto;
}

/* The lead's name is the primary thing on the card. board.css sets the title to
   `font: inherit`, which is right on a board whose cards are all one size;
   here the name has to outrank its sessions and figures, which the shared
   atoms deliberately set small. board.css also cuts the title to one line with
   an ellipsis; a lead's name is never cut, so here it wraps instead. */
.pipelines-leads-board .pipelines-card__title {
    font-size: var(--font-size-base);
    line-height: 1.3;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

/* The owner's face on the admin board keeps its size however many lines the
   name wraps to, with a little room between the two. It wears the card's
   small face (24px, the size the permissions stacks already give this chip)
   rather than the chip's own 32px: at 32px the head stood 11px taller than
   the name inside it, and that slack read as a gap under every owned lead's
   name that unowned leads never had. */
.pipelines-leads-card .pipelines-card__head > .global-person-chip--avatar,
.pipelines-leads-card .pipelines-card__head > .pipelines-leads-card__face--org {
    flex: none;
    width: 24px;
    height: 24px;
    margin-left: var(--spacing-sm);
}

.pipelines-leads-board .pipelines-card:hover {
    border-color: var(--color-grey-400);
}

/* The Booked row under the name. The card's own gap spaces it from the
   sessions block, so it needs no margin. */
.pipelines-leads-card__date {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-xsm);
    color: var(--color-grey-600);
    font-size: var(--font-size-xs);
}

/* The sessions list: one block per session, split by a hairline. The list
   scrolls once it is long. The max-height here is the plain cap; the window
   script (_leads_card_window_js.html) swaps in an exact one that cuts just
   below the first session past the line, so part of the next one peeks out,
   and adds --more for the fade. */
.pipelines-leads-card__sessions {
    position: relative;
    display: flex;
    flex-direction: column;
    /* The script's LIST_CAP (264) plus its PEEK (26). */
    max-height: 290px;
    overflow-y: auto;
    scrollbar-width: thin;
    padding-right: var(--spacing-xs);
}

.pipelines-leads-card__sessions--more {
    -webkit-mask-image: linear-gradient(black calc(100% - 28px), transparent);
    mask-image: linear-gradient(black calc(100% - 28px), transparent);
}

.pipelines-leads-card__session {
    display: block;
    flex: none;
    padding: var(--spacing-xs) 0;
    border-top: 1px solid var(--color-border-hairline);
}

.pipelines-leads-card__session:first-child {
    padding-top: 0;
    border-top: 0;
}

.pipelines-leads-card__session:last-child {
    padding-bottom: 0;
}

/* The shoot type wraps rather than cuts: it is what the session is. */
.pipelines-leads-card__session-type {
    display: block;
    color: var(--color-text);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    line-height: 1.25;
    white-space: normal;
}

.pipelines-leads-card__session-day {
    display: block;
    color: var(--color-grey-600);
    font-size: var(--font-size-xs);
    line-height: 1.3;
}

.pipelines-leads-card__people {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    margin-top: var(--spacing-2xs);
}

/* One role per line: the label on the left, only a face on the right. The
   line is exactly the face's height, so the roles sit as close as their faces
   allow and the label rides the face's centre. */
.pipelines-leads-card__person {
    display: flex;
    align-items: center;
    justify-content: space-between;
    column-gap: var(--spacing-sm);
    min-height: 20px;
}

.pipelines-leads-card__person .global-label-caps {
    color: var(--color-grey-500);
}

/* A role's face is a step under the avatar atom's smallest size: the role
   line is exactly as tall as its face, so 24px faces held the roles 26px
   apart for a label ten pixels tall, and the list read as air. 20px is the
   smallest a photo or two initials still read at. */
.pipelines-leads-card__face {
    flex: none;
    width: 20px;
    height: 20px;
}

/* What the lead wants, then where it came from: one short line each, under
   the name. Came-from wears the muted look of the next-task line. */
.pipelines-leads-card__wants,
.pipelines-leads-card__came-from {
    min-width: 0;
    margin: 0;
    font-size: var(--font-size-sm);
    overflow-wrap: anywhere;
}

.pipelines-leads-card__wants {
    color: var(--color-text);
}

.pipelines-leads-card__came-from {
    color: var(--color-text-secondary);
}

/* The org's mark fills its circle edge to edge. */
.pipelines-leads-card__face--org {
    padding: 0;
    overflow: hidden;
    background: transparent;
}

.pipelines-leads-card__face--org img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-pill);
    object-fit: cover;
}

/* ── The lead drawer's Owner bar ──
   The one block in this file that draws OUTSIDE the .pipelines-leads-board
   strip: the drawer renders into #lead-drawer-container beside it, on the
   same two pages that load this sheet, and its class names are its scope the
   same way the column strip's own __dot and __count rules above are theirs.
   Label + picker on one row above the tabs; .global-drawer-body already owns the
   horizontal padding, so the bar only spaces itself off the tabs below. */
.sales-lead-owner-bar {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
    margin-bottom: var(--spacing-smd);
}

/* The picker takes the row's slack so the roster's names never truncate
   against a label four characters wide. */
.sales-lead-owner-bar__select {
    flex: 1 1 auto;
    min-width: 0;
}

.sales-lead-owner-bar__confirm {
    margin-bottom: var(--spacing-smd);
}

/* The owner change's note and its refusals share one quiet line; the error
   borrows the app's danger ink rather than a box. */
.sales-lead-owner-bar__msg {
    margin: 0 0 var(--spacing-smd);
    color: var(--color-grey-600);
    font-size: var(--font-size-xs);
}

.sales-lead-owner-bar__msg--error {
    color: var(--color-error);
}

/* The picker's fold under the Owner line: closed until Change opens it. */
.sales-lead-owner-edit {
    margin-top: var(--spacing-sm);
}

/* ── The facts grid ──
   Every fact in the drawer — the head's referred/arrived/booked, a session's
   options and day, the form's answers (flat and in the form's own order — the
   drawer follows the layout of the form, Nick 2026-08-28), the referral's
   terms — sits in one label-over-value grid, so the whole record reads with
   one eye. Cells fill the row at a minimum width and wrap; a long value
   (--wide) takes the whole row so it reads as the paragraph it is. Drawer
   scope again, like the Owner bar above. The head's grid also carries
   sales-lead-head__facts, which styles nothing: the browser proofs find the
   head by it, so it stays. */
.sales-lead-facts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--spacing-sm) var(--spacing-md);
    margin: 0;
}

/* A grid with no cell in it still owns its gap and margin; it owns nothing. */
.sales-lead-facts:not(:has(.sales-lead-facts__item)) {
    display: none;
}

/* min-width: 0 lets a long unbroken value wrap inside its cell instead of
   stretching the whole column. */
.sales-lead-facts__item {
    min-width: 0;
}

.sales-lead-facts__item--wide {
    grid-column: 1 / -1;
}

.sales-lead-facts__label {
    margin-bottom: var(--spacing-2xs);
    color: var(--color-text-muted);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sales-lead-facts__value {
    margin: 0;
    color: var(--color-text);
    font-size: var(--font-size-md);
    overflow-wrap: anywhere;
}

/* The Owner line carries its Change pill beside the name, one step off the
   text; the pill's look is shared with the rail's Move here below. */
.sales-lead-facts__value--owner,
.sales-lead-facts__value--person {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
}

/* The org's mark beside the Owner name and the referrer's face beside theirs. */
.sales-lead-facts__face,
.sales-lead-facts__value--person > .global-person-chip--avatar {
    flex: none;
    width: 20px;
    height: 20px;
}

.sales-lead-facts__face {
    padding: 0;
    overflow: hidden;
    background: transparent;
}

.sales-lead-facts__face img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-pill);
    object-fit: cover;
}

/* The booking's reference, quiet beside its service and day. */
.sales-lead-facts__ref {
    margin-left: var(--spacing-xs);
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
}

/* The dot between the door a lead came through and its first visit. */
.sales-lead-facts__sep {
    margin: 0 var(--spacing-xs);
    color: var(--color-text-muted);
}

/* The door a lead came through, a quiet second line under its arrival date. */
.sales-lead-facts__note {
    display: block;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

/* The form's answers follow the session cards inside their section. */
.sales-lead-answers {
    margin-top: var(--spacing-md);
}

/* The door into a new refer form, under the referral's facts. */
.sales-lead-refer {
    display: inline-block;
    margin-top: var(--spacing-smd);
    font-size: var(--font-size-sm);
}

/* Two figures on one row rather than two stacked rows: the pair is a
   comparison, and a card that fits its money on one line is a card whose name
   is still the tallest thing on it. They wrap rather than squeeze when a stage
   name pushes the column narrow. */
.pipelines-leads-card__figures {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--spacing-xs) var(--spacing-smd);
}

/* Labels inherit the grey; each figure below names its own colour. */
.pipelines-leads-card__figure {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-xs);
    min-width: 0;
    color: var(--color-grey-500);
}

/* Both figures keep their size on the base class and take their COLOUR from a
   --real modifier. Every card reserves both slots now, so either can hold an em
   dash, and a dash inheriting the row's grey is what says "no figure yet"; ink
   and green are claims about a number, and a claim with no number under it is
   the thing this split exists to prevent. */
.pipelines-leads-card__value {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
}

.pipelines-leads-card__value--real {
    color: var(--color-text);
}

/* The second figure — profit to an admin, earnings to a worker — is the good
   number on this page, and green is what the rest of the app already pays out
   in. "net" rather than either word on purpose: a worker's card is asserted to
   carry the string "profit" nowhere at all (test_my_leads.py, "never says
   profit"), and a class name is text on the page like any other. */
.pipelines-leads-card__net {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
}

.pipelines-leads-card__net--real {
    color: var(--color-success);
}

/* ── The drawer's header block ──
   Who this is, before the record starts: the contact chips, the
   referred/arrived/booked cells in the facts grid, the note. Drawer scope like
   the Owner bar — .global-drawer-body owns the horizontal padding, this block
   only spaces itself off what follows. */
.sales-lead-head {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-smd);
}

.sales-lead-head__chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

/* A chip is a small door — mailto, tel, HubSpot — so it looks pressable where
   the facts line above it does not: a bordered pill in plain ink. */
.sales-lead-head__chip {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    text-decoration: none;
    max-width: 100%;
}

/* A long email ends in "…" inside its chip instead of running off the drawer. */
.sales-lead-head__chip-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sales-lead-head__chip:hover {
    border-color: var(--color-grey-400);
}

/* The pencil's Name / Email / Phone boxes, stacked in place of the chips. */
.sales-lead-contact-edit {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.sales-lead-head__note {
    margin: 0;
    color: var(--color-text);
    font-size: var(--font-size-md);
}

/* ── The booking link ──
   The drawer's one send-me control, right under the header. Boxed and
   grounded so it reads as a thing to act on, not another fact line: the row
   holds the link, Copy and the Edit pencil together, the hint under them
   says what the link opens. */
.sales-lead-sendlink {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xsm);
    padding: var(--spacing-sm) var(--spacing-smd);
    margin-bottom: var(--spacing-smd);
    border: 1px solid var(--color-grey-200);
    border-radius: var(--radius-card);
    background: var(--color-grey-50);
}

.sales-lead-sendlink__row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.sales-lead-sendlink__hint {
    margin: 0;
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
}

/* ── The Dates link card ──
   Wears the send-link box above it. Offer dates opens a drawer whose form
   stacks What, How long, When and Who (Who last: Nick, 11-03). Who is the permissions drawer's people
   list, with its own rules. How long is pills: a lit one reads like the
   drawer's live row button (border in text ink, medium weight), so a pick is
   told by the edge and not a tick. When is the shared segmented control with
   the two day boxes behind Pick days. */
.sales-lead-dates__field {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin: 0;
    padding: 0;
    border: 0;
}

.sales-lead-dates__label {
    margin: 0;
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
}

.sales-lead-dates__pills {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.sales-lead-dates__pill {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    min-height: var(--control-h-sm);
    margin: 0;
    font: inherit;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.sales-lead-dates__pill:hover {
    border-color: var(--color-text-muted);
}

.sales-lead-dates__pill.is-active {
    border-color: var(--color-text);
    background: var(--color-surface-subtle);
    font-weight: var(--font-weight-medium);
}

.sales-lead-dates__pill:focus-visible,
.sales-lead-dates__pill:has(input:focus-visible) {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

/* The Offer dates drawer is written inside the lead drawer's panel, so the
   one-drawer guard in drawer.js keeps the lead open under it. That panel is
   transformed, so these fixed parts measure from it, which already sits under
   the app header (the opportunity form's seat editor does the same). */
.sales-lead-dates-drawer .global-drawer-panel.global-drawer-panel--inset {
    top: 0;
}

.sales-lead-dates-drawer .global-drawer-scrim {
    top: 0;
    left: 0;
}

.sales-lead-dates__days {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-xs);
}

.sales-lead-dates__error {
    margin: 0;
    color: var(--color-error);
    font-size: var(--font-size-xs);
}

/* ── The session card ──
   One frozen cart line: an eyebrow for which session, the package name, its
   facts in the shared grid, then what the package includes as a check list.
   A bordered card rather than a list, because two sessions on one order need
   an edge between them to read as two. */
.sales-lead-package {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: var(--spacing-smd);
    border: 1px solid var(--color-grey-200);
    border-radius: var(--radius-card);
}

.sales-lead-package + .sales-lead-package {
    margin-top: var(--spacing-sm);
}

/* The eyebrow sits tight over the name; the card's gap is for what follows. */
.sales-lead-package__eyebrow {
    margin: 0 0 calc(0px - var(--spacing-xsm));
    color: var(--color-text-muted);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sales-lead-package__name {
    margin: 0;
    color: var(--color-text);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
}

.sales-lead-package__includes {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    margin: 0;
    padding: 0;
    list-style: none;
}

.sales-lead-package__include {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-xs);
    color: var(--color-grey-600);
    font-size: var(--font-size-xs);
}

.sales-lead-package__include .bi {
    flex-shrink: 0;
    color: var(--color-text-muted);
}

/* ── The Money band ──
   Label-over-figure cells on one wrapping row, so the section reads like the
   metrics strip rather than a form. Which cells exist is the payload's call —
   this sheet draws whatever arrives (see lead_drawer.py's gating law). */
.sales-lead-money {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-smd) var(--spacing-lg);
}

.sales-lead-money__cell {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    min-width: 0;
}

.sales-lead-money__label {
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
}

.sales-lead-money__figure {
    color: var(--color-text);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
}

/* ── Team pay ──
   One row per seat: the role, who holds it, and the figure on the right. The
   hairline between rows is what makes five seats read as a schedule rather
   than a paragraph of money. */
.sales-lead-pay {
    display: flex;
    flex-direction: column;
}

.sales-lead-pay__row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) 0;
}

.sales-lead-pay__row + .sales-lead-pay__row {
    border-top: 1px solid var(--color-grey-200);
}

.sales-lead-pay__seat {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1 1 auto;
    min-width: 0;
}

.sales-lead-pay__role {
    color: var(--color-text);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
}

.sales-lead-pay__who {
    color: var(--color-grey-600);
    font-size: var(--font-size-xs);
}

/* An open seat is an invitation, not a gap — muted would read as missing
   data, so it keeps full ink at the small size. */
.sales-lead-pay__who--open {
    color: var(--color-text);
}

/* Billed = this figure is off a real bill, the same claim the basis note
   makes in words. It borrows the app's payout green as an outline so the tag
   reads as a state, never as another figure. */
.sales-lead-pay__billed {
    flex: 0 0 auto;
    padding: 1px var(--spacing-xsm);
    border: 1px solid var(--color-success);
    border-radius: var(--radius-pill);
    color: var(--color-success);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
}

.sales-lead-pay__amount {
    flex: 0 0 auto;
    margin-left: auto;
    color: var(--color-text);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
}

/* ── "Where it stands" — the stage rail ──
   The whole pipeline top to bottom: a dot per stage, a line between them, the
   current stop in full ink. The dots carry the state — unreached stays pale,
   visited darkens, current is ink — so the eye finds "here" before it reads a
   word. */
.sales-lead-rail {
    display: flex;
    flex-direction: column;
}

.sales-lead-rail__row {
    display: flex;
    gap: var(--spacing-smd);
}

/* The track is the dot-and-line column. It stretches with the row so the line
   runs all the way to the next dot however tall the body beside it gets. */
.sales-lead-rail__track {
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: stretch;
    flex: 0 0 auto;
    width: 12px;
}

.sales-lead-rail__dot {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    margin-top: var(--spacing-xs);
    border-radius: var(--radius-pill);
    background: var(--color-grey-300);
}

.sales-lead-rail__dot--visited {
    background: var(--color-grey-500);
}

.sales-lead-rail__dot--current {
    background: var(--color-text);
}

.sales-lead-rail__line {
    flex: 1 1 auto;
    width: 2px;
    margin-top: var(--spacing-2xs);
    background: var(--color-grey-200);
}

.sales-lead-rail__body {
    flex: 1 1 auto;
    min-width: 0;
    padding-bottom: var(--spacing-smd);
}

.sales-lead-rail__name {
    color: var(--color-text);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
}

/* "Now" is an ink pill rather than a colour: the board's stage colours mean
   stage identity, and borrowing one here would make the marker read as a
   different stage rather than as "this one". */
.sales-lead-rail__now {
    display: inline-block;
    margin-left: var(--spacing-xsm);
    padding: 1px var(--spacing-xsm);
    border-radius: var(--radius-pill);
    background: var(--color-text);
    color: var(--color-card-bg);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-medium);
}

.sales-lead-rail__when {
    display: block;
    margin-top: 1px;
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
}

/* The same pressable pill the header chips wear, as a button: the rail's
   Move here and the Owner line's Change. */
.sales-lead-rail__move,
.sales-lead-facts__change {
    flex: 0 0 auto;
    padding: var(--spacing-2xs) var(--spacing-smd);
    border: 1px solid var(--color-grey-300);
    border-radius: var(--radius-pill);
    background: var(--color-card-bg);
    color: var(--color-text);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
}

/* Move here sits at the row's right edge, off the text so a misaimed tap
   reads before it moves. */
.sales-lead-rail__move {
    align-self: flex-start;
    margin-left: auto;
}

.sales-lead-rail__move:hover,
.sales-lead-facts__change:hover,
.sales-lead-facts__change[aria-expanded="true"] {
    border-color: var(--color-grey-400);
}

.sales-lead-rail__move:disabled {
    color: var(--color-grey-500);
    cursor: default;
}

/* ── The boards' + Lead and + Booking buttons ──
   Equal columns, so both buttons take the width of the longer label. */
.sales-leads-actions {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: var(--spacing-xsm);
}

/* The header rule makes each button a flex row; keep the shorter label centred. */
.sales-leads-actions .btn {
    justify-content: center;
}

/* The phone's booking-or-lead sheet (_leads_actions.html); a desk keeps the
   two buttons above. Its phone rules end this file's last phone block. */
.sales-leads-add {
    display: none;
}

/* A phone. The lead's name and the owner's Change take a fingertip strip
   (global-touch-target), so the card stays the same size. */
@media (max-width: 767.98px) {
    /* board.css lets a phone lane grow with the page, but the fill holds the
       page to the screen, so the lane scrolls its own cards. The lock already
       stops above the phone bar, so the cards need no room for it. */
    .pipelines-board.global-page-fill .pipelines-column__cards {
        overflow-y: auto;
        overscroll-behavior-y: contain;
        padding-bottom: var(--spacing-sm);
    }

    /* The drawer's chips match the phone chip, which already stands as tall as the pencil. */
    .sales-lead-head__chip {
        min-height: var(--control-h-touch);
    }

    /* Each stage row is a fingertip tall, so Move here takes the whole row's
       height without reaching into the next one. */
    .sales-lead-rail__body {
        min-height: var(--control-h-touch);
    }

    .sales-lead-rail__move {
        position: relative;
    }

    .sales-lead-rail__move::before {
        content: "";
        position: absolute;
        inset: 0 0 calc(100% - var(--control-h-touch));
    }
}

/* Create Lead drawer: who the typed email or phone already belongs to, and the refusal. */
.sales-new-lead-slot:empty {
    display: none;
}

.sales-new-lead-known {
    display: flex;
    gap: var(--spacing-smd);
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-smd);
    border-radius: var(--radius-md);
    background: var(--color-surface-subtle);
}

.sales-new-lead-known > .bi {
    color: var(--color-success);
}

.sales-new-lead-known__text {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.sales-new-lead-known__name {
    font-weight: var(--font-weight-medium);
}

.sales-new-lead-known__detail {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

/* The refusal and the way to the lead already in play sit on one line. */
.sales-new-lead-open {
    display: flex;
    gap: var(--spacing-smd);
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.sales-new-lead-open__link {
    flex-shrink: 0;
}

/* ── One wide drawer (ADR-198, ADR-205) ──
   The lead's conversation on the left and the card side on the right, each
   scrolling on its own. The conversation is the Inbox's own thread: its head
   and its people panel stay in the Inbox (the drawer head already names the
   lead, and the card side beside it is the lead), and an email reply rises as
   a sheet over the emails, as it does on a narrower Inbox. On a phone one tab
   row shows one side at a time, the conversation first. */
.sales-lead-wide {
    display: grid;
    flex: 1 1 auto;
    grid-template-rows: minmax(0, 1fr);
    grid-template-columns: minmax(0, 3fr) minmax(26rem, 2fr);
    min-height: 0;
}

.sales-lead-wide__thread {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.sales-lead-wide__lead {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    border-left: 1px solid var(--color-border-subtle);
}

.sales-lead-wide__empty {
    padding: var(--spacing-xl) var(--spacing-md);
}

.sales-lead-wide__thread .conversations-head,
.sales-lead-wide__thread .conversations-context {
    display: none;
}

.sales-lead-wide__thread .conversations-body {
    position: relative;
}

.sales-lead-wide__thread .conversations-reply-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: var(--z-raised);
    height: min(85%, 44rem);
    border-top: 1px solid var(--color-border-subtle);
    border-left: 0;
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-none) var(--radius-none);
    box-shadow: var(--shadow-lg);
}

/* ── The card side's tabs (ADR-205) ──
   Company | Contact | Lead | Tasks | Book over one pane at a time. The row
   never wraps. It scrolls sideways when it must. In the wide drawer the row
   stays put and the pane scrolls under it. */
.sales-lead-side__tabs {
    flex-wrap: nowrap;
    margin-bottom: var(--spacing-md);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}

.sales-lead-side__tabs .global-tab {
    flex: 0 0 auto;
}

.sales-lead-side__convo {
    display: none;
}

.sales-lead-side__loading {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.sales-lead-side__loading-line {
    display: block;
    height: 0.75rem;
}

.sales-lead-side__loading-line--head {
    width: 50%;
    height: 1.25rem;
}

.sales-lead-side__loading-line--short {
    width: 35%;
}

.sales-lead-wide__lead .sales-lead-side {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.sales-lead-wide__lead .sales-lead-side__tabs {
    flex: 0 0 auto;
    margin-bottom: 0;
    padding: 0 var(--spacing-mdlg);
}

.sales-lead-wide__lead .sales-lead-side__pane {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding: var(--spacing-lg) var(--spacing-mdlg);
}

.sales-lead-wide__lead .sales-lead-side__pane--book {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

/* ── A person's or a company's file on the card side ── */
.sales-lead-file__head {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-smd);
    align-items: center;
}

.sales-lead-file__name {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-heading);
}

.sales-lead-file__links {
    display: flex;
    gap: var(--spacing-sm);
}

.sales-lead-file__list {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sales-lead-file__row {
    display: flex;
    gap: var(--spacing-smd);
    align-items: center;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--color-border-subtle);
}

.sales-lead-file__row:last-child {
    border-bottom: 0;
}

.sales-lead-file__main {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.sales-lead-file__title {
    overflow: hidden;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sales-lead-file__sub {
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
}

/* On a phone the card side's row is the whole drawer's row: the side steps
   out of the grid so its tabs sit on top, Conversation first, and its panes
   take the conversation's place when a card tab is picked. */
@media (max-width: 767.98px) {
    .sales-lead-wide {
        grid-template-rows: auto minmax(0, 1fr);
        grid-template-columns: minmax(0, 1fr);
    }

    .sales-lead-wide__lead,
    .sales-lead-wide__lead .sales-lead-side {
        display: contents;
    }

    .sales-lead-wide__lead .sales-lead-side__tabs {
        order: -1;
        padding: 0 var(--spacing-md);
        border-bottom: 1px solid var(--color-border-subtle);
    }

    .sales-lead-side__convo {
        display: inline-flex;
    }

    .sales-lead-wide__lead .sales-lead-side__pane {
        padding: var(--spacing-md);
    }

    .sales-lead-wide:not(.is-lead) .sales-lead-side__pane,
    .sales-lead-wide.is-lead .sales-lead-wide__thread {
        display: none;
    }

    .sales-lead-wide:not(.is-lead) .sales-lead-side__tabs .global-tab.is-active:not(.sales-lead-side__convo) {
        color: var(--color-text-muted);
        border-bottom-color: transparent;
    }

    /* The head's one round + asks which (Nick, 10-18): the desk's two step
       aside. One class heavier than page-header.css's phone-head .btn rule,
       so stylesheet order never decides which wins. */
    .sales-leads-actions:has(.sales-leads-add) > .btn.btn-primary {
        display: none;
    }

    .sales-leads-add {
        display: flex;
    }

    /* The head is the drag handle alone: no name, no X, no hairline. */
    .sales-leads-add__head {
        padding-bottom: var(--spacing-xs);
        border-bottom: 0;
    }

    .sales-leads-add__rows {
        display: flex;
        flex-direction: column;
        padding: 0 var(--spacing-md);
    }

    .sales-leads-add__row {
        display: flex;
        align-items: center;
        gap: var(--spacing-md);
        width: 100%;
        min-height: var(--control-h-touch);
        padding: var(--spacing-smd) var(--spacing-xs);
        border: 0;
        background: transparent;
        color: var(--color-text);
        font-size: var(--font-size-xl);
        font-weight: var(--font-weight-heading);
        text-align: left;
        text-decoration: none;
    }

    .sales-leads-add__row:hover,
    .sales-leads-add__row:focus-visible {
        color: var(--color-text);
        text-decoration: none;
    }

    .sales-leads-add__icon {
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        width: var(--control-h-touch);
        height: var(--control-h-touch);
        border-radius: var(--radius-pill);
        background: var(--color-grey-100);
        font-size: var(--font-size-xl);
    }

    .sales-leads-add__icon--ink {
        background: var(--color-text);
        color: var(--color-card-bg);
    }

    .sales-leads-add__cancel {
        min-height: var(--control-h-touch);
        margin: var(--spacing-md) var(--spacing-md) 0;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-pill);
        background: var(--color-card-bg);
        color: var(--color-text);
        font-size: var(--font-size-lg);
        font-weight: var(--font-weight-medium);
    }
}

/* Lead tasks (ADR-190, ADR-193): admins only, all on the Leads page.

   The Tasks tab's list and the admin drawer's Other tasks section share one
   row, .sales-task: a round tick, the title with its kind, on the tab the lead
   and a number to call, and when it is due. A ticked row stays where it was,
   struck through, until the list is read again.

   Also here: the Tasks tab's count on the saved-view strip, the admin board's
   card line (.pipelines-leads-card__next: the next task and when), and the
   steps and progress line under each stop of the drawer's Where it stands
   rail (.sales-lead-rail__step*), and the walk through tasks in the Inbox:
   the task bar over a lead's thread (.sales-task-bar) and the drawer's head
   in the panel beside it (ADR-194).

   Loaded by every page that hosts the lead drawer (both Leads boards, the
   Inbox). */

.sales-tasks {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sales-tasks-card {
    padding: var(--spacing-xs) var(--spacing-md);
}

/* The Tasks tab fills the screen like the Bookings table (Nick, 10-11): the
   page never scrolls, the list scrolls inside its card. relative keeps each
   row's hidden screen-reader text inside the card; without it that text hangs
   below the screen and the page scrolls after all. */
.sales-tasks-fill .sales-tasks-card {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
}

.sales-task {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-smd);
    padding: var(--spacing-smd) 0;
    border-bottom: 1px solid var(--color-border-subtle);
}

.sales-task:last-child {
    border-bottom: 0;
}

.sales-tasks--drawer .sales-task {
    padding: var(--spacing-sm) 0;
}

.sales-task__tick {
    flex: 0 0 auto;
    padding: 0;
    color: var(--color-text-muted);
    font-size: var(--font-size-lg);
    line-height: 1;
    background: none;
    border: 0;
    cursor: pointer;
}

.sales-task__tick:hover {
    color: var(--color-action);
}

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

.sales-task.is-done .sales-task__tick {
    color: var(--color-success);
}

/* A zero basis and min-width: 0 let a long title or note wrap beside the
   tick, instead of pushing the due time off the row or, on a phone, dropping
   the whole task under its own tick. */
.sales-task__main {
    flex: 1 1 0;
    min-width: 0;
}

.sales-task__title {
    margin: 0;
    color: var(--color-text);
    font-size: var(--font-size-md);
    overflow-wrap: anywhere;
}

.sales-task.is-done .sales-task__title {
    color: var(--color-text-muted);
    text-decoration: line-through;
}

.sales-task__kind {
    margin-right: var(--spacing-xs);
    color: var(--color-text-muted);
}

.sales-task__who {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-xs) var(--spacing-smd);
    margin: var(--spacing-2xs) 0 0;
    font-size: var(--font-size-sm);
}

/* The lead's name is a button when it opens the drawer; it reads as a link. */
.sales-task__lead {
    padding: 0;
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
    text-align: left;
    background: none;
    border: 0;
}

button.sales-task__lead {
    color: var(--color-action);
    cursor: pointer;
}

button.sales-task__lead:hover {
    text-decoration: underline;
}

.sales-task__phone {
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.sales-task__note {
    margin: var(--spacing-2xs) 0 0;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    overflow-wrap: anywhere;
}

.sales-task__when {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--spacing-2xs);
}

.sales-task__due {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    white-space: nowrap;
}

/* A phone has no room for the due time beside the title: it drops under it. */
@media (max-width: 767.98px) {
    .sales-task {
        flex-wrap: wrap;
    }

    .sales-task__when {
        flex-direction: row;
        align-items: center;
        width: 100%;
        padding-left: calc(var(--font-size-lg) + var(--spacing-smd));
    }
}

/* The drawer's section: the legend with the label picker on its right, the
   tasks, then the add form on one row that wraps on a narrow panel. */
.sales-lead-tasks__head {
    justify-content: space-between;
}

.sales-lead-tasks__label {
    width: auto;
    min-width: 8rem;
}

.sales-lead-tasks__error {
    margin: 0 0 var(--spacing-sm);
    color: var(--color-error-text);
    font-size: var(--font-size-sm);
}

.sales-lead-tasks__done-label {
    margin-top: var(--spacing-smd);
}

.sales-lead-tasks__add {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-smd);
}

.sales-lead-tasks__kind {
    flex: 0 0 auto;
    width: auto;
}

.sales-lead-tasks__title {
    flex: 1 1 12rem;
}

.sales-lead-tasks__due {
    flex: 1 1 12rem;
}

.sales-lead-tasks__submit {
    flex: 0 0 auto;
}

.sales-lead-tasks__stage {
    flex: 0 1 auto;
    width: auto;
    min-width: 8rem;
}

/* The admin board's card line: the next open task's kind, title and when.
   The title gives way first, cut short with an ellipsis, so the when always
   shows, even on a phone-width card. */
.pipelines-leads-card__next {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    min-width: 0;
    margin: 0 0 var(--spacing-xs);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.pipelines-leads-card__next-title {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    color: var(--color-text);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pipelines-leads-card__next-when {
    flex: 0 0 auto;
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    white-space: nowrap;
}

.pipelines-leads-card__next--late .pipelines-leads-card__next-when,
.pipelines-leads-card__next--late .bi {
    color: var(--color-warning-text);
    font-weight: var(--font-weight-medium);
}

.pipelines-leads-card__next--none,
.pipelines-leads-card__next--none .pipelines-leads-card__next-title {
    color: var(--color-text-muted);
}

/* The drawer rail's current stop: a thin bar and "2 of 3 steps done". */
.sales-lead-rail__progress-line {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    margin-top: var(--spacing-xs);
}

.sales-lead-rail__progress {
    display: block;
    width: 100%;
    height: 4px;
    overflow: hidden;
    background: var(--ms-pending);
    border-radius: var(--radius-pill);
}

.sales-lead-rail__progress-fill {
    display: block;
    height: 100%;
    background: var(--ms-active);
}

.sales-lead-rail__count {
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    font-variant-numeric: tabular-nums;
}

/* A stop's steps: a tick, the kind and title, and when an open one is due. */
.sales-lead-rail__steps {
    margin: var(--spacing-xs) 0 var(--spacing-sm);
    padding: 0;
    list-style: none;
}

.sales-lead-rail__step {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-2xs) 0;
    font-size: var(--font-size-sm);
}

.sales-lead-rail__step-tick {
    flex: 0 0 auto;
    padding: 0;
    color: var(--color-text-muted);
    line-height: 1;
    background: none;
    border: 0;
    cursor: pointer;
}

.sales-lead-rail__step-tick:hover {
    color: var(--color-action);
}

.sales-lead-rail__step-tick:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

.sales-lead-rail__step.is-done .sales-lead-rail__step-tick {
    color: var(--color-success);
}

.sales-lead-rail__step-title {
    flex: 1 1 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.sales-lead-rail__step.is-done .sales-lead-rail__step-title {
    color: var(--color-text-muted);
    text-decoration: line-through;
}

.sales-lead-rail__step-title .bi {
    margin-right: var(--spacing-2xs);
    color: var(--color-text-muted);
}

.sales-lead-rail__step-when {
    flex: 0 0 auto;
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    white-space: nowrap;
}

.sales-lead-rail__step-when--late {
    color: var(--color-warning-text);
    font-weight: var(--font-weight-medium);
}

/* Steps under a stage the lead has not reached yet. */
.sales-lead-rail__steps--later {
    opacity: 0.6;
}

/* Work a task where it gets done (ADR-194). On the Tasks tab, a task's title
   opens its lead's thread in the Inbox, and Work through sits over the list
   on its right. */
.sales-task__open {
    color: inherit;
    text-decoration: none;
}

.sales-task__open:hover {
    color: var(--color-action);
    text-decoration: underline;
}

.sales-tasks-walk {
    display: flex;
    flex: 0 0 auto;
    justify-content: flex-end;
    margin-bottom: var(--spacing-sm);
}

/* The task bar over the lead's thread: the task on the left, its buttons on
   the right, and the next task under both. On a phone the buttons drop
   under the task. */
.sales-task-bar {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: var(--spacing-sm) var(--spacing-md);
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface-subtle);
}

.sales-task-bar__task {
    display: flex;
    flex: 1 1 18rem;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    align-items: center;
    min-width: 0;
    font-size: var(--font-size-sm);
}

.sales-task-bar__kind,
.sales-task-bar__who {
    color: var(--color-text-secondary);
}

.sales-task-bar__title {
    min-width: 0;
    font-weight: var(--font-weight-heading);
    overflow-wrap: anywhere;
}

.sales-task-bar.is-done .sales-task-bar__title {
    color: var(--color-text-muted);
    text-decoration: line-through;
}

.sales-task-bar__when,
.sales-task-bar__count {
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    white-space: nowrap;
}

.sales-task-bar__phone {
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.sales-task-bar__call {
    white-space: nowrap;
}

.sales-task-bar__actions {
    display: flex;
    flex: 0 0 auto;
    gap: var(--spacing-xs);
    align-items: center;
}

.sales-task-bar__form {
    margin: 0;
}

.sales-task-bar__work {
    display: flex;
    flex: 1 0 100%;
    flex-wrap: wrap;
    gap: var(--spacing-xs) var(--spacing-smd);
    align-items: center;
}

.sales-task-bar__note {
    flex: 1 1 16rem;
    margin: 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    overflow-wrap: anywhere;
}

.sales-task-bar__next {
    flex: 1 0 100%;
    margin: 0;
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    overflow-wrap: anywhere;
}

/* The drawer's head in the Inbox's narrow panel: the chips wrap. */
.conversations-lead-head {
    width: 100%;
    margin-top: var(--spacing-sm);
}

.conversations-lead-head .sales-lead-head__chips {
    flex-wrap: wrap;
}

@media (max-width: 767.98px) {
    .sales-task-bar {
        padding: var(--spacing-sm) var(--spacing-smd);
    }

    /* While a reply is typed the keyboard has the bottom half; "Up next" waits. */
    .conversations-thread:has([data-texts-input]:focus) .sales-task-bar__next {
        display: none;
    }

    .sales-task-bar__actions {
        flex-wrap: wrap;
    }

    /* The thread head right under the bar names the person, so the bar
       does not; the number to call reaches a finger's height. */
    .sales-task-bar__who {
        display: none;
    }

    .sales-task-bar__phone {
        position: relative;
    }

    .sales-task-bar__phone::after {
        content: "";
        position: absolute;
        inset: calc((var(--control-h-touch) - 100%) / -2) 0;
    }
}

/* Booking and lead cards in the side panels (Nick's picks of 10-14 and 10-15).

   The Inbox panel beside a thread, the lead drawer's Contact and Company tabs
   and the contact page's right rail list a person's bookings and leads the same
   way. A booking is the kit's clickable card (.global-card--clickable, card.css)
   with .sales-side-booking laying out its title and stage with a chevron at the
   row's end, the day, hours and place, who is on it, and its money under a kit
   divider: Charge and Paid ending in the kit's balance chip, then Profit and
   worker cost. The kit card lifts on hover; keyboard focus here lifts it the
   same way and draws the app's one :focus-visible ring (main.css). A tap opens
   it inside the same panel (.sales-side-panel), whose title,
   people and steps are the kit's drawer title, person chip and step list. A
   lead is the leads board's own card (.pipelines-leads-card, board.css and
   leads-board.css) with one line under it (.sales-side-lead__line), opened by
   a clear button laid over both (.sales-side-lead__cover), the roster card's
   way (roster-cards.css): the cover comes first and the card's positioned
   parts paint above it by source order, with no z-index. The cover carries the
   chevron, and the pair lifts as a booking card does. A removed lead has no
   drawer to open, so it has no cover and stays still (.sales-side-lead--opens
   marks the ones that open). A cancelled booking and a removed lead read in the secondary text grey, which still clears 4.5:1 on
   white.

   Loaded by every page that shows those panels: the Inbox, the Leads page
   (the drawer) and the contact page. */

.sales-side-bookings,
.sales-side-leads {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.sales-side-leads .pipelines-card {
    margin: 0;
    width: 100%;
}

.sales-side-booking {
    gap: var(--spacing-xs);
    padding: var(--spacing-smd);
}

.sales-side-booking,
.sales-side-booking:hover {
    color: var(--color-text);
    text-decoration: none;
}

/* The kit card lifts on hover (card.css); keyboard focus lifts it the same way.
   A reader who asks for less motion keeps the shadow and loses the lift, the
   same trade main.css makes for buttons. */
.sales-side-booking:focus-visible {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.sales-side-booking__chevron,
.sales-side-lead__chevron {
    flex: none;
    color: var(--color-text-secondary);
}

.sales-side-booking__chevron {
    margin-left: auto;
}

.sales-side-booking__top {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    align-items: center;
}

.sales-side-booking__title {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: var(--font-weight-subheading);
}

.sales-side-booking__when {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.sales-side-booking__who {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-2xs);
    align-items: center;
}

.sales-side-booking__nobody {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.sales-side-booking__money {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs) var(--spacing-md);
}

.sales-side-booking__figure {
    display: inline-flex;
    gap: var(--spacing-xs);
    align-items: baseline;
}

.sales-side-booking__balance {
    align-self: center;
    margin-left: auto;
}

/* The opened booking's Balance due figure, in the error text red. */
.sales-side-booking__owed {
    color: var(--color-error-text);
}

.sales-side-booking.is-cancelled,
.sales-side-booking.is-cancelled:hover,
.sales-side-lead--removed .pipelines-card,
.sales-side-lead--removed .pipelines-card__title,
.sales-side-lead--removed .pipelines-leads-card__session-type,
.sales-side-lead--removed .pipelines-leads-card__wants,
.sales-side-lead--removed .pipelines-leads-card__value--real {
    color: var(--color-text-secondary);
}

.sales-side-booking.is-cancelled .sales-side-booking__title {
    text-decoration: line-through;
}

.sales-side-lead {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
}

.sales-side-lead--opens {
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.sales-side-lead--opens .pipelines-card {
    transition: box-shadow var(--transition-fast);
}

.sales-side-lead--opens:hover,
.sales-side-lead--opens:has(:focus-visible) {
    transform: translateY(-2px);
}

.sales-side-lead--opens:hover .pipelines-card,
.sales-side-lead--opens:has(:focus-visible) .pipelines-card {
    box-shadow: var(--shadow-md);
}

.sales-side-lead__cover {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: var(--spacing-smd);
    border: 0;
    border-radius: var(--radius-card);
    background: transparent;
    cursor: pointer;
}

/* The owner's face keeps clear of the chevron, and the faces keep their
   tooltips: positioned, they paint above the cover. */
.sales-side-lead--opens .pipelines-card__head {
    padding-right: var(--spacing-lg);
}

.sales-side-lead [data-tooltip] {
    position: relative;
}

@media (prefers-reduced-motion: reduce) {
    .sales-side-booking:hover,
    .sales-side-booking:focus-visible,
    .sales-side-lead--opens:hover,
    .sales-side-lead--opens:has(:focus-visible) {
        transform: none;
    }
}

.sales-side-lead__line {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-2xs) var(--spacing-xs);
    align-items: center;
    margin: 0;
    padding: 0 var(--spacing-xs);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.sales-side-open__back {
    padding-left: 0;
    color: var(--color-text);
    text-decoration: none;
}

.sales-side-panel {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.sales-side-panel__label {
    margin: var(--spacing-xs) 0 0;
}

.sales-side-panel__list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin: 0;
    padding: 0;
    list-style: none;
}

.sales-side-panel__open {
    align-self: flex-start;
}

/* The worker board's numbers switch. Every rule keys off
   .pipelines-leads-numbers-hidden, a class only my_leads.html puts on its page
   wrapper — and only for a non-admin viewer — so nothing here can reach the
   org board, which never renders the class. The server keeps rendering every
   figure either way; this file just decides whether they paint, which is what
   lets one class on a stable ancestor survive every HTMX swap inside it
   (#kanban-columns, #leads-table, the drawer) without the swapped markup
   knowing the switch exists.

   Hidden is the default and the eye button in _leads_toolbar_actions.html is the
   opt-in (Nick, 2026-08-18) — but the switch hides only the AGGREGATES:
   the per-stage column totals and the drawer's money sections. A lead's own card and table row keep their figures whatever the
   switch says (Nick, 2026-08-28: hiding the metrics must not hide anything
   on the individual lead cards). So a new money surface on this page joins
   one side or the other on purpose: an aggregate must sit inside one of
   these containers or add its selector here, and a per-lead figure must
   stay off this list. */
.pipelines-leads-numbers-hidden .pipelines-leads-column__total,
.pipelines-leads-numbers-hidden .pipelines-leads-money-section {
    display: none;
}

/* Weather on a booking (look B, picked 2026-11-02): the session's own Weather
   card beside its session card, the same card on the worker's page, the mark on
   a calendar chip and the bookings list's Weather cell. Loaded only for an org
   with the Weather plugin on. A National Weather Service alert is the one red
   thing; a tripped weather rule wears the warning badge's amber. */

.opportunities-weather-quiet {
    margin: 0;
    font-size: var(--font-size-xs);
    color: var(--color-grey-500);
}

/* The session card and its Weather card side by side; stacked under 1100px. */
.opportunities-weather-pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 19rem;
    gap: var(--spacing-md);
    align-items: start;
}

/* The page's own card frame draws the border; this keeps the red bar inside
   its rounded corners. */
.opportunities-weather-card {
    overflow: hidden;
}

.opportunities-weather-card .global-section {
    gap: var(--spacing-smd);
    padding: var(--spacing-md) var(--spacing-mdlg);
}

.opportunities-weather-card__alert {
    display: grid;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-mdlg);
    background: var(--color-error);
    /* The card's own surface as the text, so the words read as cut out of the bar. */
    color: var(--color-card-bg);
}

.opportunities-weather-card__alert-line {
    display: flex;
    align-items: center;
    gap: var(--spacing-xsm);
    margin: 0;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.opportunities-weather-card__flags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin: 0;
}

.opportunities-weather-card__now {
    display: flex;
    align-items: center;
    gap: var(--spacing-smd);
}

.opportunities-weather-card__icon {
    font-size: var(--font-size-display);
    line-height: 1;
    color: var(--color-grey-600);
}

.opportunities-weather-card__high {
    font-family: var(--font-family-heading);
    font-size: var(--font-size-display);
    font-weight: var(--font-weight-heading);
    line-height: 1;
    color: var(--color-text);
}

.opportunities-weather-card__words {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
}

.opportunities-weather-card__sky {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
}

.opportunities-weather-card__facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--spacing-sm) var(--spacing-md);
    margin: 0;
}

.opportunities-weather-card__facts dt {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-body);
    color: var(--color-grey-500);
}

.opportunities-weather-card__facts dd {
    margin: 0;
    font-size: var(--font-size-md);
    font-variant-numeric: tabular-nums;
}

/* The shoot hours, one cell an hour; a long day scrolls sideways. */
.opportunities-weather-hours {
    display: grid;
    grid-auto-columns: minmax(2.75rem, 1fr);
    grid-auto-flow: column;
    overflow-x: auto;
    /* A swipe past the last hour stops here, never read as Back. */
    overscroll-behavior-x: contain;
    margin: 0;
    padding: var(--spacing-sm) 0 0;
    list-style: none;
    border-top: 1px solid var(--color-border-hairline);
}

.opportunities-weather-hours__cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-2xs);
    font-variant-numeric: tabular-nums;
}

.opportunities-weather-hours__hour {
    font-size: var(--font-size-xs);
    color: var(--color-grey-500);
}

.opportunities-weather-hours__icon {
    font-size: var(--font-size-lg);
    color: var(--color-grey-600);
}

.opportunities-weather-hours__temp {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
}

.opportunities-weather-hours__rain {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2xs);
    font-size: var(--font-size-xs);
    color: var(--color-grey-500);
}

/* Sunny marks wear the warning amber the picked look drew them in; every other
   mark stays grey. After the grey icon rules, so the amber wins. */
.opportunities-weather-icon--sun,
.opportunities-weather-icon--cloud-sun {
    color: var(--color-warning);
}

/* The bookings list's Weather cell. */
.opportunities-weather-cell {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-xs);
}

.opportunities-weather-cell__now {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-variant-numeric: tabular-nums;
}

/* A calendar chip's mark: after the chip's words, pushed to its right edge. */
.calendar-chip-weather {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: var(--spacing-2xs);
    margin-left: auto;
    padding-left: var(--spacing-xs);
    color: var(--color-grey-700);
    font-variant-numeric: tabular-nums;
}

.calendar-chip-weather__dot {
    width: 0.4rem;
    height: 0.4rem;
    flex: 0 0 auto;
    border-radius: var(--radius-pill);
}

.calendar-chip-weather__dot--alert {
    background: var(--color-error);
}

.calendar-chip-weather__dot--flag {
    background: var(--color-warning);
}

@media (max-width: 1023px) {
    .opportunities-weather-pair {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* A phone's month grid folds each chip to a dot, and its mark goes with the words. */
@media (max-width: 767.98px) {
    .calendar-chip-weather {
        display: none;
    }
}

/* The header's Weather fact, right after Where: the mark, high / low and the
   sky on the first line; the chance of rain (or the rule's amber chip) and any
   alert's red badge under it. A phone keeps the facts' own two-column wrap. */
/* On a desk the fact stays on the facts row, right after Where: the address
   wraps to make room rather than pushing Weather to a row of its own. */
@media (min-width: 768px) {
    .global-facts:has(.opportunities-weather-fact) {
        flex-wrap: nowrap;
    }

    .global-facts:has(.opportunities-weather-fact) > .global-facts__item {
        flex: 0 0 auto;
    }

    .global-facts:has(.opportunities-weather-fact) > [data-fact="location"] {
        flex: 0 1 auto;
    }
}

.opportunities-weather-fact__value {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
}

.opportunities-weather-fact__now {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.opportunities-weather-fact__more {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

/* The hour strip in the sidebar's and the calendar's scroll look: no scrollbar,
   a chevron at each cut edge over a fade (calendar-events.css,
   .calendar-scroll-arrow), hover-scroll.js moving it sideways. */
.opportunities-weather-hours-scroll {
    position: relative;
}

.opportunities-weather-hours--scroll {
    grid-auto-columns: minmax(4rem, 1fr);
    scrollbar-width: none;
}

.opportunities-weather-hours--scroll::-webkit-scrollbar {
    display: none;
}

.opportunities-weather-hours-scroll__arrow {
    position: absolute;
    top: 1px;
    bottom: 0;
    display: flex;
    align-items: center;
    width: var(--spacing-xl);
    opacity: 0.6;
    z-index: var(--z-raised);
    font-size: var(--font-size-lg);
    color: var(--color-text-light);
    cursor: pointer;
    user-select: none;
}

.opportunities-weather-hours-scroll__arrow:hover {
    opacity: 1;
}

.opportunities-weather-hours-scroll__arrow--start {
    left: 0;
    justify-content: flex-start;
}

.opportunities-weather-hours-scroll__arrow--end {
    right: 0;
    justify-content: flex-end;
}

/* The cut edge fades out under its chevron. A mask, not a painted gradient, so
   the fade matches whatever the card behind it is (the glass card shows the
   page through it). */
.opportunities-weather-hours--scroll.is-cut-end {
    -webkit-mask-image: linear-gradient(to right, black calc(100% - var(--spacing-xl) * 1.5), transparent);
    mask-image: linear-gradient(to right, black calc(100% - var(--spacing-xl) * 1.5), transparent);
}

.opportunities-weather-hours--scroll.is-cut-start {
    -webkit-mask-image: linear-gradient(to left, black calc(100% - var(--spacing-xl) * 1.5), transparent);
    mask-image: linear-gradient(to left, black calc(100% - var(--spacing-xl) * 1.5), transparent);
}

.opportunities-weather-hours--scroll.is-cut-start.is-cut-end {
    -webkit-mask-image: linear-gradient(
        to right,
        transparent,
        black calc(var(--spacing-xl) * 1.5),
        black calc(100% - var(--spacing-xl) * 1.5),
        transparent
    );
    mask-image: linear-gradient(
        to right,
        transparent,
        black calc(var(--spacing-xl) * 1.5),
        black calc(100% - var(--spacing-xl) * 1.5),
        transparent
    );
}

/* Task view — every role (seat) on every booking in the filtered set, one row
   each, as the shared global-grid (components/object-grid.css draws the grid
   itself: the sticky heading, the frozen band, the picker and the heading menu).
   The fifth Opportunities view; loaded only by my_assignments_task.html. What is
   left here is the card the grid sits in and the two things a seat row adds to
   a grid row: a settled seat reads muted, and its quick action shows on hover. */

/* The grid keeps a bounded white card of its own (content-separation layout —
   the standalone header card splits off above it). The card is a
   .global-page-fill flex column (main.css), the way the Table view's and the
   roster's are: it stretches to the bottom of the screen, the wrap inside takes
   the height flex hands it and scrolls both ways, and the count line below
   keeps its own height. */
.opportunities-task-view {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: var(--spacing-xs) var(--spacing-mdlg) var(--spacing-mdlg);
}

/* Nothing left on the seat: the shift is done and the files are in. It only
   lists when the view keeps settled rows, and then it reads as finished. */
.opportunities-task-view .global-grid__row.is-settled .global-grid__cell {
  color: var(--color-neutral-ink-muted-fg);
}
.opportunities-task-view .global-grid__row.is-settled .global-grid__value,
.opportunities-task-view .global-grid__row.is-settled .global-person-chip {
  opacity: 0.6;
}

.opportunities-task-view__unassigned {
  font-style: italic;
}

/* The Job cell: the job's name in small muted caps over its booking's name. */
.opportunities-task-view__job {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2xs);
  border-radius: var(--radius-sm);
}
.opportunities-task-view__kind {
  color: var(--color-text-muted);
}

/* The Details cell: label and value pairs side by side. A pair is one unit and
   never breaks inside; on a narrow cell whole pairs move to the next line. The
   list is capped at the row's own height (a grid cell has no top or bottom
   padding) and scrolls inside itself past it, so it never makes a row taller
   at any row height. */
.opportunities-task-view .global-grid__cell[data-rk="details"] {
  white-space: normal;
}
.opportunities-task-view__details {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs) var(--spacing-md);
  margin: 0;
  max-height: var(--grid-row-h);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}
/* A pair is capped at the column's width the way every grid value is, so the
   column can be dragged narrow; a pair wider than that cuts its value short and
   the full value is in the value's title. */
.opportunities-task-view__pair {
  display: inline-flex;
  align-items: baseline;
  gap: var(--spacing-xs);
  max-width: var(--grid-col-max);
  white-space: nowrap;
}
.opportunities-task-view__details dt {
  flex-shrink: 0;
  color: var(--color-text-muted);
  font-weight: var(--font-weight-body);
}
.opportunities-task-view__details dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The row's first cell: a check in a circle that ticks the row done
   (_task_tick.html), outlined in the quiet text colour and filled with the
   action ink on hover, focus and press. A row the reader may not tick leaves
   the cell empty. */
.opportunities-task-view__tick {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  padding-inline: var(--spacing-xs);
  text-align: center;
}
.opportunities-task-tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1.5px solid var(--color-text-secondary);
  border-radius: var(--radius-pill);
  background: transparent;
  color: transparent;
  font-size: var(--font-size-md);
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}
.opportunities-task-tick:hover,
.opportunities-task-tick:focus-visible,
.opportunities-task-tick:active {
  background: var(--color-action);
  border-color: var(--color-action);
  color: var(--color-neutral-ink-fg);
}
.opportunities-task-tick:disabled {
  cursor: progress;
}

/* The quick action rides the row's trailing filler cell so the columns stay
   the columns the view picked. On a pointer it shows when the row is hovered
   or holds focus; on touch it is always there. */
.opportunities-task-view__quick {
  white-space: nowrap;
}
@media (hover: hover) {
  .opportunities-task-view .global-grid__row .opportunities-task-view__quick .btn {
    opacity: 0;
    transition: opacity var(--transition-fast);
  }
  .opportunities-task-view .global-grid__row:hover .opportunities-task-view__quick .btn,
  .opportunities-task-view .global-grid__row:focus-within .opportunities-task-view__quick .btn {
    opacity: 1;
  }
}

/* The Deliverable cell is the bookings table's own (milestones.css draws it;
   base.html loads that sheet everywhere), sitting in a grid cell instead of a
   milestone cell. Two things the table's rules key off its own cell for:

   The way into the role shows on hovering ANYWHERE in the cell — the table's
   reveal is scoped to its .opportunities-milestone-propcell, so the grid cell
   names its own. A touch screen has it always (milestones.css). */
.opportunities-task-view .global-grid__cell:hover .opportunities-milestone-open,
.opportunities-task-view .global-grid__cell:focus-within .opportunities-milestone-open {
  opacity: 1;
}

/* The table caps the stack at its own row tier (--ms-row-h) so a cell never
   drags a row taller; this grid's rows size to the tallest cell (object-grid.css
   --grid-row-h is a minimum), and the cell shows two lines and never three, so
   the cap has nothing to hold back here and would only clip the second line on
   the compact tier. */
.opportunities-task-view .opportunities-milestone-delivcell__main {
  max-height: none;
}

/* The "Send Confirmation Text" step's Open group text button always shows, so
   the row says what to do without a hover; greyed, its reason sits under it. */
.opportunities-task-view .global-grid__row .opportunities-task-view__quick .btn.opportunities-task-row__group-text {
  opacity: 1;
}
.opportunities-task-row__group-text-form {
  display: inline;
  margin: 0;
}
.opportunities-task-row__group-text-off {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--spacing-2xs);
  vertical-align: middle;
}
.opportunities-task-row__group-text-why {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

/* Grid layout (_task_grid.html): each row grows to show every person in its cells. */
.opportunities-task-grid__capped {
  margin: 0 0 var(--spacing-xs);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

/* A date column holds two seats side by side. Each seat is wide enough for a
   badge word such as WORSHIP LEADER on one line. */
.opportunities-task-grid__booking {
  --task-grid-seat-w: calc(var(--spacing-2xl) + var(--spacing-2xl) + var(--spacing-xl));
  min-width: calc(2 * var(--task-grid-seat-w) + var(--spacing-sm) + var(--spacing-xl));
  vertical-align: bottom;
}

.opportunities-task-grid__heading {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2xs);
  padding-block: var(--spacing-xs);
}

.opportunities-task-grid__role {
  font-weight: var(--font-weight-medium);
  text-align: left;
}

/* Role names read left as labels; every Sunday column reads centred, the
   heading pairs, the people, their chips and an open seat's button alike
   (Nick 11-05: "Roles left, Sundays centred"). */
.opportunities-task-grid__booking,
.opportunities-task-grid__cell {
  text-align: center;
}

.opportunities-task-grid__heading,
.opportunities-task-grid__heading .global-grid__group-pair {
  align-items: center;
}

/* A line is one seat stacked: the badge words (a row with badges only), the
   face, then the name with the chip under it. Every line of a row is one
   height, made from the same tokens the parts are drawn with, so the faces of
   a row line up. The row grows to show every line of its cells (Nick's pick
   2026-11-09: a full cell shows everyone), on a phone and a computer alike.
   The phone block swaps in its own words height. A row
   with no badge words sets no --task-grid-labels-h, so it saves no room. A
   row with no Unavailable mark sets no --task-grid-marks-h. */
.opportunities-task-grid__cell {
  --task-grid-face: var(--spacing-2xl);
  --task-grid-label-h: calc(var(--font-size-2xs) * var(--line-height-heading));
  --task-grid-chip-h: calc(var(--font-size-2xs) * var(--line-height-accent) + var(--spacing-xs));
  --task-grid-words-h: calc(
    var(--font-size-md) * var(--line-height-heading) + var(--spacing-2xs)
      + var(--task-grid-chip-h) + var(--task-grid-marks-h, 0px)
  );
  --task-grid-line-h: calc(
    var(--task-grid-labels-h, 0px) + var(--task-grid-face) + var(--spacing-2xs)
      + var(--task-grid-words-h)
  );
  height: auto;
  padding-block: var(--spacing-sm);
  vertical-align: top;
}

/* A row whose seats carry badge words saves room for one or two lines of them
   (data-grid-labels, task_layout._label_lines), and the gap under them. */
.opportunities-task-grid__row[data-grid-labels="1"] > .opportunities-task-grid__cell {
  --task-grid-labels-h: calc(var(--task-grid-label-h) + var(--spacing-2xs));
}
.opportunities-task-grid__row[data-grid-labels="2"] > .opportunities-task-grid__cell {
  --task-grid-labels-h: calc(
    var(--task-grid-label-h) + var(--task-grid-label-h) + var(--spacing-2xs)
  );
}

/* A word longer than one line of a seat takes two (data-grid-long-labels,
   task_layout._long_labels), so the row saves two lines for each word, and
   the faces of the row stay level (Nick 11-09). */
.opportunities-task-grid__row[data-grid-long-labels] > .opportunities-task-grid__cell {
  --task-grid-label-h: calc(
    (var(--font-size-2xs) + var(--font-size-2xs)) * var(--line-height-heading)
  );
}
.opportunities-task-grid__row[data-grid-long-labels] .opportunities-task-grid__label {
  -webkit-line-clamp: 2;
}

/* A planned person who marked the day unavailable shows the mark on its own
   line under the chip (data-grid-marks, task_layout._marks), so the row
   saves that line and the gap over it. */
.opportunities-task-grid__row[data-grid-marks] > .opportunities-task-grid__cell {
  --task-grid-marks-h: calc(var(--spacing-2xs) + var(--task-grid-chip-h));
}

/* A cell's seats, two to a line (Nick 11-09, pairs for everyone). Every line
   shows: there is no inside scroll, no snap and no fade (Nick's pick
   2026-11-09: a full cell shows everyone; it replaces the 11-05 scroll). */
.opportunities-task-grid__seats {
  /* The gap between the two seats of a line. A badge word may use half of it
     on a phone. */
  --task-grid-seat-gap: var(--spacing-sm);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  row-gap: var(--spacing-sm);
  column-gap: var(--task-grid-seat-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* One seat: its badge words, a person's face, then their name with the seat's
   chips under it, or an open seat's door, stacked and centred. Every line is
   the same height, so the faces of a row line up. No line divides the seats;
   the gaps do. */
.opportunities-task-grid__seat {
  position: relative;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-start;
  gap: var(--spacing-2xs);
  min-width: 0;
  height: var(--task-grid-line-h);
  padding-inline: var(--spacing-xs);
  border-radius: var(--radius-sm);
}

/* A lone last seat sits in the middle of its line, as wide as one of a pair. */
.opportunities-task-grid__seat:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  justify-self: center;
  width: calc((100% - var(--task-grid-seat-gap)) / 2);
}

/* The badge words over the face (_task_grid_labels.html): the house small caps
   in the one badge grey (ADR-125 amendment 7), with no box around them. The
   words sit on the face and grow upward, so a seat with one word lines up with
   a seat that has two, and a short word with a long one. */
.opportunities-task-grid__labels {
  display: flex;
  flex: none;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  height: calc(var(--task-grid-labels-h) - var(--spacing-2xs));
}

/* A word takes the lines its row saves, then ends in "...". While it is cut,
   its full name shows in the house bubble (data-tooltip-if-cut), so it sits
   above the seat's drawer door to take the pointer. The grid cell does not
   wrap its words (global-grid__cell), so the word turns wrap back on. It
   wraps only between its words, never inside one (Nick 11-09). */
.opportunities-task-grid__label {
  position: relative;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: normal;
  white-space: normal;
  color: var(--badge-fg);
  line-height: var(--line-height-heading);
  text-align: center;
}

/* When one of its words is wider than the seat, the word shows on one line
   and ends in "..." (task-grid-cell-scroll.js marks it), and the house bubble
   shows its full name on hover. */
.opportunities-task-grid__label[data-label-one-line] {
  display: block;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* "+N" carries the other badge names in its tooltip, so it sits above the
   seat's drawer door to take the pointer on a phone too. */
.opportunities-task-grid__label--more {
  position: relative;
}

.opportunities-task-grid__who {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-2xs);
  min-width: 0;
  max-width: 100%;
  line-height: var(--line-height-heading);
  text-align: center;
}

/* The chip, then the Unavailable mark on its own line under it, both inside
   the seat (Nick 11-09). */
.opportunities-task-grid__tags {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-2xs);
  max-width: 100%;
  white-space: nowrap;
}

/* A seat's door to its drawer (_task_seat_drawer.html): a clear button laid
   behind a grid cell's line or a list row's Job cell, the roster card's own
   pattern. The links and an open seat's split button come after it and are
   positioned, so they paint above it by source order, with no z-index; the
   rest of the line is the door. The line itself takes the pressed tint while
   the door is under the pointer or holds the focus, one step darker than the
   row's own hover grey (--color-action-tint, object-grid.css) so it reads apart
   from its row, and sits under the words rather than over them (Nick 2026-11-05). */
.opportunities-task-seat-drawer {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
}
.opportunities-task-grid__seat:has(> .opportunities-task-seat-drawer:hover, > .opportunities-task-seat-drawer:focus-visible),
.opportunities-task-view__job:has(> .opportunities-task-seat-drawer:hover, > .opportunities-task-seat-drawer:focus-visible) {
  background: var(--color-action-tint-pressed);
}
.opportunities-task-seat-drawer:focus-visible {
  outline: 2px solid var(--color-action);
  outline-offset: -2px;
}
.opportunities-task-grid__seat a,
.opportunities-task-grid__seat .opportunities-task-door,
.opportunities-task-view__job a {
  position: relative;
}

/* The full name wraps to two lines at most, with no underline until hover
   (Nick 2026-11-09, pick B). */
.opportunities-task-grid__person {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  max-width: 100%;
  overflow: hidden;
  color: var(--color-text);
  line-height: var(--line-height-heading);
  text-decoration: none;
  white-space: normal;
}

.opportunities-task-grid__person:hover,
.opportunities-task-grid__person:focus-visible {
  text-decoration: underline;
}

.opportunities-task-grid__open {
  color: var(--color-text-muted);
  font-style: italic;
}

/* An open seat's door (_task_seat_door.html): the Sign Up board's own control,
   its look from signup-groups.css, sized to its content in a grid cell or a
   list row. Its menu floats over the list (seat-door-menu.js). */
.opportunities-task-door {
  display: inline-flex;
  align-items: center;
}

/* The phone's first name is in the markup once; a computer shows the full name. */
.opportunities-task-grid__first-name {
  display: none;
}

/* The face ring gives the status on both screens (Nick 2026-11-09, pick B).
   Each ring is the colour of the badge for that status (badge.css): Confirmed and Invited take the badge's text colour. Planned
   and Declined share the neutral badge, so Planned takes its text grey and
   Declined its background grey. */
.opportunities-task-grid__face {
  border: var(--task-grid-ring-width) solid var(--color-grey-700);
}

.opportunities-task-grid__face[data-ring="confirmed"] {
  border-color: var(--color-success);
}

.opportunities-task-grid__face[data-ring="invited"] {
  border-color: var(--color-info);
}

.opportunities-task-grid__face[data-ring="declined"] {
  border-color: var(--color-grey-200);
}

/* The ring says the status, so the status chip goes on both screens. The
   Unavailable mark stays (Nick 2026-11-09, pick B). */
.opportunities-task-grid__tags > :not(.opportunities-task-grid__mark) {
  display: none;
}

/* The ring key sits under the table inside the scroll box on both screens.
   It sticks to the left edge, so it stays in view as the dates scroll sideways. */
.opportunities-task-grid__key {
  position: sticky;
  left: 0;
  display: flex;
  flex-wrap: nowrap;
  gap: var(--spacing-sm);
  margin: 0;
  padding: var(--spacing-xs) 0 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  list-style: none;
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

.opportunities-task-grid__key-item {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--spacing-2xs);
  white-space: nowrap;
}

.opportunities-task-grid__key-ring {
  width: var(--spacing-smd);
  height: var(--spacing-smd);
  border: 2px solid var(--color-grey-700);
  border-radius: var(--radius-pill);
}

.opportunities-task-grid__key-item[data-ring="confirmed"] .opportunities-task-grid__key-ring {
  border-color: var(--color-success);
}

.opportunities-task-grid__key-item[data-ring="invited"] .opportunities-task-grid__key-ring {
  border-color: var(--color-info);
}

.opportunities-task-grid__key-item[data-ring="declined"] .opportunities-task-grid__key-ring {
  border-color: var(--color-grey-200);
}

/* The seat mark of a planned person who marked that day unavailable (Nick
   11-07, pick 2), with the reason in its tooltip. Its padding, gap and letter
   spacing are a step tighter than the chip's, so UNAVAILABLE fits one line of
   a computer seat (95 px of 96, measured in Chromium, 2026-11-09). */
.opportunities-task-grid__mark {
  gap: var(--spacing-2xs);
  padding-inline: var(--spacing-xs);
  letter-spacing: var(--letter-spacing-body);
  white-space: nowrap;
}

/* An open seat with a badge, for a reader with no door to it: a still dashed
   circle the size of a face, under the word, with no plus (Nick 11-09). */
.opportunities-task-grid__open-circle {
  flex: none;
  width: var(--task-grid-face);
  height: var(--task-grid-face);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-pill);
}

/* The grid on a phone (Nick 11-07, pick 1, option B) keeps the computer's
   shape: the role column fixed on the left, the date row on top scrolling
   sideways with the cells. Each seat is the face inside a ring whose colour
   gives the status, with the first name under it. People sit two to a line,
   so two whole dates and a small peek of the third fit on one screen (Nick's
   pick 2026-11-09, pairs for everyone). The key under the grid names the four colours. The shared grid
   lets its frozen column go on a phone (object-grid.css); this grid keeps it,
   since the roles are what the dates are read against. */
@media (max-width: 767.98px) {
  /* The role column and each date column as a share of the screen: the roles
     take about a fifth, and two whole dates and a small peek of the third fit
     beside them on a 430 px phone (Nick's pick 2026-11-09). A date holds two
     seats. A line is the face (one 2xl step) with the first name under it; the
     row grows to show every line, as on the computer. */
  .opportunities-task-grid {
    --task-grid-phone-role-w: 21vw;
    --task-grid-phone-seat-w: calc(var(--spacing-2xl) + var(--spacing-md));
    --task-grid-phone-date-w: calc(
      var(--task-grid-phone-seat-w) + var(--task-grid-phone-seat-w) + var(--spacing-sm)
        + var(--spacing-xs)
    );
  }

  .opportunities-task-grid .global-grid__head--pinned,
  .opportunities-task-grid .global-grid__cell--pinned {
    position: sticky;
    left: 0;
    width: var(--task-grid-phone-role-w);
    max-width: var(--task-grid-phone-role-w);
    padding-inline: var(--spacing-xs);
    white-space: normal;
  }

  .opportunities-task-grid .global-grid__head--edge,
  .opportunities-task-grid .global-grid__cell--edge {
    border-right: 1px solid var(--color-border-subtle);
  }

  .opportunities-task-grid__booking {
    width: var(--task-grid-phone-date-w);
    min-width: var(--task-grid-phone-date-w);
    max-width: var(--task-grid-phone-date-w);
    padding-inline: var(--spacing-2xs);
    font-size: var(--font-size-xs);
    white-space: normal;
  }

  /* A narrow head shows the name and the date alone; the small caps labels
     above each would run past the column. */
  .opportunities-task-grid__heading .global-grid__group-label {
    display: none;
  }

  /* Under the face a phone shows the first name alone. A badge word can take
     two lines in a seat this narrow (WORSHIP / LEADER), so each word saves
     room for two. */
  .opportunities-task-grid__cell {
    --task-grid-label-h: calc(
      (var(--font-size-2xs) + var(--font-size-2xs)) * var(--line-height-heading)
    );
    --task-grid-words-h: calc(var(--font-size-xs) * var(--line-height-heading));
    padding-inline: 0;
  }

  .opportunities-task-grid__seat {
    padding-inline: 0;
  }

  /* The list takes the cell's 2xs side padding as its own, a quarter of the
     gap. So a badge word at its edge stays inside the cell, and the seats keep
     their width. */
  .opportunities-task-grid__seats {
    padding-inline: var(--spacing-2xs);
  }

  /* Phone text stays at 12px, so a word drops the letter spacing and uses
     the seat's width plus half the gap (Nick 11-09). A phone has no hover, so
     a word stays under the drawer door, and a tap on it opens the seat. */
  .opportunities-task-grid__label {
    -webkit-line-clamp: 2;
    width: calc(100% + var(--task-grid-seat-gap) / 2);
    max-width: none;
    letter-spacing: normal;
  }

  .opportunities-task-grid__label:not(.opportunities-task-grid__label--more) {
    position: static;
  }

  /* Sign Up in a seat this narrow: the phone's 12px words, the padding a step
     tighter, and the face's height, so the word fits inside its seat. */
  .opportunities-task-grid__seat .assignments-role-btn {
    max-width: 100%;
    min-height: var(--task-grid-face);
    padding-inline: var(--spacing-2xs);
    font-size: var(--font-size-xs);
    white-space: normal;
  }

  /* A phone face is a step smaller than the computer face. */
  .opportunities-task-grid__face {
    width: var(--spacing-2xl);
    height: var(--spacing-2xl);
    font-size: var(--font-size-xs);
  }

  /* The name block folds away: the full name hides and the mark sits on the
     seat's corner, so the first name stands right under the face. */
  .opportunities-task-grid__who {
    display: contents;
  }

  .opportunities-task-grid__person {
    display: none;
  }

  .opportunities-task-grid__first-name {
    display: block;
    max-width: 100%;
    overflow: hidden;
    font-size: var(--font-size-xs);
    line-height: var(--line-height-heading);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* The ring says the status, so the chip goes. The mark stays as its icon
     alone, on the corner by the face, under any badge words; a tap still shows
     the reason. */
  .opportunities-task-grid__tags {
    position: absolute;
    top: var(--task-grid-labels-h, 0px);
    right: 0;
  }

  .opportunities-task-grid__mark-word {
    display: none;
  }

  .opportunities-task-grid__mark {
    padding: var(--spacing-2xs);
  }

}

.global-phone-head-pin {
  display: none;
}

@media (max-width: 767.98px) {
  :root {
    --task-phone-bar-h: calc(var(--safe-top) + var(--control-h-touch));
  }

  :root.is-scrolled:has(.global-phone-bar):has(.opportunities-task-list) .global-app-header {
    background: var(--color-card-bg);
  }

  :root:has(.global-phone-bar):has(.opportunities-task-list) .global-app-header__title {
    font-size: var(--font-size-md);
  }

  :root:has(.global-phone-bar) .global-app-main:has(.opportunities-task-list),
  :root .global-app-main:has(.opportunities-task-list) {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  :root:has(.global-phone-bar) .global-app-main:has(.opportunities-task-list) .global-app-content,
  :root .global-app-main:has(.opportunities-task-list) .global-app-content {
    padding-bottom: calc(var(--bottom-bar-h) + var(--page-gutter));
  }

  .global-phone-head-pin {
    position: sticky;
    top: var(--task-phone-bar-h);
    z-index: var(--z-sticky);
    display: block;
    margin-inline: var(--page-gutter-bleed);
    padding: var(--spacing-xs) var(--page-gutter) var(--spacing-sm);
    background: var(--color-page-bg);
  }

  .global-phone-head__chips {
    margin-inline: var(--page-gutter-bleed);
  }

  .global-phone-head__chips .global-toolbar__chips {
    display: flex;
    flex-wrap: nowrap;
    margin-top: var(--spacing-sm);
    padding-inline: var(--page-gutter);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .global-phone-head__chips :is(.global-toolbar__chip, .global-toolbar__adv, .global-toolbar__menu-wrap) {
    flex: 0 0 auto;
    min-height: var(--control-h-touch);
    white-space: nowrap;
  }

  .global-phone-head__chips .global-toolbar__chip--round {
    min-width: var(--control-h-touch);
    justify-content: center;
  }

  .opportunities-task-list {
    padding: 0;
    border: 0;
    background: transparent;
  }

  .opportunities-task-list .global-grid-wrap {
    display: block;
    max-height: none;
    overflow: visible;
    isolation: auto;
  }

  .opportunities-task-list .global-edge-fade::after {
    display: none;
  }

  .opportunities-task-list .global-stack-table {
    min-width: 0;
    background: transparent;
  }

  .opportunities-task-list .global-stack-table > tbody > tr.global-grid__row {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--spacing-sm);
    align-items: start;
    margin-bottom: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-md) var(--spacing-smd);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    background: var(--color-card-bg);
  }

  .opportunities-task-list .global-stack-table > tbody > tr > td.global-grid__cell {
    position: static;
    z-index: auto;
    width: auto;
    min-width: 0;
    max-width: none;
    height: auto;
    padding: var(--spacing-xs) 0;
    border: 0;
    background: transparent;
    white-space: normal;
    text-align: left;
  }

  .opportunities-task-list .global-stack-table > tbody > tr > td.opportunities-task-view__tick {
    position: absolute;
    inset: var(--spacing-2xs) var(--spacing-2xs) auto auto;
    z-index: var(--z-raised);
    display: flex;
    justify-content: flex-end;
    padding: 0;
    pointer-events: none;
  }

  .opportunities-task-list .opportunities-task-tick {
    position: relative;
    width: var(--control-h-touch);
    height: var(--control-h-touch);
    border: 0;
    background: transparent;
    pointer-events: auto;
  }

  .opportunities-task-list .opportunities-task-tick::before {
    position: absolute;
    inset: var(--spacing-smd);
    border: 1px solid var(--color-text-secondary);
    border-radius: var(--radius-pill);
    content: "";
  }

  .opportunities-task-list .opportunities-task-tick:is(:active, :focus-visible)::before {
    border-color: var(--color-action);
    background: var(--color-action);
  }

  .opportunities-task-list .opportunities-task-tick i {
    position: relative;
  }

  .opportunities-task-list .global-stack-table > tbody > tr > td[data-label] {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
  }

  .opportunities-task-list .global-stack-table > tbody > tr > td[data-label]::before {
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
  }

  .opportunities-task-list .global-stack-table > tbody > tr > td[data-rk="role"] {
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: var(--control-h-touch);
  }

  .opportunities-task-list .global-stack-table > tbody > tr > td[data-rk="role"]::before {
    content: none;
  }

  .opportunities-task-list .global-stack-table > tbody > tr:has(.opportunities-task-tick) > td[data-rk="role"],
  .opportunities-task-list .global-stack-table > tbody > tr:has(.opportunities-task-tick):not(:has(td[data-rk="role"])) > td[data-label]:nth-child(2) {
    padding-right: var(--control-h-touch);
  }

  .opportunities-task-list .opportunities-task-view__job {
    position: static;
    align-items: flex-start;
    min-width: 0;
  }

  .opportunities-task-list .opportunities-task-view__job > .opportunities-task-view__booking {
    order: -1;
    color: var(--color-text);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-heading);
  }

  .opportunities-task-list .opportunities-task-view__job:not(:has(.opportunities-task-view__booking)) > .global-label-caps {
    color: var(--color-text);
  }

  /* One link opens the card. The other controls sit above that link. */
  .opportunities-task-list .opportunities-task-view__job > a:first-of-type {
    position: static;
  }

  .opportunities-task-list .opportunities-task-view__job > a:not(:focus-visible) {
    text-decoration: none;
  }

  .opportunities-task-list .opportunities-task-view__job > a:first-of-type::after {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-card);
    content: "";
  }

  .opportunities-task-list .opportunities-task-view__job > a:not(:first-of-type),
  .opportunities-task-list td:not([data-rk="role"]) :is(a, button, form) {
    position: relative;
    z-index: var(--z-raised);
  }

  .opportunities-task-list .global-grid__link,
  .opportunities-task-list .global-grid__value,
  .opportunities-task-list .global-label-caps,
  .opportunities-task-list .global-person-chip__name {
    max-width: 100%;
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
  }

  .opportunities-task-list .global-stack-table > tbody > tr > td:is([data-rk="person"], [data-rk="details"]) {
    grid-column: 1 / -1;
  }

  .opportunities-task-list .opportunities-task-view__details {
    max-height: none;
    overflow: visible;
  }

  .opportunities-task-list .opportunities-task-view__pair {
    flex-wrap: wrap;
    max-width: 100%;
    white-space: normal;
  }

  .opportunities-task-list .opportunities-task-view__details :is(dt, dd) {
    min-width: 0;
    overflow: visible;
    overflow-wrap: anywhere;
  }

  .opportunities-task-list :is(.opportunities-milestone-delivcell, .opportunities-milestone-who, .opportunities-milestone-stamp) {
    flex-wrap: wrap;
    max-width: 100%;
    min-width: 0;
  }

  .opportunities-task-list :is(.opportunities-milestone-open, .global-person-chip a) {
    display: inline-flex;
    align-items: center;
    min-width: var(--control-h-touch);
    min-height: var(--control-h-touch);
  }

  .opportunities-task-list .global-stack-table > tbody > tr > td[data-tone]:not(:has(> .global-grid__value)) {
    background: var(--grid-tone-bg);
  }

  .opportunities-task-list .global-stack-table > tbody > tr > td[data-tone] > .global-grid__value {
    align-self: flex-start;
    padding: 0 var(--spacing-xsm);
    border-radius: var(--radius-pill);
    background: var(--grid-tone-bg);
    color: var(--grid-tone-text);
    font-weight: var(--font-weight-medium);
  }

  .opportunities-task-list .global-stack-table > tbody > tr > td.opportunities-task-view__quick {
    position: relative;
    z-index: var(--z-raised);
    grid-column: 1 / -1;
    padding: var(--spacing-sm) 0 0;
  }

  .opportunities-task-list .global-stack-table > tbody > tr > td.opportunities-task-view__quick:not(:has(button, a)) {
    display: none;
  }

  .opportunities-task-list .opportunities-task-view__quick :is(.opportunities-task-door, form, .opportunities-task-row__group-text-off) {
    display: flex;
    width: 100%;
  }

  .opportunities-task-list .opportunities-task-view__quick :is(.btn, .assignments-role-btn) {
    width: 100%;
    min-height: var(--control-h-touch);
    justify-content: center;
  }

  .opportunities-task-list .global-stack-table > tbody > tr.global-grid__group {
    position: sticky;
    top: calc(var(--task-phone-bar-h) + var(--phone-head-pin-h, var(--control-h-touch)));
    z-index: var(--z-under-sticky);
    margin: var(--spacing-sm) var(--page-gutter-bleed) var(--spacing-xs);
    padding: var(--spacing-xs) var(--page-gutter);
    border: 0;
    background: var(--color-page-bg);
  }

  .opportunities-task-list .global-grid__group-cell {
    padding: 0;
    background: transparent;
  }

  .opportunities-task-list .global-grid__group-inner {
    position: static;
    display: flex;
    padding: 0;
  }

  :root:has(.opportunities-task-list) .tasks-bar[data-holds-phone-bar] {
    left: auto;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  :root:has(.opportunities-task-list) .tasks-bar[data-holds-phone-bar] .tasks-bar__go {
    min-height: var(--control-h-touch);
    border-color: var(--color-surface-inverse);
    background: var(--color-surface-inverse);
    color: var(--color-neutral-ink-fg);
    box-shadow: var(--shadow-lg);
  }

  :root:has(.tasks-bar[data-holds-phone-bar]:not([hidden])) .opportunities-task-list {
    padding-bottom: calc(var(--control-h-touch) + var(--spacing-md));
  }
}

/*
 * Lineup — the org Scheduling tab (app/scheduling/_lineup.html).
 *
 * One page, one list. Laptop (≥ 992px): three platform cards
 * (components/card.css) on the page ground — a 280px column with the month
 * card and the rows card, and the day card on the right. Phone: the month
 * folds under its header into a week strip, and the rows card and the day
 * card take turns. Find a day and Find people stay dark until they are built
 * for real (Nick, 2026-09-11): their blocks keep their rules here, no switch
 * reaches them.
 *
 * A row: date block, name, the time behind a clock, the faces of the people
 * In as the platform's stacked person chip (components/person-chip.css),
 * one pill. Faces in the day pane are coloured discs with initials —
 * ten hues keyed by the person, a corner badge for In / Invited / Signed up
 * / could join / Declined, a dashed disc for an Open spot, and two short
 * name lines under. The drawers are the shared overlay drawer
 * (components/drawer.css); this sheet only lays out their bodies.
 *
 * Tokens only (tokens.css). The month arrows are the platform icon button,
 * the row pill the platform badge, every small caps line the platform caps
 * label; this sheet adds only colour and box. The month grid reuses
 * components/availability-calendar.css; the size overrides sit here.
 */

.scheduling-lineup {
    --lineup-face: 36px;
    --lineup-face-initials: var(--font-size-xs);
    --lineup-badge: var(--badge-size-sm);
    --lineup-badge-glyph: calc(var(--lineup-badge) * 0.6);
    --lineup-bar: 3px;
    --lineup-column: 280px;
    position: relative;
    color: var(--color-text);
}

.scheduling-lineup [x-cloak] { display: none !important; }

.scheduling-lineup__error {
    margin: 0 0 var(--spacing-sm);
    color: var(--color-error-text);
    font-size: var(--font-size-sm);
}

/* ── The panes ───────────────────────────────────────────────────── */

.scheduling-lineup__panes {
    display: grid;
    grid-template-columns: var(--lineup-column) minmax(0, 1fr);
    gap: var(--spacing-md);
    align-items: start;
}

.scheduling-lineup__list,
.scheduling-lineup__day {
    min-width: 0;
}

/* ── The month card ──────────────────────────────────────────────── */

.scheduling-lineup__month-card {
    padding: var(--spacing-smd);
    margin-bottom: var(--spacing-md);
}

/* The month header: arrows either side of the name. */
.scheduling-lineup__mh {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
}

.scheduling-lineup__mh-label {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xsm);
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 0;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-text);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-heading);
    cursor: pointer;
}

.scheduling-lineup__mh-caret {
    display: none;
    font-size: var(--font-size-2xs);
    transition: transform var(--transition-fast);
}

.scheduling-lineup.is-month-open .scheduling-lineup__mh-caret { transform: rotate(180deg); }

/* ── The week strip (phone only) ─────────────────────────────────── */

.scheduling-lineup__week {
    display: none;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: var(--spacing-xs);
}

.scheduling-lineup__wday {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: var(--spacing-xsm) 0 var(--spacing-xs);
    border: 1px solid var(--color-border-hairline);
    border-radius: var(--radius-md);
    background: var(--color-card-bg);
    color: var(--color-text);
    cursor: pointer;
}

.scheduling-lineup__wday > span:first-child {
    color: var(--color-text-secondary);
}

.scheduling-lineup__wday > b {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-heading);
    line-height: 1.2;
}

.scheduling-lineup__wday.is-today { border-color: var(--color-action); }

.scheduling-lineup__wday.is-selected {
    background: var(--color-action);
    border-color: var(--color-action);
    color: var(--color-neutral-ink-fg);
}

.scheduling-lineup__wday.is-selected > span:first-child { color: inherit; }

/* ── The month grid ──────────────────────────────────────────────── */

.scheduling-lineup__grid { gap: var(--spacing-2xs); }

.scheduling-lineup__grid .calendar-avail-dow {
    padding: 0 0 var(--spacing-xs);
    color: var(--color-text-secondary);
    letter-spacing: 0;
}

.scheduling-lineup__cell.calendar-avail-cell {
    flex-direction: column;
    justify-content: flex-start;
    gap: var(--spacing-2xs);
    padding: var(--spacing-xs) 0 0;
    font-size: var(--font-size-sm);
    border-radius: var(--radius-sm);
}

.scheduling-lineup__cell.calendar-avail-cell > span:first-child { line-height: 1.2; }

/* The shared sheet marks today with a dot; the dots here mean bookings. */
.scheduling-lineup__cell.calendar-avail-cell.is-today::after { content: none; }

.scheduling-lineup__cell.calendar-avail-cell.is-today {
    box-shadow: var(--shadow-inset-ring-strong);
}

/* One dot per booking: amber while it still needs you, green once filled.
   The dots step down from the status-dot component's small rung so three
   of them fit under a day number. */
.scheduling-lineup__dots {
    display: inline-flex;
    gap: var(--spacing-2xs);
    min-height: var(--spacing-xsm);
}

.scheduling-lineup__dot {
    width: var(--spacing-xsm);
    height: var(--spacing-xsm);
    border-radius: var(--radius-pill);
    background: var(--color-text-muted);
}

.scheduling-lineup__dot--need { background: var(--color-warning); }
.scheduling-lineup__dot--full { background: var(--color-success); }

.scheduling-lineup__cell.is-selected .scheduling-lineup__dot,
.scheduling-lineup__wday.is-selected .scheduling-lineup__dot { background: currentColor; }

.scheduling-lineup__week .scheduling-lineup__dots { min-height: var(--spacing-sm); }
.scheduling-lineup__week .scheduling-lineup__dot { width: var(--spacing-sm); height: var(--spacing-sm); }

/* ── The rows card ───────────────────────────────────────────────── */

.scheduling-lineup__rows {
    padding: var(--spacing-xs) 0;
    overflow: hidden;
}

.scheduling-lineup__rows > .global-empty-state { margin: var(--spacing-sm) var(--spacing-smd); }

.scheduling-lineup__eyebrow {
    margin: 0;
    padding: var(--spacing-sm) var(--spacing-smd) var(--spacing-xs);
    color: var(--color-text-secondary);
}

/* A row: a line in the rows card, a hairline above, a 3px marker on the
   left (red while the booking needs you, action ink while it is open). */
.scheduling-lineup-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-smd);
    border: 0;
    border-top: 1px solid var(--color-border-hairline);
    background: transparent;
    color: var(--color-text);
    text-align: left;
    cursor: pointer;
}

.scheduling-lineup-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--lineup-bar);
    background: transparent;
}

.scheduling-lineup-card:hover { background: var(--color-surface-subtle); }

.scheduling-lineup-card.is-red::before { background: var(--color-error); }

.scheduling-lineup-card.is-selected { background: var(--color-action-tint); }
.scheduling-lineup-card.is-selected::before { background: var(--color-action); }

.scheduling-lineup-card:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: -2px;
}

.scheduling-lineup-card__date {
    flex: 0 0 var(--spacing-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

.scheduling-lineup-card__date > b {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-heading);
}

.scheduling-lineup-card__date > span { color: var(--color-text-secondary); }

.scheduling-lineup-card__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
}

.scheduling-lineup-card__title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The time behind a clock, digits lined up. */
.scheduling-lineup-card__meta {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-xs);
    font-variant-numeric: tabular-nums;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scheduling-lineup-card__meta > i { color: var(--color-text-muted); }

/* The faces of the people In: the platform's stacked person chip as is;
   only the initials' ink is set here, the hue class paints the disc. A
   full workers wrap to a second line instead of running into the pill. */
.scheduling-lineup-card__faces {
    margin-top: var(--spacing-2xs);
    flex-wrap: wrap;
    row-gap: var(--spacing-2xs);
}

.scheduling-lineup-card__faces > .global-avatar {
    font-weight: var(--font-weight-medium);
    object-fit: cover;
}

/* The pill is the platform badge; this rule is box only. pillClass() also
   adds a page tone (--need, --wait, --full, --plan, --approve): only
   --approve has a rule, the rest are hooks for the tests and for later. */
.scheduling-lineup-card__pill { flex: 0 0 auto; white-space: nowrap; }

/* "1 to approve" is the one pill in the action colour, not a badge tone:
   it is the row that wants a tap from you (round-7 ruling). */
.scheduling-lineup-card__pill.scheduling-lineup-card__pill--approve {
    background: var(--color-action-tint);
    color: var(--color-action);
}

.scheduling-lineup-card__chev { display: none; }

/* ── The day card ────────────────────────────────────────────────── */

.scheduling-lineup__day-bar {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-smd) var(--spacing-md);
}

.scheduling-lineup__day-body { padding: var(--spacing-md); }

.scheduling-lineup__back {
    display: none;
    padding: 0;
    font-size: var(--font-size-sm);
    text-decoration: none;
}

.scheduling-lineup__day-title {
    margin: 0;
    font-size: var(--font-size-h4);
    font-weight: var(--font-weight-heading);
    line-height: var(--line-height-subheading);
}

.scheduling-lineup__search { margin-bottom: var(--spacing-md); max-width: 360px; }

/* Find a day's form: a subtle band inside the day card. */
.scheduling-lineup__plan {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--spacing-sm);
    padding: var(--spacing-smd);
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--color-border-hairline);
    border-radius: var(--radius-md);
    background: var(--color-surface-subtle);
}

.scheduling-lineup__plan-field {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xs);
    font-size: var(--font-size-2xs);
    font-weight: var(--font-weight-heading);
    color: var(--color-text-secondary);
}

.scheduling-lineup__hint {
    margin: 0 0 var(--spacing-sm);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

/* One booking after another inside the day card, a line between. */
.scheduling-lineup-booking + .scheduling-lineup-booking {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border-hairline);
}

.scheduling-lineup-booking__title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-heading);
    line-height: var(--line-height-subheading);
}

.scheduling-lineup-booking__confirm {
    margin-bottom: var(--spacing-md);
}

.scheduling-lineup-booking__tag {
    padding: var(--spacing-2xs) var(--spacing-sm);
    border-radius: var(--radius-pill);
    background: var(--color-action-tint);
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-heading);
}

/* Day · time · place, each behind its icon. */
.scheduling-lineup-booking__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs) var(--spacing-md);
    margin: var(--spacing-xs) 0 var(--spacing-smd);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    font-variant-numeric: tabular-nums;
}

.scheduling-lineup-booking__bit {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.scheduling-lineup-booking__bit > i { color: var(--color-text-muted); }

/* A part is one line: the role, its people, then who else could. A Sunday reads on one screen. */
.scheduling-lineup-part {
    padding-block: var(--spacing-xs);
}
.scheduling-lineup-part + .scheduling-lineup-part {
    border-top: 1px solid var(--color-border-hairline);
}
@media (min-width: 768px) {
    .scheduling-lineup-part {
        display: grid;
        grid-template-columns: 10.5rem minmax(0, 1fr) auto;
        column-gap: var(--spacing-md);
        align-items: center;
    }
    .scheduling-lineup-part > .scheduling-lineup-part__head {
        gap: 0 var(--spacing-xs);
        margin: 0;
    }
    .scheduling-lineup-part__head > .scheduling-lineup-part__name { flex: 0 0 100%; }
    .scheduling-lineup-part__head > .scheduling-lineup-part__dot { display: none; }
    .scheduling-lineup-part__head > .scheduling-lineup-part__busy { margin-left: 0; }
    .scheduling-lineup-part > .scheduling-lineup-part__strip {
        flex-wrap: wrap;
        overflow: visible;
        padding: 0;
    }
    .scheduling-lineup-part > .scheduling-lineup-part__also {
        width: auto;
        margin-top: 0;
    }
}

.scheduling-lineup-part__head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-xsm);
    margin: 0 0 var(--spacing-sm);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-heading);
}

.scheduling-lineup-part__dot { color: var(--color-text-muted); }

.scheduling-lineup-part__word {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
}

.scheduling-lineup-part__word--need,
.scheduling-lineup-part__word--wait { color: var(--color-warning-text); }
.scheduling-lineup-part__word--approve { color: var(--color-action); }
.scheduling-lineup-part__word--full { color: var(--color-success-text); }

.scheduling-lineup-part__busy {
    margin-left: auto;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-body);
    color: var(--color-text-secondary);
}

/* One line that scrolls sideways — never wraps. */
.scheduling-lineup-part__strip {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--spacing-xs) var(--spacing-md);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    /* A scrolling box clips what pokes out of it; the inset keeps the
       focus ring on a face inside the box. */
    padding: var(--spacing-xs) var(--spacing-xs) var(--spacing-xs) 0;
}


/* The part's name opens the part drawer: everyone for this part. */
.scheduling-lineup-part__name {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2xs);
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.scheduling-lineup-part__name:disabled { cursor: default; }
.scheduling-lineup-part__name > i { font-size: var(--font-size-2xs); color: var(--color-text-muted); }
.scheduling-lineup-part__name:not(:disabled):hover { color: var(--color-action); }
.scheduling-lineup-part__name:disabled > i { display: none; }

.scheduling-lineup-part__name:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Once no seat is open: the other qualified people as small plain faces
   under the part — only the names of who else could. The whole line opens
   the part drawer. */
.scheduling-lineup-part__also {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
    margin-top: var(--spacing-2xs);
    padding: var(--spacing-2xs) 0;
    border: 0;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    text-align: left;
    overflow: hidden;
    cursor: pointer;
}

.scheduling-lineup-part__also:disabled { cursor: default; }
.scheduling-lineup-part__also:not(:disabled):hover { color: var(--color-text); }

.scheduling-lineup-part__also:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 1px;
}

.scheduling-lineup-part__also-label { flex: none; }
.scheduling-lineup-part__also-chev { flex: none; margin-left: auto; font-size: var(--font-size-2xs); color: var(--color-text-muted); }
.scheduling-lineup-part__also:disabled .scheduling-lineup-part__also-chev { display: none; }

/* The faces overlap by 8px: each steps back by (xs − smd), the negative
   spelled from tokens so the sheet stays on the spacing scale. */
.scheduling-lineup-part__stack {
    display: flex;
    flex: none;
    align-items: center;
    padding-left: var(--spacing-sm);
}

.scheduling-lineup-part__stack > .scheduling-lineup-face__avatar--small {
    margin-left: calc(var(--spacing-xs) - var(--spacing-smd));
    border: 2px solid var(--color-card-bg);
}

.scheduling-lineup-part__cell {
    position: relative;
    display: flex;
    flex: none;
    align-items: center;
    gap: var(--spacing-xs);
}

/* The open spot is its own door: the round plus, the size of the face that lands on it
   (components/seat.css keeps the ring's words). */
.scheduling-lineup-face--open .scheduling-lineup-face__avatar--open {
    border: 1.5px dashed var(--color-text-secondary);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}
.scheduling-lineup-face--open:not(:disabled):hover { background: transparent; }
.scheduling-lineup-face--open:not(:disabled):hover .scheduling-lineup-face__avatar--open {
    border-style: solid;
    border-color: var(--color-neutral-ink);
    background: var(--color-neutral-ink);
    color: var(--color-neutral-ink-fg);
}

/* A candidate's own plus: the corner of the face, its own button (busyface C). */
.scheduling-lineup-face__plus {
    position: absolute;
    top: calc(50% + var(--lineup-face) / 2 - var(--lineup-badge) + var(--spacing-2xs));
    left: calc(var(--spacing-2xs) + var(--lineup-face) - var(--lineup-badge) + var(--spacing-2xs));
    width: var(--lineup-badge);
    height: var(--lineup-badge);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: var(--spacing-2xs) solid var(--color-card-bg);
    border-radius: var(--radius-pill);
    background: var(--color-action);
    color: var(--color-neutral-ink-fg);
    font-size: var(--lineup-badge-glyph);
    cursor: pointer;
}
.scheduling-lineup-face__plus--busy { background: var(--color-text-muted); }
.scheduling-lineup-face__plus:hover { background: var(--color-neutral-ink); }
.scheduling-lineup-face__plus:focus-visible {
    outline: 2px solid var(--color-action);
    outline-offset: 1px;
}
/* A held seat's chip, beside the name, outside the face's button so its tooltip works. */
.scheduling-lineup-face__chip { display: flex; }

.scheduling-lineup-part__cell--divider {
    padding-left: var(--spacing-md);
}

.scheduling-lineup-part__cell--divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: var(--spacing-xs);
    bottom: var(--spacing-xs);
    width: 1px;
    background: var(--color-border-subtle);
}

/* ── A face ──────────────────────────────────────────────────────── */

.scheduling-lineup-face {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-2xs) var(--spacing-xs) var(--spacing-2xs) var(--spacing-2xs);
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
}

.scheduling-lineup-face:disabled { cursor: default; }

.scheduling-lineup-face:not(:disabled):hover { background: var(--color-action-tint); }

.scheduling-lineup-face:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 1px;
}

.scheduling-lineup-face--busy .scheduling-lineup-face__avatar,
.scheduling-lineup-face--declined .scheduling-lineup-face__avatar { opacity: 0.45; }

.scheduling-lineup-face--busy .scheduling-lineup-face__name,
.scheduling-lineup-face--declined .scheduling-lineup-face__name { color: var(--color-text-secondary); }

.scheduling-lineup-face__avatar {
    position: relative;
    width: var(--lineup-face);
    height: var(--lineup-face);
    flex: none;
    overflow: visible;
    font-size: var(--lineup-face-initials);
    letter-spacing: 0.02em;
}

.scheduling-lineup-face__avatar > img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-pill);
    object-fit: cover;
}

.scheduling-lineup-face__avatar--open {
    border: 2px dashed var(--color-border-subtle);
    background: transparent;
}

/* The 28px face: the small stack under a filled part and the rows of the
   part drawer. Sized on its own so a person-drawer or strip face never
   shrinks by mistake. */
.scheduling-lineup-face__avatar--small {
    --lineup-face: 28px;
    --lineup-face-initials: var(--font-size-2xs);
    flex: none;
}

.scheduling-lineup-face__avatar--faded { opacity: 0.45; }

.scheduling-lineup-face__badge {
    position: absolute;
    right: calc(-1 * var(--spacing-2xs));
    bottom: calc(-1 * var(--spacing-2xs));
    width: var(--lineup-badge);
    height: var(--lineup-badge);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: var(--spacing-2xs) solid var(--color-card-bg);
    border-radius: var(--radius-pill);
    color: var(--color-neutral-ink-fg);
    font-size: var(--lineup-badge-glyph);
}

.scheduling-lineup-face__badge--in { background: var(--color-success); }
.scheduling-lineup-face__badge--invited { background: var(--color-warning); }
.scheduling-lineup-face__badge--pending { background: var(--color-action); }
.scheduling-lineup-face__badge--plus { background: var(--color-action); }
.scheduling-lineup-face__badge--no { background: var(--color-text-muted); }

.scheduling-lineup-face__name {
    font-size: var(--font-size-sm);
    line-height: 1.25;
    white-space: nowrap;
}

.scheduling-lineup-face--open .scheduling-lineup-face__name { color: var(--color-text-secondary); }

.scheduling-lineup-face__state {
    font-size: var(--font-size-xs);
    line-height: 1.2;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

/* The word under a seated face reads in the badge's colour. */
.scheduling-lineup-face--in .scheduling-lineup-face__state { color: var(--color-success-text); }
.scheduling-lineup-face--invited .scheduling-lineup-face__state { color: var(--color-warning-text); }
.scheduling-lineup-face--pending .scheduling-lineup-face__state { color: var(--color-action); }

/* ── The part drawer body ────────────────────────────────────────── */

.scheduling-lineup-list__search { margin-bottom: var(--spacing-sm); }

.scheduling-lineup-list__h {
    margin: var(--spacing-sm) 0;
    color: var(--color-text-secondary);
}

/* The row's left half is the click into the person drawer. */
.scheduling-lineup-list__who {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.scheduling-lineup-list__who:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.scheduling-lineup-list__item:hover { background: var(--color-surface-subtle); }

/* A long button (Remove from Photographer) drops under the name on a phone
   instead of squeezing the name and the state word. */
.scheduling-lineup-list__item { flex-wrap: wrap; }
.scheduling-lineup-list__control { margin-left: auto; }

.scheduling-lineup-list__name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: var(--font-size-sm);
    line-height: 1.25;
}

/* The state word never shrinks; only a very long note is cut. */
.scheduling-lineup-list__state {
    flex: none;
    max-width: 40%;
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The state word wears the strip badge's colour: In green, Invited amber, Signed up action. */
.scheduling-lineup-list__state--in { color: var(--color-success-text); }
.scheduling-lineup-list__state--invited { color: var(--color-warning-text); }
.scheduling-lineup-list__state--pending { color: var(--color-action); }
.scheduling-lineup-list__item--faded .scheduling-lineup-list__name { color: var(--color-text-secondary); }

/* ── The person drawer body ──────────────────────────────────────── */

.scheduling-lineup-person__top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) 0 var(--spacing-md);
}

.scheduling-lineup-person__avatar {
    --lineup-face: 64px;
    --lineup-face-initials: var(--font-size-lg);
}

.scheduling-lineup-person__free {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.scheduling-lineup-person__act {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.scheduling-lineup-person__note {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    text-align: center;
}

.scheduling-lineup-person__h {
    margin: 0 0 var(--spacing-sm);
    color: var(--color-text-secondary);
}

.scheduling-lineup-person__skills {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    padding: 0;
    margin: 0 0 var(--spacing-lg);
    list-style: none;
}

.scheduling-lineup-person__props { margin: 0; }

.scheduling-lineup-person__prop {
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-sm);
    padding: var(--spacing-xsm) 0;
    border-bottom: 1px solid var(--color-border-hairline);
    font-size: var(--font-size-sm);
}

.scheduling-lineup-person__prop > dt { color: var(--color-text-secondary); font-weight: var(--font-weight-body); }
.scheduling-lineup-person__prop > dd { margin: 0; text-align: right; }

/* ── Phone ───────────────────────────────────────────────────────── */

@media (max-width: 991.98px) {
    .scheduling-lineup {
        --lineup-face: 64px;
        --lineup-badge: var(--spacing-lg); /* the corner badge grows with the bigger face */
    }

    .scheduling-lineup__panes {
        display: block;
    }

    /* The list and the day take turns. */
    .scheduling-lineup.is-day .scheduling-lineup__list { display: none; }
    .scheduling-lineup:not(.is-day) .scheduling-lineup__day { display: none; }

    .scheduling-lineup__mh { justify-content: space-between; margin-bottom: var(--spacing-sm); }
    .scheduling-lineup__mh-caret { display: inline-block; }
    .scheduling-lineup__week { display: grid; }

    .scheduling-lineup__month { display: none; margin-top: var(--spacing-smd); }
    .scheduling-lineup.is-month-open .scheduling-lineup__month { display: block; }
    .scheduling-lineup__grid { gap: var(--spacing-xs); }

    .scheduling-lineup-card { padding: var(--spacing-smd); }
    .scheduling-lineup-card__date { flex-basis: var(--spacing-2xl); }
    .scheduling-lineup-card__date > b { font-size: var(--font-size-h3); }
    .scheduling-lineup-card__title { font-size: var(--font-size-md); }
    .scheduling-lineup-card__meta { font-size: var(--font-size-sm); }
    .scheduling-lineup-card__chev { display: inline-block; color: var(--color-text-muted); font-size: var(--font-size-xs); }

    .scheduling-lineup__back { display: inline-flex; align-items: center; gap: var(--spacing-2xs); }
    .scheduling-lineup__day-bar { flex-direction: column; align-items: flex-start; gap: var(--spacing-2xs); }
    .scheduling-lineup__day-body { padding: var(--spacing-smd); }

    .scheduling-lineup-face__name { font-size: var(--font-size-sm); }
}

@media (max-width: 767.98px) {
    .scheduling-lineup__mh-label {
        min-height: var(--control-h-touch);
    }
}

/*
 * Scheduling — the planners' page (app/scheduling/page.html, Nick 11-06).
 *
 * The page borrows every piece it can: the Opportunities header and its
 * toolbar, the Task view's grid and seat cells (tasks-page.css and the grid
 * sheets), and the Lineup's month, cards and day pane (lineup.css). This
 * sheet adds only the parts the page owns: the view switch's spacing, the
 * small "By role" door on each column heading, the mark on the column a
 * planner came from, By role's opportunity picker, and By date's fit in the
 * page box.
 *
 * Tokens only (tokens.css). The seat cells are never styled here: they
 * belong to the screens lane and land as they are.
 */

/* #task-root on this page: the open view's body. */
.scheduling-page {
    min-width: 0;
}

.scheduling-page__views {
    display: inline-flex;
    align-items: center;
    margin-right: var(--spacing-xs);
}

/* ── By opportunity: the door to By role on each column heading ── */
.scheduling-page__by-role {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2xs);
    margin-top: var(--spacing-2xs);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-body);
    color: var(--color-text-secondary);
    text-decoration: none;
}

.scheduling-page__by-role:hover,
.scheduling-page__by-role:focus-visible {
    color: var(--color-action);
    text-decoration: underline;
}

.scheduling-page__by-role:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* The column an "Open in Scheduling" came from: a grey wash and a dark bar. */
.opportunities-task-grid__booking.is-landed {
    background: var(--color-surface-subtle);
    border-bottom: 2px solid var(--color-text);
}

.scheduling-by-role {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ── By role: the opportunity picker (option A; swap the template for B or C) ── */
.scheduling-picker {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
}

.scheduling-picker__field {
    flex: 1 1 auto;
    min-width: 0;
    max-width: var(--scheduling-picker-width);
}

.scheduling-picker__step {
    flex: 0 0 auto;
    border-radius: var(--radius-pill);
}

.scheduling-picker__when {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* By role shows the day pane alone: the Lineup's month list stays closed. */
.scheduling-lineup--by-role .scheduling-lineup__panes {
    display: block;
}

/* ── By date: the page box stops at the foot of the screen and clips what
   spills past it (main.css, .global-page-fill), so By date scrolls inside it ── */
.scheduling-by-date {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
}

/* By date wears By role's picker on the grid's control row, beside the role
   pick and the month arrows, so it drops the picker's own gap under it. */
.scheduling-by-date .scheduling-picker {
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0;
}

@media (max-width: 767.98px) {
    .scheduling-picker {
        flex-wrap: wrap;
    }

    .scheduling-picker__field {
        order: -1;
        flex-basis: 100%;
        max-width: none;
    }

    .scheduling-picker__when {
        flex: 1 1 auto;
        text-align: center;
    }

    /* The view switch and the gear do not fit one phone row. The switch
       takes its own line and the icons sit at the right under it, as the
       phone head stacks the rest of the toolbar. */
    .global-toolbar__actions:has(.scheduling-page__views) {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .scheduling-page__views {
        flex: 0 0 100%;
    }
}

/* The Tasks page and a booking's Tasks tab (ADR-233): the grouped list at every
   width (Nick 11-02, S2 look A), a row struck through while its Undo lasts (S4
   look B), the walk bar and the phone's bottom bar. The Add task drawer and a
   contact's Tasks card wear the kit alone. */

.tasks-actions { display: flex; align-items: center; gap: var(--spacing-sm); }
.tasks-actions .bi + .global-btn-word { margin-left: var(--spacing-xsm); }
.tasks-walk-go { margin-right: var(--spacing-xs); }
.tasks-switch { margin-right: var(--spacing-xs); }
.tasks-root { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }

/* The tick: a stored task's circle. */
.tasks-tick { border: 0; background: none; padding: 0; color: var(--color-text-muted); font-size: var(--font-size-lg); line-height: 1; }
.tasks-tick:hover { color: var(--color-text); }

/* The grouped list. Its rows scroll inside the card. */
.tasks-groups-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.tasks-groups { padding: 0 var(--spacing-md) var(--spacing-sm); }
.tasks-group + .tasks-group { margin-top: var(--spacing-xs); }
.tasks-group__head { display: flex; align-items: center; gap: var(--spacing-xs); margin: 0; padding: var(--spacing-smd) 0 var(--spacing-xs); font-size: var(--font-size-sm); font-weight: var(--font-weight-medium); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .04em; background: var(--color-card-bg); }
.tasks-group__head--overdue { color: var(--color-error-text); }
/* The Done group's head opens and shuts it (Nick 11-02, S2 look B's shut group). */
.tasks-group__toggle { width: 100%; border: 0; text-align: left; cursor: pointer; }
.tasks-group__toggle .bi { margin-left: auto; }
.tasks-group__rows { list-style: none; margin: 0; padding: 0; }
.tasks-row { display: flex; align-items: center; gap: var(--spacing-smd); padding: var(--spacing-sm) 0; border-top: 1px solid var(--color-border-subtle); }
.tasks-row__tick { flex: 0 0 1.25rem; }
.tasks-row__main { flex: 1 1 auto; min-width: 0; }
.tasks-row__title, .tasks-row__who { display: flex; align-items: center; gap: var(--spacing-xs); margin: 0; min-width: 0; }
.tasks-row__task { color: inherit; text-decoration: none; font-weight: var(--font-weight-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tasks-row__who { margin-top: var(--spacing-2xs); font-size: var(--font-size-sm); }
.tasks-row__name { font-weight: var(--font-weight-medium); white-space: nowrap; }
.tasks-row__due-phone { display: none; }
.tasks-row__owner { flex: 0 0 9.5rem; }
.tasks-delivery-owner-phone { display: none; }
.tasks-row__due { flex: 0 0 10.5rem; display: flex; flex-direction: column; align-items: flex-end; gap: var(--spacing-2xs); color: var(--color-text-muted); font-size: var(--font-size-sm); }
.tasks-row.is-late .tasks-row__due time { color: var(--color-error-text); }
.tasks-row__nodate { color: var(--color-text-muted); }
.tasks-row__go { flex: 0 0 auto; display: inline-flex; align-items: center; white-space: nowrap; }
.tasks-row__go .tasks-go { min-width: 7.75rem; }
.tasks-capped { margin: var(--spacing-sm) var(--spacing-md); color: var(--color-text-muted); font-size: var(--font-size-sm); }

/* A row acted on a moment ago: struck through until its Undo runs out. */
.tasks-row.is-struck .tasks-row__task { text-decoration: line-through; color: var(--color-text-muted); }
.tasks-row.is-struck .tasks-tick { cursor: default; }
.tasks-row__undo-note { color: var(--color-text-muted); font-size: var(--font-size-sm); white-space: normal; text-align: right; max-width: 12rem; }

/* While the list loads: the day heads over grey bars, in place of the rows. */
.tasks-loading { display: none; }
.tasks-card.is-loading .tasks-loading { display: block; }
.tasks-card.is-loading #task-root { display: none; }
.tasks-loading__bars { display: flex; flex-direction: column; gap: var(--spacing-sm); padding: var(--spacing-sm) 0; }
.tasks-loading__bars .global-skeleton { height: 2.5rem; border-radius: var(--radius-lg); }

/* A booking's own Tasks tab: its rows, no icon and no "on" line. */
.tasks-tab { padding: var(--spacing-md) var(--spacing-md) var(--spacing-lg); }
.tasks-tab__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--spacing-sm); margin: 0 0 var(--spacing-sm); }
.tasks-tab__note { display: flex; align-items: center; gap: var(--spacing-xs); color: var(--color-text-muted); font-size: var(--font-size-sm); }
.tasks-tab__list { padding: var(--spacing-xs) var(--spacing-md); }
.tasks-tab__list .tasks-row:first-child { border-top: 0; }
.tasks-tab__list .tasks-row__who { display: none; }

/* The On line: the link is a box of text, so a capped line cuts the name with "…". */
.tasks-on { display: inline-flex; align-items: center; gap: var(--spacing-xs); min-width: 0; max-width: 100%; }
.tasks-on > .global-chip { flex: 0 0 auto; }
.tasks-on > .global-grid__link { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The walk bar. */
.tasks-walk { display: flex; align-items: center; flex-wrap: wrap; gap: var(--spacing-sm) var(--spacing-md); margin: var(--spacing-sm) var(--spacing-md); padding: var(--spacing-sm) var(--spacing-md); border-radius: var(--radius-lg); background: var(--color-surface-subtle); }
.tasks-walk__where { font-weight: var(--font-weight-medium); font-size: var(--font-size-sm); color: var(--color-text-muted); white-space: nowrap; }
.tasks-walk__what { display: flex; align-items: center; gap: var(--spacing-xs); flex: 1 1 16rem; min-width: 0; }
.tasks-walk__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tasks-walk__name { color: var(--color-text-muted); white-space: nowrap; }
.tasks-walk__buttons { display: flex; align-items: center; gap: var(--spacing-xs); flex-wrap: wrap; }
.tasks-walk__buttons form { margin: 0; }

/* The phone's bottom bar: hidden on wider screens. */
.tasks-bar { display: none; }

/* The Later menu, the in-place due editor and the "..." menu. An editor waiting
   on the move door's picker stays shut until the picker lands. The menu opens
   leftward from the row's right edge, so it stays inside the card. */
.tasks-later, .tasks-rowmenu { position: relative; display: inline-block; }
.tasks-later__menu { position: absolute; right: 0; top: calc(100% + var(--spacing-xs)); min-width: 15rem; }
.tasks-later__option > span { display: block; }
.tasks-later__pick { padding: var(--spacing-xs) var(--spacing-xsm) var(--spacing-xsm); }
.tasks-later__pick:empty, .tasks-inline__editor--due:empty { display: none; }
.tasks-rowmenu { vertical-align: middle; margin-left: var(--spacing-xs); }
.tasks-rowmenu__menu { position: absolute; right: 0; top: calc(100% + var(--spacing-2xs)); min-width: 15rem; white-space: nowrap; }
.tasks-rowmenu__delete--phone { display: none; }
.tasks-inline__editor { position: absolute; top: calc(100% - var(--spacing-2xs)); left: 0; min-width: 100%; white-space: normal; cursor: default; color: var(--color-text); }
.tasks-inline__editor--due { left: auto; right: 0; min-width: 0; width: calc(17rem + 2 * var(--spacing-xs)); max-width: calc(100vw - 2 * var(--spacing-md)); }
.tasks-move__time { margin-top: var(--spacing-xs); }
.tasks-rowmenu__menu.is-up { top: auto; bottom: calc(100% + var(--spacing-2xs)); }
button.tasks-row__task { min-width: 0; padding: 0; border: 0; background: none; text-align: start; }
.tasks-inline__due-phone { border: 0; background: none; padding: 0; font: inherit; }

@media (max-width: 1023px) {
  .tasks-row__owner { flex-basis: auto; }
  .tasks-row__due { flex-basis: 7.5rem; }
}

/* A phone: sticky group heads and the bottom bar, no By day / By person switch,
   and Delete asks first. The tabs line keeps one row (the tabs scroll sideways,
   Add task is a round +), and the toolbar keeps one row (search, then Filter and
   Sort as icons). */
@media (max-width: 767.98px) {
  .tasks-groups-wrap { padding-bottom: calc(var(--spacing-2xl) + var(--spacing-xl)); }
  .tasks-switch { display: none; }
  .tasks-rowmenu__delete--wide { display: none; }
  .tasks-rowmenu__delete--phone { display: flex; }
  body:has(.tasks-root) .global-page-header--tabsactions .global-page-header__tabsrow { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: var(--spacing-xs); }
  body:has(.tasks-root) .global-page-header--tabsactions .global-page-header__tabs { order: 1; flex: 1 1 auto; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  body:has(.tasks-root) .global-page-header--tabsactions .global-page-header__tabs::-webkit-scrollbar { display: none; }
  body:has(.tasks-root) .global-page-header--tabsactions .global-page-header__tabs .global-tabs { flex-wrap: nowrap; }
  body:has(.tasks-root) .global-page-header--tabsactions .global-page-header__actions { order: 2; flex: 0 0 auto; margin: 0; }
  body:has(.tasks-root) .tasks-actions .btn { width: var(--control-h-base); height: var(--control-h-base); padding: 0; border-radius: var(--radius-pill); display: inline-flex; align-items: center; justify-content: center; }
  body:has(.tasks-root) .tasks-actions .global-btn-word { display: none; }
  body:has(.tasks-root) .global-toolbar__row { flex-wrap: nowrap; gap: var(--spacing-xs); }
  body:has(.tasks-root) .global-toolbar__row > :first-child { flex: 1 1 auto; min-width: 0; }
  body:has(.tasks-root) .global-toolbar__row .global-page-search .global-filter-control { min-width: 0; width: 100%; }
  /* Filter and Sort as icons: a square that clips the word, the word itself clear. */
  body:has(.tasks-root) .global-toolbar__filter, body:has(.tasks-root) .global-toolbar__sort .global-toolbar__btn { width: 2.5rem; padding: 0 0 0 var(--spacing-smd); justify-content: flex-start; overflow: hidden; white-space: nowrap; color: transparent; }
  body:has(.tasks-root) .global-toolbar__filter .bi, body:has(.tasks-root) .global-toolbar__sort .global-toolbar__btn .bi { font-size: var(--font-size-base); color: var(--color-text); }
  body:has(.tasks-root) .global-toolbar__sort .global-toolbar__caret { display: none; }
  body:has(.tasks-root) .global-toolbar__actions { flex: 0 0 auto; display: flex; gap: var(--spacing-xs); }
  body:has(.tasks-root) .global-toolbar__actions .tasks-walk-go { display: none; }
  .tasks-groups { padding: 0 var(--spacing-sm); }
  .tasks-group__head + .tasks-group__rows > .tasks-row:first-child { border-top: 0; }
  .tasks-group__head { position: sticky; top: 0; z-index: var(--z-raised); border-bottom: 1px solid var(--color-border-subtle); }
  .tasks-row { gap: var(--spacing-sm); padding: var(--spacing-smd) 0; }
  .tasks-row__owner, .tasks-row__due { display: none; }
  .tasks-row--delivery .tasks-row__tick { display: none; }
  .tasks-row--delivery .tasks-row__who { align-items: flex-start; flex-direction: column; }
  .tasks-row--delivery .tasks-row__task,
  .tasks-row--delivery .tasks-on > a { white-space: normal; overflow-wrap: anywhere; }
  .tasks-row--delivery .tasks-row__name { white-space: normal; }
  .tasks-row--delivery .tasks-row__due-phone { margin: 0; padding: 0; }
  .tasks-delivery-owner-phone { display: inline; }
  .tasks-row__main { display: flex; flex-direction: column; gap: var(--spacing-2xs); }
  .tasks-row__due-phone { display: inline; margin-left: auto; padding-left: var(--spacing-xs); color: var(--color-text-muted); white-space: nowrap; }
  .tasks-row__due-phone.is-late { color: var(--color-error-text); font-weight: var(--font-weight-medium); }
  .tasks-row__name { overflow: hidden; text-overflow: ellipsis; }
  .tasks-row__name .tasks-on { display: flex; }
  .tasks-row__go .tasks-go { min-width: 4.75rem; padding-inline: var(--spacing-sm); }
  .tasks-tab__list .tasks-row__who { display: flex; }
  .tasks-tab__list .tasks-row__name { display: none; }
  .opportunities-tabs-shell .tasks-tab__list .tasks-row__task {
    display: inline-flex;
    align-items: center;
    min-height: var(--control-h-touch);
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
  }
  .opportunities-tabs-shell .tasks-inline__due-phone { min-height: var(--control-h-touch); }
  .tasks-rowmenu { margin-left: var(--spacing-2xs); }
  /* A phone's Later menu spans the walk bar, so it never runs off the screen's edge. */
  .tasks-walk { position: relative; }
  .tasks-later { position: static; }
  .tasks-later__menu { left: var(--spacing-sm); right: var(--spacing-sm); }
  /* A phone's due picker is a sheet at the screen's foot, clear of the list's scroll box. */
  .tasks-row .tasks-inline__editor--due { position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: auto; max-width: none; padding: var(--spacing-md) var(--spacing-md) var(--spacing-lg); border-radius: var(--radius-lg) var(--radius-lg) var(--radius-none) var(--radius-none); z-index: var(--z-modal); }
  .tasks-row .tasks-inline__editor--due .global-date-cal { width: 100%; }
  .tasks-bar { position: fixed; left: var(--spacing-md); right: var(--spacing-md); bottom: calc(var(--bottom-bar-h, 0px) + 3.5rem); z-index: var(--z-sticky); display: flex; align-items: center; justify-content: space-between; gap: var(--spacing-sm); padding: var(--spacing-xs) var(--spacing-xs) var(--spacing-xs) var(--spacing-md); border-radius: var(--radius-pill); background: var(--color-surface-inverse); color: var(--color-neutral-ink-fg); box-shadow: var(--shadow-lg); }
  .tasks-bar__count { font-weight: var(--font-weight-medium); font-size: var(--font-size-sm); }
  .tasks-bar__go { border-radius: var(--radius-pill); background: var(--color-neutral-ink-fg); color: var(--color-surface-inverse); border-color: var(--color-neutral-ink-fg); }
}
