html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* Single source of truth for the app-shell chrome heights (MainLayout.razor.css/BottomNav.razor.css
   render the actual bars; these tokens just publish their numbers). Declared here — global, unscoped —
   rather than in MainLayout.razor.css's scoped CSS, because Blazor's CSS isolation appends its scope
   attribute only to elements a component itself renders, so a scoped `:root { }` rule silently matches
   nothing (`:root[b-xxxx]` never exists — see CLAUDE.md's Blazor traps). Any page that draws its own
   full-bleed content (a game, a wizard step, etc.) should size against these instead of hardcoding the
   same numbers, so a future chrome resize can't drift out of sync with what pages assume (the bug this
   fixed 2026-08-19: RigRacePage's fullscreen calc omitted --ty-bottomnav-h entirely, leaving the shell's
   own BottomNav clearance as unclaimed padding below it and pushing the whole document past 100dvh on
   every tablet/phone width, worst at phone landscape where every px of a ~390px-tall viewport counts). */
/* Bootstrap turns on `scroll-behavior: smooth` for the whole document (under prefers-reduced-motion: no-preference).
   Here that makes every focus/scrollIntoView an ~800ms glide, during which a field's box is moving: the phone form is
   ~3500px tall with a pinned Save bar, and an automated (or impatient) tap that scrolls a field into view keeps
   re-targeting the animation, so the control never settles ("element is not stable" for minutes in Playwright, a
   tap landing on the wrong row for a person). Instant scrolling; code that wants a glide asks for behavior:'smooth'. */
:root { scroll-behavior: auto; }

:root {
    --ty-topbar-h: 3.5rem;
    /* The shell's top app bar is ALWAYS on screen (owner 9 Nov 2026: content scrolls beneath it at every width and in every
       head). --ty-topbar-h is the bar's own content height (3.5rem; 3rem on a phone, mobile.css); --ty-topbar-offset is the
       whole bar: that plus the status-bar inset the bar paints into (--ty-safe-top, set natively on Android, env() on iOS,
       0 elsewhere). mobile-shell.js overwrites it with the MEASURED height, because the bar can wrap to a second line at
       tablet-landscape widths. Everything that must clear the bar reads this: scroll-padding-top, a page's own sticky header
       (`top: var(--ty-sticky-top)`), a sticky side card. */
    --ty-topbar-offset: calc(var(--ty-topbar-h, 3.5rem) + var(--ty-safe-top, 0px));
    /* Where a PAGE-level sticky element sticks: just under the bar. A fixed panel/sheet scrolls inside itself, under no bar,
       so it resets this to 0 (see the `.dp` rule below). */
    --ty-sticky-top: var(--ty-topbar-offset);
    /* The bar's layer: over page content and every sticky header, under every dialog, sheet, scrim, panel, the full-screen
       map, the guide player (1040+) and the status-bar strip (1050). Its own open menus lift it (rules below). */
    --ty-z-topbar: 1030;
    /* The footer nav bar is on screen at every width (it is the shell's constant primary navigation, not a
       mobile-only affordance), so this is a single unconditional number rather than a per-breakpoint one.
       Matches BottomNav.razor.css's own rendered height (~60px content + its padding); a round number,
       since pages only need "roughly how much to clear", not a pixel-exact echo of the nav's measured box. */
    --ty-bottomnav-h: 60px;

    /* Touch-target geometry, published here so every layer reads the same floor (ThemeTokenParityTests requires every
       --ty-* token to be declared in a :root floor). --ty-tap / --ty-tap-gap are the phone layer's 48px / 8px
       (mobile.css restates them inside its own media query); --ty-touch-min is the tablet layer's 44px (Apple's bar)
       and --ty-edge-tab-clear the gutter that keeps the right-edge Documents tab off a tablet's content
       (tablet.css). Declared, not used, outside those layers: desktop is unchanged. */
    --ty-tap: 48px;
    --ty-tap-gap: .5rem;
    --ty-touch-min: 2.75rem;
    --ty-edge-tab-clear: 4rem;

    /* The trial countdown strip (Modules.Shared/Subscription/TrialBanner) docks directly ON TOP of the
       footer nav, so it occupies the band the corner FABs were already sitting in. Two tokens, because
       they answer different questions:
         --ty-trialstrip-h          how tall the strip IS. A published constant, like --ty-bottomnav-h
                                    above, and TrialBanner.razor.css pins its own min-height to it so the
                                    number here cannot quietly stop being true. 62px = 8px padding twice,
                                    the dismiss button's 44px WCAG touch target, and the 2px top border.
         --ty-trialstrip-clearance  how much EXTRA chrome that already clears the footer nav must move up.
                                    Zero by default, because the strip is absent far more often than it is
                                    present — a paid tenant, a platform admin, a dismissed session, or the
                                    paywall instead.
         --ty-trialstrip-overlay    how far up from the VIEWPORT BOTTOM the strip reaches — the nav band
                                    plus the strip itself. For chrome that does NOT already clear the footer
                                    nav: the sidebar, which the nav bar starts to the right of but the
                                    full-width strip crosses. Using the clearance there instead leaves the
                                    rail's last item exactly one nav-bar short, i.e. still underneath. */
    --ty-trialstrip-h: 3.875rem;
    --ty-trialstrip-clearance: 0px;
    --ty-trialstrip-overlay: 0px;

    /* The corner-FAB rail. Three files used to hand-compute this same arithmetic (the messages launcher, the
       shell's quick-add "+", the customers page's action button) and a fourth would have collided with an
       existing slot, so the geometry is published once here instead. Slots run right-to-left:
         1 = the shell's ONE speed-dial "+" (Voice, Ask AI, Messages and the quick-add records all fan out of it —
         QuickAddLauncher + the Core IShellDial seam), 2 = whatever the current PAGE adds — page actions extend the row
         OUTBOARD of the global buttons, so the global ones never move when a page adds or drops its own. A new
         corner button takes the next free slot; it never invents a bottom/right offset of its own.
       --ty-fab-bottom is the shared bottom edge: clear of the footer nav bar (which is on screen at every
       width) plus the phone's home-indicator strip. Anything docking in this corner should use these rather
       than repeat the sums. */
    /* The area map's height and corner (TyAreaMap, FB-197 canvassing): a host page sets them on an ancestor —
       the full-screen phone canvas sets the height to the viewport and the radius to 0. */
    --ty-areamap-h: clamp(320px, 60vh, 720px);
    --ty-areamap-radius: 12px;
    --ty-fab-size: 3.25rem;
    --ty-fab-gap: .75rem;
    --ty-fab-inset: 1.25rem;
    --ty-fab-bottom: calc(var(--ty-bottomnav-h, 60px) + var(--ty-trialstrip-clearance, 0px) + .75rem + var(--ty-safe-bottom, env(safe-area-inset-bottom, 0px)));
    --ty-fab-slot-1: var(--ty-fab-inset);
    --ty-fab-slot-2: calc(var(--ty-fab-inset) + (var(--ty-fab-size) + var(--ty-fab-gap)));
    --ty-fab-slot-3: calc(var(--ty-fab-inset) + 2 * (var(--ty-fab-size) + var(--ty-fab-gap)));
    --ty-fab-slot-4: calc(var(--ty-fab-inset) + 3 * (var(--ty-fab-size) + var(--ty-fab-gap)));

    /* How far the end of the scrolling content must clear the fixed bottom chrome. Published for the phone layer
       (mobile.css), which adds the floating-button row to it; consumed nowhere on tablet/desktop, where
       MainLayout's own .content padding is unchanged. */
    --ty-content-clear: calc(var(--ty-bottomnav-h, 60px) + var(--ty-trialstrip-clearance, 0px) + var(--ty-safe-bottom, env(safe-area-inset-bottom, 0px)));

    /* Where the toast stack's bottom edge sits when it docks at the bottom (ToastContainer on a phone, and every task
       screen): above the footer nav bar, the trial strip when it is up, and the system gesture / navigation bar
       (--ty-safe-bottom: set natively by the Android head, env() on iOS, 0 on desktop). ONE number for every toast, so no
       toast or page invents its own offset. Keyboard up (mobile.css, html.ty-kbd): the bar is hidden, so it drops. */
    --ty-toast-bottom: calc(var(--ty-bottomnav-h, 60px) + var(--ty-trialstrip-clearance, 0px) + var(--ty-safe-bottom, env(safe-area-inset-bottom, 0px)) + .5rem);
}

/* "Bring this into view" (keyboard focus, Tab, a jump link, scrollIntoView) must stop ABOVE the fixed bottom bar, not behind it: the
   browser knows nothing of a position:fixed layer unless the scroller says how much of its edge is taken (WCAG 2.4.11, focus not obscured).
   The page already pads its END by this clearance so a person can scroll clear; this makes the programmatic scroll agree. */
html { scroll-padding-bottom: var(--ty-content-clear, 60px); }
/* ...and the same for the top bar, which is now always there: focus, Tab, a jump link and scrollIntoView stop BELOW it. A little
   air so the target is not flush against the bar. */
html { scroll-padding-top: calc(var(--ty-topbar-offset, 3.5rem) + .5rem); }

/* Fixed panels and sheets scroll inside themselves, beneath no bar: a sticky header inside one sticks at 0. */
.dp, .dp-scrim, .wz-scrim, .cv-overlay { --ty-sticky-top: 0px; }

/* Raise the FAB rail whenever the trial strip is actually on screen.
   ------------------------------------------------------------------------------------------------
   Driven off the strip's PRESENCE IN THE DOM rather than a flag someone has to remember to set,
   because TrialBanner renders conditionally — a paid tenant, a platform admin, an escape route, or a
   dismissed session removes the element outright. :has() therefore tracks it exactly, including the
   moment the user hits the strip's own dismiss button: the element goes, the clearance goes with it,
   and the buttons drop back down. A stateful class toggled over JS interop would have to be kept in
   step with all four of those conditions, and would be wrong the first time one of them changed.

   MUST be :root, not body. A custom property's var() references are substituted at computed-value time
   ON THE ELEMENT THAT DECLARES IT — so --ty-fab-bottom, declared on :root above, reads --ty-trialstrip-
   clearance's value AS COMPUTED ON :root, and inherits down already resolved. Setting the clearance on
   body would therefore change nothing at all: the FABs would inherit a --ty-fab-bottom that had already
   been flattened using :root's 0px. (This cost a red test; it looks like it ought to work.) Re-declaring
   the clearance on :root instead re-resolves --ty-fab-bottom there, and source order does not matter
   because the cascade settles each property before the other reads it.

   The rule lives in this GLOBAL sheet rather than a scoped one for the same reason the token block above
   does: Blazor's CSS isolation would rewrite the selector to `:root[b-xxxx]`, which matches nothing (see
   CLAUDE.md's Blazor traps).

   Where :has() is unsupported the buttons simply sit where they do today — an overlap, not a broken
   layout. Every current target (Chromium WebView2/Android, WKWebView, and the desktop browsers) has
   had it since 2023. */
:root:has(.ty-trialstrip) {
    --ty-trialstrip-clearance: var(--ty-trialstrip-h);
    --ty-trialstrip-overlay: calc(var(--ty-bottomnav-h, 60px) + var(--ty-trialstrip-h));
}

/* On desktop the strip starts where the side rail ends, exactly like the footer nav bar it docks on (and
   follows the rail out when it folds away), so it never crosses the rail's Getting started / Settings /
   version shelf. That is what lets the shelf sit on the very bottom edge of the window. The rail therefore
   needs no clearance (MainLayout.razor.css); the drawer below 1024px is drawn above the strip. */
@media (min-width: 1024px) {
    :root:has(.page:not(.nav-collapsed)) .ty-trialstrip {
        left: 250px;
    }

    .ty-trialstrip {
        transition: left .32s cubic-bezier(.22, 1, .36, 1);
    }
}

/* The strip's own HEIGHT, here rather than in TrialBanner.razor.css, because it is shell geometry the
   rest of the chrome is entitled to rely on — --ty-fab-bottom above does arithmetic with it — and not
   private styling. Keeping it beside the token it must agree with is what stops the two drifting; a
   padding change in the component's scoped sheet can no longer silently move the strip out from under
   the buttons that were told how tall it is. Everything about how the strip LOOKS stays in its own
   scoped file. border-box, because the token is the outside edge: the 2px top border is part of what
   other chrome must clear, not extra on top of it. */
.ty-trialstrip {
    box-sizing: border-box;
    min-height: var(--ty-trialstrip-h, 3.875rem);
}


/* ============================================================================
   LAYER 1 - the base --ty-* token layer  (/design/ui section 3 & 4)
   ----------------------------------------------------------------------------
   The three-layer cascade is  :root  ->  [data-module]  ->  [data-tenant], with a
   selectable platform theme ([data-theme="trusty"|"graft"], themes/*.css) sitting
   between :root and the module layer. This block is the FLOOR: every token any
   component may reference is declared here with a sane light-theme default, so

       *no token is ever undefined in any theme* - including "none" (vanilla).

   That matters because an undefined custom property silently falls back to the
   literal a component happened to write inline (or to nothing at all), which is
   exactly how "it looks fine on Trusty and broken on Graft" bugs happen: the
   component's inline fallback is always a LIGHT value, so on the dark theme it
   paints a white block on slate. Declaring the floor here means a theme only has
   to RE-POINT tokens, never remember to define them.

   Load order is load-bearing: app.css is linked BEFORE themes/*.css in every host
   document, and :root and [data-theme="..."] have equal specificity - so the theme
   files win on source order. Do not move these declarations after the themes.

   Adding a token: declare it here AND in BOTH themes/trusty.css and
   themes/graft.css. Components reference only these semantic names - never a raw
   hex, never a domain colour directly (/design/ui section 3, "the one rule").
   ============================================================================ */
:root {
    /* --- Domain palette source-of-truth (mirrors ModuleTheme.PrimaryColor) --- */
    --ty-domain-window-cleaning: #1E6FD9;
    --ty-domain-gardening:       #2E9E4F;
    --ty-domain-scaffolding:     #D98A1E;
    --ty-domain-electrician:     #7C3AED;
    --ty-domain-plumber:         #0891B2;
    --ty-domain-solar-installer: #EA580C;
    --ty-domain-foot-care:       #DB2777;
    --ty-domain-car-valeting:    #475569;
    --ty-domain-roofer:          #7C2D12;
    --ty-domain-tiler:           #4D7C0F;
    --ty-domain-painter-decorator: #A21CAF;
    --ty-domain-plasterer:       #B91C1C;
    --ty-domain-inspections:     #BE185D;
    --ty-domain-surveys:         #0F766E; /* a capability module with a face of its own (IThemedModule) */
    /* Smart Survey (FB-462): a lime-green, chosen as the widest gap left in the palette. Not the Surveys teal (#0F766E) and not any
       --ty-action-* colour: hue 97, against done green 137, teal 175, indigo 244, amber 42 and violet 262. Dark ink on the fill (6.65:1). */
    --ty-domain-smart-survey:    #5FB02E;

    /* --- Colour, semantic. Primary is re-pointed per domain by Layer 2. --- */
    --ty-color-primary:          #1E6FD9;
    --ty-color-primary-ink:      #1457b0;
    --ty-color-primary-soft:     #eaf2fd;
    /* Unread notifications: the bell follows the theme's primary ink (re-declared per theme and in dark), so no dark twin is needed. */
    --ty-notify-unread:          var(--ty-color-primary-ink, var(--ty-color-primary));
    --ty-color-primary-strong:   #1457b0;
    --ty-color-primary-contrast: #ffffff;
    --ty-color-accent:           #1457b0;

    /* Surfaces, lightest to deepest. `surface` is a card/sheet, `-2` the page behind
       it, `-3` an inset control, `sunken` a recessed well (table zebra, code block,
       empty-state panel), `muted`/`subtle` the two quieter fills between them. */
    --ty-color-surface:        #ffffff;
    --ty-color-surface-2:      #f6f8fa;
    --ty-color-surface-3:      #eef1f4;
    --ty-color-surface-sunken: #f3f5f8;
    --ty-color-surface-muted:  #eef1f5;
    --ty-color-surface-subtle: #f6f8fa;
    /* The tile a third-party vendor's logo sits on (customer-import wizard). White in EVERY theme on purpose:
       vendor artwork assumes a light background, so dark themes must not override this one. */
    --ty-logo-tile: #ffffff;

    --ty-color-text:        #1c2128;
    --ty-color-text-muted:  #57606a;
    --ty-color-text-subtle: #8a95a1;
    /* "ink" = the strong reading colour on a surface that stays light-on-paper in
       every theme (crash screens, rendered documents, the public quote page), so it
       must NOT flip with the dark theme the way --ty-color-text does. */
    --ty-color-ink:         #1b2733;
    --ty-color-ink-muted:   #55636f;
    /* ...and its inverse: text drawn ON an ink / solid-dark block. */
    --ty-color-text-onink:       #ffffff;
    --ty-color-text-onink-muted: rgba(255, 255, 255, .72);

    --ty-color-border:        #e7ebf0;
    --ty-color-border-strong: #d0d7de;
    --ty-color-border-soft:   #f1f4f7;
    --ty-color-border-subtle: rgba(0, 0, 0, .06);

    /* --- Status: base / ink (readable text) / soft (tinted fill) / border --- */
    --ty-color-success:        #26b050;
    --ty-color-success-ink:    #1a7f37;
    --ty-color-success-soft:   #e6f6ea;
    --ty-color-success-border: #bfe3cc;
    --ty-color-warning:        #D98A1E;
    /* A test (sandbox) workspace: the shell logo is tinted this green; --ty-sandbox-hue rotates the blue artwork to it. */
    --ty-color-sandbox:        #2E9E4F;
    --ty-sandbox-hue:          -76deg;
    --ty-color-warning-ink:    #9a5b00;
    --ty-color-warning-soft:   #fdf1dd;
    /* The pin: a personal default ("my schedule opens in Week") — pink so it reads as *mine*, distinct from every status colour. */
    --ty-color-pin:            #e0409a;
    /* FB-225: the person's OWN settings ("Preferences" in the top-bar Settings menu) — the pin's pink family, so "mine"
       reads the same everywhere. Light values here; dark themes re-point ink/soft in the [data-bs-theme="dark"] block below. */
    --ty-color-preferences:          #e0409a;
    --ty-color-preferences-contrast: #ffffff;
    --ty-color-preferences-ink:      #a3185f;
    --ty-color-preferences-soft:     #fde8f3;
    /* The project chip: this job was booked as part of a multi-trade project. Copy-pasted as a bare
       #0F766E in all five job editors (WcJobEditor.razor.css etc — see the styling audit's finding #3);
       not repointed with the platform theme is deliberate, same as --ty-color-pin above, so "this belongs
       to a project" reads the same teal in Trusty and Graft. New/converted pages should reference this
       token (color-mix(in srgb, var(--ty-color-project) 12%, transparent) for the soft fill, 30% for the
       border) rather than hardcoding the hex again; the five job editors themselves are a second pass. */
    --ty-color-project:        #0F766E;

    /* The action colour key: one fixed colour per ACTION, used everywhere that action appears (job panel,
       the missed strip, planner rows, On my way), so a thumb learns "green = done" and never has to read.
       -bg is the fill, -fg the text on it (both >= 4.5:1). Skip is deliberately an outline (destructive-ish). */
    --ty-action-done-bg:    #1a7f37;  --ty-action-done-fg:    #ffffff;  /* Done: green */
    --ty-action-paid-bg:    #0f766e;  --ty-action-paid-fg:    #ffffff;  /* Done & paid: deep teal (money) */
    --ty-action-invoice-bg: #4338ca;  --ty-action-invoice-fg: #ffffff;  /* Invoice: indigo */
    --ty-action-replan-bg:  #e8a317;  --ty-action-replan-fg:  #2a1a00;  /* Replan: amber (calendar) */
    --ty-action-omw-bg:     #7c3aed;  --ty-action-omw-fg:     #ffffff;  /* On my way: vivid violet */
    --ty-action-skip-ink:   #b32121;  --ty-action-skip-border: #e0a3a3; /* Skip: muted red outline */
    --ty-color-warning-border: #f2d9a4;
    --ty-color-danger:         #e50000;
    --ty-color-danger-ink:     #b32121;
    --ty-color-danger-soft:    #fdecec;
    --ty-color-danger-border:  #f4d3cf;
    --ty-color-info:           #1457b0;
    --ty-color-info-ink:       #1457b0;
    --ty-color-info-soft:      #eaf2fd;
    --ty-color-info-border:    #cfe0f7;

    /* Scrim behind sheets / drawers / modals. Dark in every theme (it dims the page
       under the sheet), but each theme tunes it to its own surface contrast.
       -rgb is the bare triplet so a component that needs its own opacity can write
       rgba(var(--ty-color-overlay-rgb), .34) and STILL follow the theme - a raw
       rgba(20, 26, 33, .34) does not, and is far too weak over Graft's dark page. */
    --ty-color-overlay:     rgba(12, 18, 28, .55);
    --ty-color-overlay-rgb: 12, 18, 28;

    /* Shadow colour as a bare triplet, for the handful of drop-shadows with bespoke
       geometry (a FAB, a slide-over drawer, a dropdown) that cannot use --ty-shadow-sm/md/lg.
       Everything else should reach for the elevation tokens instead. */
    --ty-shadow-rgb: 12, 18, 28;

    /* Search-result highlight (the <mark> in document content search). Needs BOTH halves
       as tokens: a #fff1a8 highlight with `color: inherit` puts the dark theme's near-white
       body text on pale yellow at ~1.2:1 - unreadable. */
    --ty-color-highlight-bg: #fff1a8;
    --ty-color-highlight-fg: #1c2128;

    /* Third-party brand marks. The solid fill is the brand's own colour and must not drift;
       -ink is the readable-on-our-surface variant, which DOES change per theme (GOV.UK green
       on Graft's #16202b card is ~2.3:1 and fails WCAG AA). */
    --ty-brand-hmrc:          #00703c;
    --ty-brand-hmrc-contrast: #ffffff;
    --ty-brand-hmrc-ink:      #00703c;
    --ty-brand-hmrc-soft:     #e6f0ea;

    /* Tooltip / hint bubble. INVERTED against the page by design (a dark bubble on a light
       app, a light bubble on a dark one) - a hardcoded #1f2937 bubble sits on Graft's
       #0f1720 page with almost no edge, so the hint reads as a smudge rather than a popover. */
    --ty-color-tooltip-bg: #1f2937;
    --ty-color-tooltip-fg: #ffffff;

    /* --- Spacing --- */
    --ty-space-xs: 4px;  --ty-space-sm: 8px;  --ty-space-md: 12px;
    --ty-space-lg: 16px; --ty-space-xl: 24px; --ty-space-2xl: 32px; --ty-space-3xl: 48px;

    /* --- Radius --- */
    --ty-radius-control: 8px;
    --ty-radius-card:    12px;
    --ty-radius-panel:   16px;
    --ty-radius-pill:    999px;

    /* --- Typography --- */
    --ty-font-base: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --ty-font-mono: ui-monospace, Menlo, Consolas, monospace;
    --ty-font-xs: 12px; --ty-font-sm: 14px; --ty-font-base-size: 16px;
    --ty-font-lg: 20px; --ty-font-xl: 24px; --ty-font-2xl: 32px;
    --ty-weight-regular: 400; --ty-weight-medium: 500;
    --ty-weight-semibold: 600; --ty-weight-bold: 700;
    --ty-line-body: 1.5; --ty-line-heading: 1.25;
    --ty-tracking-tight: -0.02em; --ty-tracking-wide: 0.12em;

    /* --- Elevation --- */
    --ty-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
    --ty-shadow-md: 0 1px 3px rgba(0, 0, 0, 0.07), 0 12px 30px -18px rgba(0, 0, 0, 0.22);
    --ty-shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.08), 0 30px 60px -30px rgba(0, 0, 0, 0.40);

    /* --- Motion --- */
    --ty-motion-micro: 120ms; --ty-motion-standard: 200ms;
    --ty-ease: cubic-bezier(0.2, 0, 0, 1);

    /* --- Focus --- */
    --ty-focus-ring: 0 0 0 0.2rem rgba(30, 111, 217, 0.35);

    /* --- Z-index --- */
    --ty-z-nav: 100; --ty-z-sticky: 200; --ty-z-dropdown: 300;
    --ty-z-modal: 400; --ty-z-toast: 1300; /* above record panels (1080), the trade picker (1100) and the invoice preview (1200) */

    /* --- Safe-area insets (notch / home indicator). Real values on iOS + Android
       under the MAUI BlazorWebView and installed PWAs, 0 everywhere else. Pages that
       draw their own full-bleed chrome pad against these, never env() directly, so a
       head can override them. --- */
    --ty-safe-top:    env(safe-area-inset-top, 0px);
    --ty-safe-bottom: env(safe-area-inset-bottom, 0px);
    --ty-safe-left:   env(safe-area-inset-left, 0px);
    --ty-safe-right:  env(safe-area-inset-right, 0px);

    /* --- Document Library, the manila-folder file manager (/design/ui section 4.4) --- */
    --ty-doc-accent:        #D98A1E;
    --ty-doc-folder-bg:     #faf1dc;
    --ty-doc-folder-border: #ecd9a9;
    --ty-doc-folder-name:   #1c2128;
    --ty-doc-folder-meta:   #796d4e; /* was #9a8b63 = 2.99:1 on the manila tile; now 4.54:1 */
    /* Documents sticky + drawer: whose documents (DocumentsLauncher). Company = the manila folder; a job wears its
       trade's [data-module] primary; customer, vehicle and any other record get their own folder colour. Each
       -ink is the glyph/text on that fill (all >= 4.5:1). */
    --ty-doc-scope-company:       #D98A1E; --ty-doc-scope-company-ink:  #0f1720;
    --ty-doc-scope-customer:      #4f46e5; --ty-doc-scope-customer-ink: #ffffff;
    --ty-doc-scope-vehicle:       #475569; --ty-doc-scope-vehicle-ink:  #ffffff;
    --ty-doc-scope-record:        #57606a; --ty-doc-scope-record-ink:   #ffffff;
    /* Area colours for the Documents tab when no record is open (a trade wears its own [data-module] primary; customers and vehicles use the scope tokens above). Inks >= 4.5:1. */
    --ty-doc-area-schedule: #0f766e; --ty-doc-area-schedule-ink: #ffffff;
    --ty-doc-area-planning: #0369a1; --ty-doc-area-planning-ink: #ffffff;   /* a calm deep sky blue: planning is route/time work (was a pink that read as nothing) */
    --ty-doc-area-money:    #15803d; --ty-doc-area-money-ink:    #ffffff;
    --ty-doc-area-pipeline: #be123c; --ty-doc-area-pipeline-ink: #ffffff;   /* leads / surveys: a warm rose - the pipeline is what is heating up (was a purple that sat on the electrician's violet) */
    /* How much of the context colour a LIGHT folder treatment (tint / paper / outline) mixes into its fill: ~15% on a light
       surface, ~28% on a dark one, so the folder stays distinguishable from the page in both themes. */
    --ty-doc-tint-pct: 15%;

    --ty-file-pdf-bg:     #fdeceb; --ty-file-pdf-fg:     #c23e3b; /* was #d64541 = 3.84:1; now 4.54:1 */
    --ty-file-doc-bg:     #eef4fd; --ty-file-doc-fg:     #1457b0;
    --ty-file-sheet-bg:   #e8f5ec; --ty-file-sheet-fg:   #1f7a38;
    --ty-file-video-bg:   #f0ecfb; --ty-file-video-fg:   #7658c9; /* was #7a5bd0 = 4.27:1; now 4.51:1 */
    --ty-file-image-bg:   #e4f4f4; --ty-file-image-fg:   #137a7a; /* was #178f8f = 3.46:1; now 4.53:1 */
    --ty-file-default-bg: #eef1f4; --ty-file-default-fg: #57606a;

    /* --- Access (/design/ui "Team & Access" spec) --- */
    --ty-seg-bg:     #eceef1;
    --ty-seg-border: transparent;
    --ty-seg-fg:     #57606a;
    --ty-seg-on-bg:  #ffffff;
    --ty-seg-on-fg:  #1c2128;
    --ty-seg-on-shadow: 0 1px 3px rgba(0, 0, 0, .14);

    --ty-status-active-bg:    #e6f6ea; --ty-status-active-fg:    #1a7f37;
    --ty-status-invited-bg:   #fdf1dd; --ty-status-invited-fg:   #9a5b00;
    --ty-status-suspended-bg: #fdecea; --ty-status-suspended-fg: #c0392b;

    --ty-matrix-on-bg:  #e6f6ea; --ty-matrix-on-fg:  #1e8f4e;
    --ty-matrix-off-bg: #f4f5f7; --ty-matrix-off-fg: #cbd2da;
    --ty-matrix-del-bg: #fdecea; --ty-matrix-del-fg: #c0392b;

    --ty-act-bg:     #f4f6f9; --ty-act-border:     #e4e8ee; --ty-act-fg:     #8a95a1;
    --ty-act-on-bg:  #eef8f1; --ty-act-on-border:  #a9dcb8; --ty-act-on-fg:  #1e8f4e;
    --ty-act-del-bg: #fdecea; --ty-act-del-border: #f4c9c4; --ty-act-del-fg: #c0392b;

    --ty-rolerow-sel-bg:     #ffffff;
    --ty-rolerow-sel-border: #cfe0f7;
    --ty-rolerow-sel-ring:   0 0 0 3px #eaf2fd, 0 6px 16px -12px rgba(30, 111, 217, .5);
    --ty-rolerail-on:        #1E6FD9;

    --ty-accent-1-bg: #eaf2fd; --ty-accent-1-fg: #1457b0;
    --ty-accent-2-bg: #f0ecfb; --ty-accent-2-fg: #6b46c1;
    --ty-accent-3-bg: #e4f4f4; --ty-accent-3-fg: #0f6b6b;
    --ty-accent-4-bg: #e8f5ec; --ty-accent-4-fg: #1f7a38;
    --ty-accent-5-bg: #fbf0db; --ty-accent-5-fg: #9a5b00;
    --ty-accent-6-bg: #f1f4f7; --ty-accent-6-fg: #57606a;

    /* --- Data-viz & categorical ramps (FB-327, /design/ui section 4.9). Three families, all consumed through var():
       --ty-cat-{hue}[-ink|-soft]  a CATEGORICAL hue (store kinds, environments, tags): the mark/fill, the text on the
           soft tint (AA on it), and the tint. Dark themes lighten the first two and make the tint a translucent wash.
       --ty-chart-1..8             the chart SERIES palette (Okabe-Ito, colour-blind safe), tuned per theme for contrast
           against that theme's surface. Never the only signal: pair with a label or icon.
       --ty-board-*                the always-dark "operations board" surface used by the dashboards, security posture
           and backlog visuals: it stays dark under Trusty (a wall-screen look) and melts into the slate under Graft,
           with its own readable inks and bright semantic marks. A board's light variant reads --ty-color-* and
           --ty-chart-* instead. --- */
    --ty-cat-sky: #0369a1; --ty-cat-sky-ink: #0369a1; --ty-cat-sky-soft: #e0f0fb;
    --ty-cat-indigo: #4338ca; --ty-cat-indigo-ink: #4338ca; --ty-cat-indigo-soft: #e8e9fd;
    --ty-cat-violet: #7c3aed; --ty-cat-violet-ink: #5b21b6; --ty-cat-violet-soft: #f1eafe;
    --ty-cat-teal: #0f766e; --ty-cat-teal-ink: #0f766e; --ty-cat-teal-soft: #dcf5f1;
    --ty-cat-rust: #c2410c; --ty-cat-rust-ink: #9a3412; --ty-cat-rust-soft: #fdeadd;
    --ty-cat-pink: #be185d; --ty-cat-pink-ink: #9d174d; --ty-cat-pink-soft: #fce7f1;
    --ty-cat-lime: #65a30d; --ty-cat-lime-ink: #4d7c0f; --ty-cat-lime-soft: #ecf8d6;
    --ty-cat-slate: #64748b; --ty-cat-slate-ink: #475569; --ty-cat-slate-soft: #eceff4;
    --ty-chart-1: #0072b2; --ty-chart-2: #d98200; --ty-chart-3: #009e73; --ty-chart-4: #b8558c;
    --ty-chart-5: #9a8700; --ty-chart-6: #d55e00; --ty-chart-7: #4f5bd5; --ty-chart-8: #57606a;
    /* Backlog area palette (17 hues, Okabe-Ito first; always shown with the area's name) and map marks. A map (Google) cannot read var(), so tyMap.js resolves a var(--x) colour to the computed value: map tokens are plain hex. */
    --ty-area-1: #d55e00; --ty-area-2: #e69f00; --ty-area-3: #009e73; --ty-area-4: #0072b2;
    --ty-area-5: #56b4e9; --ty-area-6: #7b5ea7; --ty-area-7: #6b7280; --ty-area-8: #8c6d31;
    --ty-area-9: #f0e442; --ty-area-10: #cc79a7; --ty-area-11: #44aa99; --ty-area-12: #117733;
    --ty-area-13: #aa4499; --ty-area-14: #999933; --ty-area-15: #332288; --ty-area-16: #88ccee;
    --ty-area-17: #882255;
    --ty-map-activity-1: #0072b2; --ty-map-activity-2: #56a3d9; --ty-map-activity-3: #a9cdea; --ty-map-label: #ffffff;
    --ty-board-bg: #0b0e14; --ty-board-panel: #141a26; --ty-board-panel-2: #1a2030; --ty-board-panel-hi: #1f2738;
    --ty-board-line: #262f40; --ty-board-line-2: #323d52;
    --ty-board-ink: #dde4ef;   --ty-board-ink-2: #b6c0d1;   --ty-board-muted: #97a1b5;   --ty-board-faint: #7a8499;
    --ty-board-accent: #6ea8ff; --ty-board-accent-2: #9b7bff; --ty-board-violet: #b392ff; --ty-board-on-accent: #04111f;
    --ty-board-good: #3cc88f;  --ty-board-warn: #f0b23c;    --ty-board-bad: #f2545b;     --ty-board-info: #8b95a9;
    --ty-board-crit: #ff4d6d;  --ty-board-high: #ff8c42;    --ty-board-med: #f5c542;     --ty-board-low: #4cc9f0;
    --ty-board-fair: #a3e635;  --ty-board-poor: #f5a623;
    --ty-board-tip-bg: #0a0d13; --ty-board-tip-fg: #e6e9f0; --ty-board-tip-line: #2b3344;
    --ty-board-c1: #5ab4f0; --ty-board-c2: #f0a83c; --ty-board-c3: #3cc28e; --ty-board-c4: #d98bc0;
    --ty-board-c5: #ebdd5a; --ty-board-c6: #ff7b4a; --ty-board-c7: #8c9eff; --ty-board-c8: #a0a8b8;

    /* Solid status fills for a pill/button/badge that carries WHITE (or dark) text: -solid is the fill, -on-solid the text on it
       (both >= 4.5:1). The -ink tokens are text-on-tint colours and go pale on dark themes, so they must not be used as a fill. */
    --ty-color-success-solid: #1a7f37; --ty-color-success-on-solid: #ffffff;
    --ty-color-warning-solid: #9a5b00; --ty-color-warning-on-solid: #ffffff;
    --ty-color-danger-solid:  #b32121; --ty-color-danger-on-solid:  #ffffff;
}

/* The setup assistant's idle prompt (owner, 10 Nov 2026): green by default (the Privacy Policy's green) and blue when the page
   behind it is green, so it never matches what is on screen. Core SetupTipAccent picks by hue; the card stamps data-accent and
   SetupTipHost.razor.css re-points its primary family at one of these two sets. Fill carries -on-fill text (>= 4.5:1); ink is text
   on the soft tint or the surface. Dark themes (graft.css) override the raw blue; green follows the success family. */
:root {
    --ty-setup-tip-green-fill: var(--ty-color-success-solid);   --ty-setup-tip-green-on-fill: var(--ty-color-success-on-solid);
    --ty-setup-tip-green-ink: var(--ty-color-success-ink);      --ty-setup-tip-green-soft: var(--ty-color-success-soft);
    --ty-setup-tip-green-border: var(--ty-color-success-border, var(--ty-color-success-ink));
    --ty-setup-tip-blue-fill: #1457b0;                          --ty-setup-tip-blue-on-fill: #ffffff;
    --ty-setup-tip-blue-ink: var(--ty-color-info-ink);          --ty-setup-tip-blue-soft: var(--ty-color-info-soft);
    --ty-setup-tip-blue-border: var(--ty-color-info-border, var(--ty-color-info-ink));
}

/* ----------------------------------------------------------------------------
   LAYER 2 - domain module themes, theme-agnostic floor. Each themes/*.css repeats
   these under its own [data-theme] scope with theme-tuned ink/soft values; this
   block is what makes a [data-module] surface still pick up its trade colour when
   the platform theme is "none".

   Primary-DERIVED tokens (ink / soft / strong / accent) must be RE-DECLARED in
   every [data-module] block, never left to a var() alias at :root - an inherited
   custom property is computed once on the element that declares it, so an alias
   declared on <html> would keep the root's blue inside a green gardening surface.
   ---------------------------------------------------------------------------- */
[data-module="window-cleaning"] {
    --ty-color-primary: var(--ty-domain-window-cleaning);
    --ty-color-primary-ink: #1457b0; --ty-color-primary-soft: #eef4fd;
    --ty-color-primary-strong: #1457b0; --ty-color-accent: #1457b0;
    --ty-color-primary-contrast: #ffffff; /* 4.85:1 on this trade's fill */
}
[data-module="gardening"] {
    --ty-color-primary: var(--ty-domain-gardening);
    --ty-color-primary-ink: #1f7a38; --ty-color-primary-soft: #e8f5ec;
    --ty-color-primary-strong: #1f7a38; --ty-color-accent: #1f7a38;
    --ty-color-primary-contrast: #0f1720; /* 5.26:1 on this trade's fill */
}
[data-module="scaffolding"] {
    --ty-color-primary: var(--ty-domain-scaffolding);
    --ty-color-primary-ink: #a5670f; --ty-color-primary-soft: #fbf0db;
    --ty-color-primary-strong: #a5670f; --ty-color-accent: #a5670f;
    --ty-color-primary-contrast: #0f1720; /* 6.53:1 on this trade's fill */
}
[data-module="electrician"] {
    --ty-color-primary: var(--ty-domain-electrician);
    --ty-color-primary-ink: #5b21b6; --ty-color-primary-soft: #f1ebfd;
    --ty-color-primary-strong: #5b21b6; --ty-color-accent: #5b21b6;
    --ty-color-primary-contrast: #ffffff; /* 5.70:1 on this trade's fill */
}
[data-module="plumber"] {
    --ty-color-primary: var(--ty-domain-plumber);
    --ty-color-primary-ink: #075e73; --ty-color-primary-soft: #e2f4f8;
    --ty-color-primary-strong: #075e73; --ty-color-accent: #075e73;
    --ty-color-primary-contrast: #0f1720; /* 4.90:1 on this trade's fill */
}
[data-module="solar-installer"] {
    --ty-color-primary: var(--ty-domain-solar-installer);
    --ty-color-primary-ink: #b4460b; --ty-color-primary-soft: #fdeee3;
    --ty-color-primary-strong: #b4460b; --ty-color-accent: #b4460b;
    --ty-color-primary-contrast: #0f1720; /* 5.07:1 on this trade's fill */
}
[data-module="foot-care"] {
    --ty-color-primary: var(--ty-domain-foot-care);
    --ty-color-primary-ink: #9d174d; --ty-color-primary-soft: #fce7f3;
    --ty-color-primary-strong: #9d174d; --ty-color-accent: #9d174d;
    --ty-color-primary-contrast: #ffffff; /* 4.6:1 on this trade's fill (FB-310) */
}
[data-module="car-valeting"] {
    --ty-color-primary: var(--ty-domain-car-valeting);
    --ty-color-primary-ink: #334155; --ty-color-primary-soft: #e2e8f0;
    --ty-color-primary-strong: #334155; --ty-color-accent: #334155;
    --ty-color-primary-contrast: #ffffff; /* 7.5:1 on this trade's fill (FB-377) */
}
[data-module="roofer"] {
    --ty-color-primary: var(--ty-domain-roofer);
    --ty-color-primary-ink: #7c2d12; --ty-color-primary-soft: #fbeee6;
    --ty-color-primary-strong: #5c210d; --ty-color-accent: #7c2d12;
    --ty-color-primary-contrast: #ffffff; /* 9.4:1 on this trade's fill; ink on soft 8.3:1 */
}
[data-module="tiler"] {
    --ty-color-primary: var(--ty-domain-tiler);
    --ty-color-primary-ink: #3f6212; --ty-color-primary-soft: #eef6dc;
    --ty-color-primary-strong: #2f4a0d; --ty-color-accent: #3f6212;
    --ty-color-primary-contrast: #ffffff; /* 5.0:1 on this trade's fill; ink on soft 6.7:1 */
}
[data-module="painter-decorator"] {
    --ty-color-primary: var(--ty-domain-painter-decorator);
    --ty-color-primary-ink: #a21caf; --ty-color-primary-soft: #fae8ff;
    --ty-color-primary-strong: #86198f; --ty-color-accent: #a21caf;
    --ty-color-primary-contrast: #ffffff; /* 6.3:1 on this trade's fill; ink on soft 5.5:1 */
}
[data-module="plasterer"] {
    --ty-color-primary: var(--ty-domain-plasterer);
    --ty-color-primary-ink: #b91c1c; --ty-color-primary-soft: #fee2e2;
    --ty-color-primary-strong: #7f1d1d; --ty-color-accent: #b91c1c;
    --ty-color-primary-contrast: #ffffff; /* 6.5:1 on this trade's fill; ink on soft 5.3:1 */
}
/* ----------------------------------------------------------------------------
   LAYER 3 - the workspace's own accent ([data-tenant], /design/ui). MainLayout stamps the shell's box-less
   wrapper (.ty-tenant-scope) with data-tenant-brand and the computed --tt-* values (Core TenantTheme: every pairing already
   checked for AA) ONLY when the workspace's Branding module is on and it has set an accent of its own; this
   block maps them onto the semantic tokens. Components never read --tt-*, so the sidebar, buttons, active
   states and links take the colour with no per-component rule - and a trade surface inside the shell
   ([data-module], closer to the element) still wears its trade colour. The platform blue is the floor: with
   no accent the attribute is absent and none of this applies. Dark themes get the lightened ink/soft pair.
   ---------------------------------------------------------------------------- */
[data-tenant-brand] {
    --ty-color-primary: var(--tt-primary);
    --ty-color-primary-contrast: var(--tt-contrast);
    --ty-color-primary-ink: var(--tt-ink);
    --ty-color-primary-strong: var(--tt-ink);
    --ty-color-accent: var(--tt-ink);
    --ty-color-primary-soft: var(--tt-soft);
    --ty-nav-from: var(--tt-nav-from);
    --ty-nav-to: var(--tt-nav-to);
}
/* FB-225: the Preferences pink on a dark surface — a light ink and a deep tint (the fill stays the pin's pink). */
[data-bs-theme="dark"] {
    --ty-action-done-bg:    #218a40;
    --ty-action-paid-bg:    #14857b;
    --ty-action-invoice-bg: #5b52e0;
    --ty-action-replan-bg:  #f0b232;
    --ty-action-omw-bg:     #8b4ff0;
    --ty-action-skip-ink:   #f2a0a0;  --ty-action-skip-border: #7a3a3a;
    --ty-doc-tint-pct: 28%;
    --ty-color-sandbox:          #4CC26F;
    --ty-color-preferences-ink:  #f9a8d4;
    --ty-color-preferences-soft: #3b1230;
}
[data-bs-theme="dark"] [data-tenant-brand] {
    --ty-color-primary-ink: var(--tt-ink-dark);
    --ty-color-primary-strong: var(--tt-ink-dark);
    --ty-color-accent: var(--tt-ink-dark);
    --ty-color-primary-soft: var(--tt-soft-dark);
}
/* A primary button's hover fill is the "ink" elsewhere; for an arbitrary accent that can be the wrong side of
   the text colour, so the shell's own buttons use a hover fill computed with its own readable text. */
[data-tenant-brand] .btn-primary:not([data-module] *):hover,
[data-tenant-brand] .btn-primary:not([data-module] *):focus,
[data-tenant-brand] .btn-primary:not([data-module] *):active {
    color: var(--tt-hover-contrast);
    background-color: var(--tt-hover);
    border-color: var(--tt-hover);
}

[data-module="inspections"] {
    --ty-color-primary: var(--ty-domain-inspections);
    --ty-color-primary-ink: #9d174d; --ty-color-primary-soft: #fce7f3;
    --ty-color-primary-strong: #9d174d; --ty-color-accent: #9d174d;
    --ty-color-primary-contrast: #ffffff; /* 6.1:1 on the rose fill */
}
[data-module="surveys"] {
    --ty-color-primary: var(--ty-domain-surveys);
    --ty-color-primary-ink: #0f5f59; --ty-color-primary-soft: #e6f4f1;
    --ty-color-primary-strong: #0f5f59; --ty-color-accent: #0f5f59;
    --ty-color-primary-contrast: #ffffff; /* 5.9:1 on the teal fill */
}
[data-module="smart-survey"] {
    --ty-color-primary: var(--ty-domain-smart-survey);
    --ty-color-primary-ink: #2f6b14; --ty-color-primary-soft: #eaf5e0;
    --ty-color-primary-strong: #2a6212; --ty-color-accent: #2f6b14;
    --ty-color-primary-contrast: #0f1720; /* 6.65:1 on the lime fill; ink on soft 5.76:1, ink on white 6.49:1 */
}

/* On tablet & phone the app shell must never scroll horizontally — it keeps the fixed footer nav bar at the
   viewport width (so all its items show) and stops wide chrome (top-row, headers, cards) from forcing a
   horizontal scroll. Wide inner content (tables, card strips) keeps its own overflow-x:auto and scrolls
   locally. `hidden` is the fallback for a browser without `clip`; `clip` is what actually ships: `overflow-x: hidden` makes the
   element a scroll container (the other axis computes to auto), which makes every position:sticky below it - the top bar above
   all - resolve against that box instead of the window, so nothing sticks. `clip` cuts without becoming a scroller. */
@media (max-width: 1023.98px) {
    html, body { overflow-x: hidden; overflow-x: clip; }
}

/* A screen whose primary action is pinned to the bottom edge (the customer form's Save — .ty-pinned-action) owns
   that edge: the corner buttons (messages, the quick-add "+", a page's own action button) step aside rather than
   sit on top of it. Back the moment the form is gone. */
html:has(.ty-pinned-action) :is(.qa-fab, .comms-trigger, .ty-assist-trigger, .cl-fab, .cl-recfabs) { display: none !important; }

/* A task screen (.ty-task-screen — the canvass street and door screens) is a thumb-and-doorstep surface: the
   bottom edge belongs to the content. On a phone the corner buttons and the Documents sticky step aside (they
   are irrelevant to the task and sat on top of the door tiles), toasts collapse to the newest one and ride above
   the bottom bar, and the shell's own phone content clearance (--ty-content-clear) keeps the last row above the bar. */
@media (max-width: 47.99rem) {
    html:has(.ty-task-screen) :is(.qa-fab, .comms-trigger, .ty-assist-trigger, .cl-fab, .cl-recfabs, .dl-pull) { display: none !important; }
    html:has(.ty-task-screen) .ty-toast-host { top: auto; bottom: var(--ty-toast-bottom); }
    html:has(.ty-task-screen) .ty-toast-host > .ty-toast:not(:last-child) { display: none; }
}

/* Full-height right-hand drawers that predate TyDetailPanel (which pads itself the same way): on a phone each one
   covers the whole screen, so on an edge-to-edge host its header went under the status bar and its last row under
   the navigation bar. Every one is a flex column with its own inner scroller, so padding the box is enough. One
   grouped rule rather than eight copies; 0 on desktop. Read the tokens, never env() alone (Android's WebView reports
   only cutouts there — the head sets --ty-safe-* natively). */
:root :is(.hb-panel, .vd-drawer, .sf-drawer, .ty-assist-panel, .comms-drawer, .gd-drawer, .pl-drawer, .el-drawer, .so-drawer) {
    padding-top: var(--ty-safe-top, env(safe-area-inset-top, 0px));
    padding-right: var(--ty-safe-right, env(safe-area-inset-right, 0px));
    padding-bottom: var(--ty-safe-bottom, env(safe-area-inset-bottom, 0px));
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ----------------------------------------------------------------------------
   .ty-badge-quiet - the neutral count/label badge.

   Replaces Bootstrap's `bg-light text-dark` / `text-bg-light`, which are POLARITY-FIXED:
   Bootstrap 5.3's dark mode deliberately leaves --bs-light-rgb and --bs-dark-rgb alone
   (so `.bg-light` still means "literally light"), which paints a near-white pill with
   near-black text on Graft's slate cards. Token-driven, so it flips with the theme.
   Pair with Bootstrap's own `.badge` for the sizing/shape.
   ---------------------------------------------------------------------------- */
.badge.ty-badge-quiet {
    background-color: var(--ty-color-surface-sunken, #f3f5f8);
    color: var(--ty-color-text-muted, #57606a);
}

/* ============================================================================
   TradeYoke loaders — a reusable, branded set of loading indicators + skeletons.
   Pure CSS (no images), theme-aware via the --ty-* tokens, and defined here in the
   globally-loaded app.css so EVERY layer can use them by class name (like Bootstrap's
   spinner-border) — the shell, capability modules AND domain RCLs, none of which can
   share a Razor component but all load this stylesheet. Colour follows --ty-color-primary,
   so the yoke turns window-cleaning blue / gardening green under a [data-module] surface.

   Primary spinner (the logo's two rings + bar, rotating with a gentle pulse):
     <span class="ty-spinner" role="status" aria-label="Loading">
       <span class="ty-spinner__bar"></span>
       <span class="ty-spinner__ring ty-spinner__ring--l"></span>
       <span class="ty-spinner__ring ty-spinner__ring--r"></span>
     </span>
   Sizes: ty-spinner--xs (inline/buttons) · ty-spinner--sm · (default) · ty-spinner--lg.
   Centred section loader:  <div class="ty-load"><span class="ty-spinner">…</span><span class="ty-load__cap">Loading…</span></div>
   Blocking overlay:        wrap content in position:relative and add <div class="ty-loadveil">…</div>
   Skeletons:               <span class="ty-sk" style="width:60%;height:11px"></span>  (see ty-sk--circle / ty-skrow)
   ============================================================================ */

.ty-spinner {
    --ty-spin-sz: 3.5rem;
    position: relative;
    display: inline-block;
    width: var(--ty-spin-sz);
    height: var(--ty-spin-sz);
    color: var(--ty-color-primary, #1e6fd9);
    flex: none;
    animation: ty-spin 1.4s cubic-bezier(.65, 0, .35, 1) infinite;
}
.ty-spinner--xs { --ty-spin-sz: 1.15rem; }
.ty-spinner--sm { --ty-spin-sz: 2.25rem; }
.ty-spinner--lg { --ty-spin-sz: 4.75rem; }

.ty-spinner__bar {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 74%;
    height: calc(var(--ty-spin-sz) * .12);
    min-height: 2px;
    border-radius: 99px;
    background: currentColor;
    opacity: .9;
}
.ty-spinner__ring {
    position: absolute;
    top: 50%;
    width: calc(var(--ty-spin-sz) * .43);
    height: calc(var(--ty-spin-sz) * .43);
    border: calc(var(--ty-spin-sz) * .1) solid currentColor;
    border-radius: 999px;
    transform: translateY(-50%) scale(.82);
}
.ty-spinner__ring--l { left: 0; animation: ty-spin-pulse 1.4s ease-in-out infinite; }
.ty-spinner__ring--r { right: 0; animation: ty-spin-pulse 1.4s ease-in-out infinite .7s; }

/* The "tee" candidates (BrandMarkCatalog, selectable in Management): a stem drops from the middle of the bar, so
   the bar reads as a T. A pseudo-element, so none of the fifty-odd places that write the spinner markup change, and it
   turns with the rest of the mark. Kept inside the box (.5 + .42) so a spinning stem never sweeps a neighbour.
   The default logo, the plain yoke, has no stem. */
[data-ty-mark="tee"] .ty-spinner::after,
[data-ty-mark="tee-high"] .ty-spinner::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateX(-50%);
    width: calc(var(--ty-spin-sz) * .12);
    min-width: 2px;
    height: calc(var(--ty-spin-sz) * .42);
    border-radius: 99px;
    background: currentColor;
    opacity: .9;
}

/* Candidate mark "tee-high": the beam rises to the top of the rings and the stem ends square. After the shared
   rule above on purpose — same specificity, so the later one wins. */
[data-ty-mark="tee-high"] .ty-spinner__bar {
    top: calc(50% - var(--ty-spin-sz) * .119);
}

[data-ty-mark="tee-high"] .ty-spinner::after {
    top: calc(50% - var(--ty-spin-sz) * .119);
    height: calc(var(--ty-spin-sz) * .49);
    border-radius: 0;
}

/* The same rule for any inline 64x48 yoke SVG (reconnect dialog, release-note badge, the job mark): wrap the
   shapes in <g class="ty-mark-g"> and put <rect class="ty-mark-stem"> first. The lift is in SVG user units. */
.ty-mark-stem {
    display: none;
}

[data-ty-mark="tee"] .ty-mark-stem {
    display: inline;
}

[data-ty-mark="tee"] .ty-mark-g {
    transform: translateY(-6.5px);
}

/* Candidate mark "tee-high": its own square-ended stem (second in the markup), the beam lifted, a smaller lift overall. */
.ty-mark-stem-hi {
    display: none;
}

[data-ty-mark="tee-high"] .ty-mark-stem-hi {
    display: inline;
}

[data-ty-mark="tee-high"] .ty-mark-beam {
    transform: translateY(-5px);
}

[data-ty-mark="tee-high"] .ty-mark-g {
    transform: translateY(-3.3px);
}

@keyframes ty-spin { to { transform: rotate(360deg); } }
@keyframes ty-spin-pulse {
    0%, 100% { transform: translateY(-50%) scale(.82); opacity: .55; }
    50% { transform: translateY(-50%) scale(1.06); opacity: 1; }
}

/* Centred section loader (spinner + optional caption). */
.ty-load {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .9rem;
    padding: 2.5rem 1rem;
    text-align: center;
}
.ty-load__cap { font-size: .8rem; color: var(--ty-color-text-subtle, #8a95a1); }
.ty-load__title { font-size: .85rem; font-weight: 600; color: var(--ty-color-text, #1c2128); }

/* Blocking overlay for a first-paint / refresh — sits over the (usually skeleton) content. */
.ty-loadveil {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .85rem;
    background: var(--ty-color-surface, #fff);
    background: color-mix(in srgb, var(--ty-color-surface, #fff) 80%, transparent);
    backdrop-filter: blur(2px);
}

/* Skeleton placeholder — shape it inline (width/height) to mirror the content that's coming. */
.ty-sk {
    display: block;
    border-radius: 7px;
    background: linear-gradient(90deg,
        var(--ty-color-surface-3, #eef1f4) 25%,
        var(--ty-color-surface-2, #e2e7ec) 37%,
        var(--ty-color-surface-3, #eef1f4) 63%);
    background-size: 400% 100%;
    animation: ty-sk-shimmer 1.3s ease-in-out infinite;
}
.ty-sk--circle { border-radius: 999px; }
.ty-sk--pill { border-radius: 999px; }
.ty-skrow {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem .9rem;
    border-bottom: 1px solid var(--ty-color-border, #f2f4f7);
}
.ty-skrow:last-child { border-bottom: none; }

@keyframes ty-sk-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* Respect users who've asked for less motion — hold a calm static state. */
@media (prefers-reduced-motion: reduce) {
    .ty-spinner,
    .ty-spinner__ring--l,
    .ty-spinner__ring--r { animation: none; }
    .ty-spinner__ring { transform: translateY(-50%) scale(1); opacity: .85; }
    .ty-sk { animation: none; }
}

/* ── Anonymous auth pages (registration, email confirmation) ─────────────────────────────────────────
   One calm, chrome-free column on the empty layout: brand mark, heading, a single reassurance line, then
   the controls. Deliberately NOT the admin-form look — this is the first screen anyone sees of the
   product. Global rather than scoped CSS because /signup and /verify share it, so the journey never
   changes visual language mid-flow. Everything is a --ty-* semantic token, so the platform themes and
   their dark surfaces come for free. */

.ty-auth {
    width: 100%;
    max-width: 25rem;
    margin: 0 auto;
    padding: clamp(var(--ty-space-2xl, 32px), 8vh, 5rem) var(--ty-space-lg, 16px) var(--ty-space-3xl, 48px);
}

.ty-auth__mark {
    display: block;
    width: 2.75rem;
    height: 2.75rem;
    margin: 0 auto var(--ty-space-xl, 24px);
    border-radius: var(--ty-radius-card, 12px);
}

/* The sign-in pages' mark follows the platform's logo choice (BrandMarkCatalog). The <img> names favicon.svg, the
   current mark; `content` swaps the picture without touching the four pages that write it. */
[data-ty-mark="tee"] .ty-auth__mark {
    content: url("favicon-tee.svg");
}

[data-ty-mark="tee-high"] .ty-auth__mark {
    content: url("favicon-high.svg");
}

/* "Stacked logo" (BrandMarkCatalog.Lockup): wherever the app shows its MAIN logo, it is the yoke over TRADEYOKE.
   Small marks, spinners and the tab icon stay the plain yoke — that is data-ty-mark="classic", stamped with it. */
[data-ty-logo="stacked"] .ty-auth__mark {
    content: url("brand/tradeyoke-lockup.svg");
    width: 10rem;
    height: auto;
    border-radius: 0;
}

[data-ty-logo="stacked"][data-bs-theme="dark"] .ty-auth__mark {
    content: url("brand/tradeyoke-lockup-dark.svg");
}

/* The sidebar brand, only when it is the product's own (no tenant logo, no white-label name): the stacked logo
   replaces the mark-beside-name. `html…[data-ty-mark]` lifts this above the themes' own scoped .navbar-brand::before rules. */
html[data-ty-logo="stacked"][data-ty-mark] .navbar-brand.navbar-brand--product::before {
    content: "";
    display: block;
    flex: none;
    width: 96px;
    height: 47px;
    /* The sidebar is a DARK slab in the default and Graft themes whatever the page theme is, so it takes the
       light-on-dark lockup unconditionally: the ink TRADE of the light lockup was dark text on the dark gradient and the
       sidebar showed only "YOKE" (store screenshots, 2026-10-10). The artwork itself is unchanged - same geometry,
       the variant that already exists for dark surfaces. */
    background: url("brand/tradeyoke-lockup-dark.svg") center / contain no-repeat;
}

/* Trusty is the one theme with a LIGHT sidebar: there the ink lockup reads (and its own dark mode flips back above). */
html[data-ty-logo="stacked"][data-ty-mark][data-theme="trusty"]:not([data-bs-theme="dark"]) .navbar-brand.navbar-brand--product::before {
    background-image: url("brand/tradeyoke-lockup.svg");
}

/* Test (sandbox) workspace (owner 2026-10-23): the product mark turns GREEN instead of a separate flask icon in the top bar.
   The shell stamps data-sandbox="true" on the brand link; the colour comes from the --ty-color-sandbox / --ty-sandbox-hue
   tokens (set on :root and re-pointed in dark). The hue rotation takes the blue artwork (blue yoke + TRADEYOKE) to green and
   leaves the white strokes white; a tenant's own uploaded logo is never recoloured. */
html .navbar-brand[data-sandbox="true"]::before {
    filter: hue-rotate(var(--ty-sandbox-hue, -76deg)) saturate(1.15);
}
html .navbar-brand[data-sandbox="true"]:not(.navbar-brand--branded) .navbar-brand-name {
    color: var(--ty-color-sandbox, #2E9E4F);
}
html[data-ty-logo="stacked"][data-ty-mark] .navbar-brand.navbar-brand--product[data-sandbox="true"] .navbar-brand-name { color: inherit; }

/* The name is in the picture; keep it for screen readers only. */
html[data-ty-logo="stacked"][data-ty-mark] .navbar-brand.navbar-brand--product .navbar-brand-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Outcome screens (check your email, link expired) lead with a state icon instead of the brand mark. */
.ty-auth__icon {
    width: 3.25rem;
    height: 3.25rem;
    margin: 0 auto var(--ty-space-lg, 16px);
    display: grid;
    place-items: center;
    border-radius: var(--ty-radius-pill, 999px);
    font-size: 1.5rem;
    background: var(--ty-color-primary-soft, #eaf2fd);
    color: var(--ty-color-primary, #1E6FD9);
}

.ty-auth__icon--good {
    background: var(--ty-color-success-soft, #e6f6ea);
    color: var(--ty-color-success-ink, #1a7f37);
}

.ty-auth__icon--warn {
    background: var(--ty-color-warning-soft, #fdf1dd);
    color: var(--ty-color-warning-ink, #9a5b00);
}

.ty-auth__title {
    margin: 0 0 var(--ty-space-sm, 8px);
    font-size: clamp(1.6rem, 1.2rem + 1.6vw, var(--ty-font-2xl, 32px));
    font-weight: var(--ty-weight-semibold, 600);
    line-height: var(--ty-line-heading, 1.25);
    letter-spacing: var(--ty-tracking-tight, -.02em);
    color: var(--ty-color-text, #1c2128);
    text-align: center;
    text-wrap: balance;
}

.ty-auth__lede {
    margin: 0 0 var(--ty-space-xl, 24px);
    color: var(--ty-color-text-muted, #57606a);
    line-height: var(--ty-line-body, 1.5);
    text-align: center;
    text-wrap: pretty;
}

.ty-auth__step {
    margin: 0 0 var(--ty-space-sm, 8px);
    font-size: var(--ty-font-xs, 12px);
    font-weight: var(--ty-weight-semibold, 600);
    letter-spacing: var(--ty-tracking-wide, .12em);
    text-transform: uppercase;
    text-align: center;
    color: var(--ty-color-text-subtle, #8a95a1);
}

/* FB-227: the sign-up's two-step indicator (Business details → Services) under the "Step n of m" line. */
.ty-auth__steps {
    display: flex;
    /* FB-305: up to four steps (Companies House joins on the limited company route) - wrap rather than run off a phone. */
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--ty-space-sm, 8px);
    margin: 0 0 var(--ty-space-md, 12px);
    padding: 0;
    list-style: none;
}
.ty-auth__steps li {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    gap: 6px;
    padding: 4px 12px 4px 4px;
    border-radius: 999px;
    border: 1px solid var(--ty-color-border, #d0d7de);
    font-size: var(--ty-font-sm, 14px);
    font-weight: var(--ty-weight-semibold, 600);
    color: var(--ty-color-text-muted, #57606a);
    background: var(--ty-color-surface, #fff);
}
.ty-auth__steps-dot {
    width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    font-size: 12px;
    background: var(--ty-color-surface-muted, #eef1f4);
}
.ty-auth__steps li.is-current {
    border-color: var(--ty-color-primary, #1e6fd9);
    color: var(--ty-color-text, #1c2128);
}
.ty-auth__steps li.is-current .ty-auth__steps-dot { background: var(--ty-color-primary, #1e6fd9); color: var(--ty-color-primary-contrast, #fff); }
.ty-auth__steps li.is-done .ty-auth__steps-dot { background: var(--ty-color-success, #2e9e4f); color: #fff; }

/* FB-227: the brief in-place progress after Create (no click-through): the yoke, then three lines that tick. */
.ty-auth__provision {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--ty-space-md, 12px);
    padding: var(--ty-space-xl, 24px) 0;
}
.ty-auth__provision .ty-auth__title { margin-top: var(--ty-space-sm, 8px); }
.ty-auth__provision-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; min-width: min(20rem, 100%); }
.ty-auth__provision-steps li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: var(--ty-weight-semibold, 600);
    color: var(--ty-color-text-subtle, #8a95a1);
    transition: color .25s ease;
}
.ty-auth__provision-steps li.is-active,
.ty-auth__provision-steps li.is-done { color: var(--ty-color-text, #1c2128); }
.ty-auth__provision-dot {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    border: 2px solid var(--ty-color-border, #d0d7de);
    font-size: 13px;
    color: #fff;
    transition: background-color .25s ease, border-color .25s ease, transform .25s ease;
}
.ty-auth__provision-steps li.is-active .ty-auth__provision-dot {
    border-color: var(--ty-color-primary, #1e6fd9);
    border-top-color: transparent;
    animation: ty-provision-spin .8s linear infinite;
}
.ty-auth__provision-steps li.is-done .ty-auth__provision-dot {
    border-color: var(--ty-color-success, #2e9e4f);
    background: var(--ty-color-success, #2e9e4f);
    animation: ty-provision-pop .3s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes ty-provision-spin { to { transform: rotate(360deg); } }
@keyframes ty-provision-pop { from { transform: scale(.6); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
    .ty-auth__provision-steps li .ty-auth__provision-dot { animation: none !important; transition: none; }
    .ty-auth__provision-steps li.is-active .ty-auth__provision-dot { border-top-color: var(--ty-color-primary, #1e6fd9); }
}

/* FB-227: Companies House matches under the business name. */
.ty-auth__matches {
    margin-top: var(--ty-space-sm, 8px);
    border: 1px solid var(--ty-color-border, #d0d7de);
    border-radius: var(--ty-radius-control, 12px);
    background: var(--ty-color-surface, #fff);
    overflow: hidden;
}
.ty-auth__matches ul { list-style: none; margin: 0; padding: 0; max-height: 15rem; overflow-y: auto; }
.ty-auth__matches-hd,
.ty-auth__matches-ft {
    margin: 0;
    padding: 6px 12px;
    font-size: var(--ty-font-xs, 12px);
    color: var(--ty-color-text-subtle, #8a95a1);
}
.ty-auth__matches-hd { font-weight: var(--ty-weight-semibold, 600); text-transform: uppercase; letter-spacing: .06em; }
.ty-auth__matches-ft { border-top: 1px solid var(--ty-color-border, #d0d7de); }
.ty-auth .ty-auth__match {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 0;
    border-top: 1px solid var(--ty-color-border-subtle, #eef1f4);
    background: transparent;
    color: var(--ty-color-text, #1c2128);
    text-align: left;
    font: inherit;
    cursor: pointer;
}
.ty-auth .ty-auth__match:hover,
.ty-auth .ty-auth__match:focus-visible { background: var(--ty-color-primary-soft, rgba(30, 111, 217, .08)); outline: none; }
.ty-auth__match-name { font-weight: var(--ty-weight-semibold, 600); }
.ty-auth__match-meta { font-size: var(--ty-font-xs, 12px); color: var(--ty-color-text-muted, #57606a); }
.ty-auth__match.is-inactive .ty-auth__match-name { color: var(--ty-color-text-muted, #57606a); }
.ty-auth__company {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: var(--ty-space-sm, 8px);
    padding: 10px 12px;
    border-radius: var(--ty-radius-control, 12px);
    background: var(--ty-color-success-soft, #e3f5e9);
    color: var(--ty-color-text, #1c2128);
    font-size: var(--ty-font-sm, 14px);
}
.ty-auth__company > i { font-size: 1.2rem; color: var(--ty-color-success-ink, #1a7f37); }
.ty-auth__company-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.ty-auth__company-text span { font-size: var(--ty-font-xs, 12px); color: var(--ty-color-text-muted, #57606a); }

/* FB-305: "How is your business set up?" - two big, plain choice cards (Sole trader / Limited company), stacked so each
   reads as a sentence on a phone. A real radio pair (role="radio" + aria-checked), well over the 44px target, in the
   theme's primary colour (never a literal). Scoped .ty-auth .ty-auth__… so platform themes' button rules cannot win. */
.ty-auth__choices { display: grid; gap: var(--ty-space-sm, 8px); }
.ty-auth .ty-auth__choice {
    display: flex;
    align-items: center;
    gap: var(--ty-space-md, 12px);
    width: 100%;
    min-height: 4.5rem;
    padding: var(--ty-space-md, 12px) var(--ty-space-md, 12px);
    border: 1px solid var(--ty-color-border-strong, #d0d7de);
    border-radius: var(--ty-radius-card, 12px);
    background: var(--ty-color-surface, #fff);
    color: var(--ty-color-text, #1c2128);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.ty-auth .ty-auth__choice:hover { border-color: var(--ty-color-primary, #1E6FD9); }
.ty-auth .ty-auth__choice:focus-visible { outline: 2px solid var(--ty-color-primary, #1E6FD9); outline-offset: 2px; }
.ty-auth .ty-auth__choice[aria-checked="true"] {
    border-color: var(--ty-color-primary, #1E6FD9);
    box-shadow: inset 0 0 0 1px var(--ty-color-primary, #1E6FD9);
    background: var(--ty-color-primary-soft, #eaf2fd);
}
.ty-auth .ty-auth__choice-icon {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: var(--ty-color-primary-soft, #eaf2fd);
    color: var(--ty-color-primary, #1E6FD9);
    font-size: 1.35rem;
}
.ty-auth .ty-auth__choice[aria-checked="true"] .ty-auth__choice-icon { background: var(--ty-color-surface, #fff); }
.ty-auth .ty-auth__choice-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.ty-auth .ty-auth__choice-text strong { font-size: 1rem; font-weight: var(--ty-weight-semibold, 600); }
.ty-auth .ty-auth__choice-text span { font-size: var(--ty-font-sm, 14px); color: var(--ty-color-text-muted, #57606a); }
.ty-auth .ty-auth__choice-mark { flex: none; font-size: 1.25rem; color: var(--ty-color-text-muted, #57606a); }
.ty-auth .ty-auth__choice[aria-checked="true"] .ty-auth__choice-mark { color: var(--ty-color-primary, #1E6FD9); }
@media (prefers-reduced-motion: no-preference) {
    .ty-auth .ty-auth__choice { transition: border-color var(--ty-motion-micro, 120ms) var(--ty-ease, ease), background-color var(--ty-motion-micro, 120ms) var(--ty-ease, ease); }
    .ty-auth .ty-auth__choice:active { transform: scale(.98); }
}

/* Federated buttons: full width, quiet surface, the provider mark pinned left with the label optically
   centred — the shape a registration page is expected to have.

   NOTE the .ty-auth ancestor on every rule below that colours an ANCHOR. The platform themes carry
   `[data-theme="…"] a { color: var(--ty-color-primary) }`, which is specificity (0,1,1) and would beat a
   lone class — an anchor styled as a button then renders its label in the same blue as its own
   background, i.e. invisible. Two classes (0,2,0) wins without resorting to !important. */
.ty-auth .ty-auth__provider {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--ty-space-sm, 8px);
    width: 100%;
    min-height: 3rem;
    margin-bottom: var(--ty-space-sm, 8px);
    padding: 0 var(--ty-space-xl, 24px);
    border: 1px solid var(--ty-color-border-strong, #d0d7de);
    border-radius: var(--ty-radius-control, 8px);
    background: var(--ty-color-surface, #fff);
    color: var(--ty-color-text, #1c2128);
    font-weight: var(--ty-weight-medium, 500);
    text-decoration: none;
    transition: background var(--ty-motion-micro, 120ms) var(--ty-ease, ease),
                border-color var(--ty-motion-micro, 120ms) var(--ty-ease, ease);
}

.ty-auth .ty-auth__provider:hover {
    background: var(--ty-color-surface-2, #f6f8fa);
    border-color: var(--ty-color-text-subtle, #8a95a1);
    color: var(--ty-color-text, #1c2128);
}

.ty-auth .ty-auth__provider i {
    position: absolute;
    left: var(--ty-space-lg, 16px);
    font-size: 1.125rem;
}

/* The app's in-app doors (InAppSignInDoors) are buttons, not anchors: same face, and a held state while one runs. */
button.ty-auth__provider { font: inherit; font-weight: var(--ty-weight-medium, 500); cursor: pointer; }
.ty-auth .ty-auth__provider:disabled { opacity: .65; cursor: default; }

/* "No passkey on this device yet" and the phone hand-off on the confirmation page: a notice with a heading line. */
.ty-auth .ty-login__nopasskey,
.ty-auth .ty-phone-handoff { margin-bottom: var(--ty-space-md, 12px); align-items: flex-start; }
.ty-auth .ty-login__nopasskey strong,
.ty-auth .ty-phone-handoff strong { color: var(--ty-color-text, #1c2128); }

/* "That provider isn't wired here." Information, not failure — the email door beside it still works, so
   this reads quieter than .ty-auth__alert and carries no red. */
.ty-auth__notice {
    display: flex;
    gap: var(--ty-space-sm, 8px);
    margin: var(--ty-space-sm, 8px) 0 0;
    padding: var(--ty-space-md, 12px) var(--ty-space-lg, 16px);
    border-radius: var(--ty-radius-card, 12px);
    background: var(--ty-color-surface-2, #f6f8fa);
    color: var(--ty-color-text-muted, #57606a);
    font-size: var(--ty-font-sm, 14px);
    line-height: var(--ty-line-body, 1.5);
    text-wrap: pretty;
}

.ty-auth__divider {
    display: flex;
    align-items: center;
    gap: var(--ty-space-md, 12px);
    margin: var(--ty-space-xl, 24px) 0;
    color: var(--ty-color-text-subtle, #8a95a1);
    font-size: var(--ty-font-sm, 14px);
}

.ty-auth__divider::before,
.ty-auth__divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--ty-color-border, #e7ebf0);
}

.ty-auth__field { margin-bottom: var(--ty-space-lg, 16px); }

.ty-auth__label {
    display: block;
    margin-bottom: var(--ty-space-xs, 4px);
    font-size: var(--ty-font-sm, 14px);
    font-weight: var(--ty-weight-medium, 500);
    color: var(--ty-color-text, #1c2128);
}

.ty-auth__input {
    display: block;
    width: 100%;
    min-height: 3rem;
    padding: var(--ty-space-sm, 8px) var(--ty-space-md, 12px);
    border: 1px solid var(--ty-color-border-strong, #d0d7de);
    border-radius: var(--ty-radius-control, 8px);
    background: var(--ty-color-surface, #fff);
    color: var(--ty-color-text, #1c2128);
    font-family: inherit;
    /* 16px floor: anything smaller and iOS Safari zooms the page on focus. */
    font-size: var(--ty-font-base-size, 16px);
    line-height: var(--ty-line-body, 1.5);
}

.ty-auth__input:focus {
    outline: 2px solid transparent;
    border-color: var(--ty-color-primary, #1E6FD9);
    box-shadow: var(--ty-focus-ring, 0 0 0 .2rem rgba(30, 111, 217, .35));
}

/* Blazor stamps `valid modified` on every touched EditForm input, and the template rule above paints
   that a green outline. On a page this plain it reads as an alert about nothing — the field being fine
   is the default, not news. Errors still speak, through .is-invalid below.
   The :not() mirrors the rule being neutralised because BOTH themes restate it under their own
   [data-theme] prefix, which ties this on class count and then wins on load order — matching their
   shape puts this one specificity point ahead of both. */
.ty-auth .ty-auth__input.valid.modified:not([type=checkbox]) { outline: none; }

.ty-auth__input[readonly] {
    background: var(--ty-color-surface-2, #f6f8fa);
    color: var(--ty-color-text-muted, #57606a);
}

/* Same is-invalid class name the rest of the app's forms use, so the shared FieldValidationState UX
   holds here too — restyled to this page's language rather than Bootstrap's. */
.ty-auth__input.is-invalid,
.ty-auth__input.is-invalid:focus {
    border-color: var(--ty-color-danger, #e50000);
}

.ty-auth__input.is-invalid:focus {
    box-shadow: 0 0 0 .2rem var(--ty-color-danger-soft, #fdecec);
}

.ty-auth__hint {
    margin: var(--ty-space-xs, 4px) 0 0;
    font-size: var(--ty-font-sm, 14px);
    color: var(--ty-color-text-muted, #57606a);
}

/* The live password-requirements checklist (Signup step 1): shown up front, unmet items neutral, met items
   turn green as the person types — never colour alone (WCAG AA), the icon shape (circle vs filled check)
   carries the same meaning. */
.ty-auth__pw-checklist {
    list-style: none;
    margin: var(--ty-space-xs, 4px) 0 0;
    padding: 0;
    display: grid;
    gap: 2px;
}

.ty-auth__pw-item {
    display: flex;
    align-items: center;
    gap: var(--ty-space-xs, 4px);
    font-size: var(--ty-font-sm, 14px);
    color: var(--ty-color-text-muted, #57606a);
}

.ty-auth__pw-item i { font-size: .8rem; }

.ty-auth__pw-item--met {
    color: var(--ty-color-success-ink, #1a7f37);
}

.ty-auth__pw-item--met i { color: var(--ty-color-success, #26b050); }

/* The consent tick: a quiet footnote-sized row, but a real gate — see .ty-auth__checkbox.is-invalid. */
.ty-auth__check {
    display: flex;
    align-items: flex-start;
    gap: var(--ty-space-sm, 8px);
    font-size: var(--ty-font-sm, 14px);
    line-height: var(--ty-line-body, 1.5);
    color: var(--ty-color-text-muted, #57606a);
    cursor: pointer;
    text-wrap: pretty;
}

.ty-auth .ty-auth__checkbox {
    flex: none;
    width: 1.15rem;
    height: 1.15rem;
    margin-top: .15rem;                       /* optically level with the first line of text */
    accent-color: var(--ty-color-primary, #1E6FD9);
    cursor: pointer;
}

/* A checkbox has no border of its own to redden, so the invalid state is an outline — same is-invalid
   marker as the text fields, and the same specificity shape as the theme rule it has to outrank. */
.ty-auth .ty-auth__checkbox.is-invalid:not([type=text]) {
    outline: 2px solid var(--ty-color-danger, #e50000);
    outline-offset: 2px;
}

.ty-auth__error {
    margin: var(--ty-space-xs, 4px) 0 0;
    font-size: var(--ty-font-sm, 14px);
    font-weight: var(--ty-weight-medium, 500);
    color: var(--ty-color-danger-ink, #b32121);
}

.ty-auth__alert {
    margin: 0 0 var(--ty-space-lg, 16px);
    padding: var(--ty-space-md, 12px) var(--ty-space-lg, 16px);
    border: 1px solid var(--ty-color-danger-border, #f4d3cf);
    border-radius: var(--ty-radius-card, 12px);
    background: var(--ty-color-danger-soft, #fdecec);
    color: var(--ty-color-danger-ink, #b32121);
    line-height: var(--ty-line-body, 1.5);
}

.ty-auth .ty-auth__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--ty-space-sm, 8px);
    width: 100%;
    min-height: 3rem;
    margin-top: var(--ty-space-xl, 24px);
    padding: 0 var(--ty-space-lg, 16px);
    border: 1px solid transparent;
    border-radius: var(--ty-radius-control, 8px);
    background: var(--ty-color-primary, #1E6FD9);
    color: var(--ty-color-primary-contrast, #fff);
    font-family: inherit;
    font-size: var(--ty-font-base-size, 16px);
    font-weight: var(--ty-weight-semibold, 600);
    text-decoration: none;
    cursor: pointer;
    transition: background var(--ty-motion-micro, 120ms) var(--ty-ease, ease);
}

.ty-auth .ty-auth__submit:hover:not(:disabled) {
    background: var(--ty-color-primary-strong, #1457b0);
    color: var(--ty-color-primary-contrast, #fff);
}

.ty-auth .ty-auth__submit:disabled { opacity: .65; cursor: default; }

.ty-auth .ty-auth__submit--quiet {
    background: var(--ty-color-surface, #fff);
    border-color: var(--ty-color-border-strong, #d0d7de);
    color: var(--ty-color-text, #1c2128);
}

.ty-auth .ty-auth__submit--quiet:hover:not(:disabled) {
    background: var(--ty-color-surface-2, #f6f8fa);
    color: var(--ty-color-text, #1c2128);
}

.ty-auth .ty-auth__provider:focus-visible,
.ty-auth .ty-auth__submit:focus-visible,
.ty-auth .ty-auth__trade:focus-visible {
    outline: 2px solid transparent;
    box-shadow: var(--ty-focus-ring, 0 0 0 .2rem rgba(30, 111, 217, .35));
}

.ty-auth__foot {
    margin: var(--ty-space-xl, 24px) 0 0;
    text-align: center;
    color: var(--ty-color-text-muted, #57606a);
    font-size: var(--ty-font-sm, 14px);
}

/* An in-sentence action that is a <button> (it changes the page, not the URL) but must read like the links
   beside it — "Wrong address, or nothing arriving? Start again". Scoped under .ty-auth for the theme rule
   that otherwise recolours anchors/buttons (see the CSS trap noted on .ty-auth__submit). */
.ty-auth .ty-auth__link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--ty-color-primary-ink, #1457b0);
    font: inherit;
    font-weight: var(--ty-weight-semibold, 600);
    text-decoration: underline;
    cursor: pointer;
}

.ty-auth .ty-auth__link-button:focus-visible {
    outline: 2px solid transparent;
    box-shadow: var(--ty-focus-ring, 0 0 0 .2rem rgba(30, 111, 217, .35));
}

.ty-auth__back {
    display: inline-flex;
    align-items: center;
    gap: var(--ty-space-xs, 4px);
    margin-top: var(--ty-space-lg, 16px);
    padding: 0;
    border: 0;
    background: none;
    color: var(--ty-color-text-muted, #57606a);
    font: inherit;
    font-size: var(--ty-font-sm, 14px);
    cursor: pointer;
}

.ty-auth__back:hover { color: var(--ty-color-text, #1c2128); }

/* Trade picker — selectable tiles in each trade's own colour rather than a column of checkboxes. An
   incompatible combination stays visible but unavailable, so the rule can be seen rather than guessed. */
.ty-auth__trades {
    display: grid;
    /* auto-fill, not auto-fit: a short line (Health & Beauty has one trade today) keeps its empty tracks, so its tiles are
       exactly as wide as the Home & Trades ones above it; every row the same height, sized for the longest name wrapped on a phone. */
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    grid-auto-rows: minmax(4.125rem, auto);
    gap: var(--ty-space-sm, 8px);
    margin: 0;
    padding: 0;
    border: 0;
}

/* Each tile is one trade: its --d colour comes from the module theme (set inline), never a literal here.
   Static state (selected / disabled / focus) is plain CSS so it reads with motion off; everything that MOVES
   lives in the prefers-reduced-motion: no-preference block below. Rules are scoped .ty-auth .ty-auth__... so the
   platform themes' button/anchor colour rules cannot outrank them. */
.ty-auth .ty-auth__trade {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    gap: var(--ty-space-sm, 8px);
    height: 100%;
    min-height: 4.125rem;
    padding: var(--ty-space-sm, 8px) var(--ty-space-md, 12px);
    border: 1px solid var(--ty-color-border-strong, #d0d7de);
    border-radius: var(--ty-radius-control, 8px);
    background: var(--ty-color-surface, #fff);
    color: var(--ty-color-text, #1c2128);
    font: inherit;
    font-size: var(--ty-font-sm, 14px);
    font-weight: var(--ty-weight-medium, 500);
    text-align: left;
    cursor: pointer;
}

/* The colour that floods the tile when chosen. It sits behind the content (isolation + z-index) and is
   revealed by clip-path so nothing changes size. */
.ty-auth .ty-auth__trade::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: color-mix(in srgb, var(--d, var(--ty-color-primary, #1E6FD9)) 10%, var(--ty-color-surface, #fff));
    clip-path: circle(0% at 1.6rem 50%);
}

.ty-auth .ty-auth__trade-icon {
    position: relative;
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--d, var(--ty-color-primary, #1E6FD9)) 12%, var(--ty-color-surface, #fff));
}

.ty-auth .ty-auth__trade-icon i { font-size: 1.125rem; line-height: 1; color: var(--d, var(--ty-color-primary, #1E6FD9)); }

.ty-auth .ty-auth__trade:hover:not(:disabled) { border-color: var(--d, var(--ty-color-primary, #1E6FD9)); }

.ty-auth .ty-auth__trade[aria-pressed="true"] {
    border-color: var(--d, var(--ty-color-primary, #1E6FD9));
    box-shadow: inset 0 0 0 1px var(--d, var(--ty-color-primary, #1E6FD9));
}

.ty-auth .ty-auth__trade[aria-pressed="true"]::before { clip-path: circle(150% at 1.6rem 50%); }

/* Can't be combined with what is chosen: flat, desaturated, dashed and locked - not merely faded, so the
   text keeps AA contrast (muted text on the quiet surface) rather than being halved by opacity. */
.ty-auth .ty-auth__trade:disabled {
    border-style: dashed;
    border-color: var(--ty-color-border, #d0d7de);
    background: var(--ty-color-surface-2, #f6f8fa);
    color: var(--ty-color-text-muted, #57606a);
    cursor: not-allowed;
}

.ty-auth .ty-auth__trade:disabled .ty-auth__trade-icon { background: transparent; filter: grayscale(1); }
.ty-auth .ty-auth__trade:disabled .ty-auth__trade-icon i { color: var(--ty-color-text-muted, #57606a); }

.ty-auth .ty-auth__trade-check {
    flex: none;
    width: 1.375rem;
    height: 1.375rem;
    margin-left: auto;
    fill: var(--ty-color-surface, #fff);
    stroke: var(--d, var(--ty-color-primary, #1E6FD9));
    stroke-width: 2;
}

.ty-auth .ty-auth__trade-check path {
    fill: none;
    stroke: var(--ty-color-text, #1c2128);
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ty-auth .ty-auth__trade-lock { flex: none; width: 1.375rem; margin-left: auto; text-align: center; color: var(--ty-color-text-muted, #57606a); }

.ty-auth .ty-auth__trade-slot { flex: none; width: 1.375rem; margin-left: auto; }

/* Motion - all of it behind no-preference, so reduced-motion users get the same states with none of it. */
@media (prefers-reduced-motion: no-preference) {
    .ty-auth .ty-auth__trade {
        transition: transform 340ms cubic-bezier(.34, 1.56, .64, 1),
                    box-shadow 200ms var(--ty-ease, ease),
                    border-color var(--ty-motion-micro, 120ms) var(--ty-ease, ease),
                    background-color var(--ty-motion-micro, 120ms) var(--ty-ease, ease);
        animation: ty-trade-in 480ms cubic-bezier(.34, 1.56, .64, 1) backwards;
        animation-delay: calc(var(--i, 0) * 70ms);
    }

    .ty-auth .ty-auth__trade::before { transition: clip-path 420ms cubic-bezier(.22, 1, .36, 1); }

    .ty-auth .ty-auth__trade:focus-visible { transform: translateY(-3px) rotate(-.8deg); }
    .ty-auth .ty-auth__trade:active:not(:disabled) { transform: scale(.95); transition-duration: 90ms; }

    @media (hover: hover) {
        .ty-auth .ty-auth__trade:hover:not(:disabled) {
            transform: translateY(-3px) rotate(-.8deg);
            box-shadow: 0 8px 16px -8px color-mix(in srgb, var(--d, var(--ty-color-primary, #1E6FD9)) 60%, transparent);
        }

        .ty-auth .ty-auth__trade:nth-child(even):hover:not(:disabled) { transform: translateY(-3px) rotate(.8deg); }
        .ty-auth .ty-auth__trade[aria-pressed="true"]:hover {
            box-shadow: inset 0 0 0 1px var(--d, var(--ty-color-primary, #1E6FD9)),
                        0 8px 16px -8px color-mix(in srgb, var(--d, var(--ty-color-primary, #1E6FD9)) 60%, transparent);
        }

        .ty-auth .ty-auth__trade:disabled:hover { animation: ty-trade-nope 380ms ease-in-out; }
        .ty-auth .ty-auth__trade:disabled:hover .ty-auth__trade-lock { animation: ty-trade-lock 380ms ease-in-out; }
    }

    .ty-auth .ty-auth__trade[aria-pressed="true"] .ty-auth__trade-icon { animation: ty-trade-pop 520ms cubic-bezier(.34, 1.56, .64, 1); }
    .ty-auth .ty-auth__trade-check { animation: ty-trade-pop 460ms 80ms cubic-bezier(.34, 1.56, .64, 1) backwards; }
    .ty-auth .ty-auth__trade-check path { stroke-dasharray: 20; animation: ty-trade-draw 380ms 200ms ease-out backwards; }

    /* A little flourish per trade, drawn from the icon chip with a pseudo-element: no assets, no script. */
    .ty-auth .ty-auth__trade[aria-pressed="true"] .ty-auth__trade-icon::after {
        content: "";
        position: absolute;
        pointer-events: none;
        opacity: 0;
    }

    .ty-auth .ty-auth__trade[data-trade="window-cleaning"][aria-pressed="true"] .ty-auth__trade-icon::after,
    .ty-auth .ty-auth__trade[data-trade="plumber"][aria-pressed="true"] .ty-auth__trade-icon::after {
        width: 7px; height: 9px; top: 2px; right: 1px;
        border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%;
        background: var(--d, var(--ty-color-primary, #1E6FD9));
        animation: ty-trade-drip 900ms 150ms ease-in;
    }

    .ty-auth .ty-auth__trade[data-trade="plumber"][aria-pressed="true"] .ty-auth__trade-icon { animation-name: ty-trade-wobble; }

    .ty-auth .ty-auth__trade[data-trade="gardening"][aria-pressed="true"] .ty-auth__trade-icon { animation: ty-trade-sway 900ms ease-in-out; transform-origin: 50% 90%; }
    .ty-auth .ty-auth__trade[data-trade="gardening"][aria-pressed="true"] .ty-auth__trade-icon::after {
        width: 6px; height: 6px; top: 0; left: 2px;
        border-radius: 0 100% 0 100%;
        background: var(--d, var(--ty-color-primary, #1E6FD9));
        animation: ty-trade-leaf 1000ms 150ms ease-out;
    }

    .ty-auth .ty-auth__trade[data-trade="electrician"][aria-pressed="true"] .ty-auth__trade-icon { animation: ty-trade-flicker 600ms steps(1, end); }
    .ty-auth .ty-auth__trade[data-trade="electrician"][aria-pressed="true"] .ty-auth__trade-icon::after {
        width: 10px; height: 10px; top: -3px; right: -3px;
        background: var(--d, var(--ty-color-primary, #1E6FD9));
        clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
        animation: ty-trade-spark 700ms 100ms ease-out;
    }

    .ty-auth .ty-auth__trade[data-trade="solar-installer"][aria-pressed="true"] .ty-auth__trade-icon { animation: ty-trade-spin 800ms cubic-bezier(.22, 1, .36, 1); }
    .ty-auth .ty-auth__trade[data-trade="solar-installer"][aria-pressed="true"] .ty-auth__trade-icon::after {
        inset: 0;
        border-radius: 50%;
        border: 2px solid var(--d, var(--ty-color-primary, #1E6FD9));
        animation: ty-trade-ring 800ms ease-out;
    }

    /* The "pick one" nudge: slides in and settles with a small wobble, so it is noticed without alarming. */
    .ty-auth .ty-auth__trades ~ .ty-auth__error { animation: ty-trade-nudge 520ms cubic-bezier(.34, 1.56, .64, 1); }
}

@keyframes ty-trade-in { from { opacity: 0; transform: translateY(14px) scale(.94) rotate(-1.5deg); } }
@keyframes ty-trade-pop { 0% { transform: scale(.6); } 55% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes ty-trade-draw { from { stroke-dashoffset: 20; } to { stroke-dashoffset: 0; } }
@keyframes ty-trade-nope { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
@keyframes ty-trade-lock { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-18deg); } 75% { transform: rotate(14deg); } }
@keyframes ty-trade-drip { 0% { opacity: 0; transform: translateY(-4px) scale(.5); } 20% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(18px) scale(.9); } }
@keyframes ty-trade-wobble { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-16deg) scale(1.2); } 45% { transform: rotate(12deg) scale(1.15); } 70% { transform: rotate(-6deg); } }
@keyframes ty-trade-sway { 0% { transform: scale(.7) rotate(0); } 30% { transform: scale(1.2) rotate(-14deg); } 60% { transform: scale(1.1) rotate(10deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes ty-trade-leaf { 0% { opacity: 0; transform: translate(0, 0) rotate(0); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(-10px, 16px) rotate(140deg); } }
@keyframes ty-trade-flicker { 0% { transform: scale(1.25); filter: brightness(1.4); } 25% { transform: scale(.85); filter: none; } 50% { transform: scale(1.3); filter: brightness(1.5); } 75% { transform: scale(.95); filter: none; } 100% { transform: scale(1); } }
@keyframes ty-trade-spark { 0% { opacity: 0; transform: scale(0) rotate(0); } 35% { opacity: 1; transform: scale(1.3) rotate(45deg); } 100% { opacity: 0; transform: scale(.4) rotate(90deg); } }
@keyframes ty-trade-spin { 0% { transform: scale(.6) rotate(-120deg); } 60% { transform: scale(1.25) rotate(20deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes ty-trade-ring { 0% { opacity: .8; transform: scale(1); } 100% { opacity: 0; transform: scale(2); } }
@keyframes ty-trade-nudge { 0% { opacity: 0; transform: translateY(-8px); } 55% { opacity: 1; transform: translateY(2px) translateX(3px); } 75% { transform: translateX(-3px); } 100% { transform: none; } }

/* The address a link went to: the one thing on the screen worth re-reading, so it wraps instead of
   overflowing a phone. */
.ty-auth__address {
    display: block;
    margin: 0 0 var(--ty-space-lg, 16px);
    font-weight: var(--ty-weight-semibold, 600);
    color: var(--ty-color-text, #1c2128);
    text-align: center;
    overflow-wrap: anywhere;
}

/* ── Segmented control (.ty-seg) — the app-wide Day/Week/Month, Planned/Best, 1/2/3 switch ──────────────
   One pill, one moving highlight. Themed through the --ty-seg-* tokens (declared in the floor + both
   themes), so a dark theme gets a dark trough and a primary-coloured selection for free. Variants:
   .ty-seg--views (the primary switch on a page: taller, bolder), .ty-seg--sub (a qualifier: smaller,
   quieter), .ty-seg--pin (a personal default: the selection is pink, like the pin it belongs to). */
.ty-seg {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    border-radius: 999px;
    background: var(--ty-seg-bg, #eceef1);
    border: 1px solid var(--ty-seg-border, transparent);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .06);
}
.ty-seg-item, .ty-seg__opt {
    appearance: none;
    border: 0;
    background: transparent;
    font: 700 13px var(--ty-font-base, inherit);
    letter-spacing: -0.005em;
    color: var(--ty-seg-fg, #57606a);
    padding: 7px 16px;
    min-height: 32px;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s, box-shadow .15s, transform .18s cubic-bezier(.34, 1.56, .64, 1);
}
.ty-seg-item:hover:not(.on):not(:disabled), .ty-seg__opt:hover:not(.on):not(:disabled) { color: var(--ty-color-text, #1c2128); background: rgba(255, 255, 255, .55); }
.ty-seg-item:active:not(:disabled), .ty-seg__opt:active:not(:disabled) { transform: scale(.97); }
.ty-seg-item:focus-visible, .ty-seg__opt:focus-visible { outline: 2px solid var(--ty-color-primary, #1b6ec2); outline-offset: 2px; }
.ty-seg-item:disabled, .ty-seg__opt:disabled { cursor: default; opacity: .6; }
.ty-seg-item.on, .ty-seg__opt.on {
    background: var(--ty-seg-on-bg, #fff);
    color: var(--ty-seg-on-fg, #1c2128);
    box-shadow: var(--ty-seg-on-shadow, 0 1px 3px rgba(0, 0, 0, .14));
}
/* The primary switch on a page — bigger type, a comfortable thumb target, primary-coloured selection. */
.ty-seg--views { padding: 5px; }
.ty-seg--views .ty-seg-item, .ty-seg--views .ty-seg__opt { font-size: 14.5px; font-weight: 800; padding: 9px 20px; min-height: 40px; }
.ty-seg--views .ty-seg-item.on, .ty-seg--views .ty-seg__opt.on { background: var(--ty-color-primary, #1b6ec2); color: var(--ty-color-primary-contrast, #fff); box-shadow: 0 6px 16px -8px var(--ty-color-primary, #1b6ec2); }
/* A qualifier beside the primary switch — smaller and quieter. */
.ty-seg--sub { padding: 3px; }
.ty-seg--sub .ty-seg-item, .ty-seg--sub .ty-seg__opt { font-size: 12.5px; padding: 5px 12px; min-height: 28px; }
.ty-seg--sub .ty-seg-item.on, .ty-seg--sub .ty-seg__opt.on { color: var(--ty-color-primary, #1b6ec2); }
/* A personal default — the pin's pink. */
.ty-seg--pin .ty-seg-item.on, .ty-seg--pin .ty-seg__opt.on { background: var(--ty-color-pin, #e0409a); color: #fff; box-shadow: 0 6px 16px -8px var(--ty-color-pin, #e0409a); }

/* The round pin button beside a view/mode switch ("make this my default" — SchedulePage, PlanningV2Page,
   the job wizard/full-form switch). Kept here (rather than only in scheduling.css, where the rule
   originated) because app.css is the one stylesheet every page and every hosted panel is guaranteed to
   have loaded — a page that hosts the pin as a CHILD component (e.g. JobDetailPage inside the jobs list's
   panel) can't rely on a HeadContent link from a shallower host surviving the render churn a nested
   component goes through. The scheduling.css copy is left as-is for the pages that already reference it. */
.ty-pin { appearance: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin-left: 6px; border-radius: 999px; border: 1.5px solid var(--ty-color-border-strong, #c2cad3); background: var(--ty-color-surface, #fff); color: var(--ty-color-text-subtle, #8a95a1); font-size: 15px; cursor: pointer; transition: transform .18s cubic-bezier(.34, 1.56, .64, 1), color .15s, border-color .15s, background .15s; vertical-align: middle; }
.ty-pin:hover { color: var(--ty-color-pin, #e0409a); border-color: var(--ty-color-pin, #e0409a); transform: rotate(-20deg) scale(1.08); }
.ty-pin.on { color: #fff; background: var(--ty-color-pin, #e0409a); border-color: var(--ty-color-pin, #e0409a); box-shadow: 0 6px 16px -8px var(--ty-color-pin, #e0409a); }
.ty-pin.on:hover { transform: scale(1.06); }

/* ============================================================================
   The shared "playful" kit — cards, chips, avatars, fields, controls, tables,
   buttons. (2026-09-06 styling-consistency pass.)
   ----------------------------------------------------------------------------
   Before this, the window-cleaning/gardening look (cards, icon chips, avatars,
   segmented toggles, switches, priced rails) was re-declared per component under
   a dozen private prefixes (wc-/wcj-, gd-/gdj-, sf-, vd-, pj-, pay-, bk-…) — real
   in each one, but copy-pasted 14+ times because Blazor's scoped CSS can't cross
   components, and there was no shared class to reach for instead. This block is
   that shared vocabulary, promoted once to the globally-loaded app.css (every
   head links this file, so it reaches Web/WASM/MAUI alike) so a page written
   against `.ty-card`/`.ty-field`/`.ty-btn`/… gets the same look everywhere
   without a component import — the recipe is lifted verbatim from the reference
   file, `src/domains/TradeYoke.Domains.WindowCleaning/Jobs/WcJobEditor.razor.css`.
   Reconciliation notes (do not "clean up" these without re-reading them):
     - .ty-btn / .ty-field already existed, but only inside the non-scoped
       `access.css` (linked from just the Access page) — moved here verbatim so
       the SAME classes work everywhere; access.css no longer redeclares them.
       Every spelling already in use elsewhere keeps working: the BEM modifiers
       (`--primary`/`--danger`/`--sm`) from access.css AND the single-dash ones
       (`ty-btn-primary`, `ty-btn-ghost`, `ty-btn-quiet`) this same file's own
       phone tap-target media query below has referenced since 2026-08 without
       either ever being defined — both resolve to one rule set now.
     - `.ty-chip` (a filter/trade toggle) and `.ty-pill` + tone-* (a status tag)
       already exist as their own global vocabulary in the non-scoped
       `scheduling.css` (five job-detail panels + the schedule board). `.ty-chip`
       is left untouched; `.ty-pill` + tone-* is re-declared here byte-for-byte
       (so the same class works on pages that never load scheduling.css) without
       adding anything scheduling.css doesn't already have — `.ty-icochip` (the
       wc-card recipe's 30px icon square, unrelated to either) and `.ty-pill--tap`
       (an interactive/toggle pill, the "wc-pill" recipe) are new names chosen so
       nothing here gives the status pill a border or pointer cursor it never
       asked for.
     - `.ty-seg` / `.ty-seg-item` already exist (the Day/Week/Month switch);
       `.ty-seg__opt` is added as an alias throughout so the BEM spelling used
       in the wc-/gd- job editors' own `.wcj-seg`/`.wcj-segopt` also resolves.
   ============================================================================ */

/* --- Card: the one visual unit for "a themed block of content". --- */
.ty-card {
    background: var(--ty-color-surface, #fff);
    border: 1px solid var(--ty-color-border, #e7ebf0);
    border-radius: var(--ty-radius-card, 12px);
    box-shadow: var(--ty-shadow-sm, 0 1px 2px rgba(12, 18, 28, .04));
    overflow: hidden;
}
.ty-card__hd {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--ty-color-border, #f0f2f5);
}
.ty-card__title { font-weight: 700; font-size: .9rem; color: var(--ty-color-text, #1c2128); }
.ty-card__sub { font-size: .75rem; color: var(--ty-color-text-subtle, #98a2ad); }
.ty-card__body { padding: 16px; }
.ty-card__foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 16px;
    border-top: 1px solid var(--ty-color-border, #f0f2f5);
    background: var(--ty-color-surface-2, #f6f8fa);
}

/* --- Icon chip: the 30px rounded-square icon badge in every card header. Named .ty-icochip (not
   .ty-chip) because .ty-chip is already the filter/trade toggle pill in scheduling.css. --- */
.ty-icochip {
    width: 30px; height: 30px; flex: none;
    border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ty-color-primary-soft, #eaf2fd);
    color: var(--ty-color-primary, #1E6FD9);
    font-size: 14px;
}
.ty-icochip--amber   { background: var(--ty-color-warning-soft, #fdf1dd); color: var(--ty-color-warning-ink, #9a5b00); }
.ty-icochip--success { background: var(--ty-color-success-soft, #e6f6ea); color: var(--ty-color-success-ink, #1a7f37); }
.ty-icochip--danger  { background: var(--ty-color-danger-soft, #fdecec);  color: var(--ty-color-danger-ink, #b32121); }
.ty-icochip--sm { width: 24px; height: 24px; border-radius: 7px; font-size: 12px; }

/* --- Avatar: the 44px coloured-square initials badge (customer/team rows, card headers). Distinct from
   the round 34px `.ty-avatar` (access.css — hashed accent colour per person, Team/Users lists). --- */
.ty-ava {
    width: 44px; height: 44px; flex: none;
    border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ty-color-primary, #1E6FD9);
    color: var(--ty-color-primary-contrast, #fff);
    font-weight: 700; font-size: .9rem;
}
.ty-ava--sm { width: 34px; height: 34px; border-radius: 10px; font-size: .78rem; }

/* --- Fields: label + input, one visual language for every form on every page. Promoted from access.css
   (see the reconciliation note above) — .ty-select / .ty-textarea are new, sharing the same input shape. --- */
.ty-field { display: flex; flex-direction: column; gap: 4px; }

.ty-field__label {
    font: 600 11px var(--ty-font-base, inherit);
    color: var(--ty-color-text-muted, #57606a);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ty-field--full { grid-column: 1 / -1; }

.ty-field__input,
.ty-select,
.ty-textarea {
    display: block;
    width: 100%;
    font: 400 13.5px var(--ty-font-base, inherit);
    color: var(--ty-color-text, #1c2128);
    background: var(--ty-color-surface, #fff);
    border: 1px solid var(--ty-color-border-strong, #d0d7de);
    border-radius: var(--ty-radius-control, 8px);
    padding: 9px 12px;
}
.ty-field__input:focus, .ty-field__input:focus-visible,
.ty-select:focus, .ty-select:focus-visible,
.ty-textarea:focus, .ty-textarea:focus-visible {
    outline: none;
    border-color: var(--ty-color-primary, #1b6ec2);
    box-shadow: var(--ty-focus-ring, 0 0 0 .2rem rgba(30, 111, 217, .35));
}
/* Invalid field — red border, matching the Bootstrap is-invalid look used on the other forms (the
   form-validation skill's "is-invalid + invalid-feedback" contract holds for these controls too). */
.ty-field__input.is-invalid, .ty-select.is-invalid, .ty-textarea.is-invalid {
    border-color: var(--ty-color-danger, #dc3545);
}
.ty-field__input.is-invalid:focus, .ty-select.is-invalid:focus, .ty-textarea.is-invalid:focus,
.ty-field__input.is-invalid:focus-visible, .ty-select.is-invalid:focus-visible, .ty-textarea.is-invalid:focus-visible {
    border-color: var(--ty-color-danger, #dc3545);
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--ty-color-danger, #e50000) 30%, transparent);
}
.ty-field__input[readonly], .ty-field__input:disabled,
.ty-select:disabled, .ty-textarea[readonly], .ty-textarea:disabled {
    background: var(--ty-color-surface-2, #f6f8fa);
    color: var(--ty-color-text-muted, #57606a);
}

/* A native <select> loses its own chevron once themed (appearance:none), so one is drawn back on as a
   background-image. Two colours rather than one var() because an SVG data-uri is a static image — it
   cannot read a CSS custom property — so Graft's chevron is repointed the same way the rest of this file
   repoints icon svgs for the dark theme (see docs/UI-Design.html; no existing precedent used currentColor
   here, so this follows the closest analogue: a straight light/dark swap keyed off [data-theme]). */
.ty-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 6L8 10.5 12.5 6' fill='none' stroke='%238a95a1' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 13px;
    padding-right: 32px;
}
[data-theme="graft"] .ty-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 6L8 10.5 12.5 6' fill='none' stroke='%23b9c2cc' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.ty-textarea { min-height: 5.5rem; resize: vertical; font-family: inherit; }

/* --- Card-styled table: rounded container, soft header, hover rows (lifted from the one place this
   already existed, UsersTab.razor.css's scoped `.ty-table` — repeated here, byte-for-byte, so it also
   works unscoped on every list still using a raw Bootstrap `<table class="table">`; wrap the table in
   `.ty-table-wrap` for the scroll container + border, same as `.ty-users__tablewrap` did). --- */
.ty-table-wrap {
    overflow-x: auto;
    background: var(--ty-color-surface, #fff);
    border: 1px solid var(--ty-color-border, #e7ebf0);
    border-radius: var(--ty-radius-card, 12px);
}
.ty-table { width: 100%; border-collapse: collapse; }
.ty-table th {
    text-align: left;
    font: 700 10px var(--ty-font-base, inherit);
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--ty-color-text-subtle, #8a95a1);
    padding: 14px 16px 11px;
}
.ty-table td {
    padding: 14px 16px;
    border-top: 1px solid var(--ty-color-border, #e7ebf0);
    vertical-align: middle;
    font-size: 13.5px;
    color: var(--ty-color-text, #1c2128);
}
.ty-table tbody tr:hover td { background: var(--ty-color-surface-2, #f6f8fa); }
.ty-table__actions { display: flex; gap: 6px; flex-wrap: wrap; white-space: nowrap; }

/* --- Buttons (.ty-btn) — see the reconciliation note at the top of this section. Both spellings of every
   modifier resolve to the same rule, so existing markup using either one keeps working unchanged. --- */
.ty-btn,
.ty-btn:link,
.ty-btn:visited {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font: 600 12.5px var(--ty-font-base, inherit);
    color: var(--ty-color-text, #1c2128);
    text-decoration: none;
}
.ty-btn {
    background: var(--ty-color-surface, #fff);
    border: 1px solid var(--ty-color-border-strong, #d0d7de);
    padding: 8px 14px;
    border-radius: var(--ty-radius-control, 8px);
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}
.ty-btn:hover:not(:disabled) { background: var(--ty-color-surface-3, #eef1f4); }
.ty-btn:active:not(:disabled) { transform: scale(.98); }
.ty-btn:focus-visible { outline: none; box-shadow: var(--ty-focus-ring, 0 0 0 .2rem rgba(30, 111, 217, .35)); }
.ty-btn:disabled { opacity: .55; cursor: not-allowed; }

.ty-btn--primary, .ty-btn-primary,
.ty-btn--primary:link, .ty-btn-primary:link,
.ty-btn--primary:visited, .ty-btn-primary:visited {
    color: var(--ty-color-primary-contrast, #fff);
}
.ty-btn--primary, .ty-btn-primary {
    background: var(--ty-color-primary, #1b6ec2);
    border-color: var(--ty-color-primary, #1b6ec2);
}
.ty-btn--primary:hover:not(:disabled), .ty-btn-primary:hover:not(:disabled) {
    background: var(--ty-color-primary-ink, #1457b0);
    border-color: var(--ty-color-primary-ink, #1457b0);
}

.ty-btn--ghost, .ty-btn-ghost {
    background: transparent;
    border-color: var(--ty-color-border-strong, #d0d7de);
}
.ty-btn--ghost:hover:not(:disabled), .ty-btn-ghost:hover:not(:disabled) {
    background: var(--ty-color-surface-3, #eef1f4);
}

.ty-btn--quiet, .ty-btn-quiet {
    background: transparent;
    border-color: transparent;
    color: var(--ty-color-text-muted, #57606a);
}
.ty-btn--quiet:hover:not(:disabled), .ty-btn-quiet:hover:not(:disabled) {
    color: var(--ty-color-text, #1c2128);
    background: var(--ty-color-surface-3, #eef1f4);
}

.ty-btn--danger, .ty-btn-danger,
.ty-btn--danger:link, .ty-btn-danger:link,
.ty-btn--danger:visited, .ty-btn-danger:visited {
    color: var(--ty-color-danger, #e50000);
}
.ty-btn--danger, .ty-btn-danger {
    background: transparent;
    border-color: var(--ty-color-danger, #e50000);
}
.ty-btn--danger:hover:not(:disabled), .ty-btn-danger:hover:not(:disabled) {
    color: var(--ty-color-primary-contrast, #fff);
    background: var(--ty-color-danger, #e50000);
}

.ty-btn--sm, .ty-btn-sm { padding: 5px 10px; font-size: 11.5px; }

/* Square icon-only button. .ty-iconbtn already exists in scheduling.css with this same footprint (plus a
   hover pop only meaningful alongside that file's other motion) — declared compatibly here, not
   overridden, so pages with and without scheduling.css loaded look the same. */
.ty-btn--icon, .ty-iconbtn {
    width: 36px; height: 36px; padding: 0; flex: none;
    border-radius: var(--ty-radius-control, 10px);
    font-size: 16px;
}

/* --- Soft info hint (the wcj-hint recipe) --- */
.ty-hint {
    display: block;
    font-size: .72rem;
    line-height: 1.5;
    color: var(--ty-color-primary-ink, #1457b0);
    background: var(--ty-color-primary-soft, #eaf2fd);
    border: 1px solid var(--ty-color-primary-soft, #eaf2fd);
    border-radius: 9px;
    padding: 8px 10px;
}
.ty-hint--warning { color: var(--ty-color-warning-ink, #9a5b00); background: var(--ty-color-warning-soft, #fdf1dd); border-color: var(--ty-color-warning-soft, #fdf1dd); }
.ty-hint--danger   { color: var(--ty-color-danger-ink, #b32121);  background: var(--ty-color-danger-soft, #fdecec); border-color: var(--ty-color-danger-soft, #fdecec); }

/* --- Status pill (.ty-pill + tone-*): promoted from scheduling.css (loaded only by the schedule board +
   five job-detail panels) so the same class works on every page, e.g. team/vehicle expiry badges. Values
   copied verbatim — scheduling.css's own identical rule simply re-applies on pages that also load it, so
   nothing there changes. --- */
.ty-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font: 600 10.5px var(--ty-font-base, inherit);
    padding: 3px 9px;
    border-radius: var(--ty-radius-pill, 999px);
    white-space: nowrap;
}
.ty-pill.tone-neutral { color: var(--ty-color-text-muted, #57606a); background: var(--ty-color-surface-3, #eef1f4); }
.ty-pill.tone-info    { color: var(--ty-color-info-ink, #1457b0);    background: var(--ty-color-info-soft, #eaf2fd); }
.ty-pill.tone-success { color: var(--ty-color-success-ink, #1a7f37); background: var(--ty-color-success-soft, #e6f6ea); }
.ty-pill.tone-warning { color: var(--ty-color-warning-ink, #9a5b00); background: var(--ty-color-warning-soft, #fdf1dd); }
.ty-pill.tone-danger  { color: var(--ty-color-danger-ink, #b32121);  background: var(--ty-color-danger-soft, #fdecec); }

/* --- Interactive/toggle pill (the "wc-pill" recipe — an "Any time"-style tap-to-select pill). Named
   .ty-pill--tap, and .on layered on top of the status pill above, rather than changing .ty-pill's own
   base rule: the status pill must not gain a border or a pointer cursor it never asked for. --- */
.ty-pill--tap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem; font-weight: 600;
    white-space: nowrap;
    color: var(--ty-color-text-muted, #57606a);
    background: var(--ty-color-surface, #fff);
    border: 1px solid var(--ty-color-border, #d8dee6);
    padding: 8px 13px;
    border-radius: 999px;
    cursor: pointer;
}
.ty-pill--tap:hover:not(:disabled) { background: var(--ty-color-surface-2, #f6f8fa); }
.ty-pill--tap.on {
    background: var(--ty-color-primary-soft, #eaf2fd);
    border-color: var(--ty-color-primary, #1E6FD9);
    color: var(--ty-color-primary-ink, #1457b0);
}
.ty-pill--tap:disabled { opacity: .55; cursor: not-allowed; }

/* --- Custom on/off switch (the wcj-switch recipe) — NOT `form-check form-switch`, so it looks identical
   in every theme instead of inheriting Bootstrap's own switch chrome. Two ways to drive it, both supported
   by the same class: a plain `<button class="ty-switch">` toggling its own `.on` class (the wcj-switch
   original), OR — the more common case when converting an existing Bootstrap page — directly on
   `<input type="checkbox" role="switch" class="ty-switch" @bind="...">`, where `appearance:none` strips the
   native checkbox box and `:checked` drives the same visual state as `.on`. Either way the element keeps
   its real semantics (a real checkbox stays keyboard/screen-reader operable as a checkbox), which is why
   this is preferred over rebuilding the control as a non-form button. --- */
.ty-switch {
    appearance: none;
    -webkit-appearance: none;
    width: 40px; height: 23px; flex: none;
    border: 0; padding: 0; margin: 0;
    border-radius: 999px;
    background: var(--ty-color-border-strong, #cfd6de);
    position: relative;
    vertical-align: middle;
    cursor: pointer;
    transition: background .15s;
}
.ty-switch::after {
    content: "";
    position: absolute; top: 2px; left: 2px;
    width: 19px; height: 19px;
    border-radius: 999px;
    background: var(--ty-color-surface, #fff);
    transition: left .15s;
}
.ty-switch.on, .ty-switch:checked { background: var(--ty-color-primary, #1E6FD9); }
.ty-switch.on::after, .ty-switch:checked::after { left: 19px; }
.ty-switch:disabled { opacity: .5; cursor: not-allowed; }
.ty-switch:focus-visible { outline: none; box-shadow: var(--ty-focus-ring, 0 0 0 .2rem rgba(30, 111, 217, .35)); }
/* A native checkbox or radio that no component restyles takes the theme's colour rather than the browser's default blue. */
input[type="checkbox"]:not(.ty-switch), input[type="radio"] { accent-color: var(--ty-color-primary, #1E6FD9); }

/* --- Underline tab strip (the wcj-tabs recipe — a fourth, now shared, home for the tab pattern
   SettingsPage/TeamDetail/VehicleDetail each currently reinvent as settings-tab/sf-tab/vd-tab). --- */
.ty-tabs { display: flex; gap: 16px; border-bottom: 1px solid var(--ty-color-border, #eef1f4); flex-wrap: wrap; }
.ty-tab {
    display: inline-flex; align-items: center; gap: 6px;
    background: none; border: 0; border-bottom: 2px solid transparent;
    padding: 9px 2px; min-height: 40px;
    font-size: .8rem; font-weight: 600; white-space: nowrap;
    color: var(--ty-color-text-muted, #8a95a1);
    cursor: pointer;
}
.ty-tab:hover { color: var(--ty-color-text, #1c2128); }
.ty-tab.on { color: var(--ty-color-text, #1c2128); border-bottom-color: var(--ty-color-primary, #1E6FD9); }
.ty-tab:focus-visible { outline: none; box-shadow: var(--ty-focus-ring, 0 0 0 .2rem rgba(30, 111, 217, .35)); }

/* --- Responsive form grid + action row --- */
.ty-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--ty-space-lg, 16px);
}
.ty-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ty-grid > .ty-field--full { grid-column: 1 / -1; }
@media (max-width: 47.99rem) {
    .ty-grid, .ty-grid--3 { grid-template-columns: 1fr; }
}

.ty-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--ty-space-sm, 8px);
    flex-wrap: wrap;
}
.ty-actions--between { justify-content: space-between; }
.ty-actions--start { justify-content: flex-start; }

@media (max-width: 600px) {
    .ty-btn--icon, .ty-iconbtn, .ty-pill--tap { min-width: 40px; min-height: 40px; }
    /* A switch is a pill, so a 40x40 minimum turned it into a circle. Phones get a bigger pill instead (its label row is the
       tap target); the knob and its travel scale with it. */
    .ty-switch { width: 52px; height: 30px; }
    .ty-switch::after { top: 3px; left: 3px; width: 24px; height: 24px; }
    .ty-switch.on::after, .ty-switch:checked::after { left: 25px; }
}

/* ============================================================================
   Bootstrap override layer (2026-09-06 styling-consistency pass).
   ----------------------------------------------------------------------------
   Most of the app's C/B-grade pages are a correctly themed card or table shell
   wrapped around plain Bootstrap controls — `form-control`, `btn btn-primary`,
   `<table class="table">` — because there was nowhere else to reach for (see
   the shared kit section above this one). Restyling those Bootstrap classes
   here, once, lifts every one of those pages onto the playful look without
   editing each file — this IS the leverage move for the pages this pass never
   gets to individually.

   Scoped under `body` rather than a per-head shell wrapper (`.page` in
   Layout/MainLayout.razor, something else again in the Management console,
   which is about to link this same file over its own `.layout`/`.sidebar`/
   `.content` shell) — a wrapper class is one more thing every current AND
   future head has to happen to share, and there is no reason it should have
   to. `body` reaches every host without naming any of them.
   This still never touches the two things the brief calls out to leave alone
   — not by scoping around them, but because neither uses any class this layer
   restyles: the sign-in/registration flow has its own `.ty-auth__*` kit
   (`.ty-auth__input`, `.ty-auth__submit`, …), never `form-control`/`btn-*`, and
   the two arcade game pages are confirmed (grepped) never to reach for
   `form-control`, `btn-*`, `card`, `table`, `list-group-item`, `modal-*`,
   `alert-*` or `input-group-text` anywhere in their markup. If either one ever
   does, this section starts styling it — which would be the correct outcome
   for a class that means "Bootstrap form control" wherever it appears, not a
   sign this scoping was wrong.

   Every value is a --ty-* token — same rule as the rest of this file — so both
   platform themes (themes/trusty.css, themes/graft.css) repoint these exactly
   as they do every other component. A component with its OWN scoped override
   for one of these classes (loaded after this file, and Blazor's scoped
   attribute selector matches this same specificity) still wins, so nothing
   here fights an intentional per-page choice — it only fills the pages that
   never made one.
   ============================================================================ */

body .form-control,
body .form-select {
    font-size: 13.5px;
    color: var(--ty-color-text, #1c2128);
    background-color: var(--ty-color-surface, #fff);
    border: 1px solid var(--ty-color-border-strong, #d0d7de);
    border-radius: var(--ty-radius-control, 8px);
}
body .form-control:focus,
body .form-select:focus {
    color: var(--ty-color-text, #1c2128);
    background-color: var(--ty-color-surface, #fff);
    border-color: var(--ty-color-primary, #1b6ec2);
    box-shadow: var(--ty-focus-ring, 0 0 0 .2rem rgba(30, 111, 217, .35));
}
body .form-control.is-invalid,
body .form-select.is-invalid {
    border-color: var(--ty-color-danger, #dc3545);
}
body .form-control.is-invalid:focus,
body .form-select.is-invalid:focus {
    border-color: var(--ty-color-danger, #dc3545);
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--ty-color-danger, #e50000) 30%, transparent);
}
body .form-control::placeholder { color: var(--ty-color-text-subtle, #8a95a1); opacity: 1; }
body .form-control:disabled, body .form-control[readonly],
body .form-select:disabled {
    background-color: var(--ty-color-surface-2, #f6f8fa);
    color: var(--ty-color-text-muted, #57606a);
}
body .form-label {
    font: 600 11px var(--ty-font-base, inherit);
    color: var(--ty-color-text-muted, #57606a);
    text-transform: uppercase;
    letter-spacing: .04em;
}
body .form-text { color: var(--ty-color-text-subtle, #8a95a1); }
body .invalid-feedback { color: var(--ty-color-danger-ink, #b32121); }

body .form-check-input { border-color: var(--ty-color-border-strong, #d0d7de); }
body .form-check-input:checked {
    background-color: var(--ty-color-primary, #1b6ec2);
    border-color: var(--ty-color-primary, #1b6ec2);
}
body .form-check-input:focus {
    border-color: var(--ty-color-primary, #1b6ec2);
    box-shadow: var(--ty-focus-ring, 0 0 0 .2rem rgba(30, 111, 217, .35));
}

body .btn {
    border-radius: var(--ty-radius-control, 8px);
    font-weight: 600;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}
body .btn:active:not(:disabled) { transform: scale(.98); }
body .btn:focus-visible { box-shadow: var(--ty-focus-ring, 0 0 0 .2rem rgba(30, 111, 217, .35)); }

body .btn-primary {
    color: var(--ty-color-primary-contrast, #fff);
    background-color: var(--ty-color-primary, #1b6ec2);
    border-color: var(--ty-color-primary, #1b6ec2);
}
body .btn-primary:hover, body .btn-primary:focus {
    color: var(--ty-color-primary-contrast, #fff);
    background-color: var(--ty-color-primary-ink, #1457b0);
    border-color: var(--ty-color-primary-ink, #1457b0);
}
body .btn-secondary {
    color: var(--ty-color-text, #1c2128);
    background-color: var(--ty-color-surface-3, #eef1f4);
    border-color: var(--ty-color-surface-3, #eef1f4);
}
body .btn-secondary:hover, body .btn-secondary:focus {
    color: var(--ty-color-text, #1c2128);
    background-color: var(--ty-color-border, #e7ebf0);
    border-color: var(--ty-color-border, #e7ebf0);
}
body .btn-outline-secondary {
    color: var(--ty-color-text-muted, #57606a);
    background-color: var(--ty-color-surface, #fff);
    border-color: var(--ty-color-border-strong, #d0d7de);
}
body .btn-outline-secondary:hover, body .btn-outline-secondary:focus {
    color: var(--ty-color-text, #1c2128);
    background-color: var(--ty-color-surface-3, #eef1f4);
    border-color: var(--ty-color-border-strong, #d0d7de);
}
body .btn-outline-primary {
    color: var(--ty-color-primary, #1b6ec2);
    background-color: transparent;
    border-color: var(--ty-color-primary, #1b6ec2);
}
body .btn-outline-primary:hover, body .btn-outline-primary:focus {
    color: var(--ty-color-primary-contrast, #fff);
    background-color: var(--ty-color-primary, #1b6ec2);
    border-color: var(--ty-color-primary, #1b6ec2);
}
body .btn-danger {
    color: #fff;
    background-color: var(--ty-color-danger, #e50000);
    border-color: var(--ty-color-danger, #e50000);
}
body .btn-danger:hover, body .btn-danger:focus {
    background-color: var(--ty-color-danger-ink, #b32121);
    border-color: var(--ty-color-danger-ink, #b32121);
}
body .btn-outline-danger {
    color: var(--ty-color-danger, #e50000);
    background-color: transparent;
    border-color: var(--ty-color-danger, #e50000);
}
body .btn-outline-danger:hover, body .btn-outline-danger:focus {
    color: #fff;
    background-color: var(--ty-color-danger, #e50000);
    border-color: var(--ty-color-danger, #e50000);
}
body .btn-success {
    color: #fff;
    background-color: var(--ty-color-success, #26b050);
    border-color: var(--ty-color-success, #26b050);
}
body .btn-success:hover { background-color: var(--ty-color-success-ink, #1a7f37); border-color: var(--ty-color-success-ink, #1a7f37); }
body .btn-outline-success {
    color: var(--ty-color-success-ink, #1a7f37);
    background-color: transparent;
    border-color: var(--ty-color-success, #26b050);
}
body .btn-outline-success:hover { color: #fff; background-color: var(--ty-color-success, #26b050); border-color: var(--ty-color-success, #26b050); }
body .btn-link { color: var(--ty-color-primary, #1b6ec2); }
body .btn-group .btn, body .btn-group-sm .btn { border-radius: var(--ty-radius-control, 8px); }

body .card {
    border: 1px solid var(--ty-color-border, #e7ebf0);
    border-radius: var(--ty-radius-card, 12px);
    box-shadow: var(--ty-shadow-sm, 0 1px 2px rgba(12, 18, 28, .04));
    background: var(--ty-color-surface, #fff);
}
body .card-body { padding: 16px; }
body .card-header {
    background: var(--ty-color-surface, #fff);
    border-bottom: 1px solid var(--ty-color-border, #f0f2f5);
    font-weight: 700;
}

body .table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: var(--ty-color-surface-2, #f6f8fa);
    color: var(--ty-color-text, #1c2128);
}
body .table > thead {
    font: 700 10px var(--ty-font-base, inherit);
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--ty-color-text-subtle, #8a95a1);
}
body .table > :not(caption) > * > * { border-bottom-color: var(--ty-color-border, #e7ebf0); padding: 12px 14px; }
body .table-responsive,
body table.table:not(.ty-table) {
    background: var(--ty-color-surface, #fff);
    border: 1px solid var(--ty-color-border, #e7ebf0);
    border-radius: var(--ty-radius-card, 12px);
}
body .table-responsive { overflow: auto; }

body .list-group-item {
    border-color: var(--ty-color-border, #e7ebf0);
    background: var(--ty-color-surface, #fff);
    color: var(--ty-color-text, #1c2128);
}
body .list-group-item:first-child { border-top-left-radius: var(--ty-radius-card, 12px); border-top-right-radius: var(--ty-radius-card, 12px); }
body .list-group-item:last-child { border-bottom-left-radius: var(--ty-radius-card, 12px); border-bottom-right-radius: var(--ty-radius-card, 12px); }
body .list-group-item.active {
    background: var(--ty-color-primary-soft, #eaf2fd);
    border-color: var(--ty-color-primary-soft, #eaf2fd);
    color: var(--ty-color-primary-ink, #1457b0);
}
body .list-group-item-action:hover { background: var(--ty-color-surface-2, #f6f8fa); }

body .modal-content {
    border: 1px solid var(--ty-color-border, #e7ebf0);
    border-radius: var(--ty-radius-panel, 16px);
    box-shadow: var(--ty-shadow-lg, 0 30px 60px -30px rgba(0, 0, 0, .4));
}
body .modal-header, body .modal-footer { border-color: var(--ty-color-border, #e7ebf0); }
body .modal-header { padding: 16px 20px; }
body .modal-body { padding: 20px; }
body .modal-footer { padding: 14px 20px; }
body .modal-title { font-weight: 700; }
/* Every Bootstrap modal clears the device's system bars. The .modal backdrop is position:fixed over the whole
   window, and an edge-to-edge Android 15 WebView (or an iPhone) draws that window under the status and
   navigation bars — so a tall .modal-dialog-scrollable (100% minus its margin) put its title under the clock and
   its footer under the gesture bar (found on device: the import wizard's step 2, 2026-10-29). Padding the
   backdrop shrinks the box the dialog sizes against; the vars are unset on desktop, so nothing moves there.
   See /reference/parity-traps#modal-insets. */
body .modal {
    padding-top: var(--ty-safe-top, env(safe-area-inset-top, 0px));
    padding-bottom: var(--ty-safe-bottom, env(safe-area-inset-bottom, 0px));
    padding-left: var(--ty-safe-left, env(safe-area-inset-left, 0px));
    padding-right: var(--ty-safe-right, env(safe-area-inset-right, 0px));
}

body .alert { border-radius: var(--ty-radius-card, 12px); border-width: 1px; }
body .alert-primary   { background: var(--ty-color-primary-soft, #eaf2fd); border-color: var(--ty-color-primary-soft, #eaf2fd); color: var(--ty-color-primary-ink, #1457b0); }
body .alert-success   { background: var(--ty-color-success-soft, #e6f6ea); border-color: var(--ty-color-success-border, #bfe3cc); color: var(--ty-color-success-ink, #1a7f37); }
body .alert-warning   { background: var(--ty-color-warning-soft, #fdf1dd); border-color: var(--ty-color-warning-border, #f2d9a4); color: var(--ty-color-warning-ink, #9a5b00); }
body .alert-danger    { background: var(--ty-color-danger-soft, #fdecec);  border-color: var(--ty-color-danger-border, #f4d3cf);  color: var(--ty-color-danger-ink, #b32121); }
body .alert-secondary,
body .alert-info      { background: var(--ty-color-surface-2, #f6f8fa); border-color: var(--ty-color-border, #e7ebf0); color: var(--ty-color-text-muted, #57606a); }

body .input-group-text {
    background: var(--ty-color-surface-2, #f6f8fa);
    border-color: var(--ty-color-border-strong, #d0d7de);
    color: var(--ty-color-text-muted, #57606a);
}

/* ============================================================================
   Tap targets: the floor, on the device the work is recorded on (2026-09-03).

   A responsive audit at 390px found at least one control under 32px on all
   sixteen screens — the header's language flag at 60x21 on every one of them,
   the list checkboxes at 17x17, the pager's arrows at 35x28, the info buttons
   at 24x24. None of them are broken; all of them are missed, in the rain, with
   one thumb, which is the same thing.

   Apple and Google both ask for 44px. This raises the floor to 40 on a phone
   without moving any layout: the padding grows into space the rows already
   have, and nothing here changes above 600px, where a mouse is doing the work.

   On !important: every one of these classes is declared in a scoped .razor.css,
   whose selectors carry an extra [b-xxxxxxxxxx] and whose bundle loads after
   this file. A plain rule here would lose both ways and change nothing at all —
   which is exactly how a floor like this gets written, shipped, and quietly
   does nothing. It is scoped to the phone and to the size properties only.
   ============================================================================ */
@media (max-width: 600px) {
    /* The shared icon and chip vocabulary, wherever it is used. */
    .ty-iconbtn,
    .ty-pager__btn,
    .ty-chip,
    .cl-chip,
    .jl-chip,
    .inv-chip,
    .ci-btn,
    .cl-act,
    .p2-iconbtn,
    a.ty-dir {
        min-width: 40px !important;
        min-height: 40px !important;
    }

    /* Icon-only buttons centre their glyph once they have a floor. */
    .ty-iconbtn,
    .ty-pager__btn,
    .ci-btn,
    .cl-act,
    .p2-iconbtn,
    a.ty-dir {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* The header's language link — the one control on literally every screen. */
    .ty-lang-flag {
        min-height: 40px !important;
        padding-inline: .55rem !important;
    }

    /* A checkbox is 17px of ink whatever you do to it; what a thumb needs is the
       area around it, so the box grows and the row's own padding does the rest. */
    .form-check-input,
    .cl-check {
        width: 1.35rem !important;
        height: 1.35rem !important;
    }

    /* The tour's own controls sit over the page and are hit in exactly the same
       conditions as everything under them. */
    .ty-tour-replay-btn,
    .coach-btn,
    .coach-skip {
        min-height: 40px !important;
    }
}

/* The rest of the phone floor, measured rather than guessed: everything above was
   the shared icon vocabulary; this is the ordinary button vocabulary, which sits
   at 31px — one pixel under — almost everywhere because Bootstrap's .btn padding
   was never chosen for a thumb. Same scope, same reason, same media query. */
@media (max-width: 600px) {
    .btn,
    .ty-btn,
    .ty-btn-primary,
    .ty-btn-ghost,
    .ty-btn-quiet,
    .p2-btn,
    .p2-cta,
    .pl-act,
    .pl-map-toggle,
    .nc-back,
    .ad-toggle,
    .ty-dl-segbtn {
        min-height: 40px !important;
    }

    /* The little round help and hint buttons that sit beside a label: big enough
       to hit, small enough that they do not out-shout the field they explain. */
    .hb,
    .fh-btn {
        min-width: 36px !important;
        min-height: 36px !important;
    }

    /* Links that live inside a sentence cannot grow a min-height without pushing
       the line apart, so they grow their padding instead. */
    a.ow-link {
        display: inline-block;
        padding-block: .45rem;
    }

    /* Any checkbox or radio, not only the ones wearing a Bootstrap class. A .ty-switch is a pill that sizes itself: forcing
       it square turned every phone switch into a circle (0.3.147 capture), so it is left out here and below. */
    input[type="checkbox"]:not(.ty-switch),
    input[type="radio"] {
        width: 1.35rem !important;
        height: 1.35rem !important;
    }
}

/* The last three, once the floor above was measured rather than assumed: two icon-only
   buttons that had height but no width, and the checkboxes that Bootstrap does not class. */
@media (max-width: 600px) {
    .pl-map-toggle,
    .ty-dl-segbtn {
        min-width: 40px !important;
    }

    input[type="checkbox"]:not(.ty-switch),
    input[type="radio"] {
        width: 2rem !important;
        height: 2rem !important;
    }
}


/* ══ Take payment in person (FB-054) ══════════════════════════════════════════════════════════════════
   The payment code panel on a trade's job screen. Global rather than per-domain because five trades draw
   the identical block from the same Core seam, and five copies of one card is five places to drift.
   The code sits on a white plate whatever the theme: a QR on a tinted background is a QR a camera argues
   with, and this one is read across a doorstep. */
.ty-takepay {
    margin-top: .75rem;
    padding: 1rem;
    border: 1px solid var(--ty-color-border, #e3e6ea);
    border-radius: var(--ty-radius-card, 12px);
    background: var(--ty-color-surface, #fff);
    text-align: center;
}
.ty-takepay-hd { display: flex; align-items: center; gap: .5rem; font-weight: 700; text-align: left; }
.ty-takepay-x { margin-left: auto; padding: 0 .25rem; color: var(--ty-color-text-muted, #6b7280); text-decoration: none; }
.ty-takepay-qr { display: inline-block; margin: .75rem auto .5rem; padding: 12px; background: #fff; border-radius: 8px; }
.ty-takepay-qr svg { display: block; width: 220px; height: 220px; }
.ty-takepay-hint { color: var(--ty-color-text-muted, #6b7280); font-size: .85rem; }
.ty-takepay-link { margin-top: .5rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; word-break: break-all; color: var(--ty-color-text-muted, #6b7280); }
.ty-takepay-acts { display: flex; justify-content: center; gap: .5rem; margin-top: .75rem; }

/* ---- Layout utility: let a flex/grid child shrink below its content width ---------------------------------
   Bootstrap 5 has no .min-w-0, and dozens of components pair it with .text-truncate inside a flex row. It
   used to be defined only in the Modules.Shared wizard stylesheet, which the web head loads on wizard pages
   alone — so everywhere else the class did nothing and long text pushed its row's trailing buttons out of
   view (2026-09-17: the directions panel's Close button). Global, because it is used globally. */
.min-w-0 { min-width: 0; }


/* FB-146: "Email me a sign-in link" — the secondary way in on /login, an outlined twin of the submit button. */
.ty-auth .ty-auth__alt-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--ty-space-sm, 8px);
    width: 100%;
    min-height: 3rem;
    margin-top: var(--ty-space-sm, 8px);
    padding: 0 var(--ty-space-lg, 16px);
    border: 1px solid var(--ty-color-border-strong, #cfd6de);
    border-radius: var(--ty-radius-control, 8px);
    background: var(--ty-color-surface, #fff);
    color: var(--ty-color-text, #1c2128);
    font-weight: var(--ty-weight-semibold, 600);
    text-decoration: none;
}

.ty-auth .ty-auth__alt-link:hover { background: var(--ty-color-surface-subtle, #f6f8fa); }
.ty-auth .ty-auth__alt-link:focus-visible { outline: 2px solid transparent; box-shadow: var(--ty-focus-ring, 0 0 0 .2rem rgba(30, 111, 217, .35)); }

/* ── FB-187: first run and sign-in, shaped like a mainstream app ───────────────────────────────────────────────
   The welcome screen (/welcome) is brand, one line of value, three short benefits, then ONE primary action (start the
   trial) and one secondary (I already have an account). On a phone the actions sit at the foot of the screen, where
   the thumb is, the way app welcome screens do; wider screens keep the centred column. */
.ty-welcome__points {
    display: grid;
    gap: var(--ty-space-md, 12px);
    margin: 0 0 var(--ty-space-xl, 24px);
    padding: 0;
    list-style: none;
}

.ty-welcome__points li {
    display: flex;
    align-items: center;
    gap: var(--ty-space-md, 12px);
    color: var(--ty-color-text, #1c2128);
    line-height: var(--ty-line-body, 1.5);
}

.ty-welcome__points i {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--ty-radius-pill, 999px);
    background: var(--ty-color-primary-soft, #eaf2fd);
    color: var(--ty-color-primary, #1E6FD9);
    font-size: 1.05rem;
}

.ty-welcome__actions .ty-auth__submit { margin-top: 0; }

.ty-welcome__terms {
    margin: var(--ty-space-sm, 8px) 0 var(--ty-space-lg, 16px);
    text-align: center;
    color: var(--ty-color-text-muted, #57606a);
    font-size: var(--ty-font-sm, 14px);
}

@media (max-width: 599.98px) {
    .ty-welcome {
        display: flex;
        flex-direction: column;
        min-height: calc(100dvh - 3rem - var(--ty-safe-bottom, env(safe-area-inset-bottom, 0px)));
        padding-bottom: var(--ty-space-xl, 24px);
    }

    .ty-welcome__actions { margin-top: auto; }
}

/* "Back" to the welcome screen, top-left of the sign-in and sign-up columns (the app has no browser back button). */
.ty-auth .ty-auth__back--top {
    margin: 0 0 var(--ty-space-md, 12px);
    color: var(--ty-color-text-muted, #57606a);
    text-decoration: none;
}

.ty-auth .ty-auth__back--top:hover { color: var(--ty-color-text, #1c2128); }

/* What the app's one Sign in button leads to, said before the system sign-in sheet appears. */
.ty-auth__caption {
    display: block;
    margin: var(--ty-space-sm, 8px) 0 0;
    color: var(--ty-color-text-muted, #57606a);
    font-size: var(--ty-font-sm, 14px);
    line-height: var(--ty-line-body, 1.5);
    text-align: center;
    text-wrap: pretty;
}

.ty-auth__caption i { margin-right: var(--ty-space-xs, 4px); }

/* The passkey door under the caption: room to read the caption as belonging to the button above it. */
.ty-auth .ty-auth__caption + .ty-auth__alt-link { margin-top: var(--ty-space-lg, 16px); }

/* "Trouble signing in?": the how-you-signed-up guidance, closed until somebody needs it. */
.ty-auth__help {
    margin: var(--ty-space-xl, 24px) 0 0;
    text-align: center;
}

.ty-auth__help summary {
    display: block;
    width: fit-content;
    margin: 0 auto;
    cursor: pointer;
    color: var(--ty-color-primary-ink, #1457b0);
    font-size: var(--ty-font-sm, 14px);
    font-weight: var(--ty-weight-semibold, 600);
    list-style: none;
}

.ty-auth__help summary::-webkit-details-marker { display: none; }

.ty-auth__help summary::after {
    content: "\F282"; /* bi-chevron-down */
    font-family: "bootstrap-icons";
    margin-left: var(--ty-space-xs, 4px);
    font-size: .75em;
    vertical-align: middle;
}

.ty-auth__help[open] summary::after { content: "\F286"; } /* bi-chevron-up */

.ty-auth__help[open] {
    padding: 0 0 var(--ty-space-xs, 4px);
}

.ty-auth__help .ty-auth__hint {
    margin-top: var(--ty-space-md, 12px);
    padding: var(--ty-space-md, 12px) var(--ty-space-lg, 16px);
    border-radius: var(--ty-radius-card, 12px);
    background: var(--ty-color-surface-2, #f6f8fa);
    text-align: left;
}

.ty-auth .ty-auth__foot .ty-auth__link-button { font-size: inherit; }

/* ── The documents sticky over a record (DocumentsLauncher + Core IDocumentsContext) ───────────────────────────
   A record shown in a detail panel or drawer (TyDetailPanel .dp, the vehicle drawer .vd-drawer) publishes its
   documents scope and renders a hidden .ty-docscope-mark inside itself. The sticky then rises to THAT overlay's
   layer: above the record it belongs to, but still under anything stacked over the record later (an activity
   timeline, a wizard), which covers it as it covers the record. Without a mark (a routed record page, or no
   record at all) the sticky keeps its page-level layer. :has() = Chrome/WebView 105+, Safari 15.4+. */
.ty-docscope-mark { display: none; }
body:has(:is(.dp, .vd-drawer, .ty-panel) .ty-docscope-mark) .dl-pull.dl-pull--record { z-index: 1082; }
/* The schedule board's own detail panel (ScheduleDetailPanel, .ty-panel-overlay at 1080, the record-panel layer over
   the phone bottom nav) covers the sticky's page layer. A trade's job open in it publishes and lifts the sticky as above; anything else open in it
   (non-job work) has no documents of its own here, so the company sticky steps aside rather than sit on the panel. */
body:has(.ty-panel-overlay) .dl-pull:not(.dl-pull--record) { display: none; }
body:has(.dp--over .ty-docscope-mark) .dl-pull.dl-pull--record { z-index: 1096; }
/* A payment sheet (Tap to Pay, the payment code) is a modal drawn INSIDE the record it was opened from, so it cannot rise above the sticky
   the record lifted to 1082; the sticky steps aside while one is open rather than sit over the amount and the buttons. */
body:has(.tap-backdrop, .fp-take-backdrop) .dl-pull { display: none; }
/* Desktop: a record panel is a 64rem sheet on the right, so the sticky hangs off the panel's left edge like a folder
   tab instead of sitting on the record's own content. A maximised panel (or a window too narrow to leave room)
   keeps the sticky on the screen edge. */
@media (min-width: 72rem) {
    body:has(:is(.dp:not(.dp--max), .vd-drawer) .ty-docscope-mark) .dl-pull.dl-pull--record { right: min(64rem, 100%); }
}
/* Hide while scrolling (owner 2026-10-26: "when scrolling it's not visible, and as soon as we stop scrolling it becomes
   visible again"). mobile-shell.js sets html.ty-scrolling on any scroll (page, panel or sheet) and clears it ~400ms after the
   last event. The tab slides out to the right in ~150ms (the individual `translate` property, so it never fights the tab's own
   transform) and cannot be hit while away. It stays put while it has focus (keyboard / just tapped), and it is not drawn at all
   while the drawer is open. Reduced motion: instant, no slide. No layout shift: only translate/opacity change. */
html.ty-scrolling .dl-pull:not(:focus):not(:focus-within) {
    translate: calc(100% + 6px) 0; opacity: 0; pointer-events: none;
    transition: translate .15s ease, opacity .15s ease;
}
@media (prefers-reduced-motion: reduce) {
    :root .dl-pull.dl-pull, html.ty-scrolling .dl-pull:not(:focus):not(:focus-within) { transition: none; }
}
/* The board's .ty-panel is a 64rem sheet only above 80rem (below that it takes the screen, scheduling.css). */
@media (min-width: 80.01rem) {
    body:has(.ty-panel .ty-docscope-mark) .dl-pull.dl-pull--record { right: min(64rem, 100%); }
}

/* ── Status-bar protection (edge-to-edge) ──────────────────────────────────────────────────────────────────────────
   Under Android 15 edge-to-edge (and an iOS WKWebView with viewport-fit=cover) the status bar is transparent and drawn ON
   TOP of the web content. The top bar is now sticky at every width (owner 9 Nov 2026) and carries the inset as its own padding,
   so it covers the strip itself; this strip stays as the belt to that brace (the bar's overscroll bounce, a page that
   hides the bar, the sign-in screens), as it was when the bar scrolled away and every page's text ran up under the clock
   and the status icons (owner's recording 2026-10-15). One fixed strip the height of the top inset,
   painted in the bar's surface colour: Android's "system bar protection" for scrolling content. --ty-safe-top is pushed natively on Android (MainPage.SafeAreaInsetsListener), comes from
   env(safe-area-inset-top) on iOS, and is 0 on desktop browsers and Windows, where the strip has no height and
   draws nothing. It sits under every overlay (record panels 1080, scrims 1090+, the drawer 1200), so those still
   dim it or pad themselves for the inset, and above the page, the sticky bars and the bottom nav (1000).
   A page's own sticky header must stick at top: var(--ty-sticky-top, 0px) (the whole top bar, inset included), not 0, or it slides under the bar. */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--ty-safe-top, 0px);
    z-index: 1050;
    pointer-events: none;
    /* The top bar's own colour per theme: the un-themed bar is the light grey, Trusty and Graft paint it surface. */
    background: var(--ty-color-surface-2, #f6f8fa);
}
[data-theme="trusty"] body::before,
[data-theme="graft"] body::before { background: var(--ty-color-surface, #fff); }

/* ============================================================================
   THE FRONT DOOR (/design/auth/front-door §4) — the shared SignInPage on every head.
   The .ty-auth family above, plus: the real lockup as the ONE waiting indicator (§4f — the yoke drawn with the
   spinner's own three parts so ty-spin / ty-spin-pulse animate it unchanged), official provider marks, the Apple
   button that inverts per mode, and the segmented code input (.ty-code: one real input over six boxes).
   Only --ty-* tokens; both modes and both platform themes from the same markup; motion off under reduced motion.
   ============================================================================ */
.ty-front-door {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--ty-color-surface-2, #f6f8fa);
    color: var(--ty-color-text, #1c2128);
}
.ty-front { padding-top: clamp(var(--ty-space-xl, 24px), 7vh, 4.5rem); }

.ty-lockup {
    display: grid;
    justify-items: center;
    gap: .35rem;
    margin: 0 auto var(--ty-space-sm, 8px);
}
.ty-lockup .ty-spinner {
    --ty-spin-sz: 5.25rem;
    height: calc(var(--ty-spin-sz) * .42);
    animation: none;
}
.ty-lockup .ty-spinner__bar { width: 64%; height: calc(var(--ty-spin-sz) * .16); opacity: 1; }
.ty-lockup .ty-spinner__ring {
    width: calc(var(--ty-spin-sz) * .36);
    height: calc(var(--ty-spin-sz) * .36);
    border-width: calc(var(--ty-spin-sz) * .112);
    box-sizing: border-box;
    background: var(--ty-color-surface-2, #f6f8fa);
    transform: translateY(-50%) scale(1);
    animation: none;
}
.ty-lockup__word {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: .12em;
    line-height: 1;
    color: var(--ty-color-text, #1c2128);
    transition: opacity var(--ty-motion-micro, 120ms) var(--ty-ease, ease);
}
.ty-lockup__word span { color: var(--ty-color-primary, #1e6fd9); }
.ty-lockup__status {
    min-height: 1.5em;
    margin: 0 0 var(--ty-space-md, 12px);
    font-size: var(--ty-font-sm, 14px);
    color: var(--ty-color-text-muted, #57606a);
    text-align: center;
}
.ty-lockup__tick {
    position: absolute;
    left: -9%;
    top: -15%;
    width: 118%;
    height: 130%;
    overflow: visible;
    opacity: 0;
    pointer-events: none;
}
.ty-lockup__tick ellipse {
    fill: none;
    stroke: var(--ty-color-success, #26b050);
    stroke-width: 2.5;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
}

/* waiting: the existing spinner animation on the yoke; the wordmark dims; shown at least 400 ms (the page holds it) */
[data-ty-wait="waiting"] .ty-lockup .ty-spinner { animation: ty-spin 1.4s cubic-bezier(.65, 0, .35, 1) infinite; }
[data-ty-wait="waiting"] .ty-lockup .ty-spinner__ring--l { animation: ty-spin-pulse 1.4s ease-in-out infinite; }
[data-ty-wait="waiting"] .ty-lockup .ty-spinner__ring--r { animation: ty-spin-pulse 1.4s ease-in-out infinite .7s; }
[data-ty-wait="waiting"] .ty-lockup__word { opacity: .6; }
/* success: settles at rest, the rings swell once, a tick ring in the success colour draws around the yoke */
[data-ty-wait="success"] .ty-lockup .ty-spinner__ring { animation: ty-lockup-settle 300ms var(--ty-ease, ease) 1; }
[data-ty-wait="success"] .ty-lockup__tick { opacity: 1; }
[data-ty-wait="success"] .ty-lockup__tick ellipse { animation: ty-lockup-tick 250ms ease-out forwards; }
/* error: stopped where it is, rings fall back; colour unchanged — the words carry the error, never red */
[data-ty-wait="error"] .ty-lockup .ty-spinner__ring { opacity: .55; }
@keyframes ty-lockup-settle { 0% { transform: translateY(-50%) scale(1); } 50% { transform: translateY(-50%) scale(1.06); } 100% { transform: translateY(-50%) scale(1); } }
@keyframes ty-lockup-tick { to { stroke-dashoffset: 0; } }
@keyframes ty-lockup-fade { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) {
    [data-ty-wait="waiting"] .ty-lockup .ty-spinner,
    [data-ty-wait="waiting"] .ty-lockup .ty-spinner__ring--l,
    [data-ty-wait="waiting"] .ty-lockup .ty-spinner__ring--r { animation: ty-lockup-fade 1.4s ease-in-out infinite; }
    [data-ty-wait="success"] .ty-lockup .ty-spinner__ring { animation: none; }
    [data-ty-wait="success"] .ty-lockup__tick ellipse { animation: none; stroke-dashoffset: 0; }
}

/* the official provider marks, pinned left, label centred */
.ty-auth .ty-auth__provider svg { position: absolute; left: var(--ty-space-lg, 16px); width: 18px; height: 18px; }
.ty-auth .ty-auth__provider[aria-busy="true"] { opacity: .7; }
/* Apple's button is the ONE control that inverts per mode (Apple's HIG): black on light, white on dark. */
.ty-auth .ty-auth__provider--apple,
.ty-auth .ty-auth__provider--apple:hover { background: #000; color: #fff; border-color: #000; }
[data-bs-theme="dark"] .ty-auth .ty-auth__provider--apple,
[data-bs-theme="dark"] .ty-auth .ty-auth__provider--apple:hover { background: #fff; color: #000; border-color: #fff; }

.ty-auth .ty-auth__submit--tight { margin-top: var(--ty-space-lg, 16px); }
.ty-auth__links {
    display: grid;
    gap: var(--ty-space-md, 12px);
    justify-items: center;
    margin-top: var(--ty-space-xl, 24px);
    font-size: var(--ty-font-sm, 14px);
}
.ty-auth .ty-auth__link-button:disabled { color: var(--ty-color-text-subtle, #8a95a1); text-decoration: none; cursor: default; }
.ty-auth__countdown { font-variant-numeric: tabular-nums; }
.ty-auth__lede strong { color: var(--ty-color-text, #1c2128); user-select: all; word-break: break-word; }

/* .ty-code: the segmented six-digit input. ONE real input laid over the boxes (so paste/autofill land anywhere). */
.ty-code {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr) 12px repeat(3, 1fr);
    gap: var(--ty-space-sm, 8px);
    align-items: center;
    margin-top: var(--ty-space-xs, 4px);
}
.ty-code__input {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    opacity: 0;
    border: 0;
    font-size: 16px; /* the iOS zoom floor */
    color: transparent;
    caret-color: transparent;
    cursor: text;
}
.ty-code__gap { width: 12px; height: 2px; justify-self: center; border-radius: 1px; background: var(--ty-color-border-strong, #d0d7de); }
.ty-code__box {
    height: 3.5rem;
    display: grid;
    place-items: center;
    border: 1px solid var(--ty-color-border-strong, #d0d7de);
    border-radius: var(--ty-radius-control, 8px);
    background: var(--ty-color-surface, #fff);
    color: var(--ty-color-text, #1c2128);
    font-family: var(--ty-font-mono, ui-monospace, Menlo, Consolas, monospace);
    font-size: 1.5rem;
    font-weight: var(--ty-weight-semibold, 600);
    transition: border-color var(--ty-motion-micro, 120ms) var(--ty-ease, ease);
}
.ty-code__box--empty { color: var(--ty-color-text-subtle, #8a95a1); }
.ty-code__box--active { border-color: var(--ty-color-primary, #1e6fd9); box-shadow: var(--ty-focus-ring, 0 0 0 .2rem rgba(30, 111, 217, .35)); }
.ty-code--invalid .ty-code__box { border-color: var(--ty-color-danger, #e50000); }

/* "Confirm it's you" (front door §7.8): the fresh-sign-in panel on My account and the console's account pages. */
.ty-fresh {
    margin: 0 0 var(--ty-space-md, 12px);
    padding: var(--ty-space-md, 12px) var(--ty-space-lg, 16px);
    border: 1px solid var(--ty-color-warning, #d98a1e);
    border-radius: var(--ty-radius-card, 12px);
    background: var(--ty-color-warning-soft, #fff6e8);
    color: var(--ty-color-text, #1c2128);
}
.ty-fresh__title { margin: 0 0 .25rem; font-weight: 700; }
.ty-fresh__lede { margin: 0 0 .75rem; color: var(--ty-color-text-muted, #57606a); font-size: var(--ty-font-sm, 14px); }
.ty-fresh .ty-code { max-width: 22rem; }
.ty-fresh__error { margin: .4rem 0 0; color: var(--ty-color-danger-ink, #b42318); font-size: var(--ty-font-sm, 14px); }
.ty-fresh__or { margin: .6rem 0; color: var(--ty-color-text-muted, #57606a); font-size: var(--ty-font-sm, 14px); }
@media (prefers-reduced-motion: reduce) { .ty-code__box, .ty-lockup__word { transition: none; } }

/* ============================================================================
   FB-212 — the Terms and Privacy gate (/auth/terms) and the in-app copies (/account/legal/{key}).
   A wider reading column than the sign-in card, the document in its own focusable scroll box (the gate's
   scroll-to-end rule reads the box, legalGate.js), and the progress line that says when Accept is available.
   The document text comes from the published source, sanitised by the server; only --ty-* tokens here.
   ============================================================================ */
.ty-auth.ty-legal { max-width: 40rem; }
.ty-legal__step {
    margin: 0 0 var(--ty-space-xs, 4px);
    text-align: center;
    color: var(--ty-color-text-muted, #57606a);
    font-size: var(--ty-font-sm, 14px);
    font-weight: var(--ty-weight-semibold, 600);
    letter-spacing: .02em;
}
.ty-legal__version {
    margin: calc(-1 * var(--ty-space-sm, 8px)) 0 var(--ty-space-md, 12px);
    text-align: center;
    color: var(--ty-color-text-muted, #57606a);
    font-size: var(--ty-font-sm, 14px);
}
.ty-legal__box {
    max-height: min(55vh, 34rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--ty-space-lg, 16px) var(--ty-space-lg, 16px) var(--ty-space-sm, 8px);
    border: 1px solid var(--ty-color-border-strong, #d0d7de);
    border-radius: var(--ty-radius-card, 12px);
    background: var(--ty-color-surface, #fff);
    color: var(--ty-color-text, #1c2128);
    text-align: left;
}
.ty-legal__box:focus-visible {
    outline: 2px solid transparent;
    box-shadow: var(--ty-focus-ring, 0 0 0 .2rem rgba(30, 111, 217, .35));
}
.ty-legal__end { height: 1px; }
.ty-legal__text {
    font-size: var(--ty-font-sm, 14px);
    line-height: var(--ty-line-body, 1.5);
    overflow-wrap: anywhere;
}
.ty-legal__text h2, .ty-legal__text h3, .ty-legal__text h4 {
    margin: var(--ty-space-lg, 16px) 0 var(--ty-space-sm, 8px);
    font-size: var(--ty-font-base-size, 16px);
    font-weight: var(--ty-weight-semibold, 600);
    line-height: 1.3;
}
.ty-legal__text h2:first-child, .ty-legal__text p:first-child { margin-top: 0; }
.ty-legal__text p, .ty-legal__text ul, .ty-legal__text ol { margin: 0 0 var(--ty-space-md, 12px); }
.ty-legal__text ul, .ty-legal__text ol { padding-left: 1.25rem; }
.ty-legal__text li + li { margin-top: var(--ty-space-xs, 4px); }
.ty-legal__text a { color: var(--ty-color-primary-ink, #1457b0); }
.ty-legal__text table { width: 100%; border-collapse: collapse; margin: 0 0 var(--ty-space-md, 12px); }
.ty-legal__text th, .ty-legal__text td { padding: var(--ty-space-xs, 4px) var(--ty-space-sm, 8px); border: 1px solid var(--ty-color-border, #e5e9ee); vertical-align: top; }
.ty-legal__progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--ty-space-sm, 8px);
    margin: var(--ty-space-md, 12px) 0 0;
    color: var(--ty-color-text-muted, #57606a);
    font-size: var(--ty-font-sm, 14px);
}
.ty-legal__progress.is-done { color: var(--ty-color-success-ink, #1a7f37); }
.ty-legal .ty-auth__submit { margin-top: var(--ty-space-lg, 16px); }

/* The Privacy Policy reads green (the success family), the Terms keep the brand blue, so the second document of the gate
   never looks like the first one shown again (owner, 2026-10-28). Re-pointing the primary family inside the page turns the
   Accept button, focus ring and links green without a second button style. */
.ty-legal--privacy {
    --ty-color-primary: var(--ty-color-success-ink, #1a7f37);
    --ty-color-primary-ink: var(--ty-color-success-ink, #1a7f37);
    --ty-color-primary-strong: color-mix(in srgb, var(--ty-color-success-ink, #1a7f37) 82%, var(--ty-color-text, #1c2128));
    --ty-color-primary-contrast: var(--ty-color-surface, #fff);
    --ty-focus-ring: 0 0 0 .2rem color-mix(in srgb, var(--ty-color-success, #26b050) 40%, transparent);
}
.ty-legal--privacy .ty-auth__title { color: var(--ty-color-success-ink, #1a7f37); }
.ty-legal--privacy .ty-legal__box {
    border-color: var(--ty-color-success-border, #bfe3cc);
    border-top: 4px solid var(--ty-color-success, #26b050);
}
.ty-legal__done {
    display: flex;
    align-items: center;
    gap: var(--ty-space-sm, 8px);
    margin: 0 0 var(--ty-space-sm, 8px);
    padding: var(--ty-space-sm, 8px) var(--ty-space-md, 12px);
    border: 1px solid var(--ty-color-success-border, #bfe3cc);
    border-radius: var(--ty-radius-control, 8px);
    background: var(--ty-color-success-soft, #e6f6ea);
    color: var(--ty-color-success-ink, #1a7f37);
    font-size: var(--ty-font-sm, 14px);
    text-align: left;
}
.ty-legal__done > i { font-size: 1.15rem; flex-shrink: 0; }

/* The reading screen fits ONE viewport (owner, 2026-10-22, Android): the page itself never scrolls, the document box
   takes whatever height is left, and Accept (disabled until the end of the text has been in view) sits at the bottom,
   visible the moment the page loads. A compact header (smaller lockup and title) leaves the box the room. Insets come
   from --ty-safe-top/-bottom (pushed natively on Android, env() on iOS, 0 on desktop). */
.ty-auth.ty-legal--reading {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    padding: calc(var(--ty-safe-top, 0px) + var(--ty-space-md, 12px)) var(--ty-space-lg, 16px)
             calc(var(--ty-safe-bottom, 0px) + var(--ty-space-md, 12px));
}
.ty-legal--reading > * { flex-shrink: 0; }
.ty-legal--reading .ty-legal__box {
    flex: 1 1 auto;
    min-height: 6rem;
    max-height: none;
}
.ty-legal--reading .ty-lockup { margin-bottom: 0; }
.ty-legal--reading .ty-lockup .ty-spinner { --ty-spin-sz: 3.5rem; }
.ty-legal--reading .ty-lockup__word { font-size: .85rem; }
.ty-legal--reading .ty-lockup__status { min-height: 0; margin: 0 0 var(--ty-space-xs, 4px); }
.ty-legal--reading .ty-auth__title { margin-bottom: var(--ty-space-xs, 4px); font-size: clamp(1.3rem, 1.1rem + 1vw, var(--ty-font-xl, 24px)); }
.ty-legal--reading .ty-auth__lede { margin-bottom: var(--ty-space-sm, 8px); }
.ty-legal--reading .ty-legal__version { margin: 0 0 var(--ty-space-sm, 8px); }
.ty-legal--reading .ty-legal__progress { margin-top: var(--ty-space-sm, 8px); }
.ty-legal--reading .ty-auth__submit { margin-top: var(--ty-space-sm, 8px); }
.ty-legal--reading .ty-auth__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--ty-space-xs, 4px) var(--ty-space-lg, 16px);
    margin-top: var(--ty-space-sm, 8px);
}
/* A short screen (a phone on its side, a big text size): drop the explanatory lines before the box gets too small. */
@media (max-height: 34rem) {
    .ty-legal--reading .ty-lockup__word,
    .ty-legal--reading .ty-auth__lede,
    .ty-legal--reading .ty-legal__version { display: none; }
}

/* The in-app copy under Account: the same text, no gate, in the page's own column. */
.ty-legal-page { max-width: 48rem; }
.ty-legal-page__meta { color: var(--ty-color-text-muted, #57606a); font-size: var(--ty-font-sm, 14px); margin: 0 0 var(--ty-space-md, 12px); }
.ty-legal-page .ty-legal__box { max-height: none; overflow: visible; }

/* ============================================================================
   THE FRONT DOOR IS ONE SCREEN (owner, 2026-10-23) -- like a mobile app's sign-in: lockup, title, lede, provider buttons, "or", email,
   passkey link, terms and version fit the viewport with no page scroll, the same idea as the Terms gate's .ty-legal--reading. The page is a
   centred flex column at least one dynamic viewport tall (so the keyboard-less layout never needs the page to scroll), clear of the system bars
   via --ty-safe-top/-bottom, with every gap compressed. Below 44rem tall the lede/status give way first, below 34rem (a landscape phone) the
   version and the lede go, and only past that may the page scroll -- interactive controls are never what is dropped. Touch targets stay 44px.
   The follow-on steps (code entry, relay) share .ty-front, so they take the same frame.
   ============================================================================ */
.ty-front {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    box-sizing: border-box;
    padding: calc(var(--ty-safe-top, 0px) + clamp(8px, 2.5vh, 32px)) var(--ty-space-lg, 16px)
             calc(var(--ty-safe-bottom, 0px) + clamp(8px, 2vh, 24px));
}
.ty-front > * { flex-shrink: 0; }
.ty-front .ty-lockup { margin-bottom: 6px; }
.ty-front .ty-lockup__status { min-height: 0; margin: 0 0 var(--ty-space-xs, 4px); }
.ty-front .ty-lockup__status:empty { display: none; }
.ty-front .ty-auth__title { margin-bottom: var(--ty-space-xs, 4px); font-size: clamp(1.35rem, 1.1rem + 1.2vh, var(--ty-font-2xl, 32px)); }
.ty-front .ty-auth__lede { margin-bottom: clamp(8px, 2vh, 20px); }
.ty-front .ty-auth__provider { min-height: 2.75rem; margin-bottom: 6px; }
.ty-front .ty-auth__divider { margin: clamp(6px, 1.5vh, 16px) 0; }
.ty-front .ty-auth__field { margin-bottom: 8px; }
.ty-front .ty-auth__input { min-height: 2.75rem; }
.ty-front .ty-auth__submit { min-height: 2.75rem; margin-top: 8px; }
.ty-front .ty-auth__submit--tight { margin-top: 8px; }
.ty-front .ty-auth__links { margin-top: clamp(6px, 1.5vh, 16px); gap: 8px; }
.ty-front .ty-auth__foot { margin-top: clamp(8px, 1.8vh, 16px); font-size: var(--ty-font-xs, 12px); line-height: 1.35; }
.ty-front .ty-auth__foot a { padding: 2px 0; }
.ty-front .ty-front__version { margin-top: 4px; }

@media (max-height: 44rem) {
    .ty-front .ty-lockup .ty-spinner { --ty-spin-sz: 4rem; }
    .ty-front .ty-lockup__word { font-size: .9rem; }
    .ty-front .ty-auth__label { margin-bottom: 2px; }
    .ty-front .ty-auth__provider { margin-bottom: 5px; }
}
@media (max-height: 40rem) {
    .ty-front .ty-lockup .ty-spinner { --ty-spin-sz: 3.25rem; }
    .ty-front .ty-auth__lede { display: none; }
}
@media (max-height: 34rem) {
    .ty-front .ty-front__version { display: none; }
    .ty-front .ty-lockup__word { display: none; }
}

/* FB-225: while the top-bar Settings menu is open, lift the (sticky, z-index:1) top bar's stacking context above the shell's
   floating widgets (the documents tab on the right edge, the "+" button) so the menu is never drawn under them. */
.page main .top-row:has(.ty-setmenu__menu) { z-index: 1100; }
/* FB-228: the same lift while the notification bell's panel is open. */
.page main .top-row:has(.ty-bell__panel) { z-index: 1100; }
/* Offline redesign (2026-10-31): the connection button sits right beside the weather icon and takes over its
   "hand the spare width to the account" margin; its panel (a TyDetailPanel sheet) gets the same lift while open. */
.page main .top-row .wxc:has(+ .tysh) { margin-right: 0; }
.page main .top-row:has(.tysh .dp) { z-index: 1100; }
/* Always-on top bar: the weather panel and the expanded search live in the bar's own stacking context, so they lift it the
   same way while open (their fixed backdrops would otherwise sit under the floating buttons and panels). */
.page main .top-row:has(.wxc-panel, .gs-panel, .ghm-panel) { z-index: 1100; }
/* Release smoke 2026-11-14: the lift above is for the bar's OWN panels, and a list page keeps the header search's panel (hence the lift)
   for as long as a search stands. A layer that covers the window (a record panel, a wizard, a sheet, a lightbox) sits at 1051-1095, so
   with the bar at 1100 the bar drew OVER it: the top-right Settings button sat on the record panel's Close button and took the tap.
   While such a layer is open the bar returns to its own level and the layer covers it, as it covers everything else. A sheet that is
   INSIDE the bar (the connection panel, .tysh) is part of the bar and keeps the lift. */
body:has(:is(.dp-scrim:not(.tysh *), .sf-backdrop, .vd-backdrop, .wz-overlay, .wz-scrim, .ty-panel-overlay, .who-backdrop, .cv-overlay, .hb-scrim, .gp-scrim, .sw-scrim, .dl-lightbox-backdrop))
    .page main .top-row:is(:has(.wxc-panel, .gs-panel, .ghm-panel), :has(.ty-setmenu__menu), :has(.ty-bell__panel)) { z-index: var(--ty-z-topbar, 1030); }
/* FB-228: making room for the bell on a phone. The bar is a row of 48px thumb targets 8px apart (mobile.css), and 390px
   holds about seven; the bell is one more. When the bar is crowded — the bell plus a trial chip, a language flag or the
   sandbox flask — it tightens instead of squeezing a chip until its text overlaps its neighbour: the gaps drop to 3px
   (every target keeps its 48px) and the weather chip shows its icon only (the temperature stays in its label and its
   panel). The language flag no longer lives in the bar at all (2026-10-23, owner): it is a "Language: English" row in the
   account menu, so the old "hide the flag when a trial chip is present" rule is gone with it. Wider than a phone, nothing changes. */
@media (max-width: 47.99rem) {
    :root:root .page main > .top-row:has(.ty-bell):is(:has(.ty-trial), :has(.ty-sandbox-badge)) { column-gap: 3px; }
    :root:root .page main > .top-row:has(.ty-bell):is(:has(.ty-trial), :has(.ty-sandbox-badge)) .wxc-temp { display: none; }
    :root:root .page main > .top-row:has(.ty-bell):is(:has(.ty-trial), :has(.ty-sandbox-badge)) .wxc-chip { padding: 0; }
    :root:root .page main > .top-row:has(.ty-bell):has(.ty-trial) .ty-trial { margin-right: 0; }
}
/* 10 Nov 2026 (owner, Android phone: "the settings menu and user menu are being bunched to the right and clipped on the customers
   page"). A list page publishes filters, so the Filters toggle (PageFiltersToggle, phone only) is one more 48px target in a bar that
   already holds search, weather, connection, help, bell, account and cog: 8 x 48 plus seven 8px gaps is 440px in a 360-412px phone,
   and none of those items shrinks, so the last ones ran past the edge where the shell's overflow-x clip cut them off. The dashboard
   at 360 was already over by a little too: its account wrapper (min-width:0 from the bar's `> *` rule) collapsed to 1px while its
   button kept 48px and drew over the cog.
   Three rules, widest first, each sized from the budget (viewport - 16px of padding):
   1. The account wrapper never shrinks below its avatar; the NAME is what gives way.
   2. Up to 30rem, a bar with the Filters toggle drops the weather chip (a list page's own controls outrank the forecast; the
      dashboard, the weather's home on a phone, is unaffected): 7 x 48 + six 8px gaps = 384, which fits from 400px.
   3. Up to 25rem (360-390 phones) every bar tightens: 3px gaps, the weather as its icon only, the account as its avatar only, and the
      Filters toggle, bell and cog at 44px (still the WCAG 2.5.5 minimum, the floor the trial chip's rule above already uses). Dashboard 316 + 18 gaps = 334 of
      344; a list page 316 + 18 = 334 with the weather gone. */
@media (max-width: 47.99rem) {
    :root:root .page main > .top-row > .ty-account { min-width: 44px; }
}
@media (max-width: 30rem) {
    :root:root .page main > .top-row:has(.plt) .wxc { display: none; }
}
@media (max-width: 25rem) {
    :root:root:root .page main > .top-row { column-gap: 3px; }   /* one more :root than mobile.css's own 8px gap, which loads after this file */
    :root:root .page main > .top-row .wxc-temp { display: none; }
    :root:root .page main > .top-row .wxc-chip { padding: 0; min-width: 44px; }
    :root:root .page main > .top-row .ty-account__trigger { padding-inline: 0; width: 44px; justify-content: center; }
    :root:root .page main > .top-row .ty-account__name { display: none; }
    :root:root:root .page main > .top-row :is(.plt, .ty-bell__trigger, .ty-setmenu__trigger) {
        min-width: 44px !important; width: 44px !important; min-height: 44px !important; height: 44px !important;
    }
}
/* The setup helper's card is DOCKED, not floated, on a wide screen: it is a 24rem card pinned to the bottom right, which
   on a laptop sat on top of plan cards and the Chase button. While it shows, the page reserves its width (the card, plus
   the FAB inset either side) so nothing it could cover is underneath. From 90rem (1440px) only: docked at 1280 the
   customers table was left ~490px wide, so a small laptop keeps the floating corner card like a tablet (and the phone
   its bottom sheet). The padding is NOT transitioned: animating it walked every grid on the page through each of its
   column counts in turn; set at once, the layout changes a single time while the card itself animates in
   (SetupTipHost.razor.css tip-in). 24rem mirrors SetupTipHost.razor.css's .tip width. */
@media (min-width: 90rem) {
    body:has([data-testid="setup-tip"]) .page main > .content {
        padding-inline-end: calc(24rem + 2 * var(--ty-fab-inset, 1.25rem)) !important;
    }
    /* Where a page shows the Documents pull tab the card sits left of it (SetupTipHost.razor.css: right = edge-tab clear
       + .25rem, not the FAB inset), so the gutter grows by the same amount; without this the card covered the right
       28px of the dashboard KPI cards and the expand chevrons on /owed at 1440px. */
    body:has(.dl-pull):has([data-testid="setup-tip"]) .page main > .content {
        padding-inline-end: calc(24rem + var(--ty-edge-tab-clear, 3.5rem) + .25rem + var(--ty-fab-inset, 1.25rem)) !important;
    }
}
/* 360-400px with the whole set in the bar (search, weather, test-workspace flask, trial chip, a first name, bell, cog): the bell and the
   cog give 4px each back (48 to 44, still the WCAG 2.5.5 minimum) so the person's name is not cut to "C..". Same-width phones
   without a trial chip keep the full 48. */
@media (max-width: 25rem) {
    :root:root:root .page main > .top-row:has(.ty-trial) :is(.ty-bell__trigger, .ty-setmenu__trigger) {
        min-width: 44px !important; width: 44px !important; min-height: 44px !important; height: 44px !important;
    }
}

/* ============================================================================
   ONE close-button style for everything that opens OVER a page (owner 2026-10-31):
   panels, side panels, bottom sheets, modals, popovers, lightbox/showcase, weather and other overlays.
   A 36px rounded square with a 1px soft brand border, a faint brand tint and a brand-ink X; 44px on touch.
   Tokens only, so the module colour, tenant brand, dark theme and Trusty all re-tint it. `.ty-close` is the class
   for new code; the list below adopts the existing close controls without touching their components.
   `.ty-close--sm` is the quieter variant for inline banners and toasts (no border, fainter tint).
   `:root:root` outranks the scoped `.x[b-xxxx]` rules; behaviour, aria-labels and test ids are untouched.
   Spec: Dev Help /design/ui "Close buttons". ============================================================================ */
:root {
    --ty-close-size: 36px;
    --ty-close-fg: var(--ty-color-primary-ink, var(--ty-color-primary, #1457b0));
    --ty-close-border: color-mix(in srgb, var(--ty-color-primary, #1E6FD9) 38%, transparent);
    --ty-close-bg: color-mix(in srgb, var(--ty-color-primary, #1E6FD9) 9%, transparent);
    --ty-close-bg-hover: color-mix(in srgb, var(--ty-color-primary, #1E6FD9) 18%, transparent);
    --ty-close-bg-active: color-mix(in srgb, var(--ty-color-primary, #1E6FD9) 28%, transparent);
}
:root:root :is(.ty-close, .btn-close, .dp-act--close, .tsp__close, .tysh-close, .lm-sheet-x, .lm-card-x, .lm-layers-close,
        .ty-nav-info__close, .ty-bell__close, .ty-setmenu__close, .wxc-close, .sw-hd__close, .tso__close, .ty-lp__close,
        .wz-sheet-x, .who-x, .tp-x, .mp-x, .tip-x) {
    box-sizing: border-box;
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: var(--ty-close-size); height: var(--ty-close-size); min-width: var(--ty-close-size); min-height: var(--ty-close-size);
    padding: 0;
    border: 1px solid var(--ty-close-border); border-radius: 10px;
    background: var(--ty-close-bg); color: var(--ty-close-fg); opacity: 1;
    font-size: 1.1rem; line-height: 1; cursor: pointer;
    transition: background-color .12s ease, border-color .12s ease;
}
/* A close that carries a LABEL (the side panel's icon + "Close") is a pill, not the square above: forced to 36/44px square with padding 0 its
   text spilled out sideways and overlapped the neighbouring "Open full page" link (owner 10 Nov). Auto width, 44px tall at every size. */
:root:root .tsp .tsp__close {
    width: auto; height: auto; min-height: 44px; padding: 0 .85rem; gap: .4rem; white-space: nowrap;
    font-size: .95rem; font-weight: 700; border-radius: 999px;
}

/* The setup helper's X is a finger-sized 44px target everywhere (its tests hold it to that). */
:root:root .tip-x { --ty-close-size: 44px; }
/* Bootstrap's btn-close paints a fixed black SVG background; swap it for a currentColor mask so it takes the brand ink. */
:root:root .btn-close { background-image: none; filter: none; }
/* In a header the X sits at the far end, as before; Bootstrap's negative offsets (made for a 16px glyph) are dropped for the bigger box. */
:root:root :is(.modal-header, .offcanvas-header) .btn-close { margin: 0 0 0 auto; }
:root:root .btn-close::before {
    content: ""; width: 1rem; height: 1rem; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3.5 3.5l9 9M12.5 3.5l-9 9'/%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 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3.5 3.5l9 9M12.5 3.5l-9 9'/%3E%3C/svg%3E") center / contain no-repeat;
}
:root:root :is(.ty-close, .btn-close, .dp-act--close, .tsp__close, .tysh-close, .lm-sheet-x, .lm-card-x, .lm-layers-close,
        .ty-nav-info__close, .ty-bell__close, .ty-setmenu__close, .wxc-close, .sw-hd__close, .tso__close, .ty-lp__close,
        .wz-sheet-x, .who-x, .tp-x, .mp-x, .tip-x):hover {
    background: var(--ty-close-bg-hover); border-color: var(--ty-close-fg); color: var(--ty-close-fg); opacity: 1;
}
:root:root :is(.ty-close, .btn-close, .dp-act--close, .tsp__close, .tysh-close, .lm-sheet-x, .lm-card-x, .lm-layers-close,
        .ty-nav-info__close, .ty-bell__close, .ty-setmenu__close, .wxc-close, .sw-hd__close, .tso__close, .ty-lp__close,
        .wz-sheet-x, .who-x, .tp-x, .mp-x, .tip-x):active { background: var(--ty-close-bg-active); }
:root:root :is(.ty-close, .btn-close, .dp-act--close, .tsp__close, .tysh-close, .lm-sheet-x, .lm-card-x, .lm-layers-close,
        .ty-nav-info__close, .ty-bell__close, .ty-setmenu__close, .wxc-close, .sw-hd__close, .tso__close, .ty-lp__close,
        .wz-sheet-x, .who-x, .tp-x, .mp-x, .tip-x):focus-visible {
    outline: 2px solid var(--ty-close-fg); outline-offset: 2px; box-shadow: none;
}
/* The detail panel's close used a danger hover; one colour story for every close instead. */
:root:root .dp-act--close:hover { color: var(--ty-close-fg); border-color: var(--ty-close-fg); background: var(--ty-close-bg-hover); }

/* The scheduling panels draw their close ON a coloured header, so the tint is white rather than brand. */
:root:root .ty-panel-close {
    width: var(--ty-close-size); height: var(--ty-close-size); border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--ty-color-primary-contrast, #fff) 55%, transparent);
    background: color-mix(in srgb, var(--ty-color-primary-contrast, #fff) 18%, transparent);
    color: var(--ty-color-primary-contrast, #fff);
}
:root:root .ty-panel-close:hover { background: color-mix(in srgb, var(--ty-color-primary-contrast, #fff) 32%, transparent); }
:root:root .ty-panel-close:focus-visible { outline: 2px solid var(--ty-color-primary-contrast, #fff); outline-offset: 2px; }

/* Inline banners, toasts and flashes: same family, proportionate. */
:root:root :is(.ty-close--sm, .ty-toast-close, .plan__flash-close, .setup-nudge__close, .setup-bar__close, .ty-trial__close) {
    border-radius: 8px; border: 1px solid transparent;
    background: color-mix(in srgb, currentColor 7%, transparent);
}
:root:root :is(.ty-close--sm, .ty-toast-close, .plan__flash-close, .setup-nudge__close, .setup-bar__close, .ty-trial__close):hover {
    background: color-mix(in srgb, currentColor 16%, transparent);
}

/* The bell and settings menus only show their close as a phone sheet. */
:root:root :is(.ty-bell__close, .ty-setmenu__close, .ty-nav-info__close) { display: none; }
:root:root .ty-nav-info[data-open="true"] .ty-nav-info__close { display: inline-flex; }
@media (max-width: 767.98px) {
    :root:root :is(.ty-bell__close, .ty-setmenu__close) { display: inline-flex; }
}
@media (pointer: coarse), (max-width: 47.99rem) {
    :root { --ty-close-size: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    :root:root :is(.ty-close, .btn-close, .dp-act--close, .tsp__close, .tysh-close) { transition: none; }
}

/* ── FB-303: the dictation microphone in the corner of every multi-line text box ──────────────────────────────────────
   Markup (any project, domains included: plain HTML, no component, because a domain may reference only Core):
       <div class="ty-dictate-field"><textarea …></textarea><button type="button" class="ty-dictate-mic" data-ty-dictate></button></div>
   The ONE host (TradeYoke.Shared/Layout/DictationHost.razor, in Routes) sets html[data-ty-dictation="ready"] when this
   device can hear anything at all; until then the button is not drawn, so a box looks exactly as it did. dictation.js
   only ever writes attributes Blazor does not render (data-ty-dictate-*, aria-pressed, title, aria-label). The icon is
   a CSS mask, so the button needs no children and no icon font (public pages have none). Tokens only (/design/ui). */
.ty-dictate-field { position: relative; }
/* The box fills the wrapper, so the corner IS the box's corner (a bare textarea is only as wide as its cols).
   Zero-specificity wrapper: a component's own width rule still wins. */
:where(.ty-dictate-field) > textarea { width: 100%; }
.ty-dictate-mic { display: none; }
html[data-ty-dictation="ready"] .ty-dictate-field > .ty-dictate-mic {
    display: inline-flex;
    position: absolute;
    top: .35rem;
    right: .35rem;
    z-index: 2;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    /* The phone layer's button floor (mobile.css, --ty-tap) would blow this up to a 48px disc inside a two-line box: the
       visual stays small and the ::after below carries the hit area instead (its "hit-area extension" pattern). */
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 1px solid var(--ty-color-border);
    border-radius: 999px;
    background: var(--ty-color-surface);
    color: var(--ty-color-text-muted);
    cursor: pointer;
}
/* 32px drawn, 44px to the finger (/design/ui touch floor); the phone layer's 48px (--ty-tap) where it applies. */
html[data-ty-dictation="ready"] .ty-dictate-field > .ty-dictate-mic::after {
    content: "";
    position: absolute;
    inset: calc((2rem - max(44px, var(--ty-tap, 44px))) / 2);
}
html[data-ty-dictation="ready"] .ty-dictate-field > .ty-dictate-mic::before {
    content: "";
    width: 1.05rem;
    height: 1.05rem;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 6.5A.5.5 0 0 1 4 7v1a4 4 0 0 0 8 0V7a.5.5 0 0 1 1 0v1a5 5 0 0 1-4.5 4.975V15h3a.5.5 0 0 1 0 1h-7a.5.5 0 0 1 0-1h3v-2.025A5 5 0 0 1 3 8V7a.5.5 0 0 1 .5-.5'/%3E%3Cpath d='M10 8a2 2 0 1 1-4 0V3a2 2 0 1 1 4 0zM8 0a3 3 0 0 0-3 3v5a3 3 0 0 0 6 0V3a3 3 0 0 0-3-3'/%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 16 16'%3E%3Cpath d='M3.5 6.5A.5.5 0 0 1 4 7v1a4 4 0 0 0 8 0V7a.5.5 0 0 1 1 0v1a5 5 0 0 1-4.5 4.975V15h3a.5.5 0 0 1 0 1h-7a.5.5 0 0 1 0-1h3v-2.025A5 5 0 0 1 3 8V7a.5.5 0 0 1 .5-.5'/%3E%3Cpath d='M10 8a2 2 0 1 1-4 0V3a2 2 0 1 1 4 0zM8 0a3 3 0 0 0-3 3v5a3 3 0 0 0 6 0V3a3 3 0 0 0-3-3'/%3E%3C/svg%3E") center / contain no-repeat;
}
html[data-ty-dictation="ready"] .ty-dictate-field > .ty-dictate-mic:hover,
html[data-ty-dictation="ready"] .ty-dictate-field > .ty-dictate-mic:focus-visible {
    color: var(--ty-color-primary);
    border-color: var(--ty-color-primary);
}
/* Listening: the same red as the assistant's live microphone, and the icon becomes a stop square. */
html[data-ty-dictation="ready"] .ty-dictate-field[data-ty-dictate-state="live"] > .ty-dictate-mic {
    background: var(--ty-color-danger);
    border-color: var(--ty-color-danger);
    color: var(--ty-color-text-onink);   /* white on the red in every theme; a trade's primary-contrast can be dark */
    box-shadow: 0 0 0 .2rem var(--ty-color-danger-soft);
}
html[data-ty-dictation="ready"] .ty-dictate-field[data-ty-dictate-state="live"] > .ty-dictate-mic::before {
    width: .75rem;
    height: .75rem;
    -webkit-mask: none;
    mask: none;
    border-radius: 2px;
}
html[data-ty-dictation="ready"] .ty-dictate-field:is([data-ty-dictate-state="starting"], [data-ty-dictate-state="finishing"]) > .ty-dictate-mic {
    color: var(--ty-color-primary);
    border-color: var(--ty-color-primary);
    cursor: progress;
}
@media (prefers-reduced-motion: no-preference) {
    html[data-ty-dictation="ready"] .ty-dictate-field[data-ty-dictate-state="live"] > .ty-dictate-mic { animation: ty-dictate-pulse 1.4s ease-in-out infinite; }
    html[data-ty-dictation="ready"] .ty-dictate-field:is([data-ty-dictate-state="starting"], [data-ty-dictate-state="finishing"]) > .ty-dictate-mic { animation: ty-dictate-pulse .8s ease-in-out infinite; }
}
@keyframes ty-dictate-pulse {
    0%, 100% { box-shadow: 0 0 0 .15rem var(--ty-color-danger-soft); }
    50% { box-shadow: 0 0 0 .4rem var(--ty-color-danger-soft); }
}
/* Room for the button so typed text never runs under it. */
html[data-ty-dictation="ready"] .ty-dictate-field > textarea { padding-right: 2.6rem; }
/* A box the person cannot type into gets no microphone either. */
html[data-ty-dictation="ready"] .ty-dictate-field > textarea:is(:disabled, [readonly]) ~ .ty-dictate-mic { display: none; }
/* The words being heard (interim) or why there are none (notice), under the box, in the flow so nothing is covered. */
.ty-dictate-field[data-ty-dictate-line]:not([data-ty-dictate-line=""])::after {
    content: attr(data-ty-dictate-line);
    display: block;
    margin-top: .25rem;
    font-size: .8rem;
    line-height: 1.35;
    color: var(--ty-color-text-muted);
    overflow-wrap: anywhere;
}
.ty-dictate-field[data-ty-dictate-tone="interim"]::after { font-style: italic; }
.ty-dictate-field[data-ty-dictate-tone="notice"]::after { color: var(--ty-color-text); }

/* FB-349: a trade line's heading over its tiles on the signup form (Home & Trades, Health & Beauty). */
.ty-auth__trade-line {
    margin: var(--ty-space-md, 12px) 0 6px;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ty-color-text-muted, #57606a);
}
.ty-auth__trade-line:first-of-type { margin-top: 0; }

/* A full-screen game (Squeegee Rush / RIG RACE) owns the whole playfield: while one is mounted gameFit.js marks <html>
   and the floating shell chrome that would sit over its controls (the "+" quick-add FAB, the right-edge Documents tab)
   steps aside. Nothing is removed - they return the moment the game page is left. */
html.ty-game-active .qa-fab,
html.ty-game-active .dl-pull { display: none !important; }

/* A phone number box with its type picker (Mobile / Home / Work / Other) on the right, on trade customer pages and
   the public forms that cannot use the shared form's own rows. The box shrinks (min-width 0); the picker keeps its width. */
.ty-phone-row { container-type: inline-size; display: flex; align-items: center; gap: .5rem; min-width: 0; }
.ty-phone-row > input { flex: 1 1 auto; min-width: 0; width: auto; }
.ty-phone-row > .tpt { flex: 0 0 auto; }

/* Scroll lock (mobile-shell.js tyScrollLock): while any overlay is drawn over the page the window cannot scroll. overflow
   hidden on the viewport keeps scrollY exactly (no restore jump, no scroll events), the gutter replaces the vanished
   scrollbar so the layout does not shift, and overscroll-behavior stops a rubber-band. Menus keep their own scrolling. */
/* On <html> only: its overflow propagates to the viewport, so the window is what stops scrolling. Setting it on <body> as well would make the
   body a scroll container and the sticky top bar would stop sticking (parity trap 41). */
html.ty-scroll-locked { overflow: hidden !important; overscroll-behavior: none; }
html.ty-scroll-locked--gutter { scrollbar-gutter: stable; }
/* The overlays' own scroll areas never chain into the page behind (global: scoped CSS cannot reach a child's markup). */
.ty-setmenu__menu, .ty-account__menu, .ty-bell__panel, .ty-bell__list, .ghm-panel, .ty-trial__pop, .gp-body, .tsp__body { overscroll-behavior: contain; }
