/* Shared Graphite & Pearl shell. Personal dark/ocean choices remain explicit. */
html:not([data-theme=dark]):not([data-theme=ocean]){--panel:#fff;--soft:#f2f3f6;--muted:#596474;--border:#e1e4eb;color:#252932;background:#f6f6f9}
html:not([data-theme=dark]):not([data-theme=ocean]) :is(body,.admin-main){background:#f6f6f9;color:#252932}
html:not([data-theme=ocean]) :is(aside,.admin-side){background:radial-gradient(ellipse at 0 0,#32353c 0,transparent 55%),linear-gradient(165deg,#1c1e24,#101116 65%,#191b22);color:#f4f4f6;border-right:1px solid #41434b;box-shadow:inset -1px 0 #ffffff05}
:is(aside>strong,.admin-brand .logo){font-family:Georgia,'Times New Roman',serif!important;font-size:25px!important;letter-spacing:-.6px;font-weight:500!important;color:#fafafa!important}
html:not([data-theme=ocean]) :is(aside>strong:before,.admin-brand .logo:before){background:linear-gradient(140deg,#838595,#4f5363);box-shadow:0 1px 0 #ffffff55 inset}
:is(.admin-side p,.admin-nav small,aside>p,.admin-context span){color:#b7bac5!important}
html:not([data-theme=ocean]) :is(.admin-nav button,aside nav button){color:#e3e4ea;border:1px solid transparent;border-radius:11px;background:transparent;box-shadow:none;transition:background .15s,border-color .15s}
html:not([data-theme=ocean]) :is(.admin-nav button:hover,aside nav button:hover){background:#ffffff08;border-color:#ffffff13;box-shadow:none;filter:none}
html:not([data-theme=ocean]) :is(.admin-nav button.active,aside nav button[aria-current=page]){background:linear-gradient(100deg,#ffffff15,#ffffff09);border-color:#ffffff1b;box-shadow:inset 3px 0 #b5b7c4;color:#fff}
:is(.admin-nav button>span,.nav-icon){color:#bfc3ce!important}
:is(h1,#title,#adminViewTitle){font-family:Georgia,'Times New Roman',serif;font-weight:500;letter-spacing:-.9px;line-height:1.2}
h1{font-size:34px!important}:is(h2,h3){letter-spacing:-.35px}
html:not([data-theme=dark]):not([data-theme=ocean]) :is(.card,.case,.kpi,.metric-card,.customer-snapshot-card){background:#fff;border-color:#e1e4eb;border-radius:18px;box-shadow:0 2px 4px #20263404}
html:not([data-theme=dark]):not([data-theme=ocean]) :is(.muted,.admin-main p,.tracker-copy p,.result-count){color:#586579}
html:not([data-theme=dark]):not([data-theme=ocean]) :is(.execution-hero,.tracker-hero,.evidence-hero,.review-banner,.admin-welcome,.admin-health){background:#fff;color:#242936;border:1px solid #e1e4eb}
html:not([data-theme=dark]):not([data-theme=ocean]) :is(.execution-hero,.tracker-hero,.evidence-hero,.review-banner,.admin-welcome,.admin-health) :is(h2,strong){color:#252932}
html:not([data-theme=dark]):not([data-theme=ocean]) :is(.execution-hero,.tracker-hero,.evidence-hero,.review-banner,.admin-welcome,.admin-health) :is(p,small){color:#586579}
html:not([data-theme=dark]):not([data-theme=ocean]) .secondary{background:#fff;color:#343b48;border:1px solid #e0e3eb}
:is(.readiness-score,.tracker-gauge,.metric){font-family:Inter,'Segoe UI',system-ui,sans-serif!important;font-style:normal!important;font-variant-numeric:tabular-nums;font-weight:650}
.readiness-bar{height:7px;cursor:default;overflow:hidden}.readiness-bar :is(span:before,span:after),.tracker-progress span:after{display:none!important}
.admin-main{padding:36px 40px}.admin-topbar{gap:24px;align-items:flex-start;margin-bottom:28px}.admin-actions{margin-left:auto;align-items:center}.readiness-rows{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.readiness-row{min-width:0;border-radius:14px}.nexa-profile-menu{position:relative;margin-left:auto;min-width:110px}.nexa-profile-menu>summary{list-style:none;display:flex;align-items:center;gap:9px;border:1px solid var(--border,#ddd);border-radius:11px;padding:10px 14px;cursor:pointer;font-size:13px;background:var(--panel,#fff);color:inherit}.nexa-profile-menu>summary::-webkit-details-marker{display:none}.profile-initials{display:inline-grid;place-items:center;width:29px;height:29px;border-radius:50%;background:#68627d;color:#fff;font-weight:650}.profile-options{position:absolute;right:0;top:calc(100% + 8px);z-index:50;min-width:240px;background:var(--panel,#fff);border:1px solid var(--border,#ddd);border-radius:14px;padding:8px;box-shadow:0 14px 38px #1112;display:grid;gap:6px}.profile-options button{width:100%;text-align:left;margin:0!important}.profile-options .personal-clock{padding:8px}.nexa-profile-menu:focus-within>summary{outline-offset:3px}
.execution-hero{padding:28px}.execution-hero h2{font-size:27px;margin:12px 0}.execution-hero p{max-width:850px}.execution-form{margin:24px 0}.execution-form>button{margin:14px 12px 0 0}.execution-confirm{display:flex;gap:10px;align-items:flex-start;margin:20px 0}.execution-confirm input{width:auto!important}.execution-run{margin:16px 0}.execution-run>summary{list-style:none;display:flex;justify-content:space-between;gap:20px;align-items:center;cursor:pointer}.execution-run>summary small{display:block;margin-top:8px;color:var(--muted,#596474)}.execution-timeline{list-style:none;margin:26px 0;padding:0 0 0 18px;border-left:2px solid #dbdce5}.execution-timeline li{position:relative;padding:0 0 22px 8px}.execution-timeline li:before{content:'';position:absolute;left:-24px;top:5px;width:9px;height:9px;border-radius:50%;background:#737286;border:1px solid #fff}.execution-timeline p{margin:6px 0;line-height:1.65}.execution-timeline small{color:var(--muted,#596474)}.execution-transport{padding:18px;background:var(--soft,#f2f3f6);border-radius:12px}.execution-transport code{overflow-wrap:anywhere}.execution-recovery{padding:20px;border:1px solid #e5c8a0;background:var(--soft,#f8f5ed);border-radius:14px;margin:20px 0}.execution-recovery textarea{width:100%;min-height:95px;padding:12px;border:1px solid #cbd0da;border-radius:9px}.execution-recovery label{display:block;margin:14px 0}.execution-recovery input{width:auto!important}.execution-run pre{white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:1000px){.readiness-rows{grid-template-columns:1fr}.admin-main{padding:24px}}
@media(max-width:700px){.execution-run>summary{align-items:flex-start;flex-direction:column}.admin-topbar{flex-direction:column}.nexa-profile-menu{margin-left:0}.profile-options{left:0;right:auto}.admin-main{padding:18px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}

/* v1.33 · Executive sidebar, based on the right-hand reference. */
html:not([data-theme=ocean]) .admin-console .admin-side,
html:not([data-theme=ocean]) aside.nexa-sidebar{
 background:radial-gradient(ellipse at 100% 85%,#38434b55,transparent 48%),linear-gradient(115deg,#252b31 0%,#161d23 44%,#20262c 100%);
 border-right:1px solid #4c545c;box-shadow:inset -1px 0 #ffffff0b;color:#eeeef0;
}
.admin-console{grid-template-columns:256px minmax(0,1fr)}
.admin-console .admin-side{padding:32px 20px 22px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#68717a #20262c}
.nexa-sidebar .nexa-wordmark{display:flex!important;align-items:center;gap:12px;font-family:Georgia,'Times New Roman',serif!important;font-size:23px!important;line-height:1.02;font-weight:500!important;letter-spacing:-.65px}
.nexa-sidebar .nexa-wordmark:before{display:none!important}
.nexa-monogram{display:grid;place-items:center;width:43px;height:47px;flex:0 0 43px;border:1px solid #ffffff22;border-radius:10px;background:linear-gradient(140deg,#49535d66,#1b242c);box-shadow:inset 0 1px 0 #ffffff20,0 6px 14px #0002;color:#f4f5f6;font:29px Georgia,serif}
.admin-brand{padding:0 9px 25px;border-bottom:1px solid #ffffff20}
.admin-brand>p{font:8px/1.6 'Segoe UI',sans-serif!important;letter-spacing:2px;text-transform:uppercase;margin-top:18px!important}
.admin-context{margin:23px 10px 12px;gap:7px}
.admin-context span{font:7px/1.4 'Segoe UI',sans-serif;letter-spacing:1.5px;font-weight:500}
.admin-context strong{font:11px/1.5 'Segoe UI',sans-serif;font-weight:500}
.nexa-sidebar :is(nav.admin-nav,nav){margin:6px 0 20px;gap:6px}
html:not([data-theme=ocean]) .nexa-sidebar nav button{
 display:flex;align-items:center;gap:12px;min-height:52px;padding:8px 10px;margin:0;
 border:1px solid transparent;border-radius:11px;background:transparent;color:#edeff2;
 font:12px/1.4 'Segoe UI',system-ui,sans-serif;box-shadow:none;transform:none;text-align:left;
}
.nexa-sidebar nav button>div{min-width:0}
.nexa-sidebar .admin-nav button strong{font:11px/1.4 'Segoe UI',system-ui,sans-serif;font-weight:500}
.nexa-sidebar .admin-nav button small{font:9px/1.4 'Segoe UI',system-ui,sans-serif;margin-top:3px;color:#bdc4cb!important;font-weight:400}
html .nexa-sidebar nav button>.nav-icon{
 display:grid;place-items:center;align-self:center;flex:0 0 32px;width:32px;height:32px;
 padding:0;margin:0;border:1px solid transparent;border-radius:8px;line-height:0;
 background:transparent;color:#d2d8df!important;position:static;transform:none;
}
.nexa-sidebar .nav-icon svg{display:block;width:21px;height:21px;flex:none;margin:0;overflow:visible}
html:not([data-theme=ocean]) .nexa-sidebar nav button:hover{background:#ffffff07;border-color:#ffffff16;box-shadow:none;filter:none}
html:not([data-theme=ocean]) .nexa-sidebar nav button:is(.active,[aria-current=page]){
 background:linear-gradient(115deg,#606c7866,#8d99a033);border-color:#b6c3ce44;
 box-shadow:inset 0 1px 0 #ffffff13,0 6px 14px #0001;color:white;
}
html:not([data-theme=ocean]) .nexa-sidebar nav button:is(.active,[aria-current=page])>.nav-icon{
 background:linear-gradient(135deg,#9eaab32e,#7e8a9318);border-color:#d4dee815;color:#fff!important;
}
.nexa-sidebar nav button:focus-visible{outline:2px solid #d8e2ef;outline-offset:2px}
.sidebar-landscape{height:135px;min-height:95px;flex:1 0 95px;max-height:220px;background:url('/sidebar-mountains.svg') center bottom/100% auto no-repeat;margin:0 -20px 15px;opacity:.82;pointer-events:none}
.admin-privacy{padding:16px 8px 0;margin:0 9px;border:0;border-top:1px solid #ffffff25;border-radius:0;background:none}
.admin-privacy strong{color:#c0c6cd;font:10px/1.5 'Segoe UI',sans-serif;font-weight:400}
.admin-privacy p{font:9px/1.7 'Segoe UI',sans-serif!important;color:#b2bcc7!important}
aside.nexa-sidebar:not(.admin-side)>.sidebar-landscape{height:100px;min-height:100px;flex:none;margin-top:12px}
.admin-main :is(.readiness-row,.release-gate){padding:16px}
.admin-main .readiness-row{border:1px solid var(--border,#e1e4eb);align-items:flex-start}
.admin-main .readiness-row small{line-height:1.65;font-size:12px}
.admin-main .readiness-state{white-space:normal;flex-shrink:0;max-width:110px;text-align:center}
html:not([data-theme=dark]):not([data-theme=ocean]) .api-center{color:#24324b}
html:not([data-theme=dark]):not([data-theme=ocean]) .api-center :is(p,small){color:#536276}
@media(max-width:1100px){.admin-console{grid-template-columns:240px minmax(0,1fr)}.admin-console .admin-side{padding-left:14px;padding-right:14px}.sidebar-landscape{margin-left:-14px;margin-right:-14px}}
@media(max-width:780px){.admin-console{display:block}.admin-console .admin-side{height:auto;padding:20px}.admin-brand{padding:0 0 15px}.admin-brand>p{margin:10px 0 0!important}.admin-context,.admin-privacy,.sidebar-landscape{display:none}.nexa-sidebar .admin-nav{gap:6px}.admin-console .admin-side{overflow:visible}.nexa-wordmark{max-width:230px}}
html[data-theme=dark]{--panel:#1c293e;--soft:#26364b;--muted:#b9d1e7;--border:#374961}
html[data-theme=ocean]{--panel:#f3fffd;--soft:#e6f5f5;--muted:#456773;--border:#b9dcd5}

/* v1.34 · Theme color contracts. Each surface owns both background and text.
   Keep this after the legacy component styles. Specificity also protects it
   when preferences.css is loaded asynchronously after this stylesheet. */
html:root[data-theme] {
 --arve-page:#f6f6f9; --arve-panel:#ffffff; --arve-soft:#eef1f5;
 --arve-text:#252932; --arve-muted:#526074; --arve-border:#cbd2dc;
 --arve-link:#16636e; --arve-accent:#16636e;
 --arve-primary:#292d35; --arve-on-primary:#ffffff;
 --arve-focus:#6750a4;
 --arve-success-bg:#e1f3ea; --arve-success-fg:#185a43;
 --arve-warning-bg:#fff0d7; --arve-warning-fg:#734c13;
 --arve-error-bg:#fce7eb; --arve-error-fg:#8d273c;
 --arve-info-bg:#e7effb; --arve-info-fg:#254f80;
 --arve-planned-bg:#ede8f7; --arve-planned-fg:#554077;
 --panel:var(--arve-panel); --soft:var(--arve-soft);
 --muted:var(--arve-muted); --border:var(--arve-border);
 color-scheme:light; color:var(--arve-text); background:var(--arve-page);
}
html:root[data-theme=dark] {
 --arve-page:#11171f; --arve-panel:#1c2633; --arve-soft:#283547;
 --arve-text:#edf2f8; --arve-muted:#bcc9db; --arve-border:#52647b;
 --arve-link:#8ad9e4; --arve-accent:#8ad9e4;
 --arve-primary:#e3eaf3; --arve-on-primary:#1c2633;
 --arve-focus:#c6b5ff;
 --arve-success-bg:#173c30; --arve-success-fg:#b0ebca;
 --arve-warning-bg:#49351b; --arve-warning-fg:#ffe0a2;
 --arve-error-bg:#482630; --arve-error-fg:#ffc4ce;
 --arve-info-bg:#203953; --arve-info-fg:#c0ddff;
 --arve-planned-bg:#362d4e; --arve-planned-fg:#dfd2ff;
 color-scheme:dark;
}
html:root[data-theme=ocean] {
 --arve-page:#eaf5f3; --arve-panel:#f8fffd; --arve-soft:#deefeb;
 --arve-text:#173d43; --arve-muted:#3c6268; --arve-border:#9bbfba;
 --arve-link:#075b63; --arve-accent:#075b63;
 --arve-primary:#075b63; --arve-on-primary:#ffffff;
 --arve-focus:#5e4395;
}
html:root[data-theme] :is(body,.admin-main,.login-panel) {
 background:var(--arve-page); color:var(--arve-text);
}
html:root[data-theme] :is(main,.admin-main,dialog,.modal) {
 color:var(--arve-text);
}
html:root[data-theme] :is(main,.admin-main,dialog,.modal) :is(
 .card,.case,.kpi,.metric-card,.login-card,.snapshot-card,.customer-snapshot-card,
 .review-banner,.review-table-wrap,.review-detail,.policy-card,.support-matrix,
 .release-center,.write-design-center,.write-design-admin,.transport-governance-center,
 .mutation-sandbox-center,.dev-certification-center,.conformance-center,
 .sandbox-form,.sandbox-history,.certification-form,.certification-history,.certification-run,
 .matrix-contract-card,.remediation-evidence article,.evidence-boundaries article,
 .tenant-usage-tile,.release-stat,.promotion-step,.release-gate,.write-contract-stat,
 .hero,.command-hero,.journey-hero,.change-hero,.remediation-hero,.docs-hero,
 .team-hero,.governance-hero,.controls-hero,.connector-hero,.evidence-hero,
 .tracker-hero,.execution-hero,.admin-welcome,.admin-health,.api-center,
 .operations,.readiness-admin,.system-meta div,.message.agent
) { background:var(--arve-panel); color:var(--arve-text); border-color:var(--arve-border); }
html:root[data-theme] dialog {background:var(--arve-panel);color:var(--arve-text);border-color:var(--arve-border)}
html:root[data-theme] :is(main,.admin-main,dialog,.modal) :is(
 h1,h2,h3,h4,strong,b,label,legend,td,li,.metric,.readiness-score,.review-rationale
) {color:var(--arve-text)}
html:root[data-theme] :is(main,.admin-main,dialog,.modal) :is(p,.muted,small,.empty,.result-count,
 .fingerprint,.release-fingerprint,.metric-note,.snapshot-agent,.section-title p,
 .matrix-sources,.change-help,.steps span,#subtitle,.personal-clock) {color:var(--arve-muted)}
html:root[data-theme] :is(main,.admin-main,dialog,.modal) :is(.eyebrow,.journey-owner,.confidence,header>div>small) {color:var(--arve-accent)}
html:root[data-theme] .admin-main .admin-identity {color:var(--arve-muted)!important}
html:root[data-theme] :is(main,.admin-main,dialog,.modal) :is(a,summary) {color:var(--arve-link)}
html:root[data-theme] :is(main,.admin-main,dialog,.modal) :is(a:hover,summary:hover) {text-decoration:underline;text-underline-offset:3px}
html:root[data-theme] :is(main,.admin-main,dialog,.modal) :is(
 .journey-detail,.journey-flow-grid article,.journey-context span,.journey-number,
 .tracker-order,.engine-metric div,.docs-scope>div,.change-step,.evaluation-result,
 .api-stat,.api-boundary,.journey-gate,.write-boundary,.write-pipeline-step>span,
 .write-design-step>span,.write-identity-grid>div,.transport-gates>div,
 .certification-meta,.certification-controls label,.certification-gates>div,
 .certification-run code,.certification-recovery,.sandbox-approval,.conformance-report,
 .conformance-checks>div,.tenant-governance,.tenant-summary-stats div,.tenant-lifecycle,
 .customer-login-panel,.review-audit article,.decision-panel,.review-meta>div,
 .evidence-context,.evidence-proof,.evidence-seal,.connector-boundary,.policy-strip,
 .scenario-card,.remediation-item,.system-meta div
) {background:var(--arve-soft);color:var(--arve-text);border-color:var(--arve-border)}
html:root[data-theme] :is(main,.admin-main,dialog,.modal) :is(input,select,textarea,pre,code,th,.code-block) {
 background:var(--arve-soft);color:var(--arve-text);border-color:var(--arve-border);
}
html:root[data-theme] :is(main,.admin-main,dialog,.modal) input::placeholder,
html:root[data-theme] :is(main,.admin-main,dialog,.modal) textarea::placeholder {
 color:var(--arve-muted);opacity:1;
}
html:root[data-theme] :is(main,.admin-main,dialog,.modal) :is(input,textarea):read-only {color:var(--arve-muted)}
html:root[data-theme] :is(main,.admin-main,dialog,.modal) tbody tr:hover {background:var(--arve-soft)}
html:root[data-theme] :is(main,.admin-main,dialog,.modal) :is(td,th,fieldset,.insight-row) {border-color:var(--arve-border)}
/* Buttons set local text tokens so nested labels cannot inherit panel colors. */
html:root[data-theme] :is(main,.admin-main,dialog,.modal) button {
 --arve-text:var(--arve-on-primary);--arve-muted:var(--arve-on-primary);
 background:var(--arve-primary);color:var(--arve-on-primary);border-color:var(--arve-primary);
}
html:root[data-theme] :is(main,.admin-main,dialog,.modal) :is(button.secondary,.api-download,.customer-login-open) {
 --arve-text:var(--arve-link);--arve-muted:var(--arve-link);
 background:var(--arve-panel);color:var(--arve-link);border:1px solid var(--arve-border);
}
html:root[data-theme] :is(main,.admin-main,dialog,.modal) button.danger {
 --arve-text:var(--arve-error-fg);--arve-muted:var(--arve-error-fg);
 background:var(--arve-error-bg);color:var(--arve-error-fg);border:1px solid var(--arve-error-fg);
}
html:root[data-theme] :is(main,.admin-main,dialog,.modal) :is(button.remediation-item,button.launch-target) {
 --arve-text:inherit;--arve-muted:inherit;
 background:var(--arve-panel);color:var(--arve-text);border-color:var(--arve-border);
}
html:root[data-theme] :is(main,.admin-main,dialog,.modal) :is(button:hover,a:hover) {filter:none}
html:root[data-theme] :is(main,.admin-main,dialog,.modal) button:hover {box-shadow:0 0 0 2px var(--arve-border)}
html:root[data-theme] :is(main,.admin-main,dialog,.modal) :is(button:disabled,input:disabled,select:disabled,textarea:disabled) {
 --arve-text:inherit;--arve-muted:inherit;
 opacity:1;background:var(--arve-soft);color:var(--arve-muted);border:1px dashed var(--arve-border);cursor:not-allowed;box-shadow:none;
}
html:root[data-theme] :is(main,.admin-main,dialog,.modal) :is(button,input,select,textarea,a,summary):focus-visible {
 outline:3px solid var(--arve-focus);outline-offset:3px;
}
html:root[data-theme] :is(main,.admin-main,dialog,.modal) :is(.remediation-item.selected,.case.selected,.scenario-card:has(input:checked)) {
 border:2px solid var(--arve-accent);background:var(--arve-soft);color:var(--arve-text);
}
/* Neutral status base. Explicit status groups retain their meaning in every theme. */
html:root[data-theme] :is(main,.admin-main,dialog,.modal) :is(
 .tag,.journey-state,.change-pill,.remediation-status,.tracker-status,.readiness-state,
 .gate-state,.gate-status,.matrix-status,.launch-state,.overview-gate,.operation-stat,.outcome-banner
) {background:var(--arve-soft);color:var(--arve-text);border-color:var(--arve-border)}

html:root[data-theme] :is(main,.admin-main,dialog,.modal) :is(
 .tag:not(.warn):not(.info):not(.error):not(.suspended):not(.write-design),
 .journey-state.complete,
 .journey-state.complete_live_read,
 .journey-stage.complete .journey-number,
 .journey-stage.complete_live_read .journey-number,
 .change-pill.completed_simulated,
 .remediation-status.accepted_for_handoff,
 .remediation-status.handed_off,
 .tracker-status.complete,
 .readiness-state.complete,
 .gate-state.pass,
 .gate-status.PASS,
 .launch-state.pass,
 .overview-gate.pass,
 .release-ready,
 .operation-stat.succeeded,
 .outcome-banner.READ_READY,
 .matrix-status.pilot-eligible,
 .matrix-status.implemented,
 .matrix-status.approved-for-read-only-pilot,
 .matrix-status.harness-available,
 .matrix-status.harness-passed,
 .matrix-status.live-read-only-dev-pilot,
 .matrix-status.read-pilot-passed,
 .change-step.current,
 #inventoryStatus
) {
 --arve-text:var(--arve-success-fg);--arve-muted:var(--arve-success-fg);
 background:var(--arve-success-bg);color:var(--arve-success-fg);border-color:var(--arve-border);
}

html:root[data-theme] :is(main,.admin-main,dialog,.modal) :is(
 .tag.warn,
 .journey-state.action_required,
 .journey-state.blocked,
 .journey-stage.action_required .journey-number,
 .journey-stage.blocked .journey-number,
 .remediation-status.abstained,
 .tracker-status.partial,
 .readiness-state.partial,
 .gate-state.advisory,
 .gate-status.BLOCKED,
 .launch-state.action_required,
 .overview-gate.advisory,
 .operation-stat.queued,
 .matrix-status.conditional,
 .matrix-status.planned,
 .simulation-warning,
 .scope-banner,
 .change-warning,
 .tracker-boundary,
 .remediation-boundary,
 .execution-recovery,
 #status
) {
 --arve-text:var(--arve-warning-fg);--arve-muted:var(--arve-warning-fg);
 background:var(--arve-warning-bg);color:var(--arve-warning-fg);border-color:var(--arve-border);
}

html:root[data-theme] :is(main,.admin-main,dialog,.modal) :is(
 .tag.error,
 .tag.suspended,
 .change-pill.failed,
 .change-pill.conflict,
 .remediation-status.rejected,
 .gate-state.fail,
 .gate-status.FAIL,
 .overview-gate.blocked,
 .release-blocked,
 .operation-stat.failed,
 .outcome-banner.NOT_READY,
 .matrix-status.out-of-scope,
 .matrix-status.not-implemented,
 .matrix-status.prohibited,
 .error
) {
 --arve-text:var(--arve-error-fg);--arve-muted:var(--arve-error-fg);
 background:var(--arve-error-bg);color:var(--arve-error-fg);border-color:var(--arve-border);
}

html:root[data-theme] :is(main,.admin-main,dialog,.modal) :is(
 .tag.info,
 .tracker-status.validation-ready,
 .tracker-status.mostly-complete,
 .readiness-state.validation-ready,
 .readiness-state.mostly-complete,
 .operation-stat.running,
 .matrix-status.in-progress,
 .notice,
 .journey-help,
 .authorization-note,
 .certification-boundary,
 .transport-boundary,
 .role-summary span
) {
 --arve-text:var(--arve-info-fg);--arve-muted:var(--arve-info-fg);
 background:var(--arve-info-bg);color:var(--arve-info-fg);border-color:var(--arve-border);
}

html:root[data-theme] :is(main,.admin-main,dialog,.modal) :is(
 .tag.write-design,
 .journey-state.simulated,
 .journey-stage.simulated .journey-number,
 .change-pill.approved,
 .tracker-status.started,
 .tracker-status.early,
 .readiness-state.started,
 .readiness-state.early,
 .outcome-banner.WRITE_READY_SIMULATED,
 .sandbox-banner
) {
 --arve-text:var(--arve-planned-fg);--arve-muted:var(--arve-planned-fg);
 background:var(--arve-planned-bg);color:var(--arve-planned-fg);border-color:var(--arve-border);
}

/* Code changes keep readable foregrounds on their own added/removed surfaces. */
html:root[data-theme] :is(main,.admin-main) .review-code .diff-added td:nth-child(n+3) {background:var(--arve-success-bg);color:var(--arve-success-fg)}
html:root[data-theme] :is(main,.admin-main) .review-code .diff-removed td:nth-child(-n+2) {background:var(--arve-error-bg);color:var(--arve-error-fg)}
html:root[data-theme] :is(main,.admin-main) .change-diff {background:var(--arve-soft);color:var(--arve-text)}
html:root[data-theme] :is(main,.admin-main) .change-diff .added {background:var(--arve-success-bg);color:var(--arve-success-fg)}
html:root[data-theme] :is(main,.admin-main) .change-diff .removed {background:var(--arve-error-bg);color:var(--arve-error-fg)}
html:root[data-theme] :is(main,.admin-main) .tracker-gauge {
 color:var(--arve-text);
 background:radial-gradient(circle 43px,var(--arve-panel) 98%,transparent 100%),conic-gradient(var(--arve-accent) calc(var(--value)*1%),var(--arve-border) 0);
}
html:root[data-theme] :is(main,.admin-main) .message.user {--arve-text:#ffffff;--arve-muted:#e0edf6;background:#173c59;color:#ffffff}
html:root[data-theme] :is(main,.admin-main) .personal-clock {opacity:1}
html:root[data-theme] :is(main,.admin-main) .journey-hero:after {pointer-events:none;opacity:.3}
/* Stable header areas are independent of asynchronous identity/preferences loading. */
html body header.arve-header {
 display:grid;grid-template-columns:minmax(0,1fr) minmax(160px,320px);
 grid-template-rows:auto auto auto;gap:10px 24px;align-items:start;
}
.arve-header>.arve-header-title {grid-column:1;grid-row:1 / 3;min-width:0}
.arve-header>.nexa-profile-menu {grid-column:2;grid-row:1;justify-self:end;margin:0;min-width:0;max-width:100%}
.arve-header>.identity-box,.arve-header>.tag {grid-column:2;grid-row:2;justify-self:end;max-width:100%;min-width:0}
.arve-header>.identity-box .tag {white-space:normal;overflow-wrap:anywhere;text-align:right}
.arve-header>.personal-clock {grid-column:1 / -1;grid-row:3;margin:0;opacity:1;overflow-wrap:anywhere}
.arve-header>.admin-actions {grid-column:2;grid-row:2;justify-self:end}
.arve-header .profile-label {min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:240px}
.arve-header .profile-initials {flex:none}
html:root[data-theme] .arve-header .nexa-profile-menu>summary,
html:root[data-theme] .arve-header .profile-options {background:var(--arve-panel);color:var(--arve-text);border-color:var(--arve-border)}
@media(max-width:700px){
 html body header.arve-header {grid-template-columns:minmax(0,1fr);gap:12px}
 .arve-header>.arve-header-title {grid-column:1;grid-row:1}
 .arve-header>.nexa-profile-menu {grid-column:1;grid-row:2;justify-self:start}
 .arve-header>.identity-box,.arve-header>.tag,.arve-header>.admin-actions {grid-column:1;grid-row:3;justify-self:start}
 .arve-header>.identity-box .tag {text-align:left}
 .arve-header>.personal-clock {grid-column:1;grid-row:4}
 .arve-header .profile-options {min-width:min(260px,80vw)}
}
/* Preserve the graphite navigation, independently of workspace brightness. */
html:root[data-theme] :is(aside,.admin-side) {color:#edf2f7}
html:root[data-theme] :is(aside,.admin-side) :is(.agentSide,button.secondary) {background:#2c3742;color:#e0e7ef;border-color:#596776}
html:root[data-theme] :is(aside,.admin-side) :is(.agentSide p,.agentSide strong,#sideAgents>small) {color:#d0dce8}
@media(forced-colors:active) {
 html:root[data-theme] :is(main,.admin-main,dialog,.modal) :is(.card,.kpi,.case,button,a,input,select,textarea,pre,.tag,.journey-state,.tracker-gauge,.change-diff) {
  background:Canvas;color:CanvasText;border-color:CanvasText;forced-color-adjust:auto;
 }
 html:root[data-theme] :is(main,.admin-main,dialog,.modal) :focus-visible {outline-color:Highlight}
}

html:root[data-theme] .brand {background:linear-gradient(145deg,#17212b,#164954);color:#ffffff}
html:root[data-theme] .brand :is(h1,strong,.logo) {color:#ffffff}
html:root[data-theme] .brand :is(p,small) {color:#d8e8ef}

html:root[data-theme] :is(main,.admin-main,dialog,.modal) fieldset:disabled {opacity:1}
