/* Dark theme overrides (Marine) */
html { color-scheme: light dark; }

/* Base dark on page chrome */
body[data-theme="dark"]{background: var(--bg) !important; color: var(--text); background-image: none !important;}
/* Links */
body[data-theme="dark"] a{ color: var(--link); }
body[data-theme="dark"] a:hover{ color: var(--link-hover); }
/* Typography */
body[data-theme="dark"] .post-content{ color: var(--text); }
body[data-theme="dark"] .post-content h1,
body[data-theme="dark"] .post-content h2,
body[data-theme="dark"] .post-content h3,
body[data-theme="dark"] .post-content h4,
body[data-theme="dark"] .post-content h5,
body[data-theme="dark"] .post-content h6{ color: var(--text); }
/* Common boxes */
body[data-theme="dark"] .post-content div.infobox{ background: var(--tint-1) !important; color: var(--text) !important; }
body[data-theme="dark"] .post-content blockquote{ background: var(--tint-2); color: var(--text); }
body[data-theme="dark"] .feature,
body[data-theme="dark"] .featureBlock,
body[data-theme="dark"] .disBlock,
body[data-theme="dark"] .extrasBlock,
body[data-theme="dark"] .newextrasBlock,
body[data-theme="dark"] .fwextrasBlock,
body[data-theme="dark"] .peopleContainer,
body[data-theme="dark"] .peopleContainerBio{background: var(--surface-2) !important; color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.35);}
body[data-theme="dark"] .peopleContainerBio:before {background-image: linear-gradient(180deg,#0b1b2b 0%,#555 100%) !important;}
body[data-theme="dark"] .showit{-webkit-text-stroke: 0 !important; -webkit-text-stroke-width: 0; text-shadow: none !important; color: var(--text);}
/* Tables & rules */
body[data-theme="dark"] .post-content hr{ background: var(--border); }
body[data-theme="dark"] .post-content table,
body[data-theme="dark"] .post-content td,
body[data-theme="dark"] .post-content th{color: var(--text); border-color: var(--border);}
/* Forms */
body[data-theme="dark"] .post-content input[type="text"],
body[data-theme="dark"] .post-content input[type="tel"],
body[data-theme="dark"] .post-content input[type="url"],
body[data-theme="dark"] .post-content input[type="email"],
body[data-theme="dark"] .post-content input[type="password"],
body[data-theme="dark"] .post-content input[type="number"],
body[data-theme="dark"] .post-content textarea{ background: var(--surface); color: var(--text); border: 1px solid var(--border);}
body[data-theme="dark"] .post-content input[type="file"]{ background: var(--surface-2); }
body[data-theme="dark"] .pricefield{ background: var(--surface-2); color: var(--text); }
/* Buttons */
body[data-theme="dark"] .btn,
body[data-theme="dark"] .post-content input[type="submit"],
body[data-theme="dark"] .post-content input[type="reset"],
body[data-theme="dark"] .post-content input[type="button"]{ background: var(--btn-bg); color: var(--btn-text); border: 1px solid var(--border);}
body[data-theme="dark"] .btn:hover{ filter: brightness(1.08); }
/* Image frames */
body[data-theme="dark"] .post-content .alignleft img,
body[data-theme="dark"] .post-content .alignright img,
body[data-theme="dark"] .post-content .aligncenter img{ border-color: var(--border); }
/* Marquee / notebook tints */
body[data-theme="dark"] .marquee-wrap,
body[data-theme="dark"] .marquee-wrap .marquee,
body[data-theme="dark"] .notebook{ background: var(--surface-2) !important; }
/* Modal */
body[data-theme="dark"] .modal-content a{ color: var(--link); }
/* Tooltips */
body[data-theme="dark"] .tooltip { color: var(--link); }
/* -------- Navigation / footer bars -------- */
body[data-theme="dark"] .navigation.bg-dark,
body[data-theme="dark"] .footer.section.bg-dark,
body[data-theme="dark"] .credits.section.bg-dark{ background: #0d0f12 !important; }
body[data-theme="dark"] div.toggle-container { background: #0d0f12 !important; }
body[data-theme="dark"] .dropdown .dropbtn{ color:#ccc; background-color:transparent;}
body[data-theme="dark"] .dropdown-content,
body[data-theme="dark"] .dropdown-content-wide{ background:#0e1621; border:1px solid #243447;}
body[data-theme="dark"] .dropdown-content a,
body[data-theme="dark"] .dropdown-content-wide a{ color:#ccc; }
body[data-theme="dark"] .dropdown-content a.current-menu-item, body[data-theme="dark"] .dropdown-content-wide a.current-menu-item { color: #eee;}
body[data-theme="dark"] .dropdown-content a:hover,
body[data-theme="dark"] .dropdown-content-wide a:hover{ background:#333; }
body[data-theme="dark"] .navbar a:hover,
body[data-theme="dark"] .dropdown:hover .dropbtn{color:#fff !important; background-color:#333 !important;}
/* Footer = same background as top nav in dark mode */
body[data-theme="dark"] footer,
body[data-theme="dark"] .footer,
body[data-theme="dark"] .footer.section,
body[data-theme="dark"] .footer.section.bg-dark,
body[data-theme="dark"] .credits,
body[data-theme="dark"] .credits.section,
body[data-theme="dark"] .credits.section.bg-dark{background: #0d0f12 !important;color: #e3edf7;}
/* footer subtle divider line */
body[data-theme="dark"] .footer{ border-top: 1px solid #1a2230; }
body[data-theme="dark"] .footer-menu-block a {color: #bbb;}
body[data-theme="dark"] .footer-menu-block a:hover {color: #fff;}
body[data-theme="dark"] .footer-menu-block a.current-menu-item {color:#FFF;}
/* editor bar remains unchanged */
body[data-theme="dark"] .editor_bar {color:white; background-color: #003850 !important;}
/* for-editors stripytable and manuscript preview text */
body[data-theme="dark"] table.stripytable tr:nth-child(even){background:#2C3932;}
body[data-theme="dark"] fieldset .block{color: #fff !important;}
body[data-theme="dark"] fieldset span{color: #fff !important;}

/* -------- Toggle button -------- */
.theme-toggle{float: right; padding:3px 4px; border-radius:8px; border:1px solid #444; background:#1D1D1D; font-size:13px; position: relative; top: 17px;margin-right:5px;}
.theme-toggle:hover{background:#313131;}
@media (max-width:816.5px){.theme-toggle{position: relative; top: 15px;}}
@media (max-width: 500px){.theme-toggle{padding: 2px 2px;margin-right:3px }}

/* -------- Marine scheme (tokens) -------- */
body[data-theme="dark"][data-scheme="marine"]{
  --bg:#0a0f14; --surface:#0e1621; --surface-2:#0b1b2b; --border:#243447;
  --text:#e3edf7; --muted:#9bb0c6;
  --link:#7ad1ff; --link-hover:#a0e0ff;
  --btn-bg:#223248; --btn-text:#e3edf7;
  --tint-1:#112331; --tint-2:#0f1f2b;

  /* pricing header gradients */
  --price-grad-default:  linear-gradient(180deg,#2b2b34 0%,#5b3b47 100%);
  --price-grad-standard: linear-gradient(180deg,#203445 0%,#2b5f7e 100%);
  --price-grad-carefree: linear-gradient(180deg,#1e3a35 0%,#2b6e58 100%);
}

/* Pricing cards */
body[data-theme="dark"] #pricing-table .plan{background: var(--surface) !important; border:1px solid #243447 !important; color: var(--text) !important; text-shadow:none !important;}
body[data-theme="dark"] #pricing-table h3:not([style*="url("]),
body[data-theme="dark"] #pricing-table h2:not([style*="url("]){ background-image: var(--price-grad-default) !important; }
body[data-theme="dark"] #pricing-table #standard h3,
body[data-theme="dark"] #pricing-table #standard h2{ background-image: var(--price-grad-standard) !important; }
body[data-theme="dark"] #pricing-table #carefree h3,
body[data-theme="dark"] #pricing-table #carefree h2{ background-image: var(--price-grad-carefree) !important; }
/* Pricing titles (supports your .wh anchor class) */
body[data-theme="dark"][data-scheme="marine"] #pricing-table .plan h3,
body[data-theme="dark"][data-scheme="marine"] #pricing-table .plan h3 a.wh,
body[data-theme="dark"][data-scheme="marine"] #pricing-table .plan h2{ color:#e3edf7 !important; text-shadow:0 1px 0 rgba(0,0,0,.35);}
/* -------- Sidebar -------- */
/* Remove outer sidebar box; show only widgets */
body[data-theme="dark"] .sidebar.right{ background: transparent !important; border: none !important; border-left: none !important; box-shadow: none !important; border-radius: 0 !important;}
/* Widget shells */
body[data-theme="dark"] .sidebar.right fieldset{ background: var(--surface) !important; border: 1px solid #243447; color: var(--text); box-shadow: 0 2px 10px rgba(0,0,0,.25);}
body[data-theme="dark"] .sidebar.right h2,
body[data-theme="dark"] .sidebar.right .footer-menu-head-sub,
body[data-theme="dark"] .sidebar.right legend{ color:#e3edf7; }
body[data-theme="dark"] .sidebar.right a{ color:#7ad1ff; }
body[data-theme="dark"] .sidebar.right a:hover{ color:#a0e0ff; }
/* Sidebar CTAs / infobox look consistent */
body[data-theme="dark"] .sidebar.right .btn,
body[data-theme="dark"] .sidebar.right .cta,
body[data-theme="dark"] .sidebar.right .infobox{ background: var(--surface-2) !important; color: var(--text); border-color: #243447;}
/* Normalize inline RGBA panels */
body[data-theme="dark"] .sidebar.right .widget .widget-content > div[style*="rgba(205, 217, 210"]{ background: var(--surface-2) !important; border: 1px solid #243447 !important; color: var(--text) !important; box-shadow: 0 2px 10px rgba(0,0,0,.25);}
body[data-theme="dark"] .sidebar.right .widget .widget-content > div span[style*="font-size: large"]{ color:#e3edf7 !important;}
body[data-theme="dark"] .sidebar.right span[style*="#44ABD6"]{ color:#7ad1ff !important; }
/* Sidebar form pieces (incl. survey) */
body[data-theme="dark"] .sidebar.right input[type="text"],
body[data-theme="dark"] .sidebar.right input[type="email"],
body[data-theme="dark"] .sidebar.right input[type="number"],
body[data-theme="dark"] .sidebar.right textarea{ background: var(--surface); color: var(--text); border: 1px solid #2a3a4c;}
body[data-theme="dark"] .sidebar.right input[type="radio"]{ accent-color:#7ad1ff; }
/* -------- Survey widget -------- */
body[data-theme="dark"] #survey-widget{ background:#0e1621 !important; border:1px solid #243447 !important; color:#e3edf7; box-shadow:0 2px 10px rgba(0,0,0,.25);}
body[data-theme="dark"] #survey-widget p{ color:#e3edf7; }
body[data-theme="dark"] #survey-widget input[type="radio"]{ accent-color:#7ad1ff; }
body[data-theme="dark"] #survey-widget label{ color:#dbe7f2; line-height:1.35; }
body[data-theme="dark"] #survey-widget label:has(input:checked){ background:rgba(122,209,255,.12); outline:1px solid #2a3a4c; border-radius:6px;}
body[data-theme="dark"] #survey-widget [style*="#E7F1EA"],
body[data-theme="dark"] #survey-widget [style*="#ECF9F2"],
body[data-theme="dark"] #survey-widget [style*="background:#fff"]{ background:#10202c !important; color:#e3edf7 !important; border-color:#2a3a4c !important;}
body[data-theme="dark"] #survey-widget textarea{ background:#0f1b29; color:#e3edf7; border:1px solid #2a3a4c;}
body[data-theme="dark"] #survey-widget button{ background:#223248 !important; color:#e3edf7 !important; border:1px solid #2a3a4c !important;}
body[data-theme="dark"] #survey-widget button:hover{ filter:brightness(1.08); }
/* “Thanks” box after submit */
body[data-theme="dark"] .sidebar.right div[style*="max-width:340px"][style*="text-align:center"]{ background:#0e1621 !important; border:1px solid #243447 !important; color:#e3edf7 !important; box-shadow:0 2px 10px rgba(0,0,0,.25);}
/* ---------------------------
   LIGHT/DARK native control chrome
   --------------------------- */
/* Tell the browser which native style to use inside these blocks */
body[data-theme="dark"] .sidebar.right,
body[data-theme="dark"] #survey-widget,
body[data-theme="dark"] .post-content form{ color-scheme: dark; }

body:not([data-theme="dark"]) .sidebar.right,
body:not([data-theme="dark"]) #survey-widget,
body:not([data-theme="dark"]) .post-content form{ color-scheme: light; }

/* Light-mode radios & checkboxes (survey + consent) */
body:not([data-theme="dark"]) #survey-widget input[type="radio"],
body:not([data-theme="dark"]) .sidebar.right input[type="radio"],
body:not([data-theme="dark"]) .sidebar.right input[type="checkbox"]{accent-color:#1a84ba !important; background:#fff; border:1px solid #6b7280;}
/* Dark-mode consistency (optional) */
body[data-theme="dark"] #survey-widget input[type="radio"],
body[data-theme="dark"] .sidebar.right input[type="checkbox"]{accent-color:#7ad1ff;}
/* WebKit spinner arrows in light mode (so they don't stay dark) */
body:not([data-theme="dark"]) .sidebar.right input[type="number"]::-webkit-inner-spin-button,
body:not([data-theme="dark"]) .sidebar.right input[type="number"]::-webkit-outer-spin-button{ -webkit-appearance: inner-spin-button; background: transparent; opacity: 1;}
/* If the survey card was darkened earlier, return it to light tint */
body:not([data-theme="dark"]) #survey-widget{ background:#e6ecea !important; color:#0b1726 !important; border:none !important;}
/* Turnaround block (blockquote) — light/dark parity */
body[data-theme="dark"] .post-content blockquote{ color-scheme: dark; }
body:not([data-theme="dark"]) .post-content blockquote{ color-scheme: light; }
/* Word-count number field */
body:not([data-theme="dark"]) .post-content blockquote input[type="number"]{ background:#fff !important; color:#0b1726 !important; border:1px solid #bbb !important;}
body[data-theme="dark"] .post-content blockquote input[type="number"]{ background:var(--surface) !important; color:var(--text) !important; border:1px solid var(--border) !important;}
/* The two result chips with inline #ECF9F2 */
body[data-theme="dark"] #priority_txt,
body[data-theme="dark"] #priority2_txt{ background:var(--tint-2) !important; color:var(--text) !important; border:1px solid #2a3a4c; }
body:not([data-theme="dark"]) #priority_txt,
body:not([data-theme="dark"]) #priority2_txt{background:#ECF9F2 !important; color:#0b1726 !important; border:none !important;}
/* WebKit spinner arrows in light mode (avoid dark arrows) */
body:not([data-theme="dark"]) .post-content blockquote input[type="number"]::-webkit-inner-spin-button,
body:not([data-theme="dark"]) .post-content blockquote input[type="number"]::-webkit-outer-spin-button{-webkit-appearance: inner-spin-button;background: transparent;opacity: 1;}
/* Feature cards at top (dark mode) */
body[data-theme="dark"] .post-content > .container .card{background: var(--surface);color: var(--text);border: 1px solid var(--border);box-shadow: 0 2px 10px rgba(0,0,0,.35);}
body[data-theme="dark"] .post-content > .container .card h2{ color: var(--text); background-image: linear-gradient(180deg,#132233,#0f1f2b); border-bottom: 1px solid var(--border);}
body[data-theme="dark"] .post-content > .container .card ul li::before{ color: var(--link); }
/* Buttons in dark mode (incl. the hero panels) */
body[data-theme="dark"] .btn{background: var(--btn-bg);color: var(--btn-text);border: 1px solid var(--border);}
body[data-theme="dark"] .btn:hover,
body[data-theme="dark"] .btn:focus{background: #2b3b56 !important;color: var(--btn-text) !important;border-color: #3a4b66 !important;}
/* Consulting page boxes (dark mode) */
body[data-theme="dark"] .consultingBlock,
body[data-theme="dark"] .consultingimgBlock{background: var(--tint-2);color: var(--text);border: 1px solid var(--border);box-shadow: 0 2px 8px rgba(0,0,0,.25);}
/* Heading + small polish */
body[data-theme="dark"] .consultingimgBlock h2{ color: var(--text); }
/* Breadcrumb (inside .post-header) – dark mode */
body[data-theme="dark"] .post-header h2{color: rgba(255,255,255,.85) !important;border-top-color: rgba(255,255,255,.35) !important;border-bottom-color: rgba(255,255,255,.35) !important;}
/* quote & turnaround calc on individual editing package pages -  dark mode */
body[data-theme="dark"] blockquote #total1{ background: var(--tint-2) !important; color: var(--text);}
body:not([data-theme="dark"]) blockquote #total1{ background: #dce9e2!important; color: #000!important;}
/* Service comparison page - table -  dark mode */
body[data-theme="dark"] .bigwrapper{ background: var(--tint-2) !important; color: var(--text);}
body[data-theme="dark"] .cell2, .cell2 input[type="text"] {background: #46627b}
body[data-theme="dark"] div .pop {color:LightPink; background: #79494b} 
body[data-theme="dark"] .cell3, .cell3 input[type="text"] {background: #79494b}
body[data-theme="dark"] .cell4, .cell4 input[type="text"] {background: #477b72}
/* Quote calculator - form dark mode */
body[data-theme="dark"] .calcContainer { background: var(--tint-2) !important; color: var(--text);}
body[data-theme="dark"] .post-content fieldset { background: var(--tint-1) !important; color: var(--text);}
body[data-theme="dark"] .total-oval { background: var(--tint-1) !important; color: var(--text);}
/* Buy credit - login msg */
body[data-theme="dark"] #login-msg { background-color: #055 !important; color: var(--text);}
/* client benefit pages - toc */
body[data-theme="dark"] #toc_container { background-color: var(--tint-2) !important; color: var(--text);}
body[data-theme="dark"] #toc_container > div { background-color: var(--btn-bg) !important; color: var(--text);}
body[data-theme="dark"] .toc_title { background-color: var(--btn-bg) !important; color: var(--text);}
/* style guide dos and donts */
body[data-theme="dark"] #pricing-table h4{ background-image: var(--price-grad-default) !important; }
body[data-theme="dark"] #dos h4{ background-image: var(--price-grad-carefree) !important; }
/* journal abbreviations and example div in modelling page*/
body[data-theme="dark"] div.tab{border:0px solid #555;background-color: var(--btn-bg);}
body[data-theme="dark"] div.tab button{color: var(--btn-text);background-color:var(--btn-bg);}
body[data-theme="dark"] div.tab button:hover{color: #333;background-color: var(--link-hover);}
body[data-theme="dark"] div.tab button.active{color: #000;background-color:var(--link);}
body[data-theme="dark"] .tabcontent { background-color: var(--tint-2) !important; color: var(--text);}
/* team page */
body[data-theme="dark"] #showit { background-color: var(--tint-2) !important; color: var(--text);}
/* order submission */
body[data-theme="dark"] #overlay {background: var(--bg) !important; color: var(--text);}
body[data-theme="dark"] .overlaybox {background: var(--bg) !important; color: var(--text); background-image: none !important; }
body[data-theme="dark"] .overlaybox a.button {color: #fff !important; }
body[data-theme="dark"] #progressbar li { color: rgb(151, 151, 151); }
body[data-theme="dark"] #progressbar li:before { color: #ccc; background: black;}
/*The number of the step and the connector before it = green*/
body[data-theme="dark"] #progressbar li.finish:before,  #progressbar li.finish:after{background: #77B27C;color: white;}
body[data-theme="dark"] #progressbar li.active:before,  #progressbar li.active:after{background: #47824C;color: white;}
/*buttons*/
body[data-theme="dark"] .jobtype-button{background: var(--tint-2)!important;-webkit-text-stroke: 0 !important; -webkit-text-stroke-width: 0; text-shadow: none !important; color: var(--text) !important;}
body[data-theme="dark"] #pricing-table .credit h3 {background: var(--tint-1)!important;}
body[data-theme="dark"] .jobtype-button:hover, 
body[data-theme="dark"] .jobtype-button:focus {background: var(--tint-1)!important;}
body[data-theme="dark"] .zoneupload {background: var(--tint-2)!important; }
body[data-theme="dark"] .zoneupload .file_upload {background-color: var(--tint-2)!important; }
body[data-theme="dark"] #upload_results {background: var(--bg) !important; color: var(--text);}
body[data-theme="dark"] .radio label{background-color: var(--btn-bg); color: var(--text);}
body[data-theme="dark"] .radio input:checked + label{border: 1px solid #555;background-color: #526278; color: var(--text); font-weight:600}
body[data-theme="dark"] .radio input:checked + label:after{content:"✓";color:#00dd00;width: 30px;height: 30px;line-height: 30px;border-radius: 100%;border: 1px solid #555;background-color: #526278;z-index: 999;position: absolute;top: -10px;right: -10px;}
body[data-theme="dark"] .items div.greenBackground{background-color: #526278;}
body[data-theme="dark"] #pricebox {background-color: var(--tint-2);}
body[data-theme="dark"] #changes_msg_line {background-color: #055 !important; color: var(--text);}
body[data-theme="dark"] #turnaround_change_msg_line {background-color: #055 !important; color: var(--text);}
body[data-theme="dark"] #coupon_check {background-color: var(--btn-bg) !important;}
body[data-theme="dark"] #priority_txt, body[data-theme="dark"] #priority2_txt {background: transparent !important;border: none}
body[data-theme="dark"] #order_summary_div {background: var(--tint-2) !important;}
/* Order status page */
body[data-theme="dark"] #order_status_ticket_link {background: var(--btn-bg) !important;}
/* editor application */
body[data-theme="dark"] .submittable {background: var(--tint-2) !important; border: 1px solid #1a2230;}
body[data-theme="dark"] #cv_status, 
body[data-theme="dark"] #cover_status {background: var(--btn-bg) !important;}
/* Editor calendar */
body[data-theme="dark"] #editor_away_calendar {background: var(--tint-2) !important;border: 1px solid var(--btn-bg) !important; }
/* Ticket system */
body[data-theme="dark"] .ticket_new,
body[data-theme="dark"] .ticket_body {background: var(--surface) !important;}
body[data-theme="dark"] .client{border: 3px solid #49414F}
body[data-theme="dark"] .consultant{border: 3px solid #41494F}
body[data-theme="dark"] .client .ticket_head{background: #49414F}
body[data-theme="dark"] .consultant .ticket_head{background: #41494F}
body[data-theme="dark"] .toolbar{background-color: #333 !important;border: 1px solid #555 !important;}
body[data-theme="dark"] .tool{background-color: #555 !important;}
body[data-theme="dark"] .editable-box{background: var(--surface) !important;}
body[data-theme="dark"] .editable-box:empty:not(:focus):before {color: #ccc !important;}
body[data-theme="dark"] .post-content input[type="file"]{background: var(--surface) !important;border: 1px ridge #a1a1a1;}
body[data-theme="dark"] .tool:hover{background-color: #777 !important;}
body[data-theme="dark"] .ttable {background-color: #2C3831 !important;} 
body[data-theme="dark"] .ttable th {background-color: #2C3831 !important;} 
body[data-theme="dark"] .ttable td {background-color: #2C3831 !important;} 
body[data-theme="dark"] .ttable caption {color: #aaa !important;} 
body[data-theme="dark"] .old_ticket_file_list{background-color: #2C3831 !important;} 
body[data-theme="dark"] #new_ticket_container {background: var(--surface) !important;}
body[data-theme="dark"] table.example th.ticket_editor_headrow {background-color: var(--border) !important;}
body[data-theme="dark"] table.example td.good_row {background-color: #334433 !important;}
body[data-theme="dark"] table.example td.bbad_row {background-color: #443333 !important;}
body[data-theme="dark"] #admin_access_div {background-color: #554444 !important;}
body[data-theme="dark"] #ticket_editor_instructions {background-color: #2C3932 !important;}
body[data-theme="dark"] #editor_instructions {background-color: var(--surface) !important;}
body[data-theme="dark"] .client .ticket_icon{background-size: cover;background-repeat: no-repeat;filter: invert(1);}
body[data-theme="dark"] .consultant .ticket_icon{background-image: url("/images/ticket_consultant_icon-d.png");}
body[data-theme="dark"] #ticket_msg_waiting {background-color: rgba(0, 85, 85, 1) !important;}
/* client register */
body[data-theme="dark"] .my-wrapper {background:var(--tint-2);}
/* client login */
body[data-theme="dark"] .login {background-image: none !important;}
/* client profile */
body[data-theme="dark"] #active_job_div {background-color: #055 !important; color: var(--text);}
/* covid page */
body[data-theme="dark"] div.post-content figcaption,
body[data-theme="dark"] table caption{ color: var(--muted) !important; }
body[data-theme="dark"] .bottom {border-top: 1px solid #fff;}
/* invert monochromatic images */
body[data-theme="dark"] img.icon-mono{filter: brightness(0) invert(1);}
body[data-theme="dark"] [style*="/images/faq1.webp"]{background-image: url("/images/faq2.png") !important;}
body[data-theme="dark"] img.sign {background: transparent !important; border: 0 !important; padding: 0 !important; box-shadow: none !important; outline: none !important; filter: none !important;}
/* hide dark/light toggle on forbidden pages */
body[data-allow-dark="false"] #theme-toggle { display: none; }

/* XpertScientific chat widget — DARK MODE */
body[data-theme="dark"]{
  /* brand accent: make hover the default in dark */
  --xs-green:   #2e405d;   /* was --xs-green-h */
  --xs-green-h: #5e708d;   /* a touch brighter for hover */

  /* neutrals (dark surface palette) */
  --xs-bg:     #0f141a;    /* panel + header/foot surface */
  --xs-text:   #e3edf7;
  --xs-muted:  #98a6b3;
  --xs-border: #243447;
  --xs-shadow: 0 18px 50px rgba(0,0,0,.6);

  /* bubbles */
  --xs-bot: #142230;       /* bot bubble */
  --xs-me:  #1b2a3a;       /* my bubble */
}

/* panel and sections */
body[data-theme="dark"] #xs-panel{background:var(--xs-bg); color:var(--xs-text);border-color:var(--xs-border); box-shadow:var(--xs-shadow);}
body[data-theme="dark"] #xs-head,
body[data-theme="dark"] #xs-bottom,
body[data-theme="dark"] #xs-suggest,
body[data-theme="dark"] #xs-foot{background:var(--xs-bg); border-color:var(--xs-border);}
/* header controls */
body[data-theme="dark"] #xs-head button{ color:#a9b5c2; }
body[data-theme="dark"] #xs-head button:hover{ color:#d4dde6; }
/* messages */
body[data-theme="dark"] #xs-body{ background:var(--xs-bg); }
body[data-theme="dark"] #xs-body .me { background:var(--xs-me);  border-color:#2a3b52; }
body[data-theme="dark"] #xs-body .bot{ background:var(--xs-bot); border-color:#2a3b52; }
body[data-theme="dark"] #xs-body .msg.bot a{ color:#6bd0d7; }   /* better contrast on dark */
/* typing indicator */
body[data-theme="dark"] #xs-body .msg.typing{ background:var(--xs-bot); border-color:#2a3b52; }
body[data-theme="dark"] #xs-body .typing .dot{ background:#aeb9c6; }
/* input row */
body[data-theme="dark"] #xs-foot input{background:#0d131b; border-color:var(--xs-border);color:var(--xs-text);}
body[data-theme="dark"] #xs-foot input::placeholder{ color:var(--xs-muted); }
body[data-theme="dark"] #xs-foot input:focus{ outline:2px solid rgba(47,163,173,.35); }
/* launcher + send + chips use promoted accent */
body[data-theme="dark"] #xs-chat .btn,
body[data-theme="dark"] #xs-foot button,
body[data-theme="dark"] .xs-chip{background:var(--xs-green); color:#fff;}
body[data-theme="dark"] #xs-chat .btn:hover,
body[data-theme="dark"] #xs-foot button:hover,
body[data-theme="dark"] .xs-chip:hover{background:var(--xs-green-h);}
body[data-theme="dark"] #xs-chat .btn{ box-shadow:0 10px 30px rgba(0,0,0,.45); }
/* disclaimer */
body[data-theme="dark"] #xs-disclaimer{background:#0d131b; border-top-color:var(--xs-border);color:#9fb0be;}
body[data-theme="dark"] #xs-disclaimer a{ color:#6bd0d7; }
/* optional: thin separators for structure */
body[data-theme="dark"] #xs-head{ border-bottom:1px solid var(--xs-border); }