/* GENERATED by Tools/DesignBundle from design/src - do not edit this file.
   Edit the modules, then run: dotnet run --project Tools/DesignBundle
   (docs/internal/conversation-platform/designer-css-plan.md section 2.4; the layer order is design/contract.json's) */

@layer cv.locked, cv.reset, cv.tokens, cv.base, cv.layout, cv.components, cv.skin, cv.device, cv.theme, cv.design, cv.code, cv.host, cv.params;

/* -- design/src/shared/locked.css -- */
@layer cv.locked {
/* THE LOCKED LAYER (layer cv.locked) - designer-css-plan section 5.2. DECLARED FIRST, ON PURPOSE.

   CSS reverses the layer order for !important declarations, so an !important rule in this first layer beats every
   !important a later layer can write - a design (cv.design), a launch code's design (cv.code), a host stylesheet (cv.host)
   or the embed's options (cv.params). That is how the screens that carry a person's consent, confirmation, payment and
   sign-in stay honest whatever a design does.

   WHAT IS PROTECTED (design/contract.json "protected"): every element that carries data-cv-protected - the parts each face
   lists as protected wherever they are drawn (the RCS emulator's verified note; the AI Concierge's secure button, its
   secure sheet and Powered by; the web runner's identity screen), and the screens and moments that are protected as a
   whole (the runner's run page on its confirm, sign-in and payment screens, the staff sign-in, a signature / payment /
   action moment). A design may dress them in COLOURS through the tokens; it may never hide, fake or shrink them.

   WHEN IT BITES: while a design is worn (html.cv-dressed - set by design/face.js once a design's sheet has loaded). Our own
   default look never wears a design, so this layer never moves a pixel of it (Tests/Design/NoVisualChangeTests).

   WHAT CSS HOLDS HERE: visible, opaque, untransformed, unfiltered, unclipped, unmasked and unblended - on the protected
   element itself, and the clipping, masking, filtering and blending on everything inside it (a design that clips a button
   of a confirm screen is held exactly as one that clips the screen). WHAT ONLY THE GUARD CAN HOLD: the 14 px type floor
   and the 4.5 : 1 contrast floor (section 5.3) - CSS has no "at least" for a size or a contrast it does not know, and
   pinning a value here would move our own type and colours - and coverage (nothing slides over a protected part). The
   runtime guard (design/face.js) compares every protected part with the design and without it, and strips a design that
   spoiled one. Tests/Design/ProtectedPartsAreLockedTests holds every rule below in place; mutation-tested.

   THE HOLD: while a design's sheet is on its way (at most 1.5 s - design/face.js) the face is a neutral skeleton - nothing
   of the default look flashes before the design lands. */

html.cv-dressed [data-cv-protected] {
  visibility: visible !important;
  opacity: 1 !important;
  transform: none !important;
  translate: none !important;
  rotate: none !important;
  scale: none !important;
  filter: none !important;
  clip-path: none !important;
  -webkit-mask: none !important;
  mask: none !important;
  mix-blend-mode: normal !important;
}

html.cv-dressed [data-cv-protected] * {
  filter: none !important;
  clip-path: none !important;
  -webkit-mask: none !important;
  mask: none !important;
  mix-blend-mode: normal !important;
}

html.cv-hold {
  background-color: #f2f2f3 !important;
}

html.cv-hold[data-cv-theme="dark"] {
  background-color: #1f1f22 !important;
}

html.cv-hold body {
  visibility: hidden !important;
}
}

/* -- design/src/shared/a11y.css -- */
@layer cv.locked {
/* THE ACCESSIBILITY FLOOR (layer cv.locked) - designer-css-plan sections 5.3 and 9 (P0.5).

   What no design may take away from a person, locked beside the protected screens. The !important here is deliberate:
   in this FIRST layer it beats every !important a later layer can write - a design (cv.design), a launch code's design
   (cv.code), a host stylesheet (cv.host), the embed's options (cv.params) and every unlayered sheet - so no design can
   bring any of it back. Every rule is scoped to a customer face ([data-cv-face] - the shells set it on <html>), and this
   module is only ever bundled into the faces' own sheets (design/bundles.json): the Portal never loads it.

   P0.5 - THE IPHONE ZOOM, FIXED AT THE CAUSE. NEVER BY LOCKING THE VIEWPORT: `maximum-scale` / `user-scalable=no` would
   take pinch-zoom from the people who need it (WCAG 1.4.4), and Safari ignores them anyway
   (Tests/Design/ViewportIsNeverLockedTests). What made a page jump on an iPhone - in the RCS emulator's web overlay above
   all - was Safari zooming into any focused field whose text is under 16 px, and staying zoomed; and a quick double tap on
   a chip zooming the page. So:

   1. On a touch screen ((pointer: coarse) - a phone or a tablet, the only devices whose browsers zoom into a focused
      field), every field a person types into or picks from is at least 16 px - the size Safari leaves alone. A design
      that wants its fields larger sets --cv-field-font-size (a shared token, 16px by default); it can never go under 16.
      A mouse-and-keyboard screen keeps the face's own sizes, so nothing moves on a desktop (the shots hold it).
      Tick boxes, radios, sliders and buttons are not fields here: their text is not typed, and some size by 1em.
   2. touch-action: manipulation on the face's ROOT only (<html>): no double-tap zoom and no tap delay, while pinch-zoom
      and panning still work. Touch-action is not inherited, but the browser intersects an element's touch-action with
      every ancestor's - so the root's value reaches every element below it, and an element that asks for less (the
      signature pad's touch-action: none, a list that pans one way) keeps what it asked for. Never set on every element:
      an !important there would override exactly those.
   3. text-size-adjust: 100% on the root, so iOS never inflates the text when the phone turns.

   Tests/Design/InputsAreSixteenOnPhonesTests holds 1-3 by target on a touch window (every field the runner's markup can
   draw, and every field on the design tour's screens, in every frame); the desktop shots of
   Tests/Design/NoVisualChangeTests hold that a mouse screen did not move.

   P1 adds the rest of the floor here: :focus-visible kept, prefers-reduced-motion honoured, the minimum sizes kept. */

html[data-cv-face] {
  -webkit-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
  touch-action: manipulation !important;
}

@media (pointer: coarse) {
  [data-cv-face] :where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"],
                                  [type="button"], [type="submit"], [type="reset"], [type="image"], [type="hidden"]),
                        textarea, select) {
    font-size: max(16px, var(--cv-field-font-size, 16px)) !important;
  }
}
}

/* -- design/src/shared/reset.css -- */
@layer cv.reset {
/* THE SHARED RESET (layer cv.reset) - designer-css-plan section 2.4.

   The rules every customer face already carried, word for word: the RCS emulator (rcs.css) and the AI Concierge (bot.css)
   both open with exactly these three. A face that adopts the shared modules deletes its own copy and nothing on screen
   moves - the no-visual-change shots (Tests/Design/NoVisualChangeTests) prove it.

   What does NOT belong here: anything only one face does (the concierge's `margin: 0; padding: 0` on every element stays
   in the concierge's own modules), and anything that changes a picture. A rule earns its place in the shared reset only
   when every face already says it. */

* { box-sizing: border-box; }

/* State beats layout: a class that sets `display` would otherwise outrank the hidden ATTRIBUTE's own rule (the RCS sheet's
   backdrop once dimmed the whole page while "hidden"; the concierge's close button once showed on the full page). In this
   early layer the !important also outranks every later layer's !important - no design can show what the shell hid. */
[hidden] { display: none !important; }

html, body { height: 100%; }
}

/* -- design/src/shared/tokens.css -- */
@layer cv.tokens {
/* THE TOKENS (layer cv.tokens) - designer-css-plan section 2.3: ONE vocabulary, --cv-*, for every customer face.

   Three tiers, so a designer can work as broadly or as finely as they like:

   - REFERENCE - the raw brand: colours, type, radius, space, shadow, motion. From P1 the workspace theme fills these
     (--theme-primary -> --cv-color-brand, and so on).
   - SEMANTIC - what things ARE: a surface and the ink on it, the accent and the ink on it, the muted line, the danger,
     the focus ring, the two bubbles. Each reads a reference token, so changing the brand moves everything at once.
   - COMPONENT - one part's own knobs (--cv-chip-bg, --cv-card-radius ...). They live in each face's own token module,
     declared on the face's scope with today's value as the default; the contract (design/contract.json) lists every
     one, per face.

   The values below are the PLATFORM's neutral fallback - what a part would wear if a face named no value of its own. Each
   face's token module redeclares what it needs on its own scope with exactly the value it shows today, which is why
   adopting this file moves nothing.

   ONLY --cv-* IS PUBLIC. The RCS emulator's and the AI Concierge's pre-design-system variable names were retired in P0
   (Kirk, 2026-10-29 - greenfield: no customer stylesheet to keep, and ours were migrated in the same change); the rename
   table for anyone moving a page is RCS-Emulator-Embed.md "Moving from the old names". Components read only --cv-*, and
   whoever sets a look - a host stylesheet, the workspace's brand, the embed's style options, a design - sets --cv-* on the
   face's own scope (Tests/Design/NoLegacyDesignTokensTests holds the old names out of the repository). */

:root {
  /* ── reference ─────────────────────────────────────────────────────────────────────────────────────────────── */
  --cv-color-brand: #1a73e8;
  --cv-color-ink: #1f1f1f;
  --cv-color-paper: #ffffff;
  --cv-font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --cv-font-display: var(--cv-font-body);
  --cv-radius-s: 8px;
  --cv-radius-m: 12px;
  --cv-radius-l: 18px;
  --cv-space-1: 4px;
  --cv-space-2: 8px;
  --cv-space-3: 12px;
  --cv-space-4: 16px;
  --cv-space-5: 24px;
  --cv-space-6: 32px;
  --cv-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.08);
  --cv-shadow-2: 0 4px 14px rgba(0, 0, 0, 0.12);
  --cv-shadow-3: 0 18px 50px rgba(0, 0, 0, 0.16);
  --cv-motion-fast: 120ms;
  --cv-motion-slow: 240ms;

  /* ── semantic ──────────────────────────────────────────────────────────────────────────────────────────────── */
  --cv-surface: var(--cv-color-paper);
  --cv-on-surface: var(--cv-color-ink);
  --cv-accent: var(--cv-color-brand);
  --cv-on-accent: #ffffff;
  --cv-muted: color-mix(in srgb, var(--cv-color-ink) 62%, var(--cv-color-paper));
  --cv-danger: #c5221f;
  --cv-focus: var(--cv-color-brand);
  --cv-bubble-me-bg: var(--cv-accent);
  --cv-bubble-me-ink: var(--cv-on-accent);
  --cv-bubble-them-bg: var(--cv-surface);
  --cv-bubble-them-ink: var(--cv-on-surface);
  /* The text size of every field a person types into or picks from. The accessibility floor (a11y.css, cv.locked) never
     lets it under 16 px - Safari zooms into a smaller field - so a design may raise it, never lower it. */
  --cv-field-font-size: 16px;
}
}

/* -- design/src/shared/base.css -- */
@layer cv.base {
/* THE SHARED BASE (layer cv.base) - designer-css-plan section 2.4.

   The face root's own type and colour, once every face reads the tokens: the root ([data-cv-face]) wears --cv-font-body
   and --cv-on-surface, links and focus read --cv-accent / --cv-focus. It holds NO rules in P0 on purpose: today each face
   sets its own body type and colour, and a shared rule here could only move a picture. The face lanes move their base
   rules in here as they converge - each move proven by the no-visual-change shots. */
}

/* -- design/src/runner/tokens.css -- */
@layer cv.tokens {
/* THE WEB RUNNER'S TOKENS (layer cv.tokens) - designer-css-plan sections 2.3 and 2.4; the runner face pass (D3.5, 2026-10-29).

   The runner face is scoped by data-cv-face="runner" on <html> (UI.Runner/wwwroot/index.html), so these reach the body,
   the sign-in page and every moment. EVERY colour, corner, font, shadow and gap the runner paints with is read through
   one of these tokens - the runner's own sheets (root / wf / login / app) and the shared run view's (runner.css and
   run-host.css) alike - so a design changes the runner by setting --cv-* tokens in cv.design and never needs a class
   name.

   WHERE THE VALUES COME FROM. The workspace theme is the runner's --theme-* block: root.css's :root holds the house
   defaults (the forest-green look), and RunnerDesign.ThemeLayer writes the workspace's own block over them in cv.theme.
   Every token below DEFAULTS to that block - the reference tier reads it, the semantic tier reads the reference tier,
   and the rest read it name for name - so with no design the runner draws exactly what the theme says, pixel for pixel
   (Tests/Design/NoVisualChangeTests), and a design that sets the brand moves everything that reads it.

   A token whose --theme-* name the house defaults leave unset (--cv-panel, --cv-accent-soft, --cv-card-bg, the device
   colours ...) starts unset: each read keeps the value it names after the token, exactly as before, until a theme or
   a design sets it. The shared run view's sheets read each token with the host's own --theme-* name after it, because
   the Portal draws the same components with its own theme and never loads a design. */

[data-cv-face="runner"] {
    /* ── reference - the raw brand, fed by the workspace theme ───────────────────────────────────────────────────── */
    --cv-color-brand: var(--theme-primary);
    --cv-color-ink: var(--theme-text);
    --cv-color-paper: var(--theme-background);
    --cv-font-body: var(--theme-font);
    --cv-radius-s: var(--theme-radius-button);
    --cv-radius-m: var(--theme-radius);
    --cv-shadow-1: var(--theme-shadow);

    /* ── semantic - what things are ──────────────────────────────────────────────────────────────────────────────── */
    --cv-surface: var(--cv-color-paper);
    --cv-on-surface: var(--cv-color-ink);
    --cv-accent: var(--cv-color-brand);
    --cv-on-accent: var(--theme-text-on-primary);
    --cv-muted: var(--theme-text-muted);
    --cv-danger: var(--theme-danger);

    /* ── the runner's palette (component tier) ───────────────────────────────────────────────────────────────────── */
    /* The accent's own tones: hover, the faint wash behind a picked row, the soft glow, the deep shade, and the accent as
       an "r, g, b" triple and a hue for the few rules that mix it themselves. */
    --cv-accent-hover: var(--theme-primary-hover);
    --cv-accent-muted: var(--theme-primary-muted);
    --cv-accent-soft: var(--theme-primary-soft);
    --cv-accent-strong: var(--theme-primary-dark);
    --cv-accent-rgb: var(--theme-primary-rgb);
    --cv-accent-hue: var(--theme-primary-hue);
    /* The workspace's second and third colours (the theme's accent and offset). */
    --cv-second: var(--theme-accent);
    --cv-second-hover: var(--theme-accent-hover);
    --cv-second-muted: var(--theme-accent-muted);
    --cv-third: var(--theme-offset);
    --cv-third-muted: var(--theme-offset-muted);
    /* Ink in its weights: the second line, the emphasis, the placeholder in an empty field. */
    --cv-on-surface-2: var(--theme-text-secondary);
    --cv-on-surface-strong: var(--theme-text-emphasis);
    --cv-placeholder: var(--theme-text-placeholder);
    /* The page's layers: the tinted band, a raised card, a row under the pointer, a row being pressed. */
    --cv-surface-subtle: var(--theme-background-subtle);
    --cv-surface-raised: var(--theme-background-raised);
    --cv-surface-hover: var(--theme-background-hover);
    --cv-surface-active: var(--theme-background-active);
    /* A panel inside a moment (the amount due, a choice row, a tile) and its tones; a card behind a payment form. */
    --cv-panel: var(--theme-surface);
    --cv-panel-muted: var(--theme-surface-muted);
    --cv-panel-hover: var(--theme-surface-hover);
    --cv-panel-alt: var(--theme-surface-alt);
    --cv-card-bg: var(--theme-card-bg);
    /* Lines: the usual border, the firmer one, the faintest. */
    --cv-line: var(--theme-border);
    --cv-line-2: var(--theme-border-subtle);
    --cv-line-light: var(--theme-border-light);
    /* What went well, what needs a look, what went wrong, what is worth knowing - each with its wash. */
    --cv-success: var(--theme-success);
    --cv-success-muted: var(--theme-success-muted);
    --cv-success-bg: var(--theme-success-bg);
    --cv-warning: var(--theme-warning);
    --cv-warning-muted: var(--theme-warning-muted);
    --cv-on-warning: var(--theme-warning-text);
    --cv-danger-muted: var(--theme-danger-muted);
    --cv-info: var(--theme-info);
    --cv-info-muted: var(--theme-info-muted);
    /* The ring around a focused field (a box-shadow). */
    --cv-focus-ring: var(--theme-focus-ring);
    /* Type: the figures' font and the size scale. */
    --cv-font-mono: var(--theme-font-mono);
    --cv-font-size-xs: var(--theme-font-size-xs);
    --cv-font-size-sm: var(--theme-font-size-sm);
    --cv-font-size-base: var(--theme-font-size-base);
    --cv-font-size-lg: var(--theme-font-size-lg);
    --cv-font-size-xl: var(--theme-font-size-xl);
    --cv-font-size-2xl: var(--theme-font-size-2xl);
    --cv-font-size-3xl: var(--theme-font-size-3xl);
    /* Motion and rhythm: the one transition (duration and easing) and the gap between sections. */
    --cv-transition: var(--theme-transition);
    --cv-section-gap: var(--theme-section-gap);
    /* The bar that carries a worker's navigation (the signed-in list). */
    --cv-nav-bg: var(--theme-nav-background);
    --cv-nav-line: var(--theme-nav-border);
    --cv-nav-ink: var(--theme-nav-text-active);
    /* The phone the runner draws around itself on a wide screen. */
    --cv-device-frame: var(--theme-device-frame);
    --cv-device-edge: var(--theme-device-edge);
    --cv-device-island: var(--theme-device-island);
    /* The handwriting face (the signature rework, 2026-11-14): a typed signature on the pad and the sheet ending's handwritten
       cue. No hosted font is ever loaded for it - the device's own cursive (the shared sheet's fallback stack); a design may
       name its own, self-hosted. */
    --cv-font-script: var(--theme-font-script);
    /* THE SHEET'S X (the sheet ending): how far the centre of the RCS web view's close button sits from the screen's edge -
       43 px on an iPhone's sheet; the boot script writes 28 px inline on Android, whose in-app tab draws it nearer the edge. */
    --cv-sheet-x-center: var(--theme-sheet-x-center);

    /* ── the runner's own parts ──────────────────────────────────────────────────────────────────────────────────── */
    /* The page's colour scheme (root.css body) - the runner is drawn light. */
    --cv-color-scheme: light;

    /* The glass bar across the top of the runner's own page (app.css .runner-header). */
    --cv-header-bg: rgba(255, 255, 255, 0.85);

    /* The glass bar that holds Back and Next under every moment (app.css .wf-run-footer - the moment's buttons). */
    --cv-buttons-bg: rgba(255, 255, 255, 0.92);

    /* The staff sign-in page's backdrop (login.css body:has(.login-wrapper)) - its colour, and the glow over it. */
    --cv-signin-bg: #1a1a2e;
    --cv-signin-picture:
        radial-gradient(ellipse at 20% 20%, rgba(91, 33, 182, .18) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(37, 99, 235, .12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(26, 107, 60, .08) 0%, transparent 60%),
        linear-gradient(160deg, #1a1a2e 0%, #16213e 30%, #1a1a2e 60%, #0f3460 100%);
}
}

/* -- design/src/runner/root.css -- */
@layer cv.components {
/* =================================================================
   WF Portal — Global Design Tokens (Light Theme Defaults)
   -----------------------------------------------------------------
   All design tokens live under --theme-*. These are the only values
   you need to change to retheme the application.

   Per-tenant runtime overrides are injected by Theme.razor using the
   same --theme-* variable names. Theme.razor emits a <style> block
   that overrides specific variables — the browser cascade handles
   the rest.

   There is no separate theme.css file. root.css is the single
   source of truth for defaults. Dark themes are just another
   tenant override.
   ================================================================= */

:root {
    /* ── Backgrounds ──────────────────────────────────────────────── */

    --theme-background:               #ffffff;
    --theme-background-subtle:        #f1f4f7;
    --theme-background-raised:        #ffffff;
    --theme-background-float:         #ffffff;
    --theme-background-hover:         #e8ecf0;
    --theme-background-active:        #dde2e8;

    /* ── Borders ──────────────────────────────────────────────────── */

    --theme-border:                   #e2e6eb;
    --theme-border-subtle:            #cdd3db;

    /* ── Primary brand (forest green) ────────────────────────────── */

    --theme-primary:                  #1a6b3c;
    --theme-primary-rgb:              26, 107, 60;
    --theme-primary-hover:            #1e7d46;
    --theme-primary-muted:            rgba(26, 107, 60, .12);
    --theme-text-on-primary:          #ffffff;

    /* ── Accent (warm orange) ────────────────────────────────────── */

    --theme-accent:                   #c45500;
    --theme-accent-hover:             #d17a38;
    --theme-accent-muted:             rgba(196, 85, 0, .12);

    /* ── Offset (violet) ─────────────────────────────────────────── */

    --theme-offset:                   #5b21b6;
    --theme-offset-hover:             #6d28d9;
    --theme-offset-muted:             rgba(91, 33, 182, .10);

    /* ── Semantic ─────────────────────────────────────────────────── */

    --theme-success:                  #16a34a;
    --theme-success-muted:            rgba(22, 163, 74, .12);
    --theme-warning:                  #d97706;
    --theme-warning-muted:            rgba(217, 119, 6, .12);
    --theme-danger:                   #dc2626;
    --theme-danger-muted:             rgba(220, 38, 38, .12);
    --theme-info:                     #2563eb;
    --theme-info-rgb:                 37, 99, 235;
    --theme-info-muted:               rgba(37, 99, 235, .12);

    /* ── Text ─────────────────────────────────────────────────────── */

    --theme-text:                     #1e2a38;
    --theme-text-secondary:           #4a5668;
    /* WCAG AA 4.5:1 (2026-11-14): #7a8898 read 3.62:1 on white - every hint and placeholder failed; #565f6a is the Portal's value and
       exactly what the theme engine derives for the default text + background pair - 6.48 / 5.87 / 5.46 / 4.97 against background /
       -subtle / -hover / -active; the hierarchy still reads text < secondary < muted < placeholder. */
    --theme-text-muted:               #565f6a;
    --theme-text-emphasis:            #111827;
    --theme-text-placeholder:         #9aa5b3;

    /* ── Navigation ───────────────────────────────────────────────── */

    --theme-nav-background:           #1a6b3c;
    --theme-nav-border:               #155c33;
    --theme-nav-text:                 rgba(255, 255, 255, .75);
    --theme-nav-text-hover:           rgba(255, 255, 255, .95);
    --theme-nav-text-active:          #ffffff;
    --theme-nav-hover-background:     rgba(255, 255, 255, .10);
    --theme-nav-dropdown-background:  #155c33;
    --theme-nav-dropdown-hover:       #1a6b3c;
    --theme-nav-divider:              rgba(255, 255, 255, .12);

    /* ── Shape & shadow ───────────────────────────────────────────── */

    --theme-shadow:                   0 1px 3px rgba(0, 0, 0, .07), 0 1px 2px rgba(0, 0, 0, .04);
    --theme-radius:                   0.625rem;
    --theme-radius-button:            0.5rem;

    /* ── Focus ────────────────────────────────────────────────────── */

    --theme-focus-ring:               0 0 0 3px rgba(26, 107, 60, .18);

    /* ── Typography ───────────────────────────────────────────────── */

    --theme-font:                     'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --theme-font-mono:                'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    --theme-font-size-xs:             0.75rem;
    --theme-font-size-sm:             0.8125rem;
    --theme-font-size-base:           0.875rem;
    --theme-font-size-lg:             1rem;
    --theme-font-size-xl:             1.25rem;
    --theme-font-size-2xl:            1.5rem;
    --theme-font-size-3xl:            1.875rem;

    /* ── Spacing ──────────────────────────────────────────────────── */

    --theme-page-padding:             1.5rem 2rem;
    --theme-section-gap:              1.5rem;

    /* ── Transitions ──────────────────────────────────────────────── */

    --theme-transition:               150ms ease;

}

/* =================================================================
   Base element styles
   ================================================================= */

html {
    height: 100%;
    overflow: hidden;
}

body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--cv-surface);
    color: var(--cv-on-surface);
    font-family: var(--cv-font-body);
    font-size: var(--cv-font-size-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color-scheme: var(--cv-color-scheme);
}

#app {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* Blazor renders one intermediate wrapper div between #app and the layout.
   Make it flex so the height chain flows through to wf-main. */
#app > div:first-child {
    display: contents;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--cv-on-surface-strong);
    font-weight: 600;
}

a {
    color: var(--cv-accent);
    transition: color var(--cv-transition);
}
a:hover { color: var(--cv-accent-hover); }

/* -- Scrollbar --------------------------------------------------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--cv-surface); }
::-webkit-scrollbar-thumb { background: var(--cv-line-2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--cv-muted); }

/* =================================================================
   Utility classes
   ================================================================= */
.text-accent        { color: var(--cv-second)          !important; }
.text-offset        { color: var(--cv-third)          !important; }
.text-primary-wf    { color: var(--cv-accent)         !important; }
.text-secondary-wf  { color: var(--cv-on-surface-2)  !important; }
.bg-surface         { background-color: var(--cv-surface-subtle)  !important; }
.bg-raised          { background-color: var(--cv-surface-raised)  !important; }
.border-wf          { border-color: var(--cv-line)   !important; }

/* =================================================================
   Reusable Component Styles
   ================================================================= */

/* -- Widget / dashboard card ------------------------------------- */
.wf-widget {
    background-color: var(--cv-surface-raised);
    border: 1px solid var(--cv-line);
    border-radius: var(--cv-radius-m);
    box-shadow: var(--cv-shadow-1);
    padding: 1.25rem;
    transition: border-color var(--cv-transition), box-shadow var(--cv-transition);
}
.wf-widget:hover {
    border-color: var(--cv-line-2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .4);
}
.wf-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.wf-widget-title {
    font-size: var(--cv-font-size-sm);
    font-weight: 600;
    color: var(--cv-on-surface-2);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.wf-widget-value {
    font-size: var(--cv-font-size-3xl);
    font-weight: 700;
    color: var(--cv-on-surface-strong);
    line-height: 1;
}

/* -- Page header ------------------------------------------------- */
.wf-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--cv-section-gap);
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--cv-line);
}
.wf-page-title {
    font-size: var(--cv-font-size-2xl);
    font-weight: 700;
    color: var(--cv-on-surface-strong);
    margin: 0;
}
.wf-page-subtitle {
    font-size: var(--cv-font-size-sm);
    color: var(--cv-on-surface-2);
    margin: 0.25rem 0 0;
}

/* -- Stub page placeholder --------------------------------------- */
.wf-stub {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    text-align: center;
}
.wf-stub-icon {
    font-size: 3.5rem;
    color: var(--cv-muted);
    margin-bottom: 1rem;
}
.wf-stub-title {
    font-size: var(--cv-font-size-xl);
    font-weight: 600;
    color: var(--cv-on-surface-2);
}
.wf-stub-text {
    font-size: var(--cv-font-size-sm);
    color: var(--cv-muted);
    max-width: 28rem;
    margin-top: 0.5rem;
}

/* =================================================================
   Responsive — Page padding
   ================================================================= */

@media (max-width: 991.98px) {
    :root { --theme-page-padding: 1.25rem 1.25rem; }
}

@media (max-width: 767.98px) {
    :root { --theme-page-padding: 1rem; }
    .wf-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

/* ── Loading Spinner + Joke Quote ─────────────────────────────── */

.wf-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    gap: 2rem;
}

.wf-loading-quote {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 36rem;
    padding: 1rem 1.5rem;
    border-radius: var(--cv-radius-m);
    background: linear-gradient(135deg,
        hsla(var(--cv-accent-hue, 220), 30%, 92%, 0.6),
        hsla(var(--cv-accent-hue, 220), 20%, 96%, 0.4));
    backdrop-filter: blur(8px);
    font-style: italic;
    font-size: 0.85rem;
    color: var(--cv-on-surface);
    line-height: 1.5;
}

.wf-loading-quote-icon {
    flex-shrink: 0;
    font-size: 1.3rem;
    color: var(--cv-accent);
    font-style: normal;
}

.wf-loading-quote-text {
    flex: 1;
}

.wf-loading-spinner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 5rem;
    height: 5rem;
}

.wf-loading-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: wf-spin 1.2s linear infinite;
}

.wf-loading-ring circle {
    stroke: var(--cv-accent);
    stroke-dasharray: 80, 200;
    stroke-dashoffset: 0;
    stroke-linecap: round;
    opacity: 0.35;
}

.wf-loading-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--cv-muted);
    letter-spacing: 0.02em;
}

@keyframes wf-spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
}

/* -- design/src/runner/wf.css -- */
@layer cv.components {
/* =================================================================
   WF Portal — Component & Utility Framework
   -----------------------------------------------------------------
   Replaces Bootstrap CSS. All values reference --theme-* tokens
   from root.css. Same class names — zero .razor file changes.
   ================================================================= */

/* =================================================================
   Reset
   ================================================================= */

*, *::before, *::after { box-sizing: border-box; }

body { margin: 0; line-height: 1.5; -webkit-text-size-adjust: 100%; }

hr {
    margin: 1rem 0;
    border: 0;
    border-top: 1px solid var(--cv-line);
    opacity: .5;
}

/* =================================================================
   Buttons
   ================================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.4375rem 0.875rem;
    font-family: inherit;
    font-size: var(--cv-font-size-base);
    font-weight: 500;
    line-height: 1.5;
    color: var(--cv-on-surface);
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: var(--cv-radius-s);
    cursor: pointer;
    user-select: none;
    text-decoration: none;
    transition: all var(--cv-transition);
    vertical-align: middle;
    white-space: nowrap;
}
.btn:focus-visible { outline: 0; box-shadow: var(--cv-focus-ring); }
.btn:disabled, .btn.disabled { opacity: .55; pointer-events: none; }

.btn-primary {
    background-color: var(--cv-accent);
    border-color: var(--cv-accent);
    color: var(--cv-on-accent);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--cv-accent-hover);
    border-color: var(--cv-accent-hover);
}

.btn-secondary {
    background-color: var(--cv-surface-active);
    border-color: var(--cv-line-2);
    color: var(--cv-on-surface);
}
.btn-secondary:hover, .btn-secondary:focus {
    background-color: var(--cv-surface-hover);
    border-color: var(--cv-muted);
    color: var(--cv-on-surface-strong);
}

.btn-success {
    background-color: var(--cv-success);
    border-color: var(--cv-success);
    color: var(--cv-on-accent);
}
.btn-success:hover { opacity: .85; }

.btn-info {
    background-color: var(--cv-third);
    border-color: var(--cv-third);
    color: var(--cv-on-accent);
}
.btn-info:hover { opacity: .85; }

.btn-dark {
    background-color: var(--cv-surface-active);
    border-color: var(--cv-line-2);
    color: var(--cv-on-surface-strong);
}
.btn-dark:hover {
    background-color: var(--cv-surface-hover);
    color: var(--cv-on-surface-strong);
}

.btn-accent {
    background-color: var(--cv-second);
    border-color: var(--cv-second);
    color: var(--cv-on-accent);
}
.btn-accent:hover, .btn-accent:focus {
    background-color: var(--cv-second-hover);
    border-color: var(--cv-second-hover);
}

.btn-outline-primary {
    border-color: var(--cv-accent);
    color: var(--cv-accent);
}
.btn-outline-primary:hover, .btn-outline-primary:focus {
    background-color: var(--cv-accent-muted);
    color: var(--cv-accent);
}

.btn-outline-secondary {
    border-color: var(--cv-line-2);
    color: var(--cv-on-surface-2);
}
.btn-outline-secondary:hover, .btn-outline-secondary:focus {
    background-color: var(--cv-surface-hover);
    border-color: var(--cv-muted);
    color: var(--cv-on-surface-strong);
}

.btn-outline-success {
    border-color: var(--cv-success);
    color: var(--cv-success);
}
.btn-outline-success:hover {
    background-color: var(--cv-success-muted);
}

.btn-outline-warning {
    border-color: var(--cv-warning);
    color: var(--cv-warning);
}
.btn-outline-warning:hover {
    background-color: var(--cv-warning-muted);
}

.btn-outline-danger {
    border-color: rgba(248, 113, 113, .35);
    color: var(--cv-danger);
}
.btn-outline-danger:hover, .btn-outline-danger:focus {
    background-color: var(--cv-danger-muted);
    border-color: var(--cv-danger);
    color: var(--cv-danger);
}

.btn-outline-info {
    border-color: rgba(37, 99, 235, .4);
    color: var(--cv-info);
}
.btn-outline-info:hover, .btn-outline-info:focus {
    background-color: var(--cv-info-muted);
    border-color: var(--cv-info);
    color: var(--cv-info);
}

.btn-outline-light {
    border-color: var(--cv-line-2);
    color: var(--cv-on-surface-2);
}
.btn-outline-light:hover {
    background-color: var(--cv-surface-hover);
    border-color: var(--cv-on-surface-2);
    color: var(--cv-on-surface);
}

.btn-link {
    color: var(--cv-accent);
    text-decoration: none;
    border-color: transparent;
    background: none;
    padding: 0;
}
.btn-link:hover { color: var(--cv-accent-hover); }

.btn-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
    opacity: .6;
    /* The glyph is text (::after "x") - follow the surrounding text color so it
       stays visible on light AND dark surfaces. Filter tricks (Bootstrap's
       image-based btn-close) forced it white and vanished on light themes. */
    color: inherit;
    font-size: 1rem;
}
.btn-close::after { content: "\00d7"; font-size: 1.25rem; }
.btn-close:hover { opacity: 1; }

.btn-sm {
    padding: 0.25rem 0.625rem;
    font-size: var(--cv-font-size-sm);
}

.btn-lg {
    padding: 0.625rem 1.25rem;
    font-size: var(--cv-font-size-lg);
}

.btn-group {
    display: inline-flex;
    vertical-align: middle;
}
.btn-group > .btn { border-radius: 0; }
.btn-group > .btn:first-child { border-top-left-radius: var(--cv-radius-s); border-bottom-left-radius: var(--cv-radius-s); }
.btn-group > .btn:last-child { border-top-right-radius: var(--cv-radius-s); border-bottom-right-radius: var(--cv-radius-s); }
.btn-group > .btn + .btn { margin-left: -1px; }
.btn-group-sm > .btn { padding: 0.25rem 0.625rem; font-size: var(--cv-font-size-sm); }

/* =================================================================
   Forms
   ================================================================= */

.form-control, .form-select {
    display: block;
    width: 100%;
    padding: 0.4375rem 0.75rem;
    font-family: inherit;
    font-size: var(--cv-font-size-base);
    font-weight: 400;
    line-height: 1.5;
    color: var(--cv-on-surface-strong);
    background-color: var(--cv-surface-subtle);
    border: 1px solid var(--cv-line-2);
    border-radius: var(--cv-radius-s);
    transition: border-color var(--cv-transition), box-shadow var(--cv-transition);
    appearance: none;
}
.form-control::placeholder { color: var(--cv-placeholder); }
.form-control:focus, .form-select:focus {
    background-color: var(--cv-surface-subtle);
    border-color: var(--cv-accent);
    box-shadow: var(--cv-focus-ring);
    color: var(--cv-on-surface-strong);
    outline: 0;
}
.form-control:disabled, .form-select:disabled, .form-control[readonly] {
    background-color: var(--cv-surface-active);
    color: var(--cv-muted);
    opacity: .7;
}

.form-control-sm, .form-select-sm {
    padding: 0.25rem 0.5rem;
    font-size: var(--cv-font-size-sm);
}
.form-control-lg {
    padding: 0.625rem 1rem;
    font-size: var(--cv-font-size-lg);
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23939bb0' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.25rem;
}
.form-select option {
    background-color: var(--cv-surface-raised);
    color: var(--cv-on-surface);
}

.form-label {
    display: inline-block;
    margin-bottom: 0.375rem;
    color: var(--cv-on-surface-2);
    font-weight: 500;
    font-size: var(--cv-font-size-sm);
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: var(--cv-font-size-sm);
    color: var(--cv-muted);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 1.5rem;
}
.form-check-input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    background-color: var(--cv-surface-subtle);
    border: 1px solid var(--cv-line-2);
    border-radius: 0.25rem;
    appearance: none;
    cursor: pointer;
    flex-shrink: 0;
}
.form-check-input[type="radio"] { border-radius: 50%; }
.form-check-input:checked {
    background-color: var(--cv-accent);
    border-color: var(--cv-accent);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%230f1117' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}
.form-check-input:focus { box-shadow: var(--cv-focus-ring); outline: 0; }
.form-check-label { cursor: pointer; color: var(--cv-on-surface); }
.form-check-inline { display: inline-flex; margin-right: 1rem; }

.input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
}
.input-group > .form-control, .input-group > .form-select {
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}
.input-group > .form-control:not(:first-child), .input-group > .form-select:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
.input-group > .form-control:not(:last-child), .input-group > .form-select:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.input-group > .btn:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: -1px;
}
.input-group > .btn:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.form-floating {
    position: relative;
}
.form-floating > .form-control,
.form-floating > .form-control-plaintext {
    height: calc(3.5rem + 2px);
    padding: 1.625rem 0.75rem 0.625rem;
}
.form-floating > label {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 1rem 0.75rem;
    pointer-events: none;
    transform-origin: 0 0;
    transition: opacity .1s ease-in-out, transform .1s ease-in-out;
    color: var(--cv-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-control-plaintext ~ label {
    transform: scale(.85) translateY(-0.5rem) translateX(0.15rem);
    color: var(--cv-on-surface-2);
}
.form-control-plaintext {
    display: block;
    width: 100%;
    padding: 0.4375rem 0;
    color: var(--cv-on-surface);
    background-color: transparent;
    border: solid transparent;
    border-width: 1px 0;
}

.font-monospace { font-family: var(--cv-font-mono) !important; }

/* =================================================================
   Cards
   ================================================================= */

.card {
    display: flex;
    flex-direction: column;
    background-color: var(--cv-surface-raised);
    border: 1px solid var(--cv-line);
    border-radius: var(--cv-radius-m);
    box-shadow: var(--cv-shadow-1);
    overflow: hidden;
}
.card-header, .card-footer {
    padding: 0.75rem 1rem;
    background-color: var(--cv-surface-subtle);
    border-color: var(--cv-line);
    color: var(--cv-on-surface-strong);
}
.card-header { border-bottom: 1px solid var(--cv-line); }
.card-footer { border-top: 1px solid var(--cv-line); }
.card-body {
    flex: 1 1 auto;
    padding: 1rem;
    color: var(--cv-on-surface);
}
.card-title {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--cv-on-surface-strong);
}

/* =================================================================
   Tables
   ================================================================= */

.table {
    width: 100%;
    margin-bottom: 1rem;
    color: var(--cv-on-surface);
    border-collapse: collapse;
}
.table > thead { border-bottom: 2px solid var(--cv-line-2); }
.table thead th {
    background-color: var(--cv-surface-subtle);
    color: var(--cv-on-surface-2);
    font-weight: 600;
    font-size: var(--cv-font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.625rem 0.75rem;
    border-bottom-color: var(--cv-line-2);
    text-align: start;
}
.table > tbody > tr { border-bottom: 1px solid var(--cv-line); transition: background-color 120ms ease; }
.table > tbody > tr > td {
    padding: 0.75rem;
    vertical-align: middle;
    color: var(--cv-on-surface);
}
.table > tbody > tr > td.fw-semibold,
.table > tbody > tr > td.fw-medium { color: var(--cv-on-surface-strong); }
.table > tbody > tr > td.font-monospace {
    color: var(--cv-accent) !important;
    opacity: 0.8;
}

.table-sm > tbody > tr > td,
.table-sm > thead > tr > th { padding: 0.375rem 0.5rem; }

.table-hover > tbody > tr:hover {
    background-color: var(--cv-surface-hover) !important;
    color: var(--cv-on-surface-strong) !important;
}
.table-hover > tbody > tr:hover > td { color: var(--cv-on-surface-strong); }
.table-hover > tbody > tr:hover > td.text-muted { color: var(--cv-on-surface-2) !important; }

.table-striped > tbody > tr:nth-of-type(odd) { background-color: var(--cv-surface-subtle); }

.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table-light, thead.table-light, thead.table-light th {
    background-color: var(--cv-surface-subtle) !important;
    color: var(--cv-on-surface-2) !important;
    border-color: var(--cv-line) !important;
}

.table-active { background-color: var(--cv-surface-active) !important; }
.table-warning { background-color: var(--cv-warning-muted) !important; }

.align-middle { vertical-align: middle !important; }

/* =================================================================
   Modals
   ================================================================= */

.modal {
    position: fixed;
    inset: 0;
    z-index: 1055;
    display: none;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
}
.modal.show, .modal.d-block { display: block; }

.modal-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
    max-width: 500px;
    pointer-events: none;
}
.modal-dialog-sm { max-width: 300px; }
.modal-dialog-lg { max-width: 960px; }
.modal-dialog.modal-xl { max-width: 95%; }
.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 3.5rem);
}
.modal-dialog-scrollable {
    display: flex;
    max-height: calc(100% - 3.5rem);
}
.modal-dialog-scrollable .modal-content {
    max-height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.modal-dialog-scrollable .modal-body {
    overflow-y: auto;
    flex: 1;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: var(--cv-surface-raised);
    border: 1px solid var(--cv-line-2);
    border-radius: var(--cv-radius-m);
    box-shadow: 0 4px 24px rgba(0, 0, 0, .5);
    outline: 0;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--cv-nav-line);
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--cv-nav-bg);
    color: var(--cv-nav-ink);
    border-radius: var(--cv-radius-m) var(--cv-radius-m) 0 0;
}
.modal-header .btn {
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--cv-nav-ink);
    background: transparent;
}
.modal-header .btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.6);
}
.modal-header .btn-save {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
}
.modal-header .btn-save:hover {
    background: rgba(255, 255, 255, 0.3);
}
.modal-title {
    margin: 0;
    line-height: 1.5;
    font-weight: 600;
    color: inherit;
}

.modal-body { flex: 1 1 auto; padding: 1rem; }

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--cv-line);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background-color: rgba(0, 0, 0, .65);
}
.modal-backdrop.show { opacity: 1; }
.modal-backdrop.fade { opacity: 0; transition: opacity .15s linear; }

.fade { transition: opacity .15s linear; }
.show { opacity: 1; }

/* =================================================================
   Alerts
   ================================================================= */

.alert {
    position: relative;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: var(--cv-radius-s);
    font-size: var(--cv-font-size-sm);
}
.alert-danger {
    background-color: var(--cv-danger-muted);
    border-color: rgba(248, 113, 113, .3);
    color: var(--cv-danger);
}
.alert-success {
    background-color: var(--cv-success-muted);
    border-color: rgba(52, 211, 153, .3);
    color: var(--cv-success);
}
.alert-warning {
    background-color: var(--cv-warning-muted);
    border-color: rgba(251, 191, 36, .3);
    color: var(--cv-warning);
}
.alert-info {
    background-color: var(--cv-info-muted);
    border-color: rgba(96, 165, 250, .3);
    color: var(--cv-info);
}
.alert-dismissible { padding-right: 3rem; }
.alert-dismissible .btn-close {
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.75rem 1rem;
}

/* =================================================================
   Badges
   ================================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3em 0.55em;
    font-size: var(--cv-font-size-xs);
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1;
    color: #fff;
    white-space: nowrap;
    border-radius: var(--cv-radius-s);
    vertical-align: baseline;
}

.bg-primary   { background-color: var(--cv-accent) !important; }
.bg-secondary { background-color: var(--cv-surface-active) !important; color: var(--cv-on-surface) !important; }
.bg-success   { background-color: var(--cv-success) !important; }
.bg-danger    { background-color: var(--cv-danger) !important; }
.bg-warning   { background-color: var(--cv-warning) !important; color: var(--cv-on-accent) !important; }
.bg-info      { background-color: var(--cv-info) !important; }
.bg-dark      { background-color: var(--cv-surface-active) !important; }
.bg-light     { background-color: var(--cv-surface-subtle) !important; color: var(--cv-on-surface) !important; }

.text-bg-primary   { background-color: var(--cv-accent) !important; color: var(--cv-on-accent) !important; }
.text-bg-secondary { background-color: var(--cv-surface-active) !important; color: var(--cv-on-surface) !important; }
.text-bg-success   { background-color: var(--cv-success) !important; color: var(--cv-on-accent) !important; }
.text-bg-danger    { background-color: var(--cv-danger) !important; color: var(--cv-on-accent) !important; }
.text-bg-warning   { background-color: var(--cv-warning) !important; color: var(--cv-on-accent) !important; }
.text-bg-info      { background-color: var(--cv-info) !important; color: var(--cv-on-accent) !important; }

.badge-accent  { background-color: var(--cv-second-muted);  color: var(--cv-second); }
.badge-primary { background-color: var(--cv-accent-muted); color: var(--cv-accent); }
.badge-offset  { background-color: var(--cv-third-muted);  color: var(--cv-third); }

/* =================================================================
   List Groups
   ================================================================= */

.list-group {
    display: flex;
    flex-direction: column;
    padding-left: 0;
    margin-bottom: 0;
}
.list-group-item {
    position: relative;
    display: block;
    padding: 0.625rem 1rem;
    background-color: var(--cv-surface-subtle);
    border: 1px solid var(--cv-line);
    color: var(--cv-on-surface);
}
.list-group-item:first-child { border-top-left-radius: var(--cv-radius-m); border-top-right-radius: var(--cv-radius-m); }
.list-group-item:last-child { border-bottom-left-radius: var(--cv-radius-m); border-bottom-right-radius: var(--cv-radius-m); }
.list-group-item + .list-group-item { border-top-width: 0; }
.list-group-item-action {
    cursor: pointer;
    transition: background-color var(--cv-transition), color var(--cv-transition);
}
.list-group-item-action:hover {
    background-color: var(--cv-surface-hover);
    color: var(--cv-on-surface-strong);
}
.list-group-item-light { background-color: var(--cv-surface-subtle); }
.list-group-item.active {
    background-color: var(--cv-accent-muted);
    border-color: var(--cv-accent);
    color: var(--cv-accent);
}

/* =================================================================
   Spinners
   ================================================================= */

.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: -0.125em;
    border: 0.25em solid var(--cv-accent);
    border-right-color: transparent;
    border-radius: 50%;
    animation: wf-spin .75s linear infinite;
}
.spinner-border-sm { width: 1rem; height: 1rem; border-width: 0.2em; }

@keyframes wf-spin { to { transform: rotate(360deg); } }

/* =================================================================
   Flexbox & Display Utilities
   ================================================================= */

.d-flex          { display: flex !important; }
.d-inline-flex   { display: inline-flex !important; }
.d-block         { display: block !important; }
.d-inline        { display: inline !important; }
.d-none          { display: none !important; }
.d-grid          { display: grid !important; }

.flex-grow-1     { flex-grow: 1 !important; }
.flex-shrink-0   { flex-shrink: 0 !important; }
.flex-column     { flex-direction: column !important; }
.flex-wrap       { flex-wrap: wrap !important; }

.justify-content-start   { justify-content: flex-start !important; }
.justify-content-center  { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-end     { justify-content: flex-end !important; }

.align-items-start   { align-items: flex-start !important; }
.align-items-center  { align-items: center !important; }
.align-items-end     { align-items: flex-end !important; }
.align-content-stretch { align-content: stretch !important; }

/* =================================================================
   Spacing Utilities
   ================================================================= */

/* Margin */
.m-0  { margin: 0 !important; }
.m-1  { margin: 0.25rem !important; }
.m-2  { margin: 0.5rem !important; }
.m-3  { margin: 1rem !important; }
.m-4  { margin: 1.5rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }

.ms-auto { margin-inline-start: auto !important; }
.ms-1 { margin-inline-start: 0.25rem !important; }
.ms-2 { margin-inline-start: 0.5rem !important; }
.ms-3 { margin-inline-start: 1rem !important; }

.me-1 { margin-inline-end: 0.25rem !important; }
.me-2 { margin-inline-end: 0.5rem !important; }
.me-3 { margin-inline-end: 1rem !important; }

.mx-auto { margin-inline: auto !important; }
.my-0 { margin-block: 0 !important; }
.my-1 { margin-block: 0.25rem !important; }
.my-2 { margin-block: 0.5rem !important; }
.my-3 { margin-block: 1rem !important; }

/* Padding */
.p-0  { padding: 0 !important; }
.p-1  { padding: 0.25rem !important; }
.p-2  { padding: 0.5rem !important; }
.p-3  { padding: 1rem !important; }
.p-4  { padding: 1.5rem !important; }
.p-5  { padding: 3rem !important; }

.pt-1 { padding-top: 0.25rem !important; }
.pt-2 { padding-top: 0.5rem !important; }
.pt-3 { padding-top: 1rem !important; }

.pb-1 { padding-bottom: 0.25rem !important; }
.pb-2 { padding-bottom: 0.5rem !important; }
.pb-3 { padding-bottom: 1rem !important; }
.pb-4 { padding-bottom: 1.5rem !important; }

.ps-1 { padding-inline-start: 0.25rem !important; }
.ps-2 { padding-inline-start: 0.5rem !important; }
.ps-3 { padding-inline-start: 1rem !important; }

.pe-1 { padding-inline-end: 0.25rem !important; }
.pe-2 { padding-inline-end: 0.5rem !important; }
.pe-3 { padding-inline-end: 1rem !important; }

.px-2 { padding-inline: 0.5rem !important; }
.px-3 { padding-inline: 1rem !important; }

.py-1 { padding-block: 0.25rem !important; }
.py-2 { padding-block: 0.5rem !important; }
.py-3 { padding-block: 1rem !important; }
.py-5 { padding-block: 3rem !important; }

/* Gap */
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }

/* =================================================================
   Text Utilities
   ================================================================= */

.text-center          { text-align: center !important; }
.text-end             { text-align: end !important; }
.text-start           { text-align: start !important; }

.text-muted           { color: var(--cv-muted) !important; }
.text-danger          { color: var(--cv-danger) !important; }
.text-success         { color: var(--cv-success) !important; }
.text-warning         { color: var(--cv-warning) !important; }
.text-primary         { color: var(--cv-accent) !important; }
.text-secondary       { color: var(--cv-on-surface-2) !important; }
.text-dark            { color: var(--cv-on-surface-strong) !important; }

.text-nowrap          { white-space: nowrap !important; }
.text-truncate        { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-decoration-none { text-decoration: none !important; }

.fw-bold              { font-weight: 700 !important; }
.fw-semibold          { font-weight: 600 !important; }
.fw-medium            { font-weight: 500 !important; }
.fst-italic           { font-style: italic !important; }

.fs-1                 { font-size: 2.5rem !important; }
.fs-5                 { font-size: var(--cv-font-size-lg) !important; }

.small                { font-size: var(--cv-font-size-sm); }

/* =================================================================
   Grid System
   ================================================================= */

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.5rem;
    margin-left: -0.5rem;
}
.row > * {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding-right: 0.5rem;
    padding-left: 0.5rem;
}

/* Gap variants (g-*) override the padding/margin approach */
.g-3 { --wf-gutter: 1rem; gap: var(--wf-gutter); margin: 0; }
.g-3 > * { padding: 0; }
.g-4 { --wf-gutter: 1.5rem; gap: var(--wf-gutter); margin: 0; }
.g-4 > * { padding: 0; }

/* Small breakpoint (≥576px) */
@media (min-width: 576px) {
    .col-sm-6 { flex: 0 0 auto; width: calc(50% - var(--wf-gutter, 1rem) / 2); }
}

/* Medium breakpoint (≥768px) */
@media (min-width: 768px) {
    .col-md-4  { flex: 0 0 auto; width: calc(33.3333% - var(--wf-gutter, 1rem) * 2 / 3); }
    .col-md-6  { flex: 0 0 auto; width: calc(50% - var(--wf-gutter, 1rem) / 2); }
    .col-md-8  { flex: 0 0 auto; width: calc(66.6667% - var(--wf-gutter, 1rem) / 3); }
    .col-md-12 { flex: 0 0 auto; width: 100%; }
}

/* Large breakpoint (≥992px) */
@media (min-width: 992px) {
    .col-lg-4  { flex: 0 0 auto; width: calc(33.3333% - var(--wf-gutter, 1.5rem) * 2 / 3); }
    .col-lg-5  { flex: 0 0 auto; width: calc(41.6667% - var(--wf-gutter, 1.5rem) * 7 / 12); }
    .col-lg-6  { flex: 0 0 auto; width: calc(50% - var(--wf-gutter, 1.5rem) / 2); }
    .col-lg-7  { flex: 0 0 auto; width: calc(58.3333% - var(--wf-gutter, 1.5rem) * 5 / 12); }
    .col-lg-8  { flex: 0 0 auto; width: calc(66.6667% - var(--wf-gutter, 1.5rem) / 3); }
}

/* =================================================================
   Sizing
   ================================================================= */

.w-100  { width: 100% !important; }
.vh-100 { height: 100vh !important; }

/* =================================================================
   Display & Visibility
   ================================================================= */

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media print { .no-print { display: none !important; } }

/* =================================================================
   Borders
   ================================================================= */

.border        { border: 1px solid var(--cv-line) !important; }
.border-top    { border-top: 1px solid var(--cv-line) !important; }
.border-bottom { border-bottom: 1px solid var(--cv-line) !important; }
.border-start  { border-inline-start: 1px solid var(--cv-line) !important; }
.border-end    { border-inline-end: 1px solid var(--cv-line) !important; }

.rounded       { border-radius: var(--cv-radius-m) !important; }
.rounded-pill  { border-radius: 50rem !important; }

/* =================================================================
   Position & Overflow
   ================================================================= */

.position-fixed    { position: fixed !important; }
.position-absolute { position: absolute !important; }
.position-relative { position: relative !important; }

.overflow-auto   { overflow: auto !important; }
.overflow-hidden { overflow: hidden !important; }

/* =================================================================
   Misc
   ================================================================= */

.user-select-none { user-select: none !important; }
}

/* -- design/src/runner/login.css -- */
@layer cv.components {
/* =================================================================
   WF Portal — Login Page
   -----------------------------------------------------------------
   Standalone styles for the login/auth flow. Renders outside
   MainLayout (no TopNav, no wf-main). Uses --theme-* tokens
   from root.css.
   ================================================================= */

/* ── Body override when login page is rendered ──────────────────── */

body:has(.login-wrapper) {
    background-color: var(--cv-signin-bg) !important;
    background-image: var(--cv-signin-picture) !important;
}

/* ── Full-viewport wrapper ──────────────────────────────────────── */

.login-wrapper {
    flex: 1;
    min-height: 100vh;
    overflow-y: auto;
    padding: 6vh 1rem 2rem;
    text-align: center;
}

/* ── Logo block above card ──────────────────────────────────────── */

.login-brand {
    position: relative;
    z-index: 1;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.login-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, var(--cv-accent), var(--cv-third));
    color: #fff;
    font-size: 2rem;
    box-shadow: 0 8px 32px rgba(91, 33, 182, .3);
    margin-bottom: 0.75rem;
}

.login-brand-name {
    font-size: var(--cv-font-size-xl);
    font-weight: 700;
    color: rgba(255, 255, 255, .9);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ── Card ───────────────────────────────────────────────────────── */

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    text-align: left;
    background: rgba(255, 255, 255, .08);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: calc(var(--cv-radius-m) + 0.25rem);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, .4),
        inset 0 0 0 1px rgba(255, 255, 255, .06);
    overflow: hidden;
}

/* ── Card header ────────────────────────────────────────────────── */

.login-header {
    text-align: center;
    padding: 2rem 2rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.login-title {
    color: rgba(255, 255, 255, .95);
    font-weight: 700;
    font-size: var(--cv-font-size-2xl);
    margin-bottom: 0.25rem;
}

.login-subtitle {
    color: rgba(255, 255, 255, .5);
    font-size: var(--cv-font-size-sm);
    margin: 0;
}

/* ── Card body ──────────────────────────────────────────────────── */

.login-body {
    padding: 1.75rem 2rem 2rem;
}

.login-step-heading {
    color: rgba(255, 255, 255, .6);
    font-weight: 500;
    font-size: var(--cv-font-size-sm);
    margin-bottom: 1.25rem;
}

/* ── Form fields — must win over wf.css .form-control ───────────── */

.login-body .form-label {
    color: rgba(255, 255, 255, .7);
    font-size: var(--cv-font-size-sm);
    font-weight: 500;
}

.login-body .form-control,
.login-body .form-select {
    background-color: rgba(255, 255, 255, .08) !important;
    border: 1px solid rgba(255, 255, 255, .15) !important;
    color: rgba(255, 255, 255, .95) !important;
    padding: 0.65rem 0.875rem;
    font-size: var(--cv-font-size-base);
    border-radius: var(--cv-radius-s);
}

.login-body .form-control::placeholder {
    color: rgba(255, 255, 255, .3) !important;
}

.login-body .form-control:focus,
.login-body .form-select:focus {
    background-color: rgba(255, 255, 255, .12) !important;
    border-color: var(--cv-accent) !important;
    box-shadow: 0 0 0 3px rgba(var(--cv-accent-rgb), .3) !important;
    color: rgba(255, 255, 255, .95) !important;
    outline: none;
}

/* ── Primary button ─────────────────────────────────────────────── */

.login-btn {
    padding: 0.7rem 1rem;
    font-weight: 600;
    font-size: var(--cv-font-size-base);
    background: linear-gradient(135deg, var(--cv-accent), var(--cv-accent-hover)) !important;
    border: none !important;
    border-radius: var(--cv-radius-s);
    color: var(--cv-on-accent) !important;
    box-shadow: 0 4px 14px rgba(var(--cv-accent-rgb), .4);
    transition: transform 100ms ease, box-shadow 150ms ease;
}

.login-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(var(--cv-accent-rgb), .5);
}

.login-btn:active:not(:disabled) {
    transform: translateY(0);
}

/* ── Back link ──────────────────────────────────────────────────── */

.login-back-link {
    color: rgba(255, 255, 255, .5) !important;
    text-decoration: none !important;
    font-size: var(--cv-font-size-sm);
}

.login-back-link:hover {
    color: rgba(255, 255, 255, .8) !important;
}

/* ── List group (2FA contacts, tenant selection) ────────────────── */

.login-body .list-group-item {
    background: rgba(255, 255, 255, .06) !important;
    border: 1px solid rgba(255, 255, 255, .10) !important;
    color: rgba(255, 255, 255, .8) !important;
}

.login-body .list-group-item:hover:not(:disabled) {
    background: rgba(255, 255, 255, .10) !important;
    border-color: rgba(255, 255, 255, .18) !important;
    color: rgba(255, 255, 255, .95) !important;
}

.login-body .list-group-item.active {
    background: rgba(var(--cv-accent-rgb), .2) !important;
    border-color: var(--cv-accent) !important;
    color: rgba(255, 255, 255, .95) !important;
}

/* ── Alert ──────────────────────────────────────────────────────── */

.login-body .alert-danger {
    background: rgba(220, 38, 38, .15) !important;
    border-color: rgba(220, 38, 38, .25) !important;
    color: #fca5a5 !important;
}

/* ── Helper text ────────────────────────────────────────────────── */

.login-body .text-secondary-wf {
    color: rgba(255, 255, 255, .5) !important;
}

/* ── Code entry monospace ───────────────────────────────────────── */

.login-body .font-monospace {
    font-family: var(--cv-font-mono);
}

/* ── Card footer ────────────────────────────────────────────────── */

.login-footer {
    text-align: center;
    padding: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .35);
    font-size: var(--cv-font-size-xs);
}

/* ── Spinner override for dark bg ───────────────────────────────── */

.login-body .spinner-border {
    border-color: rgba(255, 255, 255, .3);
    border-right-color: transparent;
}

/* ── Validation messages ────────────────────────────────────────── */

.login-body .validation-message {
    color: #fca5a5;
    font-size: var(--cv-font-size-xs);
    margin-top: 0.25rem;
}

/* ── Check badge (selected contact/tenant) ──────────────────────── */

.login-check-badge {
    background-color: var(--cv-accent) !important;
    color: var(--cv-on-accent);
}

/* ── Contact value (OTP destination picker) ─────────────────────── */

/* A masked contact value is chrome, and chrome must never set the card's
   width. min-width:0 lets the flex item shrink below its content (flex
   items default to min-width:auto, which is what let a long unbroken mask
   run push the row past the card edge); the ellipsis absorbs whatever is
   left over. Belt-and-braces behind the server-side mask cap. */
.login-contact-value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Badge (locked tenant) ──────────────────────────────────────── */

.login-body .badge.bg-danger {
    background: rgba(220, 38, 38, .25) !important;
    color: #fca5a5;
}

/* ── Mobile ─────────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .login-wrapper {
        padding: 3vh 0.75rem 1.5rem;
    }
    .login-card {
        max-width: 100%;
    }
    .login-body {
        padding: 1.25rem 1.25rem 1.5rem;
    }
    .login-header {
        padding: 1.5rem 1.25rem 1rem;
    }
    .login-brand-icon {
        width: 3rem;
        height: 3rem;
        font-size: 1.5rem;
    }
    .login-brand-name {
        font-size: var(--cv-font-size-lg);
    }
}
}

/* -- design/src/runner/app.css -- */
@layer cv.components {
/* ── Blazor infrastructure ──────────────────────────────────────── */

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--cv-accent);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* ── Shell layout ───────────────────────────────────────────────── */

html, body {
    height: 100%;
    margin: 0;
    background-color: var(--cv-surface-subtle);
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.runner-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Top header bar ─────────────────────────────────────────────── */

.runner-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    height: 3.25rem;
    background: var(--cv-header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--cv-line);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.runner-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: var(--cv-font-size-lg);
    color: var(--cv-accent);
    letter-spacing: -0.01em;
}

.runner-brand i {
    font-size: 1.35rem;
}

.runner-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.runner-user-name {
    font-size: var(--cv-font-size-sm);
    color: var(--cv-on-surface-2);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Main content area ──────────────────────────────────────────── */

.runner-main {
    flex: 1;
    padding: 1.25rem 1rem 2rem;
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
}

/* ── Loading states ─────────────────────────────────────────────── */

.wf-loading-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid var(--cv-line);
    border-top-color: var(--cv-accent);
    border-radius: 50%;
    animation: wf-spin 0.7s linear infinite;
}

.wf-loading-spinner-sm {
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid var(--cv-line);
    border-top-color: var(--cv-accent);
    border-radius: 50%;
    animation: wf-spin 0.7s linear infinite;
    flex-shrink: 0;
}

.wf-loading-inline {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 2rem 0;
    color: var(--cv-on-surface-2);
    font-size: var(--cv-font-size-sm);
}

@keyframes wf-spin {
    to { transform: rotate(360deg); }
}

/* ── Empty state ────────────────────────────────────────────────── */

.wf-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    text-align: center;
    color: var(--cv-on-surface-2);
}

.wf-empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.wf-empty-state p {
    margin: 0;
    font-size: var(--cv-font-size-sm);
    max-width: 260px;
}

/* ── Instance list ──────────────────────────────────────────────── */

.wf-instance-section-label {
    font-size: var(--cv-font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--cv-on-surface-2);
    margin-bottom: 0.5rem;
}

.wf-instance-cards {
    background: var(--cv-surface);
    border-radius: var(--cv-radius-m);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.wf-instance-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    cursor: pointer;
    transition: background 120ms ease;
    position: relative;
}

.wf-instance-card:not(:first-child)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 3.5rem;
    right: 0;
    height: 1px;
    background: var(--cv-line);
    opacity: 0.6;
}

.wf-instance-card:hover {
    background: var(--cv-surface-hover);
}

.wf-instance-card:active {
    background: var(--cv-surface-active);
}

.wf-instance-card-icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--cv-accent-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cv-accent);
    font-size: 1.1rem;
}

.wf-instance-card-content {
    flex: 1;
    min-width: 0;
}

.wf-instance-card-label {
    font-size: var(--cv-font-size-base);
    font-weight: 500;
    color: var(--cv-on-surface);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wf-instance-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.2rem;
}

.wf-instance-card-chevron {
    flex-shrink: 0;
    color: var(--cv-on-surface-2);
    opacity: 0.5;
    font-size: 0.8rem;
}

/* ── Status badges ──────────────────────────────────────────────── */

.wf-instance-status {
    font-size: var(--cv-font-size-xs);
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.wf-instance-status-new    { background: var(--cv-accent-muted); color: var(--cv-accent); }
.wf-instance-status-active { background: rgba(37,99,235,.1);  color: #2563eb; }
.wf-instance-status-done   { background: rgba(22,163,74,.1);  color: #16a34a; }
.wf-instance-status-abandoned { background: rgba(107,114,128,.1); color: #6b7280; }

.wf-instance-date {
    font-size: var(--cv-font-size-xs);
    color: var(--cv-on-surface-2);
}

/* ── Mobile ─────────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .runner-main {
        padding: 1rem 0.75rem 2rem;
    }

    .runner-user-name {
        display: none;
    }
}

/* ── Run page layout ────────────────────────────────────────────── */

.wf-run-page {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 3.25rem);
    padding: 0;
    /* The tenant theme's canvas - a themed tenant (Background token) paints the
       whole run surface, not just the chrome (Venus 2026-08-25). */
    background: var(--cv-surface, #fff);
}

.wf-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 1.5rem 3rem;
}

.wf-welcome-name {
    margin: 0 0 0.75rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--cv-on-surface-strong);
    line-height: 1.2;
}

.wf-welcome-description {
    margin: 0;
    font-size: var(--cv-font-size-base);
    color: var(--cv-on-surface-2);
    max-width: 480px;
    line-height: 1.6;
}

.wf-welcome-start {
    margin-top: 2rem;
}

.wf-debug-path {
    margin-top: 0.375rem;
    font-size: 0.7rem;
    font-family: monospace;
    color: var(--cv-danger);
    word-break: break-all;
}

.wf-run-body {
    flex: 1;
    padding: 1rem;
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
}

.wf-run-footer {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--cv-buttons-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid var(--cv-line);
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.wf-run-error {
    padding: 1.5rem 1rem;
    color: var(--cv-danger);
    font-size: var(--cv-font-size-sm);
}


/* ── Instance list inline empty / error states ──────────────────── */

.wf-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
}

.wf-empty-state-inline {
    padding: 2rem 0;
    text-align: center;
    color: var(--cv-muted);
    font-size: var(--cv-font-size-sm);
}

.wf-error-banner,
.wf-error-inline {
    padding: 0.75rem 1rem;
    background: var(--cv-danger-muted);
    border-radius: var(--cv-radius-s);
    color: var(--cv-danger);
    font-size: var(--cv-font-size-sm);
    margin-bottom: 0.75rem;
}

.wf-instance-start {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem 1rem;
    text-align: center;
}

.wf-instance-start-label {
    font-size: var(--cv-font-size-sm);
    color: var(--cv-on-surface-2);
}

/* ── Mobile adjustments ─────────────────────────────────────────── */

@media (max-width: 480px) {
    .wf-run-footer {
        padding: 0.625rem 0.75rem;
    }
}

/* ── The run page: the shared run host fills the viewport ──────────────────────────────────────────────────────────
   The run page renders the RCL's ConversationRunHost (its chrome is _content/UI.Runner.Components/run-host.css). The
   host takes the WHOLE area under the header - the phone frame on a desktop, full-bleed on a phone or in a host's
   frame - and only the moment body scrolls, so the footer is always on screen. A browser without :has() keeps the
   padded column: still a working run. */

.runner-shell:has(.run-host) {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
}

.runner-main:has(.run-host) {
    display: flex;
    flex-direction: column;
    max-width: none;
    padding: 0;
    min-height: 0;
    overflow: hidden;
}

.runner-shell--embedded .runner-main {
    max-width: none;
    padding: 0;
}

.wf-run-workflow-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 1rem;
    background: var(--cv-accent);
    color: var(--cv-on-accent);
}

.wf-run-workflow-name {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ONE BAR IN A SHEET (the signature rework, 2026-11-14 - Kirk's comp): in an RCS web view sheet the runner's own header stays
   away, and this bar says the business small above the conversation's name. */
.wf-run-workflow-name--with-brand {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.wf-run-brand-small {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.3;
    opacity: 0.85;
}

/* THE WORKSPACE'S CONTACT DETAILS (2026-10-30): the phone and More in the title bar, and the menu More opens under it - as
   on the RCS emulator and the AI Concierge. Neither button is drawn for a workspace with no details. */
.wf-run-workflow-header { position: relative; }

.wf-run-contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin: -0.25rem 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
}

.wf-run-contact-btn:hover,
.wf-run-contact-btn[aria-expanded="true"] { background: color-mix(in srgb, currentColor 16%, transparent); }

/* "NOT YOU?" (the people directory, lane L8): the page a thread link opened greets its person in the title bar - "Hi Dana" - with
   the chip right beside it (person / not-you; not-you is protected - a design dresses it, never hides it). */
.wf-run-person {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    flex: 0 1 auto;
    min-width: 0;
    font-size: 0.8125rem;
    white-space: nowrap;
}

.wf-run-person-hi { overflow: hidden; text-overflow: ellipsis; }

.wf-run-not-you {
    padding: 0.125rem 0.625rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.wf-run-not-you:hover { background: color-mix(in srgb, currentColor 16%, transparent); }

.wf-run-not-you:disabled { opacity: 0.6; cursor: default; }

.wf-run-contact-scrim { position: fixed; inset: 0; z-index: 40; }

.wf-run-contact-menu {
    position: absolute;
    top: calc(100% + 0.25rem);
    right: 0.5rem;
    z-index: 41;
    min-width: 14rem;
    max-width: calc(100vw - 1rem);
    padding: 0.375rem 0;
    border: 1px solid var(--cv-line);
    border-radius: var(--cv-radius-m);
    background: var(--cv-surface);
    color: var(--cv-on-surface);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.16);
}

.wf-run-contact-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding: 0.5rem 1rem;
    color: inherit;
    text-decoration: none;
}

.wf-run-contact-item:hover,
.wf-run-contact-item:focus-visible { background: var(--cv-surface-hover); }

.wf-run-contact-title { font-size: var(--cv-font-size-sm); font-weight: 600; color: var(--cv-on-surface-strong); }

.wf-run-contact-detail { font-size: var(--cv-font-size-xs); color: var(--cv-on-surface-2); }

.wf-run-contact-go { font-size: var(--cv-font-size-xs); font-weight: 600; color: var(--cv-accent); }

/* ── The launch page ────────────────────────────────────────────── */

.wf-launch-error {
    max-width: 480px;
    margin: 3rem auto;
    padding: 0 1rem;
    text-align: center;
}

.wf-launch-error h2 {
    font-size: var(--cv-font-size-xl);
    margin: 0 0 0.75rem;
    color: var(--cv-on-surface-strong);
}

.wf-launch-error p {
    margin: 0 0 0.5rem;
    color: var(--cv-on-surface-2);
}

/* ── The signed-in page: your work, your conversations, start one (runner contract item 12) ──────────────────────
   One column at every width (a phone at 390px first); every colour a --theme-* token; 44px tap targets. */

.wf-work,
.wf-conversations,
.wf-start {
    margin: 0 0 1.75rem;
}

.wf-work > h2,
.wf-conversations > h2,
.wf-start > h2 {
    margin: 0 0 0.5rem;
}

.wf-work-job {
    margin: 0 0 0.875rem;
    padding: 0.75rem 0.875rem;
    background: var(--cv-surface);
    border: 1px solid var(--cv-line);
    border-radius: var(--cv-radius-m);
}

.wf-work-job-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.25rem 0.75rem;
}

.wf-work-job-title {
    min-width: 0;
    font-size: var(--cv-font-size-base);
    font-weight: 600;
    color: var(--cv-on-surface-strong);
    overflow-wrap: anywhere;
}

.wf-work-job-progress {
    font-size: var(--cv-font-size-xs);
    color: var(--cv-on-surface-2);
    white-space: nowrap;
}

.wf-work-job-sub {
    margin-top: 0.15rem;
    font-size: var(--cv-font-size-sm);
    color: var(--cv-on-surface-2);
    overflow-wrap: anywhere;
}

.wf-work-stages {
    list-style: none;
    margin: 0.625rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wf-work-stage-button {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.6rem;
    width: 100%;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--cv-line);
    border-radius: var(--cv-radius-s);
    background: var(--cv-surface-subtle);
    color: var(--cv-on-surface);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.wf-work-stage-button:hover:not(:disabled) {
    background: var(--cv-surface-hover);
}

.wf-work-stage-button:disabled {
    cursor: default;
    opacity: 0.75;
}

.wf-work-stage-name {
    flex: 1 1 9rem;
    min-width: 0;
    font-size: var(--cv-font-size-base);
    overflow-wrap: anywhere;
}

.wf-work-chip {
    font-size: var(--cv-font-size-xs);
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    white-space: nowrap;
}

.wf-work-chip-ready {
    background: var(--cv-accent-muted);
    color: var(--cv-accent);
}

.wf-work-chip-active {
    background: var(--cv-success-muted);
    color: var(--cv-success);
}

.wf-work-chip-waiting {
    background: var(--cv-surface-active);
    color: var(--cv-on-surface-2);
}

.wf-work-stage-cta {
    font-size: var(--cv-font-size-sm);
    font-weight: 600;
    color: var(--cv-accent);
    white-space: nowrap;
}

.wf-work-detail {
    margin: 0.25rem 0 0.5rem;
    opacity: 0.85;
}

.wf-error-banner p {
    margin: 0 0 0.25rem;
}

.wf-error-banner button {
    min-height: 36px;
    padding: 0.25rem 0.875rem;
    border: 1px solid currentColor;
    border-radius: var(--cv-radius-s);
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
}

/* -- ../../UI.Runner.Components/wwwroot/runner.css (every --theme-* read mapped to its design token by design/src/runner/theme-map.json) -- */
@layer cv.components {
/* =================================================================
 * UI.Runner.Components — shared Runner component styles
 *
 * Served at /_content/UI.Runner.Components/runner.css
 * Both UI.Portal and UI.Runner link this file.
 *
 * All colors / borders / radii reference --theme-* variables that
 * the host supplies. This file MUST NOT hard-code any palette values
 * so the same components render correctly under every host's theme.
 *
 * The Portal reads this file as it is. go's web runner reads it
 * through its design tokens: Tools/DesignBundle maps every --theme-*
 * read below to its --cv-* token while it bundles runner-face.css
 * (UI.Runner/GoSite/design/src/runner/theme-map.json - one map, a
 * read it does not name refuses the bundle), so a design reaches
 * every component on go and nothing here ever reads a design token
 * in the Portal (the runner face pass, D3.5).
 * ================================================================= */


/* ── Step capture chrome ─────────────────────────────────────────── */

.wf-step-capture {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wf-step-iteration {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--cv-accent-soft, #dbeafe);
    color: var(--cv-accent, #2563eb);
    border-radius: 999px;
    align-self: flex-start;
}

.wf-step-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--cv-on-surface-strong, var(--cv-on-surface));
    line-height: 1.35;
}

.wf-step-title {
    font-size: 0.9rem;
    color: var(--cv-muted, #6b7280);
    line-height: 1.5;
    margin-top: -0.25rem;
}

/* A PICTURE FROM A LINK (ACTIONS.md 16.2b) - an action's photo on a moment. Capped so a provider's 4000px photo never
   pushes the question off the screen; the browser fetches it (no referrer), never our server. */
.wf-step-picture {
    margin: 0;
    display: flex;
    justify-content: center;
}

.wf-step-picture img {
    display: block;
    max-width: 100%;
    max-height: 320px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--cv-radius-m, 0.75rem);
    border: 1px solid var(--cv-line, transparent);
    background: var(--cv-panel-alt, transparent);
}

/* THE MOMENT'S LINK (renderAsJson ctaUrl - an Info's, and a Choice moment's beside its choices): a link that opens a new
   tab, styled as an outlined button so it reads as an action - and never as one of the choices (no fill, its own row). */
.wf-step-link {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--cv-accent, #2563eb);
    background: transparent;
    border: 1px solid var(--cv-accent, #2563eb);
    border-radius: var(--cv-radius-m, 0.75rem);
    max-width: 100%;
    overflow-wrap: anywhere;
}

.wf-step-link:focus-visible {
    background: var(--cv-accent-soft, #dbeafe);
    text-decoration: none;
}

@media (hover: hover) {
    .wf-step-link:hover {
        background: var(--cv-accent-soft, #dbeafe);
        text-decoration: none;
    }
}

/* Step description — clamped inline so long instructions never crowd the
   capture controls; the "Details" button opens the full text in an overlay. */
.wf-step-desc {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: -0.25rem;
}

.wf-step-desc-text {
    flex: 1 1 auto;
    font-size: 0.9rem;
    color: var(--cv-muted, #6b7280);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wf-step-desc-more {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: var(--cv-accent, #2563eb);
    font-size: 0.8rem;
    line-height: 1.5;
    padding: 0;
    cursor: pointer;
    white-space: nowrap;
}

@media (hover: hover) {
    .wf-step-desc-more:hover {
        text-decoration: underline;
    }
}

/* DETAIL MODE (presentation detail: on) - the full description rendered
   INLINE between the step title and the capture control, rich (link()
   anchors, auto-linked URLs, tables, line breaks). Styled as a quiet
   reading panel: the tenant-primary rail says "this is the briefing",
   the soft surface keeps it apart from the control below, and the
   typography is set for PROSE (a touch larger + looser than the clamped
   one-liner it replaces). */
.wf-step-detail-rich {
    margin-top: -0.25rem;
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--cv-accent, #2563eb);
    border-radius: 0 8px 8px 0;
    background: var(--cv-surface-subtle, rgba(0, 0, 0, 0.03));
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--cv-on-surface, #111827);
    overflow-wrap: anywhere;
}

.wf-step-detail-rich a {
    color: var(--cv-accent, #2563eb);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.wf-step-detail-rich table {
    width: 100%;
    margin: 0.5rem 0;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.wf-step-detail-rich th,
.wf-step-detail-rich td {
    padding: 0.3rem 0.6rem;
    border-bottom: 1px solid var(--cv-line, #e5e7eb);
    text-align: left;
}

/* The Details overlay body renders through the same rich pipeline - give its
   links the same voice, and stop a 200-character URL from forcing a scrollbar. */
.wf-instructions-body a {
    color: var(--cv-accent, #2563eb);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    overflow-wrap: anywhere;
}

/* Full-screen dismissable instructions overlay. */
.wf-instructions-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 10000;
    cursor: zoom-out;
}

.wf-instructions-panel {
    position: relative;
    background: var(--cv-panel, #ffffff);
    color: var(--cv-on-surface, #111827);
    border-radius: var(--cv-radius-m, 0.75rem);
    max-width: min(100%, 36rem);
    max-height: 85%;
    overflow: auto;
    padding: 1.5rem 1.5rem 1.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    cursor: default;
}

.wf-instructions-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 0;
    background: var(--cv-panel-muted, #f3f4f6);
    color: var(--cv-on-surface, #111827);
    cursor: pointer;
}

@media (hover: hover) {
    .wf-instructions-close:hover {
        background: var(--cv-line, #e5e7eb);
    }
}

.wf-instructions-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-right: 2rem;
    line-height: 1.35;
}

.wf-instructions-body {
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
    color: var(--cv-on-surface, #374151);
}


/* ── Capture inputs ──────────────────────────────────────────────── */

.wf-capture-input {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wf-text-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--cv-surface-raised, #fff);
    border: 1px solid var(--cv-line, #d0d4da);
    border-radius: var(--cv-radius-s, 6px);
    color: var(--cv-on-surface, #222);
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s;
}

.wf-text-input:focus {
    border-color: var(--cv-accent, #2563eb);
}

.wf-text-input.wf-input-invalid {
    border-color: var(--cv-danger, #dc3545);
}

.wf-capture-error {
    font-size: 0.85rem;
    color: var(--cv-danger, #dc3545);
    padding: 0 0.25rem;
}

/* The honest optional-skip hint beside a validation error - an optional
   question with invalid text must say HOW to skip, not feel mandatory. */
.wf-capture-hint {
    font-size: 0.8rem;
    color: var(--cv-muted, #6c757d);
    padding: 0 0.25rem;
}

/* ── Ride-alongs (photo + note beside the answer) ────────────────── */

.wf-capture-image,
.wf-capture-note {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--cv-line, #d1d5db);
}

.wf-capture-image-label,
.wf-capture-note-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cv-muted, #6b7280);
}

.wf-capture-image-pick {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.6rem 1rem;
    background: var(--cv-surface-raised, #fff);
    border: 1px solid var(--cv-line, #d1d5db);
    border-radius: var(--cv-radius-s, 6px);
    cursor: pointer;
    width: fit-content;
}

.wf-capture-image-pick input[type="file"] {
    display: none;
}

.wf-capture-image-busy {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: var(--cv-muted, #6b7280);
}

.wf-capture-image-filled {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.wf-capture-image-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--cv-radius-s, 6px);
    border: 1px solid var(--cv-line, #d1d5db);
}

.wf-capture-image-icon {
    font-size: 1.5rem;
    color: var(--cv-muted, #6b7280);
}

.wf-capture-image-name {
    flex: 1;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wf-capture-image-remove {
    background: none;
    border: none;
    color: var(--cv-danger, #dc3545);
    cursor: pointer;
    padding: 0.25rem;
}

.wf-note-input {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: var(--cv-surface-raised, #fff);
    border: 1px solid var(--cv-line, #d1d5db);
    border-radius: var(--cv-radius-s, 6px);
    resize: vertical;
    font: inherit;
}

.wf-note-input:focus {
    border-color: var(--cv-accent, #2563eb);
}

.wf-capture-unsupported {
    padding: 0.75rem 1rem;
    background: var(--cv-warning-muted, #fef9c3);
    border-radius: var(--cv-radius-s, 6px);
    color: var(--cv-warning, #b45309);
    font-size: 0.875rem;
}


/* ── Info step ───────────────────────────────────────────────────── */

.wf-info-step {
    padding: 1rem;
    background: var(--cv-surface-subtle, #f8f9fa);
    border-radius: var(--cv-radius-s, 6px);
    color: var(--cv-on-surface, #222);
    font-size: 0.95rem;
    line-height: 1.6;
    border-left: 3px solid var(--cv-accent, #2563eb);
}

.wf-info-body {
    line-height: 1.6;
}

.wf-info-default {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--cv-line-light, #e5e7eb);
    font-size: 0.875rem;
}

.wf-info-default-label {
    color: var(--cv-muted, #6b7280);
    font-weight: 500;
}

.wf-info-default-value {
    font-family: var(--cv-font-mono, ui-monospace, "Cascadia Code", "Consolas", monospace);
    color: var(--cv-on-surface, #222);
    background: var(--cv-panel, #fff);
    padding: 0.05rem 0.35rem;
    border-radius: var(--cv-radius-s, 3px);
    border: 1px solid var(--cv-line-light, #e5e7eb);
}


/* ── Options list (Choice, Loop) ─────────────────────────────────── */

.wf-options-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

/* wf-option-row is used by CaptureChoice on <li> elements;
   the combined selector keeps Choice and Loop visually identical. */
.wf-options-list li,
.wf-option-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.6875rem 1rem;
    background: var(--cv-surface-raised, #fff);
    border: 1px solid var(--cv-line, #d0d4da);
    border-radius: var(--cv-radius-s, 6px);
    cursor: pointer;
    font-size: 1rem;
    color: var(--cv-on-surface, #222);
    transition: background 100ms ease, border-color 100ms ease;
    user-select: none;
}

@media (hover: hover) {
    .wf-options-list li:hover:not(.wf-option-disabled),
    .wf-option-row:hover:not(.wf-option-disabled) {
        background: var(--cv-surface-hover, #f3f4f6);
        border-color: var(--cv-line-2, #b0b7bf);
    }
}

.wf-options-list li.wf-option-selected,
.wf-option-row.wf-option-selected {
    background: var(--cv-accent-soft, #dbeafe);
    border-color: var(--cv-accent, #2563eb);
    color: var(--cv-accent, #2563eb);
    font-weight: 500;
}

.wf-option-indicator {
    flex-shrink: 0;
    width: 1.1rem;
    text-align: center;
    font-size: 0.8rem;
}

.wf-option-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.wf-option-required {
    color: var(--cv-danger, #b91c1c);
    margin-left: 0.15rem;
}

.wf-option-status-complete {
    color: var(--cv-success, #16a34a);
    font-weight: 700;
}

.wf-option-status-started {
    color: var(--cv-warning, #b45309);
}

/* Loop leg accent */
.wf-options-list.wf-loop li.wf-option-selected {
    background: var(--cv-accent-muted, rgba(37, 99, 235, 0.1));
    border-color: var(--cv-accent, #2563eb);
    color: var(--cv-accent, #2563eb);
}


/* ── Options list with alphabet jump rail ────────────────────────── */

.wf-options-with-rail {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    position: relative;
}

.wf-options-with-rail .wf-options-list {
    flex: 1 1 auto;
    min-width: 0;
}

.wf-options-list li.wf-options-section {
    display: block;
    padding: 0.5rem 0 0.25rem 0.25rem;
    background: transparent;
    border: none;
    border-radius: 0;
    color: var(--cv-muted, #6b7280);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: default;
    user-select: none;
    scroll-margin-top: 0.5rem;
}

@media (hover: hover) {
    .wf-options-list li.wf-options-section:hover {
        background: transparent;
        border-color: transparent;
    }
}

.wf-options-rail {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1px;
    padding: 0.25rem 0.125rem;
    position: sticky;
    top: 0.5rem;
    align-self: flex-start;
    max-height: calc(100vh - 8rem);
    overflow: hidden;
}

.wf-rail-letter {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    width: 1rem;
    height: 0.875rem;
    line-height: 0.875rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--cv-accent, #2563eb);
    cursor: pointer;
    user-select: none;
    text-align: center;
    border-radius: var(--cv-radius-s, 2px);
}

@media (hover: hover) {
    .wf-rail-letter:hover:not(.wf-rail-inactive) {
        background: var(--cv-accent-soft, #dbeafe);
    }
}

.wf-rail-letter.wf-rail-inactive {
    color: var(--cv-muted, #9ca3af);
    opacity: 0.4;
    cursor: default;
}


/* ── Split options ───────────────────────────────────────────────── */

.wf-split-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 0.25rem 0;
}

.wf-split-option {
    width: 100%;
    padding: 0.7rem 1.25rem;
    border: 1.5px solid var(--cv-line, #d0d4da);
    border-radius: var(--cv-radius-s, 1.5rem);
    background: var(--cv-surface-raised, #fff);
    color: var(--cv-on-surface, #222);
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    text-align: center;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease, color 150ms ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .wf-split-option:hover {
        background: var(--cv-surface-hover, #f3f4f6);
        border-color: var(--cv-line-2, #b0b7bf);
    }
}

.wf-split-option:active {
    background: var(--cv-surface-active, #e5e7eb);
}

.wf-split-option-selected {
    background: var(--cv-accent-muted, rgba(37, 99, 235, 0.1));
    border-color: var(--cv-accent, #2563eb);
    color: var(--cv-accent, #2563eb);
    box-shadow: 0 0 0 1px var(--cv-accent, #2563eb),
                0 0 14px color-mix(in srgb, var(--cv-accent) 22%, transparent);
}

@media (hover: hover) {
    .wf-split-option-selected:hover {
        background: var(--cv-accent-muted, rgba(37, 99, 235, 0.1));
        border-color: var(--cv-accent, #2563eb);
    }
}


/* ── Choice options ────────────────────────────────────────────── */

.wf-choice-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 0.25rem 0;
}

.wf-choice-option {
    width: 100%;
    padding: 0.7rem 1.25rem;
    border: 1.5px solid var(--cv-line, #d0d4da);
    border-radius: var(--cv-radius-s, 1.5rem);
    background: var(--cv-surface-raised, #fff);
    color: var(--cv-on-surface, #222);
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 100ms ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-align: left;
}

.wf-choice-option-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    font-size: 1.25rem;
    line-height: 1;
}

.wf-choice-option-label {
    flex: 1 1 auto;
}

.wf-choice-option-proceed {
    border-color: color-mix(in srgb, var(--cv-accent, #198754) 35%, var(--cv-line, #d0d4da));
}

.wf-choice-option-proceed .wf-choice-option-badge {
    color: var(--cv-accent, #198754);
}

@media (hover: hover) {
    .wf-choice-option-proceed:hover {
        background: color-mix(in srgb, var(--cv-accent, #198754) 6%, var(--cv-surface-raised, #fff));
        border-color: var(--cv-accent, #198754);
    }
}

.wf-choice-option-blocked {
    border-color: color-mix(in srgb, var(--cv-danger, #dc3545) 25%, var(--cv-line, #d0d4da));
    cursor: not-allowed;
    opacity: 0.85;
}

.wf-choice-option-blocked .wf-choice-option-badge {
    color: var(--cv-danger, #dc3545);
}

@media (hover: hover) {
    .wf-choice-option-blocked:hover {
        background: var(--cv-surface-raised, #fff);
    }
}

.wf-choice-option-exit {
    border-color: color-mix(in srgb, var(--cv-warning, #fd7e14) 35%, var(--cv-line, #d0d4da));
}

.wf-choice-option-exit .wf-choice-option-badge {
    color: var(--cv-warning, #fd7e14);
}

@media (hover: hover) {
    .wf-choice-option-exit:hover {
        background: color-mix(in srgb, var(--cv-warning, #fd7e14) 6%, var(--cv-surface-raised, #fff));
        border-color: var(--cv-warning, #fd7e14);
    }
}

.wf-choice-option-exit-selected {
    background: color-mix(in srgb, var(--cv-warning, #fd7e14) 10%, var(--cv-surface-raised, #fff));
    border-color: var(--cv-warning, #fd7e14);
    box-shadow: 0 0 0 1px var(--cv-warning, #fd7e14);
}

.wf-choice-option-selected {
    background: color-mix(in srgb, var(--cv-accent, #198754) 10%, var(--cv-surface-raised, #fff));
    border-color: var(--cv-accent, #198754);
    box-shadow: 0 0 0 1px var(--cv-accent, #198754);
}

/* ── One Style per moment (2026-10-27) ─────────────────────────────
   The moment's Style (renderAsJson messaging.style) mirrored on the web -
   Workflow.Runner.ChoiceLooks. Buttons = big full-width tap buttons (one tap
   answers a single answer); A list = the RenderAs tile rows; A carousel = the
   RenderAs card grid. The channel decides = the rows above, unchanged.
   Theme tokens only. */

.wf-choice-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin: 0.25rem 0;
}

.wf-choice-button {
    width: 100%;
    min-height: 3.25rem;
    padding: 0.85rem 1.25rem;
    border: 1.5px solid var(--cv-accent);
    border-radius: var(--cv-radius-s);
    background: var(--cv-surface-raised);
    color: var(--cv-accent);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 150ms ease, color 150ms ease, transform 100ms ease;
}

@media (hover: hover) {
    .wf-choice-button:hover {
        background: var(--cv-accent-muted);
    }
}

.wf-choice-button:active {
    transform: scale(0.98);
}

.wf-choice-button--selected {
    background: var(--cv-accent);
    color: var(--cv-on-accent);
}

@media (hover: hover) {
    .wf-choice-button--selected:hover {
        background: var(--cv-accent);
        color: var(--cv-on-accent);
    }
}

.wf-choice-button-desc {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--cv-muted);
}

.wf-choice-button--selected .wf-choice-button-desc {
    color: var(--cv-on-accent);
}

.wf-choice-look .wf-choice-button:focus-visible,
.wf-choice-look .wf-ra-tile:focus-visible {
    outline: 2px solid var(--cv-accent);
    outline-offset: 2px;
}


/* ── MultiSplit legs — the centerpiece leg menu ──────────────────────
   The Choice-option visual language (thick intentional tiles, badge icons,
   theme tokens) applied to the leg menu, with per-leg STATUS storytelling:
   fresh = arrow invite · in progress = warning half-circle + sublabel ·
   completed = primary check + tinted tile · exit = the Choice exit
   treatment, LOCKED (padlock, dimmed) until required legs complete. */

.wf-multisplit-legs {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 0.25rem 0;
}

.wf-multisplit-leg {
    width: 100%;
    padding: 0.7rem 1.25rem;
    border: 1.5px solid var(--cv-line, #d0d4da);
    border-radius: var(--cv-radius-s, 1.5rem);
    background: var(--cv-surface-raised, #fff);
    color: var(--cv-on-surface, #222);
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 100ms ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-align: left;
}

.wf-multisplit-leg-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    font-size: 1.25rem;
    line-height: 1;
}

.wf-multisplit-leg-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.wf-multisplit-leg-status {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--cv-muted, #6c757d);
}

.wf-multisplit-leg-go {
    flex-shrink: 0;
    color: var(--cv-muted, #6c757d);
    font-size: 1rem;
    transition: transform 150ms ease, color 150ms ease;
}

/* Fresh — an open invitation: neutral tile, primary arrow, primary hover. */
.wf-ms-fresh .wf-multisplit-leg-badge {
    color: var(--cv-accent, #198754);
}

@media (hover: hover) {
    .wf-ms-fresh:hover {
        background: color-mix(in srgb, var(--cv-accent, #198754) 6%, var(--cv-surface-raised, #fff));
        border-color: var(--cv-accent, #198754);
    }
}

@media (hover: hover) {
    .wf-ms-fresh:hover .wf-multisplit-leg-go {
        color: var(--cv-accent, #198754);
        transform: translateX(2px);
    }
}

/* In progress — warm accent, half-circle badge, status sublabel. */
.wf-ms-started {
    border-color: color-mix(in srgb, var(--cv-warning, #fd7e14) 35%, var(--cv-line, #d0d4da));
}

.wf-ms-started .wf-multisplit-leg-badge,
.wf-ms-started .wf-multisplit-leg-status {
    color: var(--cv-warning, #fd7e14);
}

@media (hover: hover) {
    .wf-ms-started:hover {
        background: color-mix(in srgb, var(--cv-warning, #fd7e14) 6%, var(--cv-surface-raised, #fff));
        border-color: var(--cv-warning, #fd7e14);
    }
}

/* Completed — the earned check: primary tint, still tappable to revisit. */
.wf-ms-complete {
    border-color: color-mix(in srgb, var(--cv-accent, #198754) 35%, var(--cv-line, #d0d4da));
    background: color-mix(in srgb, var(--cv-accent, #198754) 4%, var(--cv-surface-raised, #fff));
}

.wf-ms-complete .wf-multisplit-leg-badge,
.wf-ms-complete .wf-multisplit-leg-status {
    color: var(--cv-accent, #198754);
}

@media (hover: hover) {
    .wf-ms-complete:hover {
        background: color-mix(in srgb, var(--cv-accent, #198754) 9%, var(--cv-surface-raised, #fff));
        border-color: var(--cv-accent, #198754);
    }
}

/* Exit — the Choice exit treatment; padlocked until required legs finish. */
.wf-ms-exit {
    border-color: color-mix(in srgb, var(--cv-warning, #fd7e14) 35%, var(--cv-line, #d0d4da));
}

.wf-ms-exit .wf-multisplit-leg-badge {
    color: var(--cv-warning, #fd7e14);
}

@media (hover: hover) {
    .wf-ms-exit:hover:not(.wf-option-disabled) {
        background: color-mix(in srgb, var(--cv-warning, #fd7e14) 6%, var(--cv-surface-raised, #fff));
        border-color: var(--cv-warning, #fd7e14);
    }
}

.wf-ms-exit.wf-option-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    border-color: var(--cv-line, #d0d4da);
}

.wf-ms-exit.wf-option-disabled .wf-multisplit-leg-badge {
    color: var(--cv-muted, #6c757d);
}

/* INSTANT TOUCH FEEDBACK. These tiles set -webkit-tap-highlight-color:
   transparent (right — the platform's grey flash is ugly on a themed tile), but
   nothing replaced it, so on a handset a tap produced NO acknowledgement at all:
   no hover to fall back on, and the selected ring only lands once state settles.
   A pressed state closes that gap for every device, and costs nothing on a
   mouse where :hover already answers. */
.wf-multisplit-leg:active:not(.wf-option-disabled),
.wf-choice-option:active:not(.wf-option-disabled) {
    transform: scale(0.985);
    background: var(--cv-surface-active, #e5e7eb);
    border-color: var(--cv-line-2, #b0b7bf);
}

/* The current pick — the same primary ring the Choice selection wears. */
.wf-multisplit-leg.wf-option-selected {
    background: color-mix(in srgb, var(--cv-accent, #198754) 10%, var(--cv-surface-raised, #fff));
    border-color: var(--cv-accent, #198754);
    box-shadow: 0 0 0 1px var(--cv-accent, #198754);
}

.wf-multisplit-leg.wf-ms-exit.wf-option-selected {
    background: color-mix(in srgb, var(--cv-warning, #fd7e14) 10%, var(--cv-surface-raised, #fff));
    border-color: var(--cv-warning, #fd7e14);
    box-shadow: 0 0 0 1px var(--cv-warning, #fd7e14);
}


/* ── MultiSplit checkboxes (legacy rows — still worn by the Review's
      multisplit group display; the live control uses .wf-multisplit-leg) ── */

.wf-multisplit-check-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0.25rem 0;
}

.wf-multisplit-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--cv-line, #d0d4da);
    border-radius: var(--cv-radius-s, 4px);
    cursor: pointer;
    background: var(--cv-panel, #fff);
}

@media (hover: hover) {
    .wf-multisplit-check:hover {
        background: var(--cv-panel-hover, #f3f4f6);
    }
}

.wf-multisplit-check.wf-option-selected {
    background: var(--cv-accent-soft, #dbeafe);
    border-color: var(--cv-accent, #2563eb);
}

.wf-multisplit-check-label {
    flex: 1;
}


/* ── Loop iteration badge ────────────────────────────────────────── */

.wf-loop-iteration {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--cv-accent, #2563eb);
    background: var(--cv-accent-soft, #dbeafe);
    border-radius: var(--cv-radius-s, 4px);
    padding: 0.15rem 0.5rem;
    margin-bottom: 0.5rem;
}


/* ── Entity summary (CaptureEntitySummary + PickerItemReview) ────── */

.wf-entity-summary {
    padding: 0.5rem 0;
    display: flex;
    flex-direction: column;
}

.wf-entity-summary-header {
    margin-bottom: 0.5rem;
}

.wf-entity-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--cv-on-surface, #222);
}

.wf-entity-summary-empty {
    color: var(--cv-muted, #6b7280);
    font-size: 0.875rem;
    padding: 0.5rem 0;
}

.wf-property-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0;
}

.wf-property-row + .wf-property-row {
    border-top: 1px solid var(--cv-line, #d0d4da);
}

.wf-property-label {
    flex: 0 0 auto;
    min-width: 9rem;
    color: var(--cv-muted, #6b7280);
    font-weight: 500;
    font-size: 0.875rem;
}

.wf-property-value {
    flex: 1;
    font-weight: 500;
    color: var(--cv-on-surface, #222);
    font-size: 0.875rem;
    font-family: var(--cv-font-mono, ui-monospace, "Cascadia Code", "Consolas", monospace);
}

.wf-entity-summary-edit {
    flex: 0 0 auto;
    margin-left: auto;
    background: transparent;
    border: none;
    padding: 0.25rem 0.375rem;
    color: var(--cv-muted, #6b7280);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    border-radius: var(--cv-radius-s, 4px);
    transition: color 120ms ease, background 120ms ease;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .wf-entity-summary-edit:hover {
        color: var(--cv-accent, #2563eb);
        background: var(--cv-surface-hover, #f3f4f6);
    }
}


/* ── Property list (PickerItemForm review table) ─────────────────── */

.wf-property-list {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.25rem 1rem;
    margin: 0.25rem 0;
}

.wf-property-list dt {
    font-weight: 500;
    color: var(--cv-muted, #6b7280);
}

.wf-property-list dd {
    margin: 0;
    font-family: var(--cv-font-mono, ui-monospace, "Cascadia Code", "Consolas", monospace);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wf-value-text {
    font-weight: 500;
}


/* ── Picker intermediate review ──────────────────────────────────── */

.wf-picker-review-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--cv-on-surface, #222);
    margin-bottom: 0.75rem;
}

.wf-picker-empty,
.wf-picker-no-results {
    padding: 0.75rem 0;
    color: var(--cv-muted, #6b7280);
    font-size: 0.95rem;
    text-align: center;
}


/* ── Picker record list ──────────────────────────────────────────── */

.wf-picker-search {
    margin-bottom: 0.6rem;
}

.wf-picker-search-input {
    width: 100%;
    padding: 0.5rem 0.85rem;
    border: 1.5px solid var(--cv-line, #d0d4da);
    border-radius: var(--cv-radius-s, 0.5rem);
    background: var(--cv-surface-raised, #fff);
    color: var(--cv-on-surface, #222);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    transition: border-color 150ms ease;
}

.wf-picker-search-input:focus {
    border-color: var(--cv-accent, #2563eb);
}

.wf-picker-options {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin: 0.25rem 0;
}

.wf-picker-record {
    border: 1.5px solid var(--cv-line, #d0d4da);
    border-radius: var(--cv-radius-m, 0.75rem);
    background: var(--cv-surface-raised, #fff);
    overflow: hidden;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.wf-picker-record-selected {
    border-color: var(--cv-accent, #2563eb);
    box-shadow: 0 0 0 1px var(--cv-accent, #2563eb),
                0 0 14px color-mix(in srgb, var(--cv-accent) 18%, transparent);
}

.wf-picker-item {
    display: flex;
    align-items: stretch;
}

.wf-picker-item-label {
    flex: 1;
    padding: 0.65rem 1rem;
    border: none;
    background: transparent;
    color: var(--cv-on-surface, #222);
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.wf-picker-record-selected .wf-picker-item-label {
    color: var(--cv-accent, #2563eb);
    background: var(--cv-accent-muted, rgba(37, 99, 235, 0.07));
}

@media (hover: hover) {
    .wf-picker-item-label:hover {
        background: var(--cv-surface-hover, #f3f4f6);
    }
}

.wf-picker-item-edit {
    padding: 0 0.85rem;
    border: none;
    border-left: 1px solid var(--cv-line, #d0d4da);
    background: transparent;
    color: var(--cv-muted, #6b7280);
    font-size: 1rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 150ms ease, color 150ms ease;
}

@media (hover: hover) {
    .wf-picker-item-edit:hover {
        background: var(--cv-surface-hover, #f3f4f6);
        color: var(--cv-on-surface, #222);
    }
}

.wf-picker-item-details {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--cv-line, #d0d4da);
    background: var(--cv-accent-muted, rgba(37, 99, 235, 0.04));
}

.wf-picker-add-btn {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.6rem 1rem;
    border: 1.5px dashed var(--cv-line, #d0d4da);
    border-radius: var(--cv-radius-s, 1.5rem);
    background: transparent;
    color: var(--cv-muted, #6b7280);
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .wf-picker-add-btn:hover {
        border-color: var(--cv-accent, #2563eb);
        color: var(--cv-accent, #2563eb);
        background: var(--cv-accent-muted, rgba(37, 99, 235, 0.06));
    }
}


/* ── Picker step-by-step form header + navigation ────────────────── */

.wf-picker-form-tabs {
    display: flex;
    margin-bottom: 1rem;
    border: 1.5px solid var(--cv-line, #d0d4da);
    border-radius: var(--cv-radius-s, 1.5rem);
    overflow: hidden;
}

.wf-picker-form-tab {
    flex: 1;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--cv-muted, #6b7280);
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .wf-picker-form-tab:hover:not(.wf-picker-form-tab-active) {
        background: var(--cv-panel-hover, #f3f4f6);
    }
}

.wf-picker-form-tab-active {
    background: var(--cv-accent, #2563eb);
    color: #fff;
}

.wf-picker-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.wf-picker-form-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--cv-on-surface, #222);
}

.wf-picker-form-cancel-x {
    padding: 0.2rem 0.55rem;
    border: none;
    background: transparent;
    color: var(--cv-muted, #6b7280);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    border-radius: var(--cv-radius-s, 4px);
    transition: background 150ms ease, color 150ms ease;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .wf-picker-form-cancel-x:hover {
        background: var(--cv-panel-hover, #f3f4f6);
        color: var(--cv-on-surface, #222);
    }
}

.wf-picker-form-step-count {
    font-size: 0.8rem;
    color: var(--cv-muted, #6b7280);
    margin-bottom: 0.5rem;
}

.wf-picker-step-footer {
    display: flex;
    gap: 0.6rem;
    margin-top: 1rem;
}

.wf-picker-step-footer .wf-nav-back {
    padding: 0.6rem 1rem;
    border: 1.5px solid var(--cv-line, #d0d4da);
    border-radius: var(--cv-radius-s, 1.5rem);
    background: transparent;
    color: var(--cv-muted, #6b7280);
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 150ms ease, color 150ms ease;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .wf-picker-step-footer .wf-nav-back:hover:not(:disabled) {
        border-color: var(--cv-muted, #6b7280);
        color: var(--cv-on-surface, #222);
    }
}

.wf-picker-step-footer .wf-nav-back:disabled {
    opacity: 0.4;
    cursor: default;
}

.wf-picker-step-footer .wf-nav-next {
    flex: 1;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: var(--cv-radius-s, 1.5rem);
    background: var(--cv-accent, #2563eb);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 150ms ease;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .wf-picker-step-footer .wf-nav-next:hover {
        background: var(--cv-accent-strong, #1d4ed8);
    }
}


/* ── Picker add / edit form ──────────────────────────────────────── */

.wf-picker-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.25rem 0;
}

.wf-picker-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.wf-picker-form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--cv-on-surface, #222);
}

.wf-picker-form-required {
    margin-left: 0.2rem;
    color: var(--cv-danger, #dc2626);
}

.wf-picker-form-actions {
    display: flex;
    gap: 0.6rem;
    padding-top: 0.25rem;
}

.wf-picker-form-save {
    flex: 1;
    padding: 0.65rem 1rem;
    border: none;
    border-radius: var(--cv-radius-s, 1.5rem);
    background: var(--cv-accent, #2563eb);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 150ms ease;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .wf-picker-form-save:hover {
        background: var(--cv-accent-strong, #1d4ed8);
    }
}

.wf-picker-form-cancel {
    padding: 0.65rem 1.25rem;
    border: 1.5px solid var(--cv-line, #d0d4da);
    border-radius: var(--cv-radius-s, 1.5rem);
    background: transparent;
    color: var(--cv-muted, #6b7280);
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 150ms ease, color 150ms ease;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .wf-picker-form-cancel:hover {
        border-color: var(--cv-muted, #6b7280);
        color: var(--cv-on-surface, #222);
    }
}


/* ── Date / time numpad ──────────────────────────────────────────── */

/* The free-text box above the mask (2026-11-14, "Date is hard"): a person types or pastes "May 14 68" / "3:30 pm" and
   the mask fills itself through the one human date reader. It inherits .wf-text-input; only its spacing is its own. */
.wf-date-typed {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: normal;
}

.wf-date-typed::placeholder {
    color: var(--cv-muted, #6b7280);
}

.wf-date-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background: var(--cv-surface-raised, #fff);
    border: 1px solid var(--cv-line, #d0d4da);
    border-radius: var(--cv-radius-s, 6px);
    font-size: 1.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    color: var(--cv-on-surface, #222);
}

.wf-date-segment {
    color: var(--cv-muted, #6b7280);
    transition: color 120ms ease;
}

.wf-date-segment-active {
    color: var(--cv-accent, #2563eb);
}

.wf-date-sep {
    color: var(--cv-line, #d0d4da);
    font-weight: 400;
}

.wf-date-sep-dash {
    margin: 0 0.25rem;
    color: var(--cv-muted, #6b7280);
    font-weight: 400;
}

.wf-date-display-datetime {
    font-size: 1.3rem;
    gap: 0.2rem;
}

.wf-ampm-indicator {
    margin-left: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--cv-muted, #6b7280);
    align-self: flex-end;
    padding-bottom: 0.1rem;
}

.wf-numpad {
    display: grid;
    grid-template-areas:
        "n7 n8 n9 ca"
        "n4 n5 n6 ca"
        "n1 n2 n3 cc"
        "n0 n0 sl cc";
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 3.25rem);
    gap: 0.5rem;
}

.wf-numpad-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 1.25rem;
    font-weight: 500;
    background: var(--cv-surface-raised, #fff);
    border: 1px solid var(--cv-line, #d0d4da);
    border-radius: var(--cv-radius-s, 6px);
    color: var(--cv-on-surface, #222);
    cursor: pointer;
    transition: background 100ms ease, border-color 100ms ease, opacity 100ms ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .wf-numpad-btn:hover:not(:disabled) {
        background: var(--cv-surface-hover, #f3f4f6);
        border-color: var(--cv-line-2, #b0b7bf);
    }
}

.wf-numpad-btn:active:not(:disabled) {
    background: var(--cv-surface-active, #e5e7eb);
}

.wf-numpad-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.wf-numpad-action {
    background: var(--cv-surface-subtle, #f8f9fa);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

@media (hover: hover) {
    .wf-numpad-action:hover:not(:disabled) {
        background: var(--cv-surface-active, #e5e7eb);
    }
}

.wf-numpad-sep {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--cv-muted, #6b7280);
}

.wf-numpad.wf-numpad-num {
    grid-template-areas:
        "n7 n8 n9 ca"
        "n4 n5 n6 ca"
        "n1 n2 n3 cc"
        "dp n0 n0 cc";
}

.wf-numpad.wf-numpad-time {
    grid-template-areas:
        "n7 n8 n9 am"
        "n4 n5 n6 pm"
        "n1 n2 n3 md"
        "n0 n0 sl cc";
}

.wf-numpad-btn.wf-ampm-active {
    background: var(--cv-accent, #2563eb);
    color: #fff;
    border-color: var(--cv-accent, #2563eb);
}

@media (hover: hover) {
    .wf-numpad-btn.wf-ampm-active:hover {
        background: var(--cv-accent-hover, #1d4ed8);
        border-color: var(--cv-accent-hover, #1d4ed8);
    }
}

.wf-num-display {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background: var(--cv-surface-raised, #fff);
    border: 1px solid var(--cv-line, #d0d4da);
    border-radius: var(--cv-radius-s, 6px);
    font-size: 1.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    color: var(--cv-on-surface, #222);
    min-height: 3.25rem;
    word-break: break-all;
}

.wf-num-display-empty {
    color: var(--cv-muted, #6b7280);
}

.wf-shortcut-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.625rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--cv-line, #d0d4da);
    border-radius: var(--cv-radius-s, 6px);
    background: var(--cv-surface-raised, #fff);
    color: var(--cv-muted, #6b7280);
    cursor: pointer;
    transition: background 100ms ease, color 100ms ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .wf-shortcut-btn:hover {
        background: var(--cv-surface-hover, #f3f4f6);
        color: var(--cv-on-surface, #222);
    }
}

.wf-shortcut-btn:active {
    background: var(--cv-surface-active, #e5e7eb);
}


/* ── Nav buttons (also used by wf-picker-step-footer above) ──────── */

.wf-nav-back,
.wf-nav-next {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1.25rem;
    font-family: inherit;
    font-size: var(--cv-font-size-base, 1rem);
    font-weight: 500;
    border-radius: var(--cv-radius-s, 6px);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 120ms ease;
    user-select: none;
}

.wf-nav-back {
    background: var(--cv-surface-active);
    border-color: var(--cv-line-2, var(--cv-line));
    color: var(--cv-on-surface);
}

@media (hover: hover) {
    .wf-nav-back:hover:not(:disabled) {
        background: var(--cv-surface-hover);
        border-color: var(--cv-muted);
    }
}

.wf-nav-next {
    background: var(--cv-accent);
    border-color: var(--cv-accent);
    color: var(--cv-on-accent, #fff);
}

@media (hover: hover) {
    .wf-nav-next:hover:not(:disabled) {
        background: var(--cv-accent-hover, var(--cv-accent));
        border-color: var(--cv-accent-hover, var(--cv-accent));
    }
}

/* THE SAFE EXIT - reads as a way out, not as the next step. */
.wf-nav-escape {
    margin-right: auto;
    font-weight: 400;
}

.wf-nav-back:disabled,
.wf-nav-next:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}


/* ── Review — step header layout ────────────────────────────────── */

.wf-step-header-left {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    min-width: 0;
}

/* ── Review — Info step acknowledgement ─────────────────────────── */

.wf-info-acknowledged {
    font-size: 0.85rem;
    color: var(--cv-muted, #6b7280);
    font-style: italic;
}

/* ── Review — split / choice readonly radio group ───────────────── */

.wf-split-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.wf-split-radio {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--cv-muted, #6b7280);
    cursor: default;
}

.wf-split-radio.wf-option-selected {
    color: var(--cv-on-surface, #222);
    font-weight: 500;
}

.wf-split-radio input[type="radio"] {
    accent-color: var(--cv-accent, #2563eb);
    cursor: default;
}

/* The multi-select option story renders the same rows as CHECKBOXES
   (several selections checked) — same accent, same readonly cursor. */
.wf-split-radio input[type="checkbox"] {
    accent-color: var(--cv-accent, #2563eb);
    cursor: default;
}

.wf-split-radio-label {
    flex: 1;
}


/* ── Review — shell (step cards, header row, pencil, group bands) ──
   The one styling source for the shared <WorkflowReview> across the
   web runner, the Portal test runner, and Mobile. These rules lived
   only in UI.Portal/wwwroot/css/runner.css, so Mobile and the
   standalone runner rendered the review unstyled — default-flow
   headers (name and pencil wrapping onto separate lines) and a bare
   browser button for the pencil. */

.wf-review {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.wf-review-header {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--cv-line, #d0d4da);
}

.wf-review-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cv-on-surface, #222);
}

.wf-review-subtitle {
    font-size: 0.875rem;
    color: var(--cv-muted, #6b7280);
    margin-top: 0.2rem;
}

.wf-review-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: var(--cv-muted, #6b7280);
}

.wf-review-duration::before {
    content: "·";
    margin-right: 0.75rem;
}

.wf-review-abandoned {
    opacity: 0.55;
    border-top: 1px dashed var(--cv-line, #d0d4da);
    padding-top: 0.75rem;
}

.wf-review-abandoned-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--cv-muted, #6b7280);
    margin-bottom: 0.5rem;
}

.wf-review-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: var(--cv-on-surface, #222);
}

.wf-review-group-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--cv-muted, #6b7280);
    padding: 0 0 0.25rem;
}

.wf-review-nested {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-left: 1rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--cv-line, #d0d4da);
}

.wf-step {
    border: 1px solid var(--cv-line, #d0d4da);
    border-radius: var(--cv-radius-s, 6px);
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background: var(--cv-panel, #fff);
    color: var(--cv-on-surface, #222);
}

.wf-step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.wf-step-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wf-step-duration {
    font-size: 0.8em;
    color: var(--cv-muted, #6b7280);
    white-space: nowrap;
}

.wf-step-edit {
    flex-shrink: 0;
    background: transparent;
    border: none;
    border-radius: var(--cv-radius-s, 4px);
    padding: 0.2rem 0.35rem;
    font-size: 0.95em;
    line-height: 1;
    color: var(--cv-muted, #6b7280);
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.15s, background 0.15s;
}

@media (hover: hover) {
    .wf-step-edit:hover {
        opacity: 1;
        background: var(--cv-panel-hover, #f3f4f6);
    }
}

/* Touch devices have no hover to reveal the half-faded pencil, and a
   0.2rem hit area is a fat-thumb miss — show it plainly and give it a
   real tap target. */
@media (pointer: coarse) {
    .wf-step-edit {
        opacity: 0.85;
        padding: 0.35rem 0.55rem;
        font-size: 1.05em;
    }
}

.wf-step-value {
    font-size: 0.9rem;
    color: var(--cv-on-surface, #222);
}

.wf-step-entity {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}


/* ── Mobile adjustments ─────────────────────────────────────────── */

@media (max-width: 480px) {
    .wf-nav-back,
    .wf-nav-next {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* ── Review diagnostics (test-runner aid) ─────────────────────────────────── */

.wf-review-diagnostics {
    margin-top: 1.5rem;
    padding: 0.75rem;
    border: 1px dashed var(--cv-line, #d0d4da);
    border-radius: var(--cv-radius-s, 4px);
    background: var(--cv-panel-muted, #f6f7f9);
}

.wf-review-diagnostics > summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--cv-muted, #6b7280);
}

.wf-review-diagnostics-json {
    margin: 0.5rem 0 0 0;
    padding: 0.5rem 0.75rem;
    max-height: 480px;
    overflow: auto;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
    line-height: 1.45;
    background: var(--cv-panel, #fff);
    border: 1px solid var(--cv-line, #d0d4da);
    border-radius: var(--cv-radius-s, 3px);
    white-space: pre-wrap;
    word-break: break-word;
}

/* =================================================================
   MediaPanel — workflow media thumbnails + lightbox
   ================================================================= */

.wf-media-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--cv-line-2, rgba(0, 0, 0, 0.08));
}

.wf-media-thumb {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
    background: transparent;
    border: 1px solid var(--cv-line-2, rgba(0, 0, 0, 0.1));
    border-radius: var(--cv-radius-s, 0.375rem);
    cursor: zoom-in;
    transition: border-color 0.15s, transform 0.05s;
    max-width: 7rem;
}

@media (hover: hover) {
    .wf-media-thumb:hover {
        border-color: var(--cv-accent);
    }
}

.wf-media-thumb:active {
    transform: scale(0.98);
}

.wf-media-thumb-img {
    width: 100%;
    height: 4.5rem;
    object-fit: cover;
    border-radius: var(--cv-radius-s, 0.25rem);
    display: block;
}

.wf-media-thumb-icon {
    width: 100%;
    height: 4.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--cv-muted, #6b7280);
}

.wf-media-thumb-caption {
    font-size: 0.7rem;
    line-height: 1.2;
    text-align: center;
    color: var(--cv-on-surface);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Lightbox overlay — fills the nearest positioned ancestor (the phone-frame
   .phone-screen in the Portal test panel, the runner page root in standalone
   UI.Runner). Image scales to that container's bounds, not the viewport, so
   the test panel keeps the lightbox inside its phone mockup. */
.wf-media-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 10000;
    cursor: zoom-out;
    overflow: hidden;
}

.wf-media-lightbox {
    position: relative;
    max-width: min(100%, 90rem);
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: default;
    min-height: 0;
    width: 100%;
}

.wf-media-lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--cv-radius-s, 0.25rem);
    display: block;
    min-height: 0;
}

/* ── MediaView — universal renderer (image / video / audio / pdf / file) ── */

.wf-media-view-img,
.wf-media-view-video {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--cv-radius-s, 0.25rem);
    display: block;
}

.wf-media-view-pdf {
    width: 100%;
    height: 80vh;
    overflow: auto;
    border-radius: var(--cv-radius-s, 0.25rem);
    background: var(--cv-surface-hover, #f3f4f6);
}

/* PDF.js paints one canvas per page; stack them centered + scrollable. */
.wf-media-view-pdf-pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px;
}

.wf-media-view-pdf-pages canvas.wf-pdf-page {
    width: 100%;
    max-width: 900px;
    height: auto;
    background: #fff;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
}

.wf-media-view-audio {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    color: #fff;
}

.wf-media-view-audio i {
    font-size: 3rem;
    opacity: 0.3;
}

.wf-media-view-audio audio {
    width: min(100%, 32rem);
}

.wf-media-view-file {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 2rem;
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--cv-radius-s, 0.5rem);
    font-size: 1.125rem;
}

.wf-media-view-file i {
    font-size: 1.5rem;
}

.wf-media-lightbox-link {
    display: inline-flex;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--cv-panel, #fff);
    color: var(--cv-on-surface);
    text-decoration: none;
    border-radius: var(--cv-radius-s, 0.5rem);
    font-size: 1.125rem;
}

.wf-media-lightbox-link i {
    font-size: 1.5rem;
}

.wf-media-lightbox-caption {
    margin-top: 0.75rem;
    color: #fff;
    font-size: 0.875rem;
    text-align: center;
    max-width: 100%;
    padding: 0 0.5rem;
    flex-shrink: 0;
}

/* Title + description stack — both shown on the overlay. */
.wf-media-lightbox-title {
    font-weight: 600;
    font-size: 1rem;
}

.wf-media-lightbox-desc {
    margin-top: 0.2rem;
    font-size: 0.85rem;
    opacity: 0.8;
    line-height: 1.35;
}

/* Close button sits inside the lightbox container at top-right so it stays
   visible regardless of how tight the parent's bounds are (small phone-screen
   in the test panel was clipping the earlier negative-top placement). */
.wf-media-lightbox-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: 0;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
    z-index: 1;
}

@media (hover: hover) {
    .wf-media-lightbox-close:hover {
        background: rgba(0, 0, 0, 0.8);
    }
}


/* ── Files step (StepTypeId=12) — placeholder ─────────────────────── */

.wf-files-capture {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.wf-files-placeholder-banner {
    font-size: 0.8rem;
    color: var(--cv-muted, #6b7280);
    background: var(--cv-surface-subtle, #f8f9fa);
    border: 1px dashed var(--cv-line-light, #d1d5db);
    border-radius: var(--cv-radius-s, 4px);
    padding: 0.4rem 0.75rem;
    margin-bottom: 0.25rem;
}

.wf-files-slot {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--cv-surface-subtle, #f8f9fa);
    border: 1px solid var(--cv-line-light, #e5e7eb);
    border-radius: var(--cv-radius-s, 6px);
}

.wf-files-slot-label {
    font-size: 0.95rem;
    color: var(--cv-on-surface, #222);
    font-weight: 500;
}

.wf-files-required {
    color: var(--cv-danger, #dc3545);
    margin-left: 0.15rem;
}

.wf-files-busy {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: var(--cv-muted, #6b7280);
}

.wf-files-pick {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.6rem 1rem;
    background: var(--cv-surface-raised, #fff);
    border: 1px solid var(--cv-line, #d1d5db);
    border-radius: var(--cv-radius-s, 6px);
    cursor: pointer;
    width: fit-content;
}

.wf-files-pick input[type="file"],
.wf-files-replace input[type="file"] {
    display: none;
}

.wf-files-filled {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.wf-files-preview {
    width: 56px;
    height: 56px;
    overflow: hidden;
    border-radius: var(--cv-radius-s, 6px);
    border: 1px solid var(--cv-line, #d1d5db);
    flex-shrink: 0;
}

.wf-files-preview .wf-media-view-img,
.wf-files-preview .wf-media-view-video {
    width: 56px;
    height: 56px;
    object-fit: cover;
    max-height: none;
}

.wf-files-icon {
    font-size: 1.5rem;
    color: var(--cv-muted, #6b7280);
}

.wf-files-name {
    flex: 1;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wf-files-replace {
    cursor: pointer;
    color: var(--cv-muted, #6b7280);
    padding: 0.25rem;
}

.wf-files-remove {
    background: none;
    border: none;
    color: var(--cv-danger, #dc3545);
    cursor: pointer;
    padding: 0.25rem;
}

.wf-files-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    background: var(--cv-accent, #2563eb);
    color: #fff;
    border: none;
    border-radius: var(--cv-radius-s, 4px);
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}

.wf-files-upload-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

@media (hover: hover) {
    .wf-files-upload-btn:not(:disabled):hover {
        background: var(--cv-accent-hover, #1d4ed8);
    }
}

/* ── AssetItem step (StepTypeId=10) — present/browse assets ───────────── */

.wf-assetitem {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wf-assetitem-loading,
.wf-assetitem-empty {
    color: var(--cv-muted, #6b7280);
    font-size: 0.9rem;
    padding: 0.5rem 0;
}

/* Grid — responsive tiles. */
.wf-assetitem-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    gap: 0.75rem;
}

/* List — vertical rows. */
.wf-assetitem-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wf-assetitem-list .wf-assetitem-tile {
    flex-direction: row;
    align-items: center;
}

.wf-assetitem-list .wf-assetitem-media {
    width: 4rem;
    height: 4rem;
    flex: 0 0 auto;
}

/* Carousel — horizontal scroll. */
.wf-assetitem-carousel {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scroll-snap-type: x mandatory;
}

.wf-assetitem-carousel .wf-assetitem-tile {
    flex: 0 0 12rem;
    scroll-snap-align: start;
}

/* Single — one large HERO asset, centered + front-and-center. */
.wf-assetitem-single {
    display: flex;
    justify-content: center;
}

.wf-assetitem-single .wf-assetitem-tile {
    flex: 0 0 auto;
    width: 100%;
    max-width: 34rem;
    border: none;
    background: transparent;
}

.wf-assetitem-single .wf-assetitem-media {
    aspect-ratio: 16 / 10;
    border-radius: var(--cv-radius-m, 0.75rem);
    box-shadow: 0 0.375rem 1.5rem rgba(0, 0, 0, 0.14);
}

.wf-assetitem-single .wf-assetitem-footer {
    justify-content: center;
    padding-top: 0.5rem;
    font-size: 1rem;
}

.wf-assetitem-tile {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--cv-line, #e5e7eb);
    border-radius: var(--cv-radius-s, 0.5rem);
    overflow: hidden;
    background: var(--cv-panel, #fff);
}

.wf-assetitem-selectable {
    cursor: pointer;
}

@media (hover: hover) {
    .wf-assetitem-selectable:hover {
        border-color: var(--cv-accent, #2563eb);
    }
}

.wf-assetitem-selected {
    border-color: var(--cv-accent, #2563eb);
    box-shadow: 0 0 0 2px var(--cv-accent, #2563eb) inset;
}

.wf-assetitem-media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--cv-panel-muted, #f3f4f6);
    overflow: hidden;
}

.wf-assetitem-media img,
.wf-assetitem-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* A PDF renders its pages tall and can't be object-fit cropped without cutting the
   page. Let the box grow to the content and scroll past a cap instead of clipping
   mid-page inside the fixed image aspect box. */
.wf-assetitem-media.wf-assetitem-media-doc {
    aspect-ratio: auto;
    height: auto;
    max-height: 22rem;
    overflow-y: auto;
    align-items: flex-start;
    background: var(--cv-panel, #fff);
}

.wf-assetitem-single .wf-assetitem-media.wf-assetitem-media-doc {
    max-height: 70vh;
}

.wf-assetitem-media-doc .wf-media-view-pdf,
.wf-assetitem-media-doc .wf-media-view-pdf-pages {
    width: 100%;
}

.wf-assetitem-icon {
    font-size: 2rem;
    color: var(--cv-muted, #6b7280);
}

.wf-assetitem-check {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--cv-accent, #2563eb);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

/* Full-screen affordance on an image / PDF tile (top-left, opposite the select check). */
.wf-assetitem-expand {
    position: absolute;
    top: 0.35rem;
    left: 0.35rem;
    width: 1.6rem;
    height: 1.6rem;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    cursor: pointer;
    z-index: 2;
    transition: background 0.12s ease;
}

@media (hover: hover) {
    .wf-assetitem-expand:hover {
        background: rgba(0, 0, 0, 0.78);
    }
}

/* A PDF title rendered as a full-screen trigger - reads like the name but tappable. */
.wf-assetitem-name-link {
    border: none;
    background: none;
    padding: 0;
    text-align: left;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--cv-accent, #2563eb);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.wf-assetitem-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
}

/* Name + description stack, so the download stays right-aligned. */
.wf-assetitem-text {
    flex: 1 1 auto;
    min-width: 0;               /* lets the children ellipsis inside a flex row */
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.wf-assetitem-name {
    font-size: 0.8rem;
    color: var(--cv-on-surface, #374151);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Caption under the title - smaller + muted, single-line ellipsis when long. */
.wf-assetitem-desc {
    font-size: 0.72rem;
    color: var(--cv-muted, #6b7280);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wf-assetitem-single .wf-assetitem-desc {
    white-space: normal;        /* the hero has room - wrap the caption */
}

.wf-assetitem-download {
    flex: 0 0 auto;
    color: var(--cv-accent, #2563eb);
    text-decoration: none;
}

.wf-assetitem-agree {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--cv-on-surface, #374151);
    cursor: pointer;
}

.wf-assetitem-agree input {
    margin-top: 0.2rem;
}

/* ── CaptureSignature — one screen, one commit (Kirk's comp, 2026-11-14 - docs/internal/signature-rework) ─────────── */

.wf-capture-signature {
    margin-top: 0.75rem;
}

/* THE INSTRUCTION under the heading (the comp's line): how to sign in this mode. Secondary ink - 7.4:1 on the page (the face's
   muted token is below the floor on white in the runner: 3.6:1). */
.wf-signature-sub {
    margin: 0 0 14px;
    font-size: 1rem;
    line-height: 1.4;
    color: var(--cv-on-surface-2, var(--cv-on-surface));
    text-wrap: pretty;
}

/* THE ANSWER IS THE PAD ALONE: the wrapper a design's answer rules paint (the contract's "the control the person fills") holds
   nothing but the pad and wears its radius, so a design's background on it follows the pad's corners; the words under the pad
   sit outside it. */
.wf-signature-answer {
    border-radius: var(--cv-radius-m, 10px);
}

/* THE PAD - a soft field with the line to sign on, never a dashed drop zone. It stays where it is and changes state: the
   border turns the success colour once the mark is a signature (.is-signed), the warn colour after a tap the pad had to
   answer (.is-warn). The whole box claims the finger: no scroll, no rubber-band, no sheet drag starts on its border or hint. */
.wf-signature-pad {
    position: relative;
    height: 212px;
    border: 1.5px solid var(--cv-line);
    border-radius: var(--cv-radius-m, 10px);
    background: var(--cv-surface-subtle, var(--cv-surface));
    /* The pad's ink: the line, the X, the hint and a typed name all read currentColor (the quiet ones through opacity), so a
       design that recolours the pad - colours only, it is a protected moment - recolours what is written on it too. */
    color: var(--cv-on-surface);
    overflow: hidden;
    touch-action: none;
    overscroll-behavior: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    transition: border-color 200ms cubic-bezier(0.22, 1, 0.36, 1), background-color 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* The pad's ring belongs to the typed field alone (the field has no box of its own - the pad is its box); the corner's button
   carries its own ring, so a keyboard user never sees two. */
.wf-signature-pad:has(.wf-signature-typed:focus-visible) {
    border-color: var(--cv-on-surface);
    box-shadow: var(--cv-focus-ring);
}

.wf-signature-pad.is-signed {
    border-color: var(--cv-success);
    background: var(--cv-surface-raised, var(--cv-surface));
}

.wf-signature-pad.is-warn {
    border-color: var(--cv-warning);
}

/* touch-action: none IS LOAD-BEARING, and on an iPhone it is not enough on its own - the RCS web view is a draggable
   sheet and WebKit ignores it mid-stroke, so signaturepad.js also cancels touchstart / touchmove with a non-passive
   listener (Ross, 2026-11-14: the pane slid while he signed the LGH renewal). The selection / callout lines stop a long
   press on the pad turning into a magnifier or a menu instead of ink. The canvas is transparent on screen (the pad's own
   surface shows through); the white ground is baked in only when the PNG is made. */
.wf-signature-canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none; /* pointer events own the strokes - no scroll fight */
    overscroll-behavior: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    cursor: crosshair;
}

.wf-signature-pad.is-typed .wf-signature-canvas {
    visibility: hidden; /* keeps its box - the typed name is painted into it when the PNG is made */
}

/* The line to sign on, like paper, with the X at its left end (an inline SVG). */
.wf-signature-line {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 27%;
    border-bottom: 1.5px solid currentColor;
    opacity: 0.55;
    pointer-events: none;
}

.wf-signature-x {
    position: absolute;
    left: 0;
    bottom: 6px;
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

/* "Sign here" above the line - gone the moment ink lands (the pad's own data-ink, set by the script), in typed mode and
   over a saved signature. The pad's ink through opacity (so a recoloured pad recolours it): .72 reads 5.5:1 on the default
   face's soft field (.62 read 4.1:1 - under the floor; Tests/SignatureMomentTests holds the number). */
.wf-signature-hint {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(27% + 12px);
    text-align: center;
    font-size: 1.0625rem;
    color: inherit;
    opacity: 0.72;
    pointer-events: none;
    user-select: none;
    transition: opacity 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

.wf-signature-pad[data-ink] .wf-signature-hint,
.wf-signature-pad.is-typed .wf-signature-hint,
.wf-signature-pad.has-saved .wf-signature-hint {
    opacity: 0;
}

/* SIGNED - the chip in the top-left corner once the mark is a signature: the success colour mixed toward the PAD'S ink
   (currentColor - a recoloured pad keeps the word readable on it) so the word reads 5.5:1 on its wash over the signed
   white (70% success read 4.4:1 - under the floor; Tests/SignatureMomentTests holds the number). */
.wf-signature-chip {
    position: absolute;
    top: 10px;
    left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px 4px 7px;
    border-radius: 999px;
    background: var(--cv-success-muted);
    color: color-mix(in srgb, var(--cv-success) 55%, currentColor);
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.3;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 200ms cubic-bezier(0.22, 1, 0.36, 1), transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.wf-signature-chip svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.wf-signature-pad.is-signed .wf-signature-chip {
    opacity: 1;
    transform: none;
}

/* START OVER, then UNDO - one text button in the pad's top-right corner. */
.wf-signature-corner {
    position: absolute;
    top: 4px;
    right: 4px;
    min-height: 40px;
    padding: 8px 12px;
    border: 0;
    border-radius: var(--cv-radius-s, 8px);
    background: transparent;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--cv-on-surface);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    cursor: pointer;
    transition: background-color 150ms ease;
}

@media (hover: hover) {
    .wf-signature-corner:hover:not(:disabled) {
        background: var(--cv-surface-hover);
    }
}

.wf-signature-corner:active:not(:disabled) {
    background: var(--cv-surface-active);
}

.wf-signature-corner:focus-visible {
    outline: none;
    box-shadow: var(--cv-focus-ring);
}

.wf-signature-corner:disabled {
    opacity: 0.5;
    cursor: default;
}

/* THE TYPED NAME - the same line, in the handwriting face (the device's own cursive; a design may name its own); the
   placeholder in the body face. 16 px or more on a phone by its size alone (the a11y floor holds it anyway). */
.wf-signature-typed {
    position: absolute;
    left: 44px;
    right: 16px;
    bottom: calc(27% - 2px);
    width: calc(100% - 60px);
    border: 0;
    outline: 0;
    background: none;
    font-family: var(--cv-font-script, "Segoe Script", "Bradley Hand", "Comic Sans MS", cursive);
    font-size: 2.375rem;
    font-weight: 600;
    line-height: 1.1;
    color: inherit;
    caret-color: var(--cv-accent);
}

.wf-signature-typed::placeholder {
    font-family: var(--cv-font-body, inherit);
    font-size: 1.0625rem;
    font-weight: 400;
    line-height: 2.4;
    /* The pad's ink through opacity, like the hint - 5.5:1 on the soft field, and a recoloured pad keeps its placeholder readable. */
    color: currentColor;
    opacity: 0.72;
}

.wf-signature-typed::selection {
    background: var(--cv-accent-muted);
}

/* A SAVED SIGNATURE shows IN the pad - the stored picture in the same box (Start over signs again). */
.wf-signature-saved {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--cv-surface-raised, var(--cv-surface));
}

/* WHAT IS MISSING, said under the pad after a tap on the footer's button - the warn style: the words in ink (4.5:1 on the
   wash), the mark in the warn colour. */
.wf-signature-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: var(--cv-radius-s, 10px);
    background: var(--cv-warning-muted);
    color: var(--cv-on-surface);
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.4;
}

.wf-signature-note svg {
    width: 18px;
    height: 18px;
    flex: none;
    margin-top: 2px;
    fill: none;
    stroke: var(--cv-warning);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Who signs, and what the signature stands for - right under the act. */
.wf-signature-signer {
    margin: 12px 0 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--cv-on-surface);
}

.wf-signature-attest {
    margin-top: 4px;
    font-size: 0.875rem;
    line-height: 1.5;
    /* Secondary ink, 7.4:1 on the page - an attestation is read, not glanced at (the muted token holds 6.5:1 since 2026-11-14). */
    color: var(--cv-on-surface-2, var(--cv-on-surface));
    text-wrap: pretty;
}

.wf-signature-attest p:last-child {
    margin-bottom: 0;
}

/* The switch under the pad: the finger or a typed name. */
.wf-signature-switch {
    display: block;
    margin-top: 14px;
    min-height: 44px;
    padding: 10px 0;
    border: 0;
    border-radius: var(--cv-radius-s, 8px);
    background: none;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--cv-on-surface);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    text-align: start;
    cursor: pointer;
}

.wf-signature-switch:focus-visible {
    outline: none;
    box-shadow: var(--cv-focus-ring);
}

.wf-signature-switch:disabled {
    opacity: 0.5;
    cursor: default;
}

/* THE FOOTER'S BUTTON on a signature moment with nothing signed yet: MUTED, never dead - a tap asks the pad. The button
   carries the state as a mark too (data-cv-state="muted" - RunnerMarks.MutedIf), which is how a DESIGN's own lit-button rule
   knows to step aside (every starter colours the next part in the design layer, above this one, with a :not() on the state);
   this sheet names the class alone - the Portal loads it and never styles a mark. The label is secondary ink on the hover
   grey - 6.3:1 (the runner face's muted token read 2.8:1 on the active grey until 2026-11-14; it holds 5.0:1 now). */
.wf-nav-next.wf-nav-next-muted {
    background: var(--cv-surface-hover);
    border-color: var(--cv-line);
    color: var(--cv-on-surface-2, var(--cv-on-surface));
}

@media (hover: hover) {
    .wf-nav-next.wf-nav-next-muted:hover:not(:disabled) {
        background: var(--cv-surface-active);
        border-color: var(--cv-on-surface-2, var(--cv-on-surface));
    }
}

@media (prefers-reduced-motion: reduce) {
    .wf-signature-pad,
    .wf-signature-hint,
    .wf-signature-chip,
    .wf-signature-corner {
        transition: none;
    }
}

/* ── THE SHEET'S ENDING - "All set" (Kirk's comp webview-done.html, 2026-11-14) ──────────────────────────────────────
   The RCS web view sheet after a locked moment saved: a sharpie arrow pointing at the sheet's own X (its tip sits
   --theme-sheet-x-center from the screen's edge - 43 px on an iPhone, 28 px on Android, set by the runner's boot script),
   a handwritten cue, the check disc, All set, the waiting line, the browser line near the foot and the business's name as
   the footer. The page fills the body edge to edge so the arrow measures from the screen. */
.wf-run-body:has(> .wf-handback-sheet) {
    display: flex;
    flex-direction: column;
}

.wf-handback-sheet {
    position: relative;
    display: flex;
    flex: 1;
    flex-direction: column;
    margin: -1rem;
    text-align: center;
}

.wf-handback-cue {
    position: relative;
    height: 150px;
    flex: none;
}

.wf-handback-arrow {
    position: absolute;
    top: 4px;
    inset-inline-start: calc(var(--cv-sheet-x-center, 43px) - 20px);
    width: 110px;
    height: 100px;
    overflow: visible;
    color: var(--cv-on-surface);
    animation: wf-handback-nudge 1.1s ease-in-out 1.3s 3;
}

.wf-handback-arrow path {
    fill: none;
    stroke: currentColor;
    stroke-width: 5.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
}

.wf-handback-arrow-shaft {
    animation: wf-handback-draw 520ms cubic-bezier(0.22, 1, 0.36, 1) 350ms forwards;
}

.wf-handback-arrow-head {
    animation: wf-handback-draw 220ms cubic-bezier(0.22, 1, 0.36, 1) 820ms forwards;
}

.wf-handback-cue-words {
    position: absolute;
    top: 62px;
    inset-inline-start: calc(var(--cv-sheet-x-center, 43px) + 82px);
    inset-inline-end: 20px;
    margin: 0;
    font-family: var(--cv-font-script, "Segoe Script", "Bradley Hand", "Comic Sans MS", cursive);
    font-size: 1.75rem;
    font-weight: 400;
    line-height: 1.05;
    color: var(--cv-on-surface);
    text-align: start;
    text-wrap: balance;
    transform: rotate(-3deg);
    transform-origin: 0 50%;
    opacity: 0;
    animation: wf-handback-ink 300ms ease-out 900ms forwards;
}

@keyframes wf-handback-draw {
    to { stroke-dashoffset: 0; }
}

@keyframes wf-handback-ink {
    to { opacity: 1; }
}

@keyframes wf-handback-nudge {
    50% { transform: translate(-3px, -5px); }
}

.wf-handback-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 28px 0;
}

.wf-handback-tick {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--cv-success-muted);
    color: var(--cv-success);
}

.wf-handback-tick svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.wf-handback-title {
    margin: 16px 0 0;
    font-size: 2rem;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--cv-on-surface);
}

.wf-handback-waiting {
    margin: 10px 0 0;
    max-width: 30ch;
    font-size: 1.0625rem;
    color: var(--cv-muted);
    text-wrap: pretty;
}

.wf-handback-alt {
    margin: auto 0 0;
    padding: 24px 28px 14px;
    font-size: 0.875rem;
    color: var(--cv-muted);
}

.wf-handback-brand {
    border-top: 1px solid var(--cv-line);
    padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--cv-on-surface);
}

@media (prefers-reduced-motion: reduce) {
    .wf-handback-arrow,
    .wf-handback-arrow path {
        animation: none;
    }

    .wf-handback-arrow path {
        stroke-dashoffset: 0;
    }

    .wf-handback-cue-words {
        animation: none;
        opacity: 1;
    }
}

/* ── Payment capture (StepType 13 — Stripe Payment Element) ─────────────── */
.wf-capture-payment {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 30rem;
    margin: 0 auto;
    width: 100%;
}

/* Amount-due banner: the number is the hero. */
.wf-payment-amount {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.9rem 1.1rem;
    border-radius: var(--cv-radius-m, 14px);
    background: var(--cv-panel, #f6f8fb);
    border: 1px solid var(--cv-line, #c4cad8);
    font-size: 0.95rem;
    color: var(--cv-muted, #8a92a6);
    font-weight: 500;
}

.wf-payment-amount strong {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--cv-on-surface, #1a1a2e);
    letter-spacing: -0.01em;
    line-height: 1;
}

.wf-payment-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--cv-muted, #8a92a6);
    padding: 1.25rem 0;
}

/* The Stripe Element sits in a soft, contained card - feels secure + premium. */
.wf-payment-element:not(:empty) {
    min-height: 1px; /* the Stripe iframe paints its own height once mounted */
    padding: 1rem;
    border-radius: var(--cv-radius-m, 14px);
    background: var(--cv-card-bg, #ffffff);
    border: 1px solid var(--cv-line, #c4cad8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wf-payment-element:focus-within {
    border-color: var(--cv-accent, #1e6091);
    box-shadow: 0 0 0 3px var(--cv-accent-soft, rgba(30, 96, 145, 0.15));
}

/* The pay button: elevated, lockup, satisfying press. Big tap target for mobile. */
.wf-payment-pay {
    width: 100%;
    font: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    border-radius: var(--cv-radius-m, 12px);
    padding: 0.95rem 1rem;
    min-height: 3.1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--cv-accent, #1e6091);
    border: 1px solid var(--cv-accent, #1e6091);
    color: var(--cv-on-accent, #ffffff);
    box-shadow: 0 2px 8px var(--cv-accent-soft, rgba(30, 96, 145, 0.28));
    transition: transform 0.08s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

@media (hover: hover) {
    .wf-payment-pay:hover:not(:disabled) {
        filter: brightness(1.06);
        box-shadow: 0 4px 14px var(--cv-accent-soft, rgba(30, 96, 145, 0.35));
    }
}

.wf-payment-pay:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 1px 5px var(--cv-accent-soft, rgba(30, 96, 145, 0.28));
}

.wf-payment-pay:disabled {
    opacity: 0.65;
    cursor: default;
    box-shadow: none;
}

/* The one-tap button (a card on file - CapturePayment): what the tap does on the first line, the card that pays on a
   quieter second line - never run together. Both faces draw it from here (the Portal through
   _content/UI.Runner.Components/runner.css, go through runner-face.css). */
.wf-payment-onetap {
    flex-direction: column;
    gap: 0.15rem;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
}

.wf-payment-onetap-main,
.wf-payment-onetap-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wf-payment-onetap-card {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0;
}

/* "Use a different card": the secondary button under the pay button - the same shape, quieter, in the accent's ink. */
.wf-payment-different-card {
    width: 100%;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    min-height: 2.75rem;
    padding: 0.65rem 1rem;
    cursor: pointer;
    border-radius: var(--cv-radius-m, 12px);
    background: var(--cv-panel, #ffffff);
    border: 1px solid var(--cv-line, #c4cad8);
    color: var(--cv-accent, #1e6091);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

@media (hover: hover) {
    .wf-payment-different-card:hover:not(:disabled) {
        background: var(--cv-accent-muted, rgba(30, 96, 145, 0.08));
        border-color: var(--cv-accent, #1e6091);
    }
}

.wf-payment-different-card:disabled {
    opacity: 0.65;
    cursor: default;
}

/* Success receipt: a calm, confident confirmation card with an animated check. */
.wf-payment-receipt {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    border: 1px solid var(--cv-success, #2e7d32);
    border-radius: var(--cv-radius-m, 14px);
    padding: 1.1rem 1.2rem;
    background: var(--cv-success-bg, #e9f6ec);
}

.wf-payment-receipt-icon {
    font-size: 1.75rem;
    color: var(--cv-success, #2e7d32);
    line-height: 1;
    animation: wf-pay-pop 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.4) both;
}

@keyframes wf-pay-pop {
    0% { transform: scale(0.4); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.wf-payment-receipt-amount {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--cv-on-surface, #1a1a2e);
    letter-spacing: -0.01em;
}

.wf-payment-receipt-card {
    font-size: 0.9rem;
    color: var(--cv-muted, #8a92a6);
    margin-top: 0.1rem;
}

.wf-payment-receipt-link {
    display: inline-flex;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cv-accent, #1e6091);
    text-decoration: none;
}

@media (hover: hover) {
    .wf-payment-receipt-link:hover {
        text-decoration: underline;
    }
}

/* ────────────────────────────────────────────────────────────────────────────
   E1 — Confirm-to-complete banner. The "review your answers, then confirm"
   gate that the user crosses to fire WorkflowCompleted. Themed via the
   existing --theme-* token set (web + mobile both consume this RCL).
   ──────────────────────────────────────────────────────────────────────── */
.wf-review-confirm {
    margin: 0 0 1rem 0;
    padding: 0.85rem 1rem;
    background: var(--cv-surface-subtle, #f3f6fa);
    border: 1px solid var(--cv-line, #d8dde5);
    border-left: 4px solid var(--cv-accent, #1e6091);
    border-radius: var(--cv-radius-s, 6px);
}
.wf-review-confirm-hint {
    margin: 0;
    color: var(--cv-on-surface, #1a1a2e);
    font-size: 0.95rem;
    line-height: 1.4;
}
.wf-review-confirm-hint strong {
    color: var(--cv-accent, #1e6091);
}
.wf-review-done {
    border-left-color: #2e7d32;
}
.wf-review-done .wf-review-confirm-hint strong {
    color: #2e7d32;
}

/* ============================================================================
   Answer Story - the AnswerStoryView review tree (lifted from UI.Portal's
   app-cards.css so the shared RCL carries its own styling). Renders on Portal
   (Answer Center) AND Mobile (JobDetail Review modal) AND the printable proof
   packet - all three load this RCL's runner.css. The Answer-Center PAGE chrome
   (.ansc-jobcard / .ansc-jobhead / .ansc-grid) and the proof-packet .ansc-print*
   rules stay in UI.Portal/app-cards.css - they are not part of this component.
   ============================================================================ */
.ansc-story { display: flex; flex-direction: column; gap: 0.7rem; padding: 0.25rem 0; }

.ansc-story-header {
    border-bottom: 2px solid var(--cv-accent);
    padding-bottom: 0.55rem;
    margin-bottom: 0.35rem;
}
.ansc-story-name { font-size: 1.2rem; margin: 0 0 0.35rem; color: var(--cv-on-surface-strong); font-weight: 700; display: flex; align-items: center; }
.ansc-story-meta { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.82rem; color: var(--cv-on-surface-2); align-items: center; }
.ansc-story-meta .badge { font-size: 0.72rem; }

/* Loop-iteration / multisplit-leg band */
.ansc-band {
    border: 1px solid var(--cv-line);
    border-radius: var(--cv-radius-m, 0.5rem);
    overflow: hidden;
    background: color-mix(in oklch, var(--cv-accent) 3%, transparent);
}
.ansc-band.is-abandoned { opacity: 0.6; }
.ansc-band-head {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    background: color-mix(in oklch, var(--cv-accent) 10%, transparent);
    border-bottom: 1px solid var(--cv-line);
    color: var(--cv-on-surface-strong); font-size: 0.9rem;
}
.ansc-band-title { font-weight: 700; }
.ansc-band-unit {
    margin-left: auto;
    background: var(--cv-accent); color: var(--cv-on-accent, #fff);
    padding: 0.12rem 0.6rem; border-radius: var(--cv-radius-m, 1rem);
    font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em;
}
.ansc-band-body { display: flex; flex-direction: column; gap: 0.6rem; padding: 0.6rem; }

/* Step card */
.ansc-step {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--cv-line);
    border-radius: var(--cv-radius-m, 0.5rem);
    background: var(--cv-panel, #fff);
}
.ansc-step.is-abandoned { opacity: 0.6; }
.ansc-step.is-internal {
    background: color-mix(in oklch, var(--cv-warning, #f0ad4e) 12%, var(--cv-panel, #fff));
    border-color: color-mix(in oklch, var(--cv-warning, #f0ad4e) 45%, var(--cv-line));
}

.ansc-step-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.ansc-step-headline { display: flex; align-items: baseline; gap: 0.4rem; flex-wrap: wrap; min-width: 0; }
.ansc-step-icon { font-size: 0.9rem; }
.ansc-step-name { font-weight: 700; color: var(--cv-on-surface-strong); font-size: 1rem; }
.ansc-step-stamp { flex: 0 0 auto; font-size: 0.74rem; color: var(--cv-on-surface-2); white-space: nowrap; }

.ansc-internal-badge {
    background: var(--cv-warning, #f0ad4e); color: var(--cv-on-warning, #3a2c00);
    padding: 0.05rem 0.45rem; border-radius: var(--cv-radius-s, 0.25rem);
    font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}

.ansc-step-desc { color: var(--cv-on-surface-2); font-size: 0.85rem; margin: 0.15rem 0 0.3rem; }
.ansc-step-answer { color: var(--cv-on-surface-strong); font-size: 0.97rem; word-break: break-word; margin-top: 0.15rem; }
.ansc-step-answer .ansc-chosen, .ansc-chosen { color: var(--cv-success, #198754); font-weight: 600; }
.ansc-prop em { color: var(--cv-on-surface-2); }

.ansc-note {
    margin-top: 0.4rem;
    padding: 0.3rem 0.55rem;
    border-left: 3px solid var(--cv-second, var(--cv-accent));
    background: color-mix(in oklch, var(--cv-second, var(--cv-accent)) 5%, transparent);
    color: var(--cv-on-surface-strong);
    font-size: 0.88rem; font-style: italic;
    border-radius: 0 var(--cv-radius-s, 0.3rem) var(--cv-radius-s, 0.3rem) 0;
}

/* Entity rollup card */
.ansc-entity-card {
    border: 1px solid var(--cv-line);
    border-radius: var(--cv-radius-s, 0.4rem);
    padding: 0.5rem 0.65rem;
    background: color-mix(in oklch, var(--cv-on-surface-strong) 2%, transparent);
    margin-top: 0.15rem;
}
.ansc-entity-title { font-weight: 600; color: var(--cv-on-surface-strong); font-size: 0.85rem; margin-bottom: 0.35rem; }
.ansc-entity-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.3rem 1rem; }
.ansc-entity-cell { display: flex; flex-direction: column; font-size: 0.9rem; }
.ansc-entity-label { color: var(--cv-on-surface-2); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; }
.ansc-entity-val { color: var(--cv-on-surface-strong); }

/* Media grid */
.ansc-media-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.ansc-tile {
    margin: 0;
    border: 1px solid var(--cv-line);
    border-radius: var(--cv-radius-s, 0.45rem);
    background: var(--cv-panel, #fff);
    overflow: hidden;
    width: 150px;
}
.ansc-tile img { display: block; width: 100%; height: 110px; object-fit: cover; }
.ansc-tile figcaption {
    font-size: 0.7rem; color: var(--cv-on-surface-2);
    padding: 0.22rem 0.4rem; text-align: center;
    border-top: 1px solid var(--cv-line);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ansc-filechip {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.35rem 0.6rem; text-decoration: none; color: var(--cv-on-surface-strong);
}
@media (hover: hover) {
    .ansc-filechip:hover {     background: color-mix(in oklch, var(--cv-accent) 6%, transparent);     }
}

/* AssetItem audit rows — icon + title/description, proof chips. Compact and
   classy by design: the presented assets are curated tenant content, so the
   report shows WHAT was shown + agreed/selected, never the raw media. */
.ansc-assetitems {
    display: flex; flex-direction: column; gap: 0.3rem;
    margin-top: 0.45rem;
}
.ansc-assetitem {
    display: flex; align-items: center; gap: 0.55rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--cv-line);
    border-radius: var(--cv-radius-s, 0.4rem);
    background: color-mix(in oklch, var(--cv-on-surface) 2%, transparent);
}
.ansc-assetitem > i {
    font-size: 1.05rem;
    color: var(--cv-on-surface-2);
    flex: 0 0 auto;
}
.ansc-assetitem-picked {
    border-color: color-mix(in oklch, var(--cv-success, #198754) 45%, var(--cv-line));
    background: color-mix(in oklch, var(--cv-success, #198754) 5%, transparent);
}
.ansc-assetitem-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.ansc-assetitem-name { font-weight: 600; font-size: 0.9rem; color: var(--cv-on-surface-strong); }
.ansc-assetitem-desc {
    font-size: 0.82rem; color: var(--cv-on-surface-2);
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.ansc-assetitem-chip { flex: 0 0 auto; font-size: 0.82rem; white-space: nowrap; }

/* AssetItem audit on the RUN review (web + mobile) — same doctrine, wf- tokens. */
.wf-step-assetitems {
    display: flex; flex-direction: column; gap: 0.3rem;
    margin-top: 0.45rem;
}
.wf-assetitem-agreed {
    color: var(--cv-success, #198754); font-weight: 600; font-size: 0.9rem;
}
.wf-assetitem-row {
    display: flex; align-items: center; gap: 0.55rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--cv-line);
    border-radius: var(--cv-radius-s, 0.4rem);
}
.wf-assetitem-row > i {
    font-size: 1.05rem;
    color: var(--cv-on-surface-2);
    flex: 0 0 auto;
}
.wf-assetitem-picked {
    border-color: color-mix(in oklch, var(--cv-success, #198754) 45%, var(--cv-line));
    background: color-mix(in oklch, var(--cv-success, #198754) 5%, transparent);
}
.wf-assetitem-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.wf-assetitem-name { font-weight: 600; font-size: 0.9rem; color: var(--cv-on-surface-strong); }
.wf-assetitem-desc {
    font-size: 0.82rem; color: var(--cv-on-surface-2);
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.wf-assetitem-chip {
    flex: 0 0 auto; font-size: 0.82rem; white-space: nowrap;
    color: var(--cv-success, #198754); font-weight: 600;
}

.ansc-edit-pencil { color: var(--cv-on-surface-2); font-size: 0.85rem; line-height: 1; }
@media (hover: hover) {
    .ansc-edit-pencil:hover {     color: var(--cv-accent);     }
}

.ansc-story-abandoned { margin-top: 0.4rem; }
.ansc-story-abandoned summary { cursor: pointer; padding: 0.4rem 0.55rem; }
.ansc-story-abandoned-body { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.4rem; }

@media print {
    .ansc-step, .ansc-band { break-inside: avoid; }
    .ansc-internal-badge { border: 1px solid var(--cv-on-warning, #3a2c00); }
}

/* ── RenderAs visual pickers (canvasStyle cards / list) ─────────────────────
   Tap-to-pick tiles over a bundle-sourced list: image (or themed letter
   placeholder), label, authored detail line, UsedPrior badge, selected ring.
   Multi-select properties make tiles checkable (aria-multiselectable). */

.wf-ra-tiles {
    display: grid;
    gap: 0.6rem;
}

.wf-ra-tiles--cards {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.wf-ra-tiles--list {
    grid-template-columns: 1fr;
}

.wf-ra-tile {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem;
    text-align: left;
    background: var(--cv-panel, #ffffff);
    color: var(--cv-on-surface, #111827);
    border: 1px solid var(--cv-line, #e5e7eb);
    border-radius: var(--cv-radius-m, 10px);
    cursor: pointer;
    position: relative;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.wf-ra-tiles--cards .wf-ra-tile {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 0;
    overflow: hidden;
}

@media (hover: hover) {
    .wf-ra-tile:hover {
        border-color: var(--cv-accent, #2563eb);
    }
}

.wf-ra-tile--selected {
    border-color: var(--cv-accent, #2563eb);
    box-shadow: 0 0 0 2px var(--cv-accent-soft, #dbeafe);
}

.wf-ra-tile-media {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: calc(var(--cv-radius-m, 10px) - 4px);
    background: var(--cv-panel-muted, #f3f4f6);
    overflow: hidden;
}

.wf-ra-tiles--cards .wf-ra-tile-media {
    width: 100%;
    height: 96px;
    border-radius: 0;
}

.wf-ra-tile-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wf-ra-tile-letter {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--cv-accent, #2563eb);
}

.wf-ra-tile-body {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    flex: 1 1 auto;
}

.wf-ra-tiles--cards .wf-ra-tile-body {
    padding: 0.45rem 0.55rem 0.6rem;
    align-items: center;
}

.wf-ra-tile-label {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wf-ra-tile-detail {
    font-size: 0.82rem;
    color: var(--cv-muted, #6b7280);
    overflow: hidden;
    text-overflow: ellipsis;
}

.wf-ra-tile-used {
    align-self: flex-start;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: var(--cv-panel-muted, #f3f4f6);
    color: var(--cv-muted, #6b7280);
    border: 1px solid var(--cv-line, #e5e7eb);
}

.wf-ra-tiles--cards .wf-ra-tile-used {
    align-self: center;
}

/* EACH CARD ITS OWN BUTTON (messaging.cardButtonField, 2026-11-08) - a row's own words ("Clip", "Buy", "Get it") as a small tag
   on its tile, so a mixed shelf says what each tap does. The tile stays the one button; the tag is words, never a second target. */
.wf-ra-tile-action {
    align-self: flex-start;
    margin-top: 0.2rem;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.08rem 0.5rem;
    border-radius: 999px;
    color: var(--cv-accent, #2563eb);
    border: 1px solid var(--cv-accent, #2563eb);
    background: var(--cv-panel-muted, #f3f4f6);
}

.wf-ra-tiles--cards .wf-ra-tile-action {
    align-self: center;
}

.wf-ra-tile-check {
    display: none;
    color: var(--cv-accent, #2563eb);
    flex: 0 0 auto;
    font-size: 1.05rem;
}

.wf-ra-tiles--cards .wf-ra-tile-check {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--cv-accent, #2563eb);
    color: var(--cv-panel, #ffffff);
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.wf-ra-tile--selected .wf-ra-tile-check {
    display: flex;
}

/* ── Review — media constraints + the document row ──────────────────
   The review is a RECAP: inline media (image/video/audio) stays in a
   constrained box on any screen; documents render as an icon + title +
   open link (never inlined - the 200-page-handbook lesson). */

.wf-step-media-item {
    max-width: 480px;
}

.wf-step-media-item img,
.wf-step-media-item video,
.wf-step-media-item audio,
.wf-step-media-item canvas,
.wf-step-media-item iframe {
    max-width: 100%;
    max-height: 320px;
    object-fit: contain;
}

.wf-review-doc-row {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--cv-line, #e2e6eb);
    border-radius: var(--cv-radius-m, 8px);
    background: var(--cv-surface-subtle, #f6f7f9);
    color: var(--cv-on-surface, #1f2328);
    text-decoration: none;
    max-width: 100%;
}

@media (hover: hover) {
    .wf-review-doc-row:hover {
        border-color: var(--cv-accent, #2563eb);
        color: var(--cv-accent, #2563eb);
    }
}

.wf-review-doc-row > i:first-child {
    font-size: 1.15rem;
    flex-shrink: 0;
}

.wf-review-doc-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    font-size: 0.85rem;
    font-weight: 600;
}

.wf-review-doc-open {
    flex-shrink: 0;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* ═══ THE CANVAS — the run-surface presentation skin (hero + background) ═══
   Painted by the host shells from WorkflowRunner.GetPresentation(): portal
   RunHost renders the hero SPLIT (image column beside the content, flipping
   for heroRight, collapsing to a top banner on small widths); mobile RunPage
   renders the hero BANNER above the step. The hero swaps per step via
   renderAs.hero — "the step tells the canvas: use this background now." */

.wf-hero-split {
    display: flex;
    align-items: stretch;
    justify-content: center;
    width: min(100%, 1400px);
    min-height: 0;
    gap: 1.25rem;
}

.wf-hero-split.wf-hero-off .wf-hero-side {
    display: none;
}

.wf-hero-side {
    flex: 1 1 44%;
    max-width: 46%;
    min-width: 0;
    overflow: hidden;
    border-radius: var(--cv-radius-m, 14px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.16);
}

.wf-hero-side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wf-hero-right .wf-hero-side {
    order: 2;
}

.wf-hero-content {
    flex: 1 1 56%;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

@media (max-width: 900px) {
    /* Small widths: the hero image collapses to a TOP HEADER band. */
    .wf-hero-split {
        flex-direction: column;
        gap: 0.75rem;
    }

    .wf-hero-side,
    .wf-hero-right .wf-hero-side {
        order: 0;
        flex: 0 0 auto;
        max-width: 100%;
        height: 160px;
    }
}

/* The mobile / small-surface hero BANNER (above the step content). The image
   SHRINKS TO FIT (contain, natural height up to the cap) - never an odd crop
   through the middle of the art. */
.wf-hero-banner {
    flex: 0 0 auto;
    max-height: 320px;
    overflow: hidden;
}

.wf-hero-banner img {
    width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: contain;
    display: block;
}

/* WIDE viewports honor the skin's hero SPLIT on the mobile shell too: the
   banner becomes a full-height side column beside the step (heroRight flips
   it), mirroring ConversationRunHost's wf-hero-split. Under 900px the rules
   above keep the phone's top-band look. */
@media (min-width: 900px) {
    .wf-run-page.wf-hero-layout-left,
    .wf-run-page.wf-hero-layout-right {
        display: flex;
        align-items: stretch;
        min-height: 100dvh;
    }

    .wf-run-page.wf-hero-layout-left .wf-hero-banner,
    .wf-run-page.wf-hero-layout-right .wf-hero-banner {
        flex: 1 1 44%;
        max-width: 46%;
        max-height: none;
        min-width: 0;
    }

    .wf-run-page.wf-hero-layout-left .wf-hero-banner img,
    .wf-run-page.wf-hero-layout-right .wf-hero-banner img {
        width: 100%;
        height: 100%;
        max-height: none;
        object-fit: cover;
    }

    .wf-run-page.wf-hero-layout-right .wf-hero-banner {
        order: 2;
    }

    .wf-run-page.wf-hero-layout-left .wf-run-body,
    .wf-run-page.wf-hero-layout-right .wf-run-body {
        flex: 1 1 56%;
        min-width: 0;
    }
}

/* Canvas background tokens (Workflow.PresentationJson "background"). */
.wf-canvas-bg-subtle {
    background: var(--cv-surface-subtle);
}

.wf-canvas-bg-primary {
    background: color-mix(in srgb, var(--cv-accent) 10%, var(--cv-surface));
}

.wf-canvas-bg-transparent {
    background: transparent;
}

/* -- Location step (StepTypeId 14) -------------------------------------- */

.wf-location-step {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--cv-surface-subtle, #f8f9fa);
    border-radius: var(--cv-radius-s, 6px);
    border-left: 3px solid var(--cv-accent, #2563eb);
}

.wf-location-fix {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 1.05rem;
    color: var(--cv-on-surface, #222);
}

.wf-location-coords {
    font-family: var(--cv-font-mono, monospace);
    font-weight: 600;
}

.wf-location-source {
    color: var(--cv-muted, #6b7280);
    font-size: 0.85rem;
    margin-left: 0.35rem;
}

.wf-location-share,
.wf-location-refresh,
.wf-location-manual-use {
    align-self: flex-start;
    padding: 0.5rem 1rem;
    border: 1px solid var(--cv-accent, #2563eb);
    border-radius: var(--cv-radius-s, 6px);
    background: var(--cv-accent, #2563eb);
    color: var(--cv-on-accent, #fff);
    cursor: pointer;
}

.wf-location-refresh {
    background: transparent;
    color: var(--cv-accent, #2563eb);
}

.wf-location-share:disabled,
.wf-location-refresh:disabled,
.wf-location-manual-use:disabled {
    opacity: 0.5;
    cursor: default;
}

.wf-location-unavailable {
    color: var(--cv-muted, #6b7280);
    font-size: 0.9rem;
}

.wf-location-manual-hint {
    color: var(--cv-muted, #6b7280);
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

.wf-location-manual-row {
    display: flex;
    gap: 0.5rem;
}

.wf-location-manual-input {
    flex: 1;
    min-width: 0;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--cv-line, #d1d5db);
    border-radius: var(--cv-radius-s, 6px);
    background: var(--cv-surface, #fff);
    color: var(--cv-on-surface, #222);
    font-family: var(--cv-font-mono, monospace);
}

/* -- ContactCard step (StepTypeId 15) ------------------------------------ */

.wf-contact-step {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wf-contact-card {
    display: flex;
    gap: 0.9rem;
    padding: 1rem;
    background: var(--cv-surface-subtle, #f8f9fa);
    border: 1px solid var(--cv-line, #d1d5db);
    border-radius: var(--cv-radius-s, 8px);
}

.wf-contact-avatar {
    font-size: 2.4rem;
    color: var(--cv-accent, #2563eb);
    line-height: 1;
}

.wf-contact-fields {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.wf-contact-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--cv-on-surface, #222);
}

.wf-contact-org {
    color: var(--cv-muted, #6b7280);
    font-size: 0.9rem;
}

.wf-contact-row {
    display: flex;
    align-items: center;
    color: var(--cv-on-surface, #222);
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}

.wf-contact-row a {
    color: var(--cv-accent, #2563eb);
    text-decoration: none;
}

.wf-contact-notes {
    margin-top: 0.35rem;
    color: var(--cv-muted, #6b7280);
    font-size: 0.9rem;
    line-height: 1.5;
}

.wf-contact-download {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border: 1px solid var(--cv-accent, #2563eb);
    border-radius: var(--cv-radius-s, 6px);
    background: var(--cv-accent, #2563eb);
    color: var(--cv-on-accent, #fff);
    text-decoration: none;
}

/* -- The run view's honest notice (UI.Runner.Components/Shell/ConversationRunView, 2026-10-01) --
   The step-boundary refresh of a conversation that opted into contextRefresh "stepBoundary" did not
   happen, so the moment may not show the newest changes. Quiet, never alarming: the run carries on. */

.wf-run-notice {
    margin: 0 0 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--cv-warning-muted, #fef9c3);
    border-radius: var(--cv-radius-s, 6px);
    color: var(--cv-warning, #b45309);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* -- The slim runner's honest failure (ConversationRunView with a Handoff, 2026-10-02) --
   A save or completion that did not land: say so, keep the answer, offer Retry. */
.wf-run-notice.wf-run-notice-error {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    background: var(--cv-danger-muted, #fdecea);
    color: var(--cv-danger, #dc3545);
}

.wf-run-notice-error > span {
    flex: 1 1 12rem;
}

.wf-run-notice-retry {
    border: 1px solid currentColor;
    border-radius: var(--cv-radius-s, 6px);
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    cursor: pointer;
}

.wf-run-notice-retry:disabled {
    opacity: 0.6;
    cursor: default;
}

/* -- The Action moment (StepType 16, PLAN 3.9, 2026-10-02) --
   The server runs the action; the browser only waits, with the moment's own line (ConversationRunView.Actions.cs). */
.wf-action-waiting {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 0;
    text-align: center;
}

.wf-action-waiting-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--cv-on-surface, #111827);
}

.wf-action-waiting-line {
    margin: 0;
    color: var(--cv-muted, #6b7280);
    font-size: 0.95rem;
    line-height: 1.4;
}

/* The hand-back and identity panels' secondary actions sit under the primary one. */
.wf-handback-continue,
.wf-identity-back {
    margin-top: 0.75rem;
}

/* -- THE KIT VISIT (the slim runner, runner contract item 11 - RunVisitPanel) --
   Under "complete": what comes next for this person in this job. One card + Continue, or a short menu. */
.wf-visit {
    margin: 0 0 1rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--cv-line, #e5e7eb);
    border-radius: var(--cv-radius-m, 10px);
    background: var(--cv-surface, #ffffff);
    color: var(--cv-on-surface, #111827);
}

.wf-visit-looking {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--cv-on-surface-2, #6b7280);
    font-size: 0.9rem;
}

.wf-visit-kicker {
    margin: 0 0 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--cv-on-surface-2, #6b7280);
}

.wf-visit-stage {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.6rem;
    margin-bottom: 0.75rem;
}

.wf-visit-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--cv-on-surface-strong, #111827);
    overflow-wrap: anywhere;
}

.wf-visit-place {
    font-size: 0.8rem;
    color: var(--cv-on-surface-2, #6b7280);
    white-space: nowrap;
}

.wf-visit-go {
    width: 100%;
}

.wf-visit-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wf-visit-option {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.6rem;
    width: 100%;
    min-height: 44px;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--cv-line, #e5e7eb);
    border-radius: var(--cv-radius-s, 6px);
    background: var(--cv-surface-subtle, #f9fafb);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

@media (hover: hover) {
    .wf-visit-option:hover:not(:disabled) {
        background: var(--cv-surface-hover, #f3f4f6);
    }
}

.wf-visit-option:disabled {
    opacity: 0.6;
    cursor: default;
}

.wf-visit-option .wf-visit-name {
    flex: 1 1 10rem;
    font-size: 0.95rem;
}

.wf-visit-option-cta {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cv-accent, #2563eb);
}

.wf-visit-note {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--cv-on-surface, #111827);
}

/* An AUTOMATIC hand-off (R33): "Up next" is said, then the next conversation opens with no tap. */
.wf-visit-starting {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--cv-on-surface-2, #6b7280);
}

.wf-visit .wf-run-notice {
    margin: 0.75rem 0 0;
}

/* -- TEXT ME INSTEAD (the slim runner, runner contract item 13 - RunTextMePanel) --
   A quiet link under the moment; the panel takes the body over like the identity gate. */
.wf-textme-entry {
    display: flex;
    justify-content: center;
    margin-top: 1.25rem;
}

.wf-textme-link {
    border: none;
    background: none;
    padding: 0.5rem 0.75rem;
    min-height: 44px;
    color: var(--cv-accent, #2563eb);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.wf-textme {
    gap: 0;
}

.wf-textme-label {
    display: block;
    width: 100%;
    max-width: 22rem;
    margin: 1.25rem 0 0.35rem;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cv-on-surface, #111827);
}

.wf-textme-input {
    width: 100%;
    max-width: 22rem;
    min-height: 44px;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--cv-line, #d1d5db);
    border-radius: var(--cv-radius-s, 6px);
    background: var(--cv-surface, #ffffff);
    color: var(--cv-on-surface, #111827);
    font: inherit;
    font-size: 1rem;
    box-sizing: border-box;
}

.wf-textme-code {
    letter-spacing: 0.25em;
    text-align: center;
}

.wf-textme-fineprint {
    width: 100%;
    max-width: 22rem;
    margin: 0.5rem 0 0;
    text-align: left;
    font-size: 0.75rem;
    color: var(--cv-on-surface-2, #6b7280);
}

.wf-textme-secondary {
    margin-top: 0.75rem;
}

.wf-textme-error {
    width: 100%;
    max-width: 22rem;
    margin: 0.75rem 0 0;
    box-sizing: border-box;
    text-align: left;
}

/* -- CONTINUE ON YOUR PHONE (the continuity pass, phase 1 - RunTextMePanel's Pass step) --
   The ready-made messages as buttons; on a wide screen (a desktop) the QR and the pass in large type to send by hand. */
.wf-pass-sends {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    max-width: 22rem;
    margin-top: 1rem;
}

.wf-pass-send {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}

.wf-pass-desk {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 22rem;
    margin-top: 1.25rem;
}

.wf-pass-qr {
    width: 176px;
    height: 176px;
    padding: 0.5rem;
    border: 1px solid var(--cv-line, #d1d5db);
    border-radius: var(--cv-radius-s, 6px);
    background: var(--cv-surface, #ffffff); /* the QR's own SVG paints its light modules white */
}

.wf-pass-code {
    margin: 0.5rem 0 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--cv-on-surface, #111827);
    user-select: all;
}

@media (min-width: 720px) {
    .wf-pass-desk {
        display: flex;
    }
}

/* ON A COMPUTER (2026-11-04 - the DEVICE decides, never the page width: RunTextMePanel's OnAComputer over
   Workflow.Runner/Models/ContinuityLayout, "(hover: hover) and (pointer: fine)" read once at boot). The QR first and big,
   the pass under it, "Your conversation will be waiting for you.", a rule, "Can't scan?" with the one button. */
.wf-pass-desktop {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 22rem;
}

.wf-pass-desk--first {
    display: flex;
    margin-top: 0.75rem;
}

.wf-pass-desk--first .wf-pass-qr {
    width: 208px;
    height: 208px;
}

.wf-pass-center {
    text-align: center;
}

.wf-pass-waiting {
    margin: 0.75rem 0 0;
    font-weight: 600;
    text-align: center;
    color: var(--cv-on-surface, #111827);
}

.wf-pass-rule {
    width: 100%;
    margin: 1rem 0 0.25rem;
    border: 0;
    border-top: 1px solid var(--cv-line, #d1d5db);
}

.wf-pass-mac {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--cv-on-surface-2, #6b7280);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* A failed upload keeps the picked file: the retry sits under the error. */
.wf-capture-retry {
    margin-top: 0.4rem;
    border: 1px solid var(--cv-line, #d1d5db);
    border-radius: var(--cv-radius-s, 6px);
    background: var(--cv-surface, #ffffff);
    color: var(--cv-on-surface, #111827);
    font-size: 0.85rem;
    padding: 0.3rem 0.75rem;
    cursor: pointer;
}

.wf-capture-retry:disabled {
    opacity: 0.6;
    cursor: default;
}

/* -- The static transcript (UI.Runner.Components/Shell/ConversationTranscript, portal-look-and-feel 2.2 section 4) --
   The first moments of a conversation the way the customer reads them - a PICTURE, not a run. Every class is run-tx-*
   and owned by this file. Tokens only (Tests/ShellTokensOnlyTests reads this region): it reads the shared --wf-*
   tokens where a host defines them and falls back to mixes of --theme-* where it does not (the consumer runner).
   A token is a LABEL chip, never [[...]] (TranscriptText). */
/* @tokens-only */
.run-tx {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: var(--cv-surface);
    color: var(--cv-on-surface);
    font-family: var(--cv-font-body);
}

.run-tx-head {
    display: flex;
    flex: none;
    align-items: center;
    gap: 7px;
    min-height: 40px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--wf-line, var(--cv-line));
    color: var(--cv-on-surface-strong);
    font-size: 12px;
    font-weight: 650;
}

.run-tx-mark {
    display: grid;
    flex: none;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--wf-primary-soft, color-mix(in srgb, var(--cv-accent) 13%, var(--cv-surface)));
    color: var(--wf-primary-ink, color-mix(in oklab, var(--cv-accent) 62%, var(--cv-on-surface-strong)));
    font-size: 10.5px;
    font-weight: 700;
}

.run-tx-brand {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.run-tx-verified {
    flex: none;
    color: var(--wf-primary-ink, color-mix(in oklab, var(--cv-accent) 62%, var(--cv-on-surface-strong)));
    font-size: 12px;
}

.run-tx-channel {
    flex: none;
    margin-left: auto;
    color: var(--cv-muted);
    font-size: 11px;
    font-weight: 500;
}

.run-tx-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    padding: 12px 10px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, var(--cv-on-surface) 78%, transparent);
    mask-image: linear-gradient(to bottom, var(--cv-on-surface) 78%, transparent);
}

.run-tx-msg,
.run-tx-me {
    max-width: 90%;
    padding: 8px 11px;
    font-size: 12.5px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.run-tx-msg {
    align-self: flex-start;
    border-radius: 16px 16px 16px 5px;
    background: color-mix(in srgb, var(--cv-surface), var(--cv-on-surface) 8%);
    color: var(--cv-on-surface);
}

.run-tx-me {
    align-self: flex-end;
    max-width: 80%;
    border-radius: 16px 16px 5px 16px;
    background: var(--wf-primary-soft, color-mix(in srgb, var(--cv-accent) 13%, var(--cv-surface)));
    color: var(--cv-on-surface-strong);
}

.run-tx-tok {
    padding: 0 5px;
    border-radius: 5px;
    background: var(--wf-primary-soft, color-mix(in srgb, var(--cv-accent) 13%, var(--cv-surface)));
    color: var(--wf-primary-ink, color-mix(in oklab, var(--cv-accent) 62%, var(--cv-on-surface-strong)));
    font-weight: 600;
}

.run-tx-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.run-tx-chip {
    padding: 3px 10px;
    border: 1px solid color-mix(in srgb, var(--wf-primary-ink, var(--cv-accent)) 45%, transparent);
    border-radius: 999px;
    background: var(--cv-surface);
    color: var(--wf-primary-ink, color-mix(in oklab, var(--cv-accent) 62%, var(--cv-on-surface-strong)));
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.run-tx-chip.is-more {
    border-style: dashed;
    color: var(--cv-muted);
}

.run-tx-media {
    display: grid;
    place-items: center;
    align-self: flex-start;
    width: 78%;
    height: 72px;
    border-radius: 14px;
    background: var(--wf-inset, color-mix(in srgb, var(--cv-surface), var(--cv-on-surface) 6%));
    color: var(--cv-muted);
    font-size: 22px;
}
/* @end-tokens-only */

/* @tokens-only */
/* MARKDOWN IN A DESCRIPTION (docs/claude/MARKDOWN.md section 6) - the safe HTML RichStepText.Description renders
   (the welcome card, the moment's detail, the Details overlay, an Info moment's body). A plain sentence is ONE
   paragraph and must read exactly as the old pipeline's text did: no margin around a lone paragraph, the
   container's own type and colour, and white-space back to normal (the overlay's pre-wrap would double every
   line break the HTML carries). Lists, headings, quotes, code and tables sit quietly in the same voice. */
.wf-md {
    white-space: normal;
}

.wf-md > :first-child {
    margin-top: 0;
}

.wf-md > :last-child {
    margin-bottom: 0;
}

.wf-md p {
    margin: 0 0 0.6em;
}

.wf-md ul,
.wf-md ol {
    margin: 0 0 0.6em;
    padding-left: 1.4em;
}

.wf-md li + li {
    margin-top: 0.15em;
}

.wf-md h3,
.wf-md h4,
.wf-md h5,
.wf-md h6 {
    margin: 0.8em 0 0.35em;
    font-size: 1em;
    font-weight: 700;
    line-height: 1.3;
    color: var(--cv-on-surface-strong, var(--cv-on-surface));
}

.wf-md h3 {
    font-size: 1.1em;
}

.wf-md blockquote {
    margin: 0 0 0.6em;
    padding-left: 0.8em;
    border-left: 3px solid var(--cv-line);
    color: var(--cv-muted);
}

.wf-md code {
    padding: 0 0.25em;
    border-radius: 4px;
    background: var(--cv-surface-subtle);
    font-family: var(--cv-font-mono, monospace);
    font-size: 0.9em;
}

.wf-md pre {
    margin: 0 0 0.6em;
    padding: 0.6em 0.8em;
    border-radius: 6px;
    background: var(--cv-surface-subtle);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.wf-md pre code {
    padding: 0;
    background: none;
}

.wf-md a {
    color: var(--cv-accent);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    overflow-wrap: anywhere;
}

.wf-md img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.wf-md hr {
    margin: 0.8em 0;
    border: 0;
    border-top: 1px solid var(--cv-line);
}

.wf-md table {
    width: 100%;
    margin: 0 0 0.6em;
    border-collapse: collapse;
    font-size: 0.9em;
}

.wf-md th,
.wf-md td {
    padding: 0.3rem 0.6rem;
    border-bottom: 1px solid var(--cv-line);
    text-align: left;
}
/* @end-tokens-only */
}

/* -- ../../UI.Runner.Components/wwwroot/run-host.css (every --theme-* read mapped to its design token by design/src/runner/theme-map.json) -- */
@layer cv.components {
/* =====================================================================================================================
   THE RUN SHELL'S CHROME - ConversationRunHost + RunnerPhoneFrame (UI.Runner.Components/Shell), for a host that renders
   the shared run host OUTSIDE the Portal: the slim runner on go.rcsbuilder.com (UI.Runner links this file).

   The same rules the Portal's css/runner-panel.css carries for its /run/{id} page (the phone frame, the run host, the
   widescreen card, the embedded containment, the canvas), brought into the RCL when the second host adopted the shell
   (docs/claude/BlazorConventions.md - "The run view lives in the runner RCL"). The Portal keeps its own copy for now
   (zero change to the Portal's cascade); retiring that copy - link this file from the Portal and delete the duplicate -
   is a separate, visually verified change. Colours read --theme-* tokens with a literal fallback (the RCL convention) -
   go's runner reads them as its design tokens, mapped while Tools/DesignBundle bundles runner-face.css (runner.css's
   header says how); the device bezel is device-black on purpose, whatever the tenant theme, until a design sets one.
   ===================================================================================================================== */

/* -- The toolbar buttons (widescreen toggle) ------------------------------------------------------------------------ */

.runner-panel-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: var(--cv-radius-s, 4px);
    background: transparent;
    color: var(--cv-muted, #6b7280);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 150ms ease, color 150ms ease;
    text-decoration: none;
    flex-shrink: 0;
}

@media (hover: hover) {
    .runner-panel-btn:hover {
        background: var(--cv-surface-hover, #f3f4f6);
        color: var(--cv-on-surface, #111827);
    }
}

/* -- The phone frame -------------------------------------------------------------------------------------------------- */

.phone-frame {
    width: 375px;
    height: min(calc(100vh - 9rem), 720px);
    background: var(--cv-device-frame, #1c1c1e);
    border-radius: 44px;
    box-shadow:
        0 0 0 1px var(--cv-device-edge, #3a3a3c),
        0 0 0 3px var(--cv-device-frame, #1c1c1e),
        0 16px 48px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

/* Dynamic island notch */
.phone-notch {
    height: 36px;
    background: var(--cv-device-frame, #1c1c1e);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 2px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.phone-notch-pill {
    width: 126px;
    height: 34px;
    background: var(--cv-device-island, #000000);
    border-radius: 0 0 20px 20px;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

/* Screen - the run page fills it exactly; ONLY the moment body scrolls, so the footer is always visible. */
.phone-screen {
    flex: 1;
    min-height: 0;
    background: var(--cv-surface, #ffffff);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.phone-screen .wf-run-page {
    flex: 1;
    height: auto;
    min-height: 0;
}

.phone-screen .wf-run-body {
    overflow-y: auto;
    min-height: 0;
}

/* The error branch has no body - let it grow so the footer stays pinned. */
.phone-screen .wf-run-error {
    flex: 1 1 auto;
}

/* Home indicator */
.phone-home-bar {
    height: 30px;
    background: var(--cv-device-frame, #1c1c1e);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.phone-home-bar::after {
    content: '';
    width: 120px;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

/* -- The run host ----------------------------------------------------------------------------------------------------- */

/* The host takes EXACTLY the area its page hands it (flex, never viewport math); only .wf-run-body scrolls. */
.run-host {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 0.25rem 1rem 1.25rem;
    background:
        radial-gradient(1100px 520px at 50% -8%, color-mix(in srgb, var(--cv-accent, #1a6b3c) 7%, transparent), transparent 60%),
        var(--cv-surface-subtle, #f8fafc);
}

.run-host-toolbar {
    width: 100%;
    max-width: 1100px;
    display: flex;
    justify-content: flex-end;
    gap: 0.25rem;
    padding: 0.3rem 0;
    flex-shrink: 0;
}

.run-host-stage {
    flex: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: stretch;
    min-height: 0;
}

/* The standalone frame is the LARGE one; its height rides the flex chain, capped at phone height. */
.phone-frame.phone-frame-lg {
    width: 430px;
    height: auto;
    max-height: 932px;
    min-height: 0;
}

/* Widescreen - the SAME shell element (the run never remounts on toggle), bezel hidden, a wide working card. */
.run-shell-wide {
    width: min(100%, 1100px);
    height: auto;
    max-height: 932px;
    min-height: 0;
    background: var(--cv-surface, #ffffff);
    border: 1px solid var(--cv-line, #e5e7eb);
    border-radius: var(--cv-radius-m, 8px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.16);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.run-shell-wide .phone-notch,
.run-shell-wide .phone-home-bar {
    display: none;
}

/* Embedded (a host frames the runner - embed=1, or framed at all): full-bleed and bezel-less at ANY size. */
.run-host.run-host-embedded {
    padding: 0;
    background: var(--cv-surface, #ffffff);
}

.run-host-embedded .run-host-stage .phone-frame.phone-frame-lg,
.run-host-embedded .run-host-stage .run-shell-wide {
    width: 100%;
    max-height: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: var(--cv-surface, #ffffff);
}

.run-host-embedded .run-host-stage .phone-notch,
.run-host-embedded .run-host-stage .phone-home-bar {
    display: none;
}

/* On a phone the device IS the frame: full-bleed, no bezel, no toolbar. ONE responsive page for web and mobile. */
@media (max-width: 560px) {
    .run-host {
        padding: 0;
        background: var(--cv-surface, #ffffff);
    }

    .run-host-toolbar {
        display: none;
    }

    .run-host-stage .phone-frame.phone-frame-lg,
    .run-host-stage .run-shell-wide {
        width: 100%;
        max-height: none;
        border: none;
        border-radius: 0;
        box-shadow: none;
        background: var(--cv-surface, #ffffff);
    }

    .run-host-stage .phone-frame .phone-notch,
    .run-host-stage .phone-frame .phone-home-bar {
        display: none;
    }

    .run-host:not(.run-host-embedded) .run-host-stage .wf-hero-side {
        display: none;
    }
}

/* -- THE CANVAS on the run host (Workflow.PresentationJson) ------------------------------------------------------------ */

.run-host.wf-canvas-bg-subtle {
    background: var(--cv-surface-subtle, #f8fafc);
}

.run-host.wf-canvas-bg-primary {
    background: color-mix(in srgb, var(--cv-accent, #1a6b3c) 10%, var(--cv-surface, #ffffff));
}

.run-host.wf-canvas-bg-transparent {
    background: transparent;
}

/* The wide shell fills its hero column instead of its own 1100px cap. */
.run-host-stage .wf-hero-content .run-shell-wide {
    width: 100%;
}

/* The hero column caps at the content card's height so the two bottoms stay flush on tall monitors. */
.run-host-stage .wf-hero-side {
    max-height: 932px;
}

/* An embed renders the hero like any other canvas; full-bleed embeds cap nothing. */
.run-host-embedded .run-host-stage .wf-hero-side {
    max-height: none;
}
}
