/* Light theme — activated via <html data-theme="light"> (see theme-head partial). */
html[data-theme='light'] {
  color-scheme: light;
  --bg: #f0f2f5;
  --card: #ffffff;
  --line: rgba(0, 0, 0, 0.1);
  --blue: #1d4ed8;
  --muted: rgba(0, 0, 0, 0.55);
  /* Replaces light cyan/teal accent text in dark theme */
  --accent-teal-dark: #0f766e;
  --accent-teal-hover: #0d9488;
  /* Secondary “outline” buttons (account billing, etc.) */
  --btn-secondary-bg: #dbeafe;
  --btn-secondary-bg-hover: #bfdbfe;
  --btn-secondary-border: rgba(29, 78, 216, 0.38);
  --btn-secondary-text: #1e3a8a;
  --fg: #111827;
}

html[data-theme='light'] .app-body {
  color: #111827;
}

html[data-theme='light'] .app-sidebar,
html[data-theme='light'] .app-insight,
html[data-theme='light'] .app-chrome-header {
  background: #f9fafb;
}

html[data-theme='light'] .app-sidebar a,
html[data-theme='light'] .app-nav-section a {
  color: rgba(17, 24, 39, 0.85);
}

html[data-theme='light'] .app-nav-label {
  font-size: 13px;
  letter-spacing: 0.14em;
  outline: none;
}

html[data-theme='light'] .app-sidebar a:hover,
html[data-theme='light'] .app-nav-section a:hover {
  color: #111827;
}

html[data-theme='light'] .app-canvas h1,
html[data-theme='light'] .app-chrome-header__canvas h1 {
  color: #1d4ed8;
}
/* Foundry chrome title (“The Foundry”): navy in light mode; dark theme keeps blue (app-shell.css). */
html[data-theme='light'] .app-body--foundry .app-chrome-header__canvas h1 {
  color: #1e3a8a;
}
/* Crucible chrome title (“The Crucible”): navy in light mode; dark theme keeps blue (app-shell.css). */
html[data-theme='light'] .app-body--crucible .app-chrome-header__canvas h1 {
  color: #1e3a8a;
}
/* Source Quality page — chrome title (“Source Quality”); dark theme keeps blue (app-shell.css). */
html[data-theme='light'] .app-body--crucible-source-quality .app-chrome-header__canvas > h1#top {
  color: #1e3a8a;
}
html[data-theme='light'] .app-crucible-source-stage-lead {
  color: var(--accent-teal-dark);
}
html[data-theme='light'] .app-body--forged-provenance .app-canvas > h1,
html[data-theme='light'] .app-body--forged-provenance .app-chrome-header__canvas h1,
html[data-theme='light'] .app-body--research-anatomy .app-canvas > h1 {
  color: #1e3a8a;
}
html[data-theme='light'] .app-body--research-anatomy .app-chrome-header__canvas .ra-canvas-title__blue {
  color: #1e3a8a;
}
html[data-theme='light'] .app-body--research-anatomy .app-chrome-header__canvas .ra-canvas-title__forge {
  color: #0f172a;
}

html[data-theme='light'] .app-canvas .sub,
html[data-theme='light'] .app-chrome-header__canvas .sub {
  color: rgba(17, 24, 39, 0.72);
}

html[data-theme='light'] .app-placeholder,
html[data-theme='light'] .account-block {
  color: #111827;
}

html[data-theme='light'] .dash-card,
html[data-theme='light'] .dash-ideas-tile,
html[data-theme='light'] .account-layout {
  color: #111827;
}

html[data-theme='light'] input,
html[data-theme='light'] select,
html[data-theme='light'] textarea {
  background: #fff;
  color: #111827;
  border-color: rgba(0, 0, 0, 0.15);
}

html[data-theme='light'] .app-btn-primary {
  background: var(--blue);
  color: #fff;
  border: 1px solid transparent;
}

/* Marketing shell (academiq.css) */
html[data-theme='light'] body.home-page,
html[data-theme='light'] body:not(.app-body) {
  color: #111827;
}

html[data-theme='light'] body.home-page {
  background: var(--bg);
}
html[data-theme='light'] body.home-page .hero h1 {
  color: #1e3a8a;
}

html[data-theme='light'] .badge {
  color: #1d4ed8;
  background: rgba(29, 78, 216, 0.1);
  border-color: rgba(29, 78, 216, 0.22);
  font-size: 14px;
  padding: 0.5rem 1rem;
}
html[data-theme='light'] .badge:hover,
html[data-theme='light'] .badge:focus,
html[data-theme='light'] .badge:focus-visible {
  font-size: 14px;
  padding: 0.5rem 1rem;
  border-color: rgba(29, 78, 216, 0.22);
  outline: none;
  box-shadow: none;
}

html[data-theme='light'] .home-lang-form {
  color: rgba(17, 24, 39, 0.78);
}
html[data-theme='light'] .home-lang-form select {
  background: #fff;
  color: #111827;
  border-color: rgba(0, 0, 0, 0.15);
}
html[data-theme='light'] .home-lang-form select:hover,
html[data-theme='light'] .home-lang-form select:focus,
html[data-theme='light'] .home-lang-form select:focus-visible {
  outline: none;
  box-shadow: none;
  border-color: rgba(0, 0, 0, 0.15);
}

html[data-theme='light'] .top {
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--line);
}

html[data-theme='light'] .nav {
  color: rgba(17, 24, 39, 0.65);
}

html[data-theme='light'] .nav a:hover,
html[data-theme='light'] .nav a.nav-active {
  color: #111827;
}

html[data-theme='light'] .btn-outline {
  border-color: rgba(0, 0, 0, 0.12);
  background: #fff;
  color: #111827;
}

html[data-theme='light'] .btn-trial {
  background: #f3f4f6;
  border-color: rgba(0, 0, 0, 0.12);
  color: #111827;
}

html[data-theme='light'] .welcome {
  color: rgba(17, 24, 39, 0.8);
}

html[data-theme='light'] .signout {
  color: rgba(17, 24, 39, 0.55);
}

html[data-theme='light'] .lead {
  color: rgba(17, 24, 39, 0.68);
}

/* Marketing home — hero lead + primary CTAs use navy (not bright blue) */
html[data-theme='light'] body.home-page .lead {
  color: #1e3a8a;
}
/* Scope to .shell so sign-in modal (outside shell) keeps default primary blue */
html[data-theme='light'] body.home-page .shell a.btn.btn-blue,
html[data-theme='light'] body.home-page .shell button.btn.btn-blue {
  background: #1e3a8a !important;
  color: #fff !important;
  border-color: transparent;
  box-shadow: 0 0 0 1px rgba(30, 58, 138, 0.35);
  filter: none;
}
html[data-theme='light'] body.home-page .shell a.btn.btn-blue:hover,
html[data-theme='light'] body.home-page .shell button.btn.btn-blue:hover {
  background: #172554 !important;
  color: #fff !important;
  box-shadow: 0 0 0 1px rgba(23, 37, 84, 0.45);
  filter: none;
}

/* Sign-in modal (home, product, hold, guide — partial outside .shell): light surfaces in light theme */
html[data-theme='light'] #signin-modal.modal-backdrop {
  background: rgba(15, 23, 42, 0.45);
}
html[data-theme='light'] #signin-modal .modal {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--fg);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.14);
}
html[data-theme='light'] #signin-modal .modal h2 {
  color: var(--fg);
}
html[data-theme='light'] #signin-modal .modal-close {
  color: rgba(17, 24, 39, 0.45);
}
html[data-theme='light'] #signin-modal .modal-close:hover {
  color: var(--fg);
}
html[data-theme='light'] #signin-modal .modal label {
  color: rgba(17, 24, 39, 0.65);
}
html[data-theme='light'] #signin-modal .modal input {
  background: #fff;
  color: #111827;
  border-color: rgba(0, 0, 0, 0.15);
}
html[data-theme='light'] #signin-modal .modal-forgot a,
html[data-theme='light'] #signin-modal .create-link {
  color: var(--blue);
}
html[data-theme='light'] #signin-modal .error-msg {
  color: #b91c1c;
}
html[data-theme='light'] #signin-modal .success-msg {
  color: #15803d;
}

html[data-theme='light'] .meta {
  color: rgba(17, 24, 39, 0.5);
}

html[data-theme='light'] .card {
  background: var(--card);
  border: 1px solid var(--line);
  color: #111827;
}

html[data-theme='light'] h1 {
  color: #1d4ed8;
}

/* Foundry / fe-page cards use var(--card) */
html[data-theme='light'] .fe-card--main,
html[data-theme='light'] .fe-page {
  color: #111827;
}
/* Foundry center pipeline tile: match canvas background (not raised card) */
html[data-theme='light'] .app-body--foundry .fe-card--main {
  background: var(--bg);
}

html[data-theme='light'] .fe-label,
html[data-theme='light'] .fe-construct-sub {
  color: rgba(17, 24, 39, 0.75);
}

/*
 * Foundry pipeline (foundry-pipeline.css loads after this file — explicit overrides)
 */
html[data-theme='light'] .app-body--foundry .fe-input,
html[data-theme='light'] .app-body--foundry .fe-textarea {
  background: #fff;
  color: #111827;
  border-color: rgba(0, 0, 0, 0.15);
}
html[data-theme='light'] .app-body--foundry .fe-input::placeholder,
html[data-theme='light'] .app-body--foundry .fe-textarea::placeholder {
  color: rgba(17, 24, 39, 0.45);
}
html[data-theme='light'] .app-body--foundry .fe-label {
  color: rgba(17, 24, 39, 0.78);
}
html[data-theme='light'] .app-body--foundry #fe-lbl-research.fe-section-label,
html[data-theme='light'] .app-body--foundry #fe-lbl-project.fe-section-label,
html[data-theme='light'] .app-body--foundry .fe-section-label {
  color: #0d9488;
}
html[data-theme='light'] .app-body--foundry .fe-type-name {
  color: #111827;
}
html[data-theme='light'] .app-body--foundry .fe-type-desc {
  color: rgba(17, 24, 39, 0.58);
}
html[data-theme='light'] .app-body--foundry .fe-type-card:hover {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.03);
}
html[data-theme='light'] .app-body--foundry .fe-kw-pill {
  color: #1e3a8a;
  background: rgba(29, 78, 216, 0.1);
  border-color: rgba(29, 78, 216, 0.28);
}
html[data-theme='light'] .app-body--foundry .fe-kw-pill button {
  color: rgba(17, 24, 39, 0.5);
}
html[data-theme='light'] .app-body--foundry .fe-kw-pill button:hover {
  color: #111827;
  background: rgba(0, 0, 0, 0.06);
}
/* “How it works” dashed panel */
html[data-theme='light'] .app-body--foundry .fe-how {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.02);
}
html[data-theme='light'] .app-body--foundry .fe-how-step-num {
  color: rgba(17, 24, 39, 0.5);
}
html[data-theme='light'] .app-body--foundry .fe-how-text strong {
  color: rgba(17, 24, 39, 0.9);
}
html[data-theme='light'] .app-body--foundry .fe-how-text p {
  color: rgba(17, 24, 39, 0.65);
}
html[data-theme='light'] .app-body--foundry .fe-how-foot {
  color: rgba(17, 24, 39, 0.5);
}
/* Primary actions (all .fe-submit except secondary) */
html[data-theme='light'] .app-body--foundry .fe-submit:not(.fe-submit--secondary) {
  color: #1e3a8a;
  border-color: rgba(29, 78, 216, 0.38);
  background: rgba(29, 78, 216, 0.1);
}
html[data-theme='light'] .app-body--foundry .fe-submit:not(.fe-submit--secondary):disabled {
  color: rgba(30, 58, 138, 0.45);
}
html[data-theme='light'] .app-body--foundry .fe-submit--secondary {
  color: #111827;
  background: #f3f4f6;
  border-color: rgba(0, 0, 0, 0.12);
}
/* Constructs */
html[data-theme='light'] .app-body--foundry .fe-construct-heading {
  color: #111827;
}
html[data-theme='light'] .app-body--foundry .fe-construct-help-panel {
  background: rgba(0, 0, 0, 0.04);
  color: rgba(17, 24, 39, 0.82);
}
html[data-theme='light'] .app-body--foundry .fe-construct-card__label {
  color: #111827;
}
html[data-theme='light'] .app-body--foundry .fe-construct-iconbtn {
  color: rgba(17, 24, 39, 0.55);
  background: rgba(0, 0, 0, 0.04);
}
html[data-theme='light'] .app-body--foundry .fe-construct-iconbtn:hover {
  color: #111827;
  background: rgba(0, 0, 0, 0.07);
}
html[data-theme='light'] .app-body--foundry .fe-construct-lock-note {
  color: rgba(17, 24, 39, 0.55);
}
html[data-theme='light'] .app-body--foundry .fe-toast {
  color: #111827;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
}
/* Scope & timeline */
html[data-theme='light'] .app-body--foundry .fe-scope-col__h {
  color: #111827;
}
html[data-theme='light'] .app-body--foundry .fe-scope-adj-name {
  color: #111827;
}
html[data-theme='light'] .app-body--foundry .fe-scope-pill {
  color: rgba(17, 24, 39, 0.75);
  background: rgba(29, 78, 216, 0.1);
}
html[data-theme='light'] .app-body--foundry .fe-scope-domain-row {
  color: rgba(17, 24, 39, 0.88);
}
html[data-theme='light'] .app-body--foundry .fe-scope-domain-name {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}
html[data-theme='light'] .app-body--foundry .fe-tl-title {
  color: #111827;
}
html[data-theme='light'] .app-body--foundry .fe-tl-time {
  color: rgba(17, 24, 39, 0.45);
}
html[data-theme='light'] .app-body--foundry .fe-timeline {
  border-left-color: rgba(0, 0, 0, 0.1);
}
html[data-theme='light'] .app-body--foundry .fe-tl-item::before {
  background: rgba(0, 0, 0, 0.22);
}
html[data-theme='light'] .app-body--foundry .fe-spinner--lg {
  border-color: rgba(0, 0, 0, 0.1);
  border-top-color: rgba(29, 78, 216, 0.75);
}
/* Results & gaps */
html[data-theme='light'] .app-body--foundry .fe-res-sum-title {
  color: #111827;
}
html[data-theme='light'] .app-body--foundry .fe-pill {
  color: rgba(17, 24, 39, 0.82);
  background: rgba(0, 0, 0, 0.06);
}
html[data-theme='light'] .app-body--foundry .fe-res-ts {
  color: rgba(17, 24, 39, 0.45);
}
html[data-theme='light'] .app-body--foundry .fe-results-section-h {
  color: rgba(17, 24, 39, 0.78);
}
html[data-theme='light'] .app-body--foundry .fe-results-health-lead {
  color: rgba(17, 24, 39, 0.88);
}
html[data-theme='light'] .app-body--foundry .fe-health-item strong {
  color: #111827;
}
html[data-theme='light'] .app-body--foundry .fe-gap-card__title {
  color: #111827;
}
html[data-theme='light'] .app-body--foundry .fe-gap-card__body {
  color: rgba(17, 24, 39, 0.85);
}
html[data-theme='light'] .app-body--foundry .fe-res-tab.is-active {
  color: #111827;
  border-color: rgba(29, 78, 216, 0.45);
  background: rgba(29, 78, 216, 0.12);
}
html[data-theme='light'] .app-body--foundry .fe-meta-pre {
  background: #f3f4f6;
  color: rgba(17, 24, 39, 0.75);
}
html[data-theme='light'] .app-body--foundry .fe-res-iframe {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.12);
}
html[data-theme='light'] .app-body--foundry .fe-debates-card {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.1);
}
html[data-theme='light'] .app-body--foundry .fe-debates-h {
  color: #111827;
}
html[data-theme='light'] .app-body--foundry .fe-debates-pos {
  color: rgba(17, 24, 39, 0.85);
}
html[data-theme='light'] .app-body--foundry .fe-gap-h4 {
  color: rgba(17, 24, 39, 0.72);
}
html[data-theme='light'] .app-body--foundry .fe-notify-box {
  background: #fff;
  color: rgba(17, 24, 39, 0.88);
  border-color: rgba(0, 0, 0, 0.1);
}
/* Rail processing block */
html[data-theme='light'] .app-body--foundry .foundry-rail-proc__title {
  color: rgba(17, 24, 39, 0.9);
}
html[data-theme='light'] .app-body--foundry .foundry-rail-tile__status {
  color: rgba(17, 24, 39, 0.65);
}
/* Modals & lock overlay */
html[data-theme='light'] .app-body--foundry .fe-modal__p {
  color: rgba(17, 24, 39, 0.82);
}
html[data-theme='light'] .app-body--foundry .fe-lock-overlay__msg {
  color: rgba(17, 24, 39, 0.88);
}

/* Crucible / Anvil note tiles */
html[data-theme='light'] .crucible-note-tile--light .crucible-note-tile__editor {
  background: #fff;
  color: #111827;
}
html[data-theme='light'] .app-body--crucible .crucible-note-save,
html[data-theme='light'] .app-body--crucible .crucible-notes-save-btn {
  background: #1e3a8a !important;
  color: #fff !important;
  border: 1px solid #1e3a8a !important;
}
html[data-theme='light'] .app-body--crucible .crucible-note-save:hover,
html[data-theme='light'] .app-body--crucible .crucible-notes-save-btn:hover {
  background: #172554 !important;
  border-color: #172554 !important;
}
html[data-theme='light'] .app-body--crucible .crucible-add-btn {
  background: #1e3a8a !important;
  color: #fff !important;
  border: 1px solid #1e3a8a !important;
}
html[data-theme='light'] .app-body--crucible .crucible-add-btn:hover {
  background: #172554 !important;
  border-color: #172554 !important;
}
html[data-theme='light'] .app-body--crucible .crucible-sug-card__title,
html[data-theme='light'] .app-body--crucible .crucible-sug-card__title a {
  color: #1e3a8a !important;
}
html[data-theme='light'] .app-body--crucible .crucible-sug-track-btn:not(:disabled):not(.crucible-sug-track-btn--done) {
  color: #1e3a8a !important;
  background: #fff !important;
  border: 1px solid #1e3a8a !important;
}
html[data-theme='light'] .app-body--crucible .crucible-sug-track-btn:not(:disabled):not(.crucible-sug-track-btn--done):hover {
  background: rgba(30, 58, 138, 0.08) !important;
  border-color: #172554 !important;
  color: #172554 !important;
}

/* Inline auth pages (register / verify / change-email) */
html[data-theme='light'] body.auth-inline-page {
  color-scheme: light;
  --bg: #f0f2f5;
  --card: #ffffff;
  --border: rgba(0, 0, 0, 0.12);
  --text: #111827;
  --muted: rgba(17, 24, 39, 0.62);
  --primary: #1d4ed8;
  --primary-hover: #2563eb;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 50% at 20% 20%, rgba(29, 78, 216, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 85% 75%, rgba(29, 78, 216, 0.05) 0%, transparent 45%);
}
html[data-theme='light'] body.auth-inline-page h1 {
  color: #1d4ed8;
}
html[data-theme='light'] body.auth-inline-page .topbar-link:hover {
  color: #111827;
}
html[data-theme='light'] body.auth-inline-page .form-group label .opt {
  color: rgba(17, 24, 39, 0.55);
}
html[data-theme='light'] body.auth-inline-page .form-group input,
html[data-theme='light'] body.auth-inline-page .form-group select,
html[data-theme='light'] body.auth-inline-page .form-group textarea {
  background: #fff;
  color: #111827;
  border-color: rgba(0, 0, 0, 0.15);
}
html[data-theme='light'] body.auth-inline-page .form-group input::placeholder {
  color: rgba(17, 24, 39, 0.45);
}
html[data-theme='light'] body.auth-inline-page .register-field-toggle--eye {
  color: rgba(17, 24, 39, 0.45);
}
html[data-theme='light'] body.auth-inline-page .register-field-toggle--eye:hover {
  color: rgba(17, 24, 39, 0.85);
  background: rgba(0, 0, 0, 0.05);
}
html[data-theme='light'] body.auth-inline-page .error {
  color: #b91c1c;
}
html[data-theme='light'] body.auth-inline-page .hint {
  color: rgba(17, 24, 39, 0.55);
}
html[data-theme='light'] body.auth-inline-page .register-membership {
  border-color: rgba(0, 0, 0, 0.1);
}
html[data-theme='light'] body.auth-inline-page .register-membership legend {
  color: #111827;
}
html[data-theme='light'] body.auth-inline-page .register-radio {
  color: #111827;
}
html[data-theme='light'] body.auth-inline-page .register-interval {
  background: rgba(0, 0, 0, 0.04);
}
html[data-theme='light'] body.auth-inline-page .register-interval-label {
  color: rgba(17, 24, 39, 0.55);
}
html[data-theme='light'] body.auth-inline-page .masked-email {
  color: #111827;
}
html[data-theme='light'] body.auth-inline-page .lead {
  color: var(--muted);
}

/* Collapsible rail / sidebar controls (light) */
html[data-theme='light'] .app-sidebar__toggle,
html[data-theme='light'] .app-insight__toggle {
  border-color: rgba(0, 0, 0, 0.12);
  background: #fff;
  color: rgba(17, 24, 39, 0.75);
}
html[data-theme='light'] .app-sidebar__toggle:hover,
html[data-theme='light'] .app-insight__toggle:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #111827;
}
html[data-theme='light'] .app-insight-strip__btn {
  border-color: rgba(30, 58, 138, 0.22);
  background: #fff;
  color: #1e3a8a;
}
html[data-theme='light'] .app-insight-strip__btn:hover {
  background: rgba(30, 58, 138, 0.08);
  border-color: rgba(30, 58, 138, 0.35);
  color: #172554;
}

/* Collapsed rails: nav icons — navy */
html[data-theme='light'] .app-layout--sidebar-collapsed .app-sidebar .app-sidebar-link__ico {
  color: #1e3a8a;
}
html[data-theme='light'] .app-layout--sidebar-collapsed .app-sidebar .app-nav a.active .app-sidebar-link__ico,
html[data-theme='light'] .app-layout--sidebar-collapsed .app-sidebar .app-nav a:hover .app-sidebar-link__ico {
  color: #1e3a8a;
}
html[data-theme='light'] body.app-layout--insight-collapsed .app-insight .app-insight-strip__btn {
  color: #1e3a8a;
  border-color: rgba(30, 58, 138, 0.22);
}

/* ── Light mode: dark green instead of light cyan/teal text ───────── */
html[data-theme='light'] .app-nav--anvil-sections a,
html[data-theme='light'] .app-nav--crucible-sub a.app-sidebar-link--section,
html[data-theme='light'] .app-sidebar-home,
html[data-theme='light'] .app-sidebar-training,
html[data-theme='light'] .app-sidebar-project-name:not(:hover),
html[data-theme='light'] .app-body--anvil .app-sidebar-project-name,
html[data-theme='light'] .dash-rail-project-tile__name,
html[data-theme='light'] .insight-h--teal,
html[data-theme='light'] .crucible-sug-header {
  color: var(--accent-teal-dark) !important;
}
html[data-theme='light'] .app-sidebar-project-name:hover,
html[data-theme='light'] .app-sidebar-home:hover,
html[data-theme='light'] .app-sidebar-training:hover {
  color: var(--accent-teal-hover) !important;
}
html[data-theme='light'] .fe-crumb__past {
  color: rgba(17, 24, 39, 0.55);
}
html[data-theme='light'] .fe-crumb__current {
  color: #111827;
}
html[data-theme='light'] .fe-crumb__future {
  color: rgba(17, 24, 39, 0.45);
}
html[data-theme='light'] .fe-crumb__sep {
  color: rgba(17, 24, 39, 0.35);
}

/* ── Light mode: replace white/near-white text with dark ink (surfaces) ─ */
html[data-theme='light'] .app-sidebar .app-nav a.active,
html[data-theme='light'] .app-sidebar .app-nav a:hover {
  color: #111827;
}
/* Account route: active nav + page title use navy (not pure black / bright blue) */
html[data-theme='light'] .app-body--account-page .app-sidebar .app-nav a.active {
  color: #1e3a8a !important;
}
html[data-theme='light'] .app-body--account-page .app-canvas > h1,
html[data-theme='light'] .app-body--account-page.app-body--app-chrome .app-chrome-header__canvas h1 {
  color: #1e3a8a;
}
html[data-theme='light'] .app-insight .insight-h,
html[data-theme='light'] .app-insight .insight-h--feedback,
html[data-theme='light'] .app-insight .insight-h--citations,
html[data-theme='light'] .app-insight .insight-h--reference {
  color: #1e3a8a;
}
html[data-theme='light'] .app-insight-card,
html[data-theme='light'] .app-placeholder,
html[data-theme='light'] .app-trial-bar {
  color: rgba(17, 24, 39, 0.88);
}
html[data-theme='light'] .app-trial-bar {
  background: rgba(29, 78, 216, 0.08);
  border-color: rgba(29, 78, 216, 0.22);
}
html[data-theme='light'] .app-paywall h2 {
  color: #111827;
}
html[data-theme='light'] .app-paywall p {
  color: rgba(17, 24, 39, 0.82);
}
html[data-theme='light'] .anvil-score-pct,
html[data-theme='light'] .anvil-score-rating,
html[data-theme='light'] .anvil-save-status,
html[data-theme='light'] .anvil-export-label,
html[data-theme='light'] .anvil-editor-footer .anvil-save-status {
  color: rgba(17, 24, 39, 0.82) !important;
}
html[data-theme='light'] .anvil2-feedback-placeholder,
html[data-theme='light'] .app-anvil-rail__citations-placeholder {
  color: rgba(17, 24, 39, 0.55) !important;
}

/* Anvil — project/section scoring group titles + metric labels (center + rail pills) */
html[data-theme='light'] .app-body--anvil .anvil-scoring-title {
  color: #0d9488;
}
html[data-theme='light'] .app-body--anvil .anvil-score-label,
html[data-theme='light'] .app-body--anvil .anvil-score-pill__cat,
html[data-theme='light'] .app-body--anvil .anvil2-section-label {
  color: #111827;
}

/* The Anvil — light: navy chrome, rail labels, save/export, feedback tiles */
html[data-theme='light'] .app-body--anvil .app-anvil-page-head__left h1,
html[data-theme='light'] .app-body--anvil .app-chrome-header__canvas .app-anvil-page-head__left h1 {
  color: #1e3a8a !important;
}
html[data-theme='light'] .project-settings-form .app-form-actions .app-btn-primary,
html[data-theme='light'] #project-settings-form .app-form-actions .app-btn-primary {
  background: #1e3a8a !important;
  border: 1px solid #1e3a8a !important;
  color: #fff !important;
}
html[data-theme='light'] .project-settings-form .app-form-actions .app-btn-primary:hover,
html[data-theme='light'] #project-settings-form .app-form-actions .app-btn-primary:hover {
  background: #172554 !important;
  border-color: #172554 !important;
  color: #fff !important;
}
html[data-theme='light'] .app-body--anvil .app-canvas .sub.app-anvil-intro,
html[data-theme='light'] .app-body--anvil .app-chrome-header__canvas .sub.app-anvil-intro {
  color: rgba(17, 24, 39, 0.72) !important;
}
html[data-theme='light']
  .app-body--workspace-shell
  .app-insight.app-anvil-rail
  #anvil-rail-mode-default
  .app-anvil-rail__bottom {
  border-top-width: 3px;
  border-top-color: #1e3a8a;
}
/* Right insight rails: splitters navy in light mode (match Anvil Sources bar) */
html[data-theme='light'] .app-body--workspace-shell .app-insight.app-crucible-rail .app-crucible-rail__bottom,
html[data-theme='light'] .app-body--workspace-shell .app-insight.app-research-anatomy-rail .ra-rail-shell__bottom,
html[data-theme='light'] .app-body--dashboard .dash-rail-pane--published,
html[data-theme='light'] .app-insight.app-anvil-rail #anvil-rail-mode-reference .app-anvil-rail__research-plan-block {
  border-top-width: 3px;
  border-top-color: #1e3a8a;
}
html[data-theme='light'] .app-body--foundry .foundry-rail-section--past {
  border-bottom-width: 3px;
  border-bottom-color: #1e3a8a;
}
html[data-theme='light'] .app-body--forged-provenance .fp-rail-divider {
  background: #1e3a8a;
}
html[data-theme='light'] .app-insight.app-anvil-rail .insight-h--feedback,
html[data-theme='light'] .app-insight.app-anvil-rail .insight-h--citations {
  color: #1e3a8a !important;
  font-weight: 700;
}
html[data-theme='light'] .app-insight.app-crucible-rail .app-crucible-rail__top .insight-h,
html[data-theme='light'] .app-insight.app-crucible-rail .crucible-sug-header {
  color: #1e3a8a !important;
}
/* Anvil sources rail: tiles match rail bg; insert control reads navy on light */
html[data-theme='light'] .app-insight.app-anvil-rail .anvil-citation-card {
  background: #f9fafb;
  border-color: rgba(0, 0, 0, 0.1);
  color: rgba(17, 24, 39, 0.88);
}
html[data-theme='light'] .app-insight.app-anvil-rail .anvil-citation-card__footer {
  border-top-color: rgba(0, 0, 0, 0.08);
}
html[data-theme='light'] .app-insight.app-anvil-rail .anvil-citation-notes {
  color: rgba(17, 24, 39, 0.62);
  border-top-color: rgba(0, 0, 0, 0.08);
}
html[data-theme='light'] .app-insight.app-anvil-rail .anvil-citation-insert-btn {
  background: rgba(30, 58, 138, 0.08);
  border-color: rgba(30, 58, 138, 0.38);
  color: #1e3a8a;
  filter: none;
}
html[data-theme='light'] .app-insight.app-anvil-rail .anvil-citation-insert-btn:hover {
  background: rgba(30, 58, 138, 0.14);
  border-color: rgba(30, 58, 138, 0.5);
  color: #172554;
  filter: none;
}
html[data-theme='light'] .app-body--anvil .anvil-add-source-btn {
  background: #1e3a8a;
  border: 1px solid #1e3a8a;
  color: #fff;
}
html[data-theme='light'] .app-body--anvil .anvil-add-source-btn:hover {
  background: #172554;
  border-color: #172554;
  color: #fff;
}
html[data-theme='light'] .crucible-modal--add-source .crucible-btn--primary {
  background: #1e3a8a !important;
  border: 1px solid #1e3a8a !important;
  color: #fff !important;
}
html[data-theme='light'] .crucible-modal--add-source .crucible-btn--primary:hover {
  background: #172554 !important;
  border-color: #172554 !important;
  color: #fff !important;
  opacity: 1;
}
html[data-theme='light'] #project-new-form .app-form-actions .app-btn-primary {
  background: #1e3a8a !important;
  border: 1px solid #1e3a8a !important;
  color: #fff !important;
}
html[data-theme='light'] #project-new-form .app-form-actions .app-btn-primary:hover {
  background: #172554 !important;
  border-color: #172554 !important;
  color: #fff !important;
}
html[data-theme='light'] .project-create-choice__label,
html[data-theme='light'] .project-new-form__h {
  color: #0d9488;
}
html[data-theme='light'] .app-body--project-import .import-card__h {
  color: #1d4ed8;
}
html[data-theme='light'] .app-body--project-import #import-next-map.app-btn-primary {
  background: #1e3a8a !important;
  border: 1px solid #1e3a8a !important;
  color: #fff !important;
}
html[data-theme='light'] .app-body--project-import #import-next-map.app-btn-primary:hover:not(:disabled) {
  background: #172554 !important;
  border-color: #172554 !important;
  color: #fff !important;
}
html[data-theme='light'] .anvil-save-btn {
  background: #1e3a8a;
  color: #fff;
  border: 1px solid #1e3a8a;
}
html[data-theme='light'] .anvil-save-btn:hover {
  background: #172554;
  border-color: #172554;
}
html[data-theme='light'] .anvil-export-btn {
  background: #f3f4f6 !important;
  color: #374151 !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
}
html[data-theme='light'] .anvil-export-btn:hover {
  background: #e5e7eb !important;
  color: #111827 !important;
}
html[data-theme='light'] .anvil-export-btn:disabled {
  color: rgba(55, 65, 81, 0.45) !important;
}
html[data-theme='light'] .anvil-export-hint strong {
  color: rgba(17, 24, 39, 0.75) !important;
}
html[data-theme='light'] .app-body--anvil .anvil-export-bar {
  background: #f9fafb;
  border-color: rgba(0, 0, 0, 0.08);
}
html[data-theme='light'] .app-body--anvil .anvil2-feedback-card {
  background: #f9fafb;
  border-color: rgba(0, 0, 0, 0.1);
}
html[data-theme='light'] .app-body--anvil .anvil2-feedback-rationale {
  color: rgba(17, 24, 39, 0.88);
}
html[data-theme='light'] .app-body--anvil .anvil2-feedback-anchor,
html[data-theme='light'] .app-body--anvil .anvil2-feedback-suggestion {
  color: rgba(17, 24, 39, 0.72);
}
html[data-theme='light'] .app-body--anvil .anvil2-feedback-k {
  color: rgba(17, 24, 39, 0.5);
}
html[data-theme='light'] .app-body--anvil .anvil2-feedback-id {
  color: rgba(17, 24, 39, 0.45);
}
html[data-theme='light'] .app-body--anvil .anvil2-feedback-status {
  color: rgba(17, 24, 39, 0.45);
}
html[data-theme='light'] .app-body--anvil .anvil2-dismiss {
  color: #374151;
  border-color: rgba(0, 0, 0, 0.12);
  background: #fff;
}
html[data-theme='light'] .app-body--anvil .anvil2-confirm-btn {
  background: #1e3a8a !important;
  border-color: #1e3a8a !important;
  color: #fff !important;
}
html[data-theme='light'] .app-body--anvil .anvil2-confirm-btn:hover {
  background: #172554 !important;
  border-color: #172554 !important;
}
html[data-theme='light'] .app-body--anvil .anvil2-apply.app-btn-primary,
html[data-theme='light'] .app-body--anvil button.anvil2-apply.app-btn-primary {
  background: #1e3a8a !important;
  border-color: #1e3a8a !important;
  color: #fff !important;
}
html[data-theme='light'] .app-body--anvil .anvil2-apply.app-btn-primary:hover,
html[data-theme='light'] .app-body--anvil button.anvil2-apply.app-btn-primary:hover {
  background: #172554 !important;
  border-color: #172554 !important;
  color: #fff !important;
}
html[data-theme='light'] .app-body--anvil .anvil2-feedback-cat-pill {
  color: #1e3a8a !important;
}
html[data-theme='light'] .app-body--anvil .anvil-refresh-feedback-btn {
  border-color: rgba(30, 58, 138, 0.35);
  background: rgba(30, 58, 138, 0.1);
  color: #1e3a8a;
}
html[data-theme='light'] .app-body--anvil .anvil-refresh-feedback-btn:hover {
  background: rgba(30, 58, 138, 0.18);
}

html[data-theme='light'] .account-meta,
html[data-theme='light'] .account-h2,
html[data-theme='light'] .account-fieldset__legend,
html[data-theme='light'] .account-h3 {
  color: rgba(17, 24, 39, 0.82);
}
/* Subscription status + billing summary values (not dt labels) — navy on account */
html[data-theme='light'] .app-body--account-page .account-status,
html[data-theme='light'] .app-body--account-page .account-status--paid {
  color: #1e3a8a;
}
html[data-theme='light'] .app-body--account-page .account-billing-summary dd {
  color: #1e3a8a;
}
html[data-theme='light'] .app-body--account-page .account-plan-preview-estimate {
  color: #1e3a8a;
}
html[data-theme='light'] .app-body--account-page .app-link-cta {
  color: #1e3a8a;
}
html[data-theme='light'] .app-body--account-page .account-billing-pending__btn {
  color: #1e3a8a;
}
html[data-theme='light'] .app-body--account-page .account-meta--password-reset a {
  color: #1e3a8a;
}

/* Mobile WebView only (?chrome=embed): Account — section h2s blue; secondary labels/copy gray (web unchanged). */
html[data-theme='light'] .app-body--chrome-embed.app-body--account-page .account-block .account-h2 {
  color: var(--blue);
}
html[data-theme='light'] .app-body--chrome-embed.app-body--account-page .account-block .account-fieldset__legend {
  color: rgba(17, 24, 39, 0.62);
}
html[data-theme='light'] .app-body--chrome-embed.app-body--account-page .app-chrome-header__canvas .sub {
  color: rgba(17, 24, 39, 0.62);
}
html[data-theme='light'] .app-body--chrome-embed.app-body--account-page .account-block .app-field > span {
  color: rgba(17, 24, 39, 0.62);
}
html[data-theme='light'] .app-body--chrome-embed.app-body--account-page .account-block .app-field > span .account-required-star {
  color: #a58181;
}
html[data-theme='light'] .app-body--chrome-embed.app-body--account-page .account-block .account-theme-option span {
  color: rgba(17, 24, 39, 0.62);
}
html[data-theme='light'] .app-body--chrome-embed.app-body--account-page .account-block .account-h3 {
  color: rgba(17, 24, 39, 0.62);
}
html[data-theme='light'] .app-body--chrome-embed.app-body--account-page .account-block .account-meta {
  color: rgba(17, 24, 39, 0.62);
}
html[data-theme='light'] .app-body--chrome-embed.app-body--account-page .account-block .account-meta a,
html[data-theme='light'] .app-body--chrome-embed.app-body--account-page .account-block .account-meta--password-reset a {
  color: #1e3a8a;
}
html[data-theme='light'] .app-body--chrome-embed.app-body--account-page .account-block .account-meta--warn {
  color: rgba(180, 83, 9, 0.95);
}
html[data-theme='light'] .app-body--chrome-embed.app-body--account-page .account-block .account-form-required-note {
  color: #a58181;
}
html[data-theme='light'] .app-body--chrome-embed.app-body--account-page .account-block .account-billing-summary dt {
  color: rgba(17, 24, 39, 0.62);
}

html[data-theme='light'] .account-flash {
  color: #111827;
}
html[data-theme='light'] .account-billing-pending,
html[data-theme='light'] .account-membership-scheduled-cancel {
  background: rgba(29, 78, 216, 0.08);
  border-color: rgba(29, 78, 216, 0.28);
  color: #1e3a8a;
}
html[data-theme='light'] .dash-rail-renewal,
html[data-theme='light'] .dash-rail-renewal__label,
html[data-theme='light'] .dash-rail-renewal__date,
html[data-theme='light'] .dash-rail-filter-empty,
html[data-theme='light'] .dash-rail-empty {
  color: rgba(17, 24, 39, 0.78);
}
html[data-theme='light'] .dash-rail-project-tile__meta {
  color: rgba(17, 24, 39, 0.55);
}
html[data-theme='light'] .dash-ideas-tile__hint {
  color: rgba(17, 24, 39, 0.55);
}

/* Sidebar section labels (Workspace, Project, …) */
html[data-theme='light'] .app-nav-label,
html[data-theme='light'] .app-nav-label--emph {
  color: #1e3a8a;
}

/* ── Portfolio / dashboard (light): graphs + ideas/published tiles ─ */
html[data-theme='light'] .app-body--dashboard .dash-ring__text {
  fill: #111827;
}
html[data-theme='light'] .app-body--dashboard .dash-ring__bg {
  stroke: rgba(0, 0, 0, 0.1);
}
html[data-theme='light'] .app-body--dashboard .dash-section-bars-header {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}
html[data-theme='light'] .app-body--dashboard .dash-section-bars-header__metrics,
html[data-theme='light'] .app-body--dashboard .dash-section-bar__metrics {
  border-left-color: rgba(0, 0, 0, 0.1);
}
html[data-theme='light'] .app-body--dashboard .dash-section-bars-header__col {
  color: rgba(17, 24, 39, 0.65);
}
html[data-theme='light'] .app-body--dashboard .dash-section-bar__label {
  color: rgba(17, 24, 39, 0.88);
}
html[data-theme='light'] .app-body--dashboard .dash-section-bar__pct {
  color: rgba(17, 24, 39, 0.65);
}
html[data-theme='light'] .app-body--dashboard .dash-section-bar__metric-value {
  color: #111827;
}
html[data-theme='light'] .app-body--dashboard .dash-section-bar__track {
  background: rgba(0, 0, 0, 0.08);
}
html[data-theme='light'] .app-body--dashboard .dash-recent-bar__label {
  color: rgba(17, 24, 39, 0.6);
}
html[data-theme='light'] .app-body--dashboard .dash-active-project-select {
  background: #fff;
  color: #111827;
  border-color: rgba(0, 0, 0, 0.15);
}
html[data-theme='light'] .app-body--dashboard .dash-saved-tile__title {
  color: #111827;
}
html[data-theme='light'] .app-body--dashboard .dash-saved-tile__meta {
  color: rgba(17, 24, 39, 0.55);
}
html[data-theme='light'] .app-body--dashboard .dash-saved-tile__notes {
  color: rgba(17, 24, 39, 0.72);
}
html[data-theme='light'] .app-body--dashboard li.dash-research-tag {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.35);
}
html[data-theme='light'] .app-body--dashboard .dash-modal-label-hint {
  color: rgba(17, 24, 39, 0.5);
}
html[data-theme='light'] .app-body--dashboard .dash-kw-pill {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.35);
  color: #1e3a8a;
}
html[data-theme='light'] .app-body--dashboard .dash-kw-pill button {
  color: rgba(17, 24, 39, 0.45);
}
html[data-theme='light'] .app-body--dashboard .dash-kw-pill button:hover {
  color: #1e3a8a;
  background: rgba(37, 99, 235, 0.08);
}
html[data-theme='light'] .app-body--dashboard .dash-confirm-delete-body {
  color: rgba(17, 24, 39, 0.78);
}
html[data-theme='light'] .app-body--dashboard #dash-portfolio-visual .dash-visual-card__title,
html[data-theme='light'] .app-body--dashboard #dash-active-visual .dash-visual-card__title {
  color: #0d9488;
}
html[data-theme='light'] .app-body--dashboard .dash-section-bars-header {
  border-top-color: rgba(0, 0, 0, 0.1);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}
html[data-theme='light'] .app-body--dashboard .dash-rail-pane--published {
  border-top-width: 3px;
  border-top-color: #1e3a8a;
}
html[data-theme='light'] .app-body--dashboard .dash-rail-published-lead,
html[data-theme='light'] .app-body--dashboard .dash-rail-published-empty {
  color: rgba(17, 24, 39, 0.62);
}
html[data-theme='light'] .app-body--dashboard .dash-stat__k {
  color: #2563eb;
}
html[data-theme='light'] .app-body--dashboard .dash-stat__v {
  color: #111827;
}
html[data-theme='light'] .app-body--dashboard .dash-rail-head-row .insight-h {
  color: #1e3a8a !important;
  font-weight: 700;
}
html[data-theme='light'] .app-body--dashboard .dash-canvas-head__titles h1 {
  color: #1e3a8a;
}
html[data-theme='light'] .app-body--dashboard .dash-ideas-tile__title {
  color: #0d9488;
}
html[data-theme='light'] .app-body--dashboard .dash-add-project-btn.app-btn-primary,
html[data-theme='light'] .app-body--dashboard .dash-ideas-tile__btn.app-btn-primary,
html[data-theme='light'] .app-body--dashboard .dash-published-work-add.app-btn-primary {
  background: #1e3a8a !important;
  border: 1px solid #1e3a8a !important;
  color: #fff !important;
  filter: none;
}
html[data-theme='light'] .app-body--dashboard .dash-add-project-btn.app-btn-primary:hover,
html[data-theme='light'] .app-body--dashboard .dash-ideas-tile__btn.app-btn-primary:hover,
html[data-theme='light'] .app-body--dashboard .dash-published-work-add.app-btn-primary:hover {
  background: #172554 !important;
  border-color: #172554 !important;
  color: #fff !important;
}
/* Research ideas + published work: match center stage (canvas) bg; keep existing borders */
html[data-theme='light'] .app-body--dashboard .dash-import-doc-btn {
  background: #f3f4f6;
  color: #111827;
  border-color: rgba(0, 0, 0, 0.1);
}
html[data-theme='light'] .app-body--dashboard .dash-import-doc-btn:hover {
  background: #e5e7eb;
  color: #111827;
}

html[data-theme='light'] .app-body--dashboard .dash-ideas-tile--with-list {
  background: var(--bg);
}
html[data-theme='light'] .app-body--dashboard .dash-saved-tile {
  background: var(--bg);
  border-color: rgba(0, 0, 0, 0.12);
}
@media (max-width: 520px) {
  html[data-theme='light'] .app-body--dashboard .dash-section-bar__metrics,
  html[data-theme='light'] .app-body--dashboard .dash-section-bars-header__metrics {
    border-top-color: rgba(0, 0, 0, 0.1);
  }
}

/* ── Account & billing: blue-tinted secondary buttons (not white) ─ */
html[data-theme='light'] a.app-btn-primary.account-btn-yearly,
html[data-theme='light'] button.app-btn-primary.account-btn-yearly,
html[data-theme='light'] .account-btn-yearly {
  background: var(--btn-secondary-bg) !important;
  border: 1px solid var(--btn-secondary-border) !important;
  color: var(--btn-secondary-text) !important;
  filter: none;
}
html[data-theme='light'] a.app-btn-primary.account-btn-yearly:hover,
html[data-theme='light'] button.app-btn-primary.account-btn-yearly:hover,
html[data-theme='light'] .account-btn-yearly:hover {
  background: var(--btn-secondary-bg-hover) !important;
  filter: none;
}
/* Navy fill + white label (not light-blue / navy text) */
html[data-theme='light'] .app-body--account-page #account-profile-submit.app-btn-primary,
html[data-theme='light'] .app-body--account-page #account-password-submit.app-btn-primary {
  background: #1e3a8a !important;
  border: 1px solid #1e3a8a !important;
  color: #fff !important;
  filter: none;
}
html[data-theme='light'] .app-body--account-page #account-profile-submit.app-btn-primary:hover,
html[data-theme='light'] .app-body--account-page #account-password-submit.app-btn-primary:hover {
  background: #172554 !important;
  border-color: #172554 !important;
  color: #fff !important;
  filter: none;
}
html[data-theme='light'] .app-body--account-page .account-btn-resume,
html[data-theme='light'] .app-body--account-page button.app-btn-primary.account-btn-resume {
  background: #1e3a8a !important;
  border: 1px solid #1e3a8a !important;
  color: #fff !important;
  filter: none;
}
html[data-theme='light'] .app-body--account-page .account-btn-resume:hover,
html[data-theme='light'] .app-body--account-page button.app-btn-primary.account-btn-resume:hover {
  background: #172554 !important;
  border-color: #172554 !important;
  color: #fff !important;
  filter: none;
}
html[data-theme='light'] .account-btn-portal {
  background: var(--btn-secondary-bg) !important;
  border: 1px solid var(--btn-secondary-border) !important;
  color: var(--btn-secondary-text) !important;
}
html[data-theme='light'] .account-btn-portal:hover {
  background: var(--btn-secondary-bg-hover) !important;
  filter: none;
}
html[data-theme='light'] .app-body--account-page .account-open-billing-history-btn {
  background: #fff;
  border-color: rgba(30, 58, 138, 0.38);
  color: #1e3a8a;
}
html[data-theme='light'] .app-body--account-page .account-open-billing-history-btn:hover {
  background: rgba(30, 58, 138, 0.08);
  border-color: rgba(30, 58, 138, 0.55);
  color: #172554;
}

/* ── Modals (account, dashboard, crucible, RA) ─ */
html[data-theme='light'] .account-modal-overlay__panel {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
}
html[data-theme='light'] .account-modal-overlay__title {
  color: #0f172a;
}
html[data-theme='light'] .account-modal-overlay__text,
html[data-theme='light'] .account-modal-overlay__text--estimate {
  color: rgba(17, 24, 39, 0.82);
}
html[data-theme='light'] .account-modal-overlay__text--estimate-amount {
  color: #0f172a;
}
html[data-theme='light'] .account-modal-overlay__panel--billing-history .account-billing-history-table th {
  color: #1e3a8a;
}
html[data-theme='light'] .account-modal-overlay__panel--billing-history .account-billing-history-table th,
html[data-theme='light'] .account-modal-overlay__panel--billing-history .account-billing-history-table td {
  border-bottom-color: rgba(0, 0, 0, 0.08);
  color: #111827;
}
html[data-theme='light'] .account-modal-overlay__btn--secondary {
  background: #f3f4f6;
  border-color: rgba(0, 0, 0, 0.12);
  color: #111827;
}
html[data-theme='light'] .account-modal-overlay__btn--secondary:hover {
  background: #e5e7eb;
}
/* Keep subscription + confirm annual: navy fill, white text */
html[data-theme='light'] .account-modal-overlay__btn--keep,
html[data-theme='light'] .account-modal-overlay__btn--confirm-mint {
  background: #1e3a8a !important;
  border: 1px solid #1e3a8a !important;
  color: #fff !important;
  filter: none;
}
html[data-theme='light'] .account-modal-overlay__btn--keep:hover,
html[data-theme='light'] .account-modal-overlay__btn--confirm-mint:hover {
  background: #172554 !important;
  border-color: #172554 !important;
  color: #fff !important;
  filter: none;
}
html[data-theme='light'] .account-modal-overlay__btn--confirm-cancel {
  background: #e5e7eb !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  color: #4b5563 !important;
}
html[data-theme='light'] .account-modal-overlay__btn--confirm-cancel:hover {
  background: #d1d5db !important;
  filter: none;
}
html[data-theme='light'] .account-form-msg--ok {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #065f46;
}
html[data-theme='light'] .account-form-msg--error {
  background: rgba(254, 226, 226, 0.9);
  border-color: rgba(220, 38, 38, 0.25);
  color: #7f1d1d;
}
html[data-theme='light'] .account-form-msg--pending {
  color: rgba(17, 24, 39, 0.75);
}

html[data-theme='light'] .dash-modal-title-blue {
  color: #1e3a8a;
}
html[data-theme='light'] .dash-modal-muted {
  color: rgba(17, 24, 39, 0.65);
}
html[data-theme='light'] .dash-modal-form .dash-modal-label {
  color: rgba(17, 24, 39, 0.75);
}
html[data-theme='light'] .dash-modal-input,
html[data-theme='light'] .dash-modal-textarea {
  background: #fff;
  color: #111827;
  border-color: rgba(0, 0, 0, 0.15);
}
html[data-theme='light'] .dash-modal-msg {
  color: #b91c1c;
}

html[data-theme='light'] .crucible-modal {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
}
html[data-theme='light'] .crucible-modal__header h2 {
  color: #0f172a;
}
html[data-theme='light'] .crucible-modal__body {
  color: rgba(17, 24, 39, 0.88);
}
html[data-theme='light'] .crucible-btn--secondary {
  background: #f3f4f6;
  color: #111827;
  border: 1px solid rgba(0, 0, 0, 0.1);
}
html[data-theme='light'] .crucible-btn--secondary:hover {
  background: #e5e7eb;
}

html[data-theme='light'] .ra-modal__panel {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
}
html[data-theme='light'] .ra-modal__text {
  color: rgba(17, 24, 39, 0.88);
}
html[data-theme='light'] .ra-modal__btn {
  background: #f3f4f6;
  border-color: rgba(0, 0, 0, 0.12);
  color: #111827;
}
html[data-theme='light'] .ra-modal__btn:hover {
  background: #e5e7eb;
}
html[data-theme='light'] .ra-modal__btn--primary {
  background: rgba(29, 78, 216, 0.12);
  border-color: rgba(29, 78, 216, 0.45);
  color: #1d4ed8;
}
html[data-theme='light'] .ra-modal__btn--primary:hover {
  background: rgba(29, 78, 216, 0.2);
}

html[data-theme='light'] .app-form-error {
  color: #7f1d1d;
  background: rgba(254, 226, 226, 0.85);
  border-color: rgba(220, 38, 38, 0.25);
}
html[data-theme='light'] .app-form-notice {
  color: #1e3a8a;
  background: rgba(219, 234, 254, 0.9);
  border-color: rgba(29, 78, 216, 0.25);
}

/* Foundry rail teal labels (foundry-pipeline.css) — Past gap analysis rail uses navy */
html[data-theme='light'] .app-body--foundry .app-insight--foundry-rail .foundry-rail-section--past > .insight-h,
html[data-theme='light'] .app-body--foundry .app-insight--foundry-rail .foundry-rail-tile__title {
  color: #1e3a8a !important;
}
html[data-theme='light'] .app-body--foundry .foundry-rail-proc__lbl {
  color: #1e3a8a !important;
}
html[data-theme='light'] .foundry-rail-section .insight-h--teal,
html[data-theme='light'] .insight-h--teal {
  color: var(--accent-teal-dark) !important;
}
html[data-theme='light'] .app-body--foundry .app-insight--foundry-rail .foundry-rail-section--processing > .insight-h.insight-h--teal {
  color: #1e3a8a !important;
}

/* Research Anatomy rail scores / nodes */
html[data-theme='light'] .ra-node__score,
html[data-theme='light'] .ra-rail.is-active .ra-rail__span {
  color: var(--accent-teal-dark) !important;
}
html[data-theme='light'] .ra-cooldown-msg {
  color: var(--accent-teal-dark);
}
html[data-theme='light'] .ra-assessment-table th {
  color: rgba(17, 24, 39, 0.55);
}
html[data-theme='light'] .ra-assessment-table td {
  color: rgba(17, 24, 39, 0.88);
}
html[data-theme='light'] .ra-assessment-table td:last-child {
  color: var(--accent-teal-dark) !important;
}

/* Research Anatomy — center scroll tile (light) + right rail navy chrome */
html[data-theme='light'] .app-body--research-anatomy .ra-stage__scroll-tile {
  background: var(--bg);
  border-color: var(--line);
}
html[data-theme='light'] .app-body--research-anatomy .ra-tier__label {
  color: rgba(17, 24, 39, 0.55);
}
html[data-theme='light'] .app-body--research-anatomy .ra-tier__label-line {
  background: rgba(0, 0, 0, 0.1);
}
html[data-theme='light'] .app-body--research-anatomy .ra-node {
  background: var(--card);
  border-color: var(--line);
  border-left-color: rgba(30, 58, 138, 0.22);
}
html[data-theme='light'] .app-body--research-anatomy .ra-node:hover {
  background: rgba(0, 0, 0, 0.03);
}
html[data-theme='light'] .app-body--research-anatomy .ra-node.is-active {
  background: rgba(29, 78, 216, 0.06);
  border-left-color: var(--blue);
}
html[data-theme='light'] .app-body--research-anatomy .ra-node__title {
  color: rgba(17, 24, 39, 0.72);
}
html[data-theme='light'] .app-body--research-anatomy .ra-node.is-active .ra-node__title {
  color: #0f172a;
}
html[data-theme='light'] .app-body--research-anatomy .ra-node__desc {
  color: rgba(17, 24, 39, 0.62);
}
html[data-theme='light'] .app-body--research-anatomy .ra-node__eval {
  border-top-color: var(--line);
}
html[data-theme='light'] .app-body--research-anatomy .ra-node__eval-label {
  color: rgba(17, 24, 39, 0.55);
}
html[data-theme='light'] .app-body--research-anatomy .ra-node__score-line {
  color: #111827;
}
html[data-theme='light'] .app-body--research-anatomy .ra-node__feedback {
  color: rgba(17, 24, 39, 0.78);
}
html[data-theme='light'] .app-body--research-anatomy .ra-connector__v {
  background: rgba(0, 0, 0, 0.12);
}
html[data-theme='light'] .app-body--research-anatomy .ra-connector__arrow {
  border-top-color: rgba(0, 0, 0, 0.22);
}
html[data-theme='light'] .app-body--research-anatomy .ra-persistent-head__text {
  color: rgba(17, 24, 39, 0.55);
}
html[data-theme='light'] .app-body--research-anatomy .ra-persistent-head__line {
  background: rgba(0, 0, 0, 0.1);
}
html[data-theme='light'] .app-body--research-anatomy .ra-rail {
  background: var(--card);
  border-color: var(--line);
  border-left-color: rgba(30, 58, 138, 0.18);
}
html[data-theme='light'] .app-body--research-anatomy .ra-rail:hover {
  background: rgba(0, 0, 0, 0.03);
}
html[data-theme='light'] .app-body--research-anatomy .ra-rail.is-active {
  background: rgba(29, 78, 216, 0.06);
  border-left-color: var(--blue);
}
html[data-theme='light'] .app-body--research-anatomy .ra-rail__badge {
  color: rgba(17, 24, 39, 0.5);
  border-color: var(--line);
}
html[data-theme='light'] .app-body--research-anatomy .ra-rail.is-active .ra-rail__badge {
  color: var(--blue);
  border-color: rgba(29, 78, 216, 0.28);
}
html[data-theme='light'] .app-body--research-anatomy .ra-rail__title {
  color: rgba(17, 24, 39, 0.75);
}
html[data-theme='light'] .app-body--research-anatomy .ra-rail.is-active .ra-rail__title {
  color: #0f172a;
}
html[data-theme='light'] .app-body--research-anatomy .ra-rail__span {
  color: rgba(17, 24, 39, 0.5);
}
html[data-theme='light'] .app-body--research-anatomy .ra-rail__chev {
  color: rgba(17, 24, 39, 0.45);
}
html[data-theme='light'] .app-body--research-anatomy .ra-rail.is-active .ra-rail__chev {
  color: var(--blue);
}
html[data-theme='light'] .app-body--research-anatomy .ra-rail__expand {
  border-top-color: var(--line);
}
html[data-theme='light'] .app-body--research-anatomy .ra-rail__desc {
  color: rgba(17, 24, 39, 0.65);
}
html[data-theme='light'] .app-body--research-anatomy .ra-stage__footer-line {
  background: rgba(0, 0, 0, 0.1);
}
html[data-theme='light'] .app-body--research-anatomy .ra-stage__footer-brand {
  color: rgba(17, 24, 39, 0.45);
}

html[data-theme='light'] .app-insight.app-research-anatomy-rail .insight-h.ra-rail-shell__heading {
  color: var(--btn-secondary-text) !important;
  font-weight: 700;
}
html[data-theme='light'] .app-insight.app-research-anatomy-rail .ra-review-btn {
  background: var(--btn-secondary-text);
  color: #fff;
  border-color: rgba(30, 58, 138, 0.38);
}
html[data-theme='light'] .app-insight.app-research-anatomy-rail .ra-review-btn:hover:not(:disabled) {
  opacity: 0.92;
}
html[data-theme='light'] .app-insight.app-research-anatomy-rail .ra-assessment-desc {
  color: rgba(17, 24, 39, 0.72);
}
