/* Shared list-card + app-store + ops-console styling for the Portal's
   browse surfaces (context definitions, workflows, action packs, action
   center). All colors via --theme-* tokens so tenant branding flows through.
   Goal: sexy, functional, inviting, professional. */

/* ── Toolbar (search + count) ─────────────────────────────────────────── */
.plist-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.plist-search {
    position: relative;
    flex: 1;
    min-width: 220px;
    max-width: 420px;
}

.plist-search .bi {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--theme-text-secondary);
    pointer-events: none;
}

.plist-search input {
    padding-left: 2.1rem;
}

.plist-count {
    font-size: var(--theme-font-size-sm);
    color: var(--theme-text-secondary);
    white-space: nowrap;
}

.plist-spacer { flex: 1; }

/* ── Card grid ────────────────────────────────────────────────────────── */
.pcard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
}

/* The Action Packs section toolbar - title left, count + filter chips right. */
.appstore-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: end;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius, 0.6rem);
    background: var(--theme-surface, #fff);
    margin-bottom: 0.75rem;
}
.appstore-toolbar .ast-f { display: flex; flex-direction: column; gap: 0.2rem; min-width: 140px; flex: 1 1 140px; }
.appstore-toolbar .ast-f label { font-size: 0.72rem; color: var(--theme-text-secondary); font-weight: 600; }
.appstore-toolbar .ast-f-search { flex: 2 1 220px; }
.appstore-toolbar .ast-f-actions { display: flex; gap: 0.4rem; align-items: center; margin-left: auto; }
.appstore-toolbar .ast-f-count { font-size: 0.8rem; color: var(--theme-text-secondary); white-space: nowrap; }

/* Collapsible "Pack authoring" section header (Definitions). */
.appstore-section-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0.5rem;
    padding: 0.55rem 0.9rem;
    background: var(--theme-surface, #fff);
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius, 0.6rem);
    color: var(--theme-text-emphasis);
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    margin: 1rem 0 0.75rem;
}
.appstore-section-toggle:hover { background: color-mix(in oklch, var(--theme-primary) 4%, var(--theme-surface, #fff)); }
.appstore-section-toggle .chev { margin-left: auto; transition: transform .15s ease; }
.appstore-section-toggle.is-open .chev { transform: rotate(90deg); }
.appstore-section-toggle .hint { font-weight: 400; color: var(--theme-text-secondary); font-size: 0.8rem; }
.appstore-section-toggle .new-btn { margin-left: 0.5rem; }

/* Subscription edit modal - two-column layout: form (left) + catalog/preview (right). */
.subedit-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
}
@media (max-width: 991.98px) {
    .subedit-grid { grid-template-columns: 1fr; }
}
.subedit-pane {
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius, 0.6rem);
    background: var(--theme-surface, #fff);
    padding: 0.85rem 1rem;
}
.subedit-pane h6 {
    font-size: 0.78rem;
    color: var(--theme-text-secondary);
    margin: 0 0 0.6rem 0;
    font-weight: 700;
}
.subedit-fieldlist {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 260px;
    overflow-y: auto;
}
.subedit-fieldlist li {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--theme-border);
    font-size: 0.85rem;
}
.subedit-fieldlist li:last-child { border-bottom: 0; }
.subedit-fieldlist code {
    font-size: 0.82rem;
    color: var(--theme-primary);
    background: color-mix(in oklch, var(--theme-primary) 8%, transparent);
    padding: 0.05rem 0.3rem;
    border-radius: 0.2rem;
}
.subedit-fieldlist .field-desc { color: var(--theme-text-secondary); font-size: 0.75rem; margin-top: 0.15rem; }
.subedit-sample {
    background: color-mix(in oklch, var(--theme-text-emphasis) 4%, var(--theme-surface, #fff));
    border: 1px solid var(--theme-border);
    border-radius: 0.4rem;
    padding: 0.5rem 0.6rem;
    max-height: 280px;
    overflow: auto;
    font-size: 0.78rem;
    margin: 0;
}

/* Configure / Definition modal - sectioned body, like the Action Center detail. */
.ap-config-modal .ap-section {
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius, 0.6rem);
    background: var(--theme-surface, #fff);
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
}
.ap-config-modal .ap-section h6 {
    font-size: 0.78rem;
    color: var(--theme-text-secondary);
    margin: 0 0 0.6rem 0;
    font-weight: 700;
}
.ap-config-modal .ap-section .hint { font-size: 0.78rem; color: var(--theme-text-secondary); margin-top: 0.25rem; }

.pcard {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-md);
    background: var(--wf-card);
    box-shadow: var(--wf-elev-1);
    overflow: hidden;
    transition: box-shadow var(--wf-motion-panel), transform var(--wf-motion-panel), border-color .15s ease;
}

/* Elevation 2 and a 1px lift - the shadow used to be tinted with the primary, a coloured smear on a
   saturated brand and invisible on a dark one. */
.pcard:hover {
    box-shadow: var(--wf-elev-2);
    border-color: var(--wf-line-strong);
    transform: translateY(-1px);
}

/* A thin accent rail at the top of each card; color set inline per card. */
.pcard-accent {
    height: 4px;
    background: var(--theme-primary);
}

.pcard-head {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.9rem 1rem 0.4rem;
}

.pcard-icon {
    flex: 0 0 auto;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: var(--wf-radius-tile);
    display: grid;
    place-items: center;
    font-size: 1.15rem;
    background: var(--wf-primary-soft);
    color: var(--wf-primary-ink);
}

.pcard-headtext { min-width: 0; flex: 1; }

.pcard-title {
    font-weight: 650;
    color: var(--theme-text-emphasis);
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.25;
    word-break: break-word;
}

.pcard-sub {
    font-family: var(--theme-font-mono);
    font-size: 0.72rem;
    color: var(--theme-text-secondary);
    word-break: break-all;
}

.pcard-body {
    padding: 0.1rem 1rem 0.65rem;
    flex: 1;
}

.pcard-desc {
    font-size: 0.8125rem;
    color: var(--theme-text-secondary);
    margin: 0 0 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pcard-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.6rem;
    font-size: 0.74rem;
    color: var(--theme-text-secondary);
}

.pcard-meta .bi { margin-right: 0.2rem; }

.pcard-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.08rem 0.5rem;
    border-radius: var(--wf-radius-pill);
    background: var(--wf-neutral-soft);
    color: var(--theme-text-secondary);
    font-size: 0.72rem;
    font-weight: 500;
}

.pcard-foot {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border-top: 1px solid var(--wf-line);
    background: transparent;
}

.pcard-foot .pcard-spacer { flex: 1; }

/* ── Empty state: an invitation, never a shrug (Components/Common/EmptyState is the shared one) ── */
.pcard-empty {
    text-align: center;
    padding: 3rem 1rem;
    border: 1px dashed var(--wf-line-strong);
    border-radius: var(--wf-radius-md);
    background: var(--wf-brand-wash), var(--wf-card);
}

.pcard-empty-icon {
    font-size: 2.4rem;
    color: var(--wf-primary-ink);
    margin-bottom: 0.5rem;
}

.pcard-empty-title {
    font-weight: 650;
    font-size: 1.0625rem;
    color: var(--theme-text-emphasis);
    margin-bottom: 0.25rem;
}

.pcard-empty-body {
    font-size: 0.84375rem;
    color: var(--theme-text-secondary);
    max-width: 32rem;
    margin: 0 auto 1rem;
}

/* ── App-store (action packs) ─────────────────────────────────────────── */
.appstore-section-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--theme-font-size-sm);
    font-weight: 650;
    color: var(--theme-text-emphasis);
    margin: 1.5rem 0 0.75rem;
}

.appstore-status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.74rem;
    font-weight: 600;
}

.appstore-status.on { color: var(--theme-success, #198754); }
.appstore-status.off { color: var(--theme-text-secondary); }

.appstore-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: currentColor;
}

/* The on/off switch sits in the card foot. Its size is wf.css's one switch geometry (the knob's travel is built for that
   track): a bigger track here left the "on" knob part way along it. */
.appstore-switch .form-check-input {
    cursor: pointer;
}

/* Disabled packs read muted until switched on. */
.pcard-muted { opacity: 0.72; }
.pcard-muted:hover { opacity: 1; }

/* ── Ops console (action center) ──────────────────────────────────────── */
.ops-hero {
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius, 0.6rem);
    background: linear-gradient(180deg,
        color-mix(in oklch, var(--theme-primary) 7%, var(--theme-surface, #fff)),
        var(--theme-surface, #fff));
    padding: 1rem 1.1rem;
    margin-bottom: 1.5rem;
}

.ops-runlist {
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius, 0.6rem);
    overflow: hidden;
}

.ops-runrow {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    border-top: 1px solid var(--theme-border);
    cursor: pointer;
    transition: background .12s ease;
}

.ops-runrow:first-child { border-top: 0; }
.ops-runrow:hover { background: color-mix(in oklch, var(--theme-primary) 6%, transparent); }

.ops-run-main { flex: 1; min-width: 0; }
.ops-run-name { font-weight: 600; color: var(--theme-text-emphasis); }
.ops-run-sub { font-size: 0.76rem; color: var(--theme-text-secondary); }
.ops-run-time { font-size: 0.76rem; color: var(--theme-text-secondary); white-space: nowrap; }

/* status pill - colors come from severity helper classes already in use */
.ops-pill {
    font-size: 0.72rem;
    padding: 0.12rem 0.5rem;
    border-radius: 1rem;
    font-weight: 600;
}

/* The Test Center collapses to a slim strip so the Run Log gets the real estate. */
.ops-section-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0.5rem;
    padding: 0.55rem 0.9rem;
    background: var(--theme-surface, #fff);
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius, 0.6rem);
    color: var(--theme-text-emphasis);
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    margin-bottom: 1rem;
}
.ops-section-toggle:hover { background: color-mix(in oklch, var(--theme-primary) 4%, var(--theme-surface, #fff)); }
.ops-section-toggle .chev { margin-left: auto; transition: transform .15s ease; }
.ops-section-toggle.is-open .chev { transform: rotate(90deg); }
.ops-section-toggle .hint { font-weight: 400; color: var(--theme-text-secondary); font-size: 0.8rem; }

/* The Run Log filter strip — the "lotta stuff, need filters" answer. */
.ops-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: end;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius, 0.6rem);
    background: var(--theme-surface, #fff);
    margin-bottom: 0.75rem;
}
.ops-filters .ops-f { display: flex; flex-direction: column; gap: 0.2rem; min-width: 140px; flex: 1 1 140px; }
.ops-filters .ops-f label { font-size: 0.72rem; color: var(--theme-text-secondary); font-weight: 600; }
.ops-filters .ops-f-search { flex: 2 1 220px; }
.ops-filters .ops-f-actions { display: flex; gap: 0.4rem; align-items: center; margin-left: auto; }
.ops-filters .ops-f-count { font-size: 0.8rem; color: var(--theme-text-secondary); white-space: nowrap; }

/* No-match empty state inside a filtered list. */
.ops-runlist-empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--theme-text-secondary);
    border: 1px dashed var(--theme-border);
    border-radius: var(--theme-radius, 0.6rem);
}

/* ── Run detail dialog (modal-xl) ─────────────────────────────────────── */
/* Each logical section (Run header / Result / Input / Output / Steps) is a card. */
.ops-detail .ops-section {
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius, 0.6rem);
    background: var(--theme-surface, #fff);
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
}
/* ── Answer Center ────────────────────────────────────────────────────── */
.ansc-grid { display: flex; flex-direction: column; gap: 0.75rem; }

.ansc-jobcard {
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius, 0.6rem);
    background: var(--theme-surface, #fff);
    overflow: hidden;
}

.ansc-jobhead {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 1rem;
    width: 100%;
    background: transparent;
    border: 0;
    text-align: left;
    cursor: pointer;
    transition: background .12s ease;
}
.ansc-jobhead:hover { background: color-mix(in oklch, var(--theme-primary) 5%, transparent); }
.ansc-jobhead > .bi-folder2-open { font-size: 1.4rem; color: var(--theme-primary); flex: 0 0 auto; }
.ansc-jobhead .chev { color: var(--theme-text-secondary); transition: transform .15s ease; flex: 0 0 auto; }
.ansc-jobhead.is-open .chev { transform: rotate(90deg); }

.ansc-jobtitle { flex: 1; min-width: 0; }
.ansc-kit { font-weight: 700; color: var(--theme-text-emphasis); font-size: 1.05rem; line-height: 1.2; }
/* The job-number chip - three jobs on one anchor need telling apart (2026-07-03). */
.ansc-jobid {
    font-family: var(--theme-font-mono);
    font-size: .7rem;
    font-weight: 600;
    color: var(--theme-text-muted);
    background: var(--theme-background-subtle);
    border: 1px solid var(--theme-border);
    border-radius: 999px;
    padding: 0 .45rem;
    white-space: nowrap;
    vertical-align: middle;
}
.ansc-anchor { font-size: 0.82rem; color: var(--theme-text-secondary); margin-top: 0.15rem; }
.ansc-anchortext { color: var(--theme-text-emphasis); font-weight: 500; }

.ansc-jobmeta { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.ansc-kitcount {
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--theme-text-emphasis);
    padding: 0.15rem 0.55rem;
    border-radius: 0.35rem;
    background: color-mix(in oklch, var(--theme-success, #198754) 10%, transparent);
}
.ansc-date { font-size: 0.78rem; color: var(--theme-text-secondary); white-space: nowrap; }

.ansc-jobbody { border-top: 1px solid var(--theme-border); padding: 0.6rem 1rem 0.9rem; }
.ansc-toolbar { display: flex; gap: 0.5rem; justify-content: flex-end; margin-bottom: 0.4rem; }
.ansc-kittable { font-size: 0.9rem; margin-bottom: 0; }
.ansc-kittable code { font-size: 0.78rem; }

/* Reports for this job - the Report Center consumption strip under the kit table. */
.ansc-reports { margin-top: 0.75rem; border-top: 1px dashed var(--theme-border); padding-top: 0.55rem; }
.ansc-reports-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.3rem; }
.ansc-reports-title { font-weight: 600; font-size: 0.85rem; color: var(--theme-text-secondary); }
.ansc-reports-gen { display: flex; align-items: center; gap: 0.4rem; margin-left: auto; }
.ansc-reports-gen select { width: auto; max-width: 16rem; }
.ansc-reports-list { display: flex; flex-direction: column; gap: 0.2rem; }
.ansc-report-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0.25rem; border-radius: 0.3rem; font-size: 0.88rem; }
.ansc-report-row:hover { background: color-mix(in oklch, var(--theme-primary) 5%, transparent); }
.ansc-report-row i { color: var(--theme-offset); }
.ansc-report-name { font-weight: 500; }

/* Answer Story (PR1 Phase 2) - the per-workflow review tree (.ansc-story*) moved
   to UI.Runner.Components/wwwroot/runner.css so the shared AnswerStoryView RCL
   carries its own styling across Portal + Mobile + the proof packet. The Answer
   Center PAGE chrome above (.ansc-grid / .ansc-jobcard / .ansc-jobhead) and the
   proof-packet .ansc-print* rules below stay here - they are Portal-page only. */

/* Printable kit summary - a clean single-color report. */
.ansc-print {
    max-width: 8.5in;
    margin: 0.5in auto;
    padding: 0 0.5in;
    color: #222;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
.ansc-print-bar { margin-bottom: 1rem; }
/* The run's context facts on the print page - the same fact sheet the PDF header carries. */
.ansc-print-facts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 0.4rem 1.25rem;
    margin: 0.75rem 0 1rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius);
    background: var(--theme-surface);
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
}
.ansc-print-facts dt {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--theme-text-muted);
}
.ansc-print-facts dd { margin: 0; font-weight: 600; color: var(--theme-text-emphasis); }
.ansc-print-header { border-bottom: 2px solid #333; padding-bottom: 0.5rem; margin-bottom: 1rem; }
.ansc-print-header h1 { font-size: 1.4rem; margin: 0 0 0.2rem; }
.ansc-print-kit { font-size: 1.05rem; color: #444; margin-bottom: 0.3rem; }
.ansc-print-meta { display: flex; gap: 1.2rem; flex-wrap: wrap; color: #555; font-size: 0.85rem; }
.ansc-print-meta span { white-space: nowrap; }

.ansc-print-table { width: 100%; border-collapse: collapse; margin-bottom: 1.2rem; }
.ansc-print-table thead th {
    text-align: left;
    border-bottom: 1px solid #999;
    padding: 0.4rem 0.5rem;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #444;
    background: #f4f4f4;
}
.ansc-print-table tbody td {
    padding: 0.5rem;
    border-bottom: 1px solid #ddd;
    vertical-align: top;
    font-size: 0.92rem;
}
.ansc-print-num { font-variant-numeric: tabular-nums; color: #888; font-weight: 600; }
.ansc-print-status { padding: 0.1rem 0.5rem; border-radius: 0.3rem; font-size: 0.78rem; font-weight: 600; }
.ansc-print-status.is-complete { background: #d1e7dd; color: #0a3622; }
.ansc-print-status.is-pending { background: #fff3cd; color: #664d03; }

.ansc-print-footer { margin-top: 2rem; padding-top: 0.6rem; border-top: 1px solid #ddd; }
.ansc-print-genstamp { font-size: 0.75rem; color: #888; }

/* Job-report TOC + per-workflow story sections (2026-06-20). Print-page colors
   are intentionally fixed grays for monochrome proof-packet fidelity. */
/* The kit-level AI summary card on the proof-of-service packet (after the TOC). */
.ansc-print-aisummary {
    border: 1px solid var(--theme-border);
    border-left: 4px solid var(--theme-accent, var(--theme-primary));
    border-radius: .5rem;
    background: var(--theme-background-subtle);
    padding: .85rem 1rem;
    margin-bottom: 1.25rem;
}
.ansc-print-aisummary-text {
    white-space: pre-wrap;
    line-height: 1.45;
}
.ansc-print-aisummary-meta {
    margin-top: .4rem;
    font-size: .75rem;
    color: var(--theme-text-muted);
}
.ansc-print-toc {
    border: 1px solid #ddd; border-radius: 0.4rem;
    padding: 0.6rem 0.9rem; margin-bottom: 1.2rem; background: #fafafa;
}
.ansc-print-toc-title { font-weight: 700; color: #333; margin-bottom: 0.35rem; }
.ansc-print-toc ol { margin: 0; padding-left: 1.3rem; }
.ansc-print-toc li { margin: 0.15rem 0; }
.ansc-print-toc a { color: #0d6efd; text-decoration: none; }
.ansc-print-toc-meta { color: #888; font-size: 0.8rem; margin-left: 0.4rem; }

.ansc-print-section { margin-bottom: 1.4rem; }
.ansc-print-sectionhead {
    display: flex; align-items: center; gap: 0.6rem;
    background: #2c3440; color: #fff;
    padding: 0.5rem 0.8rem; border-radius: 0.4rem; margin-bottom: 0.7rem;
}
.ansc-print-sectionnum {
    background: rgba(255, 255, 255, 0.2); color: #fff;
    width: 1.6rem; height: 1.6rem; border-radius: 0.3rem; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem;
}
.ansc-print-sectiontitle { font-weight: 700; font-size: 1.02rem; }
.ansc-print-sectionmeta { margin-left: auto; font-size: 0.8rem; color: #cdd3db; white-space: nowrap; }
.ansc-print-nostory { color: #888; font-style: italic; padding: 0.5rem 0.2rem; }

@media print {
    /* Hide every chrome surface that isn't part of the report. */
    .wf-page-header, .ops-section-toggle, .ops-filters,
    .wf-sidebar, .wf-navbar, .wf-sidebar-mobilebar, .wf-shellbar, .copilot-panel,
    .d-print-none, button:not(.ansc-print-table button) { display: none !important; }

    /* THE pagination fix ("Total: 1 sheet of paper" bug). The app shell pins page
       content inside a 100vh scroll container (#app -> .wf-shell -> .wf-main, the
       last with overflow-y:auto), so the browser printed only the visible viewport.
       Neutralize the whole height/overflow/flex chain in print so the report flows
       across as many pages as it needs. */
    html, body {
        height: auto !important; min-height: 0 !important;
        overflow: visible !important; background: white;
    }
    #app, .wf-shell, .wf-shell--side, .wf-shell--top, .wf-main, .wf-main > .wf-page-area {
        display: block !important;
        height: auto !important; min-height: 0 !important; max-height: none !important;
        overflow: visible !important;
        padding-top: 0 !important;   /* drop the mobile top-bar offset that clipped the first step */
        margin: 0 !important;        /* the sheet's inset into the frame is chrome, not paper */
        border-radius: 0 !important;
        box-shadow: none !important;
        background: none !important;
    }

    /* Top padding bumps the first step down off the page edge (the brand bar is gone). */
    .ansc-print { margin: 0; padding: 0.3in 0 0 0; max-width: 100%; }
    .ansc-print-bar { display: none !important; }

    /* Keep the dark section bands (and INTERNAL badge) visible on paper. */
    .ansc-print-sectionhead {
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
        break-inside: avoid; break-after: avoid;
    }
    .ansc-print-section { break-inside: auto; }
    /* Avoid splitting a step card / TOC across a page boundary where possible. */
    .ansc-print-toc, .ansc-step, .ops-stepcard { break-inside: avoid; }
}

.ops-detail .ops-section h6 {
    font-size: 0.78rem;
    color: var(--theme-text-secondary);
    margin: 0 0 0.6rem 0;
    font-weight: 700;
}

/* Key/value grid for the run header — readable labels, big values. */
.ops-kv {
    display: grid;
    grid-template-columns: 9rem 1fr;
    gap: 0.4rem 1rem;
    align-items: baseline;
}
.ops-kv dt { font-size: 0.78rem; color: var(--theme-text-secondary); font-weight: 600; }
.ops-kv dd { margin: 0; color: var(--theme-text-emphasis); font-size: 0.92rem; word-break: break-word; }
@media (max-width: 576px) {
    .ops-kv { grid-template-columns: 1fr; gap: 0.1rem 0; }
    .ops-kv dd { margin-bottom: 0.5rem; }
}

/* Each step is its own card (was a cramped table cell). Collapses to header-only. */
.ops-stepcard {
    border: 1px solid var(--theme-border);
    border-radius: var(--theme-radius, 0.6rem);
    background: var(--theme-surface, #fff);
    margin-bottom: 0.5rem;
    overflow: hidden;
}
.ops-stepcard-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    border: 0;
    background: transparent;
    width: 100%;
    text-align: left;
}
.ops-stepcard-head:hover { background: color-mix(in oklch, var(--theme-primary) 5%, transparent); }
.ops-stepcard-head .ord { font-variant-numeric: tabular-nums; color: var(--theme-text-secondary); font-size: 0.8rem; min-width: 1.6rem; }
.ops-stepcard-head .kind { font-size: 0.72rem; padding: 0.1rem 0.45rem; border-radius: 0.25rem; background: color-mix(in oklch, var(--theme-text-emphasis) 8%, transparent); color: var(--theme-text-emphasis); font-weight: 600; }
.ops-stepcard-head .label { flex: 1; min-width: 0; font-weight: 600; color: var(--theme-text-emphasis); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-stepcard-head .dur { font-size: 0.76rem; color: var(--theme-text-secondary); white-space: nowrap; }
.ops-stepcard-head .chev { color: var(--theme-text-secondary); transition: transform .15s ease; }
.ops-stepcard-head.is-open .chev { transform: rotate(90deg); }
.ops-stepcard-body { padding: 0.6rem 0.9rem 0.9rem 0.9rem; border-top: 1px solid var(--theme-border); }
.ops-stepcard-body .ops-section { margin-bottom: 0.6rem; padding: 0.6rem 0.75rem; }
.ops-stepcard-body .ops-section:last-child { margin-bottom: 0; }

/* ── Workflow Designer list table ───────────────────────────────────────── */
/* The list surface (portal-look-and-feel 3.10): a card, a transparent sentence-case header in
   muted 12.5/600 over one hairline, ~56px two-line rows divided by a hairline, the card-hover
   fill on hover, numbers tabular. */
.wf-table-wrap { overflow-x: auto; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); background: var(--wf-card); box-shadow: var(--wf-elev-1); }
.wf-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.wf-table thead th {
    text-align: left; padding: 0.625rem 1rem; font-size: 0.78125rem; font-weight: 600;
    color: var(--theme-text-muted); white-space: nowrap;
    border-bottom: 1px solid var(--wf-line); background: transparent;
}
.wf-table tbody td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--wf-line); vertical-align: middle; }
.wf-table tbody tr:hover { background: var(--wf-card-hover); }
.wf-table tbody tr:last-child td { border-bottom: none; }
.wf-c-id { width: 64px; color: var(--theme-text-muted); font-variant-numeric: tabular-nums; }
.wf-c-steps { width: 90px; }
.wf-c-status { width: 210px; }
.wf-c-actions { width: 150px; }

.wf-prompt { display: flex; align-items: flex-start; gap: 0.65rem; }
.wf-prompt-ico {
    flex-shrink: 0; width: 38px; height: 38px; border-radius: var(--theme-radius);
    display: flex; align-items: center; justify-content: center;
    background: var(--theme-accent-muted); color: var(--theme-accent);
}
.wf-prompt-name { font-weight: 600; color: var(--theme-text-emphasis); }
.wf-prompt-desc {
    font-size: 0.8rem; color: var(--theme-text-secondary); margin-top: 2px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wf-prompt-meta { display: flex; align-items: center; gap: 0.5rem; margin-top: 4px; flex-wrap: wrap; }
.wf-prompt-internal { font-size: 0.7rem; color: var(--theme-text-muted); font-family: monospace; }
/* The small info chip (a fact about a row: a version, a context, a kind). A neutral soft pill;
   the pressable 32px chip is .wf-chip-toggle (components.css). */
.wf-chip {
    display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.72rem; font-weight: 500;
    padding: 2px 8px; border-radius: var(--wf-radius-pill); background: var(--wf-neutral-soft); color: var(--theme-text-secondary);
    text-decoration: none;
}
.wf-chip i { font-size: 0.75rem; color: var(--theme-text-muted); }
a.wf-chip:hover { background: var(--wf-primary-soft); color: var(--wf-primary-ink); text-decoration: none; }

/* Membership chips — which experience(s) carry this conversation, and their collection(s).
   Links into the experience / collection builders; soft fills in their tone's INK. */
.wf-chip-kit { background: var(--wf-primary-soft); color: var(--wf-primary-ink); text-decoration: none; }
.wf-chip-set { background: var(--wf-success-soft); color: var(--wf-success-ink); text-decoration: none; }
.wf-chip-kit i, .wf-chip-set i { color: inherit; }
.wf-chip-kit:hover, .wf-chip-set:hover { filter: brightness(0.96); text-decoration: none; }

.wf-steps { display: inline-flex; align-items: center; color: var(--theme-text-secondary); font-variant-numeric: tabular-nums; }

/* The row's scope / kind label (System / Shared / Personal; Data / PDF): a word in its tone's INK.
   The status PILL with a dot (Live / changes not live / Draft) is .wf-status-pill. */
.wf-status { display: inline-flex; align-items: center; font-size: 0.78rem; font-weight: 600; }
.wf-status-pub { color: var(--wf-success-ink); }
.wf-status-draft { color: var(--wf-warning-ink); }
.wf-status-none { color: var(--theme-text-muted); }
.wf-status-dates { font-size: 0.7rem; color: var(--theme-text-muted); margin-top: 3px; line-height: 1.4; }

.wf-actions { display: flex; align-items: center; gap: 0.35rem; }
.wf-act {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: var(--wf-radius-sm);
    border: 1px solid var(--wf-line-strong); background: var(--wf-card);
    color: var(--theme-text-secondary); cursor: pointer; text-decoration: none;
    transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.wf-act:hover { border-color: color-mix(in srgb, var(--wf-primary-ink) 45%, var(--wf-line-strong)); color: var(--wf-primary-ink); background: var(--wf-primary-soft); }
.wf-act-results:hover { border-color: color-mix(in srgb, var(--wf-success-ink) 45%, var(--wf-line-strong)); color: var(--wf-success-ink); background: var(--wf-success-soft); }
.wf-act-badge {
    position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; padding: 0 4px;
    border-radius: 999px; background: var(--theme-success); color: var(--theme-text-on-success);
    font-size: 0.62rem; font-weight: 700; display: flex; align-items: center; justify-content: center; line-height: 1;
}

/* ─────────────────────────────────────────────────────────────────────────
   Report Center builder (Ops -> /report-center). Three-pane workbench:
   template library | the Compose band editor canvas | the data-source arsenal.
   Mirrors the Data Studio ReportBuilder layout language. All --theme-* tokens.
   ───────────────────────────────────────────────────────────────────────── */
.rc-shell {
    display: grid; grid-template-columns: 260px minmax(0, 1fr) 300px; gap: 1rem;
    align-items: start;
}
@media (max-width: 1100px) { .rc-shell { grid-template-columns: 1fr; } }

.rc-library, .rc-arsenal {
    background: var(--theme-surface); border: 1px solid var(--theme-border);
    border-radius: 12px; padding: 0.75rem; max-height: calc(100vh - 220px); overflow-y: auto;
}
.rc-library-head, .rc-arsenal-head, .rc-bands-head {
    font-weight: 700; font-size: 0.8rem;
    color: var(--theme-text-muted); margin-bottom: 0.5rem;
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
.rc-lib-item {
    width: 100%; text-align: left; border: 1px solid var(--theme-border); background: var(--theme-bg);
    border-radius: 9px; padding: 0.5rem 0.6rem; margin-bottom: 0.4rem; cursor: pointer;
    display: flex; flex-direction: column; gap: 0.3rem;
}
.rc-lib-item:hover { border-color: var(--theme-primary); }
.rc-lib-item.is-active { border-color: var(--theme-primary); box-shadow: 0 0 0 2px var(--theme-primary-soft, rgba(13,110,253,0.15)); }
.rc-lib-name { font-weight: 600; color: var(--theme-text); }
.rc-lib-tags { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.rc-tag {
    font-size: 0.62rem; font-weight: 700; padding: 0.1rem 0.4rem; border-radius: 999px;
    background: var(--theme-offset-soft, rgba(13,110,253,0.12)); color: var(--theme-offset);
}
.rc-tag-trigger { background: var(--theme-border); color: var(--theme-text-muted); }

.rc-canvas {
    background: var(--theme-surface); border: 1px solid var(--theme-border);
    border-radius: 12px; padding: 1rem; min-height: 320px;
}
.rc-canvas-empty { display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--theme-text-muted); text-align: center; gap: 0.5rem; }
.rc-empty-icon { font-size: 2.5rem; opacity: 0.4; }
.rc-empty { color: var(--theme-text-muted); font-size: 0.85rem; padding: 0.5rem 0; }

.rc-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.75rem; }
.rc-name { max-width: 200px; }
.rc-sel { max-width: 190px; }
.rc-kit { max-width: 140px; }
.rc-toolbar-actions { display: flex; gap: 0.4rem; margin-left: auto; }

.rc-issues { margin-bottom: 0.6rem; }
.rc-issue { font-size: 0.82rem; padding: 0.35rem 0.55rem; border-radius: 7px; margin-bottom: 0.25rem; }
.rc-issue-error { background: var(--theme-danger-soft, rgba(220,53,69,0.12)); color: var(--theme-danger); }
.rc-issue-warning { background: var(--theme-warning-soft, rgba(255,193,7,0.14)); color: var(--theme-warning); }
.rc-status { font-size: 0.85rem; color: var(--theme-text-muted); margin-bottom: 0.6rem; }

.rc-bands { border-top: 1px solid var(--theme-border); padding-top: 0.6rem; }
.rc-addband { display: flex; gap: 0.35rem; align-items: center; }
.rc-band { border: 1px solid var(--theme-border); border-radius: 9px; padding: 0.55rem; margin: 0.5rem 0; background: var(--theme-bg); }
.rc-band-head { display: flex; align-items: center; justify-content: space-between; }
.rc-band-kind { font-weight: 700; font-size: 0.8rem; color: var(--theme-offset); text-transform: capitalize; }
.rc-band-ops .btn { padding: 0 0.3rem; }
.rc-band-note { font-size: 0.8rem; color: var(--theme-text-muted); font-style: italic; padding: 0.25rem 0; }
.rc-fields { margin-top: 0.4rem; display: flex; flex-direction: column; gap: 0.35rem; }
.rc-field-row { display: flex; gap: 0.35rem; align-items: center; }
.rc-flabel { max-width: 160px; }
.rc-fbind { flex: 1; font-family: var(--theme-font-mono); font-size: 0.8rem; }

.rc-preview-row { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.85rem; border-top: 1px solid var(--theme-border); padding-top: 0.75rem; }
.rc-preview-hint { font-size: 0.78rem; color: var(--theme-text-muted); }

.rc-src-group { margin-bottom: 0.6rem; }
.rc-src-grouphead { font-weight: 600; font-size: 0.78rem; color: var(--theme-text); margin: 0.3rem 0; }
.rc-src-field {
    width: 100%; text-align: left; border: 1px solid var(--theme-border); background: var(--theme-bg);
    border-radius: 7px; padding: 0.3rem 0.45rem; margin-bottom: 0.2rem; cursor: pointer;
    display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; font-size: 0.8rem;
}
.rc-src-field:hover { border-color: var(--theme-primary); }
.rc-src-dt { font-size: 0.68rem; color: var(--theme-text-muted); }
.rc-copied { font-size: 0.78rem; padding: 0.35rem 0.5rem; margin-bottom: 0.5rem; border-radius: 7px;
    background: var(--theme-success-soft, rgba(25,135,84,0.12)); color: var(--theme-success); }
.rc-copied code { color: var(--theme-text); }

/* Source-workflow multi-select (drives the answer fields + enrichment suggestions). */
.rc-wf-pick { border: 1px solid var(--theme-border); border-radius: 7px; padding: 0.5rem; margin-bottom: 0.6rem; }
.rc-wf-hint { font-size: 0.72rem; color: var(--theme-text-muted); margin-bottom: 0.4rem; }
.rc-wf-check { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; padding: 0.15rem 0; cursor: pointer; }

/* Enrichment suggestions - actionable (copy the keyBind). */
.rc-enrich { border-left: 3px solid var(--theme-primary); }

/* Relationship reaches - informational (which related entities a source can reach). */
.rc-rel { border: 1px solid var(--theme-border); border-radius: 7px; padding: 0.4rem 0.5rem; margin-bottom: 0.35rem; }
.rc-rel-from { font-weight: 600; font-size: 0.78rem; color: var(--theme-text); margin-bottom: 0.2rem; }
.rc-reach { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem;
    font-size: 0.78rem; color: var(--theme-text-muted); padding: 0.12rem 0; }

/* The preview job picker grows to fill the row. */
.rc-jobpick { flex: 1 1 auto; min-width: 12rem; }

/* The report designer's band internals (rcd-*) moved to report-center.css with the rest of the Report
   Center (portal-look-and-feel 3.18, 2026-10-03) - one stylesheet owns each class. */
