/* Precision: shared visual language. Page styles own workflow and semantic states. */
:root, :root[data-ui-theme="light"] {
  --precision-canvas: #f5f7fa;
  --precision-surface: #ffffff;
  --precision-raised: #f0f3f7;
  --precision-selected: #eaf0f9;
  --precision-border: #dfe5ed;
  --precision-text: #202b3e;
  --precision-muted: #5c687a;
  --precision-accent: #304d80;
  --precision-on-accent: #ffffff;
  --precision-waiting: #805700;
  --precision-waiting-bg: #fff5db;
  --ui-light-canvas: var(--precision-canvas);
  --ui-light-surface: var(--precision-surface);
  --ui-light-surface-raised: var(--precision-raised);
  --ui-light-surface-selected: var(--precision-selected);
  --ui-light-border: var(--precision-border);
  color: var(--precision-text);
  background: var(--precision-canvas);
}
:root[data-ui-theme="dark"] {
  --precision-canvas: #0d121b;
  --precision-surface: #161d29;
  --precision-raised: #1d2736;
  --precision-selected: #263a5d;
  --precision-border: #34435a;
  --precision-text: #eef3fc;
  --precision-muted: #a6b3c8;
  --precision-accent: #9dbbff;
  --precision-on-accent: #12223b;
  --precision-waiting: #e8c875;
  --precision-waiting-bg: #302817;
  --precision-info-bg: #17243a;
  --precision-info-border: #36527d;
  --precision-success: #9ad9ad;
  --precision-success-bg: #162b21;
  --precision-success-border: #315e43;
  --precision-danger: #f3aaa6;
  --precision-danger-bg: #321e24;
  --precision-danger-border: #6b3742;
  --ui-dark-canvas: var(--precision-canvas);
  --ui-dark-surface: var(--precision-surface);
  --ui-dark-surface-raised: var(--precision-raised);
  --ui-dark-surface-elevated: var(--precision-raised);
  --ui-dark-surface-selected: var(--precision-selected);
  --ui-dark-input: var(--precision-surface);
  --ui-dark-text: var(--precision-text);
  --ui-dark-text-strong: var(--precision-text);
  --ui-dark-text-muted: var(--precision-muted);
  --ui-dark-accent: var(--precision-accent);
  --ui-dark-border: var(--precision-border);
  color-scheme: dark;
}
body { color: var(--precision-text); background: var(--precision-canvas); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font-family: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
:root[data-ui-theme] #app :is(button, a, input, select, textarea, summary):focus-visible { outline: 2px solid var(--precision-accent); outline-offset: 3px; }
:root[data-ui-theme] #app :is(.shell, .process-shell) { display: flex; flex-direction: column; min-height: 100vh; }
:root[data-ui-theme] #app .topbar {
  position: relative; height: auto; min-height: 74px; overflow: visible; scrollbar-gutter: auto;
  flex-flow: row wrap; align-items: center; gap: 12px 24px; padding: 14px 28px;
  color: var(--precision-text); background: var(--precision-surface); border-bottom: 1px solid var(--precision-border);
}
:root[data-ui-theme] #app .topbar-left { flex: 1 1 680px; width: auto; flex-flow: row wrap; align-items: center; gap: 12px 24px; }
:root[data-ui-theme] #app .topbar-left > .brand { padding: 0; min-height: 36px; justify-content: flex-start; }
:root[data-ui-theme] #app .brand strong { font-size: 13px; letter-spacing: -.01em; }
:root[data-ui-theme] #app :is(.brand span, .actor span) { color: var(--precision-muted); font-size: 11px; }
:root[data-ui-theme] #app .brand-logo { width: 30px; height: 30px; border-radius: 6px; }
:root[data-ui-theme] #app .app-nav { flex: 1 1 auto; width: auto; flex-direction: row; align-items: center; gap: 3px; }
:root[data-ui-theme] #app .app-nav a { width: auto; min-height: 36px; padding: 8px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--precision-muted); }
:root[data-ui-theme] #app .app-nav a:hover { color: var(--precision-accent); background: var(--precision-raised); }
:root[data-ui-theme] #app .app-nav a[aria-current="page"] { color: var(--precision-accent); background: var(--precision-selected); }
:root[data-ui-theme] #app .app-nav-icon { width: 15px; height: 15px; }
:root[data-ui-theme] #app .app-shell-collapse { position: static; flex: 0 0 32px; order: 2; color: var(--precision-muted); border-color: var(--precision-border); background: var(--precision-surface); border-radius: 6px; }
:root[data-ui-theme] #app .app-shell-preferences { order: 3; grid-template-columns: repeat(3, 30px); margin: 0; padding: 2px; border-color: var(--precision-border); border-radius: 6px; background: var(--precision-raised); }
:root[data-ui-theme] #app .app-shell-preferences button { min-height: 28px; border-radius: 4px; color: var(--precision-muted); }
:root[data-ui-theme] #app .app-shell-preferences button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
:root[data-ui-theme] #app .app-shell-preferences button[aria-pressed="true"] { color: var(--precision-accent); background: var(--precision-surface); }
:root[data-ui-theme] #app :is(.actor, .top-actions) { width: auto; flex-flow: row wrap; align-items: center; gap: 8px; }
:root[data-ui-theme] #app :is(.actor > div, .top-actions > .actor > div) { border: 0; padding: 0; }
:root[data-ui-theme] #app .actor > div > strong { font-size: 12px; }
:root[data-ui-theme] #app .topbar :is(.btn, .page-help-controls .btn) { width: auto; min-height: 32px; padding: 6px 9px; font-size: 11px; color: var(--precision-muted); border-color: var(--precision-border); background: var(--precision-surface); }
:root[data-ui-theme] #app .topbar .page-help-controls { display: flex; gap: 5px; }
:root[data-ui-theme] #app [data-shell-collapsed="true"] .app-nav a { font-size: 0; padding: 9px; gap: 0; }
:root[data-ui-theme] #app [data-shell-collapsed="true"] .topbar :is(.brand-copy, .actor > div) { display: block; }
:root[data-ui-theme] #app [data-shell-collapsed="true"] :is([data-page-guide], [data-action="sign-out"], [data-action="signout"])::before { content: none; }
:root[data-ui-theme] #app .local-dev-marker { color: var(--precision-muted); border-color: var(--precision-border); background: var(--precision-raised); font-size: 9px; padding: 4px 6px; }
:root[data-ui-theme] #app .tenant-lock { color: var(--precision-muted); border-color: var(--precision-border); border-radius: 6px; }
:root[data-ui-theme] #app .tenant-lock::before { background: var(--precision-accent); }
:root[data-ui-theme] #app :is(.page, .home-page, .operations-page, .process-page, .administration-page) { width: min(1440px, calc(100% - 56px)); margin: 0 auto; padding: 28px 0 56px; flex: 1; }
:root[data-ui-theme] #app h1 { font-size: 28px; font-weight: 650; letter-spacing: -.035em; line-height: 1.2; }
:root[data-ui-theme] #app h2 { font-size: 18px; font-weight: 650; letter-spacing: -.02em; }
:root[data-ui-theme] #app :is(.heading, .process-heading, .administration-heading) { margin-bottom: 20px; gap: 16px; }
:root[data-ui-theme] #app .breadcrumbs { margin: 0 0 16px; font-size: 11px; font-weight: 500; }
:root[data-ui-theme] #app :is(.eyebrow, .home-command-eyebrow) { color: var(--precision-muted); font-size: 10px; font-weight: 650; letter-spacing: .07em; }
:root[data-ui-theme] #app :is(.muted, .sub, .breadcrumbs, .breadcrumbs [aria-current], .field-hint, .metric span) { color: var(--precision-muted); }
:root[data-ui-theme] #app :is(.panel, .metric, .home-panel, .admin-card, .runtime-overview, .process-nav, .process-panel, .login-card, dialog) { border-radius: 8px; box-shadow: none; }
:root[data-ui-theme] #app :is(.panel-head, .admin-card-head, .process-panel-head) { padding: 16px 18px; background: var(--precision-surface); }
:root[data-ui-theme] #app :is(.panel-body, .admin-card-body, .process-panel-body) { padding: 18px; }
:root[data-ui-theme] #app .btn { border-radius: 6px; min-height: 36px; font-size: 12px; font-weight: 600; padding: 8px 12px; box-shadow: none; text-decoration: none; }
:root[data-ui-theme] #app .btn-primary { color: var(--precision-on-accent); background: var(--precision-accent); border-color: var(--precision-accent); }
:root[data-ui-theme] #app .btn-secondary { color: var(--precision-text); background: var(--precision-surface); border-color: var(--precision-border); }
:root[data-ui-theme] #app .btn:hover:not(:disabled) { filter: brightness(.96); }
:root[data-ui-theme] #app :is(input, select, textarea) { color: var(--precision-text); background: var(--precision-surface); border-color: var(--precision-border); border-radius: 6px; font-size: 13px; }
:root[data-ui-theme] #app :is(input, select) { min-height: 36px; }
:root[data-ui-theme] #app label { color: var(--precision-muted); font-size: 12px; }
:root[data-ui-theme] #app table { font-size: 12px; }
:root[data-ui-theme] #app th { background: var(--precision-raised); color: var(--precision-muted); font-size: 10px; letter-spacing: .04em; padding: 10px 12px; }
:root[data-ui-theme] #app td { padding: 12px; border-color: var(--precision-border); }
:root[data-ui-theme] #app .tabs { border-color: var(--precision-border); gap: 12px; margin: 18px 0; overflow-x: auto; }
:root[data-ui-theme] #app .tab { color: var(--precision-muted); font-size: 12px; padding: 10px 4px; white-space: nowrap; border-bottom-width: 2px; }
:root[data-ui-theme] #app .tab:is([aria-selected="true"], [aria-pressed="true"]) { color: var(--precision-accent); border-color: var(--precision-accent); }
:root[data-ui-theme] #app :is(.metric, .admin-status, .effective-control) { padding: 14px; border-radius: 6px; }
:root[data-ui-theme] #app .metric strong { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
:root[data-ui-theme] #app :is(.routing-command-bar, .routing-context, .routing-workspace-tabs button, .foundation-card, .foundation-empty-state, .config-map-card, .editor-panel, .nested-editor, .area-card, .feature-controls, .activation-comparison > div, .assignment-editor) { border-radius: 6px; box-shadow: none; }
:root[data-ui-theme] #app :is(.foundation-card-link:hover, .area-card:hover) { transform: none; border-color: var(--precision-accent); box-shadow: none; }
:root[data-ui-theme] #app .routing-workspace-tabs button[aria-pressed="true"] { color: var(--precision-accent); border-color: var(--precision-accent); background: var(--precision-selected); }
:root[data-ui-theme] #app .process-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 18px; }
:root[data-ui-theme] #app .process-nav button { color: var(--precision-muted); font-size: 12px; font-weight: 600; background: var(--precision-surface); }
:root[data-ui-theme] #app .process-nav button:is([aria-current="page"], [aria-pressed="true"]) { color: var(--precision-accent); background: var(--precision-selected); border-left-color: var(--precision-accent); }
:root[data-ui-theme] #app :is(.selection-label, .card-link-label, .config-map-meta span, .technical-details summary, .card-technical summary, .profile-instructions summary, .foundation-card .card-guidance a, .process-context-line) { color: var(--precision-accent); }
:root[data-ui-theme] #app :is(.panel-accent-queue, .panel-accent-detail) { border: 1px solid var(--precision-border); border-radius: 8px; box-shadow: none; }
:root[data-ui-theme] #app :is(.ops-filters-panel, .dispatch-filters-panel) { border-radius: 8px; box-shadow: none; }
:root[data-ui-theme] #app :is(.exception-list-link, .review-package-link, .processing-job-link, .dispatch-row-link) { border-radius: 5px; }
:root[data-ui-theme] #app :is(.exception-list-link, .review-package-link, .processing-job-link, .dispatch-row-link)[aria-pressed="true"] { color: var(--precision-text); border-color: var(--precision-accent); background: var(--precision-selected); box-shadow: inset 3px 0 var(--precision-accent); }
:root[data-ui-theme] #app .operational-status-footer { margin-top: auto; background: var(--precision-surface); border-color: var(--precision-border); color: var(--precision-muted); }
:root[data-ui-theme] #app .operational-status-title { color: var(--precision-text); }
:root[data-ui-theme] .ui-version { color: var(--precision-muted); border-color: var(--precision-border); background: var(--precision-surface); box-shadow: none; border-radius: 6px; }
:root[data-ui-theme] .ui-version-row[aria-current="true"] { color: var(--precision-accent); }
:root[data-ui-theme] #app .login { background: var(--precision-canvas); }
:root[data-ui-theme] #app .login-card { padding: 28px; }
:root[data-ui-theme] #app dialog::backdrop { background: rgba(10, 18, 31, .6); }
:root[data-ui-theme] #app :is(.help-panel, .help-shortcut, .page-guide-bubble) { border-color: var(--precision-border); border-radius: 6px; }
:root[data-ui-theme] #app .page-guide-marker { background: var(--precision-accent); color: var(--precision-on-accent); }
:root[data-ui-theme] #app .page-guide-bubble strong { color: var(--precision-accent); }
/* Home: an action list and one detail surface, with secondary evidence below. */
:root[data-ui-theme] #app .home-stage { gap: 18px; }
:root[data-ui-theme] #app .home-command-hero { min-height: 0; padding: 0 0 4px; border: 0; border-radius: 0; box-shadow: none; color: var(--precision-text); background: transparent; }
:root[data-ui-theme] #app .home-command-copy h1 { margin: 6px 0 8px; color: var(--precision-text); }
:root[data-ui-theme] #app .home-command-copy p { max-width: 800px; color: var(--precision-muted); font-size: 13px; }
:root[data-ui-theme] #app .home-command-state:is(.is-alert, .is-ready) { min-width: 175px; padding: 12px 16px; border: 1px solid var(--precision-border); border-radius: 8px; background: var(--precision-surface); }
:root[data-ui-theme] #app .home-command-state strong { color: var(--precision-text); font-size: 32px; line-height: 1; background: var(--precision-raised); border-radius: 6px; }
:root[data-ui-theme] #app .home-command-state.is-alert strong { color: var(--precision-waiting); background: var(--precision-waiting-bg); }
:root[data-ui-theme] #app .home-command-state b { color: var(--precision-text); font-size: 12px; }
:root[data-ui-theme] #app .home-command-state span { color: var(--precision-muted); font-size: 11px; }
:root[data-ui-theme] #app .home-command-metrics { gap: 0; overflow: hidden; border: 1px solid var(--precision-border); border-radius: 8px; background: var(--precision-surface); }
:root[data-ui-theme] #app .home-command-metric { padding: 14px 18px; border: 0; border-right: 1px solid var(--precision-border); border-radius: 0; background: transparent; }
:root[data-ui-theme] #app .home-command-metric:last-child { border-right: 0; }
:root[data-ui-theme] #app .home-command-metric strong { color: var(--precision-text); font-size: 25px; font-weight: 600; font-variant-numeric: tabular-nums; }
:root[data-ui-theme] #app .home-command-metric :is(span, em) { color: var(--precision-muted); font-size: 11px; }
:root[data-ui-theme] #app .home-command-metric.is-action strong { color: var(--precision-waiting); }
:root[data-ui-theme] #app .home-command-grid { display: flex; flex-direction: column; align-items: stretch; gap: 18px; }
:root[data-ui-theme] #app .home-command-section-head { padding: 16px 18px; }
:root[data-ui-theme] #app .home-command-section-head h2 { margin-top: 4px; font-size: 18px; }
:root[data-ui-theme] #app .home-command-section-head p { color: var(--precision-muted); font-size: 12px; }
:root[data-ui-theme] #app .home-filter-group { gap: 6px; padding: 0 18px 14px; margin: 0; }
:root[data-ui-theme] #app .home-filter-chip { color: var(--precision-muted); border: 1px solid var(--precision-border); border-radius: 6px; background: var(--precision-surface); padding: 7px 10px; font-size: 12px; }
:root[data-ui-theme] #app .home-filter-chip span { color: inherit; background: var(--precision-raised); border-radius: 4px; }
:root[data-ui-theme] #app .home-filter-chip.is-active { color: var(--precision-accent); border-color: var(--precision-accent); background: var(--precision-selected); }
.home-review-workspace { display: grid; grid-template-columns: minmax(260px, .85fr) minmax(0, 1.65fr); border-top: 1px solid var(--precision-border); }
.home-action-list-shell { min-width: 0; border-right: 1px solid var(--precision-border); }
.home-action-list-head { padding: 12px 16px; border-bottom: 1px solid var(--precision-border); color: var(--precision-muted); background: var(--precision-raised); font-size: 10px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; }
.home-action-list { max-height: 600px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.home-action-list li { margin: 0; }
:root[data-ui-theme] #app .home-action-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; min-height: 82px; padding: 12px 14px; text-align: left; color: var(--precision-text); background: var(--precision-surface); border: 0; border-bottom: 1px solid var(--precision-border); border-radius: 0; cursor: pointer; }
:root[data-ui-theme] #app .home-action-list li:last-child .home-action-row { border-bottom: 0; }
:root[data-ui-theme] #app .home-action-row:hover { background: var(--precision-raised); }
:root[data-ui-theme] #app .home-action-row[aria-pressed="true"] { background: var(--precision-selected); box-shadow: inset 4px 0 var(--precision-accent); }
.home-action-icon { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; color: var(--precision-accent); }
.home-action-icon svg { width: 26px; height: 26px; }
.home-action-copy { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.home-action-row strong { font-size: 13px; line-height: 1.4; }
.home-action-meta { display: flex; justify-content: space-between; gap: 12px; font-size: 10px; color: var(--precision-muted); }
.home-action-reason { display: -webkit-box; overflow: hidden; color: var(--precision-muted); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.home-action-age { align-self: center; color: var(--precision-muted); font: 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.home-action-detail { min-width: 0; }
:root[data-ui-theme] #app .home-action-detail .home-next-action { display: flex; flex-direction: column; align-items: stretch; gap: 24px; margin: 0; padding: 24px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
:root[data-ui-theme] #app .home-next-kicker span { color: var(--precision-muted); }
:root[data-ui-theme] #app .home-next-kicker em { color: var(--precision-waiting); background: var(--precision-waiting-bg); border-radius: 4px; }
:root[data-ui-theme] #app .home-next-copy h2 { margin-top: 16px; font-size: 22px; color: var(--precision-text); }
:root[data-ui-theme] #app .home-next-copy p { color: var(--precision-muted); font-weight: 400; font-size: 14px; line-height: 1.65; }
:root[data-ui-theme] #app .home-next-actions { align-items: flex-start; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; gap: 14px; }
:root[data-ui-theme] #app :is(.home-next-meta, .home-job-secondary) { color: var(--precision-muted); font-size: 12px; }
:root[data-ui-theme] #app .home-impact-preview { color: var(--precision-text); background: var(--precision-raised); border: 1px solid var(--precision-border); border-radius: 6px; }
:root[data-ui-theme] #app .home-impact-preview :is(strong, span) { color: inherit; }
:root[data-ui-theme] #app .home-command-sidebar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 18px; }
:root[data-ui-theme] #app .home-mini-track { background: var(--precision-raised); }
:root[data-ui-theme] #app .home-mini-track i { background: var(--precision-accent); }
:root[data-ui-theme] #app :is(.home-mini-stage, .home-owner-signal p, .home-account-row span, .home-sample-note, .home-live-badge, .home-footer) { color: var(--precision-muted); }
:root[data-ui-theme] #app :is(.home-live-badge, .home-sample-note, .home-owner-signal) { background: var(--precision-raised); border-color: var(--precision-border); border-radius: 5px; }
:root[data-ui-theme] #app .home-account-row { grid-template-columns: minmax(0, 1fr) auto auto; border-color: var(--precision-border); }
:root[data-ui-theme] #app .home-account-row > b { grid-column: 1 / -1; justify-self: start; }
:root[data-ui-theme] #app .home-job-card { border-radius: 6px; box-shadow: none; }
:root[data-ui-theme] #app .home-queue-clear { color: var(--precision-muted); background: transparent; border-top: 1px solid var(--precision-border); padding: 12px 18px; }
:root[data-ui-theme] #app .home-system-note { background: var(--precision-raised); border-color: var(--precision-border); color: var(--precision-muted); border-radius: 6px; }
:root[data-ui-theme] #app .home-system-note a { color: var(--precision-accent); }
:root[data-ui-theme] #app .home-needs-panel { padding: 0; }
:root[data-ui-theme] #app .home-command-metric.is-action { background: transparent; }
:root[data-ui-theme] #app .home-command-metric.is-action::before { display: none; }
:root[data-ui-theme] #app .home-command-metrics { box-shadow: none; }
:root[data-ui-theme] #app .home-queue-clear { margin: 0; }
:root[data-ui-theme] #app .home-command-hero .home-command-eyebrow { color: var(--precision-muted); }
/* Keep page-specific labels and structural notices within the same hierarchy. */
:root[data-ui-theme] #app :is(.process-page, .operations-page) .eyebrow { color: var(--precision-muted); }
:root[data-ui-theme] #app .authority-context { border-radius: 8px; margin-bottom: 18px; }
:root[data-ui-theme] #app .authority-context > p { padding: 0 16px; font-size: 12px; }
:root[data-ui-theme] #app .authority-context-head { padding-top: 12px; }
:root[data-ui-theme] #app .process-context-line { font-size: 13px; }
:root[data-ui-theme] #app .runtime-status-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
:root[data-ui-theme] #app .home-status-bar { border-radius: 8px; padding: 20px; }
:root[data-ui-theme] #app .home-empty-clear { border-radius: 8px; padding: 24px; }

/* Dark Precision: one hierarchy across every protected surface. */
:root[data-ui-theme="dark"] #app .topbar { background: #121925; }
:root[data-ui-theme="dark"] #app :is(.panel, .home-panel, .process-nav, .process-panel, .routing-command-bar, .routing-context) {
  border-color: var(--precision-border);
  background: var(--precision-surface);
}
:root[data-ui-theme="dark"] #app :is(.panel-head, .process-panel-head, .home-action-list-head, th) {
  border-color: var(--precision-border);
  background: var(--precision-raised);
}
:root[data-ui-theme="dark"] #app :is(.eyebrow, .home-command-eyebrow, .home-next-kicker span) { color: var(--precision-muted); }
:root[data-ui-theme="dark"] #app :is(.app-nav a[aria-current="page"], .home-filter-chip.is-active) {
  color: #c6d7ff;
  border-color: #5879b8;
  background: var(--precision-selected);
}
:root[data-ui-theme="dark"] #app .home-action-row:hover { background: #1e2939; }
:root[data-ui-theme="dark"] #app .home-action-row[aria-pressed="true"] {
  background: var(--precision-selected);
  box-shadow: inset 4px 0 #a9c3ff;
}
:root[data-ui-theme="dark"] #app .home-action-row[aria-pressed="true"] .home-action-icon { color: #c6d7ff; }
:root[data-ui-theme="dark"] #app .home-impact-preview { background: #1c2635; }
:root[data-ui-theme="dark"] #app :is(.safety-banner, .review-safety, .review-guardrails, .briefing-safety) {
  color: #c8d8f8;
  border-color: var(--precision-info-border);
  background: var(--precision-info-bg);
}
:root[data-ui-theme="dark"] #app :is(.status-chip, .badge) {
  color: var(--precision-muted);
  background: var(--precision-raised);
}
:root[data-ui-theme="dark"] #app :is(.review-success, .status-chip.succeeded, .status-chip.completed, .badge.active) {
  color: var(--precision-success);
  border-color: var(--precision-success-border);
  background: var(--precision-success-bg);
}
:root[data-ui-theme="dark"] #app :is(.status-chip.open, .status-chip.failed, .status-chip.dead_lettered, .badge.failed, .badge.reconciliation_required) {
  color: var(--precision-danger);
  border-color: var(--precision-danger-border);
  background: var(--precision-danger-bg);
}
:root[data-ui-theme="dark"] #app :is(.status-chip.running, .status-chip.queued, .badge.processing, .badge.queued, .badge.suspended, .badge.reserved) {
  color: #c6d7ff;
  background: var(--precision-info-bg);
}
:root[data-ui-theme="dark"] #app .operations-page .dispatch-quick-views { background: var(--precision-surface); }
:root[data-ui-theme="dark"] #app .operations-page .dispatch-quick-view {
  color: var(--precision-text);
  border-color: var(--precision-border);
  background: var(--precision-raised);
}
:root[data-ui-theme="dark"] #app .operations-page .dispatch-quick-view strong {
  color: #c6d7ff;
  background: var(--precision-info-bg);
}
:root[data-ui-theme="dark"] #app .operations-page .dispatch-quick-view[aria-pressed="true"] {
  color: #f5f8ff;
  border-color: #789bed;
  background: #2c4775;
  box-shadow: inset 3px 0 #b6cbff;
}
:root[data-ui-theme="dark"] #app .operations-page .dispatch-quick-view[aria-pressed="true"] strong {
  color: #18305a;
  background: #dce7ff;
}
:root[data-ui-theme="dark"] #app .tab-badge { color: #c6d7ff; background: var(--precision-info-bg); }
:root[data-ui-theme="dark"] #app .tab-badge.danger { color: var(--precision-danger); background: var(--precision-danger-bg); }
:root[data-ui-theme="dark"] #app .authority-context {
  color: #c8d8f8;
  border-color: var(--precision-info-border);
  background: var(--precision-info-bg);
}
:root[data-ui-theme="dark"] #app :is(.authority-context-summary, .authority-context-details > summary, .authority-context-note) { color: #c8d8f8; }
:root[data-ui-theme="dark"] #app :is(.authority-context-details, .authority-context-note) { border-color: var(--precision-info-border); }
:root[data-ui-theme="dark"] #app .authority-facts { background: var(--precision-info-border); }
:root[data-ui-theme="dark"] #app .authority-facts > div { background: var(--precision-info-bg); }
:root[data-ui-theme="dark"] #app .routing-workspace-tabs button:hover { border-color: #5879b8; background: #1e2939; }
:root[data-ui-theme="dark"] #app .routing-workspace-tabs button[aria-pressed="true"] {
  color: #c6d7ff;
  border-color: #789bed;
  background: var(--precision-selected);
  box-shadow: inset 3px 0 #b6cbff;
}
:root[data-ui-theme="dark"] #app .routing-empty-state > span {
  color: var(--precision-success);
  background: var(--precision-success-bg);
}
:root[data-ui-theme="dark"] #app .administration-page :is(.admin-status, .effective-control, .queue-state, .local-preview, .feature-controls-head, .activation-comparison > div, .area-card) {
  color: var(--precision-text);
  border-color: var(--precision-border);
  background: var(--precision-raised);
}
:root[data-ui-theme="dark"] #app .administration-page .runtime-next-action {
  color: var(--precision-text);
  border-left-color: var(--precision-success-border);
  background: var(--precision-success-bg);
}
:root[data-ui-theme="dark"] #app .administration-page .runtime-next-action small { color: var(--precision-muted); }
:root[data-ui-theme="dark"] #app .administration-page .runtime-next-action.attention {
  color: var(--precision-danger);
  border-left-color: var(--precision-danger-border);
  background: var(--precision-danger-bg);
}
:root[data-ui-theme="dark"] #app .administration-page .admin-status.status-healthy {
  border-color: var(--precision-success-border);
  background: var(--precision-success-bg);
}
:root[data-ui-theme="dark"] #app .administration-page .admin-status.status-danger {
  color: var(--precision-danger);
  border-color: var(--precision-danger-border);
  background: var(--precision-danger-bg);
}
:root[data-ui-theme="dark"] #app .administration-page .state-pill.enabled {
  color: var(--precision-success);
  background: var(--precision-success-bg);
}
:root[data-ui-theme="dark"] #app .administration-page .state-pill.disabled {
  color: var(--precision-danger);
  background: var(--precision-danger-bg);
}
:root[data-ui-theme="dark"] #app .administration-page .state-pill.unknown {
  color: var(--precision-waiting);
  background: var(--precision-waiting-bg);
}
:root[data-ui-theme="dark"] #app .administration-page .queue-state.blocked {
  color: var(--precision-waiting);
  border-left-color: #826b31;
  background: var(--precision-waiting-bg);
}
:root[data-ui-theme="dark"] #app .administration-page .area-card-disabled { background: #131a25; }
@media (max-width: 1100px) {
  :root[data-ui-theme] #app .topbar { gap: 12px; }
  :root[data-ui-theme] #app .runtime-status-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  :root[data-ui-theme] #app .topbar-left { flex-basis: 100%; }
  :root[data-ui-theme] #app .home-command-sidebar { grid-template-columns: 1fr 1fr; }
  :root[data-ui-theme] #app .home-customer-panel { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  :root[data-ui-theme] #app .topbar { padding: 12px 16px; }
  :root[data-ui-theme] #app .topbar-left { gap: 12px; }
  :root[data-ui-theme] #app .app-nav { flex-basis: 100%; order: 4; overflow-x: auto; }
  :root[data-ui-theme] #app .app-shell-collapse { display: none; }
  :root[data-ui-theme] #app .app-shell-preferences { margin-left: auto; }
  :root[data-ui-theme] #app [data-shell-collapsed="true"] .app-nav a { font-size: 12px; gap: 8px; }
  :root[data-ui-theme] #app .local-dev-marker { display: none; }
  :root[data-ui-theme] #app :is(.page, .home-page, .operations-page, .process-page, .administration-page) { width: calc(100% - 32px); padding-top: 20px; }
  :root[data-ui-theme] #app h1 { font-size: 25px; }
  :root[data-ui-theme] #app .runtime-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :root[data-ui-theme] #app .home-command-hero { align-items: stretch; flex-direction: column; gap: 16px; }
  :root[data-ui-theme] #app .home-command-state:is(.is-alert, .is-ready) { min-width: 0; }
  :root[data-ui-theme] #app .home-command-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :root[data-ui-theme] #app .home-command-metric { border-bottom: 1px solid var(--precision-border); }
  .home-review-workspace { grid-template-columns: minmax(0, 1fr); }
  .home-action-list-shell { border-right: 0; border-bottom: 1px solid var(--precision-border); }
  .home-action-list { max-height: 360px; }
  :root[data-ui-theme] #app .home-action-detail .home-next-action { padding: 18px; }
  :root[data-ui-theme] #app :is(.home-command-sidebar, .process-layout, .administration-grid) { grid-template-columns: minmax(0, 1fr); }
  :root[data-ui-theme] #app .process-nav { position: static; }
  :root[data-ui-theme] #app .home-customer-panel { grid-column: auto; }
}
