/* TrustedAIGov www — light/dark theme layer (Pass 2B estate theming).
 *
 * Loaded AFTER site.css on every page. Defines the role tokens standalone (so
 * pages that don't link site.css still resolve them), then remaps them for dark.
 * Explicit user choice (html[data-theme], persisted by assets/js/theme.js) wins;
 * otherwise the OS preference applies. The navy hero/footer sections are dark in
 * BOTH themes by design — dark mode simply lets the light sections join them.
 */

:root {
  --page:#F5F3EE; --surface:#ffffff; --surface-2:#faf9f5; --border:#e6e2d9;
  --ink:#101725; --text-2:#5b6676; --text-3:#7a8494; --meta:#98a2b0;
  --accent:#4338CA; --accent-deep:#322aa6; --accent-tint:#edecfb; --accent-soft:#d6d3f6;
  color-scheme: light;
}

/* ---- dark values (one definition, applied two ways) --------------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page:#0E1120; --surface:#151A2C; --surface-2:#10152A;
    --border:rgba(232,231,240,.14);
    --ink:#E8E7F0; --text-2:#9AA0B5; --text-3:#8A90A8; --meta:#6B7188;
    --accent:#9B93FF; --accent-deep:#B4ADFF;
    --accent-tint:rgba(155,147,255,.14); --accent-soft:rgba(155,147,255,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page:#0E1120; --surface:#151A2C; --surface-2:#10152A;
  --border:rgba(232,231,240,.14);
  --ink:#E8E7F0; --text-2:#9AA0B5; --text-3:#8A90A8; --meta:#6B7188;
  --accent:#9B93FF; --accent-deep:#B4ADFF;
  --accent-tint:rgba(155,147,255,.14); --accent-soft:rgba(155,147,255,.35);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --page:#F5F3EE; --surface:#ffffff; --surface-2:#faf9f5; --border:#e6e2d9;
  --ink:#101725; --text-2:#5b6676; --text-3:#7a8494; --meta:#98a2b0;
  --accent:#4338CA; --accent-deep:#322aa6; --accent-tint:#edecfb; --accent-soft:#d6d3f6;
  color-scheme: light;
}

/* ---- base plumbing that must follow the tokens -------------------------- */
body { background: var(--page); color: var(--ink); }

/* ---- the theme toggle (injected by assets/js/theme.js) ------------------ */
.taig-theme-toggle {
  position: fixed; right: 18px; bottom: 18px; z-index: 999;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font: 600 12.5px/1 'IBM Plex Sans', system-ui, sans-serif;
  box-shadow: 0 4px 18px rgba(16, 23, 37, .14);
}
.taig-theme-toggle:hover { color: var(--ink); border-color: var(--accent-soft); }
.taig-theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .taig-theme-toggle { transition: color .15s, border-color .15s; }
}

/* ==== GENERATED: dark inline-style overrides (build_theme_dark.py) ==== */
:root[data-theme="dark"] [style*="--accent:#4338CA" i]{--accent:#9B93FF !important}
:root[data-theme="dark"] [style*="--accent-deep:#322aa6" i]{--accent-deep:#B4ADFF !important}
:root[data-theme="dark"] [style*="--accent-tint:#edecfb" i]{--accent-tint:rgba(155,147,255,.14) !important}
:root[data-theme="dark"] [style*="--accent-soft:#d6d3f6" i]{--accent-soft:rgba(155,147,255,.35) !important}
:root[data-theme="dark"] [style*="color: #7a8598" i]{color:#8A90A8 !important}
:root[data-theme="dark"] [style*="color: #3f4a5a" i]{color:#B4BCCC !important}
:root[data-theme="dark"] [style*="background: #ece9e1" i]{background:#161B32 !important}
:root[data-theme="dark"] [style*="border: 1px solid #ece9e1" i]{border:1px solid rgba(232,231,240,.14) !important}
:root[data-theme="dark"] [style*="background: #fbfaf7" i]{background:#10152A !important}
:root[data-theme="dark"] [style*="color: #2E7D5B" i]{color:#6FD39F !important}
:root[data-theme="dark"] [style*="border: 1px solid #ddd8cc" i]{border:1px solid rgba(232,231,240,.14) !important}
:root[data-theme="dark"] [style*="color: #3a4453" i]{color:#B4BCCC !important}
:root[data-theme="dark"] [style*="border-top:1px solid #ece9e1" i]{border-top:1px solid rgba(232,231,240,.14) !important}
:root[data-theme="dark"] [style*="color:#3f4a5a" i]{color:#B4BCCC !important}
:root[data-theme="dark"] [style*="border: 1px solid #e7e3d8" i]{border:1px solid rgba(232,231,240,.14) !important}
:root[data-theme="dark"] [style*="color: #3b4351" i]{color:#B4BCCC !important}
:root[data-theme="dark"] [style*="color: #4b5568" i]{color:#A8B0C2 !important}
:root[data-theme="dark"] [style*="color: #3a4152" i]{color:#B4BCCC !important}
:root[data-theme="dark"] [style*="color: #1e8a5b" i]{color:#6FD39F !important}
:root[data-theme="dark"] [style*="color: #4338CA" i]{color:#9B93FF !important}
:root[data-theme="dark"] [style*="background: #fbf3e6" i]{background:#2C2310 !important}
:root[data-theme="dark"] [style*="color: #B08430" i]{color:#D8AB5E !important}
:root[data-theme="dark"] [style*="border: 1px solid #f0e2c4" i]{border:1px solid #4A3B1C !important}
:root[data-theme="dark"] [style*="background: #eef0f3" i]{background:#1A2033 !important}
:root[data-theme="dark"] [style*="box-shadow: 0 0 0 5px #F5F3EE, 0 0 0 6px var(--accent-soft)" i]{box-shadow:0 0 0 5px #0E1120, 0 0 0 6px var(--accent-soft) !important}
:root[data-theme="dark"] [style*="box-shadow: 0 0 0 5px #F5F3EE, 0 0 0 6px #cde8d9" i]{box-shadow:0 0 0 5px #0E1120, 0 0 0 6px #1E4032 !important}
:root[data-theme="dark"] [style*="--ink:#101725" i]{--ink:#E8E7F0 !important}
:root[data-theme="dark"] [style*="--line:#e6e2d9" i]{--line:rgba(232,231,240,.14) !important}
:root[data-theme="dark"] [style*="border:1px solid #f0e2c4" i]{border:1px solid #4A3B1C !important}
:root[data-theme="dark"] [style*="background:#fbf3e6" i]{background:#2C2310 !important}
:root[data-theme="dark"] [style*="color:#7a5b1e" i]{color:#D8AB5E !important}
:root[data-theme="dark"] [style*="background:#FCFBF8" i]{background:#10152A !important}
:root[data-theme="dark"] [style*="background:linear-gradient(135deg, #edecfb, #f7f6fe)" i]{background:linear-gradient(135deg, #232849, #1B2036) !important}
:root[data-theme="dark"] [style*="color:#1c7a4f" i]{color:#6FD39F !important}
:root[data-theme="dark"] [style*="background: #efece4" i]{background:#131830 !important}
:root[data-theme="dark"] [style*="color:#6b7482" i]{color:#8F98AC !important}
:root[data-theme="dark"] [style*="background:#f3f1ea" i]{background:#131830 !important}
:root[data-theme="dark"] [style*="border-bottom:1px solid #eee9df" i]{border-bottom:1px solid rgba(232,231,240,.14) !important}
:root[data-theme="dark"] [style*="border-top:1px solid #f0ece2" i]{border-top:1px solid rgba(232,231,240,.14) !important}
:root[data-theme="dark"] [style*="color:#8a919c" i]{color:#8A90A8 !important}
:root[data-theme="dark"] [style*="border: 1px dashed #cfc9bd" i]{border:1px dashed rgba(232,231,240,.22) !important}
:root[data-theme="dark"] [style*="background: #EFEBE1" i]{background:#131830 !important}
:root[data-theme="dark"] [style*="border-top: 1px solid #e2ddd1" i]{border-top:1px solid rgba(232,231,240,.14) !important}
:root[data-theme="dark"] [style*="border-bottom: 1px solid #e2ddd1" i]{border-bottom:1px solid rgba(232,231,240,.14) !important}
:root[data-theme="dark"] [style*="border: 1px solid #e2ddd1" i]{border:1px solid rgba(232,231,240,.14) !important}
:root[data-theme="dark"] [style*="color: #1E6F5C" i]{color:#6FD39F !important}
:root[data-theme="dark"] [style*="background: #e8f1ee" i]{background:#14291F !important}
:root[data-theme="dark"] [style*="border: 1px solid #c5ddd6" i]{border:1px solid #1E4032 !important}
:root[data-theme="dark"] [style*="border-top: 1px solid #ece9e1" i]{border-top:1px solid rgba(232,231,240,.14) !important}
:root[data-theme="dark"] [style*="background: #eef1f5" i]{background:#1A2033 !important}
:root[data-theme="dark"] [style*="border-bottom: 1px solid #ece9e1" i]{border-bottom:1px solid rgba(232,231,240,.14) !important}
:root[data-theme="dark"] [style*="color: #1c7a4f" i]{color:#6FD39F !important}
:root[data-theme="dark"] [style*="color: #7a5b1e" i]{color:#D8AB5E !important}
:root[data-theme="dark"] [style*="color: #5a6474" i]{color:#9AA0B5 !important}
:root[data-theme="dark"] [style*="color:#4338CA" i]{color:#9B93FF !important}
:root[data-theme="dark"] [style*="border-bottom:1px solid #efece5" i]{border-bottom:1px solid rgba(232,231,240,.14) !important}
:root[data-theme="dark"] [style*="color:' + (r.ok ? '#4338CA' : '#98a2b0') + '" i]{color:' + (r.ok ? '#9B93FF' : '#98a2b0') + ' !important}
:root[data-theme="dark"] [style*="color: #2e7d5b" i]{color:#6FD39F !important}
:root[data-theme="dark"] [style*="color: #b08430" i]{color:#D8AB5E !important}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) [style*="--accent:#4338CA" i]{--accent:#9B93FF !important}
  :root:not([data-theme="light"]) [style*="--accent-deep:#322aa6" i]{--accent-deep:#B4ADFF !important}
  :root:not([data-theme="light"]) [style*="--accent-tint:#edecfb" i]{--accent-tint:rgba(155,147,255,.14) !important}
  :root:not([data-theme="light"]) [style*="--accent-soft:#d6d3f6" i]{--accent-soft:rgba(155,147,255,.35) !important}
  :root:not([data-theme="light"]) [style*="color: #7a8598" i]{color:#8A90A8 !important}
  :root:not([data-theme="light"]) [style*="color: #3f4a5a" i]{color:#B4BCCC !important}
  :root:not([data-theme="light"]) [style*="background: #ece9e1" i]{background:#161B32 !important}
  :root:not([data-theme="light"]) [style*="border: 1px solid #ece9e1" i]{border:1px solid rgba(232,231,240,.14) !important}
  :root:not([data-theme="light"]) [style*="background: #fbfaf7" i]{background:#10152A !important}
  :root:not([data-theme="light"]) [style*="color: #2E7D5B" i]{color:#6FD39F !important}
  :root:not([data-theme="light"]) [style*="border: 1px solid #ddd8cc" i]{border:1px solid rgba(232,231,240,.14) !important}
  :root:not([data-theme="light"]) [style*="color: #3a4453" i]{color:#B4BCCC !important}
  :root:not([data-theme="light"]) [style*="border-top:1px solid #ece9e1" i]{border-top:1px solid rgba(232,231,240,.14) !important}
  :root:not([data-theme="light"]) [style*="color:#3f4a5a" i]{color:#B4BCCC !important}
  :root:not([data-theme="light"]) [style*="border: 1px solid #e7e3d8" i]{border:1px solid rgba(232,231,240,.14) !important}
  :root:not([data-theme="light"]) [style*="color: #3b4351" i]{color:#B4BCCC !important}
  :root:not([data-theme="light"]) [style*="color: #4b5568" i]{color:#A8B0C2 !important}
  :root:not([data-theme="light"]) [style*="color: #3a4152" i]{color:#B4BCCC !important}
  :root:not([data-theme="light"]) [style*="color: #1e8a5b" i]{color:#6FD39F !important}
  :root:not([data-theme="light"]) [style*="color: #4338CA" i]{color:#9B93FF !important}
  :root:not([data-theme="light"]) [style*="background: #fbf3e6" i]{background:#2C2310 !important}
  :root:not([data-theme="light"]) [style*="color: #B08430" i]{color:#D8AB5E !important}
  :root:not([data-theme="light"]) [style*="border: 1px solid #f0e2c4" i]{border:1px solid #4A3B1C !important}
  :root:not([data-theme="light"]) [style*="background: #eef0f3" i]{background:#1A2033 !important}
  :root:not([data-theme="light"]) [style*="box-shadow: 0 0 0 5px #F5F3EE, 0 0 0 6px var(--accent-soft)" i]{box-shadow:0 0 0 5px #0E1120, 0 0 0 6px var(--accent-soft) !important}
  :root:not([data-theme="light"]) [style*="box-shadow: 0 0 0 5px #F5F3EE, 0 0 0 6px #cde8d9" i]{box-shadow:0 0 0 5px #0E1120, 0 0 0 6px #1E4032 !important}
  :root:not([data-theme="light"]) [style*="--ink:#101725" i]{--ink:#E8E7F0 !important}
  :root:not([data-theme="light"]) [style*="--line:#e6e2d9" i]{--line:rgba(232,231,240,.14) !important}
  :root:not([data-theme="light"]) [style*="border:1px solid #f0e2c4" i]{border:1px solid #4A3B1C !important}
  :root:not([data-theme="light"]) [style*="background:#fbf3e6" i]{background:#2C2310 !important}
  :root:not([data-theme="light"]) [style*="color:#7a5b1e" i]{color:#D8AB5E !important}
  :root:not([data-theme="light"]) [style*="background:#FCFBF8" i]{background:#10152A !important}
  :root:not([data-theme="light"]) [style*="background:linear-gradient(135deg, #edecfb, #f7f6fe)" i]{background:linear-gradient(135deg, #232849, #1B2036) !important}
  :root:not([data-theme="light"]) [style*="color:#1c7a4f" i]{color:#6FD39F !important}
  :root:not([data-theme="light"]) [style*="background: #efece4" i]{background:#131830 !important}
  :root:not([data-theme="light"]) [style*="color:#6b7482" i]{color:#8F98AC !important}
  :root:not([data-theme="light"]) [style*="background:#f3f1ea" i]{background:#131830 !important}
  :root:not([data-theme="light"]) [style*="border-bottom:1px solid #eee9df" i]{border-bottom:1px solid rgba(232,231,240,.14) !important}
  :root:not([data-theme="light"]) [style*="border-top:1px solid #f0ece2" i]{border-top:1px solid rgba(232,231,240,.14) !important}
  :root:not([data-theme="light"]) [style*="color:#8a919c" i]{color:#8A90A8 !important}
  :root:not([data-theme="light"]) [style*="border: 1px dashed #cfc9bd" i]{border:1px dashed rgba(232,231,240,.22) !important}
  :root:not([data-theme="light"]) [style*="background: #EFEBE1" i]{background:#131830 !important}
  :root:not([data-theme="light"]) [style*="border-top: 1px solid #e2ddd1" i]{border-top:1px solid rgba(232,231,240,.14) !important}
  :root:not([data-theme="light"]) [style*="border-bottom: 1px solid #e2ddd1" i]{border-bottom:1px solid rgba(232,231,240,.14) !important}
  :root:not([data-theme="light"]) [style*="border: 1px solid #e2ddd1" i]{border:1px solid rgba(232,231,240,.14) !important}
  :root:not([data-theme="light"]) [style*="color: #1E6F5C" i]{color:#6FD39F !important}
  :root:not([data-theme="light"]) [style*="background: #e8f1ee" i]{background:#14291F !important}
  :root:not([data-theme="light"]) [style*="border: 1px solid #c5ddd6" i]{border:1px solid #1E4032 !important}
  :root:not([data-theme="light"]) [style*="border-top: 1px solid #ece9e1" i]{border-top:1px solid rgba(232,231,240,.14) !important}
  :root:not([data-theme="light"]) [style*="background: #eef1f5" i]{background:#1A2033 !important}
  :root:not([data-theme="light"]) [style*="border-bottom: 1px solid #ece9e1" i]{border-bottom:1px solid rgba(232,231,240,.14) !important}
  :root:not([data-theme="light"]) [style*="color: #1c7a4f" i]{color:#6FD39F !important}
  :root:not([data-theme="light"]) [style*="color: #7a5b1e" i]{color:#D8AB5E !important}
  :root:not([data-theme="light"]) [style*="color: #5a6474" i]{color:#9AA0B5 !important}
  :root:not([data-theme="light"]) [style*="color:#4338CA" i]{color:#9B93FF !important}
  :root:not([data-theme="light"]) [style*="border-bottom:1px solid #efece5" i]{border-bottom:1px solid rgba(232,231,240,.14) !important}
  :root:not([data-theme="light"]) [style*="color:' + (r.ok ? '#4338CA' : '#98a2b0') + '" i]{color:' + (r.ok ? '#9B93FF' : '#98a2b0') + ' !important}
  :root:not([data-theme="light"]) [style*="color: #2e7d5b" i]{color:#6FD39F !important}
  :root:not([data-theme="light"]) [style*="color: #b08430" i]{color:#D8AB5E !important}
}
