/* ============================================================
   Atlas shell v2 design tokens (ATLAS work item #112).
   Light tokens are the default on :root. Dark tokens apply when the
   OS prefers dark (unless data-theme="light" forces light) or when
   data-theme="dark" explicitly forces dark. The data-theme hooks are
   dormant until a later work item wires an explicit toggle alongside
   MudThemeProvider.IsDarkMode.
   ============================================================ */
@font-face {
    font-display: swap;
    font-family: 'Atlas Sans';
    font-style: normal;
    font-weight: 100 900;
    src: url('fonts/Inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                   U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                   U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Workflow composer: keep phase cards draggable on pointer and touch devices while
   retaining explicit arrow controls as the keyboard/touch fallback. */
.workflow-phase-pipeline .mud-drop-item {
    touch-action: none;
}

.workflow-phase-zone {
    min-height: 3rem;
}

.workflow-phase-zone--dragging {
    outline: 2px dashed var(--mud-palette-primary);
    outline-offset: 0.25rem;
}

.workflow-phase-card--dragging {
    opacity: 0.72;
}

/* Duplicate/delete stay reachable by keyboard (focus-within) and on touch
   (hover: none), but only surface on pointer hover to keep cards calm (#1295). */
.workflow-phase-card__secondary-actions {
    display: inline-flex;
    opacity: 0;
    transition: opacity 120ms ease;
}

.workflow-phase-card:hover .workflow-phase-card__secondary-actions,
.workflow-phase-card:focus-within .workflow-phase-card__secondary-actions {
    opacity: 1;
}

@media (hover: none) {
    .workflow-phase-card__secondary-actions {
        opacity: 1;
    }
}

/* Edit mode owns the full content area (#1292): readable form column plus a
   sticky preview rail from lg upward, and an always-reachable action bar. */
.workflow-editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.workflow-editor-form {
    min-width: 0;
    max-width: 70rem;
}

.workflow-composer-preview {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

.workflow-editor-actionbar {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.75rem 0;
    background: var(--mud-palette-surface);
    border-top: 1px solid var(--mud-palette-lines-default);
}

@media (min-width: 1280px) {
    .workflow-editor-layout--with-preview {
        grid-template-columns: minmax(0, 1fr) minmax(21rem, 26rem);
    }
}

.workflow-agent-summary__rendered summary {
    cursor: pointer;
    font-weight: 600;
}

.workflow-agent-summary__rendered pre {
    margin: 0.75rem 0 0;
    max-height: 22rem;
    overflow: auto;
    padding: 0.75rem;
    border-radius: var(--mud-default-borderradius);
    background: var(--mud-palette-background-gray);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

@media (max-width: 600px) {
    .workflow-phase-card .mud-icon-button {
        min-width: 2.75rem;
        min-height: 2.75rem;
    }
}

@media (max-width: 1279px) {
    .workflow-composer-preview {
        position: static;
        max-height: none;
        overflow-y: visible;
    }
}

@font-face {
    font-display: swap;
    font-family: 'Atlas Mono';
    font-style: normal;
    font-weight: 400 600;
    src: url('fonts/JetBrainsMono-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                   U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                   U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    color-scheme: light;

    --atlas-font-sans: 'Atlas Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --atlas-font-mono: 'Atlas Mono', ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

    --atlas-bg: #f3f6f8;
    --atlas-sidebar: #fbfcfd;
    --atlas-surface: #ffffff;
    --atlas-surface-muted: #f7fafb;
    --atlas-border: #d8e0e6;
    --atlas-row-bg: #ffffff;
    --atlas-row-alt-bg: #f6f9fa;
    --atlas-row-hover-bg: #e4eff3;
    --atlas-row-selected-bg: #cbe6ee;
    --atlas-row-focus-bg: #e4eff3;
    --atlas-text: #1f2933;
    --atlas-muted: #66727f;
    --atlas-accent: #0787a0;
    --atlas-accent-soft: #dceff3;
    --atlas-accent-contrast: #ffffff;
    --atlas-success: #23946b;
    --atlas-warning: #c98a16;
    --atlas-danger: #d85b57;
    --atlas-info: #2477b3;

    --atlas-radius-sm: 6px;
    --atlas-radius-md: 8px;
    --atlas-radius-lg: 10px;
    --atlas-radius-pill: 999px;

    --atlas-shadow-sm: 0 1px 2px rgba(15, 23, 32, 0.08);
    --atlas-shadow-md: 0 2px 6px rgba(15, 23, 32, 0.10);

    --atlas-focus-ring: 0 0 0 2px var(--atlas-accent-soft), 0 0 0 1px var(--atlas-accent);

    /* Density and touch targets (#1592). One named scale replaces the page-local
       magic sizes previously measured across ATLAS (40px header searches, 56px filter
       selects, 26x26 icon actions, 32x32 master-list checkboxes, 48x48 grid pagination).
       The visible icon glyph stays compact; only the interactive hit area grows to
       --atlas-touch-target, which coarse pointers widen to the 44px WCAG 2.5.5 minimum. */
    --atlas-control-height-header: 2.5rem;
    --atlas-control-height-filter: 2.5rem;
    --atlas-control-height-compact: 2rem;
    --atlas-touch-target: 2.25rem;
    --atlas-touch-target-lg: 2.75rem;
    --atlas-icon-glyph: 1.25rem;
    --atlas-icon-glyph-sm: 1.125rem;
    --atlas-checkbox-target: var(--atlas-touch-target);
    --atlas-pagination-target: var(--atlas-touch-target);

    --atlas-gap-xs: 0.25rem;
    --atlas-gap-sm: 0.5rem;
    --atlas-gap-md: 0.75rem;
    --atlas-gap-lg: 1rem;
    --atlas-gap-xl: 1.5rem;
}

/* Touch pointers and phone widths promote every hit area to the 44px minimum.
   Declared once here so components never branch on breakpoint themselves (#1592). */
@media (pointer: coarse) {
    :root {
        --atlas-touch-target: var(--atlas-touch-target-lg);
        --atlas-control-height-filter: var(--atlas-touch-target-lg);
    }
}

@media (max-width: 599.95px) {
    :root {
        --atlas-touch-target: var(--atlas-touch-target-lg);
        --atlas-control-height-filter: var(--atlas-touch-target-lg);
    }
}

/* Dark token values. Defined once for the explicit data-theme override and
   reused via the prefers-color-scheme block below; keep the two blocks in sync. */
:root[data-theme="dark"] {
    color-scheme: dark;

    --atlas-bg: #090f14;
    --atlas-sidebar: #111820;
    --atlas-surface: #151c24;
    --atlas-surface-muted: #1b242d;
    --atlas-border: #2a343f;
    --atlas-row-bg: #121920;
    --atlas-row-alt-bg: #171f27;
    --atlas-row-hover-bg: #243444;
    --atlas-row-selected-bg: #14434f;
    --atlas-row-focus-bg: #243444;
    --atlas-text: #eef3f7;
    --atlas-muted: #9aa7b3;
    --atlas-accent: #12a3bf;
    --atlas-accent-soft: #12313a;
    --atlas-accent-contrast: #ffffff;
    --atlas-success: #35b982;
    --atlas-warning: #e1a22b;
    --atlas-danger: #e06363;
    --atlas-info: #38a3db;

    --atlas-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
    --atlas-shadow-md: 0 2px 8px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;

        --atlas-bg: #090f14;
        --atlas-sidebar: #111820;
        --atlas-surface: #151c24;
        --atlas-surface-muted: #1b242d;
        --atlas-border: #2a343f;
        --atlas-row-bg: #121920;
        --atlas-row-alt-bg: #171f27;
        --atlas-row-hover-bg: #243444;
        --atlas-row-selected-bg: #14434f;
        --atlas-row-focus-bg: #243444;
        --atlas-text: #eef3f7;
        --atlas-muted: #9aa7b3;
        --atlas-accent: #12a3bf;
        --atlas-accent-soft: #12313a;
        --atlas-accent-contrast: #ffffff;
        --atlas-success: #35b982;
        --atlas-warning: #e1a22b;
        --atlas-danger: #e06363;
        --atlas-info: #38a3db;

        --atlas-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
        --atlas-shadow-md: 0 2px 8px rgba(0, 0, 0, 0.5);
    }
}

html, body {
    font-family: var(--atlas-font-sans);
    color: var(--atlas-text);
    background: var(--atlas-bg);
}

body {
    margin: 0;
}

a {
    color: var(--atlas-accent);
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.mud-main-content {
    background: transparent;
}

/* Sidebar-first shell content fade-in (ATLAS work item #113). The previous rule keyed
   off .mud-main-content > div:first-child from the old MudMainContent layout; the Atlas
   shell renders page content inside .atlas-shell__content instead. */
.atlas-shell__content > * {
    animation: app-fade-in 0.18s ease-out;
}

/* Page layout helpers for Atlas console surfaces (ATLAS work item #119). A simple vertical
   stack for header + panels, and a responsive auto-fit grid for AtlasMetricCard tiles. These
   are the first real consumers of the shared primitives, so the helpers live alongside them. */
.atlas-stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-height: 0;
}

.atlas-stack--tight {
    gap: 0.75rem;
}

/* Pinned app-viewport behavior is desktop-only (plan #291 decision 2). Below 960px the
   stack participates in natural document flow so header/filter chrome can never starve
   the list panes of height. */
@media (min-width: 960px) {
    .atlas-stack--viewport {
        height: calc(100dvh - 3.5rem);
        max-height: calc(100dvh - 3.5rem);
        overflow: hidden;
    }

    .atlas-stack--viewport > * {
        flex: 0 0 auto;
    }

    .atlas-stack--viewport > .atlas-split-pane--fill {
        flex: 1 1 auto;
        min-height: 0;
    }
}

.atlas-metric-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

/* AtlasSplitPane (#126): desktop master-detail knowledge explorer. Two columns on wide
   viewports (dense master list + persistent detail pane); collapses to a single column on
   narrow viewports where --detail-active swaps which pane is visible. */
.atlas-split-pane {
    align-items: start;
    display: grid;
    gap: 1.25rem;
    grid-template-columns: minmax(20rem, 24rem) minmax(0, 1fr);
    min-height: 0;
}

.atlas-split-pane__master,
.atlas-split-pane__detail {
    min-width: 0;
    min-height: 0;
}

/* Fill (inner-scrolling) pane behavior is desktop-only (plan #291 decision 2). Keeping
   these rules out of the mobile range also keeps their (0,2,0) specificity from beating
   the single-column pane-visibility rules below 960px. */
@media (min-width: 960px) {
    .atlas-split-pane--fill {
        align-items: stretch;
        flex: 1 1 auto;
        overflow: hidden;
    }

    .atlas-split-pane--fill > .atlas-split-pane__master,
    .atlas-split-pane--fill > .atlas-split-pane__detail {
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
}

/* Mobile back bar of the split pane (#1111): desktop always shows both panes, so the
   bar only exists below the cutover. */
.atlas-split-pane__backbar {
    display: none;
}

/* Below 960px the split pane is a single naturally-sized column; DetailActive decides
   which pane is visible and the page itself scrolls (no pinned heights, plan #291 M1). */
@media (max-width: 959.95px) {
    .atlas-split-pane {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Detail focus mode (#1117): while the detail pane is active, the list chrome above
       it (page header with search/actions, filter panel, bulk panel) is hidden so the
       swapped-in detail gets the full viewport. Browsers without :has() keep the chrome
       visible, which is the previous behavior. */
    .atlas-stack--viewport:has(> .atlas-split-pane--detail-active) > :not(.atlas-split-pane) {
        display: none;
    }

    /* Back bar styled as a quiet Atlas surface row with accent text (#1117) instead of
       the default MudButton chrome. */
    .atlas-split-pane__backbar {
        display: flex;
        margin-bottom: 0.75rem;
    }

    .atlas-split-pane__backbar .atlas-split-pane__backbar-button {
        background: var(--atlas-surface);
        border: 1px solid var(--atlas-border);
        border-radius: var(--atlas-radius-md);
        color: var(--atlas-accent);
        font-weight: 700;
        justify-content: flex-start;
        padding: 0.45rem 0.85rem;
        width: 100%;
    }

    .atlas-split-pane__backbar .atlas-split-pane__backbar-button:hover,
    .atlas-split-pane__backbar .atlas-split-pane__backbar-button:focus-visible {
        background: var(--atlas-row-hover-bg);
        border-color: var(--atlas-accent);
    }

    .atlas-split-pane__detail {
        display: none;
    }

    .atlas-split-pane--detail-active .atlas-split-pane__master {
        display: none;
    }

    .atlas-split-pane--detail-active .atlas-split-pane__detail {
        display: block;
    }
}

/* Shared toolbar/filter field sizing (#1112): replaces the per-page inline min-width
   styles on search/filter inputs. Desktop keeps compact minimum widths; below 600px
   (media block further down) every field stretches to the full row. */
.atlas-field--sm {
    min-width: 10rem;
}

.atlas-field--md {
    min-width: 11.25rem;
}

.atlas-field--lg {
    min-width: 13.75rem;
}

.atlas-field--search {
    min-width: 16.25rem;
}

/* Screen-reader-only text. Used where a state has a visible non-color affordance that
   still needs a spoken name (for example the current-preview marker in a master row). */
.atlas-visually-hidden {
    border: 0;
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

/* Shared search control (#1591). Field plus its submit and reset actions travel together, so
   every page gets the same target sizes, the same order, and the same wrapping behavior. */
.atlas-search {
    align-items: center;
    display: flex;
    gap: var(--atlas-gap-xs);
    min-width: 0;
}

/* Progressive disclosure for secondary filters (#1595). Collapsed by default at every width —
   including mobile, where the old ten-control wall pushed the first result below the fold — but
   the trigger keeps reporting how many hidden filters are active. */
.atlas-disclosure {
    display: flex;
    flex-direction: column;
    gap: var(--atlas-gap-sm);
    min-width: 0;
}

.atlas-disclosure__badge {
    align-items: center;
    background: var(--atlas-accent);
    border-radius: var(--atlas-radius-pill);
    color: var(--atlas-accent-contrast);
    display: inline-flex;
    font-size: 0.7rem;
    font-weight: 700;
    justify-content: center;
    margin-left: var(--atlas-gap-xs);
    min-width: 1.25rem;
    padding: 0 0.35rem;
}

.atlas-disclosure__panel {
    border-top: 1px solid var(--atlas-border);
    min-width: 0;
    padding-top: var(--atlas-gap-md);
    width: 100%;
}

.atlas-toolbar__disclosure {
    flex: 1 1 100%;
}

/* Terminal and Converted are lifecycle scope rather than attribute filters, so they are grouped
   and named as such instead of sitting loose among the selects (#1595). */
.atlas-lifecycle-group {
    border: 1px solid var(--atlas-border);
    border-radius: var(--atlas-radius-md);
    display: flex;
    flex-direction: column;
    gap: var(--atlas-gap-xs);
    margin: 0;
    min-width: 0;
    padding: var(--atlas-gap-sm) var(--atlas-gap-md) var(--atlas-gap-md);
}

.atlas-lifecycle-group__legend {
    color: var(--atlas-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 0 var(--atlas-gap-xs);
    text-transform: uppercase;
}

/* Active-filter chips (#1591): what is narrowing the list, each removable on its own, with the
   result count rendered from the same state in the same update so it can never read as stale. */
.atlas-active-filters {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--atlas-gap-sm);
    margin-top: var(--atlas-gap-md);
    min-width: 0;
}

.atlas-active-filters__caption {
    color: var(--atlas-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.atlas-active-filters__chip {
    align-items: center;
    background: var(--atlas-accent-soft);
    border: 1px solid var(--atlas-accent);
    border-radius: var(--atlas-radius-pill);
    color: var(--atlas-text);
    display: inline-flex;
    font-size: 0.78rem;
    gap: var(--atlas-gap-xs);
    max-width: 100%;
    min-width: 0;
    padding: 0.1rem 0.15rem 0.1rem 0.6rem;
}

.atlas-active-filters__label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The remove control keeps the shared touch target while its glyph stays chip-sized (#1592). */
.atlas-active-filters__remove.mud-icon-button {
    height: var(--atlas-touch-target);
    min-height: var(--atlas-touch-target);
    min-width: var(--atlas-touch-target);
    padding: 0;
    width: var(--atlas-touch-target);
}

.atlas-active-filters__remove .mud-icon-root {
    font-size: var(--atlas-icon-glyph-sm);
    height: var(--atlas-icon-glyph-sm);
    width: var(--atlas-icon-glyph-sm);
}

.atlas-active-filters__count {
    color: var(--atlas-muted);
    font-size: 0.78rem;
    margin-left: auto;
}

@media (max-width: 599.95px) {
    .atlas-search {
        flex-wrap: wrap;
        width: 100%;
    }

    .atlas-active-filters__count {
        margin-left: 0;
    }
}

/* Shared filter toolbar row (#1592/#1591). Mixed content — fields, selects, icon actions,
   text buttons — centers on one baseline and uses the shared gap scale at every breakpoint. */
.atlas-toolbar {
    align-items: center;
    column-gap: var(--atlas-gap-md);
    row-gap: var(--atlas-gap-sm);
}

/* Density scale application (#1592). Page-header and toolbar fields share one height so
   text fields, selects, and buttons on the same row align on a common baseline. */
.atlas-page-header__actions .mud-input-control .mud-input-slot,
.atlas-toolbar .mud-input-control .mud-input-slot {
    min-height: var(--atlas-control-height-header);
}

/* MudSelect's slot padding is part of its content box. A slot-level min-height therefore made a
   nominal 40px filter 61px tall and left its value visibly high. Constrain the select root and
   center its slot within that shared control height; touch layouts promote the token to 44px. */
.atlas-page-header__actions .mud-select .mud-input,
.atlas-toolbar .mud-select .mud-input {
    height: var(--atlas-control-height-filter);
    min-height: var(--atlas-control-height-filter);
}

.atlas-page-header__actions .mud-select .mud-input-slot,
.atlas-toolbar .mud-select .mud-input-slot {
    align-items: center;
    box-sizing: border-box;
    display: flex;
    height: 100%;
    min-height: 0;
    padding-bottom: 0;
    padding-top: 0;
}

.atlas-page-header__actions .mud-button-root,
.atlas-toolbar .mud-button-root {
    min-height: var(--atlas-control-height-compact);
}

/* Icon-only actions (search, clear, preview, detail, sort, refresh). The glyph stays
   compact for density; the hit area is what grows, so touch users get a real target
   without the icon visually dominating a dense row. Replaces the 26x26 hit boxes. */
.atlas-icon-action.mud-icon-button {
    height: var(--atlas-touch-target);
    min-height: var(--atlas-touch-target);
    min-width: var(--atlas-touch-target);
    width: var(--atlas-touch-target);
}

.atlas-page-header__actions .mud-icon-button,
.atlas-toolbar .mud-icon-button {
    height: var(--atlas-touch-target);
    min-height: var(--atlas-touch-target);
    min-width: var(--atlas-touch-target);
    width: var(--atlas-touch-target);
}

.atlas-icon-action .mud-icon-root,
.atlas-page-header__actions .mud-icon-button .mud-icon-root,
.atlas-toolbar .mud-icon-button .mud-icon-root {
    font-size: var(--atlas-icon-glyph);
    height: var(--atlas-icon-glyph);
    width: var(--atlas-icon-glyph);
}

/* Enlarged hit areas must not clip their own focus ring (#1592 AC4). */
.atlas-icon-action.mud-icon-button:focus-visible,
.atlas-page-header__actions .mud-icon-button:focus-visible,
.atlas-toolbar .mud-icon-button:focus-visible {
    box-shadow: var(--atlas-focus-ring);
    outline: none;
    overflow: visible;
}

/* Checkboxes and pagination keep one target size between master lists and DataGrids. */
.atlas-master-list__checkbox .mud-button-root,
.atlas-data-grid .mud-table-cell .mud-checkbox .mud-button-root,
.atlas-data-grid .mud-table-head .mud-checkbox .mud-button-root {
    height: var(--atlas-checkbox-target);
    min-height: var(--atlas-checkbox-target);
    min-width: var(--atlas-checkbox-target);
    width: var(--atlas-checkbox-target);
}

.atlas-master-list__pager .mud-pagination .mud-icon-button,
.atlas-data-grid .mud-table-pagination .mud-icon-button {
    height: var(--atlas-pagination-target);
    min-height: var(--atlas-pagination-target);
    min-width: var(--atlas-pagination-target);
    width: var(--atlas-pagination-target);
}

/* Phone fine-tuning: let dense panel headers wrap instead of forcing horizontal
   overflow when title + actions exceed the viewport, and stretch toolbar fields
   to full width so filter rows stack instead of squeezing. */
@media (max-width: 599.95px) {
    .atlas-panel__header {
        flex-wrap: wrap;
    }

    .atlas-panel__actions {
        flex-wrap: wrap;
    }

    .atlas-field,
    .atlas-field--sm,
    .atlas-field--md,
    .atlas-field--lg,
    .atlas-field--search {
        flex: 1 1 100%;
        min-width: 0;
        width: 100%;
    }

    .atlas-page-header__actions {
        width: 100%;
    }
}

/* Selected master row highlight for the split-pane explorer (#126/#415). */
.atlas-split-pane__row--selected td,
.atlas-split-pane__row--selected {
    background: var(--atlas-row-selected-bg);
}

/* Inline code/example block used inside detail panes (#126). Replaces ad-hoc inline styles
   so example snippets render consistently in light and dark themes. */
.atlas-code-block {
    background: var(--atlas-surface-muted);
    border: 1px solid var(--atlas-border);
    border-radius: var(--atlas-radius-sm);
    color: var(--atlas-text);
    margin: 0;
    padding: 0.85rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.mud-typography-h4,
.mud-typography-h5,
.mud-typography-h6 {
    color: var(--atlas-text);
    font-weight: 700;
    letter-spacing: 0;
}

.mud-typography-body2,
.mud-typography-caption {
    color: var(--atlas-muted);
}

.mud-paper,
.mud-alert,
.mud-table-container,
.mud-data-grid,
.mud-input-control,
.mud-list,
.mud-card {
    border-radius: var(--atlas-radius-md);
}

.mud-paper,
.mud-data-grid,
.mud-table-container,
.mud-card {
    border: 1px solid var(--atlas-border);
    box-shadow: var(--atlas-shadow-md);
}

.mud-alert {
    border: 1px solid var(--atlas-border);
    box-shadow: var(--atlas-shadow-sm);
}

.mud-button-root {
    border-radius: var(--atlas-radius-sm);
    text-transform: none;
    font-weight: 700;
}

.mud-button-filled {
    box-shadow: var(--atlas-shadow-sm);
}

.mud-input-control .mud-input-slot,
.mud-input-control .mud-input-root {
    border-radius: var(--atlas-radius-sm);
}

.mud-input-control .mud-input-outlined-border {
    border-color: var(--atlas-border);
}

.mud-chip {
    font-weight: 600;
    border-radius: var(--atlas-radius-pill);
}

.mud-table-head .mud-table-cell,
.mud-data-grid-header-cell {
    color: var(--atlas-muted);
    font-weight: 700;
    background: var(--atlas-surface-muted);
}

.mud-table-row,
.mud-data-grid-row {
    background: var(--atlas-row-bg);
}

.mud-table-striped .mud-table-body .mud-table-row:nth-child(even),
.mud-table-striped .mud-table-row:nth-child(even),
.mud-data-grid .mud-table-body .mud-table-row:nth-child(even),
.mud-data-grid .mud-data-grid-row:nth-child(even) {
    background: var(--atlas-row-alt-bg);
}

.mud-table-row:hover,
.mud-data-grid-row:hover {
    background: var(--atlas-row-hover-bg) !important;
}

.mud-pagination,
.mud-data-grid-pager {
    padding-top: 0.75rem;
}

/* DataGrid row states (#1589). Ordering by visual weight: default < alternate (zebra) <
   hover/focus < selected. Zebra exists to help the eye track a row across columns and must never
   compete with a real state. */
.atlas-data-grid .mud-table-row:focus-within {
    background: var(--atlas-row-focus-bg);
    box-shadow: var(--atlas-focus-ring);
    outline: none;
}

/* Selection carries a solid accent rail as well as the fill, so it survives greyscale printing,
   forced-colors mode, and readers who cannot separate the two blues. */
.atlas-data-grid .atlas-data-grid__row--selected,
.atlas-data-grid .atlas-data-grid__row--selected:hover {
    background: var(--atlas-row-selected-bg) !important;
    box-shadow: inset 3px 0 0 var(--atlas-accent);
}

.atlas-data-grid .atlas-data-grid__row--selected td:first-child {
    font-weight: 600;
}

/* Read-only grids (Audit Log) never select anything, so their rows must not borrow the
   selectable look — no pointer cursor and no selected treatment. */
.atlas-data-grid--readonly .mud-table-row,
.atlas-data-grid--readonly .mud-table-row:hover {
    cursor: default;
}

.atlas-grid-select {
    display: inline-flex;
}

/* The empty state replaces the grid body, so it needs breathing room the dense rows do not. */
.atlas-grid-empty {
    padding-block: 2rem;
}

/* Wide tables and grids scroll inside their own container instead of widening the page
   (#1113, plan #291 decision 3). The shell clips page-level horizontal overflow, so
   without this, columns beyond the viewport would be unreachable on phones. */
.mud-table-container {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.mud-data-grid {
    max-width: 100%;
}

/* View selectors (#1596). ATLAS uses four related-looking controls with different jobs:
   semantic tabs (MudTabs, .atlas-page-tabs) swap panels; segmented filter chips toggle a lens
   over one dataset (Activity views); navigation buttons change the route (Settings sections);
   and overflow chips summarize hidden filters. .atlas-segmented gives the last three one set of
   selected/hover/focus/disabled treatments so they stop drifting apart.
   See docs/plans/atlas-view-selector-contract.md for which control to use when. */
.atlas-segmented {
    align-items: center;
    display: flex;
    gap: var(--atlas-gap-sm);
    min-width: 0;
}

/* Filter chips stay on one line and scroll, because their row is a lens picker whose members
   are peers; navigation buttons wrap, because each one is a separate destination. */
.atlas-segmented:not(.atlas-segmented--wrap) {
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.atlas-segmented--wrap {
    flex-wrap: wrap;
}

.atlas-segmented__item {
    flex: 0 0 auto;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.atlas-segmented__item:hover {
    border-color: var(--atlas-accent);
}

.atlas-segmented__item:focus-visible {
    box-shadow: var(--atlas-focus-ring);
    outline: none;
}

.atlas-segmented__item:disabled,
.atlas-segmented__item[aria-disabled="true"] {
    color: var(--atlas-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Current state is carried by a check glyph as well as the fill, so it survives greyscale,
   forced colors, and readers who cannot separate the accent from the surface. */
.atlas-segmented__item[aria-pressed="true"],
.atlas-segmented__item[aria-current] {
    font-weight: 700;
}

.atlas-segmented__item .mud-icon-root {
    font-size: var(--atlas-icon-glyph-sm);
    height: var(--atlas-icon-glyph-sm);
    margin-right: var(--atlas-gap-xs);
    width: var(--atlas-icon-glyph-sm);
}

.atlas-page-tabs {
    --mud-palette-lines-default: var(--atlas-border);
    --atlas-tab-height: 3rem;
}

/* Keep tab strips inside the viewport on narrow screens (#1114): once their width is
   constrained, MudTabs pages overflowing tabs with its own scroll buttons instead of
   widening the page. */
.atlas-page-tabs,
.user-management-tabs {
    max-width: 100%;
    min-width: 0;
}

.atlas-page-tabs .mud-tabs-toolbar,
.atlas-page-tabs .mud-tabs-tabbar {
    align-items: stretch;
    background: var(--atlas-surface-muted);
    border-bottom: 1px solid var(--atlas-border);
    min-height: var(--atlas-tab-height);
}

.atlas-page-tabs .mud-tabs-tabbar .mud-tabs-tabbar-inner,
.atlas-page-tabs .mud-tabs-tabbar .mud-tabs-tabbar-content,
.atlas-page-tabs .mud-tabs-tabbar .mud-tabs-tabbar-wrapper {
    align-items: stretch;
    min-height: var(--atlas-tab-height);
}

.atlas-page-tabs .mud-tab {
    align-items: center;
    box-sizing: border-box;
    color: var(--atlas-muted);
    display: inline-flex;
    font-weight: 700;
    height: var(--atlas-tab-height);
    letter-spacing: 0;
    line-height: 1;
    min-height: var(--atlas-tab-height);
    overflow: visible;
    padding: 0 1rem;
}

.atlas-page-tabs .mud-tab .mud-tab-content,
.atlas-page-tabs .mud-tab .mud-tab-wrapper {
    align-items: center;
    display: inline-flex;
    height: 100%;
    justify-content: center;
    min-height: 100%;
    overflow: visible;
}

.atlas-page-tabs .mud-tab:hover {
    background: var(--atlas-row-hover-bg);
    color: var(--atlas-text);
}

.atlas-page-tabs .mud-tab.mud-tab-active {
    color: var(--atlas-accent);
}

.atlas-page-tabs .mud-tabs-toolbar .mud-tabs-toolbar-content,
.atlas-page-tabs .mud-tabs-tabbar .mud-tabs-tabbar-wrapper {
    align-items: stretch;
    min-height: var(--atlas-tab-height);
}

.atlas-page-tabs .mud-tabs-slider,
.atlas-page-tabs .mud-tab-slider {
    background-color: var(--atlas-accent);
    height: 2px;
}

.atlas-page-tabs .mud-badge-root {
    align-items: center;
    display: inline-flex;
    gap: 0.35rem;
    line-height: 1;
    overflow: visible;
}

.atlas-page-tabs .mud-badge-root .mud-badge-wrapper {
    display: inline-flex;
    height: auto;
    left: auto;
    pointer-events: none;
    position: static;
    top: auto;
    width: auto;
}

.atlas-page-tabs .mud-badge,
.atlas-page-tabs .mud-badge-root .mud-badge,
.atlas-page-tabs .mud-tab-badge {
    align-items: center;
    background: var(--atlas-row-hover-bg);
    border-radius: var(--atlas-radius-pill);
    color: var(--atlas-text);
    display: inline-flex;
    height: 1.15rem;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    min-width: 1.15rem;
    padding: 0 0.35rem;
    position: static;
    transform: none;
}

.atlas-page-tabs .mud-tab-badge {
    margin-inline-start: 0.35rem;
    margin-left: 0.35rem;
}

.atlas-page-tabs .mud-tab-active .mud-badge,
.atlas-page-tabs .mud-tab-active .mud-badge-root .mud-badge,
.atlas-page-tabs .mud-tab-active .mud-tab-badge {
    background: var(--atlas-accent);
    color: var(--atlas-accent-contrast);
}

@media (max-width: 599.95px) {
    /* One line plus controlled scrolling for peer selectors; never a clipped, unreachable item. */
    .atlas-segmented:not(.atlas-segmented--wrap) {
        padding-bottom: var(--atlas-gap-xs);
    }

    .atlas-segmented--wrap {
        row-gap: var(--atlas-gap-sm);
    }
}

.user-management-tabs .mud-tabs-panels {
    padding-top: 1rem;
}

.user-management-tabs .mud-tabs-toolbar {
    margin-bottom: 0.5rem;
}

.clickable-table-row {
    cursor: pointer;
}

.membership-tooltip-content {
    color: #ffffff;
    font-size: 0.85rem;
    line-height: 1.35;
    min-width: 18rem;
    padding: 0.1rem 0;
}

.membership-tooltip-content__title {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}

.membership-tooltip-content__row {
    align-items: center;
    display: flex;
    gap: 0.9rem;
    justify-content: space-between;
    padding: 0.16rem 0;
    white-space: nowrap;
}

.membership-tooltip-content__row span,
.membership-tooltip-content__row strong {
    color: #ffffff;
}

.membership-tooltip-content__row strong {
    font-weight: 800;
}

.markdown-preview {
    background: var(--atlas-surface-muted);
    border: 1px solid var(--atlas-border);
    border-radius: var(--atlas-radius-md);
    color: var(--atlas-text);
    line-height: 1.6;
    max-width: 100%;
    overflow: auto;
    padding: 1rem;
}

.markdown-preview--embedded {
    background: transparent;
    border: 0;
    padding: 0;
}

.markdown-preview-editor {
    max-height: 680px;
}

.markdown-preview :first-child {
    margin-top: 0;
}

.markdown-preview :last-child {
    margin-bottom: 0;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3,
.markdown-preview h4,
.markdown-preview h5,
.markdown-preview h6 {
    color: var(--atlas-text);
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.25;
    margin: 1rem 0 0.5rem;
}

.markdown-preview h1 {
    font-size: 1.55rem;
}

.markdown-preview h2 {
    font-size: 1.35rem;
}

.markdown-preview h3 {
    font-size: 1.15rem;
}

.markdown-preview p,
.markdown-preview ul,
.markdown-preview ol,
.markdown-preview blockquote,
.markdown-preview pre {
    margin: 0 0 0.85rem;
}

.markdown-preview ul,
.markdown-preview ol {
    padding-left: 1.5rem;
}

.markdown-preview blockquote {
    border-left: 4px solid var(--atlas-accent);
    color: var(--atlas-muted);
    padding-left: 0.9rem;
}

.markdown-preview pre {
    background: var(--atlas-surface-muted);
    border-radius: var(--atlas-radius-sm);
    overflow: auto;
    padding: 0.85rem;
}

.markdown-preview code {
    background: var(--atlas-surface-muted);
    border-radius: 4px;
    font-size: 0.92em;
    padding: 0.1rem 0.25rem;
}

.markdown-preview pre code {
    background: transparent;
    border-radius: 0;
    padding: 0;
}

.markdown-preview hr {
    border: 0;
    border-top: 1px solid var(--atlas-border);
    margin: 1rem 0;
}

.markdown-preview table {
    border-collapse: collapse;
    display: block;
    margin: 0 0 0.85rem;
    max-width: 100%;
    overflow-x: auto;
    width: max-content;
}

.markdown-preview th,
.markdown-preview td {
    border: 1px solid var(--atlas-border);
    padding: 0.45rem 0.7rem;
    text-align: left;
    vertical-align: top;
}

.markdown-preview thead th {
    background: var(--atlas-surface-muted);
    color: var(--atlas-text);
    font-weight: 700;
}

.markdown-preview tbody tr:nth-child(even) {
    background: var(--atlas-surface-muted);
}

.markdown-preview-empty {
    color: var(--atlas-muted);
}

/* ============================================================
   Atlas shell v2 shared console component primitives (ATLAS work item #116).
   Thin, token-driven presentational classes consumed by AtlasPanel,
   AtlasPageHeader, AtlasMetricCard, AtlasListRow, AtlasEmptyState, and
   AtlasLoadingBlock. Keep these namespaced; do not add deep .mud-* overrides here.
   ============================================================ */

/* Shared semantic tone accents reused across primitives via custom properties. */
.atlas-tone--default {
    --atlas-tone: var(--atlas-muted);
    --atlas-tone-soft: var(--atlas-surface-muted);
}

.atlas-tone--accent {
    --atlas-tone: var(--atlas-accent);
    --atlas-tone-soft: var(--atlas-accent-soft);
}

.atlas-tone--success {
    --atlas-tone: var(--atlas-success);
    --atlas-tone-soft: rgba(35, 148, 107, 0.14);
}

.atlas-tone--warning {
    --atlas-tone: var(--atlas-warning);
    --atlas-tone-soft: rgba(201, 138, 22, 0.16);
}

.atlas-tone--danger {
    --atlas-tone: var(--atlas-danger);
    --atlas-tone-soft: rgba(216, 91, 87, 0.16);
}

.atlas-tone--info {
    --atlas-tone: var(--atlas-info);
    --atlas-tone-soft: rgba(36, 119, 179, 0.16);
}

/* AtlasPill: token-driven status/priority/decision/role/scope pill (#117).
   Semantic text plus a soft tone fill so meaning is never conveyed by color alone. */
.atlas-pill {
    align-items: center;
    background: var(--atlas-tone-soft, var(--atlas-surface-muted));
    border-radius: var(--atlas-radius-pill);
    color: var(--atlas-tone, var(--atlas-muted));
    display: inline-flex;
    font-size: 0.74rem;
    font-weight: 700;
    gap: 0.35rem;
    letter-spacing: 0.02em;
    line-height: 1.2;
    padding: 0.18rem 0.6rem;
    white-space: nowrap;
}

.atlas-pill__dot {
    background: currentColor;
    border-radius: var(--atlas-radius-pill);
    flex-shrink: 0;
    height: 0.45rem;
    width: 0.45rem;
}

.atlas-pill__icon {
    flex-shrink: 0;
    font-size: 0.95rem;
}

.atlas-pill__label {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* AtlasPanel: flat bordered console surface. */
.atlas-panel {
    background: var(--atlas-surface);
    border: 1px solid var(--atlas-border);
    border-radius: var(--atlas-radius-lg);
    box-shadow: none;
    overflow: hidden;
}

.atlas-panel--fill {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.atlas-panel__header {
    align-items: flex-start;
    border-bottom: 1px solid var(--atlas-border);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.85rem 1.1rem;
}

.atlas-panel--fill .atlas-panel__header {
    flex: 0 0 auto;
}

.atlas-panel__heading {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.atlas-panel__eyebrow {
    color: var(--atlas-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.atlas-panel__title {
    color: var(--atlas-text);
    font-weight: 700;
}

.atlas-panel__subtitle {
    color: var(--atlas-muted);
}

.atlas-panel__actions {
    align-items: center;
    display: flex;
    flex-shrink: 0;
    gap: 0.5rem;
}

.atlas-panel__body {
    padding: 1.1rem;
}

.atlas-panel--fill .atlas-panel__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.atlas-panel--master-list .atlas-panel__body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.atlas-panel__body--flush {
    padding: 0;
}

.atlas-panel--dense .atlas-panel__header {
    padding: 0.6rem 0.85rem;
}

.atlas-panel--dense .atlas-panel__body {
    padding: 0.85rem;
}

/* List/detail detail panels: give each information group a quiet surface so dense
   descriptions, scopes, metadata, and examples scan as distinct chunks. */
.atlas-detail-panel .atlas-panel__body > .atlas-stack--tight {
    gap: 0.9rem;
}

.atlas-detail-panel .atlas-panel__body > .atlas-stack--tight > div:not(.mud-stack),
.atlas-detail-panel .atlas-panel__body > .atlas-stack--tight > .mud-grid {
    background: var(--atlas-surface-muted);
    border: 1px solid var(--atlas-border);
    border-radius: var(--atlas-radius-md);
    padding: 0.9rem 1rem;
}

.atlas-detail-panel .atlas-panel__body > .atlas-stack--tight > .mud-stack:first-child {
    padding-bottom: 0.1rem;
}

.atlas-detail-panel .atlas-panel__body .mud-typography-subtitle2 {
    color: var(--atlas-muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Rendered Markdown inside a list/detail preview pane (#1602): capped and self-scrolling
   so a long plan or runbook stays a preview. On desktop this keeps the metadata above it
   reachable without paging through the whole document (the panel header actions are already
   pinned by .atlas-panel--fill); below 960px, where the page scrolls instead of the pane,
   it is what stops the body from turning the preview into an endless column. The full text
   lives on the detail page behind "Open full page". */
.atlas-detail-markdown {
    max-height: min(60vh, 40rem);
    overflow: auto;
    overscroll-behavior: contain;
}

/* AtlasPageHeader: compact operational page header. */
.atlas-page-header {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.atlas-page-header__heading {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.atlas-page-header__eyebrow {
    color: var(--atlas-muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.atlas-page-header__title {
    color: var(--atlas-text);
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.atlas-page-header__subtitle {
    color: var(--atlas-muted);
    max-width: 70ch;
}

.atlas-page-header__meta {
    align-items: center;
    color: var(--atlas-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 0.35rem;
}

.atlas-page-header__actions {
    align-items: center;
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* AtlasMetricCard: dashboard counter tile. */
.atlas-metric {
    background: var(--atlas-surface);
    border: 1px solid var(--atlas-border);
    border-radius: var(--atlas-radius-lg);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    height: 100%;
    padding: 1rem 1.1rem;
    position: relative;
    text-align: left;
}

a.atlas-metric,
.atlas-metric--clickable {
    color: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

a.atlas-metric:hover,
.atlas-metric--clickable:hover {
    border-color: var(--atlas-tone, var(--atlas-accent));
    box-shadow: var(--atlas-shadow-sm);
}

a.atlas-metric:focus-visible,
.atlas-metric--clickable:focus-visible {
    box-shadow: var(--atlas-focus-ring);
    outline: none;
}

.atlas-metric__header {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
}

.atlas-metric__label {
    color: var(--atlas-muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.atlas-metric__icon {
    align-items: center;
    background: var(--atlas-tone-soft, var(--atlas-surface-muted));
    border-radius: var(--atlas-radius-sm);
    color: var(--atlas-tone, var(--atlas-muted));
    display: inline-flex;
    height: 1.9rem;
    justify-content: center;
    width: 1.9rem;
}

.atlas-metric__value {
    color: var(--atlas-text);
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.1;
}

.atlas-metric__value--muted {
    color: var(--atlas-muted);
    font-size: 1.25rem;
}

.atlas-metric__caption {
    color: var(--atlas-muted);
    font-size: 0.8rem;
}

/* AtlasListRow: dense list row used by activity/issues/changelog/notes. */
.atlas-list-row {
    align-items: center;
    border-bottom: 1px solid var(--atlas-border);
    display: flex;
    gap: 0.75rem;
    padding: 0.6rem 0.5rem;
    width: 100%;
}

.atlas-list-row:last-child {
    border-bottom: 0;
}

.atlas-list-row--clickable {
    border-radius: var(--atlas-radius-sm);
    cursor: pointer;
    transition: background 0.12s ease;
}

.atlas-list-row--clickable:hover {
    background: var(--atlas-row-hover-bg);
}

.atlas-list-row--clickable:focus-visible {
    background: var(--atlas-row-focus-bg);
    box-shadow: var(--atlas-focus-ring);
    outline: none;
}

.atlas-list-row__dot {
    background: var(--atlas-tone, var(--atlas-muted));
    border-radius: var(--atlas-radius-pill);
    flex-shrink: 0;
    height: 0.55rem;
    width: 0.55rem;
}

.atlas-list-row__icon {
    color: var(--atlas-tone, var(--atlas-muted));
    flex-shrink: 0;
}

.atlas-list-row__content {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.atlas-list-row__primary {
    color: var(--atlas-text);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.atlas-list-row__secondary {
    color: var(--atlas-muted);
    display: flex;
    flex-direction: column;
    font-size: 0.82rem;
    gap: 0.15rem;
    min-width: 0;
}

.atlas-audit-summary {
    max-width: 30rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Audit log responsive renderers (#1590).

   Before this, the mobile view kept a ~585px table inside a ~373px container: labels stayed
   visible on the left while Changed by, Changes, and Details ran off-screen behind an
   unadvertised horizontal scroll container. Now each event is a real key/value card below the
   table breakpoint, and the desktop table is the only thing that hides — its pager lives outside
   .mud-table-container, so paging stays shared between the two renderers rather than duplicated. */
.audit-log__cards {
    display: none;
}

.audit-log__mobile-tools {
    display: none;
}

@media (max-width: 959.95px) {
    .audit-log__cards {
        display: block;
    }

    .audit-log__mobile-tools {
        display: block;
        margin-top: var(--atlas-gap-sm);
    }

    /* Only the table itself hides; the pager and the no-records slot stay mounted. */
    .audit-log__grid .mud-table-container {
        display: none;
    }

    .audit-log__grid .mud-table-toolbar {
        display: none;
    }
}

.audit-card-list {
    display: flex;
    flex-direction: column;
    gap: var(--atlas-gap-sm);
    list-style: none;
    margin: 0;
    padding: var(--atlas-gap-md);
}

.audit-card {
    background: var(--atlas-surface);
    border: 1px solid var(--atlas-border);
    border-radius: var(--atlas-radius-md);
    min-width: 0;
    padding: var(--atlas-gap-md);
}

.audit-card__fields {
    display: grid;
    gap: var(--atlas-gap-xs);
    margin: 0;
    min-width: 0;
}

/* Label column is capped in ch units so a long value can never widen the card; the value column
   takes the remaining space and wraps anywhere, including inside unbroken identifiers. */
.audit-card__field {
    display: grid;
    gap: var(--atlas-gap-sm);
    grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr);
    min-width: 0;
}

.audit-card__field dt {
    color: var(--atlas-muted);
    font-size: 0.78rem;
    font-weight: 600;
    min-width: 0;
    overflow-wrap: anywhere;
}

.audit-card__field dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.audit-card__id {
    color: var(--atlas-muted);
    display: block;
    font-family: var(--atlas-font-mono);
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.audit-card__empty {
    color: var(--atlas-muted);
}

/* The payload summary is clamped to three lines and expands in place, so a JSON blob never
   decides the card width and the full text is still one tap away. */
.audit-card__changes summary {
    cursor: pointer;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.audit-card__payload {
    background: var(--atlas-surface-muted);
    border-radius: var(--atlas-radius-sm);
    font-family: var(--atlas-font-mono);
    font-size: 0.75rem;
    margin: var(--atlas-gap-sm) 0 0;
    max-height: 14rem;
    overflow: auto;
    padding: var(--atlas-gap-sm);
    white-space: pre-wrap;
    word-break: break-word;
}

/* Very narrow phones stack label above value rather than squeezing two columns. */
@media (max-width: 399.95px) {
    .audit-card__field {
        gap: 0;
        grid-template-columns: minmax(0, 1fr);
    }
}

.user-management-grid .mud-table-cell {
    vertical-align: top;
}

.user-management-grid .user-grid__member {
    min-width: 12rem;
}

.user-management-grid .user-grid__profile {
    max-width: 16rem;
}

.user-management-grid .user-grid__actions {
    white-space: nowrap;
}

.atlas-list-row__trailing {
    align-items: center;
    color: var(--atlas-muted);
    display: flex;
    flex-shrink: 0;
    gap: 0.5rem;
    margin-left: auto;
}

/* AtlasMasterList: dense single-column master rows for split-pane explorers. */
.atlas-master-list {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
}

.atlas-master-list__rows {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.atlas-master-list__row {
    align-items: flex-start;
    background: var(--atlas-row-bg);
    border-bottom: 1px solid var(--atlas-border);
    display: flex;
    flex: 0 0 auto;
    gap: var(--atlas-gap-sm);
    min-width: 0;
    padding: 0.75rem 0.85rem;
    position: relative;
    transition: background 0.12s ease;
}

/* Zebra striping is a scanning aid only: it must stay weaker than hover, focus, and the
   current/marked states so a row's state is never guessed from stripe parity (#1589). */
.atlas-master-list__row:nth-child(even) {
    background: var(--atlas-row-alt-bg);
}

.atlas-master-list__row:last-child {
    border-bottom: 0;
}

.atlas-master-list__row:hover {
    background: var(--atlas-row-hover-bg);
}

/* The row body (#1587, #1601) is the preview-and-single-select target: clicking or pressing
   Enter/Space previews that item and, when multi-selection is available, makes it the sole bulk
   mark. Only the sibling checkboxes can build a multi-item selection; the detail action navigates. */
.atlas-master-list__body {
    align-items: flex-start;
    background: none;
    border: 0;
    cursor: pointer;
    display: flex;
    flex: 1 1 auto;
    gap: var(--atlas-gap-sm);
    font: inherit;
    min-width: 0;
    padding: 0;
    text-align: start;
    width: 100%;
}

.atlas-master-list__body:focus-visible {
    border-radius: var(--atlas-radius-sm);
    box-shadow: var(--atlas-focus-ring);
    outline: none;
}

/* Current preview item. Distinct from "marked for bulk actions" in both treatment and copy. */
.atlas-master-list__row--current {
    background: var(--atlas-row-selected-bg);
    box-shadow: inset 3px 0 0 var(--atlas-accent);
}

.atlas-master-list__row--current:hover {
    background: var(--atlas-row-selected-bg);
}

.atlas-master-list__row--current .atlas-master-list__title {
    font-weight: 750;
}

/* Non-color affordance for the current row: a marker glyph that survives greyscale,
   high-contrast and forced-colors rendering where the accent rail may not (#1587). */
.atlas-master-list__current-flag {
    align-self: center;
    color: var(--atlas-accent);
    display: inline-flex;
    flex: 0 0 auto;
}

/* Marked for bulk actions. A dashed inset edge rather than a fill, so a row that is both
   current and marked still reads as two separate facts. */
.atlas-master-list__row--marked {
    background: var(--atlas-row-focus-bg);
}

.atlas-master-list__row--marked::after {
    border: 1px dashed var(--atlas-accent);
    border-radius: var(--atlas-radius-sm);
    content: "";
    inset: 2px;
    pointer-events: none;
    position: absolute;
}

.atlas-master-list__row--current.atlas-master-list__row--marked {
    background: var(--atlas-row-selected-bg);
}

.atlas-master-list__checkbox {
    align-items: center;
    display: flex;
    flex-shrink: 0;
    margin-top: -0.2rem;
}

.atlas-master-list__detail {
    align-self: flex-start;
    flex: 0 0 auto;
}

.atlas-master-list__content {
    min-width: 0;
    width: 100%;
}

.atlas-master-list__primary {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.atlas-list-row__metric {
    color: var(--atlas-text);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
}

.atlas-master-list__title {
    color: var(--atlas-text);
    font-weight: 650;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.atlas-master-list__id,
.atlas-master-list__summary {
    color: var(--atlas-muted);
    font-size: 0.78rem;
}

.atlas-master-list__id {
    flex-shrink: 0;
    font-family: var(--atlas-font-mono);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.atlas-master-list__summary {
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-top: 0.2rem;
    overflow: hidden;
}

.atlas-master-list__meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.45rem;
    max-height: 3.4rem;
    min-width: 0;
    overflow: hidden;
}

.atlas-master-list__meta .atlas-pill {
    max-width: 100%;
}

/* Row-height band (#1593, #1598). Rows stay bounded, but are independent scroll items rather
   than shrinkable flex children: shrinking had clipped the metadata on every row except the last
   visible one. The wider band fits title, separate ID, two summary lines, and two pill rows. */
.atlas-master-list__row {
    max-height: 11.5rem;
    min-height: 8rem;
}

.atlas-master-list__body {
    overflow: hidden;
}

.atlas-master-list__pager {
    align-items: center;
    border-top: 1px solid var(--atlas-border);
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
}

.atlas-master-list__range {
    color: var(--atlas-muted);
    flex: 1 0 7rem;
}

.atlas-token-table {
    --mud-palette-table-lines: var(--atlas-border);
}

.atlas-token-table td {
    color: var(--atlas-text);
    vertical-align: top;
}

.atlas-token-table td:first-child {
    color: var(--atlas-muted);
    white-space: nowrap;
}

.atlas-lifecycle-panel {
    margin-bottom: 1rem;
}

.atlas-reference-list {
    background: transparent;
}

.atlas-reference-list__item {
    border-bottom: 1px solid var(--atlas-border);
}

.atlas-reference-list__item:last-child {
    border-bottom: 0;
}

.atlas-text-anywhere {
    overflow-wrap: anywhere;
}

.atlas-health-card__title {
    align-items: center;
    color: var(--atlas-text);
    display: flex;
    gap: 0.5rem;
}

.atlas-health-card__title .mud-icon-root {
    color: var(--atlas-accent);
}

.atlas-health-card,
.atlas-health-card .atlas-panel__body,
.atlas-health-details,
.atlas-health-details .mud-table-container {
    min-width: 0;
    max-width: 100%;
}

.atlas-health-details table {
    table-layout: fixed;
    width: 100%;
}

.atlas-health-details td:first-child {
    width: 38%;
    white-space: normal;
}

.atlas-health-details td:last-child,
.atlas-health-details code {
    overflow-wrap: anywhere;
    white-space: normal;
    word-break: break-word;
}

.atlas-health-finding__stack {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.atlas-breadcrumbs {
    flex-wrap: wrap;
    margin: 0 0 0.75rem;
    padding: 0;
}

.atlas-breadcrumbs a,
.atlas-breadcrumbs .mud-breadcrumb-item {
    color: var(--atlas-muted);
}

.atlas-access-denied {
    background: var(--atlas-surface);
    border-color: var(--atlas-warning);
    border-radius: var(--atlas-radius-md);
    color: var(--atlas-text);
    margin-bottom: 1rem;
}

.atlas-editor-panel {
    background: var(--atlas-surface-muted);
}

.atlas-editor-row {
    background: var(--atlas-surface);
    border: 1px solid var(--atlas-border);
    border-radius: var(--atlas-radius-md);
    padding: 0.85rem;
}

.atlas-multi-select {
    min-width: 0;
}

.atlas-chip-set {
    gap: 0.35rem;
}

.atlas-muted-text {
    color: var(--atlas-muted);
}

.atlas-bulk-bar {
    background: var(--atlas-surface-muted);
    border: 1px solid var(--atlas-border);
    border-radius: var(--atlas-radius-md);
    margin-top: 0.75rem;
    padding: 0.65rem 0.75rem;
}

.global-search-query {
    flex: 1 1 28rem;
    max-width: 100%;
}

.global-search-submit {
    align-self: center;
    /* 40px, shared with every other page-header control (#1585 alignment fix, now
       expressed through the #1592 density token). */
    height: var(--atlas-control-height-header);
    min-width: 8rem;
}

@media (min-width: 601px) {
    /* Mud's dense outlined field uses a smaller top margin without a floating label.
       Normalize the outer boxes so query, labeled limit, and submit button share edges. */
    .global-search-controls .mud-input-control,
    .global-search-controls .global-search-submit {
        margin-top: 8px;
    }

    .global-search-controls .global-search-submit {
        align-self: flex-start;
    }
}

@media (max-width: 600px) {
    .global-search-submit {
        width: 100%;
    }
}

/* AtlasEmptyState: no-data / unknown-data placeholder. */
.atlas-empty-state {
    align-items: center;
    color: var(--atlas-muted);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.atlas-empty-state--dense {
    padding: 1.25rem 1rem;
}

.atlas-empty-state__icon {
    color: var(--atlas-muted);
    margin-bottom: 0.25rem;
}

.atlas-empty-state__title {
    color: var(--atlas-text);
    font-weight: 700;
}

.atlas-empty-state__description {
    color: var(--atlas-muted);
    max-width: 46ch;
}

.atlas-empty-state__actions {
    margin-top: 0.75rem;
}

/* AtlasLoadingBlock: skeleton + indeterminate progress placeholder. */
.atlas-loading-block {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
}

.atlas-loading-block__label {
    color: var(--atlas-muted);
    font-size: 0.82rem;
}

.atlas-loading-block__lines {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@keyframes app-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }
