/* USTAIC dark theme (v0.9). Active when theme.js sets <html data-theme="dark">; light stays as designed.
   Shared by the main Advisor (data-page="main"), Logistics Planning ("logistics") and AI Collaboration ("collab"). */
html[data-theme="dark"]{color-scheme:dark}

/* ---------- toggle button (main Advisor top bar) ---------- */
.cx-theme .i-sun{display:none}
html[data-theme="dark"] .cx-theme .i-sun{display:block}
html[data-theme="dark"] .cx-theme .i-moon{display:none}

/* ---------- main Advisor ---------- */
html[data-theme="dark"] body{background:#121a23;color:#e3e9ef}
html[data-theme="dark"] .cx-main{background:#121a23}
html[data-theme="dark"] .cx-side{background:#0c141c}
html[data-theme="dark"] .cx-side-foot{border-top-color:#1f2b38}
html[data-theme="dark"] .cx-new{background:#16212c;border-color:#2a3a4a}
html[data-theme="dark"] .cx-new:hover,html[data-theme="dark"] .cx-item:hover{background:#17222e}
html[data-theme="dark"] .cx-item[aria-current]{background:#1c2a38}
html[data-theme="dark"] .cx-top{border-bottom-color:#1f2b38}
html[data-theme="dark"] .cx-title strong{color:#e9eef3}
html[data-theme="dark"] .cx-title-code{color:#4fd1c5}
html[data-theme="dark"] .cx-tag{background:#16302d;color:#7fe0d6}
html[data-theme="dark"] .cx-icon{color:#9fb0c0}
html[data-theme="dark"] .cx-icon:hover{background:#1a2430;color:#e9eef3}
html[data-theme="dark"] .cx-top-right #chatHelpBtn{border-color:#2a3644}
html[data-theme="dark"] .cx-hero h1{color:#e9eef3}
html[data-theme="dark"] .cx-hero p{color:#9fb0c0}
html[data-theme="dark"] .cx-hero-icon{background:#16302d;color:#7fe0d6}
html[data-theme="dark"] .cx .chat-log{background:#121a23}
html[data-theme="dark"] .cx .composer{background:#1a2430;border-color:#2a3644;box-shadow:none}
html[data-theme="dark"] .cx .composer:focus-within{border-color:#2bb3a7;box-shadow:0 0 0 3px rgba(43,179,167,.18)}
html[data-theme="dark"] .cx .composer textarea{color:#e3e9ef}
html[data-theme="dark"] .cx .composer textarea::placeholder{color:#8293a4}
html[data-theme="dark"] .cx .suggestions button{background:#1a2430;border-color:#2a3644;color:#d6dee6}
html[data-theme="dark"] .cx .suggestions button:hover{border-color:#4fd1c5;color:#7fe0d6}
html[data-theme="dark"] .cx-note{color:#8fa1b2}
html[data-theme="dark"] .cx-note strong{color:#7fe0d6}
html[data-theme="dark"] .cx .message.assistant .bubble{color:#e3e9ef}
html[data-theme="dark"] .cx .message.assistant .bubble-avatar{background:#1f3b5a;border-color:#1f3b5a}
html[data-theme="dark"] .cx .message.user .bubble{background:#223041;color:#e9eef3}
html[data-theme="dark"] .cx .message-meta{color:#8293a4}
/* services and inquiry desk */
html[data-theme="dark"] .cx .section-kicker{color:#4fd1c5}
html[data-theme="dark"] .cx .section-top h2{color:#e9eef3}
html[data-theme="dark"] .cx .section-top p{color:#9fb0c0}
html[data-theme="dark"] .cx .count-chip{background:#16302d;border-color:#21443f;color:#7fe0d6}
html[data-theme="dark"] .cx .service-card{background:#1a2430;border-color:#2a3644}
html[data-theme="dark"] .cx .service-number{color:#4fd1c5}
html[data-theme="dark"] .cx .service-card h3{color:#e9eef3}
html[data-theme="dark"] .cx .service-card p{color:#9fb0c0}
html[data-theme="dark"] .cx .service-card button{color:#4fd1c5}
html[data-theme="dark"] .cx .citation-panel,html[data-theme="dark"] .cx .info-strip{background:#152320;border-color:#21443f;color:#a9bcb9}
html[data-theme="dark"] .cx .citation-panel strong{color:#d6e6e3}
html[data-theme="dark"] .cx .citation-panel a,html[data-theme="dark"] .cx .info-strip a{color:#4fd1c5}
html[data-theme="dark"] .cx .form-card{background:#1a2430;border-color:#2a3644;box-shadow:none}
html[data-theme="dark"] .cx .form-step,html[data-theme="dark"] .cx .form-feedback{color:#4fd1c5}
html[data-theme="dark"] .cx .tag-neutral{border-color:#2a3644;color:#9fb0c0}
html[data-theme="dark"] .cx .form-card label{color:#c9d4de}
html[data-theme="dark"] .cx .form-card input,html[data-theme="dark"] .cx .form-card select,html[data-theme="dark"] .cx .form-card textarea{background:#121a23;border-color:#2a3644;color:#e3e9ef}
html[data-theme="dark"] .cx .form-card input::placeholder,html[data-theme="dark"] .cx .form-card textarea::placeholder{color:#8293a4}

/* ---------- Logistics Planning (follows the saved choice) ---------- */
html[data-theme="dark"][data-page="logistics"]{background:#121a23;color:#e3e9ef}
html[data-theme="dark"][data-page="logistics"] header{background:#0c141c}
html[data-theme="dark"][data-page="logistics"] nav button{background:#1a2430;border-color:#2a3644;color:#c9d4de}
html[data-theme="dark"][data-page="logistics"] nav button.active{background:#087c78;border-color:#087c78;color:#fff}
html[data-theme="dark"][data-page="logistics"] section{background:#1a2430;border-color:#2a3644}
html[data-theme="dark"][data-page="logistics"] p.sub,html[data-theme="dark"][data-page="logistics"] .report{color:#a9b8c6}
html[data-theme="dark"][data-page="logistics"] .field label,html[data-theme="dark"][data-page="logistics"] .checks label{color:#b4c3d1}
html[data-theme="dark"][data-page="logistics"] .field input,html[data-theme="dark"][data-page="logistics"] .field select,html[data-theme="dark"][data-page="logistics"] td input{background:#121a23;border-color:#2a3644;color:#e3e9ef}
html[data-theme="dark"][data-page="logistics"] .btn{background:#16212c;border-color:#2a3644;color:#cfe7e4}
html[data-theme="dark"][data-page="logistics"] .btn.primary{background:#087c78;border-color:#087c78;color:#fff}
html[data-theme="dark"][data-page="logistics"] th{background:#16212c;color:#b4c3d1}
html[data-theme="dark"][data-page="logistics"] td{border-bottom-color:#2a3644}
html[data-theme="dark"][data-page="logistics"] .metric{background:#16212c;border-color:#2a3644}
html[data-theme="dark"][data-page="logistics"] .metric small{color:#9fb0c0}
html[data-theme="dark"][data-page="logistics"] .metric strong{color:#e9eef3}
html[data-theme="dark"][data-page="logistics"] .diagram{background:#121a23;border-color:#2a3644}
html[data-theme="dark"][data-page="logistics"] .diagram svg rect[fill="#e4edf4"]{fill:#1f2b38;stroke:#5d8aa0}
html[data-theme="dark"][data-page="logistics"] .note{background:#2a2312;color:#e8cf8f;border-color:#4a3d1e}
html[data-theme="dark"][data-page="logistics"] .note.good{background:#12291f;color:#8fd9ae;border-color:#1f4a35}
html[data-theme="dark"][data-page="logistics"] footer{color:#8fa1b2;border-top-color:#2a3644}

/* ---------- AI Collaboration (data-page="collab"; overrides the page's own colour variables) ---------- */
html[data-theme="dark"][data-page="collab"]{--bg:#121a23;--card:#1a2430;--ink:#e3e9ef;--muted:#9fb0c0;--line:#2a3644;--soft:#16212c;--navy:#23405f;--deep:#0c141c;--accent:#2bb3a7;--accent-ink:#062a27;--a:#8fb4d6;--a-soft:#1b2a38;--b:#4fd1c5;--b-soft:#15302c;--u:#e0b25a;--warn:#e0b25a;--warn-soft:#33270f;--bad:#ff8a80;--bad-soft:#3a1a19;--good:#6fd08c;color-scheme:dark}
html[data-theme="dark"][data-page="collab"] .msg.user .bubble{color:#fff}
html[data-theme="dark"][data-page="collab"] .ownerbar{background:var(--card)}
html[data-theme="dark"][data-page="collab"] .dots i:last-child{mix-blend-mode:normal}
