/* =================================================================
 * 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(--theme-primary-soft, #dbeafe);
    color: var(--theme-primary, #2563eb);
    border-radius: 999px;
    align-self: flex-start;
}

.wf-step-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--theme-text-emphasis, var(--theme-text));
    line-height: 1.35;
}

.wf-step-title {
    font-size: 0.9rem;
    color: var(--theme-text-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(--theme-radius, 0.75rem);
    border: 1px solid var(--theme-border, transparent);
    background: var(--theme-surface-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(--theme-primary, #2563eb);
    background: transparent;
    border: 1px solid var(--theme-primary, #2563eb);
    border-radius: var(--theme-radius, 0.75rem);
    max-width: 100%;
    overflow-wrap: anywhere;
}

.wf-step-link:focus-visible {
    background: var(--theme-primary-soft, #dbeafe);
    text-decoration: none;
}

@media (hover: hover) {
    .wf-step-link:hover {
        background: var(--theme-primary-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(--theme-text-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(--theme-primary, #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(--theme-primary, #2563eb);
    border-radius: 0 8px 8px 0;
    background: var(--theme-background-subtle, rgba(0, 0, 0, 0.03));
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--theme-text, #111827);
    overflow-wrap: anywhere;
}

.wf-step-detail-rich a {
    color: var(--theme-primary, #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(--theme-border, #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(--theme-primary, #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(--theme-surface, #ffffff);
    color: var(--theme-text, #111827);
    border-radius: var(--theme-radius, 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(--theme-surface-muted, #f3f4f6);
    color: var(--theme-text, #111827);
    cursor: pointer;
}

@media (hover: hover) {
    .wf-instructions-close:hover {
        background: var(--theme-border, #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(--theme-text, #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(--theme-background-raised, #fff);
    border: 1px solid var(--theme-border, #d0d4da);
    border-radius: var(--theme-radius-button, 6px);
    color: var(--theme-text, #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(--theme-primary, #2563eb);
}

.wf-text-input.wf-input-invalid {
    border-color: var(--theme-danger, #dc3545);
}

.wf-capture-error {
    font-size: 0.85rem;
    color: var(--theme-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(--theme-text-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(--theme-border, #d1d5db);
}

.wf-capture-image-label,
.wf-capture-note-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--theme-text-muted, #6b7280);
}

.wf-capture-image-pick {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.6rem 1rem;
    background: var(--theme-background-raised, #fff);
    border: 1px solid var(--theme-border, #d1d5db);
    border-radius: var(--theme-radius-button, 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(--theme-text-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(--theme-radius-button, 6px);
    border: 1px solid var(--theme-border, #d1d5db);
}

.wf-capture-image-icon {
    font-size: 1.5rem;
    color: var(--theme-text-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(--theme-danger, #dc3545);
    cursor: pointer;
    padding: 0.25rem;
}

.wf-note-input {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: var(--theme-background-raised, #fff);
    border: 1px solid var(--theme-border, #d1d5db);
    border-radius: var(--theme-radius-button, 6px);
    resize: vertical;
    font: inherit;
}

.wf-note-input:focus {
    border-color: var(--theme-primary, #2563eb);
}

.wf-capture-unsupported {
    padding: 0.75rem 1rem;
    background: var(--theme-warning-muted, #fef9c3);
    border-radius: var(--theme-radius-button, 6px);
    color: var(--theme-warning, #b45309);
    font-size: 0.875rem;
}


/* ── Info step ───────────────────────────────────────────────────── */

.wf-info-step {
    padding: 1rem;
    background: var(--theme-background-subtle, #f8f9fa);
    border-radius: var(--theme-radius-button, 6px);
    color: var(--theme-text, #222);
    font-size: 0.95rem;
    line-height: 1.6;
    border-left: 3px solid var(--theme-primary, #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(--theme-border-light, #e5e7eb);
    font-size: 0.875rem;
}

.wf-info-default-label {
    color: var(--theme-text-muted, #6b7280);
    font-weight: 500;
}

.wf-info-default-value {
    font-family: var(--theme-font-mono, ui-monospace, "Cascadia Code", "Consolas", monospace);
    color: var(--theme-text, #222);
    background: var(--theme-surface, #fff);
    padding: 0.05rem 0.35rem;
    border-radius: var(--theme-radius-button, 3px);
    border: 1px solid var(--theme-border-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(--theme-background-raised, #fff);
    border: 1px solid var(--theme-border, #d0d4da);
    border-radius: var(--theme-radius-button, 6px);
    cursor: pointer;
    font-size: 1rem;
    color: var(--theme-text, #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(--theme-background-hover, #f3f4f6);
        border-color: var(--theme-border-subtle, #b0b7bf);
    }
}

.wf-options-list li.wf-option-selected,
.wf-option-row.wf-option-selected {
    background: var(--theme-primary-soft, #dbeafe);
    border-color: var(--theme-primary, #2563eb);
    color: var(--theme-primary, #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(--theme-danger, #b91c1c);
    margin-left: 0.15rem;
}

.wf-option-status-complete {
    color: var(--theme-success, #16a34a);
    font-weight: 700;
}

.wf-option-status-started {
    color: var(--theme-warning, #b45309);
}

/* Loop leg accent */
.wf-options-list.wf-loop li.wf-option-selected {
    background: var(--theme-primary-muted, rgba(37, 99, 235, 0.1));
    border-color: var(--theme-primary, #2563eb);
    color: var(--theme-primary, #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(--theme-text-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(--theme-primary, #2563eb);
    cursor: pointer;
    user-select: none;
    text-align: center;
    border-radius: var(--theme-radius-button, 2px);
}

@media (hover: hover) {
    .wf-rail-letter:hover:not(.wf-rail-inactive) {
        background: var(--theme-primary-soft, #dbeafe);
    }
}

.wf-rail-letter.wf-rail-inactive {
    color: var(--theme-text-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(--theme-border, #d0d4da);
    border-radius: var(--theme-radius-button, 1.5rem);
    background: var(--theme-background-raised, #fff);
    color: var(--theme-text, #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(--theme-background-hover, #f3f4f6);
        border-color: var(--theme-border-subtle, #b0b7bf);
    }
}

.wf-split-option:active {
    background: var(--theme-background-active, #e5e7eb);
}

.wf-split-option-selected {
    background: var(--theme-primary-muted, rgba(37, 99, 235, 0.1));
    border-color: var(--theme-primary, #2563eb);
    color: var(--theme-primary, #2563eb);
    box-shadow: 0 0 0 1px var(--theme-primary, #2563eb),
                0 0 14px color-mix(in srgb, var(--theme-primary) 22%, transparent);
}

@media (hover: hover) {
    .wf-split-option-selected:hover {
        background: var(--theme-primary-muted, rgba(37, 99, 235, 0.1));
        border-color: var(--theme-primary, #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(--theme-border, #d0d4da);
    border-radius: var(--theme-radius-button, 1.5rem);
    background: var(--theme-background-raised, #fff);
    color: var(--theme-text, #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(--theme-primary, #198754) 35%, var(--theme-border, #d0d4da));
}

.wf-choice-option-proceed .wf-choice-option-badge {
    color: var(--theme-primary, #198754);
}

@media (hover: hover) {
    .wf-choice-option-proceed:hover {
        background: color-mix(in srgb, var(--theme-primary, #198754) 6%, var(--theme-background-raised, #fff));
        border-color: var(--theme-primary, #198754);
    }
}

.wf-choice-option-blocked {
    border-color: color-mix(in srgb, var(--theme-danger, #dc3545) 25%, var(--theme-border, #d0d4da));
    cursor: not-allowed;
    opacity: 0.85;
}

.wf-choice-option-blocked .wf-choice-option-badge {
    color: var(--theme-danger, #dc3545);
}

@media (hover: hover) {
    .wf-choice-option-blocked:hover {
        background: var(--theme-background-raised, #fff);
    }
}

.wf-choice-option-exit {
    border-color: color-mix(in srgb, var(--theme-warning, #fd7e14) 35%, var(--theme-border, #d0d4da));
}

.wf-choice-option-exit .wf-choice-option-badge {
    color: var(--theme-warning, #fd7e14);
}

@media (hover: hover) {
    .wf-choice-option-exit:hover {
        background: color-mix(in srgb, var(--theme-warning, #fd7e14) 6%, var(--theme-background-raised, #fff));
        border-color: var(--theme-warning, #fd7e14);
    }
}

.wf-choice-option-exit-selected {
    background: color-mix(in srgb, var(--theme-warning, #fd7e14) 10%, var(--theme-background-raised, #fff));
    border-color: var(--theme-warning, #fd7e14);
    box-shadow: 0 0 0 1px var(--theme-warning, #fd7e14);
}

.wf-choice-option-selected {
    background: color-mix(in srgb, var(--theme-primary, #198754) 10%, var(--theme-background-raised, #fff));
    border-color: var(--theme-primary, #198754);
    box-shadow: 0 0 0 1px var(--theme-primary, #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(--theme-primary);
    border-radius: var(--theme-radius-button);
    background: var(--theme-background-raised);
    color: var(--theme-primary);
    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(--theme-primary-muted);
    }
}

.wf-choice-button:active {
    transform: scale(0.98);
}

.wf-choice-button--selected {
    background: var(--theme-primary);
    color: var(--theme-text-on-primary);
}

@media (hover: hover) {
    .wf-choice-button--selected:hover {
        background: var(--theme-primary);
        color: var(--theme-text-on-primary);
    }
}

.wf-choice-button-desc {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--theme-text-muted);
}

.wf-choice-button--selected .wf-choice-button-desc {
    color: var(--theme-text-on-primary);
}

.wf-choice-look .wf-choice-button:focus-visible,
.wf-choice-look .wf-ra-tile:focus-visible {
    outline: 2px solid var(--theme-primary);
    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(--theme-border, #d0d4da);
    border-radius: var(--theme-radius-button, 1.5rem);
    background: var(--theme-background-raised, #fff);
    color: var(--theme-text, #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(--theme-text-muted, #6c757d);
}

.wf-multisplit-leg-go {
    flex-shrink: 0;
    color: var(--theme-text-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(--theme-primary, #198754);
}

@media (hover: hover) {
    .wf-ms-fresh:hover {
        background: color-mix(in srgb, var(--theme-primary, #198754) 6%, var(--theme-background-raised, #fff));
        border-color: var(--theme-primary, #198754);
    }
}

@media (hover: hover) {
    .wf-ms-fresh:hover .wf-multisplit-leg-go {
        color: var(--theme-primary, #198754);
        transform: translateX(2px);
    }
}

/* In progress — warm accent, half-circle badge, status sublabel. */
.wf-ms-started {
    border-color: color-mix(in srgb, var(--theme-warning, #fd7e14) 35%, var(--theme-border, #d0d4da));
}

.wf-ms-started .wf-multisplit-leg-badge,
.wf-ms-started .wf-multisplit-leg-status {
    color: var(--theme-warning, #fd7e14);
}

@media (hover: hover) {
    .wf-ms-started:hover {
        background: color-mix(in srgb, var(--theme-warning, #fd7e14) 6%, var(--theme-background-raised, #fff));
        border-color: var(--theme-warning, #fd7e14);
    }
}

/* Completed — the earned check: primary tint, still tappable to revisit. */
.wf-ms-complete {
    border-color: color-mix(in srgb, var(--theme-primary, #198754) 35%, var(--theme-border, #d0d4da));
    background: color-mix(in srgb, var(--theme-primary, #198754) 4%, var(--theme-background-raised, #fff));
}

.wf-ms-complete .wf-multisplit-leg-badge,
.wf-ms-complete .wf-multisplit-leg-status {
    color: var(--theme-primary, #198754);
}

@media (hover: hover) {
    .wf-ms-complete:hover {
        background: color-mix(in srgb, var(--theme-primary, #198754) 9%, var(--theme-background-raised, #fff));
        border-color: var(--theme-primary, #198754);
    }
}

/* Exit — the Choice exit treatment; padlocked until required legs finish. */
.wf-ms-exit {
    border-color: color-mix(in srgb, var(--theme-warning, #fd7e14) 35%, var(--theme-border, #d0d4da));
}

.wf-ms-exit .wf-multisplit-leg-badge {
    color: var(--theme-warning, #fd7e14);
}

@media (hover: hover) {
    .wf-ms-exit:hover:not(.wf-option-disabled) {
        background: color-mix(in srgb, var(--theme-warning, #fd7e14) 6%, var(--theme-background-raised, #fff));
        border-color: var(--theme-warning, #fd7e14);
    }
}

.wf-ms-exit.wf-option-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    border-color: var(--theme-border, #d0d4da);
}

.wf-ms-exit.wf-option-disabled .wf-multisplit-leg-badge {
    color: var(--theme-text-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(--theme-background-active, #e5e7eb);
    border-color: var(--theme-border-subtle, #b0b7bf);
}

/* The current pick — the same primary ring the Choice selection wears. */
.wf-multisplit-leg.wf-option-selected {
    background: color-mix(in srgb, var(--theme-primary, #198754) 10%, var(--theme-background-raised, #fff));
    border-color: var(--theme-primary, #198754);
    box-shadow: 0 0 0 1px var(--theme-primary, #198754);
}

.wf-multisplit-leg.wf-ms-exit.wf-option-selected {
    background: color-mix(in srgb, var(--theme-warning, #fd7e14) 10%, var(--theme-background-raised, #fff));
    border-color: var(--theme-warning, #fd7e14);
    box-shadow: 0 0 0 1px var(--theme-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(--theme-border, #d0d4da);
    border-radius: var(--theme-radius-button, 4px);
    cursor: pointer;
    background: var(--theme-surface, #fff);
}

@media (hover: hover) {
    .wf-multisplit-check:hover {
        background: var(--theme-surface-hover, #f3f4f6);
    }
}

.wf-multisplit-check.wf-option-selected {
    background: var(--theme-primary-soft, #dbeafe);
    border-color: var(--theme-primary, #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(--theme-primary, #2563eb);
    background: var(--theme-primary-soft, #dbeafe);
    border-radius: var(--theme-radius-button, 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(--theme-text, #222);
}

.wf-entity-summary-empty {
    color: var(--theme-text-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(--theme-border, #d0d4da);
}

.wf-property-label {
    flex: 0 0 auto;
    min-width: 9rem;
    color: var(--theme-text-muted, #6b7280);
    font-weight: 500;
    font-size: 0.875rem;
}

.wf-property-value {
    flex: 1;
    font-weight: 500;
    color: var(--theme-text, #222);
    font-size: 0.875rem;
    font-family: var(--theme-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(--theme-text-muted, #6b7280);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    border-radius: var(--theme-radius-button, 4px);
    transition: color 120ms ease, background 120ms ease;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .wf-entity-summary-edit:hover {
        color: var(--theme-primary, #2563eb);
        background: var(--theme-background-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(--theme-text-muted, #6b7280);
}

.wf-property-list dd {
    margin: 0;
    font-family: var(--theme-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(--theme-text, #222);
    margin-bottom: 0.75rem;
}

.wf-picker-empty,
.wf-picker-no-results {
    padding: 0.75rem 0;
    color: var(--theme-text-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(--theme-border, #d0d4da);
    border-radius: var(--theme-radius-button, 0.5rem);
    background: var(--theme-background-raised, #fff);
    color: var(--theme-text, #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(--theme-primary, #2563eb);
}

.wf-picker-options {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin: 0.25rem 0;
}

.wf-picker-record {
    border: 1.5px solid var(--theme-border, #d0d4da);
    border-radius: var(--theme-radius, 0.75rem);
    background: var(--theme-background-raised, #fff);
    overflow: hidden;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.wf-picker-record-selected {
    border-color: var(--theme-primary, #2563eb);
    box-shadow: 0 0 0 1px var(--theme-primary, #2563eb),
                0 0 14px color-mix(in srgb, var(--theme-primary) 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(--theme-text, #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(--theme-primary, #2563eb);
    background: var(--theme-primary-muted, rgba(37, 99, 235, 0.07));
}

@media (hover: hover) {
    .wf-picker-item-label:hover {
        background: var(--theme-background-hover, #f3f4f6);
    }
}

.wf-picker-item-edit {
    padding: 0 0.85rem;
    border: none;
    border-left: 1px solid var(--theme-border, #d0d4da);
    background: transparent;
    color: var(--theme-text-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(--theme-background-hover, #f3f4f6);
        color: var(--theme-text, #222);
    }
}

.wf-picker-item-details {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--theme-border, #d0d4da);
    background: var(--theme-primary-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(--theme-border, #d0d4da);
    border-radius: var(--theme-radius-button, 1.5rem);
    background: transparent;
    color: var(--theme-text-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(--theme-primary, #2563eb);
        color: var(--theme-primary, #2563eb);
        background: var(--theme-primary-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(--theme-border, #d0d4da);
    border-radius: var(--theme-radius-button, 1.5rem);
    overflow: hidden;
}

.wf-picker-form-tab {
    flex: 1;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--theme-text-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(--theme-surface-hover, #f3f4f6);
    }
}

.wf-picker-form-tab-active {
    background: var(--theme-primary, #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(--theme-text, #222);
}

.wf-picker-form-cancel-x {
    padding: 0.2rem 0.55rem;
    border: none;
    background: transparent;
    color: var(--theme-text-muted, #6b7280);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    border-radius: var(--theme-radius-button, 4px);
    transition: background 150ms ease, color 150ms ease;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .wf-picker-form-cancel-x:hover {
        background: var(--theme-surface-hover, #f3f4f6);
        color: var(--theme-text, #222);
    }
}

.wf-picker-form-step-count {
    font-size: 0.8rem;
    color: var(--theme-text-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(--theme-border, #d0d4da);
    border-radius: var(--theme-radius-button, 1.5rem);
    background: transparent;
    color: var(--theme-text-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(--theme-text-muted, #6b7280);
        color: var(--theme-text, #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(--theme-radius-button, 1.5rem);
    background: var(--theme-primary, #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(--theme-primary-dark, #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(--theme-text, #222);
}

.wf-picker-form-required {
    margin-left: 0.2rem;
    color: var(--theme-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(--theme-radius-button, 1.5rem);
    background: var(--theme-primary, #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(--theme-primary-dark, #1d4ed8);
    }
}

.wf-picker-form-cancel {
    padding: 0.65rem 1.25rem;
    border: 1.5px solid var(--theme-border, #d0d4da);
    border-radius: var(--theme-radius-button, 1.5rem);
    background: transparent;
    color: var(--theme-text-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(--theme-text-muted, #6b7280);
        color: var(--theme-text, #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(--theme-text-muted, #6b7280);
}

.wf-date-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background: var(--theme-background-raised, #fff);
    border: 1px solid var(--theme-border, #d0d4da);
    border-radius: var(--theme-radius-button, 6px);
    font-size: 1.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    color: var(--theme-text, #222);
}

.wf-date-segment {
    color: var(--theme-text-muted, #6b7280);
    transition: color 120ms ease;
}

.wf-date-segment-active {
    color: var(--theme-primary, #2563eb);
}

.wf-date-sep {
    color: var(--theme-border, #d0d4da);
    font-weight: 400;
}

.wf-date-sep-dash {
    margin: 0 0.25rem;
    color: var(--theme-text-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(--theme-text-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(--theme-background-raised, #fff);
    border: 1px solid var(--theme-border, #d0d4da);
    border-radius: var(--theme-radius-button, 6px);
    color: var(--theme-text, #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(--theme-background-hover, #f3f4f6);
        border-color: var(--theme-border-subtle, #b0b7bf);
    }
}

.wf-numpad-btn:active:not(:disabled) {
    background: var(--theme-background-active, #e5e7eb);
}

.wf-numpad-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.wf-numpad-action {
    background: var(--theme-background-subtle, #f8f9fa);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

@media (hover: hover) {
    .wf-numpad-action:hover:not(:disabled) {
        background: var(--theme-background-active, #e5e7eb);
    }
}

.wf-numpad-sep {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--theme-text-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(--theme-primary, #2563eb);
    color: #fff;
    border-color: var(--theme-primary, #2563eb);
}

@media (hover: hover) {
    .wf-numpad-btn.wf-ampm-active:hover {
        background: var(--theme-primary-hover, #1d4ed8);
        border-color: var(--theme-primary-hover, #1d4ed8);
    }
}

.wf-num-display {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background: var(--theme-background-raised, #fff);
    border: 1px solid var(--theme-border, #d0d4da);
    border-radius: var(--theme-radius-button, 6px);
    font-size: 1.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    color: var(--theme-text, #222);
    min-height: 3.25rem;
    word-break: break-all;
}

.wf-num-display-empty {
    color: var(--theme-text-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(--theme-border, #d0d4da);
    border-radius: var(--theme-radius-button, 6px);
    background: var(--theme-background-raised, #fff);
    color: var(--theme-text-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(--theme-background-hover, #f3f4f6);
        color: var(--theme-text, #222);
    }
}

.wf-shortcut-btn:active {
    background: var(--theme-background-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(--theme-font-size-base, 1rem);
    font-weight: 500;
    border-radius: var(--theme-radius-button, 6px);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 120ms ease;
    user-select: none;
}

.wf-nav-back {
    background: var(--theme-background-active);
    border-color: var(--theme-border-subtle, var(--theme-border));
    color: var(--theme-text);
}

@media (hover: hover) {
    .wf-nav-back:hover:not(:disabled) {
        background: var(--theme-background-hover);
        border-color: var(--theme-text-muted);
    }
}

.wf-nav-next {
    background: var(--theme-primary);
    border-color: var(--theme-primary);
    color: var(--theme-text-on-primary, #fff);
}

@media (hover: hover) {
    .wf-nav-next:hover:not(:disabled) {
        background: var(--theme-primary-hover, var(--theme-primary));
        border-color: var(--theme-primary-hover, var(--theme-primary));
    }
}

/* 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(--theme-text-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(--theme-text-muted, #6b7280);
    cursor: default;
}

.wf-split-radio.wf-option-selected {
    color: var(--theme-text, #222);
    font-weight: 500;
}

.wf-split-radio input[type="radio"] {
    accent-color: var(--theme-primary, #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(--theme-primary, #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(--theme-border, #d0d4da);
}

.wf-review-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--theme-text, #222);
}

.wf-review-subtitle {
    font-size: 0.875rem;
    color: var(--theme-text-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(--theme-text-muted, #6b7280);
}

.wf-review-duration::before {
    content: "·";
    margin-right: 0.75rem;
}

.wf-review-abandoned {
    opacity: 0.55;
    border-top: 1px dashed var(--theme-border, #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(--theme-text-muted, #6b7280);
    margin-bottom: 0.5rem;
}

.wf-review-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: var(--theme-text, #222);
}

.wf-review-group-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--theme-text-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(--theme-border, #d0d4da);
}

.wf-step {
    border: 1px solid var(--theme-border, #d0d4da);
    border-radius: var(--theme-radius-button, 6px);
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background: var(--theme-surface, #fff);
    color: var(--theme-text, #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(--theme-text-muted, #6b7280);
    white-space: nowrap;
}

.wf-step-edit {
    flex-shrink: 0;
    background: transparent;
    border: none;
    border-radius: var(--theme-radius-button, 4px);
    padding: 0.2rem 0.35rem;
    font-size: 0.95em;
    line-height: 1;
    color: var(--theme-text-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(--theme-surface-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(--theme-text, #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(--theme-border, #d0d4da);
    border-radius: var(--theme-radius-button, 4px);
    background: var(--theme-surface-muted, #f6f7f9);
}

.wf-review-diagnostics > summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--theme-text-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(--theme-surface, #fff);
    border: 1px solid var(--theme-border, #d0d4da);
    border-radius: var(--theme-radius-button, 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(--theme-border-subtle, 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(--theme-border-subtle, rgba(0, 0, 0, 0.1));
    border-radius: var(--theme-radius-button, 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(--theme-primary);
    }
}

.wf-media-thumb:active {
    transform: scale(0.98);
}

.wf-media-thumb-img {
    width: 100%;
    height: 4.5rem;
    object-fit: cover;
    border-radius: var(--theme-radius-button, 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(--theme-text-muted, #6b7280);
}

.wf-media-thumb-caption {
    font-size: 0.7rem;
    line-height: 1.2;
    text-align: center;
    color: var(--theme-text);
    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(--theme-radius-button, 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(--theme-radius-button, 0.25rem);
    display: block;
}

.wf-media-view-pdf {
    width: 100%;
    height: 80vh;
    overflow: auto;
    border-radius: var(--theme-radius-button, 0.25rem);
    background: var(--theme-background-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(--theme-radius-button, 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(--theme-surface, #fff);
    color: var(--theme-text);
    text-decoration: none;
    border-radius: var(--theme-radius-button, 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(--theme-text-muted, #6b7280);
    background: var(--theme-background-subtle, #f8f9fa);
    border: 1px dashed var(--theme-border-light, #d1d5db);
    border-radius: var(--theme-radius-button, 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(--theme-background-subtle, #f8f9fa);
    border: 1px solid var(--theme-border-light, #e5e7eb);
    border-radius: var(--theme-radius-button, 6px);
}

.wf-files-slot-label {
    font-size: 0.95rem;
    color: var(--theme-text, #222);
    font-weight: 500;
}

.wf-files-required {
    color: var(--theme-danger, #dc3545);
    margin-left: 0.15rem;
}

.wf-files-busy {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: var(--theme-text-muted, #6b7280);
}

.wf-files-pick {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.6rem 1rem;
    background: var(--theme-background-raised, #fff);
    border: 1px solid var(--theme-border, #d1d5db);
    border-radius: var(--theme-radius-button, 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(--theme-radius-button, 6px);
    border: 1px solid var(--theme-border, #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(--theme-text-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(--theme-text-muted, #6b7280);
    padding: 0.25rem;
}

.wf-files-remove {
    background: none;
    border: none;
    color: var(--theme-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(--theme-primary, #2563eb);
    color: #fff;
    border: none;
    border-radius: var(--theme-radius-button, 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(--theme-primary-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(--theme-text-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(--theme-radius, 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(--theme-border, #e5e7eb);
    border-radius: var(--theme-radius-button, 0.5rem);
    overflow: hidden;
    background: var(--theme-surface, #fff);
}

.wf-assetitem-selectable {
    cursor: pointer;
}

@media (hover: hover) {
    .wf-assetitem-selectable:hover {
        border-color: var(--theme-primary, #2563eb);
    }
}

.wf-assetitem-selected {
    border-color: var(--theme-primary, #2563eb);
    box-shadow: 0 0 0 2px var(--theme-primary, #2563eb) inset;
}

.wf-assetitem-media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--theme-surface-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(--theme-surface, #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(--theme-text-muted, #6b7280);
}

.wf-assetitem-check {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--theme-primary, #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(--theme-primary, #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(--theme-text, #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(--theme-text-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(--theme-primary, #2563eb);
    text-decoration: none;
}

.wf-assetitem-agree {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--theme-text, #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(--theme-text-secondary, var(--theme-text));
    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(--theme-radius, 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(--theme-border);
    border-radius: var(--theme-radius, 10px);
    background: var(--theme-background-subtle, var(--theme-background));
    /* 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(--theme-text);
    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(--theme-text);
    box-shadow: var(--theme-focus-ring);
}

.wf-signature-pad.is-signed {
    border-color: var(--theme-success);
    background: var(--theme-background-raised, var(--theme-background));
}

.wf-signature-pad.is-warn {
    border-color: var(--theme-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(--theme-success-muted);
    color: color-mix(in srgb, var(--theme-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(--theme-radius-button, 8px);
    background: transparent;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--theme-text);
    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(--theme-background-hover);
    }
}

.wf-signature-corner:active:not(:disabled) {
    background: var(--theme-background-active);
}

.wf-signature-corner:focus-visible {
    outline: none;
    box-shadow: var(--theme-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(--theme-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(--theme-primary);
}

.wf-signature-typed::placeholder {
    font-family: var(--theme-font, 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(--theme-primary-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(--theme-background-raised, var(--theme-background));
}

/* 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(--theme-radius-button, 10px);
    background: var(--theme-warning-muted);
    color: var(--theme-text);
    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(--theme-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(--theme-text);
}

.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(--theme-text-secondary, var(--theme-text));
    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(--theme-radius-button, 8px);
    background: none;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--theme-text);
    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(--theme-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(--theme-background-hover);
    border-color: var(--theme-border);
    color: var(--theme-text-secondary, var(--theme-text));
}

@media (hover: hover) {
    .wf-nav-next.wf-nav-next-muted:hover:not(:disabled) {
        background: var(--theme-background-active);
        border-color: var(--theme-text-secondary, var(--theme-text));
    }
}

@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(--theme-sheet-x-center, 43px) - 20px);
    width: 110px;
    height: 100px;
    overflow: visible;
    color: var(--theme-text);
    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(--theme-sheet-x-center, 43px) + 82px);
    inset-inline-end: 20px;
    margin: 0;
    font-family: var(--theme-font-script, "Segoe Script", "Bradley Hand", "Comic Sans MS", cursive);
    font-size: 1.75rem;
    font-weight: 400;
    line-height: 1.05;
    color: var(--theme-text);
    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(--theme-success-muted);
    color: var(--theme-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(--theme-text);
}

.wf-handback-waiting {
    margin: 10px 0 0;
    max-width: 30ch;
    font-size: 1.0625rem;
    color: var(--theme-text-muted);
    text-wrap: pretty;
}

.wf-handback-alt {
    margin: auto 0 0;
    padding: 24px 28px 14px;
    font-size: 0.875rem;
    color: var(--theme-text-muted);
}

.wf-handback-brand {
    border-top: 1px solid var(--theme-border);
    padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--theme-text);
}

@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(--theme-radius, 14px);
    background: var(--theme-surface, #f6f8fb);
    border: 1px solid var(--theme-border, #c4cad8);
    font-size: 0.95rem;
    color: var(--theme-text-muted, #8a92a6);
    font-weight: 500;
}

.wf-payment-amount strong {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--theme-text, #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(--theme-text-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(--theme-radius, 14px);
    background: var(--theme-card-bg, #ffffff);
    border: 1px solid var(--theme-border, #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(--theme-primary, #1e6091);
    box-shadow: 0 0 0 3px var(--theme-primary-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(--theme-radius, 12px);
    padding: 0.95rem 1rem;
    min-height: 3.1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--theme-primary, #1e6091);
    border: 1px solid var(--theme-primary, #1e6091);
    color: var(--theme-on-primary, #ffffff);
    box-shadow: 0 2px 8px var(--theme-primary-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(--theme-primary-soft, rgba(30, 96, 145, 0.35));
    }
}

.wf-payment-pay:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 1px 5px var(--theme-primary-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(--theme-radius, 12px);
    background: var(--theme-surface, #ffffff);
    border: 1px solid var(--theme-border, #c4cad8);
    color: var(--theme-primary, #1e6091);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

@media (hover: hover) {
    .wf-payment-different-card:hover:not(:disabled) {
        background: var(--theme-primary-muted, rgba(30, 96, 145, 0.08));
        border-color: var(--theme-primary, #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(--theme-success, #2e7d32);
    border-radius: var(--theme-radius, 14px);
    padding: 1.1rem 1.2rem;
    background: var(--theme-success-bg, #e9f6ec);
}

.wf-payment-receipt-icon {
    font-size: 1.75rem;
    color: var(--theme-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(--theme-text, #1a1a2e);
    letter-spacing: -0.01em;
}

.wf-payment-receipt-card {
    font-size: 0.9rem;
    color: var(--theme-text-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(--theme-primary, #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(--theme-background-subtle, #f3f6fa);
    border: 1px solid var(--theme-border, #d8dde5);
    border-left: 4px solid var(--theme-primary, #1e6091);
    border-radius: var(--theme-radius-button, 6px);
}
.wf-review-confirm-hint {
    margin: 0;
    color: var(--theme-text, #1a1a2e);
    font-size: 0.95rem;
    line-height: 1.4;
}
.wf-review-confirm-hint strong {
    color: var(--theme-primary, #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(--theme-primary);
    padding-bottom: 0.55rem;
    margin-bottom: 0.35rem;
}
.ansc-story-name { font-size: 1.2rem; margin: 0 0 0.35rem; color: var(--theme-text-emphasis); font-weight: 700; display: flex; align-items: center; }
.ansc-story-meta { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.82rem; color: var(--theme-text-secondary); align-items: center; }
.ansc-story-meta .badge { font-size: 0.72rem; }

/* Loop-iteration / multisplit-leg band */
.ansc-band {
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius, 0.5rem);
    overflow: hidden;
    background: color-mix(in oklch, var(--theme-primary) 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(--theme-primary) 10%, transparent);
    border-bottom: 1px solid var(--theme-border);
    color: var(--theme-text-emphasis); font-size: 0.9rem;
}
.ansc-band-title { font-weight: 700; }
.ansc-band-unit {
    margin-left: auto;
    background: var(--theme-primary); color: var(--theme-on-primary, #fff);
    padding: 0.12rem 0.6rem; border-radius: var(--theme-radius, 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(--theme-border);
    border-radius: var(--theme-radius, 0.5rem);
    background: var(--theme-surface, #fff);
}
.ansc-step.is-abandoned { opacity: 0.6; }
.ansc-step.is-internal {
    background: color-mix(in oklch, var(--theme-warning, #f0ad4e) 12%, var(--theme-surface, #fff));
    border-color: color-mix(in oklch, var(--theme-warning, #f0ad4e) 45%, var(--theme-border));
}

.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(--theme-text-emphasis); font-size: 1rem; }
.ansc-step-stamp { flex: 0 0 auto; font-size: 0.74rem; color: var(--theme-text-secondary); white-space: nowrap; }

.ansc-internal-badge {
    background: var(--theme-warning, #f0ad4e); color: var(--theme-warning-text, #3a2c00);
    padding: 0.05rem 0.45rem; border-radius: var(--theme-radius-button, 0.25rem);
    font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}

.ansc-step-desc { color: var(--theme-text-secondary); font-size: 0.85rem; margin: 0.15rem 0 0.3rem; }
.ansc-step-answer { color: var(--theme-text-emphasis); font-size: 0.97rem; word-break: break-word; margin-top: 0.15rem; }
.ansc-step-answer .ansc-chosen, .ansc-chosen { color: var(--theme-success, #198754); font-weight: 600; }
.ansc-prop em { color: var(--theme-text-secondary); }

.ansc-note {
    margin-top: 0.4rem;
    padding: 0.3rem 0.55rem;
    border-left: 3px solid var(--theme-accent, var(--theme-primary));
    background: color-mix(in oklch, var(--theme-accent, var(--theme-primary)) 5%, transparent);
    color: var(--theme-text-emphasis);
    font-size: 0.88rem; font-style: italic;
    border-radius: 0 var(--theme-radius-button, 0.3rem) var(--theme-radius-button, 0.3rem) 0;
}

/* Entity rollup card */
.ansc-entity-card {
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius-button, 0.4rem);
    padding: 0.5rem 0.65rem;
    background: color-mix(in oklch, var(--theme-text-emphasis) 2%, transparent);
    margin-top: 0.15rem;
}
.ansc-entity-title { font-weight: 600; color: var(--theme-text-emphasis); 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(--theme-text-secondary); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; }
.ansc-entity-val { color: var(--theme-text-emphasis); }

/* 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(--theme-border);
    border-radius: var(--theme-radius-button, 0.45rem);
    background: var(--theme-surface, #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(--theme-text-secondary);
    padding: 0.22rem 0.4rem; text-align: center;
    border-top: 1px solid var(--theme-border);
    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(--theme-text-emphasis);
}
@media (hover: hover) {
    .ansc-filechip:hover {     background: color-mix(in oklch, var(--theme-primary) 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(--theme-border);
    border-radius: var(--theme-radius-button, 0.4rem);
    background: color-mix(in oklch, var(--theme-text) 2%, transparent);
}
.ansc-assetitem > i {
    font-size: 1.05rem;
    color: var(--theme-text-secondary);
    flex: 0 0 auto;
}
.ansc-assetitem-picked {
    border-color: color-mix(in oklch, var(--theme-success, #198754) 45%, var(--theme-border));
    background: color-mix(in oklch, var(--theme-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(--theme-text-emphasis); }
.ansc-assetitem-desc {
    font-size: 0.82rem; color: var(--theme-text-secondary);
    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(--theme-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(--theme-border);
    border-radius: var(--theme-radius-button, 0.4rem);
}
.wf-assetitem-row > i {
    font-size: 1.05rem;
    color: var(--theme-text-secondary);
    flex: 0 0 auto;
}
.wf-assetitem-picked {
    border-color: color-mix(in oklch, var(--theme-success, #198754) 45%, var(--theme-border));
    background: color-mix(in oklch, var(--theme-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(--theme-text-emphasis); }
.wf-assetitem-desc {
    font-size: 0.82rem; color: var(--theme-text-secondary);
    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(--theme-success, #198754); font-weight: 600;
}

.ansc-edit-pencil { color: var(--theme-text-secondary); font-size: 0.85rem; line-height: 1; }
@media (hover: hover) {
    .ansc-edit-pencil:hover {     color: var(--theme-primary);     }
}

.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(--theme-warning-text, #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(--theme-surface, #ffffff);
    color: var(--theme-text, #111827);
    border: 1px solid var(--theme-border, #e5e7eb);
    border-radius: var(--theme-radius, 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(--theme-primary, #2563eb);
    }
}

.wf-ra-tile--selected {
    border-color: var(--theme-primary, #2563eb);
    box-shadow: 0 0 0 2px var(--theme-primary-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(--theme-radius, 10px) - 4px);
    background: var(--theme-surface-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(--theme-primary, #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(--theme-text-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(--theme-surface-muted, #f3f4f6);
    color: var(--theme-text-muted, #6b7280);
    border: 1px solid var(--theme-border, #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(--theme-primary, #2563eb);
    border: 1px solid var(--theme-primary, #2563eb);
    background: var(--theme-surface-muted, #f3f4f6);
}

.wf-ra-tiles--cards .wf-ra-tile-action {
    align-self: center;
}

.wf-ra-tile-check {
    display: none;
    color: var(--theme-primary, #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(--theme-primary, #2563eb);
    color: var(--theme-surface, #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(--theme-border, #e2e6eb);
    border-radius: var(--theme-radius, 8px);
    background: var(--theme-background-subtle, #f6f7f9);
    color: var(--theme-text, #1f2328);
    text-decoration: none;
    max-width: 100%;
}

@media (hover: hover) {
    .wf-review-doc-row:hover {
        border-color: var(--theme-primary, #2563eb);
        color: var(--theme-primary, #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(--theme-radius, 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(--theme-background-subtle);
}

.wf-canvas-bg-primary {
    background: color-mix(in srgb, var(--theme-primary) 10%, var(--theme-background));
}

.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(--theme-background-subtle, #f8f9fa);
    border-radius: var(--theme-radius-button, 6px);
    border-left: 3px solid var(--theme-primary, #2563eb);
}

.wf-location-fix {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 1.05rem;
    color: var(--theme-text, #222);
}

.wf-location-coords {
    font-family: var(--theme-font-mono, monospace);
    font-weight: 600;
}

.wf-location-source {
    color: var(--theme-text-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(--theme-primary, #2563eb);
    border-radius: var(--theme-radius-button, 6px);
    background: var(--theme-primary, #2563eb);
    color: var(--theme-text-on-primary, #fff);
    cursor: pointer;
}

.wf-location-refresh {
    background: transparent;
    color: var(--theme-primary, #2563eb);
}

.wf-location-share:disabled,
.wf-location-refresh:disabled,
.wf-location-manual-use:disabled {
    opacity: 0.5;
    cursor: default;
}

.wf-location-unavailable {
    color: var(--theme-text-muted, #6b7280);
    font-size: 0.9rem;
}

.wf-location-manual-hint {
    color: var(--theme-text-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(--theme-border, #d1d5db);
    border-radius: var(--theme-radius-button, 6px);
    background: var(--theme-background, #fff);
    color: var(--theme-text, #222);
    font-family: var(--theme-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(--theme-background-subtle, #f8f9fa);
    border: 1px solid var(--theme-border, #d1d5db);
    border-radius: var(--theme-radius-button, 8px);
}

.wf-contact-avatar {
    font-size: 2.4rem;
    color: var(--theme-primary, #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(--theme-text, #222);
}

.wf-contact-org {
    color: var(--theme-text-muted, #6b7280);
    font-size: 0.9rem;
}

.wf-contact-row {
    display: flex;
    align-items: center;
    color: var(--theme-text, #222);
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}

.wf-contact-row a {
    color: var(--theme-primary, #2563eb);
    text-decoration: none;
}

.wf-contact-notes {
    margin-top: 0.35rem;
    color: var(--theme-text-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(--theme-primary, #2563eb);
    border-radius: var(--theme-radius-button, 6px);
    background: var(--theme-primary, #2563eb);
    color: var(--theme-text-on-primary, #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(--theme-warning-muted, #fef9c3);
    border-radius: var(--theme-radius-button, 6px);
    color: var(--theme-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(--theme-danger-muted, #fdecea);
    color: var(--theme-danger, #dc3545);
}

.wf-run-notice-error > span {
    flex: 1 1 12rem;
}

.wf-run-notice-retry {
    border: 1px solid currentColor;
    border-radius: var(--theme-radius-button, 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(--theme-text, #111827);
}

.wf-action-waiting-line {
    margin: 0;
    color: var(--theme-text-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(--theme-border, #e5e7eb);
    border-radius: var(--theme-radius, 10px);
    background: var(--theme-background, #ffffff);
    color: var(--theme-text, #111827);
}

.wf-visit-looking {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--theme-text-secondary, #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(--theme-text-secondary, #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(--theme-text-emphasis, #111827);
    overflow-wrap: anywhere;
}

.wf-visit-place {
    font-size: 0.8rem;
    color: var(--theme-text-secondary, #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(--theme-border, #e5e7eb);
    border-radius: var(--theme-radius-button, 6px);
    background: var(--theme-background-subtle, #f9fafb);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

@media (hover: hover) {
    .wf-visit-option:hover:not(:disabled) {
        background: var(--theme-background-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(--theme-primary, #2563eb);
}

.wf-visit-note {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--theme-text, #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(--theme-text-secondary, #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(--theme-primary, #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(--theme-text, #111827);
}

.wf-textme-input {
    width: 100%;
    max-width: 22rem;
    min-height: 44px;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--theme-border, #d1d5db);
    border-radius: var(--theme-radius-button, 6px);
    background: var(--theme-background, #ffffff);
    color: var(--theme-text, #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(--theme-text-secondary, #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(--theme-border, #d1d5db);
    border-radius: var(--theme-radius-button, 6px);
    background: var(--theme-background, #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(--theme-text, #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(--theme-text, #111827);
}

.wf-pass-rule {
    width: 100%;
    margin: 1rem 0 0.25rem;
    border: 0;
    border-top: 1px solid var(--theme-border, #d1d5db);
}

.wf-pass-mac {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--theme-text-secondary, #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(--theme-border, #d1d5db);
    border-radius: var(--theme-radius-button, 6px);
    background: var(--theme-background, #ffffff);
    color: var(--theme-text, #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(--theme-background);
    color: var(--theme-text);
    font-family: var(--theme-font);
}

.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(--theme-border));
    color: var(--theme-text-emphasis);
    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(--theme-primary) 13%, var(--theme-background)));
    color: var(--wf-primary-ink, color-mix(in oklab, var(--theme-primary) 62%, var(--theme-text-emphasis)));
    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(--theme-primary) 62%, var(--theme-text-emphasis)));
    font-size: 12px;
}

.run-tx-channel {
    flex: none;
    margin-left: auto;
    color: var(--theme-text-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(--theme-text) 78%, transparent);
    mask-image: linear-gradient(to bottom, var(--theme-text) 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(--theme-background), var(--theme-text) 8%);
    color: var(--theme-text);
}

.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(--theme-primary) 13%, var(--theme-background)));
    color: var(--theme-text-emphasis);
}

.run-tx-tok {
    padding: 0 5px;
    border-radius: 5px;
    background: var(--wf-primary-soft, color-mix(in srgb, var(--theme-primary) 13%, var(--theme-background)));
    color: var(--wf-primary-ink, color-mix(in oklab, var(--theme-primary) 62%, var(--theme-text-emphasis)));
    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(--theme-primary)) 45%, transparent);
    border-radius: 999px;
    background: var(--theme-background);
    color: var(--wf-primary-ink, color-mix(in oklab, var(--theme-primary) 62%, var(--theme-text-emphasis)));
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.run-tx-chip.is-more {
    border-style: dashed;
    color: var(--theme-text-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(--theme-background), var(--theme-text) 6%));
    color: var(--theme-text-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(--theme-text-emphasis, var(--theme-text));
}

.wf-md h3 {
    font-size: 1.1em;
}

.wf-md blockquote {
    margin: 0 0 0.6em;
    padding-left: 0.8em;
    border-left: 3px solid var(--theme-border);
    color: var(--theme-text-muted);
}

.wf-md code {
    padding: 0 0.25em;
    border-radius: 4px;
    background: var(--theme-background-subtle);
    font-family: var(--theme-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(--theme-background-subtle);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.wf-md pre code {
    padding: 0;
    background: none;
}

.wf-md a {
    color: var(--theme-primary);
    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(--theme-border);
}

.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(--theme-border);
    text-align: left;
}
/* @end-tokens-only */
