/* Bootstrap supplies the palette and components. These are legacy admin exceptions. */
html.pxm-theme[data-bs-theme="light"] { color-scheme: light; }

html.pxm-theme[data-bs-theme="dark"] :is(.bg-white, .bg-light, #signed-in-user-info, div.block, .registration_key, .registration_key_small) {
	background-color: var(--bs-tertiary-bg) !important;
	color: var(--bs-body-color);
	border-color: var(--bs-border-color);
}

html.pxm-theme[data-bs-theme="dark"] :is(.text-dark, .text-black, a.download_link, .cloud-share-modality-label, .cloud-share-patient-id-label, .input-icon, .output-icon, .effects-icon, .notes-icon) {
	color: var(--bs-body-color) !important;
}

html.pxm-theme[data-bs-theme="dark"] .text-secondary,
html.pxm-theme[data-bs-theme="dark"] .link-secondary {
	color: var(--bs-secondary-color) !important;
}

html.pxm-theme[data-bs-theme="dark"] .link-secondary:hover,
html.pxm-theme[data-bs-theme="dark"] .link-secondary:focus {
	color: #c3ceda !important;
}

html.pxm-theme[data-bs-theme="dark"] :is(.error, td.osirix-lite-not-available, [style*="color:darkred"], [style*="color: darkred"]) { color: var(--bs-danger-text-emphasis) !important; }

html.pxm-theme[data-bs-theme="dark"] [style*="color:green"] { color: var(--bs-success-text-emphasis) !important; }

/* Contextual tables have fixed light colors in Bootstrap. */
html.pxm-theme[data-bs-theme="dark"] .table-light { --bs-table-bg: var(--bs-tertiary-bg); }

html.pxm-theme[data-bs-theme="dark"] .table-primary { --bs-table-bg: var(--bs-primary-bg-subtle); }

html.pxm-theme[data-bs-theme="dark"] .table-secondary { --bs-table-bg: var(--bs-secondary-bg-subtle); }

html.pxm-theme[data-bs-theme="dark"] .table-success { --bs-table-bg: var(--bs-success-bg-subtle); }

html.pxm-theme[data-bs-theme="dark"] .table-info { --bs-table-bg: var(--bs-info-bg-subtle); }

html.pxm-theme[data-bs-theme="dark"] .table-warning { --bs-table-bg: var(--bs-warning-bg-subtle); }

html.pxm-theme[data-bs-theme="dark"] .table-danger { --bs-table-bg: var(--bs-danger-bg-subtle); }

html.pxm-theme[data-bs-theme="dark"] :is(.table-light, .table-primary, .table-secondary, .table-success, .table-info, .table-warning, .table-danger) {
	--bs-table-color: var(--bs-body-color);
	--bs-table-border-color: var(--bs-border-color);
	--bs-table-striped-color: var(--bs-body-color);
	--bs-table-striped-bg: rgba(255, 255, 255, .05);
	--bs-table-hover-color: var(--bs-body-color);
	--bs-table-hover-bg: rgba(255, 255, 255, .075);
	--bs-table-active-color: var(--bs-body-color);
	--bs-table-active-bg: rgba(255, 255, 255, .1);
}

html.pxm-theme[data-bs-theme="dark"] td.reg_key strong {
	background-color: var(--bs-warning-bg-subtle);
	color: var(--bs-warning-text-emphasis);
}

/* Datepicker, documentation syntax highlighting and legacy C3 charts. */
html.pxm-theme[data-bs-theme="dark"] .datepicker {
	background-color: var(--bs-body-bg);
	color: var(--bs-body-color);
}

html.pxm-theme[data-bs-theme="dark"] :is(.datepicker table tr td.day:hover, .datepicker table tr td span:hover, .datepicker .datepicker-switch:hover, .datepicker .prev:hover, .datepicker .next:hover, .datepicker tfoot tr th:hover) {
	background: var(--bs-secondary-bg);
}

html.pxm-theme[data-bs-theme="dark"] :is(.datepicker table tr td.old, .datepicker table tr td.new, .datepicker table tr td.disabled) { color: var(--bs-secondary-color); }

html.pxm-theme[data-bs-theme="dark"] :is(code, pre[class*="language-"], code[class*="language-"]) {
	color: var(--bs-body-color);
	background-color: var(--bs-tertiary-bg);
	text-shadow: none;
}

html.pxm-theme[data-bs-theme="dark"] :is(.token.comment, .token.prolog, .token.doctype, .token.cdata, .token.punctuation) { color: #adb5bd; }

html.pxm-theme[data-bs-theme="dark"] :is(.token.property, .token.tag, .token.constant, .token.symbol, .token.deleted) { color: #f18caa; }

html.pxm-theme[data-bs-theme="dark"] :is(.token.selector, .token.attr-name, .token.string, .token.builtin, .token.inserted) { color: #a8d989; }

html.pxm-theme[data-bs-theme="dark"] :is(.token.operator, .token.entity, .token.url) { color: #e6bc8a; background: none; }

html.pxm-theme[data-bs-theme="dark"] :is(.token.atrule, .token.attr-value, .token.keyword) { color: #8acbfa; }

html.pxm-theme[data-bs-theme="dark"] :is(.token.function, .token.class-name) { color: #eaa1c5; }

html.pxm-theme[data-bs-theme="dark"] .c3 text { fill: var(--bs-body-color); }

html.pxm-theme[data-bs-theme="dark"] :is(.c3-axis path, .c3-axis line) { stroke: var(--bs-secondary-color); }

html.pxm-theme[data-bs-theme="dark"] .c3-grid line { stroke: var(--bs-border-color); }

html.pxm-theme[data-bs-theme="dark"] :is(.c3-tooltip, .c3-tooltip td) {
	background-color: var(--bs-body-bg);
	color: var(--bs-body-color);
}

html.pxm-theme[data-bs-theme="dark"] .c3-tooltip th { background-color: var(--bs-secondary-bg); }

html.pxm-theme[data-bs-theme="dark"] .center :is(.e, .v, .h) {
	background-color: var(--bs-tertiary-bg);
	color: var(--bs-body-color);
}

html.pxm-theme[data-bs-theme="dark"] .accordion-button:not(.collapsed) {
	/* Header button active state (Expanded) */
	background-color: var(--bs-secondary-bg);
	color: var(--bs-body-color);
}


html.pxm-theme[data-bs-theme="dark"] .form-control::placeholder {
	color: #8b929a;
	opacity: 1;
}

html.pxm-theme[data-bs-theme="dark"] {
	--bs-secondary: #59636f;
	--bs-secondary-rgb: 89, 99, 111;
	--bs-secondary-color: #aeb7c2;
	--bs-secondary-color-rgb: 174, 183, 194;
	--bs-secondary-text-emphasis: #aeb7c2;
	--bs-secondary-bg: #35414d;
	--bs-secondary-bg-rgb: 53, 65, 77;
	--bs-secondary-bg-subtle: #2c3743;
	--bs-secondary-border-subtle: #59636f;
	--bs-border-color: #59636f;
	--bs-border-color-translucent: rgba(174, 183, 194, 0.2);
}

html.pxm-theme[data-bs-theme="dark"] .btn-secondary {
	--bs-btn-color: #fff;
	--bs-btn-bg: #59636f;
	--bs-btn-border-color: #59636f;
	--bs-btn-hover-color: #fff;
	--bs-btn-hover-bg: #718096;
	--bs-btn-hover-border-color: #718096;
	--bs-btn-focus-shadow-rgb: 113, 128, 150;
	--bs-btn-active-color: #fff;
	--bs-btn-active-bg: #718096;
	--bs-btn-active-border-color: #718096;
	--bs-btn-disabled-color: #fff;
	--bs-btn-disabled-bg: #59636f;
	--bs-btn-disabled-border-color: #59636f;
}

html.pxm-theme[data-bs-theme="dark"] .btn-outline-secondary {
	--bs-btn-color: #aeb7c2;
	--bs-btn-border-color: #718096;
	--bs-btn-hover-color: #fff;
	--bs-btn-hover-bg: #59636f;
	--bs-btn-hover-border-color: #59636f;
	--bs-btn-focus-shadow-rgb: 113, 128, 150;
	--bs-btn-active-color: #fff;
	--bs-btn-active-bg: #59636f;
	--bs-btn-active-border-color: #59636f;
	--bs-btn-disabled-color: #718096;
	--bs-btn-disabled-border-color: #718096;
}

html.pxm-theme[data-bs-theme="dark"] .table-secondary {
	--bs-table-color: var(--bs-secondary-color);
	--bs-table-striped-color: var(--bs-secondary-color);
	--bs-table-hover-color: var(--bs-secondary-color);
	--bs-table-active-color: var(--bs-secondary-color);
}
