/* ============================================================
   Dashboard design system — shared styles for catalog dashboard
   pages (Background Jobs, Fixity, ...).

   Usage: put class="dashboard" on the page root, then use the
   component classes below. These are GLOBAL (not component-scoped),
   so they apply across pages and reach Fluent component host
   elements directly (no ::deep needed).

   Colors use Fluent design tokens so the look adapts to light and
   dark themes. FluentLabel renders a <fluent-typography> element
   whose Typo sets a default font-size; the text rules below are
   written WITH their container (e.g. `.dashboard .stat-tile
   .stat-count`) so they outweigh that default. This file is linked
   after the scoped bundle, so equal-specificity ties resolve here.
   ============================================================ */

:root {
    --status-success: var(--dashboard-success, #10b981);
    --status-info: var(--dashboard-info, #0ea5e9);
    --status-danger: #e2575f;
    --status-warning: #e8b13a;
    --status-success-bg: rgba(16, 185, 129, 0.14);
    --status-info-bg: rgba(14, 165, 233, 0.15);
    --status-danger-bg: rgba(226, 87, 95, 0.14);
    --status-warning-bg: rgba(232, 177, 58, 0.15);
    --status-warning-border: rgba(232, 177, 58, 0.45);
    --status-neutral-bg: rgba(128, 128, 128, 0.16);

    /* Sequential freshness scale (fresh -> stale). No Fluent equivalent exists for a
       sequential ramp, so these are defined centrally; past-policy and never reuse the
       status/neutral palette. */
    --freshness-0-30: #35d6a0;
    --freshness-31-90: #1aa179;
    --freshness-91-180: #caa83e;
    --freshness-181-365: #dd8a3a;
    --freshness-past-policy: var(--status-danger);
}

/* ---- Page shell ---- */

.dashboard {
    max-width: 1320px;
    margin: 0 auto;
    padding: 22px 26px 64px;
}

.dashboard-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.dashboard .dashboard-header .dashboard-title {
    display: block;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
}

.dashboard .dashboard-header .dashboard-subtitle {
    display: block;
    font-size: 13px;
    color: var(--neutral-foreground-hint);
    margin-top: 5px;
}

/* ---- Live indicator pill ---- */

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--neutral-layer-2);
    border: 1px solid var(--neutral-stroke-divider-rest);
    border-radius: 16px;
    padding: 6px 13px;
}

.live-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--status-success);
    animation: dashPulse 1.6s ease-in-out infinite;
}

.dashboard .live-indicator .live-indicator-text {
    font-size: 12px;
    color: var(--neutral-foreground-hint);
}

/* ---- Stat tiles ---- */

.stat-tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 20px;
}

/* FluentCard provides the border and radius; a raised surface fill is applied for
   the filled look (the default card fill is close to the page background). */
.dashboard .stat-tile {
    background: var(--neutral-layer-2);
    padding: 15px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Overview uses three tiles (no Published metric yet). */
.stat-tiles-3 {
    grid-template-columns: repeat(3, 1fr);
}

.dashboard .stat-tile-clickable {
    cursor: pointer;
}

.dashboard .stat-tile-clickable:hover {
    border-color: var(--neutral-stroke-rest);
}

.dashboard .stat-tile.active {
    outline: 2px solid var(--accent-fill-rest);
    outline-offset: -1px;
}

.dashboard .stat-tile-warning {
    border-color: var(--status-warning-border);
}

.dashboard .stat-tile .stat-count {
    display: block;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.1;
}

.dashboard .stat-tile .stat-caption {
    display: block;
    font-size: 12px;
    color: var(--neutral-foreground-hint);
    margin-top: 3px;
}

/* ---- Toolbar ---- */

.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.toolbar-spacer {
    flex: 1;
}

/* FluentSearch supplies the field, icon, and clear button; only width is set. */
.dashboard .toolbar-search {
    width: 300px;
}

/* ---- Filter pills (FluentButton restyled into rounded pills) ---- */

.filter-pills {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

/* Filter pills and segments are plain <button>s (not FluentButtons): the v4-era
   ::part(control) styling stopped taking effect in v5, so we style the element
   directly. Not scoped to .dashboard so the same control works inside drawers. */
.filter-pill {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 13px;
    border-radius: 16px;
    border: 1px solid var(--neutral-stroke-rest);
    background: transparent;
    color: var(--neutral-foreground-hint);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.filter-pill:hover {
    border-color: var(--neutral-stroke-strong, var(--neutral-stroke-rest));
    color: var(--neutral-foreground-rest);
}

.filter-pill.active {
    border-color: var(--accent-fill-rest);
    background: var(--status-info-bg);
    color: var(--accent-foreground-rest, var(--accent-fill-rest));
}

/* ---- Segmented control (a track of plain <button>s) ---- */

.segmented {
    display: inline-flex;
    /* Size to its buttons; without this it stretches to full width inside a
       stretch-aligned FluentStack (e.g. the member panel's Member/Admin toggle). */
    align-self: flex-start;
    background: var(--neutral-layer-1);
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 7px;
    padding: 3px;
    gap: 2px;
}

.segment {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--neutral-foreground-hint);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.segment:hover {
    color: var(--neutral-foreground-rest);
}

.segment.active {
    background: var(--accent-fill-rest);
    color: var(--foreground-on-accent-rest, #ffffff);
}

/* ---- Result count caption (above a grid) ---- */

.dashboard .result-count {
    display: block;
    font-size: 12px;
    color: var(--neutral-foreground-hint);
    margin: 14px 0 8px;
}

/* ---- Loading skeletons ---- */

.loading-skeletons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}

/* ---- Section header (icon + title above a card/grid) ---- */

.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard .section-header .section-title {
    font-size: 16px;
    font-weight: 600;
}

/* ---- Banners ---- */

.banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
}

.banner-warning {
    background: var(--status-warning-bg);
    border-color: var(--status-warning-border);
}

.banner-success {
    background: var(--status-success-bg);
    border-color: rgba(16, 185, 129, 0.3);
}

/* ---- Progress bar ---- */

.progress-track {
    width: 100%;
    height: 12px;
    background: var(--neutral-layer-4);
    border-radius: 6px;
    overflow: hidden;
}

.progress-track-sm {
    height: 6px;
    border-radius: 3px;
}

.progress-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--status-success);
    transition: width 0.5s ease;
}

/* ---- Fixity freshness distribution ---- */

.freshness-bar {
    display: flex;
    width: 100%;
    height: 30px;
    border-radius: 6px;
    overflow: hidden;
    gap: 1.5px;
    background: var(--neutral-layer-4);
}

.freshness-bar-segment {
    height: 100%;
    transition: width 0.5s ease;
}

.freshness-legend {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px 16px;
}

.freshness-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.freshness-legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex: none;
}

.dashboard .freshness-legend-label {
    flex: 1;
    font-size: 12px;
    color: var(--neutral-foreground-rest);
}

.dashboard .freshness-legend-label-alert {
    color: var(--status-danger);
}

.dashboard .freshness-legend-count {
    font-size: 12px;
    font-weight: 700;
    color: var(--neutral-foreground-rest);
}

.dashboard .freshness-legend-count-alert {
    color: var(--status-danger);
}

.freshness-stats {
    display: flex;
    width: 100%;
    border-top: 1px solid var(--neutral-stroke-divider-rest);
    padding-top: 14px;
}

.freshness-stat {
    flex: 1;
    padding: 0 14px;
    border-right: 1px solid var(--neutral-stroke-divider-rest);
}

.freshness-stat:first-child {
    padding-left: 0;
}

.freshness-stat:last-child {
    border-right: none;
}

.dashboard .freshness-stat-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    color: var(--neutral-foreground-rest);
}

.dashboard .freshness-stat-value-alert {
    color: var(--status-danger);
}

.dashboard .freshness-stat-label {
    display: block;
    margin-top: 5px;
    font-size: 11.5px;
    color: var(--neutral-foreground-hint);
}

/* ---- Data card (a FluentCard wrapping a full-bleed data grid) ---- */

.dashboard .data-card {
    background: var(--neutral-layer-2);
    padding: 0;
    overflow: hidden;
    margin-top: 14px;
}

/* ---- Data grid ----
   FluentDataGrid (DisplayMode Grid) is a CSS grid whose rows are display:contents,
   so the cells are the grid items. All styling targets cells, not rows. Column
   widths come from the GridTemplateColumns parameter. Both the FAST role attributes
   and the td/th forms are matched so this is robust to the grid's markup. */

.dashboard .data-grid {
    width: 100%;
    column-gap: 0;
    background: var(--neutral-layer-2);
}

.dashboard .data-grid [role="gridcell"],
.dashboard .data-grid [role="columnheader"],
.dashboard .data-grid td,
.dashboard .data-grid th {
    align-items: center;
    min-height: unset;
    border: none;
}

.dashboard .data-grid [role="gridcell"]:first-child,
.dashboard .data-grid [role="columnheader"]:first-child,
.dashboard .data-grid td:first-child,
.dashboard .data-grid th:first-child {
    padding-left: 18px;
}

.dashboard .data-grid [role="gridcell"]:last-child,
.dashboard .data-grid [role="columnheader"]:last-child,
.dashboard .data-grid td:last-child,
.dashboard .data-grid th:last-child {
    padding-right: 18px;
}

/* Body cells: flex centering, gray fill, divider; overflow clipped so a cell whose
   content is a hair too wide doesn't show a scrollbar. */
.dashboard .data-grid [role="gridcell"],
.dashboard .data-grid td {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 10px 7px;
    background: var(--neutral-layer-2);
    border-top: 1px solid var(--neutral-stroke-divider-rest);
    overflow: hidden;
}

.dashboard .data-grid-clickable [role="gridcell"],
.dashboard .data-grid-clickable td {
    cursor: pointer;
}

/* Roomier body rows for grids whose cells stack text over a progress bar. Only
   body cells are affected; headers are [role="columnheader"]/th. */
.dashboard .data-grid-roomy [role="gridcell"],
.dashboard .data-grid-roomy td {
    padding-top: 14px;
    padding-bottom: 14px;
}

/* Header cells: distinct fill + uppercase labels. */
.dashboard .data-grid [role="columnheader"],
.dashboard .data-grid th {
    --fluent-data-grid-header-opacity: 1;
    display: flex;
    align-items: center;
    padding: 8px 7px;
    background: var(--neutral-layer-3);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--neutral-foreground-hint);
}

/* Keep header titles from being shrunk to an ellipsis by the flex layout, and strip
   the default title-wrapper insets so the header aligns with the cell content. */
.dashboard .data-grid [role="columnheader"] *,
.dashboard .data-grid th * {
    flex-shrink: 0;
    overflow: visible;
    text-overflow: clip;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
}

/* Row hover (matched via cells, since rows have no box). Notes:
   - !important beats FluentDataGrid's built-in ShowHover, which otherwise paints the
     cells with a stealth-hover token that is nearly invisible against light cells.
   - the :has() variant covers browsers where :hover does not propagate to the
     display:contents row.
   - the color blends foreground into the cell fill so it reads in light AND dark. */
.dashboard .data-grid [role="row"]:hover [role="gridcell"],
.dashboard .data-grid [role="row"]:has([role="gridcell"]:hover) [role="gridcell"],
.dashboard .data-grid tbody tr:hover td {
    background: color-mix(in srgb, var(--neutral-foreground-rest) 12%, var(--neutral-layer-2)) !important;
}

/* Selected row: accent bar on its first cell. */
.dashboard .data-grid .data-grid-row-selected [role="gridcell"]:first-child,
.dashboard .data-grid .data-grid-row-selected td:first-child {
    box-shadow: inset 3px 0 0 0 var(--accent-fill-rest);
}

/* Let the empty-state message span all columns. */
.dashboard .data-grid .empty-state {
    grid-column: 1 / -1;
}

/* ---- Status dot ---- */

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    flex: none;
}

.status-dot-neutral {
    background: var(--neutral-foreground-hint);
}

.status-dot-info {
    background: var(--status-info);
    animation: dashPulse 1.4s ease-in-out infinite;
}

.status-dot-success {
    background: var(--status-success);
}

.status-dot-danger {
    background: var(--status-danger);
}

.status-dot-warning {
    background: var(--status-warning);
}

/* ---- Cell content helpers ---- */

.cell-stack {
    min-width: 0;
}

.dashboard .data-grid .cell-title {
    display: block;
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard .data-grid .cell-danger {
    display: block;
    font-size: 11.5px;
    color: var(--status-danger);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.dashboard .data-grid .cell-mono {
    display: block;
    font-family: monospace;
    font-size: 11px;
    color: var(--neutral-foreground-hint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.dashboard .data-grid .cell-primary {
    display: block;
    font-size: 12.5px;
}

.dashboard .data-grid .cell-secondary {
    display: block;
    font-size: 11px;
    color: var(--neutral-foreground-hint);
    margin-top: 1px;
}

.dashboard .data-grid .cell-value {
    font-size: 12.5px;
}

.dashboard .data-grid .cell-value-info {
    font-weight: 600;
    color: var(--status-info);
}

.dashboard .data-grid .cell-value-faint {
    color: var(--neutral-foreground-hint);
}

/* ---- Badge content (inside a FluentBadge whose colors come from its params) ---- */

.badge-content {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1;
}

/* ---- Person / avatar cell ---- */

.person-cell {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9.5px;
    font-weight: 700;
    flex: none;
}

.avatar-tone-0 {
    background: rgba(14, 165, 233, 0.22);
    color: var(--status-info);
}

.avatar-tone-1 {
    background: rgba(16, 185, 129, 0.22);
    color: var(--status-success);
}

.avatar-tone-2 {
    background: rgba(232, 177, 58, 0.25);
    color: var(--status-warning);
}

.avatar-tone-3 {
    background: var(--status-neutral-bg);
    color: var(--neutral-foreground-rest);
}

.avatar-system {
    background: var(--status-neutral-bg);
}

.dashboard .data-grid .person-name {
    display: block;
    min-width: 0;
    font-size: 12.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard .data-grid .person-name-system {
    color: var(--neutral-foreground-hint);
}

/* ---- Row actions ---- */

.row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

/* ---- Empty state ---- */

.empty-state {
    padding: 50px;
    text-align: center;
    border-top: 1px solid var(--neutral-stroke-divider-rest);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.dashboard .empty-state .empty-state-text,
.access-page .empty-state .empty-state-text {
    font-size: 13.5px;
    color: var(--neutral-foreground-hint);
}

/* ---- "Coming soon" placeholder (unbuilt pages: Curation, Publish) ---- */

.coming-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
    padding: 72px 24px;
    min-height: 55vh;
}

.coming-soon-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    border-radius: 22px;
    background: var(--accent-bg);
    margin-bottom: 6px;
}

.coming-soon-icon svg {
    width: 44px;
    height: 44px;
}

.coming-soon-badge {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--accent-fill-rest);
    background: var(--accent-bg);
    padding: 4px 12px;
    border-radius: 999px;
}

.coming-soon-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--neutral-foreground-rest);
}

.coming-soon-text {
    max-width: 440px;
    color: var(--neutral-foreground-hint);
    line-height: 1.55;
    font-size: 14px;
}

/* ---- Pagination ---- */

.pagination-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.dashboard .pagination-bar .page-info,
.access-pagination .page-info {
    font-size: 12px;
    color: var(--neutral-foreground-hint);
}

.dashboard .pagination-bar .page-label,
.access-pagination .page-label {
    display: inline-block;
    font-size: 12px;
    min-width: 84px;
    text-align: center;
}

/* Pager nav buttons: FluentButton's Default appearance renders a near-black fill in
   dark mode, which looks jarring. Restyle them as the design's "secondary" icon
   button (a gray fill with a border), theme-aware via the surface tokens. */
.dashboard .pagination-bar fluent-button::part(control),
.access-pagination fluent-button::part(control) {
    background: var(--surface-card-elev);
    border-color: var(--border-strong);
    color: var(--text-tertiary);
}

.dashboard .pagination-bar fluent-button:not([disabled]):hover::part(control),
.access-pagination fluent-button:not([disabled]):hover::part(control) {
    background: color-mix(in srgb, var(--text-primary) 8%, var(--surface-card-elev));
}

/* ---- Records empty-state hero (shown when an org has no records yet) ---- */

.records-empty {
    max-width: 1000px;
    margin: 0 auto;
    padding: 48px 0 40px;
}

.records-empty-hero {
    text-align: center;
}

.records-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: var(--neutral-layer-2);
    border: 1px solid var(--neutral-stroke-divider-rest);
}

.dashboard .records-empty .records-empty-title {
    margin: 18px 0 0;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--neutral-foreground-rest);
}

.dashboard .records-empty .records-empty-subtitle {
    font-size: 14px;
    color: var(--neutral-foreground-hint);
    margin: 8px auto 0;
    max-width: 460px;
    line-height: 1.5;
}

.records-type-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 34px;
}

.records-type-card {
    background: var(--neutral-layer-2);
    border: 1px solid var(--neutral-stroke-divider-rest);
    border-radius: 12px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.records-type-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    flex: none;
}

.records-type-card-body {
    flex: 1;
}

.dashboard .records-type-card .records-type-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--neutral-foreground-rest);
}

.dashboard .records-type-card .records-type-card-desc {
    font-size: 13px;
    color: var(--neutral-foreground-hint);
    margin-top: 5px;
    line-height: 1.5;
}

.records-soon-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 30px 0 16px;
}

.records-soon-divider-line {
    height: 1px;
    flex: 1;
    background: var(--neutral-stroke-divider-rest);
}

.dashboard .records-soon-divider .records-soon-divider-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--neutral-foreground-hint);
    white-space: nowrap;
}

.records-soon-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.records-soon-card {
    background: var(--neutral-layer-1);
    border: 1px dashed var(--neutral-stroke-rest);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0.78;
}

.records-soon-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--neutral-layer-3);
    flex: none;
}

.records-soon-card-body {
    min-width: 0;
}

.dashboard .records-soon-card .records-soon-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--neutral-foreground-rest);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard .records-soon-card .records-soon-card-sub {
    font-size: 11.5px;
    color: var(--neutral-foreground-hint);
    margin-top: 2px;
}

/* ---- Animations ---- */

@keyframes dashPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.35;
    }
}

/* ---- Records: facet rail + sort dropdown ---- */

.records-layout {
    display: flex;
    align-items: flex-start;
    gap: 22px;
    margin-top: 20px;
}

.facet-rail {
    width: 246px;
    flex: none;
}

/* The main column takes all remaining width beside the fixed facet rail. Without this the
   flex item sizes to its content, so a list of short titles leaves the grid narrower than
   the page header, misaligning it with the New Record button. min-width: 0 lets it shrink
   below content size rather than overflowing. */
.records-main {
    flex: 1;
    min-width: 0;
}

.facet-card {
    background: var(--neutral-layer-2);
    border: 1px solid var(--neutral-stroke-divider-rest);
    border-radius: 10px;
    overflow: hidden;
}

/* Content card matching the design's neutral card / records filter rail (grey fill, subtle
   border, rounded). Selector is `.fluent-card.detail-card` (not just `.detail-card`) to match
   FluentUI's own `.fluent-card:not([appearance])` rule specificity (0,2,0); dashboard.css loads
   after FluentUI's scoped bundle, so at equal specificity this wins. FluentCard's default
   already fills with --neutral-layer-2; this aligns the border colour and radius to the rail. */
.fluent-card.detail-card {
    background-color: var(--neutral-layer-2);
    border: 1px solid var(--neutral-stroke-divider-rest);
    border-radius: 10px;
    box-shadow: none;
}

.facet-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 16px 12px;
}

.facet-card-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--neutral-foreground-rest);
}

.facet-clear {
    border: none;
    background: transparent;
    color: var(--accent-fill-rest);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.facet-clear:hover {
    text-decoration: underline;
}

.facet-group {
    border-top: 1px solid var(--neutral-stroke-divider-rest);
    padding: 12px 14px 13px;
}

/* Scrollable container for a long facet list (e.g. the Entity facet on the Files view). */
.facet-group-scroll {
    max-height: 208px;
    overflow-y: auto;
}

.facet-group-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--neutral-foreground-hint);
    margin-bottom: 8px;
}

.facet-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
    padding: 0;
}

/* With Label set, FluentCheckbox lays the box + label out through a <fluent-field>,
   whose box-to-label gap comes from an inline margin on the slotted checkbox. Trim
   only the vertical margin (margin-block) so the Type facet reads as one dense list
   without collapsing that horizontal gap. Target both the field wrapper and the bare
   checkbox so it holds regardless of which element carries the margin. */
.facet-group .facet-row fluent-field,
.facet-group .facet-row fluent-checkbox {
    margin-block: 0;
}

/* A vertical list of FluentCheckboxes: the <fluent-field> each renders carries its own
   vertical margin, so a container gap alone still leaves them far apart. Zero the field
   margin and let the small flex gap control the rhythm. */
/* ---- Organization settings pages ----
   Shared scaffold for the pages under /settings: a page header (title plus a
   one-line description) followed by bordered section cards, per the
   "Statuses and Workflow" design. */

/* Simple form pages: a single left-aligned column with even rhythm between
   the header, notices, and cards. Wide pages (workflow, curation, profile
   editor) keep their own layout and use the header/card classes directly. */
.settings-page {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    max-width: 720px;
}

.settings-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

/* Inside .settings-page the column gap provides the spacing. */
.settings-page > .settings-header {
    margin-bottom: 0;
}

.settings-header-desc {
    display: block;
    margin-top: 2px;
    font-size: var(--fs-secondary);
    color: var(--text-tertiary);
}

.settings-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Section card. FluentCard's own scoped rule (.fluent-card:not([appearance]))
   ties this specificity, so keep the .fluent-card prefix; this file loads
   later and wins (same approach as .detail-card). */
.fluent-card.settings-card {
    display: block;
    background-color: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: none;
    padding: 14px 16px;
}

/* Full-bleed variant for cards holding row lists (e.g. the curation checks). */
.fluent-card.settings-card-flush {
    padding: 0;
    overflow: hidden;
}

.settings-card-title {
    font-size: var(--fs-label);
    font-weight: var(--fw-bold);
    letter-spacing: var(--label-spacing-wide);
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Card header row: uppercase title on the left, actions on the right. */
.settings-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.settings-card-head .settings-card-title {
    margin-bottom: 0;
}

/* Wider column for pages built around data grids (e.g. record access). */
.settings-page.settings-page-wide {
    max-width: 1100px;
}

.settings-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-checkboxes fluent-field,
.settings-checkboxes fluent-checkbox {
    margin-block: 0;
}

.facet-row .facet-count {
    font-size: 11.5px;
    color: var(--neutral-foreground-hint);
    font-variant-numeric: tabular-nums;
}

/* A "More…" / "Less" toggle under a facet list that shows only its most common values. */
.facet-more {
    border: none;
    background: transparent;
    color: var(--accent-foreground-rest, var(--accent-fill-rest));
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-top: 6px;
}

.facet-more:hover {
    text-decoration: underline;
}

/* FluentRadioGroup puts its Class on the <fluent-field> it wraps itself in. The
   <fluent-radio-group> is that field's input, and each FluentRadio is a further
   <fluent-field> (label plus <fluent-radio>) slotted into the group. The rules below
   reach those inner elements; an outer-tree rule beats the shadow styles it replaces. */
.dashboard .facet-radio-group {
    display: block;
}

/* The group's shadow styles put a 16px gap between radios and an 8px margin around the
   group, so the radios sat a blank line apart and indented from the checkbox lists.
   With both removed, each radio takes one label line, the same as a checkbox row. */
.dashboard .facet-radio-group fluent-radio-group {
    align-items: flex-start;
    gap: 0;
    margin: 0;
}

/* The group paints every radio label in the tertiary foreground and only the checked
   one in the primary, which makes the unselected options read as disabled. (A radio's
   field also keeps its checked state after another radio is chosen, so a once-selected
   label stayed bright.) Give every label the color the checkbox labels use. FluentUI
   also gives the first radio of a group a top margin, which is removed here. */
.dashboard .facet-radio-group fluent-radio-group > fluent-field {
    color: var(--colorNeutralForeground1);
    margin: 0;
}

/* ---- Sort dropdown ---- */

.sort-dropdown {
    position: relative;
}

.dashboard .sort-trigger::part(control) {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
}

.sort-trigger .sort-prefix {
    font-size: 12.5px;
    /* Explicit regular weight: the trigger is a FluentButton whose control renders
       slotted text semibold in v5, so without this the "Sort by" prefix inherits bold
       and stops reading as the dimmed label it should be. */
    font-weight: var(--fw-regular);
    color: var(--neutral-foreground-hint);
    margin-right: 6px;
}

.sort-trigger .sort-current {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--neutral-foreground-rest);
    margin-right: 6px;
}

.sort-overlay {
    position: fixed;
    inset: 0;
    z-index: 39;
}

.sort-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 40;
    min-width: 208px;
    background: var(--neutral-layer-2);
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 9px;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.35);
    padding: 5px;
}

.sort-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 11px;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    color: var(--neutral-foreground-hint);
}

.sort-option .sort-option-label {
    flex: 1;
    text-align: left;
}

.sort-option:hover {
    background: var(--neutral-fill-stealth-hover);
}

.sort-option.active {
    font-weight: 600;
    color: var(--neutral-foreground-rest);
}

/* ---- Styled select (Shared/StyledSelect.razor) ----
   A select with the sort-dropdown's popover (it reuses .sort-overlay, .sort-menu,
   and .sort-option) behind a quiet filled trigger, replacing FluentSelect where
   its default outline look reads as heavy (the settings areas). */

.styled-select {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.styled-select-label {
    display: block;
    margin-bottom: 5px;
    font-size: var(--fs-body);
    color: var(--text-secondary);
}

.styled-select-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 32px;
    padding: 5px 10px;
    background: var(--surface-input);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: var(--fs-secondary);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
}

.styled-select-trigger:focus-visible {
    outline: none;
    border-color: var(--brand-accent);
}

.styled-select-trigger:disabled {
    opacity: 0.55;
    cursor: default;
}

.styled-select-value {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Anchor the menu to the trigger's left edge at least as wide as the trigger
   (the sort dropdown anchors right instead). */
.styled-select .sort-menu {
    left: 0;
    right: auto;
    min-width: 100%;
}

/* The records toolbar lives inside the main column of the two-column layout, so the section
   margin that normally separates the toolbar from the page header is not needed here. */
.dashboard .records-main .toolbar {
    margin-top: 0;
}

/* ---- View toggle (segmented control switching the list between cards and the table) ---- */

.view-toggle {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: var(--neutral-layer-3);
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 8px;
}

.view-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 30px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--neutral-foreground-hint);
    cursor: pointer;
}

.view-toggle-btn:hover {
    color: var(--neutral-foreground-rest);
}

.view-toggle-btn.active {
    background: var(--neutral-layer-1);
    color: var(--neutral-foreground-rest);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* ---- Record cards (default list view) ---- */

.records-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.record-card {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background: var(--neutral-layer-2);
    border: 1px solid var(--neutral-stroke-divider-rest);
    border-radius: 11px;
    padding: 16px 18px;
    cursor: pointer;
}

.record-card:hover {
    border-color: var(--neutral-stroke-rest);
    background: color-mix(in srgb, var(--neutral-foreground-rest) 4%, var(--neutral-layer-2));
}

.record-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    flex: none;
}

.record-card-body {
    flex: 1;
    min-width: 0;
}

.record-card-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.record-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--neutral-foreground-rest);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.record-card-desc {
    font-size: 13px;
    color: var(--neutral-foreground-hint);
    margin-top: 5px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.record-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 11px;
    flex-wrap: wrap;
}

.record-card-identifier {
    font-family: monospace;
    font-size: 11.5px;
    color: var(--neutral-foreground-hint);
}

.record-card-modified {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--neutral-foreground-hint);
    white-space: nowrap;
}

.record-card-chevron {
    flex: none;
    align-self: center;
}

/* ============================================================
   Record editor — full-width command toolbar, structure tree
   sidebar, and the action dropdown menus. These are global (the
   record editor markup opts in by class, not by the `.dashboard`
   wrapper) so the rules below are written without a `.dashboard`
   ancestor. Colors use Fluent tokens so they adapt to themes.
   ============================================================ */

/* ---- Command toolbar (spans the sidebar + content) ---- */

.record-toolbar {
    flex: none;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 8px 16px;
    background: var(--neutral-layer-1);
    border-bottom: 1px solid var(--neutral-stroke-divider-rest);
}

.record-toolbar-sep {
    flex: none;
    width: 1px;
    height: 24px;
    background: var(--neutral-stroke-rest);
}

.record-root-tile {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--neutral-layer-3);
}

.record-toolbar-spacer {
    flex: 1;
}

/* ---- Add menu (the toolbar's primary action; reuses .sort-overlay and .sort-menu) ---- */

.add-menu {
    position: relative;
    display: flex;
    flex: none;
}

.add-menu-list {
    width: 324px;
    max-width: calc(100vw - 32px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.add-menu-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--neutral-foreground-rest);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.add-menu-item:hover,
.add-menu-item:focus-visible {
    background: var(--neutral-fill-stealth-hover);
}

.add-menu-item:focus-visible {
    outline: 2px solid var(--accent-fill-rest);
    outline-offset: -2px;
}

.add-menu-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.add-menu-title {
    font-size: 13px;
    color: var(--neutral-foreground-rest);
}

.add-menu-description {
    font-size: 12px;
    color: var(--neutral-foreground-hint);
}

.add-menu-divider {
    height: 1px;
    margin: 4px 8px;
    background: var(--neutral-stroke-divider-rest);
}

/* ---- Toolbar entity stats (file size, row count) ---- */

.record-stats {
    flex: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.record-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--neutral-layer-3);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: var(--neutral-foreground-hint);
    white-space: nowrap;
}

.record-stat svg {
    width: 14px;
    height: 14px;
}

/* ---- Toolbar breadcrumb ---- */

.record-breadcrumb {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
    overflow: hidden;
    flex-wrap: nowrap;
}

.record-breadcrumb .crumb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    font-size: 12.5px;
    color: var(--neutral-foreground-hint);
    white-space: nowrap;
}

.record-breadcrumb .crumb:hover {
    background: var(--neutral-fill-stealth-hover);
}

.record-breadcrumb .crumb-label {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.record-breadcrumb .crumb-current {
    font-weight: 600;
    color: var(--neutral-foreground-rest);
    background: var(--neutral-fill-stealth-hover);
    cursor: default;
}

.record-breadcrumb .crumb-sep {
    flex: none;
    font-size: 12px;
    color: var(--neutral-foreground-hint);
    padding: 0 1px;
}

/* ---- Action dropdown menu (Add / Download / More) ---- */

.record-menu-wrap {
    position: relative;
    flex: none;
}

.record-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 50;
    min-width: 224px;
    background: var(--neutral-layer-2);
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 9px;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.35);
    padding: 5px;
}

.record-menu-heading {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--neutral-foreground-hint);
    padding: 7px 10px 5px;
}

.record-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    color: var(--neutral-foreground-rest);
    text-align: left;
}

.record-menu-item:hover {
    background: var(--neutral-fill-stealth-hover);
}

.record-menu-item .record-menu-label {
    flex: 1;
}

.record-menu-item .record-menu-hint {
    font-size: 11px;
    color: var(--neutral-foreground-hint);
}

.record-menu-item:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.record-menu-item:disabled:hover {
    background: transparent;
}

/* The file page's More menu (LogicalFileDeleteAction): items carry a second, descriptive line. */
.record-more-menu {
    width: 300px;
    max-width: calc(100vw - 32px);
}

.record-menu-item-described {
    align-items: flex-start;
    text-decoration: none;
}

.record-menu-item-described > svg {
    flex: none;
    margin-top: 1px;
}

.record-menu-item .record-menu-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.record-menu-item .record-menu-text .record-menu-label {
    font-weight: 600;
}

.record-menu-item .record-menu-description {
    font-size: 12px;
    line-height: 1.35;
    color: var(--neutral-foreground-hint);
}

.record-menu-item .record-menu-description-link {
    color: var(--accent-fill-rest);
}

.record-menu-item-danger {
    color: var(--danger);
}

.record-menu-item-danger:not(:disabled):hover {
    background: var(--danger-bg);
}

/* A disabled item with a description keeps its reason readable instead of fading the whole row. */
.record-menu-item-described:disabled {
    opacity: 1;
    color: var(--neutral-foreground-hint);
}

.logical-file-delete-error {
    font-size: 12px;
    color: var(--danger);
}

/* Status only (a file whose reads are blocked by its deletion): one line with the stage and a status link. */
.logical-file-delete-status {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: var(--neutral-foreground-rest);
}

.logical-file-delete-status:empty {
    display: none;
}

.logical-file-delete-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-fill-rest);
}

/* ---- Structure sidebar ---- */

.structure-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: var(--neutral-layer-1);
}

.structure-header {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 10px 9px 14px;
    border-bottom: 1px solid var(--neutral-stroke-rest);
}

.structure-header-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--neutral-foreground-hint);
}

.structure-tools {
    display: flex;
    align-items: center;
    gap: 6px;
}

.structure-tools-sep {
    width: 1px;
    height: 18px;
    background: var(--neutral-stroke-rest);
}

.structure-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
}

.structure-tool-btn:hover {
    background: var(--neutral-fill-stealth-hover);
}

.structure-tool-btn.active {
    border-color: var(--accent-fill-rest);
    background: var(--status-info-bg);
}

.structure-tree {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px 6px 18px;
}

/* ---- Structure tree rows ---- */

.tree-row {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px 5px 6px;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
}

.tree-row:hover {
    background: var(--neutral-fill-stealth-hover);
}

.tree-row.selected {
    background: var(--status-info-bg);
    box-shadow: inset 0 0 0 1px var(--accent-fill-rest);
}

.tree-twisty {
    flex: none;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
}

.tree-twisty:hover {
    background: var(--neutral-fill-stealth-hover);
}

.tree-icon {
    flex: none;
    display: inline-flex;
}

.tree-name {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--neutral-foreground-hint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-row.selected .tree-name,
.tree-name.container {
    color: var(--neutral-foreground-rest);
}

.tree-trailing {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tree-focus-btn {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background: var(--status-info-bg);
}

.tree-count {
    font-size: 11px;
    min-width: 14px;
    text-align: right;
    color: var(--neutral-foreground-hint);
    font-variant-numeric: tabular-nums;
}

.tree-count.data {
    color: var(--status-info);
}

/* A Files group too large to list in the tree (search only). */
.tree-count.overflow {
    color: var(--status-warning);
    font-weight: 600;
}

/* ---- Focus banner ---- */

.focus-banner {
    flex: none;
    padding: 9px 12px 10px;
    border-bottom: 1px solid var(--neutral-stroke-rest);
    background: var(--status-info-bg);
}

.focus-banner-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
}

.focus-banner-label {
    flex: 1;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--accent-fill-rest);
}

.focus-banner-exit {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border: 1px solid var(--accent-fill-rest);
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    font-size: 11.5px;
    color: var(--accent-fill-rest);
}

.focus-banner-path {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
}

.focus-banner-crumb {
    border: none;
    background: transparent;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 11.5px;
    color: var(--neutral-foreground-hint);
    cursor: pointer;
    max-width: 168px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.focus-banner-crumb.current {
    font-weight: 700;
    color: var(--neutral-foreground-rest);
    cursor: default;
}

.focus-banner-path-sep {
    color: var(--neutral-foreground-hint);
    font-size: 11px;
}

/* The Files view reuses the dashboard shell classes but renders inside the record content
   pane, which supplies its own width and clips overflow. Override the page-shell centering so
   the table fills the pane and stays left-aligned, and make this element the scroll container
   (the pane itself is overflow:hidden) so long result lists can scroll. */
.dashboard.files-view {
    max-width: none;
    margin: 0;
    padding: 0;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 44px header bar, flush to the top of the content pane so it lines up with the structure panel
   header and the entity views' secondary navigation. */
.files-view-header {
    flex: none;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 44px;
    min-height: 44px;
    padding: 0 22px;
    border-bottom: 1px solid var(--neutral-stroke-divider-rest);
    background: var(--neutral-layer-1);
}

/* Scrolls beneath the fixed header; carries the padding the whole view used to have. */
.files-view-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 22px 40px;
}

/* ============================================================
   People page — members, teams, and invitations. The grid,
   toolbar, and card shells reuse the dashboard classes above;
   the rules below add the People-specific pieces: catalog-role
   badges, team chips, avatar stacks, the segment count pill, and
   the person / team drawer internals.

   Catalog roles are a categorical scale with no Fluent token
   equivalent (like the freshness ramp), so the five role colors
   are defined centrally here. Tints are mixed with `transparent`
   so a single color drives both fill and text on either theme.
   The drawer rules are NOT scoped to `.dashboard` because dialog
   panels render outside the page shell.
   ============================================================ */

:root {
    --role-reader: #7c8b9e;
    --role-proposer: #38a3d1;
    --role-writer: #2f6fed;
    --role-maintainer: var(--status-warning);
    --role-admin: var(--status-danger);
}

/* ---- Catalog-role access badge ---- */

.access-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.access-badge-lg {
    gap: 7px;
    padding: 5px 13px;
    font-size: 13px;
    font-weight: 700;
}

.access-badge .access-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex: none;
    background: currentColor;
}

.access-badge-lg .access-dot {
    width: 8px;
    height: 8px;
}

.access-badge-reader {
    color: var(--role-reader);
    background: color-mix(in srgb, var(--role-reader) 16%, transparent);
}

.access-badge-proposer {
    color: var(--role-proposer);
    background: color-mix(in srgb, var(--role-proposer) 16%, transparent);
}

.access-badge-writer {
    color: var(--role-writer);
    background: color-mix(in srgb, var(--role-writer) 16%, transparent);
}

.access-badge-maintainer {
    color: var(--role-maintainer);
    background: color-mix(in srgb, var(--role-maintainer) 16%, transparent);
}

.access-badge-admin {
    color: var(--role-admin);
    background: color-mix(in srgb, var(--role-admin) 16%, transparent);
}

/* ---- Organization role badge (Member / Admin) ---- */

.org-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1;
    background: var(--status-neutral-bg);
    color: var(--neutral-foreground-hint);
}

.org-badge-admin {
    background: color-mix(in srgb, var(--accent-fill-rest) 16%, transparent);
    color: var(--accent-fill-rest);
}

/* ---- Team chips (member row: which teams a person belongs to) ---- */

.team-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 0;
}

.team-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--neutral-layer-3);
}

.team-chip .team-chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex: none;
}

.dashboard .data-grid .team-chip-label {
    font-size: 11.5px;
    color: var(--neutral-foreground-rest);
    white-space: nowrap;
}

.dashboard .data-grid .team-chips-empty {
    font-size: 11.5px;
    color: var(--neutral-foreground-hint);
}

/* ---- Team member avatar stack (teams grid) ---- */

.team-members-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.avatar-stack {
    display: inline-flex;
    align-items: center;
}

.avatar-stack .avatar {
    border: 2px solid var(--neutral-layer-2);
}

.avatar-stack > * + * {
    margin-left: -7px;
}

.avatar-stack-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    margin-left: -7px;
    border-radius: 999px;
    border: 2px solid var(--neutral-layer-2);
    background: var(--neutral-layer-4);
    font-size: 10px;
    font-weight: 700;
    color: var(--neutral-foreground-hint);
}

.dashboard .data-grid .team-members-count {
    font-size: 12px;
    color: var(--neutral-foreground-hint);
}

/* Mono slug under a team name. */
.dashboard .data-grid .cell-slug {
    display: block;
    font-family: monospace;
    font-size: 11px;
    color: var(--neutral-foreground-hint);
    margin-top: 2px;
}

/* ---- Access filter pill dot (members toolbar) ---- */

.filter-pill .pill-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

/* ---- Segmented control count pill ---- */

.dashboard .segment .segment-count,
.access-page .segment .segment-count {
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    background: var(--status-neutral-bg);
    color: var(--neutral-foreground-hint);
}

.dashboard .segment.active .segment-count,
.access-page .segment.active .segment-count {
    background: rgba(255, 255, 255, 0.25);
    color: var(--foreground-on-accent-rest, #ffffff);
}

/* ============================================================
   Person / team drawers (rendered inside dialog panels, so these
   are global, not scoped to `.dashboard`).
   ============================================================ */

/* The app's dialogs render their own icon+title header before the dialog body;
   without padding it sits flush against the panel's top-left edge. */
.colectica-dialog-header {
    padding: 20px 24px 6px;
    color: var(--neutral-foreground-rest);
}

.drawer-section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--neutral-foreground-hint);
    margin: 4px 0 9px;
}

.drawer-hint {
    font-size: 11.5px;
    color: var(--neutral-foreground-hint);
    line-height: 1.45;
    margin-top: 6px;
}

/* ---- Access role radio rows (each row sets --role-color) ---- */

.access-radio {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border-radius: 9px;
    border: 1px solid var(--neutral-stroke-divider-rest);
    background: var(--neutral-layer-2);
    cursor: pointer;
    margin-bottom: 7px;
}

.access-radio:hover {
    border-color: var(--neutral-stroke-rest);
}

.access-radio.selected {
    border-color: var(--role-color);
    background: color-mix(in srgb, var(--role-color) 14%, transparent);
}

.access-radio-outer {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex: none;
    border: 1.5px solid var(--neutral-stroke-strong, var(--neutral-stroke-rest));
    display: flex;
    align-items: center;
    justify-content: center;
}

.access-radio.selected .access-radio-outer {
    border-color: var(--role-color);
}

.access-radio-inner {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--role-color);
}

.access-radio-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: none;
    background: var(--role-color);
}

.access-radio-label {
    flex: 1;
    min-width: 0;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--neutral-foreground-rest);
}

/* ---- Team-membership checkbox rows ---- */

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 9px 11px;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
}

.check-row:hover {
    background: var(--neutral-fill-stealth-hover);
}

.check-row.checked {
    background: color-mix(in srgb, var(--accent-fill-rest) 12%, transparent);
}

.check-box {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex: none;
    border: 1.5px solid var(--neutral-stroke-strong, var(--neutral-stroke-rest));
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.check-row.checked .check-box {
    border-color: var(--accent-fill-rest);
    background: var(--accent-fill-rest);
}

.check-row-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex: none;
}

.check-row-label {
    flex: 1;
    font-size: 13px;
    color: var(--neutral-foreground-rest);
}

.check-row-meta {
    font-size: 11.5px;
    color: var(--neutral-foreground-hint);
}

/* ---- Effective-access breakdown box (person drawer; sets --role-color) ---- */

.eff-box {
    border-radius: 11px;
    padding: 14px 15px;
    border: 1px solid var(--role-color, var(--neutral-stroke-rest));
    background: var(--neutral-layer-2);
}

.eff-box-top {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.eff-box-note {
    font-size: 12px;
    color: var(--neutral-foreground-hint);
}

.eff-box-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.eff-row {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12.5px;
}

.eff-row-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex: none;
}

.eff-row-src {
    flex: 1;
    color: var(--neutral-foreground-hint);
}

.eff-row-role {
    color: var(--neutral-foreground-hint);
}

.eff-row.driver .eff-row-src {
    color: var(--neutral-foreground-rest);
}

.eff-row.driver .eff-row-role {
    font-weight: 700;
}

/* ---- Team drawer member list ---- */

.member-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.member-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 9px;
    border-radius: 8px;
}

.member-row-team {
    background: var(--neutral-layer-2);
}

.member-row-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    flex: none;
    background: var(--neutral-layer-4);
}

.member-row-name {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--neutral-foreground-rest);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-row-kind {
    font-size: 11px;
    color: var(--neutral-foreground-hint);
    margin-left: 6px;
}

.member-list-empty {
    padding: 14px;
    font-size: 12.5px;
    color: var(--neutral-foreground-hint);
    text-align: center;
}

/* ---- Invite dialog: valid-email hint ---- */

.invite-hint {
    font-size: 12px;
    color: var(--neutral-foreground-hint);
    margin-top: 6px;
}

.invite-hint-valid {
    color: var(--status-success);
}

/* ============================================================
   Org overview — "Files by type" card
   A compact breakdown of file counts by extension, each row a
   type icon + label + count + a proportional bar. FluentCard
   supplies the fill, border, and radius (like .stat-tile).
   ============================================================ */

.dashboard .files-card {
    max-width: 480px;
    background: var(--neutral-layer-2);
    padding: 18px 20px 10px;
    margin-top: 26px;
}

.files-card-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 4px;
}

.dashboard .files-card .files-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--neutral-foreground-rest);
}

.dashboard .files-card .files-card-total {
    font-size: 12px;
    color: var(--neutral-foreground-hint);
}

.file-type-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-top: 1px solid var(--border-muted);
}

.file-type-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--neutral-bg);
    flex: none;
}

.file-type-meta {
    flex: 1;
    min-width: 0;
}

.file-type-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.file-type-label {
    font-size: 13px;
    color: var(--neutral-foreground-hint);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-type-ext {
    font-weight: 700;
    color: var(--neutral-foreground-rest);
}

.file-type-count {
    flex: none;
    font-size: 13px;
    font-weight: 700;
    color: var(--neutral-foreground-rest);
}

.file-type-bar {
    height: 6px;
    background: var(--border-subtle);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.file-type-bar-fill {
    height: 100%;
    border-radius: 3px;
}

.dashboard .files-card .files-empty {
    padding: 14px 0 12px;
    font-size: 13px;
    color: var(--neutral-foreground-hint);
    border-top: 1px solid var(--border-muted);
}

/* Files by type and Recent activity sit side by side when there is room, one column otherwise. */
.dashboard .dashboard-cards {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 20px;
    margin-top: 26px;
}

.dashboard .dashboard-cards .files-card {
    flex: 1 1 380px;
    margin-top: 0;
}

.activity-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--border-muted);
}

.activity-meta {
    flex: 1;
    min-width: 0;
}

.activity-text {
    font-size: 13px;
    color: var(--neutral-foreground-rest);
    overflow-wrap: anywhere;
}

.activity-record {
    font-weight: 600;
    color: var(--neutral-foreground-rest);
    text-decoration: none;
}

.activity-record:hover {
    text-decoration: underline;
}

.activity-when {
    margin-top: 2px;
    font-size: 12px;
    color: var(--neutral-foreground-hint);
}

/* ============================================================
   Home page
   Organization cards (a tone-colored logo tile, a
   permission-derived role badge whose tooltip lists what the
   user may do, the slug, counts, and health links), pending
   invitations, and a side rail holding the user's own work.
   ============================================================ */

.home-layout {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 28px;
}
.home-main {
    flex: 999 1 560px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.home-rail {
    flex: 1 1 380px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.home-notice {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12.5px;
    color: var(--text-muted);
}

/* Pending invitations: also shown on /org-setup, so not scoped to the dashboard shell. */
.home-invites {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-bottom: 18px;
}
.home-invite {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 12px 16px;
    background: var(--surface-card);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    text-align: left;
}
.home-invite-icon {
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--info-bg);
    color: var(--brand-accent-soft);
}
.home-invite-text {
    flex: 1 1 260px;
    min-width: 0;
    font-size: 13.5px;
    color: var(--text-primary);
}
.home-invite-hint {
    margin-top: 1px;
    font-size: 12px;
    color: var(--text-muted);
}

.org-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 760px;
    width: 100%;
}
.home-layout-rail .org-list {
    max-width: none;
}
/* The card is not itself a link: the organization name is, stretched over the card by its
   ::after, so the role badge and health links can sit above it as their own focus targets. */
.org-card {
    position: relative;
    display: flex;
    gap: 16px;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: 13px;
    padding: 19px 20px;
    color: inherit;
    transition: border-color 120ms var(--ease-out, ease);
}
.org-card:hover {
    border-color: var(--brand-accent);
}
.org-card:has(.org-card-link:focus-visible) {
    outline: 2px solid var(--brand-accent);
    outline-offset: 2px;
}
.org-logo {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    font-weight: 700;
}
.org-logo.org-tone-0 { background: var(--info-bg);    color: var(--brand-accent); }
.org-logo.org-tone-1 { background: var(--success-bg); color: var(--success); }
.org-logo.org-tone-2 { background: var(--warning-bg); color: var(--warning); }
.org-logo.org-tone-3 { background: var(--neutral-bg); color: var(--text-muted); }

.org-card-body {
    flex: 1;
    min-width: 0;
}
.org-card-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.org-card-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
}
.org-card-link {
    text-decoration: none;
}
.org-card-link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 13px;
}
.org-card-link:focus-visible {
    outline: none;
}

/* Role badge and its tooltip. The tooltip is plain CSS (hover or focus on the badge) rather
   than a FluentTooltip; Escape hides it through the org-role-tip-dismissed class. */
.org-role-wrap {
    position: relative;
    z-index: 1;
    display: inline-flex;
}
.org-role-wrap:hover,
.org-role-wrap:focus-within {
    z-index: 5;
}
.org-role {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 700;
    white-space: nowrap;
    cursor: default;
}
.org-role:focus-visible {
    outline: 2px solid var(--brand-accent);
    outline-offset: 2px;
}
.org-role .org-role-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex: none;
    background: currentColor;
}
.org-role-admin   { background: var(--accent-bg);  color: var(--brand-accent-soft); }
.org-role-mgr     { background: var(--info-bg);    color: var(--sem-info); }
.org-role-contrib { background: var(--success-bg); color: var(--success); }
.org-role-viewer  { background: var(--neutral-bg); color: var(--text-tertiary); }

.org-role-tip {
    position: absolute;
    top: calc(100% + 7px);
    left: 0;
    width: 208px;
    box-sizing: border-box;
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    background: var(--surface-app);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    box-shadow: var(--shadow-toast);
    visibility: hidden;
    opacity: 0;
    transition: opacity 120ms var(--ease-out, ease);
}
.org-role-wrap:hover .org-role-tip,
.org-role:focus + .org-role-tip {
    visibility: visible;
    opacity: 1;
}
.org-role-wrap.org-role-tip-dismissed .org-role-tip {
    visibility: hidden;
    opacity: 0;
}
.org-role-tip-lead {
    font-size: 12px;
    color: var(--text-muted);
}
.org-role-tip ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12.5px;
    color: var(--text-secondary);
}
.org-role-tip li {
    display: flex;
    align-items: center;
    gap: 7px;
}

.org-card-slug {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-top: 3px;
}
.org-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    margin-top: 11px;
    font-size: 12.5px;
    color: var(--text-muted);
}
.org-facts strong {
    font-weight: 600;
    color: var(--text-secondary);
}
.org-alerts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-top: 9px;
}
.org-alert {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
}
.org-alert:hover {
    text-decoration: underline;
}
.org-alert-warning { color: var(--warning); }
.org-alert-danger  { color: var(--danger); }

/* Small neutral pills; the workflow settings page uses them for field lists. */
.org-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 13px;
}
.org-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--neutral-bg);
    white-space: nowrap;
}
.org-card-open {
    align-self: center;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-inset);
    color: var(--text-tertiary);
    transition: background 120ms var(--ease-out, ease), color 120ms var(--ease-out, ease);
}
.org-card:hover .org-card-open {
    background: var(--accent-bg);
    color: var(--brand-accent-soft);
}

/* Side rail sections: "Waiting on you" and "Recent records". */
.home-section {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
}
.home-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 10px;
}
.home-section-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}
.home-section-count {
    font-size: 12px;
    color: var(--text-muted);
}
.home-row {
    display: flex;
    gap: 12px;
    padding: 11px 16px 12px;
    border-top: 1px solid var(--border-muted);
}
.home-row-compact {
    align-items: center;
    padding: 9px 16px;
}
.home-row-icon {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--neutral-bg);
    color: var(--text-tertiary);
}
.home-row-body {
    flex: 1;
    min-width: 0;
}
.home-row-kicker {
    font-size: 12px;
    color: var(--text-muted);
}
.home-row-title {
    display: inline-block;
    margin-top: 1px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}
.home-row-title:hover {
    text-decoration: underline;
}
.home-row-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 9px;
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-muted);
}
.home-row-blocking {
    font-weight: 600;
    color: var(--danger);
}
.home-section-more {
    padding: 9px 16px 11px;
    border-top: 1px solid var(--border-muted);
    font-size: 12px;
    color: var(--text-muted);
}

/* ---------- Organization setup wizard (/org-setup) ---------- */

.org-wizard-card {
    text-align: left;
}

.wizard-steps {
    display: flex;
    align-items: flex-start;
    width: 100%;
    padding: 8px 8px 4px;
    margin-bottom: 14px;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: none;
    min-width: 86px;
}

.wizard-step-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border: 2px solid var(--border-strong);
    background: var(--surface-canvas);
    color: var(--text-muted);
}

.wizard-step-circle.done {
    background: var(--status-success-bg);
    border-color: var(--status-success);
    color: var(--status-success);
}

.wizard-step-circle.current {
    border-color: var(--brand-accent);
    color: var(--brand-accent);
    box-shadow: 0 0 0 3px var(--accent-bg);
}

.wizard-step-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
}

.wizard-connector {
    flex: 1;
    height: 2px;
    background: var(--border-strong);
    margin-top: 13px;
    min-width: 18px;
}

.wizard-connector.done {
    background: var(--status-success);
}

/* Equal height across steps (sized to the tallest, the Teams step) so the card
   does not grow and shrink between steps and the buttons stay put. */
.wizard-step-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    padding-top: 6px;
    min-height: 390px;
}

/* FluentUI gives checkbox fields a default block margin that strands the
   .wizard-hint below them; pull them back together. */
.wizard-step-body fluent-field:has(fluent-checkbox),
.wizard-step-body fluent-checkbox {
    margin-block: 0;
}

.wizard-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.wizard-field-error {
    font-size: 12px;
    color: var(--status-danger);
    margin-top: 4px;
}

.wizard-slug-input::part(control) {
    font-family: var(--font-monospace, monospace);
}

.wizard-choice-cards {
    display: flex;
    gap: 12px;
    width: 100%;
}

.wizard-choice-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--surface-card);
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: var(--text-primary);
}

.wizard-choice-card:hover {
    border-color: var(--border-strong);
}

.wizard-choice-card.active {
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 1px var(--brand-accent);
}

.wizard-choice-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.wizard-choice-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.wizard-flow {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 4px;
}

.wizard-flow-chip {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--surface-canvas);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    white-space: nowrap;
}

.wizard-flow-arrow {
    font-size: 11px;
    color: var(--text-muted);
}

.wizard-caption {
    font-size: 12px;
    color: var(--text-muted);
}

.wizard-setting-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}

.wizard-setting-card {
    flex: 1;
    min-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--surface-card);
}

.wizard-setting-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.wizard-summary {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    background: var(--surface-canvas);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
}

.wizard-summary-row {
    display: flex;
    gap: 8px;
    font-size: 12.5px;
}

.wizard-summary-label {
    color: var(--text-muted);
    min-width: 110px;
}

.wizard-summary-value {
    color: var(--text-primary);
    font-weight: 500;
}

.wizard-summary-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.wizard-teams-layout {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
}

.wizard-teams-rail {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 220px;
    flex: none;
}

.wizard-teams-rail-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: none;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
}

.wizard-teams-rail-item:hover {
    background: var(--surface-canvas);
}

.wizard-teams-rail-item.active {
    background: var(--accent-bg);
    color: var(--brand-accent);
    font-weight: 600;
}

.wizard-teams-rail-count {
    font-size: 10.5px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
    padding: 1px 5px;
    border-radius: 999px;
    background: var(--surface-canvas);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.wizard-teams-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--surface-card);
}

.wizard-teams-content-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.wizard-teams-caption {
    font-size: 12px;
    color: var(--text-muted);
}

.wizard-team-selectall {
    border: none;
    background: none;
    padding: 0;
    font-size: 11.5px;
    color: var(--brand-accent);
    cursor: pointer;
    white-space: nowrap;
}

.wizard-team-selectall:hover {
    text-decoration: underline;
}

.wizard-team-sub {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-left: 24px;
}

.wizard-team-role {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: var(--surface-canvas);
    color: var(--text-secondary);
    white-space: nowrap;
}

.wizard-buttons {
    display: flex;
    align-items: center;
    width: 100%;
    margin-top: 10px;
}

.wizard-buttons-right {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

/* The wizard needs more room than the default splash column so the Standard
   template's four status chips stay on one line and the Teams step's three
   columns fit their descriptions without wrapping tall. */
.splash-wrapper-inner:has(.org-wizard-card) {
    max-width: 960px;
}

/* ============================================================
   Organization-wide search: the Catalog tab's scope control and
   the Files and Variables scope pages. The segments are links
   (each scope is its own page), the file groups are plain cards,
   and the valid meter is a thin track. Tokens only, no hex.
   ============================================================ */

/* Segments rendered as <a> keep the button look: no underline, inherited color. */
.search-scopes .segment {
    text-decoration: none;
    gap: 7px;
}

.search-scopes .segment:hover {
    text-decoration: none;
}

.search-scopes .segment-count {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--neutral-foreground-rest) 10%, transparent);
    color: inherit;
    font-variant-numeric: tabular-nums;
}

.search-scopes .segment.active .segment-count {
    background: color-mix(in srgb, var(--foreground-on-accent-rest, #ffffff) 22%, transparent);
}

.dashboard-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* The cell that names a hit's record and the entity that owns it. */
.record-context {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.record-context-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--accent-foreground-rest, var(--accent-fill-rest));
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.record-context-title:hover {
    text-decoration: underline;
}

.record-context-path {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--neutral-foreground-hint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Cross-scope hint in an empty state: "No records match, but 6 files do." */
.scope-hint {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 11px 14px;
    border-radius: 8px;
    background: var(--status-info-bg);
    border: 1px solid color-mix(in srgb, var(--status-info) 30%, transparent);
    color: var(--neutral-foreground-rest);
    font-size: 13px;
    text-align: left;
}

.scope-hint a {
    font-weight: 600;
    color: var(--accent-foreground-rest, var(--accent-fill-rest));
}

/* Files grouped by record: one card per record. */
.file-groups {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
}

.file-group {
    background: var(--neutral-layer-2);
    border: 1px solid var(--neutral-stroke-divider-rest);
    border-radius: 10px;
    overflow: hidden;
}

.file-group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--neutral-layer-3, var(--neutral-layer-1));
    border-bottom: 1px solid var(--neutral-stroke-divider-rest);
}

.file-group-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    flex: none;
}

.file-group-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--neutral-foreground-rest);
    text-decoration: none;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-group-title:hover {
    text-decoration: underline;
}

.file-group-meta {
    font-size: 12px;
    color: var(--neutral-foreground-hint);
    white-space: nowrap;
}

.file-group-open {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    color: var(--accent-foreground-rest, var(--accent-fill-rest));
    text-decoration: none;
}

.file-group-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(140px, 220px) 110px 130px 32px;
    gap: 12px;
    align-items: center;
    padding: 12px 14px 12px 22px;
    border-bottom: 1px solid var(--neutral-stroke-divider-rest);
    cursor: pointer;
    color: inherit;
    text-decoration: none;
}

.file-group-row:last-child {
    border-bottom: none;
}

.file-group-row:hover {
    background: color-mix(in srgb, var(--neutral-foreground-rest) 3%, transparent);
}

.file-group-more {
    display: block;
    padding: 9px 14px 10px 22px;
    border-top: 1px solid var(--neutral-stroke-divider-rest);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--accent-foreground-rest, var(--accent-fill-rest));
    text-decoration: none;
}

.file-group-more:hover {
    text-decoration: underline;
}

.file-cell {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.file-cell-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    flex: none;
}

.file-cell-name {
    font-weight: 600;
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-cell-meta {
    font-size: 12px;
    color: var(--neutral-foreground-hint);
    white-space: nowrap;
}

/* The line under a file name that says where the file lives: its record, then the nested
   entity when there is one. Both parts shrink and ellipsize, the record last. */
.file-cell-context {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    margin-top: 1px;
}

.file-cell-context .record-context-title {
    flex: 0 1 auto;
    min-width: 0;
    font-size: 12px;
    font-weight: 500;
}

.file-cell-context .record-context-path {
    flex: 0 2 auto;
    min-width: 0;
}

.record-context-path-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Variables scope: the rows of the record Variables view (variables-view.css supplies the
   .vv-* row, type, distribution, and meter styles) inside a dashboard card, with a last
   column naming each variable's record and data frame. The view's column template and
   paddings are redeclared here because they are scoped to its own .vv-view root. */
.org-variables {
    --vv-cols: minmax(140px, 1.25fr) 116px 172px 168px 128px minmax(120px, 1fr) 16px;
    --vv-row-gap: 16px;
    --vv-pad-left: 19px;
}

/* The page scrolls, not the list, so the header stays in flow with its card. */
.org-variables .vv-list-header {
    position: static;
    padding-right: 16px;
}

.org-variables .vv-row {
    padding-right: 16px;
}

.org-variables .vv-row-wrap:last-child {
    border-bottom: none;
}

/* The name is a real link to the variable, so it can be opened in a new tab; it keeps the
   Variables view's plain name styling until hovered. */
.org-variables a.vv-var-name {
    color: var(--neutral-foreground-rest);
    text-decoration: none;
}

.org-variables a.vv-var-name:hover {
    text-decoration: underline;
}

.org-variables .vv-stack-legend {
    max-width: 150px;
}

.measure-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: none;
}

.filter-pill .measure-dot {
    margin-right: 7px;
}

.filter-pill .pill-count {
    margin-left: 7px;
    color: var(--neutral-foreground-hint);
    font-variant-numeric: tabular-nums;
}

/* Hand-off from a record's Files view to the organization-wide Files search. */
.files-handoff {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--neutral-foreground-hint);
}

.files-handoff a {
    font-weight: 600;
    color: var(--accent-foreground-rest, var(--accent-fill-rest));
}

/* ============================================================
   Record settings: Access page (Pages/CatalogRecordSettingsAccess.razor),
   its grant dialog, and its details drawer. The page sits in the settings
   shell rather than .dashboard, so its list styling is declared here.
   ============================================================ */

/* Role badge with neutral text and a role-coloured dot. As text on the tinted
   fill, the Reader, Proposer, and Writer colours fall below 4.5:1. */
.access-badge-contrast {
    color: var(--text-secondary);
}

.access-badge-contrast.access-badge-reader .access-dot {
    background: var(--role-reader);
}

.access-badge-contrast.access-badge-proposer .access-dot {
    background: var(--role-proposer);
}

.access-badge-contrast.access-badge-writer .access-dot {
    background: var(--role-writer);
}

.access-badge-contrast.access-badge-maintainer .access-dot {
    background: var(--role-maintainer);
}

.access-badge-contrast.access-badge-admin .access-dot {
    background: var(--role-admin);
}

/* ---- Organization base card ---- */

.fluent-card.access-base-card {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.access-base-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    flex: none;
    background: var(--neutral-bg);
}

.access-base-text {
    flex: 1 1 300px;
    min-width: 0;
}

.access-base-title {
    font-size: var(--fs-card-title);
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
}

.access-base-desc {
    font-size: var(--fs-secondary);
    color: var(--text-tertiary);
}

/* ---- List card: full bleed, and not clipped, so the role and filter menus can
   extend past its edge. ---- */

.fluent-card.access-list-card {
    padding: 0;
    overflow: visible;
}

.access-list-head {
    padding: 12px 16px 0;
}

.access-toolbar {
    margin-top: 0;
    padding: 12px 16px;
    gap: 10px;
}

.access-toolbar .access-search {
    width: 250px;
}

/* The access-level filter sits at the right end of the toolbar, so its menu
   opens leftwards from the trigger's right edge. */
.access-filter .sort-menu {
    left: auto;
    right: 0;
    min-width: 220px;
}

.access-filter .check-row {
    font-family: inherit;
}

/* ---- Access table ---- */

@media (max-width: 1000px) {
    .access-table-scroll {
        overflow-x: auto;
    }
}

.access-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    table-layout: fixed;
}

.access-col-role {
    width: 170px;
}

.access-col-members {
    width: 100px;
}

.access-col-actions {
    width: 110px;
}

.access-table th,
.access-table td {
    padding: 6px 7px;
    border-top: 1px solid var(--border-subtle);
    text-align: left;
    vertical-align: middle;
}

.access-table th:first-child,
.access-table td:first-child {
    padding-left: 18px;
}

.access-table th:last-child,
.access-table td:last-child {
    padding-right: 18px;
}

.access-table thead th {
    padding-top: 8px;
    padding-bottom: 8px;
    background: var(--surface-rail);
    font-size: var(--fs-label);
    font-weight: var(--fw-bold);
    letter-spacing: var(--label-spacing-wide);
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--text-muted);
}

.access-table tbody tr:not(.access-group-row):hover td {
    background: var(--neutral-bg);
}

.access-sort {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: none;
    background: transparent;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    color: inherit;
    cursor: pointer;
}

.access-sort:hover {
    color: var(--text-primary);
}

.access-table .access-group-row th {
    padding: 0;
    background: var(--surface-canvas);
}

.access-group-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 18px 7px 12px;
    border: none;
    background: transparent;
    font-family: inherit;
    text-align: left;
    color: var(--text-primary);
    cursor: pointer;
}

.access-group-label {
    font-size: var(--fs-secondary);
    font-weight: var(--fw-semibold);
}

.access-group-count {
    padding: 0 7px;
    border-radius: 999px;
    background: var(--neutral-bg);
    font-size: var(--fs-micro);
    font-weight: var(--fw-semibold);
    color: var(--text-secondary);
}

.access-group-hint {
    font-size: var(--fs-small);
    font-weight: var(--fw-regular);
    color: var(--text-muted);
}

.access-name {
    min-width: 0;
    font-size: var(--fs-secondary);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.access-name-team {
    display: block;
    font-weight: var(--fw-semibold);
}

.access-slug {
    display: block;
    font-family: var(--font-mono);
    font-size: var(--fs-micro);
    color: var(--text-muted);
}

.access-members {
    font-size: var(--fs-secondary);
    color: var(--text-tertiary);
}

/* ---- Editable role badge and its menu ---- */

.access-role {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
}

.access-badge-button {
    padding: 2px 7px 2px 9px;
    border: 1px solid var(--border-strong);
    font-family: inherit;
    cursor: pointer;
}

.access-badge-button:hover:not(:disabled) {
    border-color: var(--text-muted);
}

.access-badge-button:focus-visible {
    outline: 2px solid var(--brand-accent);
    outline-offset: 2px;
}

.access-badge-button:disabled {
    opacity: 0.6;
    cursor: default;
}

.access-role .sort-menu {
    left: 0;
    right: auto;
    width: 300px;
}

.access-menu-title {
    padding: 6px 8px 4px;
    font-size: var(--fs-label);
    font-weight: var(--fw-bold);
    letter-spacing: var(--label-spacing-wide);
    text-transform: uppercase;
    color: var(--text-muted);
}

.access-role-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    padding: 6px 8px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    font-family: inherit;
    font-weight: 400;
    text-align: left;
    color: var(--text-primary);
    cursor: pointer;
}

.access-role-option:hover {
    background: var(--neutral-fill-stealth-hover);
}

.access-role-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 18px;
    flex: none;
}

.access-role-dot {
    width: 7px;
    height: 7px;
    margin-top: 6px;
    border-radius: 50%;
    flex: none;
}

.access-role-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.access-role-label {
    font-size: var(--fs-secondary);
    font-weight: var(--fw-semibold);
}

/* The weights are stated outright so the description never picks up a bold weight
   from the button or cell around it. */
.access-role-menu .access-role-desc {
    font-size: 11.5px;
    font-weight: 400;
    color: var(--text-muted);
}

.access-menu-divider {
    height: 1px;
    margin: 4px 0;
    background: var(--border-subtle);
}

.access-role-remove {
    align-items: center;
    font-size: var(--fs-secondary);
    color: var(--status-danger);
}

/* ---- Source cell ---- */

.access-source {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: var(--fs-secondary);
}

.access-direct-chip {
    padding: 2px 8px;
    border-radius: var(--radius-md);
    background: var(--status-info-bg);
    font-size: 11.5px;
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
}

.access-source .team-chip-label {
    font-size: 11.5px;
    color: var(--text-primary);
    white-space: nowrap;
}

.access-source-more {
    font-size: 11.5px;
    color: var(--text-muted);
}

.access-source-note {
    color: var(--text-tertiary);
}

.access-pagination {
    margin-top: 0;
    padding: 10px 16px;
    border-top: 1px solid var(--border-subtle);
}

/* ---- Role description under an access radio label (grant dialog, details drawer) ---- */

.access-radio .access-radio-desc {
    display: block;
    margin-top: 1px;
    font-size: 11.5px;
    font-weight: 400;
    color: var(--neutral-foreground-hint);
}

/* ---- Grant access dialog ---- */

.grant-access {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.grant-access-pick {
    flex: 1 1 380px;
    min-width: 0;
}

.grant-access-role {
    flex: 1 1 250px;
    min-width: 0;
}

.grant-access-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    min-height: 36px;
    padding: 4px 6px;
    background: var(--surface-input);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
}

.grant-access-search:focus-within {
    border-color: var(--brand-accent);
}

.grant-access-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    height: 24px;
    padding: 0 2px 0 8px;
    border-radius: var(--radius-md);
    background: var(--status-info-bg);
    font-size: var(--fs-small);
    color: var(--text-primary);
}

.grant-access-chip button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    border-radius: var(--radius-xs);
    background: transparent;
    cursor: pointer;
}

.grant-access-chip button:hover {
    background: var(--neutral-fill-stealth-hover);
}

.grant-access-input {
    flex: 1 1 140px;
    min-width: 100px;
    height: 24px;
    padding: 0 4px;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: var(--fs-secondary);
    color: var(--text-primary);
}

.grant-access-results {
    height: 264px;
    margin-top: 8px;
    padding: 3px;
    overflow-y: auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
}

.grant-access-results .check-row {
    font-family: inherit;
}

.grant-access-results .check-row:disabled {
    opacity: 0.55;
    cursor: default;
}

.grant-access-results .check-row:disabled:hover {
    background: transparent;
}

.grant-access-sub {
    display: block;
    font-size: var(--fs-micro);
    color: var(--neutral-foreground-hint);
}

.grant-access-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: var(--status-info-bg);
    font-size: var(--fs-secondary);
    color: var(--text-secondary);
}

/* ---- Role-based visibility: the no-access state and the read-only record notice ---- */

.no-access {
    max-width: 720px;
}

.no-access .no-access-state {
    border-top: none;
}

.no-access .no-access-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.no-access .no-access-link {
    font-size: 13.5px;
    color: var(--accent-fill-rest);
    text-decoration: none;
}

.no-access .no-access-link:hover {
    text-decoration: underline;
}

/* A file's Preview view when no preview can be shown reuses the no-access card. */
.preview-unavailable .preview-unavailable-file {
    max-width: 100%;
    overflow-wrap: anywhere;
    font-family: var(--monospace-font-family, monospace);
    font-size: 12.5px;
    color: var(--neutral-foreground-rest);
}

.preview-unavailable .empty-state-text {
    max-width: 440px;
}

.preview-unavailable .preview-unavailable-action {
    margin-top: 6px;
}

.record-read-only-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 12px 8px 16px;
    padding: 9px 13px;
    border-radius: 8px;
    background: var(--neutral-layer-2);
    border: 1px solid var(--neutral-stroke-divider-rest);
    font-size: 13.5px;
    color: var(--neutral-foreground-rest);
}

.record-read-only-notice span {
    flex: 1;
}

.record-read-only-notice a {
    color: var(--accent-fill-rest);
    text-decoration: none;
}

/* The Metadata tab of a file version that is not the current one. */
.file-version-metadata-notice {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    max-width: 760px;
    margin: 16px;
    padding: 20px;
    border-radius: 10px;
    background: var(--neutral-layer-1);
    border: 1px solid var(--neutral-stroke-divider-rest);
}

.file-version-metadata-notice h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.file-version-metadata-notice p {
    margin: 0;
    line-height: 1.5;
    color: var(--neutral-foreground-hint);
}

/* ---- File tab: one version's facts beside the file's versions ---- */

.file-version-page {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 24px;
    padding: 16px;
    overflow: auto;
}

.file-version-main {
    flex: 999 1 520px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.file-version-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px;
}

.file-version-head-text {
    flex: 1 1 340px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-version-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.file-version-subtitle {
    margin: 0;
    line-height: 1.5;
    color: var(--neutral-foreground-hint);
}

/* A version's standing: current, read only, or where its processing stands. */
.file-version-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--neutral-layer-3);
    color: var(--neutral-foreground-rest);
}

.file-version-badge.current {
    background: var(--success-bg);
    color: var(--status-success);
}

.file-version-badge.attention {
    background: var(--warning-bg);
    color: var(--status-warning);
}

.file-version-facts {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 9px 16px;
    margin: 0;
    font-size: 13.5px;
}

.file-version-facts dt {
    color: var(--neutral-foreground-hint);
}

.file-version-facts dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

.file-version-muted {
    color: var(--neutral-foreground-hint);
}

.file-version-mono {
    font-family: var(--monospace-font-family, ui-monospace, monospace);
    font-size: 12.5px;
    overflow-wrap: anywhere;
}

.file-version-note {
    margin: 12px 0 0;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--neutral-foreground-hint);
}

/* Checksums and identifiers: a label, a value to copy, and its copy button. */
.file-version-copy-rows {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13.5px;
}

.file-version-copy-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 32px;
    column-gap: 16px;
    align-items: center;
}

.file-version-copy-row > span:first-child {
    color: var(--neutral-foreground-hint);
}

.file-version-copy {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--neutral-foreground-hint);
    cursor: pointer;
}

.file-version-copy:hover {
    background: var(--neutral-fill-stealth-hover);
    color: var(--neutral-foreground-rest);
}

.file-version-list-card {
    flex: 1 1 300px;
    max-width: 400px;
}

.file-version-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-version-item {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--neutral-stroke-divider-rest);
    border-radius: 8px;
}

.file-version-item.selected {
    border-color: var(--accent-fill-rest);
    background: var(--accent-bg);
}

.file-version-item.pending {
    border-style: dashed;
}

.file-version-item-link {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    color: var(--neutral-foreground-rest);
    text-decoration: none;
    font-size: 12.5px;
}

.file-version-item-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
}

.file-version-item-head strong {
    font-weight: 600;
}

.file-version-item-head .file-version-muted {
    margin-left: auto;
    font-size: 12.5px;
}

.file-version-item-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 0 12px 10px;
    font-size: 12.5px;
}

/* The version picker beside the breadcrumb. */
.file-version-picker {
    position: relative;
    flex: none;
}

.file-version-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 9px;
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 999px;
    background: var(--neutral-layer-1);
    color: var(--neutral-foreground-rest);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.file-version-chip.other {
    border-color: var(--accent-fill-rest);
    background: var(--accent-bg);
}

.file-version-picker .record-menu {
    left: 0;
    right: auto;
    width: 320px;
    max-width: calc(100vw - 32px);
}

.file-version-picker .record-menu-item {
    text-decoration: none;
}

.file-version-picker .record-menu-item.selected {
    background: var(--neutral-fill-stealth-hover);
}

/* The Upload new version dialog. */
.upload-version {
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-size: 13.5px;
}

.upload-version-file {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 8px;
}

.upload-version-file-text {
    flex: 1 1 200px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-wrap: anywhere;
}

.upload-version-line {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    line-height: 1.45;
}

.upload-version-line > svg,
.upload-version-warning > svg {
    flex: none;
    margin-top: 2px;
}

.upload-version-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--status-warning);
    border-radius: 8px;
    background: var(--warning-bg);
    line-height: 1.45;
}

.upload-version-choice {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: none;
}

.upload-version-choice legend {
    margin-bottom: 8px;
    padding: 0;
    font-weight: 600;
}

.upload-version-choice label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--neutral-stroke-divider-rest);
    border-radius: 8px;
    cursor: pointer;
}

.upload-version-choice label.selected {
    border-color: var(--accent-fill-rest);
    background: var(--accent-bg);
}

.upload-version-choice label input {
    flex: none;
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: var(--accent-fill-rest);
}

.upload-version-choice label > span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.upload-version-import {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.upload-version-import summary {
    cursor: pointer;
    color: var(--accent-fill-rest);
}

.upload-version-options {
    margin: 8px 0 0;
    padding: 0;
    border: none;
}

/* ---- Deletion status (the deletion status page and a record that is being deleted) ---- */

.dashboard.deletion-page {
    max-width: 960px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.deletion-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
}

.deletion-banner.tone-info {
    background: var(--status-info-bg);
}

.deletion-banner.tone-warning {
    background: var(--status-warning-bg);
    border-color: var(--status-warning-border);
}

.deletion-banner.tone-success {
    background: var(--status-success-bg);
}

.deletion-banner.tone-neutral {
    background: var(--status-neutral-bg);
}

.deletion-banner-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex: none;
}

.deletion-banner-body {
    min-width: 0;
}

.deletion-banner-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    color: var(--neutral-foreground-rest);
}

.deletion-banner.tone-info .deletion-banner-title {
    color: var(--status-info);
}

.deletion-banner.tone-warning .deletion-banner-title {
    color: var(--status-warning);
}

.deletion-banner.tone-success .deletion-banner-title {
    color: var(--status-success);
}

.deletion-banner-text {
    display: flex;
    flex-wrap: wrap;
    gap: 0 4px;
    margin-top: 3px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--neutral-foreground-rest);
    overflow-wrap: anywhere;
}

.deletion-banner-text a {
    color: var(--accent-fill-rest);
    text-decoration: none;
}

.deletion-banner-text a:hover {
    text-decoration: underline;
}

.fluent-card.deletion-card {
    padding: 18px 20px;
}

.deletion-meter {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--neutral-stroke-divider-rest);
}

.deletion-meter-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 12.5px;
    color: var(--neutral-foreground-hint);
}

.deletion-meter-count {
    font-weight: 600;
    color: var(--neutral-foreground-rest);
    font-variant-numeric: tabular-nums;
}

.deletion-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.deletion-details > .fluent-card {
    box-sizing: border-box;
    height: 100%;
}

.deletion-card-title {
    margin-bottom: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--neutral-foreground-hint);
}

.deletion-facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 9px 24px;
    margin: 0;
    font-size: 13px;
}

.deletion-facts dt {
    color: var(--neutral-foreground-hint);
}

.deletion-facts dd {
    margin: 0;
    color: var(--neutral-foreground-rest);
    font-variant-numeric: tabular-nums;
}

.deletion-page .deletion-empty {
    border-top: none;
}

.deletion-loading {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* The notice the record list shows after a catalog record's deletion is accepted. */
.dashboard .records-deletion-notice {
    margin-bottom: 18px;
}
