/* Phone-first, single-card staff surface. Deliberately small — this client shares nothing with the
   manager console's design system.

   COLOUR RULE: every colour in this sheet resolves through a custom property declared once below.
   The PWA never sets data-theme and gets the light palette; the portal /staff tree carries the global
   theme on <html data-theme="…">, and the dark block re-points the SAME properties. Adding a colour
   literal to a rule outside the two palette blocks re-opens the light/dark drift this sheet used to
   have (every rule written twice), so don't. */

:root {
    /* Surfaces */
    --sf-bg: #f3f4f8;
    --sf-surface: #fff;
    --sf-raised: #f8f9fc;          /* run rows, pick entries, tiles */
    --sf-sunken: #f1f2f7;          /* statements, notes */
    --sf-hover: #eef0f8;
    --sf-row-hover: #f2f4f7;
    --sf-shadow: rgba(20, 20, 40, 0.08);

    /* Ink */
    --sf-text: #1f2233;
    --sf-body: #3a3f55;
    --sf-muted: #6b7080;
    --sf-faint: #9aa0b4;

    /* Lines */
    --sf-border: #e3e4ec;
    --sf-border-soft: #e4e7ec;
    --sf-edge: #c7cae0;            /* the 4px left edge on a card row */

    /* Accents */
    --sf-accent: #4338ca;
    --sf-accent-soft: #d9d9f5;
    --sf-accent-dim: #e3e4ec;
    --sf-link: #2563eb;
    --sf-danger: #b91c1c;
    --sf-danger-edge: #dc2626;
    --sf-danger-surface: #fef5f4;
    --sf-danger-border: #f0c9c4;

    /* Run-status pills (StaffRunTone → tone-*) */
    --sf-tone-neutral-bg: #e8eaf3;  --sf-tone-neutral-fg: #4b5066;
    --sf-tone-active-bg: #e0ecff;   --sf-tone-active-fg: #1d4ed8;
    --sf-tone-positive-bg: #e3f5ea; --sf-tone-positive-fg: #15803d;
    --sf-tone-warning-bg: #fde7e5;  --sf-tone-warning-fg: #b91c1c;
    --sf-tone-muted-bg: #eceef3;    --sf-tone-muted-fg: #8a8f9e;

    /* Verdict banner (StatusTone → tone-*) */
    --sf-v-success-bg: #ecfdf3; --sf-v-success-bd: #abefc6; --sf-v-success-fg: #067647;
    --sf-v-danger-bg: #fef3f2;  --sf-v-danger-bd: #fecdca;  --sf-v-danger-fg: #b42318;
    --sf-v-warning-bg: #fffaeb; --sf-v-warning-bd: #fedf89; --sf-v-warning-fg: #b54708;
    --sf-v-neutral-bg: #f2f4f7; --sf-v-neutral-bd: #e4e7ec; --sf-v-neutral-fg: #475467;

    /* Status dots (StatusTone → tone-*) */
    --sf-dot-success: #12b76a;
    --sf-dot-danger: #f04438;
    --sf-dot-warning: #f79009;
    --sf-dot-info: #2e90fa;
    --sf-dot-neutral: #98a2b3;
}

/* The portal /staff surface inherits the console's theme attribute; the PWA never sets it. Re-point
   the properties, don't restate the rules. */
[data-theme="dark"] {
    --sf-bg: #010409;
    --sf-surface: #161B22;
    --sf-raised: #1C2128;
    --sf-sunken: #161B22;
    --sf-hover: #21262D;
    --sf-row-hover: #161B22;
    --sf-shadow: rgba(1, 4, 9, 0.6);

    --sf-text: #E6EDF3;
    --sf-body: #ADBAC7;
    --sf-muted: #7D8590;
    --sf-faint: #6E7681;

    --sf-border: #30363D;
    --sf-border-soft: #30363D;
    --sf-edge: #444C56;

    --sf-accent: #A5A2F5;
    --sf-accent-soft: #2D2B5E;
    --sf-accent-dim: #30363D;
    --sf-link: #539BF5;
    --sf-danger: #F85149;
    --sf-danger-edge: #F85149;
    --sf-danger-surface: #25171A;
    --sf-danger-border: #4D2329;

    --sf-tone-neutral-bg: #21262D;                    --sf-tone-neutral-fg: #ADBAC7;
    --sf-tone-active-bg: rgba(56, 139, 253, 0.15);    --sf-tone-active-fg: #58A6FF;
    --sf-tone-positive-bg: rgba(46, 160, 67, 0.15);   --sf-tone-positive-fg: #3FB950;
    --sf-tone-warning-bg: rgba(248, 81, 73, 0.15);    --sf-tone-warning-fg: #F85149;
    --sf-tone-muted-bg: #21262D;                      --sf-tone-muted-fg: #7D8590;

    --sf-v-success-bg: #12261C; --sf-v-success-bd: #1F4D33; --sf-v-success-fg: #56D364;
    --sf-v-danger-bg: #25171A;  --sf-v-danger-bd: #4D2329;  --sf-v-danger-fg: #F85149;
    --sf-v-warning-bg: #271D12; --sf-v-warning-bd: #4D3A1F; --sf-v-warning-fg: #E3B341;
    --sf-v-neutral-bg: #161B22; --sf-v-neutral-bd: #30363D; --sf-v-neutral-fg: #ADBAC7;
}

html, body {
    margin: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--sf-bg);
    min-height: 100vh;
}

.staff-shell {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 24px 16px;
}

/* ── The card, and the page chrome inside it ────────────────────────────────
   .staff-card is the centered single-message surface (tiles, enrol, splash);
   .staff-page turns it into the left-aligned screen every StaffPageScaffold
   renders, keeping only the heading centered. */

.staff-card {
    width: 100%;
    max-width: 420px;
    background: var(--sf-surface);
    border-radius: 16px;
    box-shadow: 0 2px 16px var(--sf-shadow);
    padding: 32px 24px;
    margin-top: 8vh;
    text-align: center;
}

.staff-page {
    text-align: left;
}

.staff-title {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 8px 0 12px;
    text-align: center;
    color: var(--sf-text);
}

/* The head row keeps the title centered, with back / action tucked to the edges. */
.staff-page-head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.staff-page-back {
    position: absolute;
    left: 0;
}

.staff-page-action {
    position: absolute;
    right: 0;
}

/* Filters that outlive the body's loading + error states. */
.staff-page-toolbar {
    margin-top: 4px;
    margin-bottom: 8px;
}

/* Loading / error / empty / not-found — every non-list outcome, centered in the card. */
.staff-state {
    text-align: center;
    padding: 16px 4px 8px;
}

.staff-muted {
    color: var(--sf-muted);
}

.staff-hero-icon {
    font-size: 56px !important;
    width: 56px;
    height: 56px;
    color: var(--sf-muted);
}

/* One-time generated-PIN reveal on the enrolment screen. */
.staff-pin-reveal {
    margin: 12px auto 16px;
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    font-variant-numeric: tabular-nums;
    color: var(--sf-accent);
}

/* Tile grid: tap your name, then enter your PIN. */
.staff-tile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 8px;
}

.staff-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 8px;
    border: 1px solid var(--sf-border);
    border-radius: 12px;
    background: var(--sf-raised);
    font: inherit;
    font-weight: 600;
    color: var(--sf-text);
    cursor: pointer;
}

.staff-tile:hover {
    background: var(--sf-hover);
    border-color: var(--sf-edge);
}

.staff-tile .mud-icon-root {
    font-size: 34px;
    color: var(--sf-muted);
}

/* Authenticated chrome: the signed-in top bar (name + sign-out). Rendered only for a
   signed-in principal — the anonymous tile screen has no chrome. */
.staff-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px 8px 16px;
    background: var(--sf-surface);
    border-bottom: 1px solid var(--sf-border);
}

.staff-topbar-name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--sf-text);
}

/* Manage-device row: name + remove control. */
.staff-manage-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* ── Worklist run card (Scheduled + Requested) ───────────────────────────── */

.staff-run-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.staff-run {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 14px;
    border: 1px solid var(--sf-border);
    border-left: 4px solid var(--sf-edge);
    border-radius: 12px;
    background: var(--sf-raised);
}

/* Past-due runs get a warm edge so the list scans at a glance. */
.staff-run.is-overdue {
    border-left-color: var(--sf-danger-edge);
    background: var(--sf-danger-surface);
}

.staff-run-body {
    min-width: 0; /* let long names ellipsize instead of pushing the meta column */
    flex: 1 1 auto;
}

/* The body is a tap target (opens a run of this procedure, carrying the instance ref). Reset the
   <button> chrome so it reads as the card body, not a button; subtle hover cue on the title. */
.staff-run-open {
    appearance: none;
    border: none;
    background: none;
    margin: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    display: block;
    width: 100%;
}
.staff-run-open:hover .staff-run-procedure {
    text-decoration: underline;
}

.staff-run-procedure {
    font-weight: 600;
    color: var(--sf-text);
    line-height: 1.3;
}

.staff-run-subjects {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.staff-run-subject {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--sf-hover);
    color: var(--sf-body);
    font-size: 0.8rem;
    font-weight: 500;
}

.staff-run-subject.is-empty {
    background: transparent;
    color: var(--sf-faint);
    font-style: italic;
    padding-left: 0;
}

/* Requested runs only: who asked + their note. Both sit in the body column so the note
   wraps to the body width rather than blowing out the card. */
.staff-run-requester {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--sf-muted);
}

.staff-run-requester-icon {
    font-size: 16px !important;
    width: 16px;
    height: 16px;
}

.staff-run-note {
    margin-top: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--sf-sunken);
    color: var(--sf-body);
    font-size: 0.82rem;
    line-height: 1.4;
    /* Unknown length, user-authored: preserve the author's newlines, wrap, and break
       even an unbroken string so a long note never overflows the card horizontally. */
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.staff-run-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex: 0 0 auto;
    text-align: right;
}

.staff-run-status {
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Status tones — semantic, mapped from StaffRunPresentation.StaffRunTone via StaffTone.Class. */
.staff-run-status.tone-neutral  { background: var(--sf-tone-neutral-bg);  color: var(--sf-tone-neutral-fg); }
.staff-run-status.tone-active   { background: var(--sf-tone-active-bg);   color: var(--sf-tone-active-fg); }
.staff-run-status.tone-positive { background: var(--sf-tone-positive-bg); color: var(--sf-tone-positive-fg); }
.staff-run-status.tone-warning  { background: var(--sf-tone-warning-bg);  color: var(--sf-tone-warning-fg); }
.staff-run-status.tone-muted    { background: var(--sf-tone-muted-bg);    color: var(--sf-tone-muted-fg); }

.staff-run-due {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.78rem;
    color: var(--sf-muted);
    white-space: nowrap;
}

.staff-run-due.is-overdue {
    color: var(--sf-danger);
    font-weight: 600;
}

.staff-run-due-icon {
    font-size: 15px !important;
    width: 15px;
    height: 15px;
}

/* ── Won't Complete: a wrapper holds the run card + its optional inline reason editor. ──
   The wrapper is the flex-list child, so the card and its editor sit together with a
   tighter inner gap than the list's own. */
.staff-run-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* The small top-right decline affordance. Muted by default so a worklist of runs
   isn't a wall of red; reddens on hover to signal the destructive intent. */
.staff-run-decline-btn,
.staff-run-decline-btn .mud-icon-root {
    color: var(--sf-faint) !important;
}
.staff-run-decline-btn:hover,
.staff-run-decline-btn:hover .mud-icon-root {
    color: var(--sf-danger) !important;
}

.staff-run-decline-panel {
    border: 1px solid var(--sf-danger-border);
    border-radius: 10px;
    background: var(--sf-danger-surface);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.staff-run-decline-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sf-danger);
}

.staff-run-decline-error {
    font-size: 0.8rem;
    color: var(--sf-danger);
}

.staff-run-decline-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ── Procedure picker (the catalogue screen + the wizard's step 1) ────────── */

.staff-pick-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.staff-pick-entry {
    display: block;
    width: 100%;
    text-align: left;
    font: inherit;
    cursor: pointer;
    padding: 14px 14px;
    border: 1px solid var(--sf-border);
    border-left: 4px solid var(--sf-edge);
    border-radius: 12px;
    background: var(--sf-raised);
}

.staff-pick-entry:hover {
    background: var(--sf-hover);
    border-color: var(--sf-edge);
    border-left-color: var(--sf-accent);
}

.staff-pick-name {
    font-weight: 600;
    color: var(--sf-text);
    line-height: 1.3;
}

.staff-pick-description {
    margin-top: 6px;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--sf-body);
    /* User-authored, unknown length: wrap and break so a long description can't overflow. */
    overflow-wrap: anywhere;
}

.staff-pick-pager {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

/* ── Run form + item viewer: fields, sections, statements ─────────────────── */

.staff-run-description {
    margin: 4px 0 12px;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--sf-body);
    overflow-wrap: anywhere; /* user-authored, unknown length */
}

.staff-form-section {
    margin-top: 16px;
}

.staff-form-section-title {
    font-weight: 600;
    color: var(--sf-text);
    margin-bottom: 6px;
}

.staff-form-optional {
    font-weight: 400;
    font-size: 0.82rem;
    color: var(--sf-faint);
}

.staff-form-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.staff-form-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.staff-form-label {
    font-weight: 600;
    color: var(--sf-text);
    line-height: 1.3;
}

.staff-form-required {
    color: var(--sf-danger);
    margin-left: 2px;
}

/* Step instruction/description text under a field's label. */
.staff-form-instr {
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--sf-muted);
    overflow-wrap: anywhere;
}

/* Statement: render-only audit text, no input. */
.staff-form-statement {
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--sf-sunken);
    border-left: 3px solid var(--sf-edge);
}

.staff-form-statement-label {
    font-weight: 600;
    color: var(--sf-text);
    line-height: 1.35;
}

/* Disabled-with-note for deferred field types (FileUpload / RelatedEntity). */
.staff-form-unsupported {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--sf-sunken);
    color: var(--sf-faint);
    font-size: 0.85rem;
    font-style: italic;
}

.staff-form-unsupported .mud-icon-root {
    font-size: 18px;
}

/* Inline per-field validation gap (client pre-check or a server 400 gap). */
.staff-form-error {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--sf-danger);
}

/* YesNo radios sit in a row on a phone width. */
.staff-form-yesno {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
}

/* Asset autocomplete option: name over a muted module line. */
.staff-asset-option {
    display: flex;
    flex-direction: column;
}

.staff-asset-name {
    font-weight: 500;
    color: var(--sf-text);
}

.staff-asset-module {
    font-size: 0.76rem;
    color: var(--sf-faint);
}

/* ── Single-item read-only viewer ─────────────────────────────────────────── */

.staff-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    font-size: 0.82rem;
    color: var(--sf-muted);
    margin: -4px 0 12px;
}

.staff-item-sep { opacity: 0.5; }

/* Asset-first run launcher — sits between the verdict banner and the fields. */
.staff-item-launch { margin: 4px 0 14px; }

/* Read-only field value (the staff twin of the Web ReadOnlyValue). */
.staff-rov-value {
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--sf-text);
    overflow-wrap: anywhere;
}

.staff-rov-value a { color: var(--sf-link); text-decoration: underline; overflow-wrap: anywhere; }

.staff-rov-empty {
    font-size: 0.95rem;
    color: var(--sf-faint);
}

.staff-rov-note {
    margin-top: 2px;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--sf-muted);
    overflow-wrap: anywhere;
}

/* Hash-free tamper verdict banner. Tone classes carry the colour. */
.staff-verdict {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    margin: 4px 0 14px;
}

.staff-verdict-text { display: flex; flex-direction: column; gap: 2px; }
.staff-verdict-headline { font-weight: 600; line-height: 1.3; }
.staff-verdict-sub { font-size: 0.85rem; line-height: 1.4; opacity: 0.9; }

.staff-verdict.tone-success { background: var(--sf-v-success-bg); border-color: var(--sf-v-success-bd); color: var(--sf-v-success-fg); }
.staff-verdict.tone-danger  { background: var(--sf-v-danger-bg);  border-color: var(--sf-v-danger-bd);  color: var(--sf-v-danger-fg); }
.staff-verdict.tone-warning { background: var(--sf-v-warning-bg); border-color: var(--sf-v-warning-bd); color: var(--sf-v-warning-fg); }
.staff-verdict.tone-neutral { background: var(--sf-v-neutral-bg); border-color: var(--sf-v-neutral-bd); color: var(--sf-v-neutral-fg); }

/* ── Panels: relations, activity, related assets, the wizard's tree ───────── */

.staff-panel {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--sf-border-soft);
}

.staff-panel-title {
    font-weight: 600;
    color: var(--sf-text);
    margin-bottom: 8px;
}

.staff-panel-empty {
    font-size: 0.88rem;
    color: var(--sf-faint);
}

/* Relation row — the navigate link is its own button; the tree's checkbox sits to its LEFT
   (the .staff-rel-row flex leaves that slot) without disturbing the link. */
.staff-rel-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.staff-rel-open {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 6px;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    color: inherit;
    font: inherit;
    min-width: 0;
}

.staff-rel-open:hover { background: var(--sf-row-hover); }

.staff-rel-icon { font-size: 1.1rem; color: var(--sf-muted); flex: none; }

.staff-rel-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--sf-text);
}

.staff-rel-kind {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sf-faint);
    flex: none;
}

.staff-activity-list { display: flex; flex-direction: column; gap: 2px; }

.staff-activity-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 6px;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    color: inherit;
    font: inherit;
    width: 100%;
}

.staff-activity-row:hover { background: var(--sf-row-hover); }

.staff-activity-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }

.staff-activity-line { display: flex; align-items: baseline; gap: 8px; min-width: 0; }

.staff-activity-proc {
    font-weight: 500;
    color: var(--sf-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.staff-activity-status { font-size: 0.78rem; color: var(--sf-muted); flex: none; }

.staff-activity-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--sf-muted);
}

.staff-activity-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 6px;
    padding: 8px;
    background: none;
    border: 1px solid var(--sf-border-soft);
    border-radius: 8px;
    cursor: pointer;
    color: var(--sf-link);
    font: inherit;
}

.staff-activity-more:hover { background: var(--sf-row-hover); }

/* Status dot — 8px round, tone-coloured (shared by the activity list). */
.staff-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: none;
    margin-top: 6px;
    background: var(--sf-dot-neutral);
}

.staff-status-dot.tone-success { background: var(--sf-dot-success); }
.staff-status-dot.tone-danger  { background: var(--sf-dot-danger); }
.staff-status-dot.tone-warning { background: var(--sf-dot-warning); }
.staff-status-dot.tone-info    { background: var(--sf-dot-info); }
.staff-status-dot.tone-neutral { background: var(--sf-dot-neutral); }

/* ── QR scanner ───────────────────────────────────────────────────────────── */

.staff-scan-viewport {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 8px auto 0;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.staff-scan-viewport.is-hidden { display: none; }

.staff-scan-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* A centred square reticle to aim the code into. Pointer-transparent overlay. */
.staff-scan-reticle {
    position: absolute;
    inset: 18%;
    border: 3px solid rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.28);
    pointer-events: none;
}

/* ── Run wizard ───────────────────────────────────────────────────────────────
   The stepper doubles as the between-steps back affordance (a prior step is a
   button; the current + future ones are inert). Sits above each step's card. */
.staff-wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 0 auto 10px;
    flex-wrap: wrap;
}

.staff-wizard-step {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    background: none;
    border: none;
    border-radius: 8px;
    font: inherit;
    color: var(--sf-faint);
    cursor: default;
}

.staff-wizard-step.is-reachable {
    color: var(--sf-accent);
    cursor: pointer;
}

.staff-wizard-step.is-reachable:hover { background: var(--sf-hover); }

.staff-wizard-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--sf-accent-dim);
    color: var(--sf-muted);
    flex: none;
}

.staff-wizard-step.is-current .staff-wizard-step-num { background: var(--sf-accent); color: #fff; }
.staff-wizard-step.is-reachable .staff-wizard-step-num { background: var(--sf-accent-soft); color: var(--sf-accent); }

.staff-wizard-step-label { font-size: 0.85rem; font-weight: 500; }
.staff-wizard-step.is-current .staff-wizard-step-label { color: var(--sf-text); }

.staff-wizard-sep { font-size: 1rem; color: var(--sf-edge); flex: none; }

/* ── Asset-selection tree (wizard step 2) ─────────────────────────────────────
   Reuses .staff-rel-row via <StaffRelationRow>: the reserved LEFT slot carries the
   subject checkbox, and the link becomes the expander. */
.staff-tree-panel { padding-top: 4px; }

.staff-tree-level { display: flex; flex-direction: column; }

.staff-tree-check { margin: 0; flex: none; }

/* Keeps a non-tickable (structural) row's label aligned with tickable siblings. */
.staff-tree-check-spacer { width: 30px; flex: none; }

.staff-tree-open { padding-left: 0; }

.staff-tree-caret { color: var(--sf-faint); }

.staff-tree-note {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 6px;
    font-size: 0.85rem;
}

.staff-tree-muted { color: var(--sf-faint); }

#blazor-error-ui {
    background: #ffffe0;
    color: #000;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

/* ── Tablet (≥768px): the shared single-card surface gets room to breathe.
   Phone stays kiosk-tight. Widens the card moderately and gives the name-tile
   grid a third column (the screen that benefits most on a mounted tablet).
   Linked by both hosts; on the portal the chrome column + the .main-inner
   ::deep override cap .staff-card further, so this only really bites in the PWA. */
@media (min-width: 768px) {
    .staff-card {
        max-width: 560px;
        padding: 40px 36px;
    }
    .staff-tile-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
    .staff-run,
    .staff-pick-entry { padding: 16px 18px; }
}
