/* ============================================================
   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;
}

@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: #eef3f6;
    --atlas-row-hover-bg: #e1eef2;
    --atlas-row-selected-bg: #dceff3;
    --atlas-row-focus-bg: #e1eef2;
    --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);
}

/* 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: #202a34;
    --atlas-row-hover-bg: #273746;
    --atlas-row-selected-bg: #12313a;
    --atlas-row-focus-bg: #273746;
    --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: #202a34;
        --atlas-row-hover-bg: #273746;
        --atlas-row-selected-bg: #12313a;
        --atlas-row-focus-bg: #273746;
        --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;
}

.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;
}

.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;
}

@media (max-width: 959.95px) {
    .atlas-split-pane {
        grid-template-columns: minmax(0, 1fr);
    }

    .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;
    }

    .atlas-stack--viewport {
        height: calc(100dvh - 2.5rem);
        max-height: none;
        overflow: visible;
    }

    .atlas-stack--viewport > * {
        flex: 0 0 auto;
    }
}

/* 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;
}

.atlas-page-tabs {
    --mud-palette-lines-default: var(--atlas-border);
    --atlas-tab-height: 3rem;
}

.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);
}

.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-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;
}

/* 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.25rem;
    width: 100%;
}

.atlas-list-row:last-child {
    border-bottom: 0;
}

.atlas-list-row--clickable {
    border-radius: var(--atlas-radius-sm);
    cursor: pointer;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    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);
    font-size: 0.82rem;
}

.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);
    cursor: pointer;
    display: flex;
    gap: 0.65rem;
    min-width: 0;
    padding: 0.75rem 0.85rem;
    transition: background 0.12s ease;
}

.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);
}

.atlas-master-list__row:focus-visible {
    background: var(--atlas-row-focus-bg);
    box-shadow: var(--atlas-focus-ring);
    outline: none;
}

.atlas-master-list__row--selected {
    background: var(--atlas-row-selected-bg);
    box-shadow: inset 3px 0 0 var(--atlas-accent);
}

.atlas-master-list__row--selected:hover,
.atlas-master-list__row--selected:focus-visible {
    background: var(--atlas-row-selected-bg);
}

.atlas-master-list__checkbox {
    flex-shrink: 0;
    margin-top: -0.2rem;
}

.atlas-master-list__content {
    min-width: 0;
    width: 100%;
}

.atlas-master-list__primary {
    align-items: baseline;
    display: flex;
    gap: 0.45rem;
    min-width: 0;
}

.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);
}

.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;
    min-width: 0;
}

.atlas-master-list__meta .atlas-pill {
    max-width: 100%;
}

.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-breadcrumbs {
    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 {
    align-self: center;
    flex: 1 1 28rem;
    max-width: 100%;
    min-height: 40px;
    min-width: min(100%, 280px);
}

.global-search-query .mud-input-control-input-container,
.global-search-query .mud-input-root,
.global-search-query .mud-input-slot {
    max-height: 40px;
}

.global-search-query .mud-input-root {
    min-height: 40px;
}

/* 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;
    }
