/*
    Report Browser - the rail-and-list card every module's Reports hub renders, and the in-page
    category manager (Cim360ReportCategoryManager) that sits beside it. Global, not a Blazor
    isolated stylesheet, and that is the whole reason this file exists.

    Cim360ReportBrowser.razor.css used to carry these rules scoped to the component. .rb-body -
    the flex row that puts the rail beside the list - is a div rendered by Cim360SettingsGrid, a
    CHILD component, so Blazor never stamped the isolation attribute on it and the rule never
    matched: the rail rendered stacked above the list, full width, because display:flex simply
    never applied. ::deep does not rescue this either - `::deep .rb-body` compiles to
    `[b-xxxxx] .rb-body`, which still needs a scoped ANCESTOR, and Cim360SettingsGrid's own root
    element is not one. The fix is the one every other cross-component sheet in this product
    already uses: move the rules here, and link this file in both hosts, the same as
    css/lists/cim360-list.css and css/cards/cim360-card.css already are. DEV-436.

    Colours are the product's own tokens (app.css), not the design mock's hex values -
    --cim360-primary already IS the mock's brand blue (#1D75BB), so this is the same palette read
    from one place instead of copied into a second.
*/

/* ============================================================================================
   HEAD STRIP - white with blue text, matching Cim360FilterBar (the header every OTHER list/view
   page gets through Cim360ListPage), NOT Cim360SettingsGrid's own .c360-grid-head (blue with
   white text, cim360-dialog.css:1491) that every OTHER Cim360SettingsGrid consumer keeps.

   Scoped to .rb-hub-grid - the CssClass Cim360ReportBrowser hands to its <Cim360SettingsGrid> -
   rather than to .c360-grid-head itself, which stays untouched for Custom Fields, Users, Roles and
   every other settings list still built on it. Three classes on the left of the combinator
   (.c360-grid.rb-hub-grid) so this reliably outranks cim360-dialog.css's own .c360-grid.is-card
   rule regardless of link order, rather than leaning on being the later stylesheet.
   ============================================================================================ */
/* The same white strip for the pages that have no grid under them - the designer and the viewer.
   They carry a title and actions and nothing else, so they cannot borrow the grid's head; this is
   the one definition of what that strip looks like, and all three now agree. */
.rb-page-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.75rem;
    padding: 0.5rem 0.875rem 0.5rem 1.25rem;
    background: var(--cim360-card);
    color: var(--cim360-text);
    border-bottom: 1px solid var(--cim360-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    font-family: 'Nunito', "Segoe UI", system-ui, sans-serif;
}

.rb-page-head .t {
    color: var(--cim360-primary);
    font-size: 0.9375rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rb-page-head .d {
    color: var(--cim360-text-muted);
    font-size: 0.75rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Pushes whatever follows to the right-hand end, the way the hub's own actions sit. */
.rb-page-head .sp {
    flex: 1 1 auto;
}

.c360-grid.rb-hub-grid > .c360-grid-head {
    background: var(--cim360-card);
    color: var(--cim360-text);
    border-bottom: 1px solid var(--cim360-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    font-family: 'Nunito', "Segoe UI", system-ui, sans-serif;
}

.c360-grid.rb-hub-grid > .c360-grid-head .c360-grid-title {
    color: var(--cim360-primary);
    font-size: 0.9375rem;
    font-weight: 700;
}

/* The count pill: a 10% tint of the brand blue with -dark text, not the dark-wash-on-blue the
   settings bar uses - that wash exists only to stay legible on a blue ground. Same shape and
   contrast reasoning as Cim360FilterBar's own .filter-bar-count. */
.c360-grid.rb-hub-grid > .c360-grid-head .c360-grid-head-count {
    background: rgba(29, 117, 187, .10);
    color: var(--cim360-primary-dark);
}

/* The search pill was a white shape floating on a blue bar; on white it needs its own border to
   read as a control rather than disappearing into the strip around it. */
.c360-grid.rb-hub-grid > .c360-grid-head .c360-grid-search {
    background: var(--cim360-card);
    border: 1px solid var(--cim360-border);
    box-shadow: none;
}

.c360-grid.rb-hub-grid > .c360-grid-head .c360-grid-search:focus-within {
    border-color: var(--cim360-primary);
    box-shadow: 0 0 0 0.1875rem var(--cim360-primary-tint);
}

.c360-grid.rb-hub-grid > .c360-grid-head .c360-grid-search-icon,
.c360-grid.rb-hub-grid > .c360-grid-head .c360-grid-search-input {
    color: var(--cim360-text);
}

.c360-grid.rb-hub-grid > .c360-grid-head .c360-grid-search-icon {
    color: var(--cim360-text-muted);
}

.c360-grid.rb-hub-grid > .c360-grid-head .c360-grid-search-clear {
    color: var(--cim360-text-muted);
}

.c360-grid.rb-hub-grid > .c360-grid-head .c360-grid-search-clear:hover {
    background: rgba(0, 0, 0, .06);
}

/* The head's own action buttons - "Describe a report" and "Design a report" (and the ghost variant), kept
   under the design's own class names (rb-head-btn / .ghost). */
/* Shaped as the list header's primary button (.filter-btn-primary in Cim360FilterBar): the same height,
   padding, 4px corners and weight, so Print on a list and Describe / Design a report on a hub read as one control. */
.rb-head-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4375rem;
    height: 1.75rem;
    padding: 0 0.6875rem;
    border: 1px solid var(--cim360-primary);
    border-radius: 0.25rem;
    background: var(--cim360-primary-surface);
    color: var(--cim360-text-inverse);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    font-family: 'Nunito', "Segoe UI", system-ui, sans-serif;
    transition: background .15s, border-color .15s;
}

.rb-head-btn:hover {
    background: var(--cim360-primary-surface-hover);
    border-color: var(--cim360-primary-hover);
}

.rb-head-btn.ghost {
    background: var(--cim360-card);
    color: var(--cim360-primary);
    border-color: var(--cim360-border);
}

.rb-head-btn.ghost:hover {
    background: rgba(29, 117, 187, .06);
    border-color: var(--cim360-primary);
}

.rb-table {
    table-layout: fixed;
}

/* The design's row grid, less the export-format column: 34px | 1fr | 152px | 26px | 28px.
   On the COLGROUP rather than the cells, because table-layout: fixed reads its widths from the
   first row and the first row here is a visually-hidden header - so widths written on the <td>
   classes are never consulted and every column comes out equal.
   The last column was 20px while it held a decorative chevron; it now holds a real Run button, so
   it carries the kebab's 28px target PLUS an 8px right gutter - table-layout: fixed sizes the whole
   cell, padding included, so without the extra width the gutter would come out of the button. */
.rb-cw-star { width: 2.125rem; }
.rb-cw-last { width: 9.5rem; }
.rb-cw-actions { width: 1.75rem; }
.rb-cw-run { width: 2.25rem; }

/* ---- left rail: library views + categories, replacing the horizontal facet tray ---- */
/* .c360-grid-body already scrolls itself (overflow-y: auto) - here the body becomes a flex row
   instead and each of its two children (the rail, the list) scrolls independently, exactly as the
   design specifies. THIS is the rule that never landed while it lived in the isolated sheet. */
.rb-body {
    display: flex;
    align-items: stretch;
    overflow: hidden;

    /* The design's .rb-card: one bordered, rounded white shell holding the rail and the list.
       Stated here because this grid's head is the product's white bar rather than the shared blue
       one, and the shared body border is drawn to meet the blue head rather than this. */
    border: 1px solid var(--cim360-border);
    border-top: 0;
    border-radius: 0 0 0.3125rem 0.3125rem;
}

.rb-rail {
    flex: 0 0 13.625rem;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--cim360-border-soft);
    background: var(--cim360-surface-2);
    overflow-y: auto;
}

.rb-rail-lbl {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: .875rem .625rem .375rem 1rem;
    font-size: .59375rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--cim360-text-muted);
}

.rb-rail-add {
    margin-left: auto;
    width: 1.375rem;
    height: 1.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--cim360-border);
    border-radius: 0.25rem;
    background: var(--cim360-card);
    color: var(--cim360-primary);
    font-size: .625rem;
}

.rb-rail-add:hover {
    background: var(--cim360-primary-surface);
    color: var(--cim360-text-inverse);
    border-color: var(--cim360-primary);
}

/* Shared by the three library rows (direct children of .rb-rail) and every category row (a child
   of .rb-rail-row instead, alongside its kebab) - flex:1 stretches it to fill the width either
   way, rather than a hard width:100% that would fight the kebab for space. */
/* The three library rows are DIRECT children of .rb-rail, which is a COLUMN flex container, and
   every category row sits inside .rb-rail-row, which is a ROW one. flex: 1 1 auto therefore means
   two different things in the two places: width in the category row, and HEIGHT as a direct child -
   so All reports, Favourites and Recently run each grew to share the rail's spare height and stood
   three times taller than a category, for no reason a reader could see. The stretch is switched off
   for the direct children below; the flex is kept, because inside .rb-rail-row it is what lets the
   label take the space the kebab does not. */
.rb-rail-item {
    display: flex;
    align-items: center;
    gap: 0.5625rem;
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    border-left: 0.1875rem solid transparent;
    background: transparent;
    text-align: left;
    padding: 0 0.875rem 0 0.8125rem;
    height: 2.125rem;
    font-size: .78125rem;
    font-weight: 600;
    color: var(--cim360-caption);
    font-family: inherit;
}

.rb-rail-item i {
    font-size: .8125rem;
    color: var(--cim360-text-muted);
    width: 0.9375rem;
    flex: 0 0 auto;
}

.rb-rail-item .n {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rb-rail-item .c {
    font-size: .6875rem;
    font-weight: 700;
    color: var(--cim360-text-muted);
    font-variant-numeric: tabular-nums;
}

.rb-rail-item:hover {
    background: var(--cim360-primary-soft);
}

.rb-rail-item.on {
    background: var(--cim360-card);
    border-left-color: var(--cim360-primary);
    color: var(--cim360-primary);
}

.rb-rail-item.on i,
.rb-rail-item.on .c {
    color: var(--cim360-primary);
}

.rb-rail > .rb-rail-item {
    flex: 0 0 auto;
}

.rb-rail-row {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

/* The category kebab (Cim360RowActions - a child component, so its own markup is reached with
   ::deep) stays hidden until the row is hovered, focused, its menu is open, or it is the active
   facet - never only on hover, or a keyboard user could never reach it and an open menu could
   vanish under the pointer moving away. */
.rb-rail-row ::deep .row-actions-trigger {
    opacity: 0;
}

.rb-rail-row:hover ::deep .row-actions-trigger,
.rb-rail-row:focus-within ::deep .row-actions-trigger,
.rb-rail-row ::deep .row-actions-trigger.open,
.rb-rail-row.on ::deep .row-actions-trigger {
    opacity: 1;
}

.rb-rail-sep {
    height: 1px;
    margin: .625rem .875rem 0;
    background: var(--cim360-border-soft);
}

.rb-rail-manage {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: .5rem .875rem .5rem 1rem;
    font-size: .71875rem;
    font-weight: 700;
    color: var(--cim360-primary);
}

.rb-rail-manage:hover {
    background: var(--cim360-primary-soft);
}

/* .rb-rail-note removed with the footnote it styled - 2026-09-15. */

/* ---- the list column: a fixed bar, then independently-scrolling rows, then a hint strip ---- */
.rb-list {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.rb-list-bar {
    flex: 0 0 auto;
    height: 2.25rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0 .875rem;
    border-bottom: 1px solid var(--cim360-border-soft);
    background: var(--cim360-surface-3);
}

.rb-list-bar .t {
    font-size: .75rem;
    font-weight: 700;
    color: var(--cim360-text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rb-list-bar .m {
    font-size: .71875rem;
    color: var(--cim360-text-muted);
    white-space: nowrap;
}

.rb-sort {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: .71875rem;
    color: var(--cim360-text-muted);
    flex: 0 0 auto;
}

.rb-sort label {
    white-space: nowrap;
}

.rb-sort select {
    height: 1.5rem;
}

.rb-rows {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Desktop-first, like the design itself. Below the app's own toolbar-wrap breakpoint
   (.c360-grid-head.is-wrap also turns on at 900px) the rail stacks above the list - a fixed
   218px column would leave less width for the rows than for the rail on a narrow screen - and
   scrolls its own short strip instead of claiming half the height. */
@media (max-width: 900px) {
    .rb-body {
        flex-direction: column;
        overflow: visible;
    }

    .rb-rail {
        flex: 0 0 auto;
        width: 100%;
        max-height: 40vh;
        border-right: 0;
        border-bottom: 1px solid var(--cim360-border-soft);
    }

    .rb-list {
        overflow: visible;
    }

    .rb-rows {
        overflow-y: visible;
    }
}

/* Sticky, uppercase - the design's own treatment. Only ever drawn inside .rb-rows, which is the
   scroll container it sticks within; drawn instead of grouping is skipped for a single category's
   own view, see Cim360ReportBrowser's _showGroupHeadings. */
.rb-group {
    margin: 0;
    padding: .75rem .75rem .25rem;
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--cim360-text-muted);
    background: var(--cim360-card);
    position: sticky;
    top: 0;
    z-index: 1;
}

.rb-row td {
    vertical-align: middle;
    border-bottom: 1px solid var(--cim360-border-soft);
    padding: .5rem .5rem;
}

.rb-row:hover {
    background: var(--cim360-primary-soft);
}

/* Column geometry matches the design's row grid, less the export-format column - dropped
   platform-wide per the project owner's own instruction, not a gap. */
/* The shared .c360-grid-table cell padding is 14px 16px, which is right for a data grid and far
   too wide for a 28px button column: 32px of padding inside a 28px column pushed the row past its
   container and put a horizontal scrollbar under the list. The narrow columns carry their own
   padding; the two wide ones keep the product's. */
.rb-row > .rb-col-star,
.rb-row > .rb-col-actions {
    padding-left: 0;
    padding-right: 0;
}

/* The trailing cell keeps a right gutter, unlike the two narrow columns above. It is the last
   thing before the list's own scrollbar, and with the padding zeroed the Run button sat hard
   against it. */
.rb-row > .rb-col-run {
    padding-left: 0;
    padding-right: .5rem;
}

.rb-col-star {
    width: 2.125rem;
}

.rb-col-last {
    width: 9.5rem;
}

.rb-col-actions {
    width: 1.75rem;
}

.rb-col-run {
    width: 2.25rem;
    text-align: right;
}

/* Styled off .rb-star rather than off the chevron it replaces: it is a button in a narrow trailing
   cell, which is the star's problem and not the chevron's. Muted until the row is hovered or the
   button itself is focused, so a list of forty reports does not read as forty play buttons. */
/* Floored at 24px (2.5.8): 1.75rem alone drew 22.4px once the UI scaled to 80%, on every row of
   every reports hub (2026-10-06). flex: none so the narrow trailing cell cannot squeeze it. */
.rb-run {
    width: max(1.75rem, 24px);
    height: max(1.75rem, 24px);
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    border-radius: 0.25rem;
    color: var(--cim360-border-strong);
    font-size: .875rem;
}

.rb-row:hover .rb-run {
    color: var(--cim360-primary);
}

.rb-run:hover {
    background: var(--cim360-primary-soft);
    color: var(--cim360-primary);
}

/* ---- favourite star ----
   Centred in the gap a reader actually sees - the row's left edge to the report title - which is
   this 34px cell PLUS the name cell's own 16px left padding, 50px in all. Centring the button
   inside its own cell alone leaves it 8px left of where it looks like it belongs, which is how it
   came to sit hard against the row's edge with a wide gap before the title.

   Safe to overhang the cell: .rb-table is table-layout: fixed, so the column cannot widen and the
   title does not move. Measured rather than guessed - 18px each side of the icon. */
.rb-star {
    margin-left: .6875rem;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    border-radius: 0.25rem;
    color: var(--cim360-border-strong);
    font-size: .875rem;
}

.rb-star:hover {
    background: var(--cim360-primary-soft);
    color: var(--cim360-primary);
}

/* --cim360-warning, not the mock's raw #F5A623 - a token already checked for contrast rather
   than a second amber invented for one icon. */
.rb-star.on {
    color: var(--cim360-warning);
}

/* ---- the row's one real "open" control ---- */
.rb-open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    width: 100%;
    border: 0;
    background: transparent;
    padding: .1rem 0;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
}

.rb-name {
    font-size: .875rem;
    font-weight: 700;
    color: var(--cim360-text-strong);
    line-height: 1.25;
}

.rb-desc {
    font-size: .75rem;
    color: var(--cim360-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* ---- last run ---- */
.rb-last {
    font-size: .75rem;
    color: var(--cim360-text-muted);
    line-height: 1.3;
    display: block;
}

.rb-last b {
    display: block;
    font-size: .8125rem;
    font-weight: 700;
    color: var(--cim360-caption);
}

.rb-last.never {
    font-style: italic;
}

/* ---- empty state ---- */
.rb-empty {
    padding: 3.5rem 1.25rem;
    text-align: center;
    color: var(--cim360-text-muted);
}

.rb-empty i {
    font-size: 1.625rem;
    color: var(--cim360-border-strong);
    display: block;
    margin-bottom: .625rem;
}

.rb-empty-title {
    font-weight: 700;
    color: var(--cim360-caption);
}

.rb-empty-hint {
    font-size: .8125rem;
}

/* ---- the list's own hint strip ----
   The design's .rb-list-foot carries both "Showing n of total" and this hint, scoped to the list
   column alone. Cim360SettingsGrid's own footer already shows the count, spans the full card
   width under rail and list together, and is not a file this change owns - so the hint is its own
   strip, inside .rb-list, directly above that shared footer rather than folded into it. */
.rb-list-hint {
    flex: 0 0 auto;
    margin: 0;
    padding: .5rem .875rem;
    font-size: .71875rem;
    color: var(--cim360-text-muted);
    border-top: 1px solid var(--cim360-border-soft);
    background: var(--cim360-surface-3);
}

/* ---- row menu: the "move to category" section ---- */
.rb-pop-label {
    color: var(--cim360-text-muted);
    cursor: default;
}

.rb-pop-label:hover {
    background: transparent !important;
}

.rb-pop-sub {
    margin: .125rem 0 .25rem;
    padding: .1875rem 0 .1875rem .375rem;
    border-left: 2px solid var(--cim360-primary-tint);
}

.rb-pop-sub button {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: .375rem .5625rem;
    border-radius: 0.3125rem;
    font-size: .75rem;
    font-weight: 600;
    color: var(--cim360-caption);
    font-family: inherit;
}

.rb-pop-sub button:hover:not(:disabled) {
    background: var(--cim360-primary-soft);
    color: var(--cim360-primary);
}

.rb-pop-sub button:disabled {
    color: var(--cim360-text-muted);
}

.rb-pop-sub button i {
    font-size: .75rem;
    color: var(--cim360-text-muted);
    width: .875rem;
}

.rb-pop-sub button .tick {
    margin-left: auto;
    color: var(--cim360-primary);
}

/* ============================================================================================
   Cim360ReportCategoryManager - the in-page new/edit/delete/manage windows, all built on
   Cim360ConfirmModal. Global for the same reason as the rest of this file: the icon picker and
   the manage list are the ChildContent this component hands to a shared modal, and a scoped
   sheet cannot reach markup rendered by a different component's own render tree.
   ============================================================================================ */

.rb-iconpick {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.375rem;
}

.rb-iconpick button {
    height: 2rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.3125rem;
    background: var(--cim360-card);
    color: var(--cim360-text-muted);
    font-size: .875rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rb-iconpick button:hover {
    border-color: var(--cim360-primary);
    color: var(--cim360-primary);
}

.rb-iconpick button.on {
    background: var(--cim360-primary-soft);
    border-color: var(--cim360-primary);
    color: var(--cim360-primary);
    box-shadow: inset 0 0 0 1px var(--cim360-primary);
}

.rb-catlist {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.rb-catrow {
    display: grid;
    grid-template-columns: 1.25rem minmax(0, 1fr) 2.125rem 1.625rem 1.625rem 1.625rem;
    align-items: center;
    gap: 0.4375rem;
}

.rb-catrow .ic {
    color: var(--cim360-text-muted);
    font-size: .875rem;
    text-align: center;
}

.rb-catrow .n {
    font-size: .6875rem;
    font-weight: 700;
    color: var(--cim360-text-muted);
    text-align: center;
}

.rb-catrow > button {
    height: 1.625rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.25rem;
    background: var(--cim360-card);
    color: var(--cim360-text-muted);
    font-size: .6875rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rb-catrow > button:hover:not(:disabled) {
    border-color: var(--cim360-primary);
    color: var(--cim360-primary);
}

.rb-catrow > button:disabled {
    color: var(--cim360-border);
    border-color: var(--cim360-border-soft);
}

.rb-catrow > button.del:hover:not(:disabled) {
    border-color: var(--cim360-danger);
    color: var(--cim360-danger);
}

/* Sits under the list and above the count, separated by a rule: it acts on the whole list rather
   than on any row, so it must not read as another row's control. */
.rb-catadd {
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 1px solid var(--cim360-border);
}

.rb-catadd > button {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
}

.rb-pcount {
    margin: .5rem 0 0;
    font-size: .6875rem;
    color: var(--cim360-text-muted);
}

/* ---- report parameters: how to compare ---- */

/* Narrow and above the editor, not beside it. It decides what the editor below BECOMES, so it
   reads as a modifier on the question rather than as a second question of equal weight. */
/* Layout only - the control itself is .c360-dlg-input now, not Bootstrap's form-select. Written
   with both classes so it outscores that one declaration it has to beat: .c360-dlg-input sets
   width:100% and this operator picker is sized to its own longest label, so one class against one
   class would be decided by which stylesheet the host happens to link second. */
.c360-dlg-input.rp-op {
    width: auto;
    min-width: 11rem;
    max-width: 100%;
    margin-bottom: .375rem;
}

/* ---- report output: On screen or a file, and the orientation (DEV-694) ----

   Set apart from the report's own questions by a rule above: those are what the report asks, this is
   what the reader does with the answers. Also used in a list's Print dialog. */
.rp-output {
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 1px solid var(--cim360-border);
}

/* The chip tray for "is one of". Wraps and scrolls rather than growing without limit - the field
   values route caps its list, but that cap is still larger than a dialog can show at once. */
.rp-many {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    max-height: 9rem;
    overflow-y: auto;
    padding: .375rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.25rem;
}

.rp-chip {
    border: 1px solid var(--cim360-border);
    background: transparent;
    border-radius: 62.4375rem;
    padding: .125rem .5rem;
    font-size: .75rem;
    color: var(--cim360-text);
    line-height: 1.5;
}

.rp-chip:hover {
    border-color: var(--cim360-primary);
    color: var(--cim360-primary);
}

/* Chosen carries a border as well as a ground, so the state does not rest on colour alone. */
.rp-chip.on {
    background: var(--cim360-primary-soft);
    border-color: var(--cim360-primary);
    color: var(--cim360-primary);
    font-weight: 600;
}

/* ============================================================================================
   DESCRIBE A REPORT - a dialog, not a strip in the hub's own flex row (DEV-444). Mirrors
   Cim360DashboardPage's own tile-builder dialog (.c360-dash-build-backdrop / .c360-dash-build in
   cim360-dashboard.css) - same z-index band, wash, blur and card chrome - but bounded rather than
   full-screen: this dialog has no separate preview stage, so it never needs the room that one does.

   c360DashPopFade / c360DashPopIn are cim360-dashboard.css's own keyframes, reused rather than
   redefined - every reports page already loads that stylesheet (see index.html / App.razor), so a
   second copy of the same two rules would only be a second place for them to drift apart.
   ============================================================================================ */
.rb-describe-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(15, 23, 42, .46);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    animation: c360DashPopFade .14s ease;
}

/* Bounded, not full screen - the conversation is the whole dialog, so it takes only the room a
   conversation needs rather than the two-pane spread the tile builder's preview stage earns it. */
.rb-describe {
    width: min(45rem, 100%);
    max-height: min(47.5rem, 100%);
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--cim360-card);
    border-radius: 0.75rem;
    overflow: hidden;
    padding: 1.125rem 1.375rem 1.25rem;
    box-shadow: 0 1.5rem 3.75rem rgba(15, 23, 42, .34), 0 0.25rem 0.875rem rgba(15, 23, 42, .18);
    animation: c360DashPopIn .16s cubic-bezier(.2, .7, .3, 1);
}

@media (prefers-reduced-motion: reduce) {
    .rb-describe-backdrop, .rb-describe { animation: none; }
}

.rb-describe-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 0 0 auto;
}

.rb-describe-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    background: color-mix(in srgb, var(--cim360-primary) 10%, var(--cim360-card));
    color: color-mix(in srgb, var(--cim360-primary) 70%, var(--cim360-text-strong));
}

[data-fluent-darkmode] .rb-describe-icon {
    color: color-mix(in srgb, var(--cim360-primary) 72%, var(--cim360-text-tint-base));
}

.rb-describe-title {
    flex: 1 1 auto;
    font-size: 1rem;
    font-weight: 800;
    color: var(--cim360-text-strong);
    letter-spacing: -.01em;
}

.rb-describe-close {
    flex: 0 0 auto;
    width: 2.125rem;
    height: 2.125rem;
    border-radius: 0.5rem;
    border: 1px solid var(--cim360-border);
    background: var(--cim360-surface-2);
    color: var(--cim360-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
}

.rb-describe-close:hover { color: var(--cim360-primary); border-color: var(--cim360-primary); }
.rb-describe-close:focus-visible { outline: 2px solid var(--cim360-primary); outline-offset: 2px; }

/* Fills below the head and lets the chat inside scroll, rather than the dialog growing to fit it.
   Cim360ReportBuilder's root, .c360-dash-chat, already declares its own "flex: 1 1 auto; min-height:
   0" (cim360-dashboard.css) - exactly the way .c360-dash-build-chat leaves that fill to the chat's
   own class rather than reaching for it with a child selector - so this body only has to be the
   flex column the chat expects to sit in. */
.rb-describe-body {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    margin-top: 1rem;
}

/* ---- the draft: what was built, and the decision about it -----------------------------------
   rb-draft / rb-draft-what / rb-draft-do were c360-dash-chat-draft* until now - a dashboard prefix
   on classes the dashboard itself never used (its own tile builder puts Keep/Discard in the
   dialog footer instead, see .c360-dash-build-decide in cim360-dashboard.css) and nothing in that
   file styled. That absence is the whole reason the block between the chat log and the compose
   box rendered as loose text with no panel of its own.

   The radius, background and internal rhythm are .c360-dash-chat's own (border-radius: 12px,
   background: var(--cim360-surface-2)) rather than invented ones, so the draft reads as a sibling
   of the chat log immediately above it instead of a different kind of thing. */
.rb-draft {
    flex: 0 0 auto;
    /* A hard ceiling of its own, not just a shrinking chat log. c360-dash-chat-log already gives
       up space first (flex: 1 1 auto down to its own min-height: 160px) - this is the second line
       of defence for a report with many columns and several conditions, so the draft scrolls
       itself rather than pushing c360-dash-chat-compose below it out of the dialog. */
    max-height: 17.5rem;
    overflow-y: auto;
    margin: 0.75rem 0;
    padding: 0.75rem 0.875rem;
    background: var(--cim360-surface-2);
    border: 1px solid var(--cim360-border);
    border-radius: 0.75rem;
}

.rb-draft-what {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.8125rem;
}

.rb-draft-what > i {
    color: var(--cim360-primary);
    font-size: 0.875rem;
    flex: 0 0 auto;
}

.rb-draft-title {
    font-weight: 700;
    color: var(--cim360-text-strong);
}

.rb-draft-dataset {
    color: var(--cim360-text-muted);
}

/* The header row the printed report will actually show, and nothing under it - see the WHY
   comment beside this markup in Cim360ReportBuilder.razor for why a body row is deliberately
   never drawn here. */
.rb-draft-cols {
    margin-top: 0.625rem;
    overflow-x: auto;
    border: 1px solid var(--cim360-border-soft);
    border-radius: 0.5rem;
}

.rb-draft-cols-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
}

.rb-draft-cols-table th {
    padding: 0.375rem 0.625rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--cim360-caption);
    background: var(--cim360-card);
    white-space: nowrap;
}

.rb-draft-cols-table th + th {
    border-left: 1px solid var(--cim360-border-soft);
}

/* The one decision behind a column that a header row alone would not show - marked rather than
   left silent, because a total sitting where it should not is a wrong number on the page, not a
   style choice nobody need be told about. */
.rb-draft-total {
    margin-left: 0.375rem;
    display: inline-block;
    padding: 1px 0.375rem;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--cim360-primary);
    background: var(--cim360-primary-soft);
    border-radius: 62.4375rem;
}

.rb-draft-decisions {
    margin: 0.625rem 0 0;
    padding-left: 1.125rem;
    font-size: 0.7813rem;
    color: var(--cim360-text-muted);
}

.rb-draft-decisions li {
    margin-bottom: 0.1875rem;
}

.rb-draft-do {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
