/**
 * DC Accessibility – floating accessibility panel
 * (C) 2026 Dezign Cubicle – GPL v2 or later
 *
 * Feature rules target page content only: "body :not(.dca-root, .dca-root *)"
 * keeps the widget itself unaffected by the modes it switches on.
 */

/* =========================================================
   Tokens
   ========================================================= */
.dca-root {
	--dca-brand: #1d4ed8;
	--dca-icon: #ffffff;
	--dca-size: 56px;
	--dca-x: 20px;
	--dca-y: 20px;
	--dca-z: 2147483000;

	--dca-surface: #ffffff;
	--dca-subtle: #f4f5f7;
	--dca-line: #e4e7ec;
	--dca-ink: #1c2430;
	--dca-muted: #5b6574;
	--dca-off: #c9ced6;
	--dca-accent: var(--dca-brand);
	--dca-ease: cubic-bezier(.2, .8, .2, 1);

	position: fixed;
	right: var(--dca-x);
	bottom: calc(var(--dca-y) + env(safe-area-inset-bottom, 0px));
	z-index: var(--dca-z);
	font: 400 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--dca-ink);
	letter-spacing: normal;
	word-spacing: normal;
	text-align: left;
	text-transform: none;
	-webkit-font-smoothing: antialiased;
}
/* Dark theme: forced (Panel theme = Dark) or following the visitor's device (Panel theme = Auto) */
.dca-root.dca-theme-dark {
	--dca-surface: #1a1e26;
	--dca-subtle: #232833;
	--dca-line: #2f3542;
	--dca-ink: #eef0f3;
	--dca-muted: #9aa3b2;
	--dca-off: #464d5a;
	--dca-accent: color-mix(in srgb, var(--dca-brand) 55%, #ffffff);
}
@media (prefers-color-scheme: dark) {
	.dca-root.dca-theme-auto {
		--dca-surface: #1a1e26;
		--dca-subtle: #232833;
		--dca-line: #2f3542;
		--dca-ink: #eef0f3;
		--dca-muted: #9aa3b2;
		--dca-off: #464d5a;
		--dca-accent: color-mix(in srgb, var(--dca-brand) 55%, #ffffff);
	}
}
.dca-root.dca-left { right: auto; left: var(--dca-x); }
.dca-root *, .dca-root *::before, .dca-root *::after { box-sizing: border-box; }
.dca-root svg { display: block; flex: none; }
.dca-root button {
	font: inherit;
	color: inherit;
	margin: 0;
	text-transform: none;
	letter-spacing: normal;
	line-height: inherit;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	-webkit-tap-highlight-color: transparent;
}
.dca-root button:focus-visible,
.dca-root a:focus-visible {
	outline: 2px solid var(--dca-accent);
	outline-offset: 2px;
}

/* =========================================================
   Floating button
   ========================================================= */
.dca-root .dca-trigger {
	position: relative;
	display: grid;
	place-items: center;
	width: var(--dca-size);
	height: var(--dca-size);
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--dca-brand);
	color: var(--dca-icon);
	box-shadow: 0 0 0 3px rgba(255, 255, 255, .92), 0 12px 28px -8px rgba(16, 24, 40, .5);
	transition: transform .25s var(--dca-ease), box-shadow .25s var(--dca-ease);
}
.dca-root .dca-trigger:hover { transform: translateY(-2px); box-shadow: 0 0 0 3px rgba(255, 255, 255, .92), 0 16px 32px -8px rgba(16, 24, 40, .55); }
.dca-root .dca-trigger:focus-visible { outline: 3px solid var(--dca-brand); outline-offset: 5px; }
.dca-root .dca-trigger svg {
	grid-area: 1 / 1;
	width: 54%;
	height: 54%;
	transition: opacity .2s ease, transform .3s var(--dca-ease);
}
.dca-root .dca-trigger .dca-i-close { width: 40%; height: 40%; opacity: 0; transform: rotate(-90deg) scale(.5); }
.dca-root .dca-trigger[aria-expanded="true"] .dca-i-main { opacity: 0; transform: rotate(90deg) scale(.5); }
.dca-root .dca-trigger[aria-expanded="true"] .dca-i-close { opacity: 1; transform: none; }
.dca-root .dca-badge {
	position: absolute;
	top: 1px;
	right: 1px;
	width: 13px;
	height: 13px;
	border-radius: 50%;
	background: #16a34a;
	box-shadow: 0 0 0 2.5px #ffffff;
	transform: scale(0);
	transition: transform .25s var(--dca-ease);
}
.dca-root.has-active .dca-badge { transform: scale(1); }

/* =========================================================
   Panel
   ========================================================= */
.dca-root .dca-panel {
	position: absolute;
	right: 0;
	bottom: calc(var(--dca-size) + 16px);
	display: flex;
	flex-direction: column;
	width: 360px;
	max-width: calc(100vw - (2 * var(--dca-x)));
	max-height: calc(100vh - var(--dca-size) - var(--dca-y) - 44px);
	max-height: calc(100dvh - var(--dca-size) - var(--dca-y) - 44px);
	background: var(--dca-surface);
	color: var(--dca-ink);
	border: 1px solid var(--dca-line);
	border-radius: 20px;
	box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 30px 60px -18px rgba(16, 24, 40, .38);
	overflow: hidden;
	opacity: 0;
	transform: translateY(10px) scale(.96);
	transform-origin: bottom right;
	transition: opacity .2s ease, transform .3s var(--dca-ease);
}
.dca-root .dca-panel.is-open { opacity: 1; transform: none; }
.dca-root .dca-panel[hidden] { display: none !important; }
.dca-root.dca-left .dca-panel { right: auto; left: 0; transform-origin: bottom left; }

/* Header */
.dca-root .dca-head {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 18px 16px 14px 18px;
}
.dca-root .dca-head-ico {
	display: grid;
	place-items: center;
	flex: none;
	width: 38px;
	height: 38px;
	border-radius: 12px;
	background: var(--dca-brand);
	color: var(--dca-icon);
}
.dca-root .dca-head-ico svg { width: 22px; height: 22px; }
.dca-root .dca-head-text { flex: 1; min-width: 0; padding-top: 1px; }
.dca-root .dca-title {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	font-family: inherit;
	font-size: 17px;
	font-weight: 650;
	line-height: 1.25;
	letter-spacing: -.01em;
	color: var(--dca-ink);
}
.dca-root .dca-title:focus { outline: none; }
.dca-root .dca-sub { margin: 2px 0 0; padding: 0; font-size: 13px; line-height: 1.4; color: var(--dca-muted); }
.dca-root .dca-close {
	display: grid;
	place-items: center;
	flex: none;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--dca-muted);
	transition: background-color .15s ease, color .15s ease;
}
.dca-root .dca-close:hover { background: var(--dca-subtle); color: var(--dca-ink); }
.dca-root .dca-close svg { width: 18px; height: 18px; }

/* Body */
.dca-root .dca-body {
	padding: 2px 14px 6px;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
}
.dca-root .dca-section { margin: 0 0 16px; }
.dca-root .dca-section-title {
	margin: 0 4px 8px;
	padding: 0;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--dca-muted);
}
.dca-root .dca-group {
	background: var(--dca-subtle);
	border-radius: 14px;
	padding: 2px 0;
}
.dca-root .dca-group-pad { padding: 10px 8px 6px; }

/* Rows */
.dca-root .dca-row {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 54px;
	padding: 8px 10px 8px 12px;
}
.dca-root .dca-row + .dca-row::before {
	content: "";
	position: absolute;
	top: 0;
	left: 56px;
	right: 12px;
	height: 1px;
	background: var(--dca-line);
}
.dca-root .dca-row.has-switch { cursor: pointer; }
.dca-root .dca-ico {
	display: grid;
	place-items: center;
	flex: none;
	width: 32px;
	height: 32px;
	border-radius: 9px;
	background: var(--dca-surface);
	color: var(--dca-muted);
	box-shadow: inset 0 0 0 1px var(--dca-line);
	transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.dca-root .dca-ico svg { width: 18px; height: 18px; }
.dca-root .dca-row.is-on .dca-ico { background: var(--dca-accent); color: var(--dca-icon); box-shadow: none; }
.dca-root .dca-label { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 500; line-height: 1.3; color: var(--dca-ink); }

/* Switch */
.dca-root .dca-switch {
	position: relative;
	flex: none;
	width: 44px;
	height: 26px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: var(--dca-off);
	transition: background-color .2s ease;
}
.dca-root .dca-knob {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #ffffff;
	box-shadow: 0 1px 3px rgba(16, 24, 40, .3);
	transition: transform .25s var(--dca-ease);
}
.dca-root .dca-switch[aria-checked="true"] { background: var(--dca-accent); }
.dca-root .dca-switch[aria-checked="true"] .dca-knob { transform: translateX(18px); }

/* Stepper */
.dca-root .dca-stepper {
	display: flex;
	align-items: center;
	flex: none;
	gap: 2px;
	padding: 2px;
	background: var(--dca-surface);
	border: 1px solid var(--dca-line);
	border-radius: 11px;
}
.dca-root .dca-step {
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--dca-ink);
	transition: background-color .15s ease, opacity .15s ease;
}
.dca-root .dca-step svg { width: 16px; height: 16px; }
.dca-root .dca-step:hover { background: var(--dca-subtle); }
.dca-root .dca-step[aria-disabled="true"] { opacity: .3; cursor: default; background: transparent; }
.dca-root .dca-readout {
	min-width: 54px;
	font-size: 13px;
	font-weight: 600;
	text-align: center;
	font-variant-numeric: tabular-nums;
	color: var(--dca-ink);
}

/* Colour swatches */
.dca-root .dca-swatches {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
	gap: 6px;
}
.dca-root .dca-swatch {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 7px;
	padding: 4px 2px 6px;
	border: 0;
	border-radius: 12px;
	background: transparent;
	color: var(--dca-muted);
	font-size: 12px;
	line-height: 1.2;
	text-align: center;
}
.dca-root .dca-chip {
	display: grid;
	place-items: center;
	width: 100%;
	max-width: 56px;
	height: 46px;
	border-radius: 12px;
	font: 700 18px/1 Georgia, "Times New Roman", serif;
	box-shadow: inset 0 0 0 1px rgba(128, 128, 128, .35);
	transition: box-shadow .2s ease, transform .2s var(--dca-ease);
}
.dca-root .dca-swatch:hover .dca-chip { transform: translateY(-1px); }
.dca-root .dca-swatch[aria-pressed="true"] { color: var(--dca-ink); font-weight: 600; }
.dca-root .dca-swatch[aria-pressed="true"] .dca-chip {
	box-shadow: 0 0 0 2px var(--dca-subtle), 0 0 0 4px var(--dca-accent);
}
.dca-root .dca-chip-none       { background: #ffffff; color: #1c2430; }
.dca-root .dca-chip-contrast   { background: #000000; color: #ffeb3b; }
.dca-root .dca-chip-invert     { background: #20242c; color: #f4f5f7; }
.dca-root .dca-chip-grayscale  { background: linear-gradient(135deg, #f2f2f2 0%, #9b9b9b 100%); color: #222222; }
.dca-root .dca-chip-saturation { background: linear-gradient(135deg, #cfd9e6 0%, #e2d4cb 100%); color: #3b4452; }

/* Footer */
.dca-root .dca-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px 12px;
	padding: 12px 16px 14px;
	border-top: 1px solid var(--dca-line);
}
.dca-root .dca-reset {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 8px 12px;
	border: 0;
	border-radius: 10px;
	background: var(--dca-subtle);
	color: var(--dca-ink);
	font-size: 13.5px;
	font-weight: 600;
	transition: background-color .15s ease, opacity .15s ease;
}
.dca-root .dca-reset:hover { background: var(--dca-line); }
.dca-root .dca-reset[aria-disabled="true"] { opacity: .45; cursor: default; background: var(--dca-subtle); }
.dca-root .dca-reset svg { width: 15px; height: 15px; }
.dca-root .dca-link {
	color: var(--dca-muted);
	font-size: 13px;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.dca-root .dca-link:hover { color: var(--dca-ink); }

.dca-root .dca-sr {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* Reading guide (lives inside .dca-root) */
.dca-root .dca-guide {
	position: fixed;
	left: 0;
	right: 0;
	top: -100px;
	height: 14px;
	transform: translateY(-50%);
	background: rgba(17, 24, 39, .8);
	border-top: 2px solid #ffbf00;
	border-bottom: 2px solid #ffbf00;
	pointer-events: none;
}

/* Phones: panel becomes a sheet across the bottom */
@media (max-width: 480px) {
	.dca-root .dca-panel {
		position: fixed;
		left: 10px;
		right: 10px;
		width: auto;
		max-width: none;
		bottom: calc(var(--dca-size) + var(--dca-y) + 14px + env(safe-area-inset-bottom, 0px));
		max-height: calc(100dvh - var(--dca-size) - var(--dca-y) - 40px);
	}
}
@media (prefers-reduced-motion: reduce) {
	.dca-root .dca-panel,
	.dca-root .dca-trigger,
	.dca-root .dca-trigger svg,
	.dca-root .dca-knob,
	.dca-root .dca-badge,
	.dca-root .dca-chip { transition: none; }
}
@media print {
	.dca-root, .dca-skip { display: none !important; }
}

/* Skip link */
.dca-skip {
	position: absolute;
	left: 12px;
	top: -200px;
	z-index: 2147483001;
	padding: 12px 18px;
	border-radius: 6px;
	background: #000000;
	color: #ffffff !important;
	font: 600 16px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	text-decoration: none;
}
.dca-skip:focus { top: 12px; outline: 3px solid #ffbf00; outline-offset: 2px; }

/* =========================================================
   Feature modes (classes on <html>)
   ========================================================= */

/* Enhanced focus outline */
html.dca-focus :focus-visible {
	outline: 3px solid #1a73e8 !important;
	outline-offset: 2px !important;
}

/* Text size – zoom method (root method is applied inline by JS) */
html.dca-zoom.dca-textsize-1 body > :not(.dca-root) { zoom: 1.1; }
html.dca-zoom.dca-textsize-2 body > :not(.dca-root) { zoom: 1.2; }
html.dca-zoom.dca-textsize-3 body > :not(.dca-root) { zoom: 1.35; }
html.dca-zoom.dca-textsize-4 body > :not(.dca-root) { zoom: 1.5; }

/* Line height */
html.dca-lineheight-1 body :not(.dca-root, .dca-root *) { line-height: 1.6 !important; }
html.dca-lineheight-2 body :not(.dca-root, .dca-root *) { line-height: 1.9 !important; }
html.dca-lineheight-3 body :not(.dca-root, .dca-root *) { line-height: 2.2 !important; }

/* Letter / word spacing */
html.dca-spacing-1 body :not(.dca-root, .dca-root *) { letter-spacing: .05em !important; word-spacing: .08em !important; }
html.dca-spacing-2 body :not(.dca-root, .dca-root *) { letter-spacing: .1em !important;  word-spacing: .16em !important; }
html.dca-spacing-3 body :not(.dca-root, .dca-root *) { letter-spacing: .16em !important; word-spacing: .24em !important; }

/* Readable font (icon fonts excluded) */
html.dca-font-1 body :not(.dca-root, .dca-root *, i, [class*="icon"], [class*="fa-"], .fa, .fas, .far, .fab, .fal, .fad, [class*="material-icons"], [class*="material-symbols"], [aria-hidden="true"]) {
	font-family: Verdana, Tahoma, "Segoe UI", Arial, sans-serif !important;
}

/* Align left */
html.dca-align-1 body :is(p, li, h1, h2, h3, h4, h5, h6, td, th, dd, dt, blockquote, figcaption, label, caption):not(.dca-root *) {
	text-align: left !important;
}

/* High contrast */
html.dca-contrast-1,
html.dca-contrast-1 body { background: #000000 !important; }
html.dca-contrast-1 body :not(.dca-root, .dca-root *) {
	background-color: #000000 !important;
	background-image: none !important;
	color: #ffffff !important;
	border-color: #ffffff !important;
	box-shadow: none !important;
	text-shadow: none !important;
}
html.dca-contrast-1 body :is(a, a *):not(.dca-root, .dca-root *) { color: #ffeb3b !important; }
html.dca-contrast-1 body a:not(.dca-root *) { text-decoration: underline !important; }
html.dca-contrast-1 body :is(button, input, select, textarea, .btn):not(.dca-root, .dca-root *) {
	border: 2px solid #ffffff !important;
}
html.dca-contrast-1 body :is(input, textarea)::placeholder { color: #cccccc !important; }

/* Colour filters – applied to body's children so the widget and fixed elements inside it are not affected */
html.dca-invert-1,
html.dca-invert-1 body { background: #000000 !important; }
html.dca-invert-1 body > :not(.dca-root) { filter: invert(1) hue-rotate(180deg) !important; }
html.dca-invert-1 body > :not(.dca-root) :is(img, video, iframe, canvas) { filter: invert(1) hue-rotate(180deg) !important; }

html.dca-grayscale-1 body > :not(.dca-root) { filter: grayscale(1) !important; }
html.dca-saturation-1 body > :not(.dca-root) { filter: saturate(.4) !important; }

/* Highlight links */
html.dca-links-1 body a:not(.dca-root *, .dca-skip) {
	outline: 2px solid #ffbf00 !important;
	outline-offset: 2px !important;
	background-color: #fff3c4 !important;
	color: #000000 !important;
	text-decoration: underline !important;
}

/* Highlight headings */
html.dca-headings-1 body :is(h1, h2, h3, h4, h5, h6, [role="heading"]):not(.dca-root *) {
	outline: 2px dashed #1a73e8 !important;
	outline-offset: 4px !important;
}

/* Big cursor */
html.dca-cursor-1,
html.dca-cursor-1 * {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M6 4l32 18-14 4-6 14z' fill='%23000' stroke='%23fff' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E") 6 4, auto !important;
}

/* Stop animations */
html.dca-motion-1 *,
html.dca-motion-1 *::before,
html.dca-motion-1 *::after {
	animation-duration: .001s !important;
	animation-delay: 0s !important;
	animation-iteration-count: 1 !important;
	transition-duration: .001s !important;
	transition-delay: 0s !important;
	scroll-behavior: auto !important;
}

/* Hide images */
html.dca-images-1 body :is(img, picture, video, [role="img"]):not(.dca-root *) { visibility: hidden !important; }
html.dca-images-1 body :not(.dca-root, .dca-root *) { background-image: none !important; }
