/* Dark mode for the IPS AI Program Tracker (Greg, 1 Oct 2026).
   Everything here is scoped to html[data-theme="dark"], so in light mode this file does nothing.
   The page sets most colours one by one rather than through tokens, so this file has two parts:
   1. the shared colour tokens, switched in one place;
   2. overrides for the rules and inline styles that use fixed light colours.
   Screen only: printing always uses the light look. */

@media screen {

/* ---- 1. tokens ---- */
html[data-theme="dark"]{
  color-scheme: dark;
  --ink:#e6edf3; --charcoal:#9cc3ea; --bg:#0f1720; --card:#17212c; --line:#2b3a4a; --mut:#9aa8b6;
  --green-d:#4da3e6; --green-l:#16283a; --navy:#9cc3ea;
  --s1:#2a3440; --s6:#1f3d7a;
  --newline:#5a4a1e;
}
html[data-theme="dark"] body{background:var(--bg);color:var(--ink)}

}

/* ---- 2. overrides for fixed light colours, page section by section ---- */
/* ===== part 1: 78 rules ===== */
@media screen{
html[data-theme="dark"] .tlrow{background:#17212c}
html[data-theme="dark"] .tlrow.used{background:#1d2835}
html[data-theme="dark"] .fvpane{background:#17212c}
html[data-theme="dark"] .fvpane .fvnote{color:#f2c46b;background:#3a3118;border-bottom-color:#6a5424}
html[data-theme="dark"] .fwblk{background:#1d2835}
html[data-theme="dark"] .bpeek{background:#1d2835;border-color:#3a4d63;box-shadow:0 -3px 8px rgba(0,0,0,.40)}
html[data-theme="dark"] .bpeek + .bpeek{background:#17212c}
html[data-theme="dark"] .bpeek:hover{background:#233041}
html[data-theme="dark"] .bcard.stacked{border-color:#3a4d63;box-shadow:0 8px 18px rgba(0,0,0,.45)}
html[data-theme="dark"] .stkitem{color:#4da3e6}
html[data-theme="dark"] .stksec{border-color:#2b3a4a;background:#16283a}
html[data-theme="dark"] .edu-learn{background:#17212c}
html[data-theme="dark"] .edu-btn.edu-ghost{background:#17212c}
html[data-theme="dark"] .edu-track h2 .edu-who{background:#17212c}
html[data-theme="dark"] .edu-patch{background:#17212c;box-shadow:0 4px 12px rgba(0,0,0,.35)}
html[data-theme="dark"] .edu-patch:hover,html[data-theme="dark"] .edu-patch:focus-visible{box-shadow:0 12px 24px rgba(0,0,0,.55)}
html[data-theme="dark"] .edu-badge{box-shadow:0 0 0 4px #17212c,0 0 0 7px var(--c),0 6px 14px rgba(0,0,0,.45)}
html[data-theme="dark"] .dp-grid div{background:#1d2835}
html[data-theme="dark"] .dp-res{background:#1d2835}
html[data-theme="dark"] .rlane input,html[data-theme="dark"] .rlane select{background:#0f1720;color:#e6edf3;border-color:rgba(255,255,255,.25)}
html[data-theme="dark"] .rl-cost.quoted input{background:#3a3118;color:#f2c46b}
html[data-theme="dark"] .dp-meet{background:#3a3118;color:#f2c46b}
html[data-theme="dark"] .dpitem{background:#17212c}
html[data-theme="dark"] .dc-timer{background:#183222;color:#7fd394;border-color:#2c5a3c}
html[data-theme="dark"] .dc-timer.warn{background:#3a3118;color:#f2c46b;border-color:#6a5424}
html[data-theme="dark"] .dc-timer.over{background:#3a1d20;color:#ff9b93;border-color:#6e3338}
html[data-theme="dark"] .dc-timer.none{background:#1d2835}
html[data-theme="dark"] .bstep{background:#17212c}
html[data-theme="dark"] .bgate{background:#3a3118;border-color:#6a5424}
html[data-theme="dark"] .bgate b{color:#f2c46b}
html[data-theme="dark"] .bexit{background:#1d2835}
html[data-theme="dark"] .bfacts{background:#1d2835}
html[data-theme="dark"] .orow .orx{background:#17212c;color:#ff9b93}
html[data-theme="dark"] .orow .orx:hover{background:#3a1d20;border-color:#ff9b93}
html[data-theme="dark"] .oslabreak{background:#3a1d20;border-color:#6e3338;color:#ff9b93}
html[data-theme="dark"] a.dlbtn,html[data-theme="dark"] button.dlbtn,html[data-theme="dark"] .omedia-btn{background:#17212c}
html[data-theme="dark"] a.dlbtn:hover,html[data-theme="dark"] button.dlbtn:hover,html[data-theme="dark"] .omedia-btn:hover{background:#233041}
html[data-theme="dark"] .omedia-item{background:#1d2835}
html[data-theme="dark"] .omedia-x:hover{color:#ff9b93}
html[data-theme="dark"] .oimport{background:#3a3118;border-color:#6a5424}
html[data-theme="dark"] .oimport b{color:#f2c46b}
html[data-theme="dark"] .oimport.ok{background:#183222;border-color:#2c5a3c}
html[data-theme="dark"] .oimport.ok b{color:#7fd394}
html[data-theme="dark"] .costlock{background:#17212c;box-shadow:0 6px 16px rgba(0,0,0,.40)}
html[data-theme="dark"] .costlock input{background:#0f1720;color:#e6edf3;border-color:#2b3a4a}
html[data-theme="dark"] .costlock .err{color:#ff9b93}
html[data-theme="dark"] .cost-uc{background:#1d2835}
html[data-theme="dark"] .skilljar{background:#17212c}
html[data-theme="dark"] .sj-head{background:#1d2835}
html[data-theme="dark"] .sj-head:hover{background:#233041}
html[data-theme="dark"] .sj-head:focus-visible,html[data-theme="dark"] .sj-item:focus-visible{outline-color:#4da3e6}
html[data-theme="dark"] .sj-item{border-bottom-color:#2b3a4a}
html[data-theme="dark"] .sj-item:hover{background:#233041}
html[data-theme="dark"] .uc-pole{stroke:#9aa8b6}
html[data-theme="dark"] .cpill{background:#17212c}
html[data-theme="dark"] .cpill.on{background:#1D456F;border-color:#4da3e6;color:#fff}
html[data-theme="dark"] .cvdetails{background:#17212c}
html[data-theme="dark"] .cvdetails summary{color:#4da3e6}
html[data-theme="dark"] .bul .bl-est{background:#2a4d73}
html[data-theme="dark"] .bul .bl-val,html[data-theme="dark"] .cleg{color:#9aa8b6}
html[data-theme="dark"] .ytile>div{background:#17212c}
html[data-theme="dark"] .viztip{background:#233041;box-shadow:0 8px 22px rgba(0,0,0,.55),0 0 0 1px #3a4d63}
html[data-theme="dark"] .vbox{background:#17212c}
html[data-theme="dark"] .vbox.spend{border-left-color:#ff9b93}
html[data-theme="dark"] .vbox.saved{border-left-color:#7fd394}
html[data-theme="dark"] .vbox.cross{border-left-color:#4da3e6}
html[data-theme="dark"] .lineage:hover{background:#233041}
html[data-theme="dark"] .pbrow{border-bottom-color:#2b3a4a}
html[data-theme="dark"] .pbrow .over{color:#ff9b93}
html[data-theme="dark"] .pbrow .under{color:#7fd394}
html[data-theme="dark"] .lgin{background:#0f1720;color:#e6edf3;border-color:#2b3a4a}
html[data-theme="dark"] .utable td{border-bottom-color:#2b3a4a}
html[data-theme="dark"] .ubtn{background:#17212c}
html[data-theme="dark"] .ubtn:hover{background:#233041}
html[data-theme="dark"] .ubtn.danger{color:#ff9b93}
html[data-theme="dark"] .ubtn.danger:hover{background:#3a1d20;border-color:#ff9b93}
html[data-theme="dark"] .unote{background:#3a3118;border-color:#6a5424;color:#f2c46b}
html[data-theme="dark"] .unote.bad{background:#3a1d20;border-color:#6e3338;color:#ff9b93}
html[data-theme="dark"] .odecided{background:#183222;border-color:#2c5a3c}
html[data-theme="dark"] .odecided.no{background:#3a1d20;border-color:#6e3338}
html[data-theme="dark"] .reqitem{background:#17212c}
html[data-theme="dark"] .wkbtn.on{color:#1a2732}
}

/* ===== part 2: 122 rules ===== */
@media screen {
html[data-theme="dark"] .stagedates input[type=date]{background:#1d2835}
html[data-theme="dark"] .stagebasenote{color:#f2c46b;background:#3a3118;border-color:#5c4a1c}
html[data-theme="dark"] .effpanel{background:#17212c;box-shadow:0 8px 22px rgba(0,0,0,.4)}
html[data-theme="dark"] .effadd{background:#1d2835}
html[data-theme="dark"] .effadd>input,html[data-theme="dark"] .effadd-row input,html[data-theme="dark"] .effadd-row select{background:#17212c;color:#e6edf3}
html[data-theme="dark"] .eff-card{background:#17212c}
html[data-theme="dark"] .eff-status{background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12"><path d="M2.5 4.5 6 8l3.5-3.5" fill="none" stroke="%234da3e6" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg>')}
html[data-theme="dark"] .eff-card.is-idea .eff-status{background-color:#3a3118;color:#f2c46b;background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12"><path d="M2.5 4.5 6 8l3.5-3.5" fill="none" stroke="%23f2c46b" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg>')}
html[data-theme="dark"] .eff-card.is-idea .eff-status:hover{border-color:#f2c46b}
html[data-theme="dark"] .eff-status option{background:#17212c}
html[data-theme="dark"] .eff-conf{background-color:#17212c;background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12"><path d="M2.5 4.5 6 8l3.5-3.5" fill="none" stroke="%23f2c46b" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg>');color:#f2c46b;border-color:#5c4a1c}
html[data-theme="dark"] .eff-conf.set{background-color:#3a3118}
html[data-theme="dark"] .eff-conf:hover,html[data-theme="dark"] .eff-conf:focus{border-color:#f2c46b}
html[data-theme="dark"] .eff-conf option{background:#17212c}
html[data-theme="dark"] .eff-chip.conf{background:#3a3118;color:#f2c46b;border-color:#5c4a1c}
html[data-theme="dark"] .eff-fb{color:#9aa8b6}
html[data-theme="dark"] .eff-chip.time{background:#16283a;color:#4da3e6}
html[data-theme="dark"] .eff-chip.money{background:#183222;color:#7fd394}
html[data-theme="dark"] .eff-card .del,html[data-theme="dark"] .stagedel,html[data-theme="dark"] .tlc .tldel,html[data-theme="dark"] .litem .del,html[data-theme="dark"] .tcard .del2{color:#ff9b93}
html[data-theme="dark"] .panel{background:#17212c}
html[data-theme="dark"] .panel h3{background:#1d2835}
html[data-theme="dark"] .stagebar{background:#233041}
html[data-theme="dark"] .stagerow{border-bottom-color:#2b3a4a}
html[data-theme="dark"] .stageslide,html[data-theme="dark"] .stageslide.ss-ns{background:#1d2835}
html[data-theme="dark"] .stageslide.ss-ip{background:#3a3118;border-color:#5c4a1c}
html[data-theme="dark"] .stageslide.ss-cp{background:#183222;border-color:#2c5a3b}
html[data-theme="dark"] .stagecount.zero{background:#233041}
html[data-theme="dark"] .stageadd-row input,html[data-theme="dark"] .stageadd textarea,html[data-theme="dark"] .addrow input,html[data-theme="dark"] .addrow select,html[data-theme="dark"] .addrow textarea{background:#1d2835;color:#e6edf3}
html[data-theme="dark"] .tl{border-left-color:#2b3a4a}
html[data-theme="dark"] .tlc:before{border-color:#17212c}
html[data-theme="dark"] .tlc .tltxt,html[data-theme="dark"] .tcard .txt{color:#e6edf3}
html[data-theme="dark"] .litem,html[data-theme="dark"] .upditem,html[data-theme="dark"] .fitem{border-bottom-color:#2b3a4a}
html[data-theme="dark"] .litem:not(.done) .chk{border-color:#5f7185}
html[data-theme="dark"] .sev-low{background:#16283a;color:#4da3e6}
html[data-theme="dark"] .sev-med{background:#3a3118;color:#f2c46b}
html[data-theme="dark"] .sev-high{background:#3a1d20;color:#ff9b93}
html[data-theme="dark"] .rmtl-dot{background:#17212c;border-color:#5f7185}
html[data-theme="dark"] .rmtl-item.rmtl-future .rmtl-dot{background:#17212c}
html[data-theme="dark"] .rmtl-del{background:#17212c;color:#ff9b93}
html[data-theme="dark"] .rmtl-item:hover .rmtl-del{border-color:#ff9b93}
html[data-theme="dark"] .ittl-dot{background:#17212c}
html[data-theme="dark"] .ittl-item.ittl-late .ittl-dot{background:#ff9b93;border-color:#ff9b93}
html[data-theme="dark"] .ps-shelved{background:#233041;color:#9aa8b6}
html[data-theme="dark"] .folder{background:#17212c}
html[data-theme="dark"] .folder-tab{background:#1d2835}
html[data-theme="dark"] .folder-tab:hover{background:#233041}
html[data-theme="dark"] .folder-badge{border-color:#1d2835}
html[data-theme="dark"] .folder-count{background:#17212c}
html[data-theme="dark"] .fitem .frow button{background:#1d2835}
html[data-theme="dark"] .qmsdrop{border-color:#5f7185;background:#1d2835}
html[data-theme="dark"] .qmsdrop:hover{border-color:#4da3e6;background:#16283a}
html[data-theme="dark"] .tk{background:#17212c}
html[data-theme="dark"] .tk.on-ns{background:#2b3a4a;color:#e6edf3;border-color:#5f7185}
html[data-theme="dark"] .tk.on-ip{background:#3a3118;color:#f2c46b;border-color:#5c4a1c}
html[data-theme="dark"] .tk.on-cp{background:#183222;color:#7fd394;border-color:#2c5a3b}
html[data-theme="dark"] .pctwrap{background:#3a3118;border-color:#5c4a1c}
html[data-theme="dark"] .pctwrap label{color:#f2c46b}
html[data-theme="dark"] .pctwrap input{background:#17212c;color:#e6edf3;border-color:#5c4a1c}
html[data-theme="dark"] .pctwrap .pbar2{background:#5c4a1c}
html[data-theme="dark"] .threadbox{background:#1d2835}
html[data-theme="dark"] .threadbox textarea,html[data-theme="dark"] .threadbox select,html[data-theme="dark"] .cddate input{background:#17212c;color:#e6edf3}
html[data-theme="dark"] .tcard{background:#17212c}
html[data-theme="dark"] .ocard{background:#17212c;box-shadow:0 6px 16px rgba(0,0,0,.35)}
html[data-theme="dark"] .ocard:hover{box-shadow:0 12px 26px rgba(0,0,0,.5)}
html[data-theme="dark"] .ocard.od{border-left-color:#ff9b93;background:#3a1d20}
html[data-theme="dark"] .obadge.src{background:#1d2835;color:#9aa8b6}
html[data-theme="dark"] .oform{background:#1d2835}
html[data-theme="dark"] .oform.empty{background:#17212c}
html[data-theme="dark"] .oform.pending{background:#3a3118;border-color:#5c4a1c}
html[data-theme="dark"] .oform.pending b{color:#f2c46b}
html[data-theme="dark"] .oformchip{background:#1d2835;color:#4da3e6}
html[data-theme="dark"] .oformchip:hover{background:#233041;border-color:#4da3e6}
html[data-theme="dark"] .oback{background:#1d2835;color:#9aa8b6}
html[data-theme="dark"] .oback:hover{background:#233041;color:#e6edf3}
html[data-theme="dark"] .oback.go{color:#c9a6f2}
html[data-theme="dark"] .oback.go:hover{background:#251c38;color:#c9a6f2}
html[data-theme="dark"] .oclock{color:#7fd394}
html[data-theme="dark"] .oclock.warn{color:#f2c46b}
html[data-theme="dark"] .oclock.od{color:#ff9b93}
html[data-theme="dark"] .opp-empty{background:#17212c}
html[data-theme="dark"] .gate{background:#17212c}
html[data-theme="dark"] .kindchip{background:#1d2835}
html[data-theme="dark"] .kindchip.proj{background:#16283a;border-color:#2a4560;color:#4da3e6}
html[data-theme="dark"] .kindchip.tl{background:#3a1d20;border-color:#5c2a2e;color:#ff9b93}
html[data-theme="dark"] .kindchip.bs{background:#183222;border-color:#2c5a3b;color:#7fd394}
html[data-theme="dark"] .kindchip.air{background:#3a3118;border-color:#5c4a1c;color:#f2c46b}
html[data-theme="dark"] .clspill{background:#17212c}
html[data-theme="dark"] .clspill span{background:rgba(255,255,255,.12)}
html[data-theme="dark"] .clspill.on span{background:rgba(255,255,255,.3)}
html[data-theme="dark"] .clspill.all.on{background:#2f6ba8;border-color:#2f6ba8}
html[data-theme="dark"] .colhead:hover,html[data-theme="dark"] .colhead:focus-visible{box-shadow:0 0 0 3px rgba(77,163,230,.35)}
html[data-theme="dark"] .pullbtn{background:#3a1d20;color:#ff9b93}
html[data-theme="dark"] .pullbtn:hover{background:#4a262a}
html[data-theme="dark"] .zone.over{background:#16283a}
html[data-theme="dark"] .bcard{background:#17212c;box-shadow:0 4px 12px rgba(0,0,0,.35)}
html[data-theme="dark"] #bghost{box-shadow:0 14px 34px rgba(0,0,0,.6)}
html[data-theme="dark"] .clssel{background:#1d2835}
html[data-theme="dark"] .clssel.c-ai{background:#183222;color:#7fd394}
html[data-theme="dark"] .clssel.c-purchase{background:#271d3b;color:#c9a6f2}
html[data-theme="dark"] .clssel.c-existing{background:#16283a;color:#4da3e6}
html[data-theme="dark"] .needcls{background:#3a3118;border-color:#5c4a1c;color:#f2c46b}
html[data-theme="dark"] .bopen{background:#1d2835;color:#4da3e6;border-color:#2a4560}
html[data-theme="dark"] .bopen:hover{background:#233041}
html[data-theme="dark"] .bnone{background:#17212c}
html[data-theme="dark"] .orphans{background:#17212c}
html[data-theme="dark"] .orphans button{background:#1d2835}
html[data-theme="dark"] .cdtab{background:#1d2835}
html[data-theme="dark"] .cdtab .cdn{background:rgba(255,255,255,.12)}
html[data-theme="dark"] .cdtab.on .cdn{background:rgba(255,255,255,.28)}
html[data-theme="dark"] .cdstage{background:#1d2835}
html[data-theme="dark"] .airm-name,html[data-theme="dark"] .airm-track{border-bottom-color:#2b3a4a}
html[data-theme="dark"] .airm-qline{border-left-color:#2b3a4a}
html[data-theme="dark"] .cdcheck{background:#17212c}
html[data-theme="dark"] .cdcheck.on{background:#183222;border-color:#2c5a3b}
html[data-theme="dark"] .cdcheck.gate{background:#3a3118;border-color:#5c4a1c}
html[data-theme="dark"] .cdcheck.gate.on{background:#183222;border-color:#2c5a3b}
html[data-theme="dark"] .cdcheck .cdby{color:#7fd394}
html[data-theme="dark"] .cdact{background:#16283a;border-color:#2a4560}
html[data-theme="dark"] .bsnote{background:#3a3118;border-color:#5c4a1c}
html[data-theme="dark"] .bsnote p{color:#f2c46b}
html[data-theme="dark"] .updrop{background:#17212c}
html[data-theme="dark"] .updrop:hover,html[data-theme="dark"] .updrop.over,html[data-theme="dark"] .updrop:focus-visible{background:#16283a}
}

/* ===== part 3: 74 rules ===== */
@media screen{
/* ---- buttons and option cards ---- */
html[data-theme="dark"] .hbtns button:not(.oppact),
html[data-theme="dark"] .cperiod button,
html[data-theme="dark"] .dbtn2,
html[data-theme="dark"] .createopt{background:#17212c}
html[data-theme="dark"] .createopt:hover{background:#233041}
html[data-theme="dark"] .createopt b{color:#4da3e6}
html[data-theme="dark"] .need-val{color:#4da3e6}

/* ---- opportunity tiles ---- */
html[data-theme="dark"] .ftile:not(.sel):hover{box-shadow:0 12px 26px rgba(0,0,0,.5)}
html[data-theme="dark"] .ftile.sel .ftile-num{background:#17212c}
html[data-theme="dark"] .ftile-ownin{background:transparent;border-color:transparent;color:#9aa8b6}
html[data-theme="dark"] .ftile-ownin:hover{border-color:#2b3a4a;background:#1d2835}
html[data-theme="dark"] .ftile-ownin:focus{border-color:#4da3e6;background:#1d2835;color:#e6edf3}
html[data-theme="dark"] .ftile.assigned{background:#3a3118;border-top-color:#2b3a4a;border-right-color:#2b3a4a;border-bottom-color:#2b3a4a}
html[data-theme="dark"] .ftile.assigned.sel{background:#16283a;border-color:var(--green)}
html[data-theme="dark"] .ftile.assigned.mpick{background:#16283a}

/* ---- update banner, ROI box, suggested path ---- */
html[data-theme="dark"] .fbanner{background:#17212c}
html[data-theme="dark"] .fchip.fc-orange{background:#3a3118;color:#f2c46b;border-color:#2b3a4a}
html[data-theme="dark"] .fchip.fc-note{background:#1d2835;color:#9aa8b6;border-color:#2b3a4a}
html[data-theme="dark"] .fb-note{color:#9aa8b6}
html[data-theme="dark"] .roi-line b{color:#9cc3ea}
html[data-theme="dark"] .supersede{background:#1d2835;color:#9aa8b6}
html[data-theme="dark"] .pathbox{background:#3a3118}
html[data-theme="dark"] .path-h,
html[data-theme="dark"] .path-line{color:#f2c46b}

/* ---- source toggle ---- */
html[data-theme="dark"] .srctoggle{background:#1d2835}
html[data-theme="dark"] .srchead.ips{background:#16283a;border-color:#2b3a4a;color:#9cc3ea}
html[data-theme="dark"] .srchead.telus{background:#1d2835;border-color:#2b3a4a;color:#e6edf3}

/* ---- cost tracking tab ---- */
html[data-theme="dark"] .costrow,
html[data-theme="dark"] .fc-cbrow,
html[data-theme="dark"] .qmsrow,
html[data-theme="dark"] .estrow,
html[data-theme="dark"] .eva-row,
html[data-theme="dark"] .cmp-brow{border-bottom-color:#2b3a4a}
html[data-theme="dark"] .costrow.wkrow{background:#1d2835}
html[data-theme="dark"] .costrow.wkrow .cl,
html[data-theme="dark"] .costrow.wkrow .wkpos,
html[data-theme="dark"] .costrow.wkrow .ct{color:#9aa8b6}
html[data-theme="dark"] .fc-card,
html[data-theme="dark"] .fc-cbyr{border-color:#2b3a4a}
html[data-theme="dark"] .cmp-track,
html[data-theme="dark"] .fc-cbkpi{background:#1d2835}
html[data-theme="dark"] .cmp-net.pos,
html[data-theme="dark"] .eva-var.pos{background:#183222;color:#7fd394}
html[data-theme="dark"] .cmp-net.neg,
html[data-theme="dark"] .eva-var.neg{background:#3a1d20;color:#ff9b93}
html[data-theme="dark"] .eva-var.neu{background:#1d2835}
html[data-theme="dark"] .cmp-onetime{background:#16283a;color:#4da3e6}
html[data-theme="dark"] .fc-cbh.cost{color:#9aa8b6}
html[data-theme="dark"] .fc-cbyr b.pos{color:#7fd394}
html[data-theme="dark"] .fc-cbyr b.neg{color:#ff9b93}
html[data-theme="dark"] .qmsrow.is-approved{background:#183222}
html[data-theme="dark"] .effkpis div.fc b,
html[data-theme="dark"] .effkpis div.fc span{color:#f2c46b}
html[data-theme="dark"] .eff-pos-sub{color:#9aa8b6}
html[data-theme="dark"] .eff-chip.rate{background:#1d2835;color:#9aa8b6}
html[data-theme="dark"] .eff-chip.money.onetime{background:#16283a;color:#4da3e6}

/* ---- weekly progress report ---- */
html[data-theme="dark"] .wkstat.warn b{color:#ff9b93}
html[data-theme="dark"] .wkproj{box-shadow:0 4px 14px rgba(0,0,0,.35)}
html[data-theme="dark"] .wkchip{background:#1d2835;color:#9aa8b6}
html[data-theme="dark"] .wkchip.hrs{background:#16283a;color:#4da3e6}
html[data-theme="dark"] .wkchip.on,
html[data-theme="dark"] .k-on{background:#183222;color:#7fd394}
html[data-theme="dark"] .wkchip.risk,
html[data-theme="dark"] .k-risk{background:#3a3118;color:#f2c46b}
html[data-theme="dark"] .wkchip.behind,
html[data-theme="dark"] .k-behind,
html[data-theme="dark"] .pill-warn{background:#3a1d20;color:#ff9b93}
html[data-theme="dark"] .wkline{border-top-color:#2b3a4a}
html[data-theme="dark"] .wkask{background:#3a1d20;border-top-color:#2b3a4a;border-right-color:#2b3a4a;border-bottom-color:#2b3a4a}
html[data-theme="dark"] .uconst{background:#17212c}
html[data-theme="dark"] .chkitem{background:#1d2835}

/* ---- projects ---- */
html[data-theme="dark"] .livelink:hover{background:#233041}
html[data-theme="dark"] .dbtn.done.on{background:#183222;color:#7fd394}

/* ---- data consolidation tab ---- */
html[data-theme="dark"] .destwrap,
html[data-theme="dark"] .dcard2{background:#17212c;box-shadow:0 6px 16px rgba(0,0,0,.35)}
html[data-theme="dark"] .dcard2.st-done{box-shadow:0 6px 16px rgba(20,107,74,.45)}
html[data-theme="dark"] .dcard2.st-plan{box-shadow:0 6px 16px rgba(52,104,151,.45)}
html[data-theme="dark"] .hubwrap{background:#17212c}
html[data-theme="dark"] .planitem,
html[data-theme="dark"] .ptag.via{background:#1d2835}
html[data-theme="dark"] .ptag.via{color:#9aa8b6}
html[data-theme="dark"] .planitem .del{color:#ff9b93}
html[data-theme="dark"] .dc-success{background:#17212c;color:#7fd394;border-color:#7fd394}
html[data-theme="dark"] .dc-success:hover{background:#183222}
html[data-theme="dark"] .dc-success.on{background:#146B4A;color:#fff;border-color:#146B4A}

/* ---- month-by-month ledger ---- */
html[data-theme="dark"] .ledger th,
html[data-theme="dark"] .ledger td{border-bottom-color:#2b3a4a}
html[data-theme="dark"] .ledger thead th.sel{background:#16283a}
html[data-theme="dark"] .ledger .yr,
html[data-theme="dark"] .ledger tr.sum td,
html[data-theme="dark"] .ledger tr.sum th,
html[data-theme="dark"] .ledger tr.net td,
html[data-theme="dark"] .ledger tr.net th{background:#1d2835}
html[data-theme="dark"] .ledger tr.fc td,
html[data-theme="dark"] .ledger tr.fc th{color:#f2c46b;background:#3a3118}
html[data-theme="dark"] .ledger tr.fc .yr{background:#3a3118;color:#f2c46b}
html[data-theme="dark"] .ledger td.pos{color:#7fd394}
html[data-theme="dark"] .ledger td.neg{color:#ff9b93}
html[data-theme="dark"] .ledger .z{color:#9aa8b6}
html[data-theme="dark"] .ledger tbody th[data-why]{border-bottom-color:#9aa8b6}

/* ---- "where did this number come from?" tooltip ---- */
html[data-theme="dark"] #whyTip{background:#233041;box-shadow:0 10px 26px rgba(0,0,0,.6),0 0 0 1px #2b3a4a}
html[data-theme="dark"] [data-why]:focus-visible{outline-color:#4da3e6}
}

/* ===== part 4: 15 rules ===== */
@media screen{
/* ---- inline colours (style="..." in the markup and in the JS template strings) ----
   Scoped to #appRoot so the sign-in card stays white (the full-colour logo sits on it).
   Text rules are anchored to the start of the style or to a ";" so that border-color:#x and
   border-left-color:#x never count as a text colour. */

/* red text: errors, overdue, over plan */
html[data-theme="dark"] #appRoot [style^="color:#a1231b" i],
html[data-theme="dark"] #appRoot [style*=";color:#a1231b" i],
html[data-theme="dark"] #appRoot [style^="color:#8a1a1a" i],
html[data-theme="dark"] #appRoot [style*=";color:#8a1a1a" i]{color:#ff9b93!important}
/* amber text: warnings in the Cost notes */
html[data-theme="dark"] #appRoot [style^="color:#8a5d00" i],
html[data-theme="dark"] #appRoot [style*=";color:#8a5d00" i]{color:#f2c46b!important}
/* green text: under plan, positive net hours */
html[data-theme="dark"] #appRoot [style^="color:#006300" i],
html[data-theme="dark"] #appRoot [style*=";color:#006300" i],
html[data-theme="dark"] #appRoot [style^="color:#1e6b1e" i],
html[data-theme="dark"] #appRoot [style*=";color:#1e6b1e" i]{color:#7fd394!important}
/* purple text: "Added by team" tag */
html[data-theme="dark"] #appRoot [style^="color:#6b3fa0" i],
html[data-theme="dark"] #appRoot [style*=";color:#6b3fa0" i]{color:#c9a6f2!important}
/* blue text: estimated-cost figure */
html[data-theme="dark"] #appRoot [style^="color:#0077C8" i],
html[data-theme="dark"] #appRoot [style*=";color:#0077C8" i]{color:#4da3e6!important}
/* muted text: "(you)" in the user list */
html[data-theme="dark"] #appRoot [style^="color:#5B6770" i],
html[data-theme="dark"] #appRoot [style*=";color:#5B6770" i]{color:#9aa8b6!important}

/* light backgrounds: the grey stat boxes on the Cost summary and the purple "Added by team" tag */
html[data-theme="dark"] #appRoot [style*="var(--surface-1"],
html[data-theme="dark"] #appRoot [style*="background:#e9e1f2" i]{background:#1d2835!important}

/* borders */
html[data-theme="dark"] #appRoot [style*="border:1px dashed #c3cbd8" i]{border-color:#2b3a4a!important}
html[data-theme="dark"] #appRoot [style*="border:1px solid #f1c0bb" i]{border-color:rgba(255,155,147,.45)!important}
html[data-theme="dark"] #appRoot [style*="border-left-color:#6b3fa0" i]{border-left-color:#c9a6f2!important}
html[data-theme="dark"] #appRoot [style*="border-left-color:#a1231b" i]{border-left-color:#ff9b93!important}
html[data-theme="dark"] #appRoot [style*="border-color:#8a1a1a" i]{border-color:#ff9b93!important}

/* The change-password message gets its colour from JavaScript (msg.style.color = ...), and the
   browser rewrites the attribute as rgb(...), so it is matched in that form. */
html[data-theme="dark"] #pwMsg[style*="rgb(161, 35, 27)"]{color:#ff9b93!important}
html[data-theme="dark"] #pwMsg[style*="rgb(91, 103, 112)"]{color:#9aa8b6!important}
html[data-theme="dark"] #pwMsg[style*="rgb(30, 143, 62)"]{color:#7fd394!important}
}

/* ===== part 5: 109 rules ===== */
@media screen {
/* editable tool list, cost comparison, ledger, data lineage */
html[data-theme="dark"] .toolrow{border-bottom-color:#2b3a4a}
html[data-theme="dark"] .toolrow input{background:#1d2835}
html[data-theme="dark"] .wkmo{background:#1d2835;color:#9aa8b6}
html[data-theme="dark"] .cmp-var{background:#1d2835}
html[data-theme="dark"] .cmp-var.over{background:#3a1d20;border-color:rgba(255,155,147,.4);color:#ff9b93}
html[data-theme="dark"] .cmp-var.under{background:#183222;border-color:rgba(127,211,148,.4)}
html[data-theme="dark"] .cmp-var.warn{background:#3a3118;border-color:rgba(242,196,107,.4);color:#f2c46b}
html[data-theme="dark"] .ledger td.fut,
html[data-theme="dark"] .ledger th.fut{color:#9aa8b6;background:#1d2835}
html[data-theme="dark"] .ledger td.fut .z{color:#2b3a4a}
html[data-theme="dark"] .ledger .yr.proj{background:#1d2835;color:#9aa8b6}
html[data-theme="dark"] .lineage summary:hover{color:#9cc3ea}
html[data-theme="dark"] .lintab th,
html[data-theme="dark"] .lintab td{border-bottom-color:#2b3a4a}
html[data-theme="dark"] .estflag{background:#2e2040;color:#c9a6f2}

/* use-case quadrant pills and the finding pop-up body */
html[data-theme="dark"] .qd.MajorProject{background:#3a3118;color:#f2c46b}
html[data-theme="dark"] .qd.FillIn{background:#16283a;color:#4da3e6}
html[data-theme="dark"] .qd.LowPriority{background:#233041;color:#9aa8b6}
html[data-theme="dark"] .qd.Foundation{background:#2e2040;color:#c9a6f2}
html[data-theme="dark"] .box{background:#1d2835}
html[data-theme="dark"] .ph{background:#1d2835}
html[data-theme="dark"] .ph div{color:#e6edf3}

/* org chart */
html[data-theme="dark"] .tier.t2 .tiernum{border-color:#4da3e6;color:#9cc3ea}
html[data-theme="dark"] .tier.t3 .tiernum{color:#f2c46b}
html[data-theme="dark"] .lnode{box-shadow:0 4px 12px rgba(0,0,0,.4)}
html[data-theme="dark"] .lnode.owner{box-shadow:0 8px 20px rgba(0,0,0,.55)}
html[data-theme="dark"] .lnode.cfo{border-top-color:#4da3e6}
html[data-theme="dark"] .lbadge{background:#1D456F}
html[data-theme="dark"] .lnode.spn .lbadge,
html[data-theme="dark"] .lnode.owner .lbadge{background:#0077C8}
html[data-theme="dark"] .lnode.cfo .lbadge{background:#1D456F}
html[data-theme="dark"] .lav,
html[data-theme="dark"] .avatar{border-color:#17212c}
html[data-theme="dark"] .lnode.cfo .lav{outline-color:#4da3e6}
html[data-theme="dark"] .witem b i.ok{background:#183222;color:#7fd394}
html[data-theme="dark"] .work.none{color:#9aa8b6}
html[data-theme="dark"] .fanhead{color:#9cc3ea}
html[data-theme="dark"] .dcard{box-shadow:0 4px 12px rgba(0,0,0,.4)}
html[data-theme="dark"] .dcard:hover{box-shadow:0 12px 26px rgba(0,0,0,.55)}
html[data-theme="dark"] .dh{background:#1d2835}
html[data-theme="dark"] .rrow select{background:#1d2835}
html[data-theme="dark"] .rv-yes{background:#183222!important;color:#7fd394!important;border-color:rgba(127,211,148,.4)!important}
html[data-theme="dark"] .rv-no{background:#3a1d20!important;color:#ff9b93!important;border-color:rgba(255,155,147,.4)!important}
html[data-theme="dark"] .rv-nr{background:#233041!important;color:#9aa8b6!important}
html[data-theme="dark"] .rv-l0{background:#233041!important;color:#9aa8b6!important}
html[data-theme="dark"] .rv-l1{background:#16283a!important;color:#4da3e6!important}
html[data-theme="dark"] .rv-l2{background:#3a3118!important;color:#f2c46b!important}
html[data-theme="dark"] .rv-l3{background:#183222!important;color:#7fd394!important;border-color:rgba(127,211,148,.4)!important}
html[data-theme="dark"] .readybar{background:#2b3a4a}
html[data-theme="dark"] .dh .champx{color:#ff9b93}
html[data-theme="dark"] .addchamp{background:#0077C8}
html[data-theme="dark"] .addchamp:hover{background:#346897}

/* combine-into-one-build bar, source list and version history */
html[data-theme="dark"] .mergebar{background:#16283a;border-top-color:#2b3a4a;border-right-color:#2b3a4a;border-bottom-color:#2b3a4a}
html[data-theme="dark"] .mb-count{color:#4da3e6}
html[data-theme="dark"] .mb-go:disabled{background:#2b3a4a;color:#9aa8b6}
html[data-theme="dark"] .ftile.mpick{background:#16283a;outline-color:#4da3e6}
html[data-theme="dark"] .ftile-pick{background:#1d2835}
html[data-theme="dark"] .mergedbanner{background:#1d2835}
html[data-theme="dark"] .mergedbanner button{background:#233041}
html[data-theme="dark"] .srcrow{background:#1d2835}
html[data-theme="dark"] .srcrow:hover{background:#233041;border-color:#4da3e6;box-shadow:0 1px 6px rgba(77,163,230,.25)}
html[data-theme="dark"] .srcrow:focus-visible{outline-color:#4da3e6}
html[data-theme="dark"] .srcgo{color:#4da3e6}
html[data-theme="dark"] .srcrow .sn{color:#4da3e6}
html[data-theme="dark"] .srcpeek-note{background:#16283a;border-color:#2b3a4a;color:#e6edf3}
html[data-theme="dark"] .histrow{background:#1d2835}
html[data-theme="dark"] .histrow.cur{background:#16283a}
html[data-theme="dark"] .histnow{background:#0077C8}
html[data-theme="dark"] .histrow button{background:#1D456F}
html[data-theme="dark"] .histrow button:disabled{background:#2b3a4a;color:#9aa8b6}

/* projects / under construction selectors */
html[data-theme="dark"] .spill.on{background:#0077C8;border-color:#0077C8}
html[data-theme="dark"] .oppseg button.on{background:#0077C8}
html[data-theme="dark"] .tcount{background:#0077C8}
html[data-theme="dark"] .assignedtag{background:#3a3118;color:#f2c46b}

/* pop-up dialogs and their forms */
html[data-theme="dark"] .mask{background:rgba(0,0,0,.7)}
html[data-theme="dark"] .dlg{background:#17212c}
html[data-theme="dark"] .finddlg{background:#17212c}
html[data-theme="dark"] .dlgb textarea{background:#1d2835;color:#e6edf3}
html[data-theme="dark"] .dates input{background:#1d2835;color:#e6edf3}
html[data-theme="dark"] .dlgact .rm{color:#ff9b93}
html[data-theme="dark"] .dlgact .save,
html[data-theme="dark"] .bcform-a .save{background:#0077C8}
html[data-theme="dark"] .dlgact .save:hover{background:#346897}

/* construction tab cards and project dashboard */
html[data-theme="dark"] .cstat2{background:#17212c}
html[data-theme="dark"] .pcard{background:#17212c;box-shadow:0 6px 16px rgba(0,0,0,.4)}
html[data-theme="dark"] .pcard:hover{box-shadow:0 14px 30px rgba(0,0,0,.55)}
html[data-theme="dark"] .pcard .task{color:#e6edf3;background:#1d2835}
html[data-theme="dark"] .pcard .pbot select{background:#1d2835;color:#e6edf3}
html[data-theme="dark"] .ps-plan{background:#16283a;color:#4da3e6}
html[data-theme="dark"] .ps-prog{background:#3a3118;color:#f2c46b}
html[data-theme="dark"] .ps-pilot{background:#2e2040;color:#c9a6f2}
html[data-theme="dark"] .ps-done{background:#183222;color:#7fd394}
html[data-theme="dark"] .bctag.bug{background:#3a1d20;color:#ff9b93}
html[data-theme="dark"] .bctag.change{background:#16283a;color:#4da3e6}
html[data-theme="dark"] .bcform{background:#1d2835}
html[data-theme="dark"] .bcform textarea{background:#17212c;color:#e6edf3}
html[data-theme="dark"] .kpibox{background:#17212c}
html[data-theme="dark"] .kpibox b.warn{color:#ff9b93}

/* FTE tracker and capacity planner */
html[data-theme="dark"] .fterow{border-bottom-color:#2b3a4a}
html[data-theme="dark"] .fte-val.pos{color:#7fd394}
html[data-theme="dark"] .fte-val.neg{color:#ff9b93}
html[data-theme="dark"] .fte-val.mut{color:#9aa8b6}
html[data-theme="dark"] .fteadd input,
html[data-theme="dark"] .fteadd select{background:#1d2835;color:#e6edf3}
html[data-theme="dark"] .ftetbl th,
html[data-theme="dark"] .ftetbl td{border-bottom-color:#2b3a4a}
html[data-theme="dark"] .ftetbl .stick{background:#17212c}
html[data-theme="dark"] .ftetbl input[type=number],
html[data-theme="dark"] .ftetbl select{background:#1d2835;color:#e6edf3}
html[data-theme="dark"] .ftetbl tr.is-champ .stick{color:#ff9b93}
html[data-theme="dark"] .ftetbl .pos{color:#7fd394}
html[data-theme="dark"] .ftetbl .neg{color:#ff9b93}
html[data-theme="dark"] .ftetbl tfoot .stick{background:#1d2835}
html[data-theme="dark"] .ftetbl tr.is-auto td.ro{color:#9aa8b6}
html[data-theme="dark"] .ftetbl tr.is-auto{background:#1d2835}
html[data-theme="dark"] .ftetbl tr.is-auto .stick{background:#1d2835}
html[data-theme="dark"] .fte-auto{color:#4da3e6}
}


/* ---- 3. hand fixes, last so they win ---- */
@media screen {

/* The dark text tokens are also used as BUTTON backgrounds with white text. Those keep a dark fill. */
html[data-theme="dark"] .lbadge,
html[data-theme="dark"] .histrow button,
html[data-theme="dark"] .head .assignbtn,
html[data-theme="dark"] .cpill.on{background:#2e5f8f;border-color:#2e5f8f;color:#fff}
html[data-theme="dark"] .spill.on,
html[data-theme="dark"] .oppseg button.on,
html[data-theme="dark"] .clspill.all.on{background:#e6edf3;border-color:#e6edf3;color:#0f1720}
html[data-theme="dark"] [style*="background:var(--charcoal)"]{background:#2e5f8f!important}
html[data-theme="dark"] [style*="background:var(--ink)"]{background:#2e5f8f!important}

/* Form fields */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea{background:#1d2835;color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder{color:#7d8b99}

/* The theme switch in the top bar */
html[data-theme="dark"] .themebtn{background:#1d2835!important;border-color:#4da3e6!important}

}
