/* =====================================================================
   THE REPORT CENTER, in the new frame (portal-look-and-feel.md 3.18 -
   the third center, after Launch Control and the Answer Center).
   ---------------------------------------------------------------------
   One stylesheet for the whole center, three prefixes, every class
   owned by this file alone (Tests/ConversationBuilderCssOwnershipTests):
     rpc-  the library (/report-center) and the frame around the report
           designer's start screen;
     rcd-  the report designer's band internals (moved here from
           app-cards.css, 2026-10-03);
     rdz-  the report designer (/report-center/builder, rebuilt
           2026-09-30 - Kirk: "Templates - wasting a whole rail on the
           left ... Then there will be room to actually work"): the start
           cards, the report bar, the palette, the page, the setup /
           preview / confirm dialogs.
   (report-designer.css is this file's old name.)

   The shared pieces come from components.css (the KPI tile, the
   segmented control, status pills, the code chip, empty states,
   skeletons) and wf.css (cards, tables, buttons, forms, dialogs); this
   file only lays them out.

   TOKENS ONLY, the whole file (Tests/ShellTokensOnlyTests): no hex, no
   rgb() / hsl(), no colour keyword - every colour reads a --wf-*,
   --theme-* or --conv-* token. The one named exception is the print
   preview's paper (.rdz-preview-frame): the rendered report is printed
   on white whatever the Portal theme - content, not chrome (the
   .wf-qr rule).

   The colour grammar (3.3): primary ink for marks, links and selection;
   a state is a word with a dot in its state ink (a running schedule
   success, a paused one neutral); never the offset or info hues on
   anything that is not a Flow or Say moment.
   ===================================================================== */

/* =====================================================================
   THE LIBRARY (rpc-)
   ===================================================================== */

/* ---- The page: cards on the 8px rhythm (16-20 between cards) ---- */
.rpc-page { min-width: 0; }
.rpc-stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* ---- A card's head: the title 15/650, one muted sentence ---- */
/* A card that holds a dropdown must not clip it: wf.css's .card is overflow: hidden. */
.rpc-card { min-width: 0; overflow: visible; }
.rpc-card-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 14px; padding: 18px 20px 0; }
.rpc-card-words { flex: 1 1 16rem; min-width: 0; }
.rpc-card-title { margin: 0; color: var(--theme-text-emphasis); font-size: var(--wf-text-h3); font-weight: 650; letter-spacing: -0.005em; }
.rpc-card-sub { max-width: 68ch; margin: 3px 0 0; color: var(--theme-text-secondary); font-size: 13px; line-height: 1.45; }
.rpc-card > .wf-empty { padding-bottom: 28px; }

/* ---- Notes, the calm failure, the first-report invitation ---- */
.rpc-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0; color: var(--theme-text-muted); font-size: 12.5px; line-height: 1.45; }
.rpc-note > .bi { color: var(--wf-primary-ink); }
.rpc-note.is-boxed { padding: 12px 16px; border-radius: var(--wf-radius-md); background: var(--wf-inset); color: var(--theme-text-secondary); font-size: 13px; }
.rpc-card-note { margin: 12px 20px 0; }
.rpc-failed { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 14px; padding: 16px 18px; }
.rpc-failed-text { flex: 1 1 18rem; min-width: 0; margin: 0; color: var(--theme-text-secondary); font-size: 13.5px; }
.rpc-first { padding: 12px 0; overflow: visible; }
/* Stories (STORY-4, design 8.1 "Joins"): one row that opens the Story's books - the Story page owns them. */
.rpc-stories { display: flex; flex-direction: row; align-items: center; gap: 14px; padding: 14px 18px; color: inherit; text-decoration: none; }
.rpc-stories:hover { box-shadow: var(--wf-elev-2); }
.rpc-stories-words { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.rpc-stories-title { font-weight: 650; font-size: 15px; color: var(--theme-text-emphasis); }
.rpc-stories-text { font-size: 13px; color: var(--theme-text-secondary); }
.rpc-stories-open { font-size: 13px; font-weight: 600; color: var(--wf-primary-ink); white-space: nowrap; }
.rpc-start-page > .rpc-note { margin-bottom: 16px; }

/* ---- Skeletons in the shape of what is coming ---- */
.rpc-skel-kpi { height: 66px; }
.rpc-skel-title { width: 9rem; height: 14px; }
.rpc-skel-sub { width: min(28rem, 80%); margin-top: 8px; }
.rpc-skel-rows { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 20px; }
.rpc-skel-row { height: 48px; }

/* ---- The numbers (the shared KPI tile, components.css) ---- */
/* Four tiles: one row of four, or two rows of two on a narrow page - never three and a dangling one (the Answer Center's balanced rows). */
.rpc-kpis { margin: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---- New report (the header's one primary - a menu of the two kinds) ---- */
.rpc-new { flex: none; }
.rpc-new-list { width: min(21rem, calc(100vw - 32px)); }
.rpc-new-list .wf-action-menu-item { align-items: flex-start; }
.rpc-new-list .wf-action-menu-item > .bi { margin-top: 9px; }
.rpc-menu-text { display: flex; flex-direction: column; min-width: 0; padding: 6px 0; line-height: 1.35; }
.rpc-menu-text > b { color: var(--theme-text-emphasis); font-weight: 600; }
.rpc-menu-text > small { color: var(--theme-text-muted); font-size: 12px; white-space: normal; }
/* The invitation's button is CENTRED: its list opens centred under it, as wide as the screen allows. */
.rpc-new-list.is-centered[role="menu"] { right: auto; left: calc(50% - min(10.5rem, (100vw - 32px) / 2)); }

/* =====================================================================
   EVERY REPORT (portal-look-and-feel 3.10) - one card: the lens and the
   search, then a row per report (~56px: a title and a muted sub-line),
   the kind, how people get it, and the row actions on hover / focus
   (always on touch).

   NOTHING SCROLLS SIDEWAYS, AT ANY WIDTH: the table is table-layout:
   fixed at 100% of its card - the kind and the action columns are
   declared (.rpc-col-*), the report and how people get it share the
   rest, and a long name ellipsises (its title holds the whole name)
   instead of widening the table. At 760px of page and narrower each row
   becomes a stacked card. The card itself never clips: the layout makes
   the table fit (design/portal/report-center/sweep.html measures it
   every 20px from 320 to 1600, rail open and folded;
   Tests/ReportCenterPortalTests pins the arithmetic).
   ===================================================================== */
.rpc-reports { overflow: visible; }
.rpc-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 20px 4px; }
.rpc-lens { max-width: 100%; }
.rpc-lens > button { display: inline-flex; align-items: center; gap: 6px; }
.rpc-lens-count { color: var(--theme-text-muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.rpc-lens > button[aria-pressed="true"] .rpc-lens-count { color: var(--theme-text-secondary); }
.rpc-search {
    display: flex;
    flex: 0 1 18rem;
    align-items: center;
    gap: 8px;
    min-width: 12rem;
    height: 36px;
    margin-left: auto;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: var(--wf-radius-sm);
    background: var(--wf-inset);
    color: var(--theme-text-muted);
    transition: background var(--wf-motion), border-color var(--wf-motion);
}
.rpc-search:focus-within { border-color: var(--wf-primary-ink); background: var(--wf-card); box-shadow: var(--theme-focus-ring); }
.rpc-search-input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: var(--theme-text-emphasis); font: inherit; font-size: 13.5px; }
.rpc-search-input::placeholder { color: var(--theme-text-muted); }

.rpc-table { width: 100%; margin: 10px 0 0; table-layout: fixed; }
/* The declared columns (the header row sets them - fixed layout): the kind (a word and a date), the row actions (at
   most three icon buttons). The report and how people get it share what is left. */
.rpc-col-report, .rpc-col-reach { width: auto; }
.rpc-col-kind { width: 10.5rem; }
.rpc-col-actions { width: 8.25rem; }
.rpc-table > thead > tr > th:first-child,
.rpc-table > tbody > tr > td:first-child { padding-left: 20px; }
.rpc-table > thead > tr > th:last-child,
.rpc-table > tbody > tr > td:last-child { padding-right: 14px; }
.rpc-table > tbody > tr > td { padding-top: 11px; padding-bottom: 11px; vertical-align: top; }
.rpc-row { transition: background var(--wf-motion); }
.rpc-row:hover { background: var(--wf-card-hover); }

.rpc-name { display: block; min-width: 0; overflow: hidden; color: var(--theme-text-emphasis); font-size: 13.5px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.rpc-desc { display: block; min-width: 0; margin-top: 2px; overflow: hidden; color: var(--theme-text-secondary); font-size: 12.5px; white-space: nowrap; text-overflow: ellipsis; }
.rpc-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; margin-top: 4px; color: var(--theme-text-muted); font-size: 12px; }
.rpc-code { display: inline-block; max-width: 100%; overflow: hidden; line-height: 22px; white-space: nowrap; text-overflow: ellipsis; }
.rpc-system { display: inline-flex; align-items: center; gap: 4px; color: var(--theme-text-secondary); }
.rpc-kind { display: inline-flex; align-items: center; gap: 6px; color: var(--theme-text); font-size: 13px; font-weight: 500; }
.rpc-kind > .bi { color: var(--wf-primary-ink); }

/* How people get it: the live charts (a link), the schedule (a state word with a dot), or one quiet line. */
.rpc-reach { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.rpc-live {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 24px;
    padding: 0 10px;
    border-radius: var(--wf-radius-pill);
    background: var(--wf-primary-soft);
    color: var(--wf-primary-ink);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.rpc-live:hover { background: color-mix(in srgb, var(--wf-primary-soft), var(--theme-primary) 10%); color: var(--wf-primary-ink); text-decoration: none; }
.rpc-live:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: 2px; }
.rpc-reach .wf-status-pill > .bi { font-size: 11px; }
.rpc-reach-line { display: inline-flex; align-items: flex-start; gap: 6px; min-width: 0; color: var(--theme-text-secondary); font-size: 12.5px; line-height: 1.45; }
.rpc-reach-line > .bi { flex: none; margin-top: 1px; color: var(--wf-primary-ink); }
.rpc-reach-line.is-unknown { color: var(--theme-text-muted); cursor: help; }
.rpc-reach-line.is-unknown > .bi { color: var(--theme-text-muted); }

.rpc-cell-actions { white-space: nowrap; }
.rpc-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; opacity: 0; transition: opacity var(--wf-motion); }
.rpc-row:hover .rpc-actions,
.rpc-row:focus-within .rpc-actions { opacity: 1; }
@media (hover: none) {
    .rpc-actions { opacity: 1; }
}
.rpc-iconbtn { width: 32px; height: 32px; padding: 0; justify-content: center; }
.rpc-iconbtn > .bi { font-size: 15px; }
.rpc-table-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 12px 20px 16px; border-top: 1px solid var(--wf-line); color: var(--theme-text-muted); font-size: 12.5px; }
.rpc-foot-note { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--theme-text-secondary); }
.rpc-foot-note > .bi { color: var(--wf-primary-ink); }

/* =====================================================================
   THE DEPLOY WIZARD (a .modal dialog over the page): the running
   schedule's panel, the fields in the house form shape (3.11 - the
   label above, one hint, no red star: the role list is aria-required
   and its error says what to do), the result.
   ===================================================================== */
.rpc-deploy-title { display: flex; align-items: center; gap: 8px; font-size: 1.0625rem; }
.rpc-deploy-body { display: flex; flex-direction: column; gap: 16px; }
.rpc-deploy-intro { margin: 0; color: var(--theme-text-secondary); font-size: 13.5px; line-height: 1.5; }
.rpc-sched { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--wf-line); border-radius: var(--wf-radius-md); background: var(--theme-background-subtle); }
.rpc-sched-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.rpc-sched-title { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--theme-text-emphasis); font-size: 14px; font-weight: 650; }
.rpc-sched-title > .bi { color: var(--wf-primary-ink); }
.rpc-sched .wf-status-pill > .bi { font-size: 11px; }
.rpc-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 0; padding: 0; color: var(--theme-text-secondary); font-size: 12.5px; list-style: none; }
.rpc-facts > li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.rpc-facts > li > .bi { flex: none; color: var(--wf-primary-ink); }
.rpc-facts.is-stacked { flex-direction: column; align-items: flex-start; }
.rpc-sched-edit { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; border-top: 1px solid var(--wf-line); }
.rpc-sched-confirm { margin: 0; color: var(--theme-text); font-size: 13.5px; }
.rpc-button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rpc-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rpc-field > .form-label { margin: 0; }
.rpc-cadence { max-width: 16rem; }
.rpc-hint { margin: 0; color: var(--theme-text-muted); font-size: 12.5px; line-height: 1.45; }
.rpc-hint.is-error { display: flex; align-items: center; gap: 6px; color: var(--wf-danger-ink); font-weight: 500; }
.rpc-switch { flex-wrap: wrap; align-items: flex-start; row-gap: 2px; }
.rpc-switch > .form-check-input { margin-top: 2px; }
.rpc-switch > .rpc-hint { flex-basis: 100%; padding-left: 1.5rem; }
.rpc-sched-new { display: flex; flex-direction: column; gap: 12px; margin-left: 1.5rem; padding-left: 14px; border-left: 2px solid var(--wf-line); }
.rpc-roles-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.rpc-roles-field > legend { float: none; width: auto; margin: 0 0 2px; padding: 0; }
.rpc-roles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 2px 12px;
    max-height: 12rem;
    padding: 8px 10px;
    overflow-y: auto;
    border: 1px solid var(--wf-line-strong);
    border-radius: var(--wf-radius-sm);
    background: var(--wf-card);
}
.rpc-roles-field[aria-invalid="true"] > .rpc-roles { border-color: var(--theme-danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-danger) 18%, transparent); }
.rpc-role { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 28px; margin: 0; color: var(--theme-text); font-size: 13px; cursor: pointer; }
.rpc-role > span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rpc-inline-alert { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 10px 14px; font-size: 13px; }
.rpc-done { display: flex; flex-direction: column; gap: 12px; }
.rpc-done-open { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.rpc-done-url { min-width: 0; color: var(--theme-text-muted); font-size: 12px; overflow-wrap: anywhere; }

/* =====================================================================
   NARROWER PAGES (the page area is the size container - .wf-page-area)
   ===================================================================== */

/* THE STACKED TABLE (760px of page and narrower): each report becomes a stacked card. The report is its title (the
   name, the description, the code chip), the kind and how people get it two labelled lines side by side, the actions
   always on show - in a column on the right while there is room, on their own row on a phone. The header row is hidden
   (visually); each cell carries its label. Nothing scrolls sideways. */
@container page (max-width: 760px) {
    .rpc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rpc-table, .rpc-table > tbody { display: block; width: 100%; }
    .rpc-table > thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .rpc-table > tbody > tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
        grid-template-areas:
            "report report act"
            "kind reach act";
        gap: 10px 16px;
        padding: 14px 20px;
    }
    .rpc-table > tbody > tr > td,
    .rpc-table > tbody > tr > td:first-child,
    .rpc-table > tbody > tr > td:last-child { display: flex; flex-direction: column; min-width: 0; padding: 0; border: 0; }
    .rpc-cell-report { grid-area: report; }
    .rpc-cell-kind { grid-area: kind; }
    .rpc-cell-reach { grid-area: reach; }
    .rpc-cell-actions { grid-area: act; align-self: start; }
    .rpc-cell-kind[data-label]::before,
    .rpc-cell-reach[data-label]::before {
        content: attr(data-label);
        margin-bottom: 3px;
        color: var(--theme-text-muted);
        font-size: 11.5px;
        font-weight: 600;
    }
    .rpc-name, .rpc-desc { white-space: normal; }
    .rpc-actions { opacity: 1; }
}

/* THE PHONE: the stacked card's actions take their own row, as bordered 40px buttons; the lens is a swipe row. */
@container page (max-width: 640px) {
    .rpc-card-head { padding: 16px 16px 0; }
    .rpc-card-note { margin: 12px 16px 0; }
    .rpc-toolbar { padding: 12px 16px 2px; }
    .rpc-lens { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .rpc-lens::-webkit-scrollbar { display: none; }
    .rpc-lens > button { flex: none; }
    .rpc-search { flex: 1 1 100%; margin-left: 0; }

    .rpc-table > tbody > tr {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas:
            "report report"
            "kind reach"
            "act act";
        gap: 10px 12px;
        padding: 14px 16px;
    }
    .rpc-actions { justify-content: flex-end; gap: 6px; }
    .rpc-iconbtn { width: 40px; height: 40px; border: 1px solid var(--wf-line-strong); background: var(--wf-card); }
    .rpc-table-foot { padding: 12px 16px 14px; }
    .rpc-skel-rows { padding: 16px; }
}

/* Where the page header puts its actions at the LEFT (root.css: @media (max-width: 767.98px) - a viewport rule, so this
   one is too), New report's list opens from its start, inward. [role] out-ranks the shared end alignment. */
@media (max-width: 767.98px) {
    .rpc-new-list[role="menu"] { right: auto; left: 0; }
    .rpc-new-list.is-centered[role="menu"] { left: calc(50% - min(10.5rem, (100vw - 32px) / 2)); }
    .rpc-sched-new { margin-left: 0; }
}

/* A TOUCH SCREEN (portal-look-and-feel 3.17): 44px targets and a 16px input (a smaller one makes iOS zoom on focus).
   The action column widens to hold its 44px buttons - the stacking rule's arithmetic counts this width. */
@media (pointer: coarse) {
    .rpc-search { height: 44px; }
    .rpc-search-input { font-size: 16px; }
    .rpc-lens > button { min-width: 44px; min-height: 44px; justify-content: center; }
    .rpc-deploy .btn-close { min-width: 44px; min-height: 44px; }
    .rpc-switch > .form-check-label { display: inline-flex; align-items: center; min-height: 44px; }
    .rpc-iconbtn { width: 44px; height: 44px; }
    .rpc-col-actions { width: 10.25rem; }
    .rpc-live { min-height: 44px; }
    .rpc-role { min-height: 44px; }
    .rpc-page .btn-sm, .rpc-deploy .btn-sm { min-width: 44px; min-height: 44px; }
    .rpc-deploy .form-control, .rpc-deploy .form-select { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .rpc-row, .rpc-actions, .rpc-search { transition: none; }
}

/* =====================================================================
   THE BAND INTERNALS (rcd-) - the report designer's blocks on the page.
   Pure-Blazor HTML5 drag and drop; a [[ ]] token renders as a friendly
   chip (plumbing, not UX). They sit BEFORE the designer's rules below
   (they loaded first from app-cards.css), so the page's .rdz-page
   restyling wins exactly as it did.
   ===================================================================== */

/* Inter-band drop zones - invisible until a drag is live. */
.rcd-drop { height: 6px; border-radius: 4px; margin: 2px 0; transition: height 0.1s ease; }
.rcd-drop span { display: none; }
.rcd-drop.is-active { height: 22px; border: 1.5px dashed color-mix(in oklch, var(--theme-primary) 55%, transparent);
    background: color-mix(in oklch, var(--theme-primary) 6%, transparent);
    display: flex; align-items: center; justify-content: center; }
.rcd-drop.is-active span { display: inline; font-size: 0.68rem; color: var(--wf-primary-ink); font-weight: 600; }
.rcd-drop.is-active.is-hover { background: color-mix(in oklch, var(--theme-primary) 16%, transparent); border-style: solid; }

/* A band on the paper. */
.rcd-band { border: 1px solid transparent; border-radius: 8px; padding: 0.15rem 0.35rem 0.35rem; cursor: pointer; }
.rcd-band:hover { border-color: var(--wf-line-strong); }
.rcd-band.is-selected { border-color: var(--theme-primary); box-shadow: 0 0 0 2px color-mix(in oklch, var(--theme-primary) 18%, transparent); }
.rcd-band.is-hover { background: color-mix(in oklch, var(--theme-primary) 5%, transparent); }
.rcd-band-head { display: flex; align-items: center; gap: 0.4rem; cursor: grab; padding: 0.1rem 0; }
.rcd-band-head:active { cursor: grabbing; }
.rcd-band-ico { color: var(--theme-text-muted); font-size: 0.85rem; }
.rcd-band-title { font-size: 0.68rem; font-weight: 700; color: var(--theme-text-muted); }
.rcd-band-x { margin-left: auto; border: 0; background: none; color: var(--theme-text-muted); padding: 0 0.2rem; visibility: hidden; }
.rcd-band:hover .rcd-band-x, .rcd-band.is-selected .rcd-band-x { visibility: visible; }
.rcd-band-x:hover { color: var(--wf-danger-ink); }
.rcd-align { display: inline-flex; gap: 1px; margin-left: 0.4rem; }
.rcd-align button { border: 1px solid var(--wf-line-strong); background: var(--wf-card); color: var(--theme-text-muted);
    padding: 0 0.3rem; font-size: 0.72rem; border-radius: 4px; line-height: 1.3; }
.rcd-align button.is-on { background: var(--theme-primary); border-color: var(--theme-primary); color: var(--theme-text-on-primary); }
.rcd-band-body { padding: 0.15rem 0.2rem; }
.rcd-al-center { text-align: center; }
.rcd-al-right { text-align: right; }

/* WYSIWYG field rows - label + a friendly VALUE CHIP (the token is a tooltip, never typed). */
.rcd-fields { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; }
.rcd-al-center .rcd-fields { justify-content: center; }
.rcd-al-right .rcd-fields { justify-content: flex-end; }
.rcd-field { display: flex; align-items: center; gap: 0.35rem; }
.rcd-field-labelro { font-size: 0.72rem; color: var(--theme-text-muted); }
.rcd-field-label { border: 1px solid var(--wf-line-strong); border-radius: 5px; font-size: 0.75rem; padding: 0.1rem 0.3rem; max-width: 9.5rem; background: var(--wf-card); color: var(--theme-text); }
.rcd-chip { display: inline-flex; align-items: center; background: var(--wf-primary-soft);
    color: var(--wf-primary-ink); border-radius: 5px; padding: 0.08rem 0.42rem; font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.rcd-agg { border: 1px solid var(--wf-line-strong); border-radius: 5px; font-size: 0.72rem; padding: 0.08rem 0.2rem; background: var(--wf-card); color: var(--theme-text); max-width: 11rem; }
.rcd-field-x { border: 0; background: none; color: var(--theme-text-muted); padding: 0; }
.rcd-field-x:hover { color: var(--wf-danger-ink); }
.rcd-hint { font-size: 0.76rem; color: var(--theme-text-muted); font-style: italic; }
.rcd-note { font-size: 0.76rem; color: var(--theme-text-muted); }
.rcd-warnchip { font-size: 0.68rem; background: var(--wf-warning-soft); color: var(--wf-warning-ink); border-radius: 999px; padding: 0.06rem 0.45rem; }

.rcd-text { font-size: 0.88rem; color: var(--theme-text); line-height: 1.6; }
.rcd-story, .rcd-step, .rcd-imageband, .rcd-chart { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--theme-text); flex-wrap: wrap; }
.rcd-story i, .rcd-step i, .rcd-imageband i { color: var(--wf-primary-ink); }
.rcd-step-name { font-weight: 600; }
.rcd-curate { margin-top: 0.4rem; border-top: 1px dashed var(--wf-line-strong); padding-top: 0.4rem; max-height: 13rem; overflow-y: auto; }
.rcd-curate-row { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; padding: 0.12rem 0; cursor: pointer; }
.rcd-curate-wf { margin-left: auto; font-size: 0.68rem; color: var(--theme-text-muted); }
.rcd-imgw { width: 4.2rem; border: 1px solid var(--wf-line-strong); border-radius: 5px; font-size: 0.78rem; padding: 0.1rem 0.3rem; background: var(--wf-card); color: var(--theme-text); }
.rcd-imgcap { max-width: 12rem; }

/* Chart colour swatches (theme tokens + a custom colour picker). The chart glyph wears the chart's own colour (content
   the author picked - set inline from the band). */
.rcd-swatches { display: inline-flex; align-items: center; gap: 0.25rem; }
.rcd-swatch { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--wf-card); outline: 1px solid var(--wf-line-strong); padding: 0; cursor: pointer; }
.rcd-swatch.is-on { outline: 2px solid var(--theme-text); }
.rcd-swatch-custom { width: 22px; height: 20px; border: 1px solid var(--wf-line-strong); border-radius: 5px; padding: 0; background: var(--wf-card); cursor: pointer; }
.rcd-swatch-custom.is-on { outline: 2px solid var(--theme-text); }

/* Table band - a data source + its column chips (views / reports / entities / the answer set). */
.rcd-tableband { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; color: var(--theme-text); }
.rcd-tableband-src { display: flex; align-items: center; gap: 0.4rem; }
.rcd-tableband-src i { color: var(--wf-primary-ink); }
.rcd-tableband-name { font-weight: 600; }
.rcd-tablecols { display: flex; flex-wrap: wrap; gap: 0.3rem 0.55rem; }
.rcd-tablecol { display: inline-flex; align-items: center; gap: 0.25rem; border: 1px solid var(--wf-line); border-radius: 7px; padding: 0.12rem 0.4rem; background: color-mix(in oklch, var(--theme-primary) 4%, var(--wf-card)); }
.rcd-tablecol-head { font-size: 0.78rem; font-weight: 600; }

/* Columns band - the L/C/R cells, each its own nested drop canvas. */
.rcd-cols { display: flex; gap: 0.6rem; align-items: stretch; }
.rcd-col { flex: 1; min-width: 0; border: 1px dashed var(--wf-line-strong); border-radius: 7px; padding: 0.25rem; position: relative; }
.rcd-cell-x { position: absolute; top: 0.15rem; right: 0.15rem; border: 0; background: none; color: var(--theme-text-muted); padding: 0; }
.rcd-cell-add { border: 1px dashed var(--wf-line-strong); background: none; color: var(--theme-text-muted); border-radius: 7px; padding: 0 0.5rem; }
.rcd-cell-add:hover, .rcd-cell-x:hover { color: var(--wf-primary-ink); border-color: var(--wf-primary-ink); }

.rcd-divider { border: 0; border-top: 1px solid var(--wf-line-strong); margin: 0.3rem 0; }
.rcd-spacer { height: 14px; background: repeating-linear-gradient(45deg, transparent, transparent 5px, color-mix(in oklch, var(--theme-border) 55%, transparent) 5px, color-mix(in oklch, var(--theme-border) 55%, transparent) 6px); border-radius: 4px; }
.rcd-pagebreak { border-top: 2px dashed var(--wf-line-strong); text-align: center; margin-top: 0.55rem; }
.rcd-pagebreak span { position: relative; top: -0.72rem; background: var(--wf-card); padding: 0 0.5rem; font-size: 0.66rem; color: var(--theme-text-muted); }

/* Fill in my own form - the uploaded source PDF (PDF.js) with the placements over it. The pages are the form itself
   (content), so the placements read on the paper in the brand's own colour. */
.rcd-fill-bar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.rcd-fill-upload { position: relative; overflow: hidden; }
.rcd-fill-upload input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.rcd-fill-inspector { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; border: 1px solid var(--wf-line);
    border-radius: 8px; padding: 0.4rem 0.55rem; margin-bottom: 0.5rem; background: var(--wf-card); }
.rcd-fill-named { font-size: 0.72rem; color: var(--wf-success-ink); background: var(--wf-success-soft);
    border-radius: 999px; padding: 0.1rem 0.5rem; }
.rcd-fill-pages { display: flex; flex-direction: column; gap: 0.9rem; align-items: center; }
.rcd-fill-pagewrap { position: relative; display: inline-block; box-shadow: var(--wf-elev-2); border: 1px solid var(--wf-line); }
.rcd-fill-pagewrap canvas { display: block; }
.rcd-fill-widget { position: absolute; border: 1px dashed color-mix(in oklch, var(--theme-success) 65%, transparent);
    background: color-mix(in oklch, var(--theme-success) 7%, transparent); border-radius: 2px; }
.rcd-fill-pages.is-place .rcd-fill-widget { background: color-mix(in oklch, var(--theme-success) 18%, transparent); }
.rcd-fill-place { position: absolute; display: flex; align-items: center; overflow: hidden; cursor: grab;
    border: 1.5px solid var(--theme-primary); background: color-mix(in oklch, var(--theme-primary) 12%, transparent);
    border-radius: 3px; font-size: 10px; color: var(--theme-primary); font-weight: 600; padding: 0 3px; white-space: nowrap; }
.rcd-fill-place:active { cursor: grabbing; }
.rcd-fill-place.is-selected { border-width: 2.5px; box-shadow: 0 0 0 2px color-mix(in oklch, var(--theme-primary) 35%, transparent); }
.rcd-fill-t-signature { border-style: dashed; }
.rcd-fill-t-image { border-style: dotted; }
/* During drags the drop target must be the PAGE (wrapper-relative offsets): chips let events
   through; widgets stay live only while PLACING a palette field (the named-fill snap). */
.rcd-fill-pages.is-place .rcd-fill-place, .rcd-fill-pages.is-move .rcd-fill-place { pointer-events: none; }
.rcd-fill-pages.is-move .rcd-fill-widget { pointer-events: none; }

/* =====================================================================
   THE REPORT DESIGNER (rdz-)
   ===================================================================== */

.rdz-app {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding-bottom: 2rem;
}
/* An open report: an app-like work surface, full width of the page area (no content frame - the palette and the page
   need the room). */
.rdz-studio { min-width: 0; }

.rdz-iconbtn {
    display: inline-grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    flex: 0 0 auto;
    border: 1px solid var(--wf-line-strong);
    border-radius: var(--wf-radius-sm);
    background: var(--wf-card);
    color: var(--theme-text);
}
.rdz-iconbtn:hover:not(:disabled) { border-color: var(--wf-primary-ink); color: var(--wf-primary-ink); }
.rdz-iconbtn:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: 2px; }
.rdz-iconbtn:disabled { opacity: 0.45; }

.rdz-linkbtn {
    border: 0;
    background: none;
    padding: 0;
    color: var(--wf-primary-ink);
    font-size: var(--theme-font-size-xs, 0.75rem);
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}
.rdz-linkbtn:hover { text-decoration: underline; }

/* ---- The start screen: a card per PDF report and a big New report card (the page header is PageHeader) ---- */
.rdz-start {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 16px;
}
.rdz-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
    min-height: 150px;
    padding: 18px 20px 16px;
    text-align: left;
    font: inherit;
    color: var(--theme-text);
    background: var(--wf-card);
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-md);
    box-shadow: var(--wf-elev-1);
    cursor: pointer;
    transition: border-color var(--wf-motion), transform var(--wf-motion), box-shadow var(--wf-motion);
}
.rdz-card:hover {
    border-color: var(--wf-line-strong);
    transform: translateY(-1px);
    box-shadow: var(--wf-elev-2);
}
.rdz-card:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: 2px; }
.rdz-card-kind { margin-bottom: 6px; }
.rdz-card-title { max-width: 100%; color: var(--theme-text-emphasis); font-size: 15px; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.rdz-card-sub { color: var(--theme-text-secondary); font-size: 13px; }
.rdz-card-facts {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 100%;
    margin-top: auto;
    padding-top: 10px;
    color: var(--theme-text-muted);
    font-size: 12px;
    line-height: 1.4;
}
.rdz-card-facts > span { overflow-wrap: anywhere; }
.rdz-card-facts i { margin-right: 6px; color: var(--wf-primary-ink); }
.rdz-card-new {
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1.5px dashed color-mix(in srgb, var(--wf-primary-ink) 45%, var(--wf-line-strong));
    background: var(--wf-primary-soft);
    box-shadow: none;
}
.rdz-card-new:hover { border-color: var(--wf-primary-ink); }
.rdz-card-plus {
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-bottom: 6px;
    border-radius: 50%;
    font-size: 1.35rem;
    color: var(--theme-text-on-primary);
    background: var(--theme-primary);
}
.rdz-skel-card { min-height: 150px; border-radius: var(--wf-radius-md); }

/* ---- The report bar ------------------------------------------------------ */
.rdz-bar {
    position: sticky;
    /* Under the shell bar (--wf-sticky-top), and below it in the stack (the shell bar is 30). */
    top: var(--wf-sticky-top);
    z-index: 29;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    background: color-mix(in srgb, var(--wf-card) 94%, transparent);
    backdrop-filter: blur(6px);
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-md);
    box-shadow: var(--wf-elev-1);
}
.rdz-bar-id { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; flex: 1 1 auto; }
.rdz-title {
    width: 100%;
    min-width: 0;
    padding: 0.05rem 0.25rem;
    border: 1px solid transparent;
    border-radius: var(--wf-radius-xs);
    background: transparent;
    color: var(--theme-text-emphasis);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.25;
}
.rdz-title:hover { border-color: var(--wf-line-strong); }
.rdz-title:focus { outline: none; border-color: var(--wf-primary-ink); background: var(--wf-card); }
.rdz-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    padding: 0.05rem 0.2rem;
    border: 0;
    background: none;
    text-align: left;
    font: inherit;
    color: var(--theme-text-secondary);
    cursor: pointer;
}
.rdz-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.12rem 0.55rem;
    border-radius: var(--wf-radius-pill);
    background: var(--wf-inset);
    font-size: var(--theme-font-size-xs, 0.75rem);
    /* A pill wraps onto its own line first (the summary wraps); one wider than the whole line wraps its own words
       (a long "Made automatically every time ..." on a phone) - it never pushes the sheet sideways. */
    max-width: 100%;
    white-space: normal;
}
.rdz-pill i { flex: none; color: var(--wf-primary-ink); }
.rdz-summary-edit { font-size: var(--theme-font-size-xs, 0.75rem); color: var(--wf-primary-ink); font-weight: 600; margin-left: 0.15rem; }
.rdz-summary-edit i { margin-right: 0.2rem; }
.rdz-summary:hover .rdz-pill { background: var(--wf-primary-soft); }
.rdz-summary:hover .rdz-summary-edit { text-decoration: underline; }
.rdz-summary:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: 2px; border-radius: var(--wf-radius-xs); }
.rdz-bar-actions { display: flex; align-items: center; gap: 0.45rem; flex: 0 0 auto; }
.rdz-savestate { font-size: var(--theme-font-size-xs, 0.75rem); color: var(--theme-text-muted); white-space: nowrap; }
.rdz-savestate.is-dirty { color: var(--wf-warning-ink); font-weight: 600; }
.rdz-savestate.is-dirty::before { content: "\2022"; margin-right: 0.3rem; }

.rdz-menu { position: relative; }
.rdz-menu-shield { position: fixed; inset: 0; z-index: 40; }
.rdz-menu-pop {
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    z-index: 41;
    display: flex;
    flex-direction: column;
    min-width: 14rem;
    padding: 0.3rem;
    background: var(--theme-background-float, var(--wf-card));
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-lg);
    box-shadow: var(--wf-elev-3);
}
.rdz-menu-pop button {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 34px;
    padding: 0.45rem 0.6rem;
    border: 0;
    border-radius: var(--wf-radius-sm);
    background: none;
    text-align: left;
    color: var(--theme-text);
    font-size: var(--theme-font-size-sm, 0.875rem);
}
.rdz-menu-pop button:hover { background: var(--wf-card-hover); }
.rdz-menu-pop button.is-danger { color: var(--wf-danger-ink); }

/* ---- Notes (save refusals, problems found) ---------------------------------- */
.rdz-notes {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.55rem 2.4rem 0.55rem 0.75rem;
    background: var(--wf-card);
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-md);
}
.rdz-note { display: flex; align-items: flex-start; gap: 0.5rem; font-size: var(--theme-font-size-sm, 0.875rem); color: var(--theme-text); }
.rdz-note > i { color: var(--wf-primary-ink); margin-top: 0.15rem; }
.rdz-note-warn > i { color: var(--wf-warning-ink); }
.rdz-note-error > i { color: var(--wf-danger-ink); }
.rdz-notes-x { position: absolute; top: 0.45rem; right: 0.45rem; border: 0; background: none; color: var(--theme-text-muted); }
.rdz-notes-x:hover { color: var(--theme-text); }

/* ---- The work area: palette | page ---------------------------------------- */
.rdz-work {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.rdz-palette {
    position: sticky;
    top: calc(var(--wf-sticky-top) + 5.6rem);
    max-height: calc(100vh - 7rem - var(--wf-sticky-top));
    overflow-y: auto;
    padding: 0.65rem;
    background: var(--wf-card);
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-md);
    box-shadow: var(--wf-elev-1);
}
.rdz-pal-search { display: flex; align-items: center; gap: 0.4rem; }
.rdz-pal-search i { color: var(--theme-text-muted); }
.rdz-pal-tip {
    display: flex;
    gap: 0.45rem;
    margin-top: 0.5rem;
    padding: 0.45rem 0.55rem;
    border-radius: var(--wf-radius-sm);
    background: var(--wf-inset);
    color: var(--theme-text-secondary);
    font-size: var(--theme-font-size-xs, 0.75rem);
    line-height: 1.35;
}
.rdz-pal-tip i { color: var(--wf-primary-ink); margin-top: 0.05rem; }
.rdz-pal-sec { margin-top: 0.85rem; }
/* Sentence case (portal-look-and-feel 3.15: no UPPERCASE labels). */
.rdz-pal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--theme-text-secondary);
}
.rdz-pal-note { margin: 0 0 0.35rem; font-size: var(--theme-font-size-xs, 0.75rem); color: var(--theme-text-muted); }
.rdz-pal-empty {
    padding: 0.7rem 0.5rem;
    text-align: center;
    font-size: var(--theme-font-size-sm, 0.85rem);
    color: var(--theme-text-muted);
    border: 1px dashed var(--wf-line-strong);
    border-radius: var(--wf-radius-sm);
}
.rdz-pal-empty p { margin: 0 0 0.5rem; }

.rdz-blocks { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; }
.rdz-block {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.42rem 0.5rem;
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-sm);
    background: var(--wf-card);
    color: var(--theme-text);
    font-size: 0.8rem;
    text-align: left;
    cursor: pointer;
    transition: border-color 120ms ease, background 120ms ease;
}
.rdz-block i { color: var(--wf-primary-ink); font-size: 0.95rem; }
.rdz-block:hover { border-color: var(--wf-primary-ink); background: var(--wf-primary-soft); }
.rdz-block:active, .rdz-item:active { cursor: grabbing; }

.rdz-pal-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.32rem 0.3rem;
    border: 0;
    border-radius: var(--wf-radius-sm);
    background: none;
    text-align: left;
    color: var(--theme-text-emphasis);
    font-size: 0.82rem;
    font-weight: 650;
}
.rdz-pal-group:hover { background: var(--wf-card-hover); }
.rdz-pal-group i { font-size: 0.7rem; color: var(--theme-text-muted); }
.rdz-count {
    margin-left: auto;
    padding: 0 0.4rem;
    border-radius: var(--wf-radius-pill);
    background: var(--wf-neutral-soft);
    color: var(--theme-text-secondary);
    font-size: 0.68rem;
    font-weight: 600;
}
.rdz-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    margin: 0 0 0.2rem;
    padding: 0.34rem 0.5rem 0.34rem 0.65rem;
    border: 1px solid transparent;
    border-radius: var(--wf-radius-sm);
    background: var(--theme-background-subtle);
    color: var(--theme-text);
    font-size: 0.84rem;
    text-align: left;
    cursor: pointer;
    transition: border-color 120ms ease, background 120ms ease;
}
.rdz-item:hover { border-color: var(--wf-primary-ink); background: var(--wf-primary-soft); }
.rdz-item i { flex: 0 0 auto; color: var(--wf-primary-ink); }
.rdz-item-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rdz-item-tag {
    margin-left: auto;
    flex: 0 0 auto;
    padding: 0 0.4rem;
    border-radius: var(--wf-radius-pill);
    background: var(--wf-neutral-soft);
    color: var(--theme-text-secondary);
    font-size: 0.68rem;
    font-weight: 600;
}

/* ---- The stage: a desk with a real-looking page on it -------------------- */
.rdz-stage { min-width: 0; }
.rdz-desk {
    min-height: calc(100vh - 11rem);
    padding: 1.6rem 1rem 2rem;
    border-radius: var(--wf-radius-md);
    background:
        radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--theme-text-muted) 18%, transparent) 1px, transparent 0) 0 0 / 18px 18px,
        var(--theme-background-subtle);
}
.rdz-page {
    position: relative;
    max-width: 8.5in;
    min-height: 9in;
    margin: 0 auto;
    padding: 0.55in 0.6in 0.7in;
    background: var(--wf-card);
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-xs);
    box-shadow: var(--wf-elev-2);
    color: var(--theme-text);
}
.rdz-page-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.4rem; padding: 2.5rem 0.5rem 1rem; }
.rdz-page-empty > i { font-size: 2.4rem; color: color-mix(in srgb, var(--wf-primary-ink) 55%, transparent); }
.rdz-page-empty h3 { margin: 0.2rem 0 0; font-size: 1.25rem; font-weight: 700; color: var(--theme-text-emphasis); }
.rdz-page-empty p { margin: 0 0 0.8rem; color: var(--theme-text-secondary); max-width: 26rem; }
.rdz-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.6rem; width: 100%; max-width: 36rem; }
.rdz-quick button {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.7rem 0.75rem;
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-md);
    background: var(--wf-card);
    text-align: left;
    color: var(--theme-text);
    font-size: 0.8rem;
}
.rdz-quick button:hover { border-color: var(--wf-primary-ink); background: var(--wf-primary-soft); }
.rdz-quick i { font-size: 1.2rem; color: var(--wf-primary-ink); }
.rdz-quick strong { display: block; font-size: 0.86rem; color: var(--theme-text-emphasis); }

.rdz-sources { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; max-width: 8.5in; margin: 0.9rem auto 0; }
.rdz-sources-title { font-size: 12.5px; font-weight: 600; color: var(--theme-text-secondary); }
.rdz-source-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.3rem 0.15rem 0.6rem;
    border: 1px solid var(--wf-line-strong);
    border-radius: var(--wf-radius-pill);
    background: var(--wf-card);
    font-size: 0.78rem;
}
.rdz-source-chip i { color: var(--wf-primary-ink); }
.rdz-source-chip button { border: 0; background: none; padding: 0 0.1rem; color: var(--theme-text-muted); }
.rdz-source-chip button:hover { color: var(--wf-danger-ink); }

/* ---- Bands on the page: they look like what prints; the frame appears on hover -- */
.rdz-page .rcd-drop { height: 10px; margin: 0; }
.rdz-page .rcd-drop.is-active { height: 30px; margin: 3px 0; border-radius: 6px; }
.rdz-page .rcd-band {
    position: relative;
    margin: 0;
    padding: 0.55rem 0.6rem 0.6rem;
    border: 1px dashed transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 120ms ease, background 120ms ease;
}
.rdz-page .rcd-band:hover { border-color: color-mix(in srgb, var(--theme-primary) 45%, transparent); }
.rdz-page .rcd-band.is-selected {
    border: 1px solid var(--theme-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-primary) 16%, transparent);
    background: color-mix(in srgb, var(--theme-primary) 3%, transparent);
}
.rdz-page .rcd-band.is-hover { background: color-mix(in srgb, var(--theme-primary) 6%, transparent); }
/* The frame's label + tools float on the top edge, like a design tool - never in the page's flow. */
.rdz-page .rcd-band-head {
    position: absolute;
    top: -0.8rem;
    left: 0.5rem;
    z-index: 3;
    display: none;
    align-items: center;
    gap: 0.35rem;
    padding: 0.12rem 0.3rem 0.12rem 0.2rem;
    border-radius: var(--wf-radius-xs);
    background: var(--theme-primary);
    color: var(--theme-text-on-primary);
    box-shadow: var(--wf-elev-1);
    cursor: grab;
}
.rdz-page .rcd-band:hover > .rcd-band-head,
.rdz-page .rcd-band.is-selected > .rcd-band-head { display: flex; }
.rdz-page .rcd-band-grip { font-size: 0.8rem; opacity: 0.8; }
.rdz-page .rcd-band-ico { color: inherit; font-size: 0.75rem; }
.rdz-page .rcd-band-title { color: inherit; font-size: 0.64rem; letter-spacing: 0.05em; }
.rdz-page .rcd-align { margin-left: 0.2rem; }
.rdz-page .rcd-align button { border-color: color-mix(in srgb, var(--theme-text-on-primary) 35%, transparent); background: transparent; color: inherit; }
.rdz-page .rcd-align button.is-on { background: var(--theme-text-on-primary); color: var(--theme-primary); border-color: var(--theme-text-on-primary); }
.rcd-band-tools { display: inline-flex; align-items: center; gap: 0.1rem; margin-left: 0.25rem; }
.rcd-band-tools button {
    display: inline-grid;
    place-items: center;
    width: 1.35rem;
    height: 1.25rem;
    padding: 0;
    border: 0;
    border-radius: 0.3rem;
    background: transparent;
    color: inherit;
    font-size: 0.72rem;
    visibility: visible;
}
.rcd-band-tools button:hover:not(:disabled) { background: color-mix(in srgb, var(--theme-text-on-primary) 22%, transparent); }
.rcd-band-tools button:disabled { opacity: 0.4; }
.rdz-page .rcd-band-x { margin-left: 0; }
.rdz-page .rcd-band-x:hover { color: inherit; background: color-mix(in srgb, var(--theme-danger) 70%, transparent) !important; }
.rdz-page .rcd-band-body { padding: 0; }

/* Header block: the facts across the top, like the printed masthead's fact row. */
.rdz-page .rcd-k-header .rcd-band-body { padding: 0.55rem 0.2rem; border-top: 3px solid var(--theme-text-emphasis); border-bottom: 1px solid var(--wf-line-strong); }
/* A field: the label small and quiet, the answer as the value it will print. */
.rdz-page .rcd-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.55rem 1.1rem; }
.rdz-page .rcd-k-header .rcd-fields { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.rdz-page .rcd-field { flex-direction: column; align-items: flex-start; gap: 0.12rem; min-width: 0; }
.rdz-page .rcd-field-labelro { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.05em; }
.rdz-page .rcd-field .rcd-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 0.84rem; font-weight: 600; }
.rdz-page .rcd-field .rcd-field-label { max-width: 100%; }
/* A question card, as the printed answer card: an edge, the question, where the answer lands. */
.rdz-page .rcd-k-step .rcd-band-body { padding: 0.5rem 0.75rem; border: 1px solid var(--wf-line-strong); border-left: 3px solid var(--theme-primary); border-radius: 4px; }
.rdz-page .rcd-step-name { font-size: 0.95rem; color: var(--theme-text-emphasis); }
.rdz-page .rcd-step::after {
    content: "";
    display: block;
    flex-basis: 100%;
    height: 0.55rem;
    margin-top: 0.15rem;
    border-radius: 3px;
    background: repeating-linear-gradient(90deg, var(--theme-background-subtle) 0 70%, transparent 70% 100%);
    max-width: 55%;
}
/* The full story: a stack of ghost cards. */
.rdz-page .rcd-k-answerStory .rcd-story {
    padding: 0.6rem 0.75rem 1.9rem;
    border: 1px solid var(--wf-line-strong);
    border-left: 3px solid var(--theme-primary);
    border-radius: 4px;
    background:
        linear-gradient(var(--theme-background-subtle), var(--theme-background-subtle)) 0.75rem calc(100% - 1.1rem) / 45% 0.5rem no-repeat,
        linear-gradient(var(--theme-background-subtle), var(--theme-background-subtle)) 0.75rem calc(100% - 0.45rem) / 30% 0.5rem no-repeat;
    box-shadow: 0 5px 0 -1px var(--wf-card), 0 5px 0 0 var(--wf-line-strong), 0 10px 0 -1px var(--wf-card), 0 10px 0 0 var(--wf-line-strong);
    margin-bottom: 0.7rem;
}
.rdz-page .rcd-k-chart .rcd-chart,
.rdz-page .rcd-k-image .rcd-imageband {
    min-height: 5.5rem;
    padding: 0.75rem;
    border: 1px dashed var(--wf-line-strong);
    border-radius: 6px;
    background: color-mix(in srgb, var(--theme-background-subtle) 60%, transparent);
    justify-content: center;
}
.rdz-page .rcd-k-chart .rcd-chart > i:first-child,
.rdz-page .rcd-k-image .rcd-imageband > i:first-child { font-size: 1.5rem; }
.rdz-page .rcd-k-table .rcd-tablecols { padding-bottom: 0.35rem; border-bottom: 2px solid var(--theme-text-emphasis); }
.rdz-page .rcd-text { font-size: 0.92rem; }
.rdz-page .rcd-cols { gap: 0.9rem; }
.rdz-page .rcd-pagebreak span { background: var(--wf-card); }

/* ---- Fill-in mode --------------------------------------------------------- */
.rdz-fill { min-width: 0; }
.rdz-fill-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.6rem; }
.rdz-fill-hint { font-size: var(--theme-font-size-xs, 0.75rem); color: var(--theme-text-muted); }
.rdz-fill-empty { padding: 2rem; text-align: center; color: var(--theme-text-muted); }
.rdz-fill-drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    max-width: 34rem;
    margin: 2rem auto;
    padding: 2.6rem 1.5rem;
    text-align: center;
    border: 2px dashed color-mix(in srgb, var(--wf-primary-ink) 45%, var(--wf-line-strong));
    border-radius: var(--wf-radius-md);
    background: var(--wf-primary-soft);
    color: var(--theme-text-secondary);
    cursor: pointer;
}
.rdz-fill-drop:hover { border-color: var(--wf-primary-ink); }
.rdz-fill-drop i { font-size: 2.4rem; color: var(--wf-primary-ink); }
.rdz-fill-drop strong { font-size: 1.05rem; color: var(--theme-text-emphasis); }
.rdz-fill-drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---- Dialogs: the float surface, radius xl, elevation 3, over the ONE scrim (portal-look-and-feel 3.13) ---- */
.rdz-dlg-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: var(--wf-scrim);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    animation: rdz-fade 150ms ease;
}
.rdz-dlg {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 1051;
    display: flex;
    flex-direction: column;
    width: min(46rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    transform: translate(-50%, -50%);
    background: var(--theme-background-float, var(--wf-card));
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-xl);
    box-shadow: var(--wf-elev-3);
    animation: rdz-pop 180ms var(--wf-ease);
}
@keyframes rdz-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rdz-pop { from { opacity: 0; transform: translate(-50%, -48%) scale(0.98); } to { opacity: 1; transform: translate(-50%, -50%); } }
.rdz-dlg-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1.2rem 0.75rem;
    border-bottom: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-xl) var(--wf-radius-xl) 0 0;
}
.rdz-dlg-head h2 { margin: 0; font-size: 1.2rem; font-weight: 700; color: var(--theme-text-emphasis); }
.rdz-dlg-body { display: flex; flex-direction: column; gap: 1.15rem; padding: 1.05rem 1.2rem 1.2rem; overflow-y: auto; }
.rdz-dlg-body h2 { margin: 0; font-size: 1.15rem; font-weight: 700; color: var(--theme-text-emphasis); }
.rdz-dlg-body p { margin: 0; color: var(--theme-text-secondary); }
.rdz-dlg-foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1.2rem;
    border-top: 1px solid var(--wf-line);
    border-radius: 0 0 var(--wf-radius-xl) var(--wf-radius-xl);
}
.rdz-confirm { width: min(30rem, calc(100vw - 2rem)); }
.rdz-setup { width: min(46rem, calc(100vw - 2rem)); }

/* The setup questions. */
.rdz-q { display: flex; flex-direction: column; gap: 0.45rem; }
.rdz-q-label { display: flex; align-items: center; gap: 0.55rem; margin: 0; font-weight: 700; font-size: 0.98rem; color: var(--theme-text-emphasis); }
.rdz-q-num {
    display: inline-grid;
    place-items: center;
    width: 1.45rem;
    height: 1.45rem;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--theme-primary);
    color: var(--theme-text-on-primary);
    font-size: 0.75rem;
    font-weight: 700;
}
.rdz-q-hint { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; font-size: var(--theme-font-size-xs, 0.75rem); color: var(--theme-text-muted); }
/* A saved report's code name reads as a code chip (the global code ink fell to 3.4:1 on a dark dialog). */
.rdz-q-hint > code { padding: 1px 7px; border-radius: var(--wf-radius-xs); background: var(--wf-inset); color: var(--theme-text-secondary); font: 600 11.5px var(--theme-font-mono, ui-monospace, monospace); }
.rdz-codename {
    min-width: 12rem;
    padding: 0.1rem 0.4rem;
    border: 1px solid var(--wf-line-strong);
    border-radius: var(--wf-radius-xs);
    background: var(--wf-card);
    color: var(--theme-text);
    font-family: var(--theme-font-mono, ui-monospace, monospace);
    font-size: 0.78rem;
}
/* Choice cards (3.11 .wf-choice's look - kept on the designer's own buttons, aria-pressed). */
.rdz-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.rdz-choice {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--wf-line-strong);
    border-radius: var(--wf-radius-md);
    background: var(--wf-card);
    text-align: left;
    color: var(--theme-text);
}
.rdz-choice > i { font-size: 1.4rem; color: var(--wf-primary-ink); }
.rdz-choice-title { font-weight: 700; color: var(--theme-text-emphasis); }
.rdz-choice-sub { font-size: 0.8rem; color: var(--theme-text-secondary); line-height: 1.35; }
.rdz-choice:hover { border-color: var(--wf-primary-ink); }
.rdz-choice:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: 2px; }
.rdz-choice.is-on { border-color: var(--wf-primary-ink); background: var(--wf-primary-soft); box-shadow: 0 0 0 1px var(--wf-primary-ink); }
.rdz-choice.is-on::after {
    content: "\2713";
    position: absolute;
    top: 0.55rem;
    right: 0.65rem;
    display: grid;
    place-items: center;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 50%;
    background: var(--theme-primary);
    color: var(--theme-text-on-primary);
    font-size: 0.75rem;
    font-weight: 700;
}
.rdz-radios { display: flex; flex-direction: column; gap: 0.4rem; }
.rdz-radio {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin: 0;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--wf-line-strong);
    border-radius: var(--wf-radius-md);
    background: var(--wf-card);
    cursor: pointer;
}
.rdz-radio input { margin-top: 0.2rem; accent-color: var(--theme-primary); }
.rdz-radio strong { display: block; font-weight: 650; color: var(--theme-text-emphasis); }
.rdz-radio small { display: block; color: var(--theme-text-muted); }
.rdz-radio.is-on { border-color: var(--wf-primary-ink); background: var(--wf-primary-soft); }
.rdz-radio-pick { margin: -0.1rem 0 0.2rem 2rem; width: calc(100% - 2rem); }
.rdz-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.35rem; }
.rdz-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--wf-line-strong);
    border-radius: var(--wf-radius-sm);
    background: var(--wf-card);
    font-size: 0.86rem;
    cursor: pointer;
}
.rdz-check input { accent-color: var(--theme-primary); }
.rdz-check.is-on { border-color: var(--wf-primary-ink); background: var(--wf-primary-soft); }
.rdz-filter { margin-top: 0.3rem; }
.rdz-filter-on { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; font-size: var(--theme-font-size-sm, 0.875rem); }
.rdz-filter-on i { color: var(--wf-primary-ink); }
.rdz-filter .card { margin-top: 0 !important; }

/* The preview dialog: the real page, big. */
.rdz-preview { width: min(1120px, calc(100vw - 2rem)); height: calc(100vh - 2rem); }
.rdz-preview-head { flex-wrap: wrap; }
.rdz-preview-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 0.45rem; }
.rdz-preview-pick { width: auto; min-width: 16rem; max-width: 28rem; }
.rdz-preview-lang { width: auto; }
.rdz-preview-body {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    min-height: 0;
    padding: 1rem;
    background: var(--theme-background-subtle);
    border-radius: 0 0 var(--wf-radius-xl) var(--wf-radius-xl);
}
.rdz-preview-frame {
    width: min(calc(8.5in + 2rem), 100%);
    height: 100%;
    border: 0;
    border-radius: var(--wf-radius-xs);
    box-shadow: var(--wf-elev-2);
}
/* The rendered report is the PRINTED PAGE: white in every theme (content, not chrome - the named exception in
   Tests/ShellTokensOnlyTests, the .wf-qr rule). */
.rdz-preview-frame { background: white; }
.rdz-preview-msg { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem; max-width: 26rem; text-align: center; color: var(--theme-text-secondary); }
.rdz-preview-msg > i { font-size: 2.2rem; color: color-mix(in srgb, var(--wf-primary-ink) 60%, transparent); }

/* ---- Narrower screens ----------------------------------------------------- */
@media (max-width: 1100px) {
    .rdz-work { grid-template-columns: 260px minmax(0, 1fr); }
    .rdz-page { padding: 0.45in 0.4in 0.6in; }
}
@media (max-width: 860px) {
    .rdz-work { grid-template-columns: minmax(0, 1fr); }
    .rdz-palette { position: static; max-height: 22rem; }
    .rdz-bar { flex-wrap: wrap; top: 0; }
    .rdz-bar-actions { width: 100%; justify-content: flex-end; }
    .rdz-choices { grid-template-columns: 1fr; }
    .rdz-page { padding: 1.1rem 0.9rem 1.4rem; min-height: 0; }
    .rdz-desk { padding: 0.75rem 0.4rem 1rem; }
}

/* A touch screen (3.17): the designer's frame - the start cards, the bar's buttons, the menu - takes 44px targets
   and a 16px search. */
@media (pointer: coarse) {
    .rdz-iconbtn { width: 44px; height: 44px; }
    .rdz-menu-pop button { min-height: 44px; }
    .rdz-pal-search input { font-size: 16px; }
    .rdz-summary { min-height: 44px; }
    .rdz-title { min-height: 44px; }
    .rdz-dlg .btn, .rdz-dlg .btn-sm { min-height: 44px; }
    .rdz-check { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    .rdz-card, .rdz-dlg, .rdz-dlg-backdrop { transition: none; animation: none; }
    .rdz-card:hover { transform: none; }
}
