/* Shared AET presentation tokens. Dark preserves the existing palette. */
:root {
  color-scheme: dark;
  --aet-page: #101418;
  --aet-surface: #181e24;
  --aet-surface-secondary: #202830;
  --aet-text: #eef2f5;
  --aet-muted: #9da8b3;
  --aet-border: #35404b;
  --aet-accent: #4da3ff;
  --aet-link: #7dbdff;
  --aet-input: #11171c;
  --aet-inset: #141a20;
  --aet-hover: #263d52;
  --aet-nav-surface: #111827;
  --aet-primary: #2563eb;
  --aet-primary-border: #3b82f6;
  --aet-technical-border: #334155;
  --aet-inspector: #020617;
  --aet-chip: #1e293b;
  --aet-status-surface: #172554;
  --aet-status-text: #bfdbfe;
  --aet-slate-muted: #94a3b8;
  --aet-slate-border: #64748b;
  --aet-slate-text: #cbd5e1;
  --aet-notice: #0b1220;
  --aet-engineering-active: #1c3447;
  --aet-engineering-accent: #6fa7d0;
  --aet-engineering-border: #293b4a;
  --aet-tag-border: #53697a;
  --aet-success-border: #5d9c72;
  --aet-warning-border: #b18a50;
  --aet-error-border: #ad665d;
  --aet-graph: #0a1016;
  --aet-engineering-muted: #9db0bf;
  --aet-flow-border: #40586b;
  --aet-flow-surface: #101b24;
  --aet-arrow: #8fa6b8;
  --aet-learn-border: #547f9d;
  --aet-source-text: #a9bac7;
  --aet-surface-inset: #14191e;
  --aet-surface-deep: #151b21;
  --aet-surface-low: #171d22;
  --aet-surface-raised: #1b2228;
  --aet-surface-result: #1b232b;
  --aet-border-soft: #2d3740;
  --aet-border-blue: #2f4658;
  --aet-border-emphasis: #2f5d7c;
  --aet-border-card: #303941;
  --aet-border-panel: #33404a;
  --aet-border-action: #3d6d91;
  --aet-border-control: #45515b;
  --aet-info-border: #4f88ad;
  --aet-success-edge: #4f8a65;
  --aet-border-muted: #5f7488;
  --aet-secondary-label: #8fa4b8;
  --aet-success-text: #8fd19e;
  --aet-warning-edge: #927644;
  --aet-text-subtle: #9aa7b2;
  --aet-text-caption: #9fb5c5;
  --aet-text-secondary: #aeb8c0;
  --aet-text-label: #b8c5cf;
  --aet-error-text: #e6a0a0;
  --aet-on-primary: #fff;
  --aet-shadow: rgba(0,0,0,.18);
  --aet-engineering-surface: rgba(10,16,22,.5);
  --aet-wheel-surface: rgba(100,116,139,.14);
  --aet-upgrade-surface: rgba(15,23,42,.72);
  --aet-technical-surface: rgba(18,27,36,.55);
  --aet-wash-low: rgba(255,255,255,.018);
  --aet-wash: rgba(255,255,255,.025);
  --aet-wash-strong: rgba(255,255,255,.08);
}
:root[data-aet-theme="light"] {
  color-scheme: light;
  --aet-page: #f4f7fa;
  --aet-surface: #ffffff;
  --aet-surface-secondary: #eaf0f5;
  --aet-text: #18232d;
  --aet-muted: #52616f;
  --aet-border: #a5b4c2;
  --aet-accent: #1663ad;
  --aet-link: #145c9e;
  --aet-input: #ffffff;
  --aet-inset: #edf3f8;
  --aet-hover: #dcebf7;
  --aet-nav-surface: #eaf0f5;
  --aet-primary: #1d4ed8;
  --aet-primary-border: #2563eb;
  --aet-technical-border: #93a4b5;
  --aet-inspector: #eaf0f5;
  --aet-chip: #dfe8f0;
  --aet-status-surface: #dbeafe;
  --aet-status-text: #1e40af;
  --aet-slate-muted: #526477;
  --aet-slate-border: #64748b;
  --aet-slate-text: #334155;
  --aet-notice: #eaf2fb;
  --aet-engineering-active: #dcecf6;
  --aet-engineering-accent: #37688c;
  --aet-engineering-border: #98adbd;
  --aet-tag-border: #627d91;
  --aet-success-border: #37774b;
  --aet-warning-border: #8a642b;
  --aet-error-border: #a13f35;
  --aet-graph: #0a1016;
  --aet-engineering-muted: #526878;
  --aet-flow-border: #819caf;
  --aet-flow-surface: #e4edf4;
  --aet-arrow: #526b7d;
  --aet-learn-border: #456f8c;
  --aet-source-text: #4a6375;
  --aet-surface-inset: #eef3f7;
  --aet-surface-deep: #e9f0f5;
  --aet-surface-low: #f0f4f7;
  --aet-surface-raised: #edf2f6;
  --aet-surface-result: #e6eff6;
  --aet-border-soft: #aab9c6;
  --aet-border-blue: #7894a9;
  --aet-border-emphasis: #456f8c;
  --aet-border-card: #a0b2c0;
  --aet-border-panel: #9aaebb;
  --aet-border-action: #37688c;
  --aet-border-control: #8c9fae;
  --aet-info-border: #3b6e8f;
  --aet-success-edge: #37774b;
  --aet-border-muted: #687f91;
  --aet-secondary-label: #526878;
  --aet-success-text: #236a37;
  --aet-warning-edge: #8a642b;
  --aet-text-subtle: #52616f;
  --aet-text-caption: #4a6375;
  --aet-text-secondary: #495e6d;
  --aet-text-label: #3e5566;
  --aet-error-text: #9d2d2d;
  --aet-on-primary: #fff;
  --aet-shadow: rgba(0,0,0,.12);
  --aet-engineering-surface: #f1f5f8;
  --aet-wheel-surface: rgba(100,116,139,.14);
  --aet-upgrade-surface: #f1f5f9;
  --aet-technical-surface: #eaf1f7;
  --aet-wash-low: rgba(22,63,96,.025);
  --aet-wash: rgba(22,63,96,.04);
  --aet-wash-strong: rgba(22,63,96,.09);
}

.aet-theme-bar { max-width:1100px; margin:0 auto; padding:8px 20px; display:flex; justify-content:flex-end; }
.aet-theme-toggle { min-height:44px; padding:8px 14px; border:1px solid var(--aet-border); border-radius:10px; background:var(--aet-surface); color:var(--aet-text); font:600 14px Arial,Helvetica,sans-serif; cursor:pointer; }
.aet-theme-toggle:hover { background:var(--aet-hover); border-color:var(--aet-accent); }
:where(a,button,input,select,textarea):focus-visible { outline:3px solid var(--aet-accent); outline-offset:3px; }
input::placeholder,textarea::placeholder { color:var(--aet-muted); opacity:1; }
input:disabled,select:disabled,textarea:disabled,button:disabled { opacity:.65; cursor:not-allowed; }
input:user-invalid,select:user-invalid,textarea:user-invalid { border-color:var(--aet-error-border); }
/* Existing plotted labels and SVG artwork keep their technical dark backdrop. */
:root .canvas-wrap canvas { background:#020617; }
.eng-graph { background:#0a1016; }
:root[data-aet-theme="light"] .phase-nav button.active { color:var(--aet-on-primary); }
