/* Exceptions to Dark Reader's automatic conversion. This sheet is ignored by
   the converter; every rule is scoped to the saved application dark theme. */
html[data-app-theme="dark"] {--app-label:#f5f5f5;--app-section:#f5f5f5;--app-secondary:#f5f5f5;}
html[data-app-theme="dark"] body {color:#e6e8eb !important;}
html[data-app-theme="dark"] #sidebar {background:#171819 !important;}
html[data-app-theme="dark"] #sidebar :is(.brand,.sidebar-footer,#sidebar-quickjump) {border-color:#353739 !important;}
html[data-app-theme="dark"] #sidebar nav a {color:#f5f5f5 !important;}
html[data-app-theme="dark"] #sidebar nav a:is(:hover,.active) {color:#f0f1f3 !important;}
html[data-app-theme="dark"] #sidebar :is(.brand span,.sidebar-footer,.sidebar-account-role) {color:#f5f5f5 !important;}
html[data-app-theme="dark"] #sidebar :is(.qj-input,#qj-input) {background:#171819 !important;color:#f5f5f5 !important;}
html[data-app-theme="dark"] #main :is(.page-title,h1,h2,h3,h4,h5,h6) {color:#eef0f3 !important;}
html[data-app-theme="dark"] :is(.text-muted,.text-secondary,.card-desc) {color:var(--app-secondary) !important;}
html[data-app-theme="dark"] .stat-label {color:var(--app-label) !important;}
html[data-app-theme="dark"] :is(.stat-card .label,.legend,.ar-label,.ar-note,.tracker-card-cat-label,.notion-opts-label,.notion-opts-empty,.cl-empty,.mk-dlg-desc,.rowlabel,.empty-msg,.ro-note,.auto-section .desc,.settings-row label,.mc-seg-lbl,.mc-tl) {color:#f5f5f5 !important;}
/* Secondary labels use clean white while semantic colors remain distinct. */
html[data-app-theme="dark"] :is(.field-label,.field-label > span:not([data-app-chip]):not([data-app-ink]),.form-label) {color:var(--app-label) !important;}
html[data-app-theme="dark"] #main label:not([data-app-chip]):not([data-app-ink]):not([style*="background"]) {color:#f5f5f5 !important;}
html[data-app-theme="dark"] :is(input.form-control,textarea.form-control,select.form-select) {color:#e6e8eb !important;}
html[data-app-theme="dark"] .text-danger {color:#f4a1a6 !important;}
html[data-app-theme="dark"] .text-success {color:#a7dfba !important;}
html[data-app-theme="dark"] .text-primary {color:#a5c8f8 !important;}
html[data-app-theme="dark"] :is(.btn-outline-primary,.btn-outline-info) {color:#e6e8eb !important;border-color:#7798c6 !important;}
html[data-app-theme="dark"] .btn-outline-success {color:#a7dfba !important;border-color:#71987f !important;}
html[data-app-theme="dark"] .btn-outline-danger {color:#f4a1a6 !important;border-color:#ae7479 !important;}
html[data-app-theme="dark"] :is(.btn-outline-secondary,.btn-outline-dark) {color:#f5f5f5 !important;border-color:#747b86 !important;}
html[data-app-theme="dark"] #main a[href]:not([href^="#"]):not(.nav-link):not(.btn):not(.page-link) {color:#a5c8f8 !important;}
html[data-app-theme="dark"] #main a[href]:not([href^="#"]):not(.nav-link):not(.btn):not(.page-link):hover {color:#d0e3ff !important;}
/* Tabs are local controls rather than destination links. */
html[data-app-theme="dark"] #main .nav-tabs .nav-link {color:var(--app-label) !important;}
html[data-app-theme="dark"] #main .nav-tabs .nav-link.active {color:#eef0f3 !important;}
html[data-app-theme="dark"] #main table th {color:var(--app-label) !important;}
html[data-app-theme="dark"] #main table td:not([data-app-ink]):not([data-app-chip]) {color:#e6e8eb !important;}
html[data-app-theme="dark"] .fc .fc-col-header-cell-cushion,
html[data-app-theme="dark"] .fc .fc-daygrid-day-number {color:#f5f5f5 !important;}
html[data-app-theme="dark"] .fc .fc-day-sun :is(.fc-col-header-cell-cushion,.fc-daygrid-day-number),
html[data-app-theme="dark"] .fc .fc-holiday-name {color:#f48c92 !important;}
html[data-app-theme="dark"] .fc .fc-day-sat :is(.fc-col-header-cell-cushion,.fc-daygrid-day-number),
html[data-app-theme="dark"] .fc .fc-today-label {color:#8cb7f2 !important;}
html[data-app-theme="dark"] .fc .fc-day-other .fc-daygrid-day-top {opacity:.55;}
html[data-app-theme="dark"] #main .fc-button-primary {color:#e6e8eb !important;}
html[data-app-theme="dark"] #schedule-panel-content :is(.text-muted,[style*="color:#64748b"]):not([style*="background"]) {color:#f5f5f5 !important;}
html[data-app-theme="dark"] #schedule-panel-content .ws-panel-bar.neutral-schedule-bar {background:#2e3237 !important;color:#e6e8eb !important;}
html[data-app-theme="dark"] #main :is(.etc-badge,.etc-kind-badge) {opacity:1;font-size:11px !important;line-height:1.4;padding:1px 5px !important;border:0;}
/* Colored chips must remain opaque and readable, including dynamically added ones. */
html[data-app-theme="dark"] [data-app-chip] {background-color:var(--app-chip-bg,#35383d) !important;color:var(--app-chip-fg,#f5f5f5) !important;}
html[data-app-theme="dark"] [data-app-chip="red"] {--app-chip-bg:#4c3035;--app-chip-fg:#f5c6cb;}
html[data-app-theme="dark"] [data-app-chip="orange"] {--app-chip-bg:#4b382b;--app-chip-fg:#f2d0b4;}
html[data-app-theme="dark"] [data-app-chip="yellow"] {--app-chip-bg:#49412d;--app-chip-fg:#efdfae;}
html[data-app-theme="dark"] [data-app-chip="green"] {--app-chip-bg:#2b4538;--app-chip-fg:#c7ecd5;}
html[data-app-theme="dark"] [data-app-chip="cyan"] {--app-chip-bg:#2a4145;--app-chip-fg:#c1e5e8;}
html[data-app-theme="dark"] [data-app-chip="blue"] {--app-chip-bg:#2c4057;--app-chip-fg:#c5e0ff;}
html[data-app-theme="dark"] [data-app-chip="purple"] {--app-chip-bg:#44344f;--app-chip-fg:#eadbff;}
html[data-app-theme="dark"] [data-app-chip="pink"] {--app-chip-bg:#4b3343;--app-chip-fg:#f2cde6;}
/* Colored text without a painted background needs a lighter foreground. */
html[data-app-theme="dark"] [data-app-ink="neutral"] {color:#e6e8eb !important;}
html[data-app-theme="dark"] [data-app-ink="muted"] {color:var(--app-label) !important;}
html[data-app-theme="dark"] [data-app-ink="red"] {color:#f4a1a6 !important;}
html[data-app-theme="dark"] [data-app-ink="orange"] {color:#e6bc98 !important;}
html[data-app-theme="dark"] [data-app-ink="yellow"] {color:#e5d197 !important;}
html[data-app-theme="dark"] [data-app-ink="green"] {color:#a7dfba !important;}
html[data-app-theme="dark"] [data-app-ink="cyan"] {color:#a6dce5 !important;}
html[data-app-theme="dark"] [data-app-ink="blue"] {color:#a5c8f8 !important;}
html[data-app-theme="dark"] [data-app-ink="purple"] {color:#d6b8ed !important;}
html[data-app-theme="dark"] [data-app-ink="pink"] {color:#ecc0dd !important;}
/* No change to document, drawing or chemistry image pixels. */

/* Contrast corrections found while checking transparent controls and small labels. */
html[data-app-theme="dark"] #sidebar .qm-green {background:#23633d !important;}
html[data-app-theme="dark"] #sidebar .qm-green :is(.k,.v) {color:#f1f7f3 !important;}
html[data-app-theme="dark"] #sidebar .qm-yellow {background:#dec968 !important;}
html[data-app-theme="dark"] #sidebar .qm-yellow :is(.k,.v) {color:#181a1b !important;}
html[data-app-theme="dark"] :is(.page-tab,.widget-tab,.tabchip,.ar-tab,.dw-tab) {color:var(--app-label) !important;}
html[data-app-theme="dark"] :is(.page-tab.active,.widget-tab.active,.tabchip.on,.ar-tab.active,.dw-tab.active,.dw-tab.on) {color:#eef0f3 !important;}
html[data-app-theme="dark"] .detail-design .btn-mail {color:#ddc3f6 !important;}
html[data-app-theme="dark"] :is(#notice-deadline-display,#rej-country-warn) {color:#ffcca4 !important;}
html[data-app-theme="dark"] #main button[style*="font-size: 0.65rem"] {color:#f5f5f5 !important;}
html[data-app-theme="dark"] .mp-saveb {background:#23633d !important;color:#f1f7f3 !important;}
html[data-app-theme="dark"] .mp-clr-hl {color:#181a1b !important;background:#dec968 !important;}
html[data-app-theme="dark"] :is(.dow.sun,.day.sun) {color:#f48c92 !important;}
html[data-app-theme="dark"] :is(.dow.sat,.day.sat) {color:#8cb7f2 !important;}
html[data-app-theme="dark"] [data-app-amber="true"],
html[data-app-theme="dark"] [data-app-amber="true"] :is(.fc-event-main,.fc-event-title,.fc-event-time) {color:#171819 !important;}
html[data-app-theme="dark"] .fc .fc-more-link {color:#f4a1a6 !important;}
/* Brighter schedule row surfaces; input fields and foregrounds remain unchanged. */
html[data-app-theme="dark"] [data-schedule-surface="empty"] {--schedule-row-bg:#3a3d40;}
html[data-app-theme="dark"] [data-schedule-surface="scheduled"] {--schedule-row-bg:#635c28;}
html[data-app-theme="dark"] [data-schedule-surface="done"] {--schedule-row-bg:#255d45;}
html[data-app-theme="dark"] [data-schedule-surface],
html[data-app-theme="dark"] [data-schedule-surface] > td {background:var(--schedule-row-bg) !important;}
html[data-app-theme="dark"] [data-schedule-surface] [data-app-ink="purple"] {color:#f0e1ff !important;}
html[data-app-theme="dark"] [data-schedule-surface] [data-app-ink="blue"] {color:#c5deff !important;}
html[data-app-theme="dark"] [data-schedule-surface] [data-app-ink="red"] {color:#ffd2d6 !important;}
/* Selected tabs need a distinct surface as well as an accent marker. */
html[data-app-theme="dark"] :is(#main,#m-app,#quickMemoModal) :is(.page-tab,.widget-tab,.tabchip,.ar-tab,.dw-tab,.nav-tabs .nav-link,.tab-btn,.mk-tab,.mk-tabs button,.help-tab,.palette-tab,.tab-item,.m-tab,.tabs button,.dtabs button,.qm-tab,#order-view-tabs button,#panel-tab-bar button[id^="tab-"]) {background:#222425 !important;color:#f5f5f5 !important;}
html[data-app-theme="dark"] :is(#main,#m-app,#quickMemoModal) :is(.page-tab.active,.widget-tab.active,.tabchip.on,.ar-tab.active,.dw-tab.active,.dw-tab.on,.nav-tabs .nav-link.active,.tab-btn.active,.mk-tab.active,.mk-tabs button.active,.help-tab.active,.palette-tab.active,.tab-item.active,.m-tab.on,.tabs button.on,.dtabs button.on,.qm-tab.active,#order-view-tabs button.btn-primary,#panel-tab-bar button[id^="tab-"].active) {
  background:#384b60 !important;
  color:#ffffff !important;
  border-color:#719bd0 !important;
  box-shadow:inset 0 -3px 0 #8bbcff;
}
/* Outline actions keep matching, visible text/borders and a tinted hover surface. */
html[data-app-theme="dark"] :is(.btn-outline-primary,.btn-outline-info) {--action-ink:#f5f5f5;--action-border:#b5c4d8;--action-hover:#293e56;}
html[data-app-theme="dark"] :is(.btn-outline-secondary,.btn-outline-dark,.btn-outline-light) {--action-ink:#f5f5f5;--action-border:#9ca5b0;--action-hover:#373c43;}
html[data-app-theme="dark"] .btn-outline-danger {--action-ink:#ffc0c5;--action-border:#e99aa3;--action-hover:#503139;}
html[data-app-theme="dark"] :is(.btn-outline-success,.hdr-actions .btn-clone) {--action-ink:#b9eccb;--action-border:#81be97;--action-hover:#294737;}
html[data-app-theme="dark"] :is(.btn-outline-warning,.hdr-actions #folder-go-btn,.hdr-actions #folder-pick-btn) {--action-ink:#f3d59b;--action-border:#c8a469;--action-hover:#4b402b;}
html[data-app-theme="dark"] .hdr-actions .btn-mail {--action-ink:#e4caff;--action-border:#b79ad5;--action-hover:#45364f;}
html[data-app-theme="dark"] .mc-pchip.sel {outline:2px solid #b9d7ff !important;outline-offset:2px;}
html[data-app-theme="dark"] .dashboard-design #panel-settings-btn {background:#222425 !important;color:#e6e8eb !important;border-color:#77828f !important;}
html[data-app-theme="dark"] .dashboard-design #main #panel-tab-bar .panel-tab-items button {background:transparent !important;box-shadow:none !important;border:0 !important;border-radius:7px;}
html[data-app-theme="dark"] .dashboard-design #main #panel-tab-bar .panel-tab-items button.active {background:#384b60 !important;}
html[data-app-theme="dark"] :is(button,a):is([class*="btn-outline-"],.hdr-actions .btn-mail,.hdr-actions .btn-clone,.hdr-actions #folder-go-btn,.hdr-actions #folder-pick-btn):not(.active) {
  background:transparent !important;
  color:var(--action-ink,#f5f5f5) !important;
  border-color:var(--action-border,#9ca5b0) !important;
}
html[data-app-theme="dark"] :is(button,a):is([class*="btn-outline-"],.hdr-actions .btn-mail,.hdr-actions .btn-clone,.hdr-actions #folder-go-btn,.hdr-actions #folder-pick-btn):not(:disabled):not(.disabled):is(:hover,:focus-visible) {
  background:var(--action-hover,#373c43) !important;
  color:var(--action-ink,#f5f5f5) !important;
  border-color:var(--action-border,#9ca5b0) !important;
}
