/* MUPA Corp. — โหมดมืด (เทาเข้มอมม่วงนิด ๆ เน้นอ่านชัด) */
#themeToggle{position:fixed;right:14px;bottom:14px;z-index:9000;width:40px;height:40px;border-radius:50%;border:1px solid #f2dcea;background:#fff;color:#84195c;font-size:1.1rem;line-height:1;cursor:pointer;box-shadow:0 4px 14px rgba(0,0,0,.18);display:flex;align-items:center;justify-content:center;padding:0;opacity:.92}
#themeToggle:hover{opacity:1}
@media print{#themeToggle{display:none}}
html[data-theme="dark"]{
  color-scheme:dark;
  --card:#2a272d; --bg:#232026; --bg-app:#1c1a1f;
  --ink:#ece8ed; --muted:#ada5b0; --line:#403b44; --line-soft:#35313a;
  --pink-soft:#3b2636; --pink-light:#b5457f;
  --pink-t:#ff77ba; --pink-deep-t:#ff8fc6; --plum-t:#e6aad3; --plum-deep-t:#f2c4e5;
  --ok:#52c993; --ok-bg:#1f3a2e; --fix:#ff808a; --fix-bg:#3d2428;
  --shadow-s:0 1px 2px rgba(0,0,0,.4),0 6px 18px rgba(0,0,0,.25);
}
html[data-theme="dark"] body{background:var(--bg-app);color:var(--ink)}
html[data-theme="dark"] #themeToggle{background:#2a272d;color:#f2c4e5;border-color:#403b44}
html[data-theme="dark"] input,html[data-theme="dark"] textarea,html[data-theme="dark"] select{background:#211f24;color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#8b838f}
html[data-theme="dark"] input:disabled,html[data-theme="dark"] textarea:disabled,html[data-theme="dark"] input[readonly]{background:#2b2830;color:var(--muted)}
html[data-theme="dark"] a{color:var(--pink-t)}
html[data-theme="dark"] button{color:inherit}
html[data-theme="dark"] ::selection{background:var(--pink);color:#fff}
html[data-theme="dark"] .news-caption.long:not(.open)::after{background:linear-gradient(transparent,var(--card))}
html[data-theme="dark"] img.invert-dark{filter:invert(1) hue-rotate(180deg)}
html[data-theme="dark"] table th{color:var(--plum-t)}

/* ── สีที่เขียนฝังในสไตล์: ตัวหนังสือ ── */
html[data-theme="dark"] [style*="color:#b71c1c" i],html[data-theme="dark"] [style*="color:#8c1f2a" i],html[data-theme="dark"] [style*="color:#8a1c1c" i],html[data-theme="dark"] [style*="color:#791F1F" i]{color:#ff9aa0!important}
html[data-theme="dark"] [style*="color:#3B6D11" i],html[data-theme="dark"] [style*="color:#27500A" i]{color:#9fd77a!important}
html[data-theme="dark"] [style*="color:#0C447C" i],html[data-theme="dark"] [style*="color:#185FA5" i]{color:#8fc3f0!important}
html[data-theme="dark"] [style*="color:#534AB7" i],html[data-theme="dark"] [style*="color:#3C3489" i]{color:#b9b3f7!important}
html[data-theme="dark"] [style*="color:#993556" i],html[data-theme="dark"] [style*="color:#9c4a7d" i]{color:#ffa6cf!important}
html[data-theme="dark"] [style*="color:#993C1D" i]{color:#ffb08f!important}
html[data-theme="dark"] [style*="color:#6b4b00" i],html[data-theme="dark"] [style*="color:#7a5c00" i],html[data-theme="dark"] [style*="color:#8a4b00" i],html[data-theme="dark"] [style*="color:#b26a00" i]{color:#f0cf7f!important}
html[data-theme="dark"] [style*="color:#446" i]{color:#b7c0ee!important}
/* ── พื้นหลังพาสเทลฝังในสไตล์ → โทนมืด ── */
html[data-theme="dark"] [style*="background:#FBEAF0" i],html[data-theme="dark"] [style*="background:#fdeef7" i]{background:#3b2431!important}
html[data-theme="dark"] [style*="background:#E6F1FB" i]{background:#1f3144!important}
html[data-theme="dark"] [style*="background:#EAF3DE" i],html[data-theme="dark"] [style*="background:#e9f7f0" i]{background:#25362a!important}
html[data-theme="dark"] [style*="background:#FCEBEB" i],html[data-theme="dark"] [style*="background:#fdeaea" i],html[data-theme="dark"] [style*="background:#fde8e8" i],html[data-theme="dark"] [style*="background:#FAECE7" i],html[data-theme="dark"] [style*="background:#fdeff0" i]{background:#3d2528!important}
html[data-theme="dark"] [style*="background:#EEEDFE" i],html[data-theme="dark"] [style*="background:#eef" i]{background:#2b2943!important}
html[data-theme="dark"] [style*="background:#fff6e0" i],html[data-theme="dark"] [style*="background:#fff8e1" i],html[data-theme="dark"] [style*="background:#fffdf3" i]{background:#3a3322!important;border-color:#6b5a2a!important}
html[data-theme="dark"] [style*="background:#f8f8f8" i]{background:#26232a!important}
html[data-theme="dark"] [style*="background:#e3cfdb" i],html[data-theme="dark"] [style*="background:#ccc" i]{background:#4a444e!important}
/* ── กล่องในไฟล์ CSS ที่ใช้สีพาสเทลตรง ๆ ── */
html[data-theme="dark"] .banner.warn,html[data-theme="dark"] .add-skip,html[data-theme="dark"] .date-warn{background:#3a3322;border-color:#6b5a2a;color:#f0cf7f}
html[data-theme="dark"] .send-progress,html[data-theme="dark"] .bulkbar{background:#3b2636;color:var(--plum-deep-t)}
html[data-theme="dark"] .add-ok{color:#9fd77a}
html[data-theme="dark"] .tag{background:#2b2943;color:#b7c0ee}
html[data-theme="dark"] .tag.red{background:#3d2528;color:#ff9aa0}
html[data-theme="dark"] .dw-box,html[data-theme="dark"] .link-card{background:var(--card)}
/* --- fixes from contrast audit --- */
html[data-theme="dark"] .btn-primary,html[data-theme="dark"] .mbtn.primary,html[data-theme="dark"] .lc-btn.primary,html[data-theme="dark"] .req-filter .on,html[data-theme="dark"] .wiz-dot.active span{color:#fff}
html[data-theme="dark"] .btn-primary,html[data-theme="dark"] .mbtn.primary,html[data-theme="dark"] .lc-btn.primary,html[data-theme="dark"] .wiz-dot.active span{background:#d4016f}
html[data-theme="dark"] .wiz-dot.done span{background:#3b2636}
html[data-theme="dark"] .type-use{color:#8fd694}
html[data-theme="dark"] .type-not{color:#ffae8a}
html[data-theme="dark"] .type-icon{background:#3b3340 !important}
html[data-theme="dark"] .logo-note{background:#3b2636;border-color:var(--line);color:var(--plum-deep-t)}
html[data-theme="dark"] .logo-note a{color:var(--pink-deep-t)}
html[data-theme="dark"] .type-card.selected,html[data-theme="dark"] .cat-radio label:has(input:checked){background:#3b2636;box-shadow:none}
html[data-theme="dark"] .warn-box{background:#3d2428}
html[data-theme="dark"] .live-box{background:#3a3326;border-color:#5a4d2c}
html[data-theme="dark"] .live-prefix{background:#4a3f26;color:#f0c987}
html[data-theme="dark"] .story-note{background:#332f37;color:var(--muted)}
html[data-theme="dark"] .success-box{background:#1f3a2e;border-color:#3f9a6d}
html[data-theme="dark"] .rate-star{color:#4a4350}
html[data-theme="dark"] .rate-star.on{color:#f5a623}
html[data-theme="dark"] .warn-box,html[data-theme="dark"] .warn-box *{color:#ff9aa0}
html[data-theme="dark"] .warn-box .warn-title{color:#ffb3b8}
html[data-theme="dark"] .rate-star{color:#7d7585}
html[data-theme="dark"] .act:not(.approve):not(.publish):not(.fix){background:var(--card);border-color:var(--line)}
html[data-theme="dark"] .req-filter .on{background:#d4016f;color:#fff}
html[data-theme="dark"] .rate-star{color:#948b9b}
html[data-theme="dark"] .rate-star.on{color:#f5a623}
html[data-theme="dark"] .pin-note{background:#4a4326;color:#f3e7a8;box-shadow:0 3px 8px rgba(0,0,0,.4)}
html[data-theme="dark"] .pin-note.alt{background:#4a2c3c;color:#f5c3dc}
html[data-theme="dark"] .pin-note b,html[data-theme="dark"] .pin-note strong{color:inherit}
