/**
 * assets/css/wcag-frontend-toolbar.css
 *
 * Styling for the EZZE WCAG Pro Frontend Toolbar.
 */

/* ==========================================================================
   1. Imports & Global Plugin Styles
   ========================================================================== */

/* --- Apply Plugin Font (Inter) if theme font is disabled --- */
@import url('../fonts/inter-fonts.css');

body.wcag-toolbar-use-plugin-font :where(
    #wcag-toolbar,
    #wcag-toolbar-trigger-wrap,
    #wcag-toolbar-restore,
    #wcag-toolbar-notice,
    #wcag-toolbar-score-tooltip,
    #wcag-reading-mode-dialog,
    #wcag-read-aloud-compact-player
) {
    font-family: 'Inter', sans-serif;
}

/* --- Hidden Attribute Handling (Toolbar-owned UI only) --- */
:where(
    #wcag-toolbar,
    #wcag-toolbar-trigger-wrap,
    #wcag-toolbar-overlay,
    #wcag-toolbar-restore,
    #wcag-toolbar-notice,
    #wcag-toolbar-score-tooltip,
    #wcag-reading-mode-dialog,
    #wcag-read-aloud-compact-player,
    #wcag-reading-line
)[hidden],
:where(
    #wcag-toolbar,
    #wcag-toolbar-trigger-wrap,
    #wcag-toolbar-overlay,
    #wcag-toolbar-restore,
    #wcag-toolbar-notice,
    #wcag-toolbar-score-tooltip,
    #wcag-reading-mode-dialog,
    #wcag-read-aloud-compact-player,
    #wcag-reading-line
) [hidden] {
    display: none !important;
}

/* ==========================================================================
   2. Accessibility Function Body Classes
   ========================================================================== */

/* Presentation modes only recolor original opaque surfaces. Transparent builder
   wrappers and image-backed areas must keep their authored layers and colors. */
html.wcag-colors-muted {
    --wcag-page-mode-bg: #fff8ed;
    --wcag-page-mode-text: #293b48;
    --wcag-page-mode-link: #155a78;
    --wcag-page-mode-border: #6f888c;
    --wcag-page-mode-button-bg: #1a303c;
    --wcag-page-mode-button-text: #fff8ed;
    --wcag-page-mode-button-hover: #0c4f70;
    --wcag-page-mode-button-focus-inner: #fff8ed;
}
html.wcag-colors-grayscale {
    --wcag-page-mode-bg: #ffffff;
    --wcag-page-mode-text: #171717;
    --wcag-page-mode-link: #171717;
    --wcag-page-mode-border: #525252;
}
html.wcag-colors-custom {
    --wcag-page-mode-bg: var(--wcag-custom-background, #fffdf5);
    --wcag-page-mode-text: var(--wcag-custom-text, #171717);
    --wcag-page-mode-link: var(--wcag-custom-text, #171717);
    --wcag-page-mode-border: var(--wcag-custom-text, #171717);
    --wcag-page-mode-button-bg: var(--wcag-custom-action-bg, #000000);
    --wcag-page-mode-button-text: var(--wcag-custom-action-text, #ffffff);
    --wcag-page-mode-button-hover: var(--wcag-custom-action-hover, #333333);
    --wcag-page-mode-button-focus-inner: var(--wcag-custom-action-focus-inner, #ffffff);
}
html.wcag-contrast-system {
    --wcag-page-mode-bg: #ffffff;
    --wcag-page-mode-text: #0f172a;
    --wcag-page-mode-link: #1e40af;
    --wcag-page-mode-border: #475569;
}
html.wcag-contrast-increased-light {
    --wcag-page-mode-bg: #ffffff;
    --wcag-page-mode-text: #000000;
    --wcag-page-mode-link: #0000ee;
    --wcag-page-mode-border: #000000;
    --wcag-page-mode-button-bg: #000000;
    --wcag-page-mode-button-text: #ffffff;
    --wcag-page-mode-button-hover: #1e40af;
    --wcag-page-mode-button-focus-inner: #ffffff;
}
html.wcag-contrast-increased-dark {
    --wcag-page-mode-bg: #171f25;
    --wcag-page-mode-text: #f6f2e9;
    --wcag-page-mode-link: #ffd18a;
    --wcag-page-mode-link-hover: #ffe4ad;
    --wcag-page-mode-border: #dfe6e8;
    --wcag-page-mode-button-bg: #f2f0e9;
    --wcag-page-mode-button-text: #172127;
    --wcag-page-mode-button-hover: #ffda9f;
    --wcag-page-mode-button-focus-inner: #172127;
}
html.wcag-contrast-increased-light.wcag-colors-muted {
    --wcag-page-mode-bg: #fff8ed;
    --wcag-page-mode-text: #1a303c;
    --wcag-page-mode-link: #0c4f70;
    --wcag-page-mode-border: #557982;
    --wcag-page-mode-button-hover: #0c4f70;
}
html.wcag-contrast-increased-dark.wcag-colors-muted {
    --wcag-page-mode-bg: #172b35;
    --wcag-page-mode-text: #eaf0ea;
    --wcag-page-mode-link: #a8d8d4;
    --wcag-page-mode-link-hover: #d8f2ef;
    --wcag-page-mode-border: #91aaa9;
    --wcag-page-mode-button-bg: #eaf0ea;
    --wcag-page-mode-button-text: #172b35;
    --wcag-page-mode-button-hover: #c8e9e6;
    --wcag-page-mode-button-focus-inner: #172b35;
}
html.wcag-contrast-increased-light.wcag-colors-grayscale {
    --wcag-page-mode-bg: #ffffff;
    --wcag-page-mode-text: #171717;
    --wcag-page-mode-link: #171717;
    --wcag-page-mode-border: #525252;
    --wcag-page-mode-button-hover: #525252;
}
html.wcag-contrast-increased-dark.wcag-colors-grayscale {
    --wcag-page-mode-bg: #111111;
    --wcag-page-mode-text: #f5f5f5;
    --wcag-page-mode-link: #f5f5f5;
    --wcag-page-mode-link-hover: #ffffff;
    --wcag-page-mode-border: #d4d4d4;
    --wcag-page-mode-button-bg: #f5f5f5;
    --wcag-page-mode-button-text: #111111;
    --wcag-page-mode-button-hover: #d4d4d4;
    --wcag-page-mode-button-focus-inner: #111111;
}
@media (prefers-color-scheme: light) {
    html.wcag-contrast-system {
        --wcag-page-mode-bg: #ffffff;
        --wcag-page-mode-text: #0f172a;
        --wcag-page-mode-link: #1e40af;
        --wcag-page-mode-border: #475569;
    }
    html.wcag-contrast-system.wcag-colors-muted {
        --wcag-page-mode-bg: #fff8ed;
        --wcag-page-mode-text: #1a303c;
        --wcag-page-mode-link: #0c4f70;
        --wcag-page-mode-border: #557982;
    }
    html.wcag-contrast-system.wcag-colors-grayscale {
        --wcag-page-mode-bg: #ffffff;
        --wcag-page-mode-text: #171717;
        --wcag-page-mode-link: #171717;
        --wcag-page-mode-border: #525252;
    }
}
@media (prefers-color-scheme: dark) {
    html.wcag-contrast-system {
        --wcag-page-mode-bg: #0f172a;
        --wcag-page-mode-text: #f8fafc;
        --wcag-page-mode-link: #bae6fd;
        --wcag-page-mode-border: #cbd5e1;
    }
    html.wcag-contrast-system.wcag-colors-muted {
        --wcag-page-mode-bg: #172b35;
        --wcag-page-mode-text: #eaf0ea;
        --wcag-page-mode-link: #a8d8d4;
        --wcag-page-mode-border: #91aaa9;
        --wcag-page-mode-button-bg: #fff8ed;
        --wcag-page-mode-button-text: #172b35;
        --wcag-page-mode-button-hover: #c8e9e6;
        --wcag-page-mode-button-focus-inner: #172b35;
    }
    html.wcag-contrast-system.wcag-colors-grayscale {
        --wcag-page-mode-bg: #111111;
        --wcag-page-mode-text: #f5f5f5;
        --wcag-page-mode-link: #f5f5f5;
        --wcag-page-mode-border: #d4d4d4;
    }
}

html:is(.wcag-colors-muted, .wcag-colors-grayscale, .wcag-colors-custom, .wcag-contrast-increased-light, .wcag-contrast-increased-dark, .wcag-contrast-system) .wcag-presentation-scope:not(img, picture, video, canvas, iframe, object, embed, svg, [data-wcag-image-surface]),
html:is(.wcag-colors-muted, .wcag-colors-grayscale, .wcag-colors-custom, .wcag-contrast-increased-light, .wcag-contrast-increased-dark, .wcag-contrast-system) .wcag-presentation-scope :where(*:not(img, picture, video, canvas, iframe, object, embed, source, track, svg, svg *, [data-wcag-image-surface], [data-wcag-image-surface] *)) {
    border-color: var(--wcag-page-mode-border) !important;
    color: var(--wcag-page-mode-text) !important;
}

/* Never turn transparent theme layers into opaque panels. A surface is tagged
   only after the runtime observes an authored, fully opaque background. */
html:is(.wcag-colors-muted, .wcag-colors-grayscale, .wcag-colors-custom, .wcag-contrast-increased-light, .wcag-contrast-increased-dark, .wcag-contrast-system) .wcag-presentation-scope:not([data-wcag-image-surface]),
html:is(.wcag-colors-muted, .wcag-colors-grayscale, .wcag-colors-custom, .wcag-contrast-increased-light, .wcag-contrast-increased-dark, .wcag-contrast-system) .wcag-presentation-scope [data-wcag-palette-surface]:not([data-wcag-image-surface], [data-wcag-image-surface] *) {
    background-color: var(--wcag-page-mode-bg) !important;
}

/* Theme icons often draw their visible shape with a CSS mask or empty menu-bar
   span. Keep those color carriers distinct from the surrounding page surface. */
html:is(.wcag-colors-muted, .wcag-colors-grayscale, .wcag-colors-custom, .wcag-contrast-increased-light, .wcag-contrast-increased-dark, .wcag-contrast-system) .wcag-presentation-scope[data-wcag-icon-color-carrier]:not([data-wcag-image-surface]),
html:is(.wcag-colors-muted, .wcag-colors-grayscale, .wcag-colors-custom, .wcag-contrast-increased-light, .wcag-contrast-increased-dark, .wcag-contrast-system) .wcag-presentation-scope [data-wcag-icon-color-carrier]:not([data-wcag-image-surface], [data-wcag-image-surface] *) {
    background-color: currentColor !important;
}

html:is(.wcag-colors-muted, .wcag-colors-grayscale, .wcag-colors-custom, .wcag-contrast-increased-light, .wcag-contrast-increased-dark, .wcag-contrast-system) .wcag-presentation-scope:is(a, a:visited):not([data-wcag-image-surface]),
html:is(.wcag-colors-muted, .wcag-colors-grayscale, .wcag-colors-custom, .wcag-contrast-increased-light, .wcag-contrast-increased-dark, .wcag-contrast-system) .wcag-presentation-scope :is(a, a:visited):not([data-wcag-image-surface], [data-wcag-image-surface] *) {
    color: var(--wcag-page-mode-link) !important;
}

/* A theme may put the visible link label in a nested span with its own color.
   Keep that label in the link palette without changing image-backed content. */
html:is(.wcag-colors-muted, .wcag-colors-grayscale, .wcag-colors-custom, .wcag-contrast-increased-light, .wcag-contrast-increased-dark, .wcag-contrast-system) .wcag-presentation-scope :is(a, a:visited):not([data-wcag-image-surface], [data-wcag-image-surface] *) :where(*:not(img, picture, video, canvas, iframe, object, embed, svg, svg *)) {
    color: inherit !important;
}

html:is(.wcag-contrast-increased-light, .wcag-contrast-increased-dark, .wcag-contrast-system) :where(.wcag-presentation-scope:is(button, input, select, textarea, [role="button"]):not([data-wcag-image-surface]), .wcag-presentation-scope :where(button, input, select, textarea, [role="button"]):not([data-wcag-image-surface], [data-wcag-image-surface] *)) {
    border: 2px solid var(--wcag-page-mode-border) !important;
    background-color: var(--wcag-page-mode-bg) !important;
    color: var(--wcag-page-mode-text) !important;
}

/* Filled actions, including theme links over photographs, need their own opaque
   foreground/background pair in increased contrast and Muted colors. */
html:is(.wcag-contrast-increased-light, .wcag-contrast-increased-dark, .wcag-colors-muted, .wcag-colors-custom) .wcag-presentation-scope :is(button, input[type="button"], input[type="submit"], input[type="reset"], a.btn, a.button, a[role="button"], a[data-wcag-action-surface], [role="button"]):not([data-wcag-image-surface], [data-wcag-image-surface] *) {
    border: 2px solid var(--wcag-page-mode-button-bg) !important;
    background-color: var(--wcag-page-mode-button-bg) !important;
    color: var(--wcag-page-mode-button-text) !important;
}
html:is(.wcag-contrast-increased-light, .wcag-contrast-increased-dark, .wcag-colors-muted, .wcag-colors-custom) .wcag-presentation-scope :is(button, input[type="button"], input[type="submit"], input[type="reset"], a.btn, a.button, a[role="button"], a[data-wcag-action-surface], [role="button"]):not([data-wcag-image-surface], [data-wcag-image-surface] *) :where(*) {
    color: inherit !important;
}
html:is(.wcag-contrast-increased-light, .wcag-contrast-increased-dark, .wcag-colors-muted, .wcag-colors-custom) .wcag-presentation-scope :is(button, input[type="button"], input[type="submit"], input[type="reset"], a.btn, a.button, a[role="button"], a[data-wcag-action-surface], [role="button"]):not([data-wcag-image-surface], [data-wcag-image-surface] *):is(:hover, :focus-visible) {
    background-color: var(--wcag-page-mode-button-hover) !important;
    color: var(--wcag-page-mode-button-text) !important;
}
html:is(.wcag-contrast-increased-light, .wcag-contrast-increased-dark, .wcag-colors-muted, .wcag-colors-custom) .wcag-presentation-scope :is(button, input[type="button"], input[type="submit"], input[type="reset"], a.btn, a.button, a[role="button"], a[data-wcag-action-surface], [role="button"]):not([data-wcag-image-surface], [data-wcag-image-surface] *):focus-visible {
    outline: 3px solid var(--wcag-page-mode-button-hover) !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 3px var(--wcag-page-mode-button-focus-inner), 0 0 0 6px var(--wcag-page-mode-button-hover) !important;
}

html.wcag-contrast-increased-dark .wcag-presentation-scope :is(a, a:visited):not(.btn, .button, [role="button"], [data-wcag-action-surface], [data-wcag-image-surface], [data-wcag-image-surface] *):is(:hover, :focus-visible) {
    color: var(--wcag-page-mode-link-hover) !important;
    text-decoration-thickness: .18em !important;
}

html:is(.wcag-contrast-increased-light, .wcag-contrast-increased-dark, .wcag-contrast-system) :where(.wcag-presentation-scope:is(a, a:visited):not([data-wcag-image-surface]), .wcag-presentation-scope :where(a, a:visited):not([data-wcag-image-surface], [data-wcag-image-surface] *)) {
    text-decoration: underline !important;
    text-decoration-thickness: .12em !important;
}

html.wcag-colors-include-media.wcag-colors-muted { --wcag-media-color-filter: saturate(.45); }
html.wcag-colors-include-media.wcag-colors-grayscale { --wcag-media-color-filter: grayscale(1); }
html.wcag-contrast-include-media:is(.wcag-contrast-increased-light, .wcag-contrast-increased-dark) { --wcag-media-contrast-filter: contrast(1.3); }
html.wcag-contrast-include-media.wcag-contrast-increased-dark { --wcag-media-contrast-filter: brightness(.75) contrast(1.3); }
html.wcag-contrast-include-media.wcag-contrast-system { --wcag-media-contrast-filter: contrast(1.18); }

html.wcag-colors-include-media:is(.wcag-colors-muted, .wcag-colors-grayscale) :where(.wcag-presentation-scope:is(img, video, canvas, svg, [data-wcag-background-media]), .wcag-presentation-scope :where(img, video, canvas, svg, [data-wcag-background-media])):not([data-wcag-media-filter-capture]),
html.wcag-contrast-include-media:is(.wcag-contrast-increased-light, .wcag-contrast-increased-dark, .wcag-contrast-system) :where(.wcag-presentation-scope:is(img, video, canvas, svg, [data-wcag-background-media]), .wcag-presentation-scope :where(img, video, canvas, svg, [data-wcag-background-media])):not([data-wcag-media-filter-capture]) {
    filter: var(--wcag-media-original-filter, blur(0)) var(--wcag-media-color-filter, saturate(1)) var(--wcag-media-contrast-filter, contrast(1)) !important;
}

html.wcag-contrast-include-media :where(.wcag-presentation-scope:is(img, video, canvas, svg, [data-wcag-background-media]), .wcag-presentation-scope :where(img, video, canvas, svg, [data-wcag-background-media]))[data-wcag-contrast-media-exception] {
    --wcag-media-contrast-filter: contrast(1);
}

html.wcag-underline-links :where(.wcag-presentation-scope:is(a, a:visited), .wcag-presentation-scope :where(a, a:visited)) {
    text-decoration: underline !important;
    text-decoration-thickness: max(1px, .1em) !important;
    text-underline-offset: .16em !important;
}

html.wcag-emphasize-controls :where(
    .wcag-presentation-scope:is(button, input, select, textarea, summary, audio[controls], video[controls], [contenteditable]:not([contenteditable="false"]), [role="button"], [role="switch"], [role="checkbox"], [role="radio"], [role="combobox"], [role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="option"], [role="slider"], [role="spinbutton"], [role="textbox"], [role="tab"], [role="treeitem"]),
    .wcag-presentation-scope :where(button, input, select, textarea, summary, audio[controls], video[controls], [contenteditable]:not([contenteditable="false"]), [role="button"], [role="switch"], [role="checkbox"], [role="radio"], [role="combobox"], [role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="option"], [role="slider"], [role="spinbutton"], [role="textbox"], [role="tab"], [role="treeitem"])
) {
    border: 3px solid currentColor !important;
    box-shadow: 0 0 0 2px Canvas !important;
}

/* Reduce motion */
html.wcag-reduce-motion *:not(:where([role="progressbar"], [role="progressbar"] *, [aria-busy="true"], [aria-busy="true"] *, [data-wcag-essential-motion], [data-wcag-essential-motion] *)),
html.wcag-reduce-motion *:not(:where([role="progressbar"], [role="progressbar"] *, [aria-busy="true"], [aria-busy="true"] *, [data-wcag-essential-motion], [data-wcag-essential-motion] *))::before,
html.wcag-reduce-motion *:not(:where([role="progressbar"], [role="progressbar"] *, [aria-busy="true"], [aria-busy="true"] *, [data-wcag-essential-motion], [data-wcag-essential-motion] *))::after {
    animation-delay: -1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    background-attachment: initial !important;
    scroll-behavior: auto !important;
    transition-delay: 0s !important;
    transition-duration: 0s !important;
    transition: none !important;
    animation: none !important;
}

/* Spezifische Selektoren, falls nötig */
html.wcag-reduce-motion body .ut-hover:hover img,
html.wcag-reduce-motion body .ut-hover:hover video.ut-selfvideo-player {
    transform: none !important;
    transition: none !important;
}
html.wcag-reduce-motion #wcag-toolbar-trigger:hover {
    transform: none !important; /* Verhindert Skalierung des Triggers bei deaktivierten Animationen */
}


@media (prefers-contrast: more) {
    html.wcag-contrast-system .wcag-presentation-scope :where(a, button, input, select, textarea, [role="button"]) {
        outline: 2px solid currentColor !important;
        outline-offset: 2px !important;
    }
}


/* ==========================================================================
   3. Toolbar Trigger Button
   ========================================================================== */

/* Wrapper handles positioning to avoid conflicts with Elementor and other page builders */
#wcag-toolbar-trigger-wrap {
    position: fixed;
    z-index: 99998; /* Unter dem Overlay, aber über dem meisten Seiteninhalt */
    /* Position (top/right/bottom/left) wird per JS/PHP gesetzt */
}

body.wcag-toolbar-is-open #wcag-toolbar-trigger-wrap {
    z-index: 100001 !important; /* Über Overlay (99999); !important beats inline z-index from PHP */
}

/*! <fs_premium_only> */
body.wcag-toolbar-is-open .wcag-toolbar-score-tooltip {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}
/*! </fs_premium_only> */

#wcag-toolbar-trigger {
    position: relative; /* Nicht mehr fixed - Wrapper übernimmt Positionierung */
    touch-action: manipulation;
    width: 50px;
    height: 50px;
    padding: 0;
    color: var(--wcag-icon-color, #ffffff); /* Standard-Icon-Farbe, wird per JS überschrieben */
    background-color: var(--wcag-trigger-bg-color, #0369a1); /* Standard-BG, wird per JS überschrieben */
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden; /* Wichtig für ::after Pseudo-Element (Ripple) */
    transition: transform 0.2s ease-in-out, background-color 0.2s, box-shadow 0.3s ease-in-out, border-radius 0.2s;
}

#wcag-toolbar-trigger:hover {
    transform: scale(1.1); /* Nur wenn Animationen nicht deaktiviert sind */
}

#wcag-toolbar-trigger:focus-visible {
    outline: 3px solid #fff !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 6px #111827 !important;
}

#wcag-toolbar-trigger svg {
    width: 24px; /* Konsistente Größe */
    height: 24px; /* Konsistente Größe */
    display: block;
    position: relative; /* Über Pseudo-Element (Ripple) */
    z-index: 2;
    /* filter (Icon-Schatten) wird per JS gesetzt */
    transition: filter 0.3s ease-in-out; /* Sanfter Übergang für den Schatten */
}

#wcag-toolbar-trigger.wcag-toolbar-trigger--icon-shadow svg {
    filter: drop-shadow(0 2px 2px rgb(0 0 0 / 40%));
}

/* --- Update Indicator Style (Pulse + Ripple for Trigger) --- */
@keyframes wcag-toolbar-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes wcag-toolbar-ripple {
  0% {
    transform: scale(0.8);
    opacity: 1;
  }
  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

#wcag-toolbar-trigger::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit; /* Erbt den Radius vom Button */
    background-color: var(--wcag-toolbar-accent, #0369a1); /* Akzentfarbe für Ripple */
    opacity: 0;
    z-index: 1; /* Hinter dem SVG */
    transform: scale(0.8);
    animation: none; /* Standardmäßig keine Animation */
    pointer-events: none;
}

/* Aktivierung der Animationen im Admin-Bereich */
body.toplevel_page_ezze-wcag-pro #wcag-toolbar-trigger.is-updated {
    animation: wcag-toolbar-pulse 0.5s ease-out 2;
}
body.toplevel_page_ezze-wcag-pro #wcag-toolbar-trigger.is-updated::after {
    animation: wcag-toolbar-ripple 1s ease-out forwards;
}


/* ==========================================================================
   4. Toolbar Main Container & Overlay
   ========================================================================== */
#wcag-toolbar {
    position: fixed;
    z-index: 100000; /* Über dem Overlay */
    /* Use the toolbar's own type scale instead of the theme's root font size. */
    width: min(760px, calc(100% - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    max-width: calc(100% - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    max-height: calc(100vh - 2em - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 2em - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    background-color: var(--wcag-toolbar-bg, #fff); /* Wird per JS mit CSS-Variablen gesetzt */
    color: var(--wcag-toolbar-text, #333); /* Wird per JS mit CSS-Variablen gesetzt */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Verhindert Überlaufen des Inhalts */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    /* Weitere CSS-Eigenschaften (top, left, right, bottom, border-radius, box-shadow) werden per JS gesetzt */
}

/* The dialog itself is a programmatic focus anchor; its controls keep their own visible focus styles. */
#wcag-toolbar[tabindex="-1"]:focus {
    outline: none !important;
}

#wcag-toolbar.wcag-toolbar-open {
    opacity: 1;
    visibility: visible;
}

#wcag-toolbar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Fixed mockup overlay; former custom color values cannot override it. */
    background-color: rgb(15 23 42 / 58%) !important;
    z-index: 99999; /* Unter der Toolbar, aber über dem Trigger */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

#wcag-toolbar-overlay.wcag-overlay-visible {
    opacity: 1;
    visibility: visible;
}


/* ==========================================================================
   5. Toolbar Inner Structure & Components
   ========================================================================== */

.wcag-toolbar-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%; /* Stellt sicher, dass der innere Container die volle Höhe einnimmt */
    max-height: calc(100vh - 40px);  /* bis zu dieser Höhe wächst er mit */
    overflow: hidden; /* Verhindert, dass z.B. der Footer bei viel Inhalt verschwindet */
}

/* 5.1 Toolbar Header */
.wcag-toolbar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .9em;
    padding: 1.35em 1.5em;
    border-bottom: 1px solid transparent; /* Farbe wird durch Theme-Klasse gesetzt */
    flex-shrink: 0; /* Verhindert Schrumpfen des Headers */
    background-color: var(--wcag-toolbar-header-bg); /* Wird per JS gesetzt */
}

.wcag-toolbar-title {
    font-size: 1.3em;
    font-weight: 750;
    margin: 0;
    color: inherit; /* Erbt vom Toolbar-Text */
    line-height: 1.4;
}

/* KORRIGIERTE Stile für den Schließen-Button */
#wcag-toolbar #wcag-toolbar-close {
    /* Basis-Reset & explizite Definitionen */
    background: transparent !important;
    border: none !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 10px !important;
    margin: 0 !important;
    cursor: pointer !important;
    color: inherit !important; /* Erbt Farbe vom Header (var(--wcag-toolbar-text) via #wcag-toolbar) */
    opacity: 1;
    line-height: 1 !important;
    box-shadow: none !important;
    border-radius: .65em !important;
    transition: opacity 0.2s ease-in-out, background-color 0.2s ease-in-out !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    font-size: initial !important;
    font-family: inherit !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    position: relative;
}

#wcag-toolbar #wcag-toolbar-close:hover {
    opacity: 1;
    background-color: rgba(0,0,0,0.05) !important;
}

#wcag-toolbar #wcag-toolbar-close svg {
    display: block !important;
    width: 24px !important;
    height: 24px !important;
    stroke: currentColor; /* Stellt sicher, dass die SVG-Linien die geerbte Textfarbe annehmen */
}

#wcag-toolbar #wcag-toolbar-close:focus-visible {
    outline: 2px solid #fff !important;
    outline-offset: 2px !important;
    opacity: 1; /* Bessere Sichtbarkeit bei Fokus */
    box-shadow: 0 0 0 5px #111827 !important;
}

/* KORRIGIERTE Stile für den Schließen-Button im Dark-Theme */
#wcag-toolbar.wcag-theme-dark #wcag-toolbar-close:hover {
    background-color: rgba(255, 255, 255, 0.12) !important; /* Hellerer Hover-Effekt */
}
#wcag-toolbar.wcag-theme-dark #wcag-toolbar-close svg {
    stroke: var(--wcag-toolbar-text, #e2e8f0); /* Stellt sicher, dass SVG-Linien hell sind */
}

.wcag-toolbar-top-actions {
    position: relative;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    flex: none;
    gap: .65em;
    border-bottom: 1px solid rgb(15 23 42 / 10%);
    background: var(--wcag-toolbar-bg, #fff);
    padding: .75em 1.25em;
}


/* 5.2 Toolbar Content Area */
.wcag-toolbar-content {
    padding: 1em 1.25em 1.25em;

    flex: 1 1 auto;                  /* nimmt den verbliebenen Platz ein */
    flex-grow: 1;                    /* Nimmt verfügbaren Platz ein */
    min-height: 0;                   /* erlaubt dem Flex-Item zu schrumpfen */
    overflow-y: auto;                /* Scroll bei Überlauf */
    scrollbar-gutter: stable;        /* keeps the no-JS fallback width stable */
    scroll-behavior: smooth;         /* weiches Scrollen */
    overscroll-behavior: contain;    /* kein Scroll-Chaining auf Body */
    -webkit-overflow-scrolling: touch; /* Für sanftes Scrollen auf iOS */
}

/* JavaScript keeps native scrolling authoritative and only replaces the
   browser-painted bar with this slim, synchronized overlay. */
#wcag-toolbar.wcag-toolbar-custom-scrollbar .wcag-toolbar-inner {
    position: relative;
}

#wcag-toolbar.wcag-toolbar-custom-scrollbar .wcag-toolbar-content {
    padding-inline-end: calc(28px + 7.2px);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#wcag-toolbar.wcag-toolbar-custom-scrollbar .wcag-toolbar-content::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

#wcag-toolbar .wcag-toolbar-scrollbar {
    position: absolute;
    z-index: 35;
    right: 2.88px;
    width: 20px;
    border-radius: 999px;
    opacity: .42;
    pointer-events: auto;
    touch-action: none;
    transition: opacity 150ms ease;
}

#wcag-toolbar .wcag-toolbar-scrollbar[hidden] {
    display: none !important;
}

#wcag-toolbar .wcag-toolbar-scrollbar::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    border-radius: 999px;
    background: var(--wcag-toolbar-line, #d8dee8);
    transform: translateX(-50%);
}

#wcag-toolbar .wcag-toolbar-scrollbar__thumb {
    position: absolute;
    top: 0;
    left: calc(50% - 2px);
    display: block;
    width: 4px;
    min-height: 44px;
    border-radius: 999px;
    background: var(--wcag-toolbar-muted, #475569);
    cursor: grab;
    transition: width 150ms ease, background-color 150ms ease, opacity 150ms ease;
}

#wcag-toolbar .wcag-toolbar-scrollbar:is(:hover, .is-active, .is-dragging) {
    opacity: .9;
}

#wcag-toolbar .wcag-toolbar-scrollbar:is(:hover, .is-active, .is-dragging) .wcag-toolbar-scrollbar__thumb {
    width: 6px;
    background: var(--wcag-toolbar-control-accent, #1d4ed8);
}

#wcag-toolbar .wcag-toolbar-scrollbar.is-dragging .wcag-toolbar-scrollbar__thumb {
    cursor: grabbing;
}

#wcag-toolbar .wcag-toolbar-content[role="region"]:focus-visible {
    outline: 3px solid var(--wcag-toolbar-focus-outer, #111827) !important;
    outline-offset: -4px !important;
}

/* Cursor beim aktiven Drag */
.wcag-toolbar-content.dragging {
    cursor: grabbing;
}

.wcag-toolbar-options-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    /* Reflow from the available toolbar width; do not assume a desktop viewport means a wide panel. */
    grid-template-columns: repeat(auto-fit, minmax(min(19em, 100%), 1fr));
    gap: .8em;
}

.wcag-toolbar-options-list li {
    margin: 0;
    padding: 0;
}

.wcag-toolbar-no-functions {
    grid-column: 1 / -1;
    text-align: center;
    font-style: italic;
    color: #6b7280; /* Tailwind gray-500 */
    padding: 1em 0; /* Etwas vertikaler Platz */
}

/* 5.3 Toolbar Shortcut Hints */
.wcag-toolbar-shortcuts-shell {
    position: relative;
    z-index: 20;
    flex: none;
    background: var(--wcag-toolbar-bg, #fff);
    padding: .15em 1.25em 1em;
    overflow: visible;
}

.wcag-toolbar-shortcuts-shell[hidden] {
    display: none !important;
}

#wcag-toolbar-shortcut-hints {
    position: relative;
    margin: 0;
    border: 1px solid rgb(100 116 139 / 35%);
    border-radius: .7em;
    background: var(--wcag-toolbar-bg, #fff);
    box-shadow: 0 .35em 1em rgb(15 23 42 / 10%);
    overflow: visible;
}

.wcag-toolbar-header-icon {
    display: inline-flex;
    width: 3.25em;
    height: 3.25em;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid rgb(37 99 235 / 16%);
    border-radius: 50%;
    background: var(--wcag-toolbar-accent-transparent, rgb(37 99 235 / 10%));
    color: var(--wcag-toolbar-control-accent, #0369a1);
}

.wcag-toolbar-header-icon svg {
    width: 1.8em;
    height: 1.8em;
}

#wcag-toolbar-shortcut-hints summary {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    min-height: 44px;
    align-items: center;
    gap: .65em 1.1em;
    padding: .75em 1em;
    font-size: .82em;
    font-weight: 700;
    line-height: 1.35;
    cursor: pointer;
    list-style: none;
    border-radius: inherit;
    transition: background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

#wcag-toolbar-shortcut-hints summary::-webkit-details-marker {
    display: none;
}

#wcag-toolbar-shortcut-hints summary:hover {
    background: var(--wcag-toolbar-accent-transparent, rgb(3 105 161 / 10%));
    box-shadow: 0 .45em 1.15em rgb(15 23 42 / 14%);
    transform: translateY(-1px);
}

#wcag-toolbar-shortcut-hints summary:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
    box-shadow: inset 0 0 0 3px #111827;
}

#wcag-toolbar-shortcut-hints summary > svg,
.wcag-toolbar-shortcut-chevron svg {
    width: 1.2em;
    height: 1.2em;
    flex: 0 0 auto;
}

.wcag-shortcut-hints-title {
    min-width: 0;
    font-weight: 700;
    white-space: nowrap;
}

.wcag-shortcut-hints-description {
    min-width: 0;
    color: inherit;
    font-size: .92em;
    font-weight: 400;
    line-height: 1.4;
    opacity: .68;
}

.wcag-toolbar-shortcut-chevron {
    display: inline-flex;
    transition: transform .2s ease;
}

#wcag-toolbar-shortcut-hints[open] .wcag-toolbar-shortcut-chevron {
    transform: rotate(180deg);
}

.wcag-shortcut-hints-list {
    position: absolute;
    z-index: 20;
    right: 0;
    bottom: calc(100% + .55em);
    left: 0;
    max-height: min(16em, 55vh);
    overflow-y: auto;
    list-style: none;
    margin: 0;
    border: 1px solid rgb(100 116 139 / 35%);
    border-radius: .7em;
    background: var(--wcag-toolbar-bg, #fff);
    padding: .7em;
    box-shadow: 0 .75em 2em rgb(15 23 42 / 18%);
    font-size: .78em;
    line-height: 1.5;
    color: inherit;
    overscroll-behavior: contain;
}

.wcag-shortcut-hints-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .75em;
    margin: 0;
    border-bottom: 1px solid rgb(100 116 139 / 16%);
    padding: .62em .55em;
    font-size: 1em;
    line-height: 1.4;
}

.wcag-shortcut-hints-list li:last-child {
    border-bottom: 0;
}

.wcag-shortcut-hints-action {
    min-width: 0;
    font-weight: 650;
}

.wcag-shortcut-key-combination {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: .28em;
    white-space: nowrap;
}

.wcag-shortcut-key-combination kbd {
    display: inline-flex;
    min-width: 2em;
    min-height: 2em;
    align-items: center;
    justify-content: center;
    border: 1px solid rgb(100 116 139 / 38%);
    border-bottom-width: 2px;
    border-radius: .4em;
    background: rgb(248 250 252 / 96%);
    padding: .15em .42em;
    color: #334155;
    font: inherit;
    font-size: .92em;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 1px 2px rgb(15 23 42 / 10%);
}

.wcag-shortcut-key-separator {
    color: inherit;
    font-size: .86em;
    opacity: .55;
}


/* 5.4 Toolbar Footer */
.wcag-toolbar-footer-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    flex: none;
    align-items: center;
    gap: .6em .75em;
    margin-top: auto;
    border-top: 1px solid rgb(15 23 42 / 10%);
    background: var(--wcag-toolbar-footer-bg, #f5f5f5);
    padding: .75em 1.25em;
}

.wcag-toolbar-footer {
    min-width: 0;
    padding: 0;
    text-align: left;
    font-size: .8em;
    line-height: 1.5;
}
.wcag-toolbar-footer a {
    color: var(--wcag-toolbar-link-color, #0369a1) !important;
    text-decoration: underline;
}
.wcag-toolbar-footer a:hover {
    text-decoration: none;
}

.wcag-toolbar-logo {
    max-width: 2.5em !important;
    height: auto;
    display: inline-block;
    margin-right: .55em;
    vertical-align: middle;
}

#wcag-toolbar .wcag-toolbar-accessibility-statement-link,
.wcag-toolbar-accessibility-statement-link {
    box-sizing: border-box !important;
    color: #fff !important;
    text-decoration: none !important;
    display: inline-flex !important;
    width: 100% !important;
    min-height: 44px;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: .75em !important;
    border: 1px solid var(--wcag-toolbar-action-color, #0369a1) !important;
    border-radius: .65em !important;
    padding: .65em .8em !important;
    background-color: var(--wcag-toolbar-action-color, #0369a1) !important;
    font-size: 1em !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    transition: border-color .2s ease, background-color .2s ease !important;
}

#wcag-toolbar .wcag-toolbar-accessibility-statement-link:hover,
.wcag-toolbar-accessibility-statement-link:hover {
    border-color: var(--wcag-toolbar-action-color, #0369a1) !important;
    text-decoration: none !important;
    background-color: var(--wcag-toolbar-action-color, #0369a1) !important;
    color: #fff !important;
    box-shadow: inset 0 0 0 2px rgb(255 255 255 / 45%) !important;
}

#wcag-toolbar .wcag-toolbar-reset {
    display: inline-flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: .4em;
    border: 1px solid rgb(100 116 139 / 35%) !important;
    border-radius: .55em !important;
    background: var(--wcag-toolbar-bg, #fff) !important;
    padding: .55em .7em !important;
    color: var(--wcag-toolbar-action-color, #0369a1) !important;
    font: inherit !important;
    font-size: .76em !important;
    font-weight: 750 !important;
    line-height: 1.2 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    box-shadow: none !important;
    cursor: pointer;
}

#wcag-toolbar .wcag-toolbar-reset svg {
    width: 1.1em;
    height: 1.1em;
    flex: 0 0 auto;
}

#wcag-toolbar .wcag-toolbar-reset:hover:not(:disabled) {
    background: var(--wcag-toolbar-accent-transparent-hover, rgb(3 105 161 / 20%)) !important;
    box-shadow: 0 .35em .8em rgb(15 23 42 / 12%) !important;
}

#wcag-toolbar .wcag-toolbar-reset:disabled {
    border-color: rgb(100 116 139 / 22%) !important;
    background: rgb(241 245 249 / 72%) !important;
    color: var(--wcag-toolbar-switch-off, #64748b) !important;
    opacity: 1;
    cursor: not-allowed;
}

#wcag-toolbar .wcag-toolbar-reset:focus-visible {
    outline: 2px solid #fff !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 5px #111827 !important;
}

.wcag-toolbar-description {
    margin: .2em 0 0;
    color: inherit;
    font-size: .84em;
    line-height: 1.45;
    opacity: .75;
}

.wcag-toolbar-heading {
    min-width: 0;
    flex: 1 1 auto;
}

#wcag-toolbar .wcag-toolbar-footer a:focus-visible,
#wcag-toolbar .wcag-toolbar-accessibility-statement-link:focus-visible {
    outline: 2px solid #fff !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 5px #111827 !important;
}

#wcag-toolbar .wcag-toolbar-accessibility-statement-link svg,
.wcag-toolbar-accessibility-statement-link svg {
    width: 1.15em !important;
    height: 1.15em !important;
    flex-shrink: 0 !important;
    stroke: currentColor !important;
}

/* 5.5 Zusatz für scrollbaren Toolbar Content */
/* Header, top actions, shortcuts and footer stay outside the card scroller. */
.wcag-toolbar-header,
.wcag-toolbar-top-actions,
.wcag-toolbar-shortcuts-shell,
.wcag-toolbar-footer-shell {
    flex: none;
}

/* 5.6 Visitor utility actions */
#wcag-toolbar .wcag-toolbar-utility-button {
    width: 100%;
}

#wcag-toolbar .wcag-toolbar-utility-button,
#wcag-toolbar .wcag-toolbar-hide-options button {
    display: inline-flex;
    min-width: 0;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: .45em;
    border: 1px solid rgb(100 116 139 / 35%) !important;
    border-radius: .5em !important;
    background: var(--wcag-toolbar-bg, #fff) !important;
    padding: .55em .65em !important;
    color: inherit !important;
    font: inherit !important;
    font-size: .78em !important;
    font-weight: 650 !important;
    line-height: 1.25 !important;
    text-align: center;
    text-transform: none !important;
    letter-spacing: normal !important;
    box-shadow: none !important;
    cursor: pointer;
}

#wcag-toolbar .wcag-toolbar-utility-button {
    min-height: 44px;
    border-color: transparent !important;
    background: rgb(226 232 240 / 72%) !important;
    padding-inline: .7em !important;
    color: #334155 !important;
    font-size: .78em !important;
    font-weight: 650 !important;
    opacity: 1;
}

#wcag-toolbar .wcag-toolbar-utility-button:hover,
#wcag-toolbar .wcag-toolbar-hide-options button:hover {
    border-color: var(--wcag-toolbar-control-accent, #0369a1) !important;
    background: #dbeafe !important;
}

#wcag-toolbar .wcag-toolbar-utility-button:hover,
#wcag-toolbar .wcag-toolbar-utility-button:focus-visible,
#wcag-toolbar .wcag-toolbar-utility-button[aria-expanded="true"] {
    opacity: 1;
}

#wcag-toolbar .wcag-toolbar-utility-button:focus-visible,
#wcag-toolbar .wcag-toolbar-hide-options button:focus-visible {
    outline: 2px solid #fff !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 5px #111827 !important;
}

.wcag-toolbar-utility-button svg {
    width: 1.1em;
    height: 1.1em;
    flex: 0 0 auto;
}

.wcag-toolbar-hide-options {
    position: absolute;
    z-index: 35;
    top: calc(100% - .2em);
    right: 1.25em;
    left: 1.25em;
    margin: 0;
    border: 1px solid rgb(100 116 139 / 24%);
    border-radius: .65em;
    background: var(--wcag-toolbar-bg, #fff);
    padding: .7em;
    box-shadow: 0 .8em 2em rgb(15 23 42 / 18%);
}

#wcag-toolbar .wcag-toolbar-dialog-actions[data-wcag-default-dialog-actions] .wcag-toolbar-hide-control {
    display: flex;
    min-width: 0;
    flex: 0 0 auto;
}

#wcag-toolbar .wcag-toolbar-dialog-actions[data-wcag-default-dialog-actions] #wcag-toolbar-hide {
    width: auto;
    max-width: 100%;
    min-height: 44px;
    padding: 8px 11.2px !important;
    font-size: 12.48px !important;
}

#wcag-toolbar .wcag-toolbar-dialog-actions[data-wcag-default-dialog-actions] .wcag-toolbar-hide-options {
    top: auto;
    right: auto;
    bottom: calc(100% + 6.4px);
    left: 0;
    width: min(352px, 100%);
}

.wcag-toolbar-hide-options.is-open {
    animation: wcag-toolbar-options-in .18s ease-out;
}

@keyframes wcag-toolbar-options-in {
    from { opacity: 0; transform: translateY(-.25em); }
    to { opacity: 1; transform: translateY(0); }
}

.wcag-toolbar-hide-options > h4 {
    margin: 0;
    padding: 0;
    color: inherit;
    font-size: .78em;
    font-weight: 650;
    line-height: 1.4;
}

.wcag-toolbar-hide-options__choices {
    display: grid;
    gap: .4em;
    margin-top: .55em;
}

#wcag-toolbar .wcag-toolbar-hide-options__choices button {
    justify-content: flex-start;
    text-align: left;
}

.wcag-toolbar-hide-options .wcag-toolbar-hide-options__hint {
    margin-top: .6em;
    color: inherit;
    font-size: .7em;
    font-weight: 400;
    opacity: .72;
}

.wcag-toolbar-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

.wcag-toolbar-restore {
    position: fixed !important;
    z-index: 100003 !important;
    bottom: max(16px, env(safe-area-inset-bottom)) !important;
    left: -9999px !important;
    border: 2px solid #fff !important;
    border-radius: 9px !important;
    background: #075985 !important;
    padding: 11px 16px !important;
    color: #fff !important;
    font: 600 14px/1.3 'Inter', sans-serif !important;
    box-shadow: 0 0 0 2px #075985, 0 8px 24px rgb(15 23 42 / 24%) !important;
}

.wcag-toolbar-restore:focus-visible {
    left: max(16px, env(safe-area-inset-left)) !important;
    outline: 3px solid #facc15 !important;
    outline-offset: 3px !important;
}

.wcag-toolbar-notice {
    position: fixed !important;
    z-index: 100004 !important;
    right: 16px !important;
    bottom: max(16px, env(safe-area-inset-bottom), var(--wcag-toolbar-notice-body-offset, 0px)) !important;
    left: 16px !important;
    display: flex !important;
    max-width: 512px;
    align-items: center;
    justify-content: space-between;
    gap: 13px;
    margin: 0 auto;
    border: 1px solid var(--wcag-toolbar-control-border, #8795a8);
    border-radius: 11px;
    background: var(--wcag-toolbar-surface, #ffffff);
    padding: 13px 16px 17px;
    color: var(--wcag-toolbar-ink, #0f172a);
    font: 500 14px/1.4 'Inter', sans-serif;
    box-shadow: 0 14px 34px rgb(15 23 42 / 28%);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .2s ease, transform .2s ease;
}

.wcag-toolbar-notice.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.wcag-toolbar-notice[hidden] {
    display: none !important;
}

#wcag-toolbar > .wcag-toolbar-notice {
    position: absolute !important;
    bottom: calc(var(--wcag-toolbar-notice-footer-offset, 0px) + 12px) !important;
}

#wcag-toolbar .wcag-toolbar-inner > #wcag-toolbar-notice.wcag-toolbar-notice {
    position: relative !important;
    z-index: auto !important;
    inset: auto !important;
    width: 100%;
    max-width: none;
    min-height: 60px;
    flex: 0 0 auto;
    margin: 0;
    border: 0 !important;
    border-bottom: 1px solid var(--wcag-toolbar-line, #d8dee8) !important;
    border-radius: 0 !important;
    background: var(--wcag-toolbar-surface, #ffffff) !important;
    padding: 10.4px 28px calc(10.4px + 4px);
    color: var(--wcag-toolbar-ink, #0f172a) !important;
    box-shadow: none !important;
    transform: none;
    transition: opacity .2s ease;
}

#wcag-toolbar .wcag-toolbar-inner > #wcag-toolbar-notice .wcag-toolbar-notice__message {
    min-width: 0;
    flex: 1 1 auto;
}

#wcag-toolbar .wcag-toolbar-inner > #wcag-toolbar-notice .wcag-toolbar-notice__timer {
    right: 0;
    bottom: -1px;
    left: 0;
    border-radius: 0;
}

.wcag-toolbar-notice__undo {
    display: inline-flex;
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 7.2px;
    border: 1px solid var(--wcag-toolbar-control-accent, #1d4ed8) !important;
    border-radius: 6px !important;
    background: var(--wcag-toolbar-control-accent, #1d4ed8) !important;
    padding: 9px 12px !important;
    color: var(--wcag-toolbar-on-accent, #ffffff) !important;
    font: inherit !important;
    font-weight: 700 !important;
    cursor: pointer;
}

.wcag-toolbar-notice__undo:focus-visible {
    outline: 3px solid var(--wcag-toolbar-focus-outer, #111827) !important;
    outline-offset: 2px !important;
}

.wcag-toolbar-notice__timer {
    position: absolute;
    right: 4px;
    bottom: 4px;
    left: 4px;
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: rgb(29 78 216 / 18%);
    pointer-events: none;
}

.wcag-toolbar-notice__timer-bar {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: var(--wcag-toolbar-control-accent, #1d4ed8);
}

.wcag-toolbar-notice.is-timing .wcag-toolbar-notice__timer-bar {
    animation: wcag-toolbar-notice-countdown var(--wcag-toolbar-notice-duration, 6000ms) linear forwards;
    animation-delay: calc(0ms - var(--wcag-toolbar-notice-elapsed, 0ms));
}

.wcag-toolbar-notice.is-timer-paused .wcag-toolbar-notice__timer-bar {
    animation-play-state: paused;
}

html.wcag-reduce-motion .wcag-toolbar-notice__timer-bar {
    animation-timing-function: steps(12, end) !important;
}

@keyframes wcag-toolbar-notice-countdown {
    to { width: 0; }
}

#wcag-toolbar-trigger-wrap.wcag-toolbar-trigger-suppressed {
    display: none !important;
}

.wcag-toolbar-sheet-handle {
    display: none;
}

/* Mobile rendering follows the same bottom-sheet pattern as admin help. */
#wcag-toolbar.wcag-toolbar-mobile-sheet {
    position: fixed !important;
    inset: auto 0 0 !important;
    width: 100% !important;
    max-width: none !important;
    max-height: min(86dvh, 46em) !important;
        border-radius: 24px 24px 0 0 !important;
    opacity: 1;
    --wcag-bottom-sheet-drag-y: 0px;
    transform: none !important;
    transition: transform 260ms ease-in-out, visibility 260ms ease-in-out !important;
    box-shadow: 0 -18px 45px rgb(15 23 42 / 22%) !important;
}

#wcag-toolbar.wcag-toolbar-mobile-sheet.wcag-toolbar-closed:not(.wcag-toolbar-open) {
    transform: translate3d(0, 100%, 0) !important;
}

#wcag-toolbar.wcag-toolbar-mobile-sheet.wcag-toolbar-open {
    transform: none !important;
    transition: none !important;
}

#wcag-toolbar.wcag-toolbar-mobile-sheet.wcag-toolbar-open.is-wcag-bottom-sheet-resetting {
    transition: transform 260ms ease-in-out !important;
    transform: translate3d(0, var(--wcag-bottom-sheet-drag-y, 0px), 0) !important;
}

#wcag-toolbar.wcag-toolbar-mobile-sheet.wcag-toolbar-open.is-wcag-bottom-sheet-dragging {
    transition: none !important;
    transform: translate3d(0, var(--wcag-bottom-sheet-drag-y, 0px), 0) !important;
}

#wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-inner {
    max-height: min(86dvh, 46em) !important;
    padding-bottom: env(safe-area-inset-bottom);
}

/* iOS 26 can paint a fixed element anchored with `bottom: 0` below the visual
   viewport even while its CSSOM rectangle is correct. Keep the modal dialog as
   a top-anchored visual-viewport frame and bottom-align only its inner sheet. */
#wcag-toolbar.wcag-toolbar-mobile-sheet.wcag-toolbar-visual-viewport-frame {
    top: var(--wcag-toolbar-visual-top, 0px) !important;
    right: 0 !important;
    bottom: auto !important;
    left: 0 !important;
    display: flex;
    width: 100% !important;
    height: var(--wcag-toolbar-visual-height, 100dvh) !important;
    max-width: none !important;
    max-height: none !important;
    align-items: stretch;
    justify-content: flex-end;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    overflow: hidden;
    transform: none !important;
    transition: none !important;
    box-shadow: none !important;
}

#wcag-toolbar.wcag-toolbar-mobile-sheet.wcag-toolbar-visual-viewport-frame .wcag-toolbar-inner {
    width: 100%;
    height: auto;
    max-height: min(calc(var(--wcag-toolbar-visual-height, 100dvh) - 32px), 800px) !important;
    margin-top: auto;
    border: 1px solid var(--wcag-toolbar-line);
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
    background: var(--wcag-toolbar-bg, #ffffff);
    box-shadow: 0 -18px 45px rgb(15 23 42 / 22%);
    transform: none;
    transition: transform 260ms ease-in-out;
}

#wcag-toolbar.wcag-toolbar-mobile-sheet.wcag-toolbar-visual-viewport-frame.wcag-toolbar-closed:not(.wcag-toolbar-open),
#wcag-toolbar.wcag-toolbar-mobile-sheet.wcag-toolbar-visual-viewport-frame.wcag-toolbar-open,
#wcag-toolbar.wcag-toolbar-mobile-sheet.wcag-toolbar-visual-viewport-frame.wcag-toolbar-open.is-wcag-bottom-sheet-resetting,
#wcag-toolbar.wcag-toolbar-mobile-sheet.wcag-toolbar-visual-viewport-frame.wcag-toolbar-open.is-wcag-bottom-sheet-dragging {
    transform: none !important;
    transition: none !important;
}

#wcag-toolbar.wcag-toolbar-mobile-sheet.wcag-toolbar-visual-viewport-frame.wcag-toolbar-closed:not(.wcag-toolbar-open) .wcag-toolbar-inner {
    transform: translate3d(0, 100%, 0);
}

#wcag-toolbar.wcag-toolbar-mobile-sheet.wcag-toolbar-visual-viewport-frame.wcag-toolbar-open .wcag-toolbar-inner {
    transform: none;
    transition: none;
}

#wcag-toolbar.wcag-toolbar-mobile-sheet.wcag-toolbar-visual-viewport-frame.wcag-toolbar-open.is-wcag-bottom-sheet-resetting .wcag-toolbar-inner {
    transition: transform 260ms ease-in-out;
    transform: translate3d(0, var(--wcag-bottom-sheet-drag-y, 0px), 0);
}

#wcag-toolbar.wcag-toolbar-mobile-sheet.wcag-toolbar-visual-viewport-frame.wcag-toolbar-open.is-wcag-bottom-sheet-dragging .wcag-toolbar-inner {
    transition: none;
    transform: translate3d(0, var(--wcag-bottom-sheet-drag-y, 0px), 0);
}

#wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-header {
    position: relative;
    padding-top: 1.8em;
}

#wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-header-icon {
    width: 2.75em;
    height: 2.75em;
}

#wcag-toolbar.wcag-toolbar-mobile-sheet #wcag-toolbar-close {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 12px !important;
}

#wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-sheet-handle {
    position: absolute;
    top: .55em;
    left: 50%;
    display: block;
    width: 2.8em;
    height: .28em;
    border-radius: 999px;
    background: currentColor;
    opacity: .24;
    transform: translateX(-50%);
    cursor: grab;
    touch-action: none;
}

#wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-sheet-handle:active {
    cursor: grabbing;
}

#wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-content {
    padding: 1em 1.15em;
}

#wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-top-actions {
    gap: .5em;
    padding: .7em 1.15em;
}

#wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-options-list {
    grid-template-columns: minmax(0, 1fr);
    gap: .65em;
}

#wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-switch-card {
    min-height: 6.25em;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "icon copy state";
    align-content: center;
    align-items: center;
    gap: .75em;
    padding: .85em;
}

#wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-switch-icon {
    width: 2.75em;
    height: 2.75em;
}

#wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-switch-copy,
#wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-switch-state {
    align-self: center;
}

#wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-shortcut-hints-description {
    display: none;
}

#wcag-toolbar.wcag-toolbar-mobile-sheet #wcag-toolbar-shortcut-hints summary {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: .65em;
}

#wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-shortcuts-shell {
    padding: .15em 1.15em .8em;
}

#wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-footer-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: .25em;
    padding: .75em 1.15em;
}

#wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-footer {
    grid-column: 1;
}

body:not(.wp-admin).wcag-toolbar-mobile-open {
    overflow: hidden;
}

body.wcag-toolbar-mobile-open #wcag-toolbar-trigger-wrap {
    opacity: 0;
    pointer-events: none;
}


/* ==========================================================================
   6. Switch Component (Tailwind-like)
   ========================================================================== */
.wcag-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    width: 100%;
    min-height: 44px;
    position: relative; /* Für :focus-visible auf dem Input */
}

.wcag-switch-label {
    margin-right: 0.75em; /* 12px */
    font-size: 0.9em; /* 14.4px */
    font-weight: 500;
    color: inherit; /* Erbt vom Toolbar-Text */
    flex-grow: 1; /* Label nimmt verfügbaren Platz ein */
}

.wcag-switch-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.wcag-switch-slider {
    position: relative;
    display: inline-block;
    width: 44px; /* Breite des Schalters */
    height: 24px; /* Höhe des Schalters */
    box-sizing: border-box;
    border: 2px solid var(--wcag-toolbar-switch-off, #64748b);
    background-color: var(--wcag-toolbar-switch-off, #64748b);
    border-radius: 9999px; /* Vollständig abgerundet */
    transition: background-color 0.2s ease-in-out;
    flex-shrink: 0; /* Verhindert Schrumpfen des Schalters */
}

.wcag-switch-slider::after {
    box-sizing: border-box; /* Schalter auf 20x20px halten, sonst auf einigen seiten 22x22px */
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px; /* Größe des inneren Kreises */
    height: 20px; /* Größe des inneren Kreises */
    background-color: var(--wcag-toolbar-switch-off-thumb, #fff);
    border-radius: 50%;
    border: 1px solid var(--wcag-toolbar-switch-off-thumb, #fff);
    transition: transform 0.2s ease-in-out;
}

.wcag-switch-input:checked + .wcag-switch-slider {
    border-color: var(--wcag-toolbar-control-accent, #0369a1);
    background-color: var(--wcag-toolbar-control-accent, #0369a1);
}

.wcag-switch-input:checked + .wcag-switch-slider::after {
    transform: translateX(20px); /* Verschiebt den Kreis nach rechts */
    border-color: var(--wcag-toolbar-control-thumb, #fff);
    background-color: var(--wcag-toolbar-control-thumb, #fff);
}

.wcag-switch-input:focus-visible + .wcag-switch-slider {
    box-shadow: 0 0 0 2px #fff, 0 0 0 5px #111827;
}

/* Card presentation supersedes the legacy track when current markup is used. */
.wcag-switch {
    position: relative;
    display: block;
    width: 100%;
    min-height: 44px;
    cursor: pointer;
    user-select: none;
}

.wcag-switch-card {
    display: grid;
    min-height: 7.25em;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "icon copy state";
    align-content: center;
    align-items: center;
    gap: 1em;
    border: 1px solid rgb(100 116 139 / 22%);
    border-radius: .8em;
    background: var(--wcag-toolbar-bg, #fff);
    padding: 1.15em;
    color: inherit;
    box-shadow: 0 .4em 1.2em rgb(15 23 42 / 8%);
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.wcag-switch:hover .wcag-switch-card {
    border-color: rgb(100 116 139 / 42%);
    box-shadow: 0 .55em 1.4em rgb(15 23 42 / 12%);
}

.wcag-switch-input:checked + .wcag-switch-card {
    border-color: var(--wcag-toolbar-control-accent, #0369a1);
    background: var(--wcag-toolbar-accent-transparent, rgb(3 105 161 / 10%));
}

.wcag-switch-input:focus-visible + .wcag-switch-card {
    outline: none;
    box-shadow: 0 0 0 2px #fff, 0 0 0 5px #111827;
}

.wcag-switch-icon {
    grid-area: icon;
    display: inline-flex;
    width: 3.35em;
    height: 3.35em;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--wcag-toolbar-accent-transparent, rgb(3 105 161 / 10%));
    color: inherit;
}

.wcag-switch-icon svg {
    width: 1.75em;
    height: 1.75em;
}

.wcag-switch-copy {
    grid-area: copy;
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: .35em;
}

.wcag-switch-card .wcag-switch-label {
    flex-grow: 0;
    margin: 0;
    color: inherit;
    font-size: .92em;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.wcag-switch-description {
    color: inherit;
    font-size: .76em;
    font-weight: 400;
    line-height: 1.45;
    opacity: .68;
    overflow-wrap: anywhere;
}

.wcag-switch-state {
    grid-area: state;
    align-self: center;
    color: var(--wcag-toolbar-switch-off, #64748b);
    font-size: .76em;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.wcag-switch-state-off,
.wcag-switch-state-on {
    display: inline-flex;
    align-items: center;
    gap: .35em;
}

.wcag-switch-state-on {
    display: none;
    color: var(--wcag-toolbar-control-accent, #0369a1);
}

.wcag-switch-state svg {
    width: 1.25em;
    height: 1.25em;
}

.wcag-switch-input:checked + .wcag-switch-card .wcag-switch-state-off {
    display: none;
}

.wcag-switch-input:checked + .wcag-switch-card .wcag-switch-state-on {
    display: inline-flex;
}

.wcag-toolbar-hint {
    margin: .45em .35em 0;
    color: inherit;
    font-size: .72em;
    line-height: 1.45;
    opacity: .75;
}


/* ==========================================================================
   7. Theme Specific Adjustments (Light/Dark)
   ========================================================================== */

/* Light Theme (Standard) */
#wcag-toolbar.wcag-theme-light .wcag-toolbar-header {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}
#wcag-toolbar.wcag-theme-light .wcag-toolbar-footer-shell {
    border-top-color: rgba(0, 0, 0, 0.1);
}
#wcag-toolbar.wcag-theme-light #wcag-toolbar-shortcut-hints {
    border-color: rgba(0, 0, 0, 0.12);
}

/* Dark Theme */
#wcag-toolbar.wcag-theme-dark {
    /* Compatibility adjustments for legacy markup. The fixed Light/Dark
       contract near the end of this file owns every color token. */
}

#wcag-toolbar.wcag-theme-dark .wcag-toolbar-header {
    border-bottom-color: rgba(255, 255, 255, 0.15); /* Hellerer Rand für bessere Trennung */
}

#wcag-toolbar.wcag-theme-dark .wcag-toolbar-footer-shell {
    border-top-color: rgba(255, 255, 255, 0.15); /* Hellerer Rand */
}

#wcag-toolbar.wcag-theme-dark .wcag-toolbar-close-button {
    /* color: #e2e8f0; */ /* Explizit helle Farbe, falls 'inherit' nicht ausreicht */
}
#wcag-toolbar.wcag-theme-dark .wcag-toolbar-close-button:hover {
    background-color: rgba(255, 255, 255, 0.12) !important; /* Hellerer Hover-Effekt */
}
#wcag-toolbar.wcag-theme-dark .wcag-toolbar-close-button svg {
    stroke: var(--wcag-toolbar-text, #e2e8f0); /* Stellt sicher, dass SVG-Linien hell sind */
}


/* Switch im Dark Theme */
#wcag-toolbar.wcag-theme-dark .wcag-switch-label {
    color: var(--wcag-toolbar-text, #e2e8f0); /* Stellt sicher, dass das Label hell ist */
}

#wcag-toolbar.wcag-theme-dark .wcag-switch-slider {
    border-color: var(--wcag-toolbar-switch-off, #94a3b8);
    background-color: var(--wcag-toolbar-switch-off, #94a3b8);
}

#wcag-toolbar.wcag-theme-dark .wcag-switch-slider::after {
    background-color: var(--wcag-toolbar-switch-off-thumb, #111827);
    border-color: var(--wcag-toolbar-switch-off-thumb, #111827);
}

#wcag-toolbar.wcag-theme-dark .wcag-switch-input:checked + .wcag-switch-slider {
    border-color: var(--wcag-toolbar-control-accent, #7dd3fc);
    background-color: var(--wcag-toolbar-control-accent, #7dd3fc);
}

#wcag-toolbar.wcag-theme-dark .wcag-switch-input:checked + .wcag-switch-slider::after {
    background-color: var(--wcag-toolbar-control-thumb, #111827);
    border-color: var(--wcag-toolbar-control-thumb, #111827);
}

#wcag-toolbar.wcag-theme-dark .wcag-switch-input:focus-visible + .wcag-switch-slider {
    box-shadow: 0 0 0 2px #fff, 0 0 0 5px #111827;
}

#wcag-toolbar.wcag-theme-dark .wcag-switch-input:focus-visible + .wcag-switch-card {
    box-shadow: 0 0 0 2px #111827, 0 0 0 5px #facc15;
}


/* Shortcut Hints im Dark Theme */
#wcag-toolbar.wcag-theme-dark #wcag-toolbar-shortcut-hints,
#wcag-toolbar.wcag-theme-dark .wcag-shortcut-hints-list {
    border-color: rgba(255, 255, 255, 0.18);
}

#wcag-toolbar.wcag-theme-dark .wcag-shortcut-hints-title {
    color: var(--wcag-toolbar-text, #e2e8f0); /* Helle Schrift, erbt von Toolbar-Einstellung */
    /* Falls spezifischer gewünscht:
    color: #f7fafc; // Fast weiß
    */
}

#wcag-toolbar.wcag-theme-dark .wcag-shortcut-hints-list {
    color: var(--wcag-toolbar-text, #e2e8f0); /* Helle Schrift, erbt von Toolbar-Einstellung */
    /* Falls spezifischer gewünscht:
    color: #cbd5e0; // Helleres Grau
    */
}
#wcag-toolbar.wcag-theme-dark .wcag-shortcut-hints-list li {
    border-bottom-color: rgb(255 255 255 / 14%);
}

#wcag-toolbar.wcag-theme-dark .wcag-shortcut-key-combination kbd {
    border-color: rgb(255 255 255 / 32%);
    background: rgb(255 255 255 / 10%);
    color: var(--wcag-toolbar-text, #e2e8f0);
}


/* Links im Footer des Dark Themes */
#wcag-toolbar.wcag-theme-dark .wcag-toolbar-footer a {
    /* Die Akzentfarbe wird verwendet. Wenn diese im Dark Theme zu dunkel ist, hier eine hellere Variante setzen:
    color: #63b3ed !important; // Beispiel: Tailwind blue-400
    */
}

/* Accessibility Statement Link im Dark Theme */
#wcag-toolbar.wcag-theme-dark .wcag-toolbar-accessibility-statement-link {
    color: var(--wcag-toolbar-on-accent, #ffffff) !important;
}

#wcag-toolbar.wcag-theme-dark .wcag-toolbar-accessibility-statement-link:hover {
    color: #fff !important;
}
#wcag-toolbar.wcag-theme-dark .wcag-toolbar-footer {
     color: var(--wcag-toolbar-text, #e2e8f0);
}

#wcag-toolbar.wcag-theme-dark .wcag-toolbar-footer > span {
     opacity: 0.8;
}


/* ==========================================================================
   Reading Mask nur Dark-Mode, dynamische Höhe
   ========================================================================== */

   .reading-mask {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 99997;
  }

  /* Dark-Mode Overlay über Box-Shadow der Highlight-Line */
  .reading-mask .highlight-line {
    position: absolute;
    left: 0; width: 100%;
    background: transparent;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.6);
    /* Höhe wird per JS gesetzt */
  }

/* ==========================================================================
   8. Desktop/Mobile Visibility based on Breakpoint and Body Classes
   ========================================================================== */

/* Hide on Desktop when the body has the 'wcag-hide-on-desktop' class
   and the screen width is greater than the mobile breakpoint. */
@media screen and (min-width: calc(var(--wcag-mobile-breakpoint, 768px) + 1px)) {
    body.wcag-hide-on-desktop #wcag-toolbar-trigger-wrap,
    body.wcag-hide-on-desktop #wcag-toolbar {
        display: none !important;
    }
}

/* Hide on Mobile when the body has the 'wcag-hide-on-mobile' class
   and the screen width is less than or equal to the mobile breakpoint. */
@media screen and (max-width: var(--wcag-mobile-breakpoint, 768px)) {
    body.wcag-hide-on-mobile #wcag-toolbar-trigger-wrap,
    body.wcag-hide-on-mobile #wcag-toolbar {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    #wcag-toolbar-trigger,
    #wcag-toolbar-trigger::after,
    #wcag-toolbar-trigger svg,
    #wcag-toolbar,
    #wcag-toolbar-overlay,
    .wcag-toolbar-notice,
    .wcag-toolbar-hide-options,
    .wcag-toolbar-accessibility-statement-link,
    #wcag-toolbar-shortcut-hints summary,
    .wcag-switch-card,
    .wcag-toolbar-shortcut-chevron,
    .wcag-switch-slider,
    .wcag-switch-slider::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }

    #wcag-toolbar-trigger:hover,
    #wcag-toolbar-shortcut-hints summary:hover,
    #wcag-toolbar .wcag-toolbar-accessibility-statement-link:hover {
        transform: none !important;
    }

    .wcag-toolbar-content {
        scroll-behavior: auto !important;
    }

    .wcag-toolbar-notice__timer-bar {
        animation-timing-function: steps(12, end) !important;
    }
}

@media (forced-colors: active) {
    #wcag-toolbar-trigger,
    #wcag-toolbar,
    #wcag-toolbar button,
    #wcag-toolbar a,
    #wcag-toolbar .wcag-switch-slider,
    #wcag-toolbar .wcag-switch-card {
        forced-color-adjust: auto;
    }

    #wcag-toolbar-trigger {
        border: 2px solid ButtonText !important;
        background: ButtonFace !important;
        color: ButtonText !important;
    }

    .wcag-toolbar-notice__timer {
        border: 1px solid CanvasText;
        background: Canvas;
    }

    .wcag-toolbar-notice__timer-bar {
        background: Highlight;
        forced-color-adjust: auto;
    }

    #wcag-reading-mask .wcag-reading-mask__window {
        border-color: CanvasText;
        forced-color-adjust: none;
    }

    #wcag-toolbar {
        border: 2px solid CanvasText !important;
        background: Canvas !important;
        color: CanvasText !important;
    }

    #wcag-toolbar .wcag-switch-slider {
        border: 2px solid ButtonText !important;
        background: ButtonFace !important;
    }

    #wcag-toolbar .wcag-switch-card {
        border: 2px solid ButtonText !important;
        background: Canvas !important;
        color: CanvasText !important;
    }

    #wcag-toolbar .wcag-switch-slider::after {
        border: 1px solid ButtonText !important;
        background: ButtonText !important;
    }

    #wcag-toolbar .wcag-switch-input:checked + .wcag-switch-slider {
        border-color: Highlight !important;
        background: Highlight !important;
    }

    #wcag-toolbar .wcag-switch-input:checked + .wcag-switch-card {
        border-color: Highlight !important;
        background: Canvas !important;
    }

    #wcag-toolbar .wcag-switch-input:checked + .wcag-switch-slider::after {
        border-color: HighlightText !important;
        background: HighlightText !important;
    }

    #wcag-toolbar-trigger:focus-visible,
    #wcag-toolbar button:focus-visible,
    #wcag-toolbar a:focus-visible,
    #wcag-toolbar input:focus-visible,
    #wcag-toolbar .wcag-switch-input:focus-visible + .wcag-switch-slider,
    #wcag-toolbar .wcag-switch-input:focus-visible + .wcag-switch-card {
        outline: 3px solid Highlight !important;
        outline-offset: 3px !important;
        box-shadow: none !important;
    }
}

/* Component token fallbacks for markup loaded before the fixed theme class is
   attached. The Light/Dark contract below is the authoritative palette. */
#wcag-toolbar {
    --wcag-toolbar-control-accent: var(--wcag-toolbar-accent, #1d4ed8);
    --wcag-toolbar-on-accent: #ffffff;
    --wcag-toolbar-surface: var(--wcag-toolbar-bg, #ffffff);
    --wcag-toolbar-header-text: var(--wcag-toolbar-ink, #0f172a);
    --wcag-toolbar-footer-text: var(--wcag-toolbar-ink, #0f172a);
    --wcag-toolbar-header-action: var(--wcag-toolbar-accent, #1d4ed8);
    --wcag-toolbar-footer-link: var(--wcag-toolbar-link-color, #1e40af);
}

#wcag-toolbar .wcag-toolbar-header {
    background: var(--wcag-toolbar-header-bg, var(--wcag-toolbar-bg)) !important;
    color: var(--wcag-toolbar-header-text) !important;
}

#wcag-toolbar .wcag-toolbar-header :where(.wcag-toolbar-title, .wcag-toolbar-description) { color: inherit !important; }
#wcag-toolbar .wcag-toolbar-profile,
#wcag-toolbar .wcag-toolbar-close {
    border-color: var(--wcag-toolbar-header-action) !important;
    background: transparent !important;
    color: var(--wcag-toolbar-header-action) !important;
}

#wcag-toolbar .wcag-toolbar-content,
#wcag-toolbar .wcag-toolbar-view-header { background: var(--wcag-toolbar-bg) !important; color: var(--wcag-toolbar-ink) !important; }

#wcag-toolbar :where(
    .wcag-toolbar-tool-card,
    .wcag-toolbar-choice-card,
    .wcag-toolbar-text-stepper,
    .wcag-toolbar-color-control,
    .wcag-read-aloud-player__controls button,
    .wcag-toolbar-profile-item
) {
    background: var(--wcag-toolbar-surface) !important;
    color: var(--wcag-toolbar-ink) !important;
}

#wcag-toolbar .wcag-toolbar-setting-row { background: var(--wcag-toolbar-surface); color: var(--wcag-toolbar-ink); }
#wcag-toolbar .wcag-toolbar-tool-card.is-active,
#wcag-toolbar .wcag-toolbar-tool-card[data-wcag-active="true"] { background: linear-gradient(145deg, var(--wcag-toolbar-surface), var(--wcag-toolbar-accent-soft)) !important; }
#wcag-toolbar .wcag-toolbar-choice-card:has(input:checked) { background: var(--wcag-toolbar-accent-soft) !important; }
#wcag-toolbar .wcag-toolbar-primary-action,
#wcag-toolbar .wcag-read-aloud-player__controls [data-wcag-action="read-aloud-toggle"] {
    border-color: var(--wcag-toolbar-control-accent) !important;
    background: var(--wcag-toolbar-control-accent) !important;
    color: var(--wcag-toolbar-on-accent) !important;
}

#wcag-toolbar .wcag-toolbar-view-status:not(:empty) { background: var(--wcag-toolbar-success-soft); color: var(--wcag-toolbar-success); }
#wcag-toolbar .wcag-toolbar-footer-shell { background: var(--wcag-toolbar-footer-bg) !important; color: var(--wcag-toolbar-footer-text) !important; }
#wcag-toolbar .wcag-toolbar-footer,
#wcag-toolbar .wcag-toolbar-footer > span { color: inherit !important; }
#wcag-toolbar .wcag-toolbar-footer a { color: var(--wcag-toolbar-footer-link) !important; text-decoration: underline !important; }
#wcag-toolbar .wcag-toolbar-color-control input[type="text"] { color: var(--wcag-toolbar-ink) !important; }

@media (max-width: 380px) {
    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-top-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-shortcut-hints-list li {
        grid-template-columns: minmax(0, 1fr);
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-shortcut-key-combination {
        justify-content: flex-start;
    }
}

/* ==========================================================================
   16. Toolbar v2 — canonical mockup implementation
   ========================================================================== */

#wcag-toolbar {
    --wcag-toolbar-accent: #1d4ed8;
    --wcag-toolbar-accent-strong: #173eb8;
    --wcag-toolbar-accent-soft: #eff6ff;
    --wcag-toolbar-success: #08783e;
    --wcag-toolbar-success-soft: #ecfdf3;
    --wcag-toolbar-danger: #b42318;
    --wcag-toolbar-ink: #0f172a;
    --wcag-toolbar-muted: #526071;
    --wcag-toolbar-line: #d8dee8;
    box-sizing: border-box;
    width: min(760px, calc(100% - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    max-width: calc(100% - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    max-height: min(780px, calc(100dvh - 32px));
    border: 1px solid var(--wcag-toolbar-line);
    border-radius: 16px;
    background: var(--wcag-toolbar-bg, #ffffff);
    color: var(--wcag-toolbar-text, var(--wcag-toolbar-ink));
    box-shadow: 0 24px 64px rgb(15 23 42 / 24%);
    container-name: wcag-toolbar;
    container-type: inline-size;
    font-size: 16px;
    line-height: 1.45;
    margin: 0;
    padding: 0;
}

#wcag-toolbar::backdrop { background: transparent; }
/* Match the ID-specific base reset so the saved desktop preference wins. */
#wcag-toolbar #wcag-toolbar-close.wcag-toolbar-close--mobile-only { display: none !important; }
#wcag-toolbar.wcag-toolbar-mobile-sheet #wcag-toolbar-close.wcag-toolbar-close--mobile-only { display: inline-flex !important; }

#wcag-toolbar *, #wcag-toolbar *::before, #wcag-toolbar *::after,
#wcag-reading-mode-dialog *, #wcag-reading-mode-dialog *::before, #wcag-reading-mode-dialog *::after,
#wcag-read-aloud-compact-player *, #wcag-read-aloud-compact-player *::before, #wcag-read-aloud-compact-player *::after {
    box-sizing: border-box;
}

#wcag-toolbar :where(button, input, select, textarea, a, label, legend, output) {
    font: inherit;
    letter-spacing: normal;
    text-transform: none;
}

#wcag-toolbar :where(button, input, select, textarea, a):focus-visible,
#wcag-read-aloud-compact-player :where(button, input, select, textarea, a):focus-visible {
    outline: 3px solid var(--wcag-toolbar-focus-inner, #ffffff) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 6px var(--wcag-toolbar-focus-outer, #111827) !important;
}

#wcag-reading-mode-dialog :where(button, input, select, textarea, a, [tabindex]):focus-visible {
    outline: 3px solid #ffffff !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 6px #111827 !important;
}

#wcag-toolbar .wcag-toolbar-inner { max-height: inherit; background: inherit; }

#wcag-toolbar .wcag-toolbar-header {
    min-height: 84px;
    padding: 16px 28px;
    border-bottom-color: var(--wcag-toolbar-line);
    background: var(--wcag-toolbar-header-bg, #ffffff);
}

#wcag-toolbar .wcag-toolbar-heading {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12.8px;
}

#wcag-toolbar .wcag-toolbar-header-icon {
    width: 48px;
    height: 48px;
    border: 2px solid var(--wcag-toolbar-header-action);
    background: transparent;
    color: var(--wcag-toolbar-header-action);
}

#wcag-toolbar .wcag-toolbar-header-icon svg {
    width: 27.2px;
    height: 27.2px;
    stroke-width: 1.8;
}

#wcag-toolbar .wcag-toolbar-close {
    display: inline-grid;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--wcag-toolbar-line) !important;
    border-radius: 8.8px !important;
    background: var(--wcag-toolbar-surface) !important;
    padding: 0 !important;
    color: var(--wcag-toolbar-header-text) !important;
}

#wcag-toolbar .wcag-toolbar-close svg { width: 24px; height: 24px; }

#wcag-toolbar .wcag-toolbar-title {
    color: inherit;
    font-size: 19.84px;
    font-weight: 760;
    line-height: 1.25;
}

#wcag-toolbar .wcag-toolbar-description {
    margin-top: 1.92px;
    color: var(--wcag-toolbar-header-text);
    font-size: 13.44px;
    opacity: 1;
}

#wcag-toolbar .wcag-toolbar-profile-status {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 5.6px;
    margin-inline-start: auto;
    border: 0;
    border-radius: 8.8px;
    background: transparent;
    padding: 7.2px 10.4px;
    color: var(--wcag-toolbar-header-text);
    cursor: pointer;
}

.wcag-toolbar-notice__undo svg {
    width: 18.4px;
    height: 18.4px;
    flex: 0 0 auto;
    stroke-width: 2;
}

#wcag-toolbar .wcag-toolbar-profile-status strong { color: var(--wcag-toolbar-header-action); font-weight: 700; }
#wcag-toolbar .wcag-toolbar-content { padding: 25.6px 28px; scroll-behavior: auto; }
#wcag-toolbar .wcag-toolbar-view[hidden], #wcag-toolbar [data-wcag-view][hidden] { display: none !important; }
#wcag-toolbar .wcag-toolbar-view { min-width: 0; }

#wcag-toolbar .wcag-toolbar-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13.6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

#wcag-toolbar .wcag-toolbar-tool-card,
#wcag-toolbar [data-wcag-open-view].wcag-toolbar-tool-card {
    position: relative;
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 150.4px;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid var(--wcag-toolbar-line) !important;
    border-radius: 11.2px !important;
    background: var(--wcag-toolbar-surface) !important;
    padding: 12px !important;
    color: var(--wcag-toolbar-ink) !important;
    text-align: center;
    text-transform: none !important;
    letter-spacing: normal !important;
    box-shadow: 0 1px 2px rgb(15 23 42 / 4%) !important;
    cursor: pointer;
}

#wcag-toolbar .wcag-toolbar-tool-card:hover {
    border-color: var(--wcag-toolbar-control-accent) !important;
    background: var(--wcag-toolbar-accent-soft) !important;
    box-shadow: 0 7.2px 16px rgb(29 78 216 / 10%) !important;
}

#wcag-toolbar .wcag-toolbar-tool-card.is-active,
#wcag-toolbar .wcag-toolbar-tool-card[aria-pressed="true"],
#wcag-toolbar .wcag-toolbar-tool-card[data-wcag-active="true"] {
    border: 2px solid var(--wcag-toolbar-accent) !important;
    background: linear-gradient(145deg, var(--wcag-toolbar-surface), var(--wcag-toolbar-accent-soft)) !important;
    padding: calc(12px - 1px) !important;
}

#wcag-toolbar .wcag-toolbar-tool-card.is-system-active {
    border-style: dashed !important;
    border-color: var(--wcag-toolbar-line) !important;
    background: var(--wcag-toolbar-surface) !important;
}

#wcag-toolbar .wcag-toolbar-tool-card__icon {
    display: inline-grid;
    width: 49.6px;
    height: 49.6px;
    place-items: center;
    color: var(--wcag-toolbar-ink);
}

#wcag-toolbar .wcag-toolbar-tool-card__icon svg {
    width: 40.8px;
    height: 40.8px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
}

#wcag-toolbar .wcag-toolbar-tool-card__icon svg.icon-tabler-text-size { stroke-width: 1.7; }

#wcag-toolbar .wcag-toolbar-tool-card__title { display: block; color: inherit; font-size: 16px; font-weight: 650; line-height: 1.25; }
#wcag-toolbar .wcag-toolbar-tool-card__value { display: block; min-height: 18.4px; color: var(--wcag-toolbar-muted); font-size: 12.48px; line-height: 1.25; }

#wcag-toolbar .wcag-toolbar-tool-card__check {
    position: absolute;
    top: 8.8px;
    right: 8.8px;
    display: none;
    width: 26.4px;
    height: 26.4px;
    place-items: center;
    border-radius: 50%;
    background: var(--wcag-toolbar-control-accent);
    color: var(--wcag-toolbar-on-accent);
}

#wcag-toolbar .wcag-toolbar-tool-card.is-active .wcag-toolbar-tool-card__check,
#wcag-toolbar .wcag-toolbar-tool-card[data-wcag-active="true"] .wcag-toolbar-tool-card__check { display: inline-grid; }
#wcag-toolbar .wcag-toolbar-tool-card__check svg { width: 16px; height: 16px; stroke-width: 2.5; }

#wcag-toolbar .wcag-toolbar-text-stepper {
    display: grid;
    width: fit-content;
    max-width: 100%;
    grid-template-columns: 36px minmax(64px, auto) 36px;
    overflow: hidden;
    border: 1px solid var(--wcag-toolbar-line);
    border-radius: 8.8px;
    background: var(--wcag-toolbar-surface);
    outline: 1px solid var(--wcag-toolbar-line);
    outline-offset: -1px;
}

#wcag-toolbar .wcag-toolbar-text-stepper button {
    position: relative;
    min-width: 36px;
    min-height: 44px;
    border: 0 !important;
    background: var(--wcag-toolbar-surface, #ffffff) !important;
    padding: 0 !important;
    color: var(--wcag-toolbar-ink) !important;
    font-size: 16px !important;
    line-height: 1 !important;
    cursor: pointer;
}

#wcag-toolbar .wcag-toolbar-text-stepper button::before {
    position: absolute;
    inset-block: 0;
    content: "";
}

#wcag-toolbar .wcag-toolbar-text-stepper button:first-child::before {
    inset-inline: 0 -9px;
}

#wcag-toolbar .wcag-toolbar-text-stepper button:last-child::before {
    inset-inline: -9px 0;
}

#wcag-toolbar .wcag-toolbar-text-stepper button:first-child { border-right: 1px solid var(--wcag-toolbar-line) !important; }
#wcag-toolbar .wcag-toolbar-text-stepper button:last-child { border-left: 1px solid var(--wcag-toolbar-line) !important; }
#wcag-toolbar .wcag-toolbar-text-stepper button svg { width: 19.2px; height: 19.2px; stroke-width: 2; }
#wcag-toolbar .wcag-toolbar-text-stepper output { display: inline-flex; align-items: center; justify-content: center; color: var(--wcag-toolbar-ink); font-size: 14px; font-weight: 750; }

#wcag-toolbar .wcag-toolbar-view-status {
    display: flex;
    min-height: 51.2px;
    align-items: center;
    gap: 10.4px;
    margin-top: 20px;
    border: 1px solid var(--wcag-toolbar-success-border, #ccebdd);
    border-radius: 9.6px;
    background: var(--wcag-toolbar-success-soft);
    padding: 10.4px 13.6px;
    color: var(--wcag-toolbar-success);
    font-size: 14.4px;
    font-weight: 650;
}

#wcag-toolbar .wcag-toolbar-view-status svg { width: 21.6px; height: 21.6px; flex: none; }

#wcag-toolbar .wcag-toolbar-active-preferences {
    display: block;
    padding: 13.6px 16px;
    color: var(--wcag-toolbar-success);
}

#wcag-toolbar .wcag-toolbar-active-preferences[hidden],
#wcag-toolbar .wcag-toolbar-active-preferences__list[hidden] { display: none !important; }

#wcag-toolbar .wcag-toolbar-active-preferences__summary {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

#wcag-toolbar .wcag-toolbar-active-preferences__message {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 11.2px;
    color: var(--wcag-toolbar-success);
    font-size: 16px;
    font-weight: 750;
}

#wcag-toolbar .wcag-toolbar-active-preferences__status-icon {
    display: inline-grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
}

#wcag-toolbar .wcag-toolbar-active-preferences__status-icon svg {
    width: 32px;
    height: 32px;
    stroke-width: 1.8;
}

#wcag-toolbar .wcag-toolbar-active-preferences__toggle {
    display: inline-flex;
    min-width: 172px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 10.4px;
    border: 1px solid var(--wcag-toolbar-control-border) !important;
    border-radius: 8px;
    background: var(--wcag-toolbar-surface) !important;
    padding: 8px 12.8px;
    color: var(--wcag-toolbar-ink) !important;
    font-weight: 650;
    cursor: pointer;
}

#wcag-toolbar .wcag-toolbar-active-preferences__toggle:hover {
    border-color: var(--wcag-toolbar-accent) !important;
    background: var(--wcag-toolbar-accent-soft) !important;
}

#wcag-toolbar .wcag-toolbar-active-preferences__chevron {
    display: inline-grid;
    place-items: center;
    transition: transform 160ms ease;
}

#wcag-toolbar .wcag-toolbar-active-preferences__toggle[aria-expanded="true"] .wcag-toolbar-active-preferences__chevron {
    transform: rotate(180deg);
}

#wcag-toolbar .wcag-toolbar-active-preferences__toggle svg {
    width: 18.4px;
    height: 18.4px;
    stroke-width: 2;
}

#wcag-toolbar .wcag-toolbar-active-preferences__list {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 10.4px;
    margin: 13.6px 0 0;
    border-top: 1px solid var(--wcag-toolbar-success-border, #ccebdd);
    padding: 13.6px 0 0;
    list-style: none;
}

#wcag-toolbar .wcag-toolbar-active-preference {
    display: inline-grid;
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    min-height: 56px;
    grid-template-columns: 40px minmax(0, max-content) 44px;
    align-items: stretch;
    border: 1px solid var(--wcag-toolbar-control-border);
    border-radius: 8px;
    background: var(--wcag-toolbar-surface);
    color: var(--wcag-toolbar-ink);
    overflow: hidden;
}

#wcag-toolbar .wcag-toolbar-active-preference__icon {
    display: inline-grid;
    width: 40px;
    align-self: stretch;
    place-items: center;
    color: var(--wcag-toolbar-ink);
}

#wcag-toolbar .wcag-toolbar-active-preference__icon svg {
    width: 20.8px;
    height: 20.8px;
    stroke-width: 1.8;
}

#wcag-toolbar .wcag-toolbar-active-preference__copy {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: baseline;
    align-content: center;
    gap: 1.92px 6.4px;
    padding: 7.2px 11.2px 7.2px 2.4px;
    text-align: start;
}

#wcag-toolbar .wcag-toolbar-active-preference__title {
    min-width: 0;
    color: var(--wcag-toolbar-ink);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: normal;
    word-break: normal;
}

#wcag-toolbar .wcag-toolbar-active-preference__value {
    min-width: 0;
    color: var(--wcag-toolbar-muted);
    font-size: 12.48px;
    font-weight: 500;
    line-height: 1.25;
    overflow-wrap: normal;
    word-break: normal;
}

#wcag-toolbar .wcag-toolbar-active-preference__remove {
    display: inline-grid;
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    align-self: stretch;
    place-items: center;
    border: 0 !important;
    border-inline-start: 1px solid var(--wcag-toolbar-line) !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 0;
    color: var(--wcag-toolbar-ink) !important;
    cursor: pointer;
}

#wcag-toolbar .wcag-toolbar-active-preference__remove:hover {
    background: var(--wcag-toolbar-accent-soft) !important;
    color: var(--wcag-toolbar-accent) !important;
}

#wcag-toolbar .wcag-toolbar-active-preference__remove svg {
    width: 16.8px;
    height: 16.8px;
    stroke-width: 2;
}

#wcag-toolbar .wcag-toolbar-choice-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

#wcag-toolbar .wcag-toolbar-choice-card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 129.6px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 11.2px;
    border: 1px solid var(--wcag-toolbar-line);
    border-radius: 10.4px;
    background: var(--wcag-toolbar-surface);
    padding: 14.4px 9.6px;
    color: var(--wcag-toolbar-ink);
    text-align: center;
    cursor: pointer;
}

#wcag-toolbar .wcag-toolbar-choice-card:has(input:checked) {
    border: 2px solid var(--wcag-toolbar-accent);
    background: var(--wcag-toolbar-accent-soft);
    padding: calc(14.4px - 1px) calc(9.6px - 1px);
}

#wcag-toolbar #wcag-toolbar-view-contrast .wcag-toolbar-choice-card {
    min-height: 180px;
    justify-content: flex-start;
    gap: 8.8px;
    margin: 0 !important;
    padding: 11.2px;
}

#wcag-toolbar #wcag-toolbar-view-contrast .wcag-toolbar-choice-grid { grid-auto-rows: 1fr; }

#wcag-toolbar #wcag-toolbar-view-contrast .wcag-toolbar-choice-card:has(input:checked) {
    padding: calc(11.2px - 1px);
}

#wcag-toolbar .wcag-toolbar-contrast-preview {
    --wcag-contrast-preview-background: #ffffff;
    --wcag-contrast-preview-text: #0f172a;
    --wcag-contrast-preview-accent: #1d4ed8;
    --wcag-contrast-preview-line: #64748b;
    display: grid;
    width: 100%;
    min-height: 84px;
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--wcag-toolbar-line);
    border-radius: 8.8px;
    background: var(--wcag-contrast-preview-background);
}

#wcag-toolbar .wcag-toolbar-contrast-preview--increased-light {
    --wcag-contrast-preview-text: #000000;
    --wcag-contrast-preview-accent: #0000ee;
    --wcag-contrast-preview-line: #000000;
}

#wcag-toolbar .wcag-toolbar-contrast-preview--increased-dark {
    --wcag-contrast-preview-background: #171f25;
    --wcag-contrast-preview-text: #f6f2e9;
    --wcag-contrast-preview-accent: #ffd18a;
    --wcag-contrast-preview-line: #dfe6e8;
}

#wcag-toolbar .wcag-toolbar-contrast-preview--system { grid-template-columns: repeat(2, minmax(0, 1fr)); }

#wcag-toolbar .wcag-toolbar-contrast-preview__pane {
    display: grid;
    min-width: 0;
    align-content: center;
    gap: 5.12px;
    background: var(--wcag-contrast-preview-background);
    padding: 8.8px 10.4px;
    color: var(--wcag-contrast-preview-text);
}

#wcag-toolbar .wcag-toolbar-contrast-preview__pane--dark {
    --wcag-contrast-preview-background: #0f172a;
    --wcag-contrast-preview-text: #f8fafc;
    --wcag-contrast-preview-accent: #bae6fd;
    --wcag-contrast-preview-line: #cbd5e1;
}

#wcag-toolbar .wcag-toolbar-contrast-preview__pane > strong {
    color: inherit;
    font-size: 26.4px;
    font-weight: 750;
    line-height: 1;
}

#wcag-toolbar .wcag-toolbar-contrast-preview__line {
    display: block;
    width: 88%;
    height: 2.88px;
    border-radius: 999px;
    background: var(--wcag-contrast-preview-line);
}

#wcag-toolbar .wcag-toolbar-contrast-preview__line--accent {
    width: 68%;
    height: 3.52px;
    background: var(--wcag-contrast-preview-accent);
}

#wcag-toolbar #wcag-toolbar-view-read-aloud .wcag-toolbar-choice-card {
    min-height: 76px;
    margin: 0 !important;
    padding: 10.4px 9.6px;
}

#wcag-toolbar #wcag-toolbar-view-read-aloud .wcag-toolbar-choice-card:has(input:checked) {
    padding: calc(10.4px - 1px) calc(9.6px - 1px);
}

#wcag-toolbar #wcag-toolbar-view-read-aloud .wcag-toolbar-choice-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

#wcag-toolbar .wcag-read-aloud-flow,
#wcag-toolbar #wcag-read-aloud-ready {
    display: grid;
    gap: 16px;
}

#wcag-toolbar #wcag-read-aloud-ready > .wcag-toolbar-choice-group { margin-bottom: 0; }

#wcag-toolbar .wcag-read-aloud-selection-card {
    gap: 4.8px;
}

#wcag-toolbar .wcag-read-aloud-selection-card__hint {
    display: block;
    max-width: 240px;
    color: var(--wcag-toolbar-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
}

#wcag-toolbar .wcag-read-aloud-selection-card__hint[hidden] {
    display: none;
}

#wcag-toolbar #wcag-read-aloud-start {
    width: 100%;
}

#wcag-toolbar .wcag-toolbar-choice-card input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

#wcag-toolbar .wcag-toolbar-choice-card:has(input:focus-visible) {
    outline: 3px solid var(--wcag-toolbar-focus-inner, #ffffff) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 6px var(--wcag-toolbar-focus-outer, #111827) !important;
}

#wcag-toolbar .wcag-toolbar-color-mode-card {
    min-height: 140px;
    justify-content: center;
    gap: 11.2px;
    margin: 0 !important;
    padding: 11.2px;
}

#wcag-toolbar .wcag-toolbar-color-mode-card:has(input:checked) { padding: calc(11.2px - 1px); }

#wcag-toolbar .wcag-toolbar-color-preview {
    display: grid;
    box-sizing: content-box;
    width: 96px;
    height: 34.4px;
    grid-template-columns: repeat(3, 32px);
    overflow: hidden;
    border: 1px solid var(--wcag-toolbar-line);
    border-radius: 7.2px;
    background: var(--wcag-toolbar-surface);
}

#wcag-toolbar .wcag-toolbar-color-preview--custom {
    width: 64px;
    grid-template-columns: repeat(2, 32px);
}
#wcag-toolbar .wcag-toolbar-color-preview__segment { min-width: 0; }
#wcag-toolbar .wcag-toolbar-color-preview--original .wcag-toolbar-color-preview__segment:nth-child(1) { background: #ffffff; }
#wcag-toolbar .wcag-toolbar-color-preview--original .wcag-toolbar-color-preview__segment:nth-child(2) { background: #64748b; }
#wcag-toolbar .wcag-toolbar-color-preview--original .wcag-toolbar-color-preview__segment:nth-child(3) { background: #1d4ed8; }
#wcag-toolbar .wcag-toolbar-color-preview--muted .wcag-toolbar-color-preview__segment:nth-child(1) { background: #fff8ed; }
#wcag-toolbar .wcag-toolbar-color-preview--muted .wcag-toolbar-color-preview__segment:nth-child(2) { background: #6f888c; }
#wcag-toolbar .wcag-toolbar-color-preview--muted .wcag-toolbar-color-preview__segment:nth-child(3) { background: #155a78; }
#wcag-toolbar .wcag-toolbar-color-preview--grayscale .wcag-toolbar-color-preview__segment:nth-child(1) { background: #ffffff; }
#wcag-toolbar .wcag-toolbar-color-preview--grayscale .wcag-toolbar-color-preview__segment:nth-child(2) { background: #d1d5db; }
#wcag-toolbar .wcag-toolbar-color-preview--grayscale .wcag-toolbar-color-preview__segment:nth-child(3) { background: #171717; }
#wcag-toolbar .wcag-toolbar-color-preview--custom .wcag-toolbar-color-preview__segment:nth-child(1) { background: var(--wcag-custom-background, #fffdf5); }
#wcag-toolbar .wcag-toolbar-color-preview--custom .wcag-toolbar-color-preview__segment:nth-child(2) { background: var(--wcag-custom-text, #171717); }

#wcag-toolbar .wcag-toolbar-color-mode-card .wcag-toolbar-choice-card__copy {
    display: grid;
    min-height: 39.2px;
    align-content: center;
}

#wcag-toolbar .wcag-toolbar-color-mode-card .wcag-toolbar-choice-card__copy > strong,
#wcag-toolbar .wcag-toolbar-color-adjustment .wcag-toolbar-choice-card__copy > strong {
    color: var(--wcag-toolbar-ink);
    font-size: 14.4px;
    line-height: 1.25;
}

#wcag-toolbar .wcag-toolbar-color-adjustments { margin-bottom: 16px; }

#wcag-toolbar .wcag-toolbar-color-adjustments__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

#wcag-toolbar .wcag-toolbar-color-adjustment {
    display: grid;
    min-height: 112px;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    justify-content: initial;
    gap: 13.6px;
    margin: 0 !important;
    padding: 14.4px 16px;
    text-align: left;
}

#wcag-toolbar .wcag-toolbar-color-adjustment:has(input:checked) { padding: calc(14.4px - 1px) calc(16px - 1px); }

#wcag-toolbar .wcag-toolbar-color-adjustment__icon {
    display: inline-grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid var(--wcag-toolbar-line);
    border-color: color-mix(in srgb, var(--wcag-toolbar-control-accent) 18%, var(--wcag-toolbar-line));
    border-radius: 10.4px;
    background: var(--wcag-toolbar-accent-soft);
    color: var(--wcag-toolbar-control-accent);
}

#wcag-toolbar .wcag-toolbar-color-adjustment__icon svg { width: 24px; height: 24px; }

#wcag-toolbar .wcag-toolbar-color-adjustment .wcag-toolbar-choice-card__copy {
    min-width: 0;
    padding-inline-end: 0;
}

#wcag-toolbar .wcag-toolbar-color-adjustment__availability {
    position: absolute;
    top: 8.8px;
    right: 10.4px;
    display: inline-flex;
    width: fit-content;
    min-height: 24px;
    align-items: center;
    border: 1px solid var(--wcag-toolbar-line);
    border-radius: 999px;
    padding: 2.4px 8px;
    color: var(--wcag-toolbar-muted);
    font-size: 10.88px;
    font-weight: 700;
    line-height: 1.2;
}

#wcag-toolbar .wcag-toolbar-color-adjustment__availability[hidden] { display: none !important; }
#wcag-toolbar .wcag-toolbar-color-adjustment:not(:has(input:disabled)) .wcag-toolbar-color-adjustment__availability { display: none; }
#wcag-toolbar .wcag-toolbar-color-adjustment:has(input:disabled) { padding-top: 21.6px; }
#wcag-toolbar .wcag-toolbar-color-adjustment:has(input:disabled) .wcag-toolbar-color-adjustment__icon {
    border-color: var(--wcag-toolbar-line);
    background: var(--wcag-toolbar-surface);
    background: color-mix(in srgb, var(--wcag-toolbar-surface) 78%, var(--wcag-toolbar-line));
    color: var(--wcag-toolbar-muted);
}
#wcag-toolbar .wcag-toolbar-color-adjustment:has(input:disabled) .wcag-toolbar-choice-card__copy > strong { color: var(--wcag-toolbar-muted); }

#wcag-toolbar .wcag-toolbar-section { margin: 0 0 21.6px; }
#wcag-toolbar .wcag-toolbar-section:last-child { margin-bottom: 0; }
#wcag-toolbar .wcag-toolbar-section__title { margin: 0 0 12px; color: var(--wcag-toolbar-ink); font-size: 16px; font-weight: 750; line-height: 1.3; }

#wcag-toolbar .wcag-toolbar-setting-row {
    display: flex;
    min-height: 51.2px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--wcag-toolbar-line);
    padding: 8.8px 0;
}

#wcag-toolbar .wcag-toolbar-setting-row:last-child { border-bottom: 0; }
#wcag-toolbar .wcag-toolbar-setting-row__copy { min-width: 0; }
#wcag-toolbar .wcag-toolbar-setting-row__copy strong, #wcag-toolbar .wcag-toolbar-setting-row__copy span { display: block; }
#wcag-toolbar .wcag-toolbar-setting-row__copy small { display: block; margin-top: 1.92px; color: var(--wcag-toolbar-muted); font-size: 12.16px; }
#wcag-toolbar .wcag-toolbar-setting-row > select { width: min(384px, 65%); min-width: 0; max-width: 384px; flex: 1 1 192px; }

#wcag-toolbar .wcag-toolbar-switch {
    position: relative;
    display: inline-flex;
    width: 48px;
    height: 26.4px;
    flex: 0 0 auto;
    align-items: center;
}

#wcag-toolbar .wcag-toolbar-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

#wcag-toolbar .wcag-toolbar-switch__track {
    position: absolute;
    inset: 0;
    border: 1px solid var(--wcag-toolbar-switch-off, #64748b);
    border-radius: 999px;
    background: var(--wcag-toolbar-switch-off, #64748b);
    transition: background-color .18s ease, border-color .18s ease;
    cursor: pointer;
}

#wcag-toolbar .wcag-toolbar-switch__track::after {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--wcag-toolbar-surface);
    box-shadow: 0 1px 3px rgb(15 23 42 / 30%);
    content: "";
    transition: transform .18s ease;
}

#wcag-toolbar .wcag-toolbar-switch input:checked + .wcag-toolbar-switch__track { border-color: var(--wcag-toolbar-control-accent); background: var(--wcag-toolbar-control-accent); }
#wcag-toolbar .wcag-toolbar-switch input:checked + .wcag-toolbar-switch__track::after { background: var(--wcag-toolbar-on-accent); }
#wcag-toolbar .wcag-toolbar-switch input:checked + .wcag-toolbar-switch__track::after { transform: translateX(21.44px); }
#wcag-toolbar .wcag-toolbar-switch input:focus-visible + .wcag-toolbar-switch__track { outline: 3px solid var(--wcag-toolbar-focus-inner, #ffffff); outline-offset: 2px; box-shadow: 0 0 0 6px var(--wcag-toolbar-focus-outer, #111827); }

#wcag-toolbar .wcag-toolbar-color-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    align-items: end;
    gap: 13.6px;
}

#wcag-toolbar .wcag-toolbar-color-field label { display: block; margin-bottom: 5.6px; font-weight: 650; }

#wcag-toolbar .wcag-toolbar-color-input {
    display: grid;
    min-height: 45.6px;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    gap: 8.8px;
    border: 1px solid var(--wcag-toolbar-line);
    border-radius: 8.8px;
    background: var(--wcag-toolbar-surface);
    padding: 4.8px 8.8px;
}

#wcag-toolbar .wcag-toolbar-color-input input[type="color"] { width: 32px; height: 32px; border: 0; background: transparent; padding: 0; }
#wcag-toolbar .wcag-toolbar-color-input input[type="text"] { width: 100%; min-width: 0; border: 0 !important; background: transparent !important; padding: 4.8px 0 !important; color: var(--wcag-toolbar-ink) !important; box-shadow: none !important; }
#wcag-toolbar .wcag-toolbar-color-field [aria-invalid="true"] { border-color: var(--wcag-toolbar-danger) !important; }
#wcag-toolbar .wcag-toolbar-field-error { margin: 4.8px 0 0; color: var(--wcag-toolbar-danger); font-size: 12.48px; }

#wcag-toolbar .wcag-toolbar-contrast-badge {
    display: inline-flex;
    min-height: 45.6px;
    align-items: center;
    border: 1px solid var(--wcag-toolbar-success-border, #059669);
    border-radius: 8.8px;
    background: var(--wcag-toolbar-success-soft, #ecfdf5);
    padding: 7.2px 11.2px;
    color: var(--wcag-toolbar-success, #047857);
    font-size: 13.12px;
    font-weight: 750;
    white-space: nowrap;
}

#wcag-toolbar .wcag-toolbar-contrast-badge[data-level="too-low"] { border-color: var(--wcag-toolbar-danger-border, #d92d20); background: var(--wcag-toolbar-danger-soft, #fff1f0); color: var(--wcag-toolbar-danger, #b42318); }
#wcag-toolbar .wcag-toolbar-contrast-badge[data-level="aa-large"] { border-color: var(--wcag-toolbar-warning-border, #c2410c); background: var(--wcag-toolbar-warning-soft, #fff7ed); color: var(--wcag-toolbar-warning, #9a3412); }

#wcag-toolbar .wcag-toolbar-view-message {
    margin: 12px 0 0;
    border-left: 4px solid var(--wcag-toolbar-accent);
    background: var(--wcag-toolbar-accent-soft);
    padding: 10.4px 12.8px;
    color: var(--wcag-toolbar-ink);
}

#wcag-toolbar .wcag-toolbar-control-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12.8px;
    border: 1px solid var(--wcag-toolbar-line);
    border-radius: 9.6px;
    padding: 8.8px 12.8px;
}

#wcag-toolbar .wcag-toolbar-control-group + .wcag-toolbar-control-group { margin-top: 10.4px; }

#wcag-toolbar select, #wcag-reading-mode-dialog select {
    min-height: 44px;
    border: 1px solid var(--wcag-toolbar-line) !important;
    border-radius: 8px !important;
    background-color: var(--wcag-toolbar-surface) !important;
    color: var(--wcag-toolbar-ink) !important;
    padding: 7.2px 37.6px 7.2px 11.2px !important;
}

#wcag-toolbar .wcag-toolbar-player { display: grid; gap: 16px; }
#wcag-toolbar .wcag-toolbar-player__title { margin: 0; font-size: 20px; font-weight: 760; }
#wcag-toolbar .wcag-toolbar-player__meta { color: var(--wcag-toolbar-muted); }

#wcag-toolbar .wcag-toolbar-player__progress-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
}

#wcag-toolbar progress, #wcag-read-aloud-compact-player progress {
    width: 100%;
    height: 7.2px;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    background: var(--wcag-toolbar-line, #e5e7eb);
    accent-color: var(--wcag-toolbar-control-accent, #1d4ed8);
}

#wcag-toolbar progress::-webkit-progress-bar { border-radius: 999px; background: var(--wcag-toolbar-line); }
#wcag-toolbar progress::-webkit-progress-value { border-radius: 999px; background: var(--wcag-toolbar-control-accent, #1d4ed8); }
#wcag-read-aloud-compact-player progress::-webkit-progress-bar { border-radius: 999px; background: var(--wcag-toolbar-line, #cbd5e1); }
#wcag-read-aloud-compact-player progress::-webkit-progress-value { border-radius: 999px; background: var(--wcag-toolbar-control-accent, #1d4ed8); }

#wcag-toolbar .wcag-toolbar-player__current {
    min-height: 92.8px;
    border: 1px solid var(--wcag-toolbar-line);
    border-left: 5px solid var(--wcag-toolbar-accent);
    border-radius: 10.4px;
    background: var(--wcag-toolbar-accent-soft);
    padding: 16px 18.4px;
    color: var(--wcag-toolbar-ink);
    font-size: 16.8px;
    line-height: 1.55;
}

#wcag-toolbar .wcag-toolbar-player__buttons {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

#wcag-toolbar .wcag-toolbar-player__button {
    display: inline-flex;
    min-height: 89.6px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7.2px;
    border: 1px solid var(--wcag-toolbar-line) !important;
    border-radius: 10.4px !important;
    background: var(--wcag-toolbar-surface) !important;
    color: var(--wcag-toolbar-ink) !important;
    cursor: pointer;
}

#wcag-toolbar .wcag-toolbar-player__button svg { width: 32px; height: 32px; }

#wcag-toolbar .wcag-toolbar-player__button--primary {
    width: 96px;
    height: 96px;
    min-height: 96px;
    justify-self: center;
    border: 3.52px double var(--wcag-toolbar-on-accent) !important;
    border-radius: 50% !important;
    background: var(--wcag-toolbar-control-accent) !important;
    color: var(--wcag-toolbar-on-accent) !important;
    box-shadow: 0 0 0 2.56px var(--wcag-toolbar-control-accent) !important;
}

#wcag-toolbar .wcag-toolbar-primary-action,
#wcag-toolbar [data-wcag-action="done"],
#wcag-toolbar [data-wcag-action="start-reading-mode"],
#wcag-toolbar [data-wcag-action="start-read-aloud"] {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 8.8px;
    border: 2px solid var(--wcag-toolbar-control-accent) !important;
    border-radius: 8.8px !important;
    background: var(--wcag-toolbar-control-accent) !important;
    padding: 10.4px 16px !important;
    color: var(--wcag-toolbar-on-accent) !important;
    font-weight: 750 !important;
    text-decoration: none !important;
    cursor: pointer;
}

#wcag-toolbar .wcag-toolbar-secondary-action,
#wcag-toolbar [data-wcag-action="reset-colors"],
#wcag-toolbar [data-wcag-action="stop-read-aloud"] {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 8.8px;
    border: 1px solid var(--wcag-toolbar-line) !important;
    border-radius: 8.8px !important;
    background: var(--wcag-toolbar-surface) !important;
    padding: 10.4px 16px !important;
    color: var(--wcag-toolbar-ink) !important;
    font-weight: 650 !important;
    cursor: pointer;
}

#wcag-toolbar :is(.wcag-toolbar-primary-action, .wcag-toolbar-secondary-action) > svg {
    width: 19.2px;
    height: 19.2px;
    flex: 0 0 auto;
}

#wcag-toolbar .wcag-read-aloud-follow-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

#wcag-toolbar .wcag-read-aloud-follow-toggle[aria-pressed="true"] .wcag-read-aloud-follow-setting__track {
    border-color: var(--wcag-toolbar-control-accent);
    background: var(--wcag-toolbar-control-accent);
}

#wcag-toolbar .wcag-read-aloud-follow-toggle[aria-pressed="true"] .wcag-read-aloud-follow-setting__track > span {
    background: var(--wcag-toolbar-on-accent);
    transform: translateX(21.44px);
}

#wcag-toolbar .wcag-toolbar-footer-shell {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    border-top-color: var(--wcag-toolbar-line);
    background: var(--wcag-toolbar-footer-bg, #f8fafc);
    padding: 14.4px 28px;
}

#wcag-toolbar .wcag-toolbar-footer-shell > .wcag-toolbar-footer {
    display: flex;
    min-height: 44px;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#wcag-toolbar .wcag-toolbar-dialog-actions.wcag-read-aloud-footer-actions {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
}

#wcag-toolbar .wcag-read-aloud-footer-status {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 8.8px;
    color: var(--wcag-toolbar-success);
    font-size: 13.76px;
    font-weight: 650;
}

#wcag-toolbar .wcag-read-aloud-footer-status > span:first-child {
    width: 10.4px;
    height: 10.4px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: currentColor;
}

#wcag-toolbar .wcag-read-aloud-footer-status > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#wcag-toolbar .wcag-read-aloud-footer-actions > button {
    min-width: 160px;
}

#wcag-toolbar .wcag-toolbar-footer .wcag-toolbar-accessibility-statement-link,
#wcag-toolbar .wcag-toolbar-footer .wcag-toolbar-accessibility-statement-link:hover {
    width: auto !important;
    max-width: 100%;
    min-height: 44px;
    justify-content: center !important;
    border: 0 !important;
    background: transparent !important;
    padding: 6.4px 8.8px !important;
    color: var(--wcag-toolbar-footer-link) !important;
    box-shadow: none !important;
    text-decoration: underline !important;
    text-decoration-thickness: .09em !important;
    text-underline-offset: .18em !important;
}

#wcag-toolbar .wcag-toolbar-view-back {
    display: inline-grid;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--wcag-toolbar-line) !important;
    border-radius: 8.8px !important;
    background: var(--wcag-toolbar-surface) !important;
    padding: 0 !important;
    color: var(--wcag-toolbar-ink) !important;
    cursor: pointer;
}

#wcag-toolbar .wcag-toolbar-view-back svg { width: 24px; height: 24px; }

#wcag-toolbar .wcag-toolbar-preset-profiles {
    margin: 0 0 18.4px;
}

#wcag-toolbar .wcag-toolbar-preset-profiles > h4,
#wcag-toolbar .wcag-toolbar-preset-profiles > p {
    margin: 0;
}

#wcag-toolbar .wcag-toolbar-preset-profiles > p {
    margin-top: 4px;
    color: var(--wcag-toolbar-muted);
    font-size: 13.44px;
}

#wcag-toolbar .wcag-toolbar-preset-profiles__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 288px), 1fr));
    gap: 10.4px;
    margin-top: 12px;
}

#wcag-toolbar .wcag-toolbar-preset-profile {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 104px;
    grid-template-columns: 42.4px minmax(0, 1fr);
    align-items: center;
    gap: 11.2px;
    border: 1px solid var(--wcag-toolbar-control-border, var(--wcag-toolbar-line)) !important;
    border-radius: 10.4px !important;
    background: var(--wcag-toolbar-surface) !important;
    padding: 12.8px !important;
    color: var(--wcag-toolbar-ink) !important;
    text-align: start;
    cursor: pointer;
}

#wcag-toolbar .wcag-toolbar-preset-profile:hover {
    border-color: var(--wcag-toolbar-accent-hover) !important;
}

#wcag-toolbar .wcag-toolbar-preset-profile[aria-pressed="true"] {
    border: 2px solid var(--wcag-toolbar-control-accent) !important;
    background: linear-gradient(145deg, var(--wcag-toolbar-surface), var(--wcag-toolbar-accent-soft)) !important;
    padding: calc(12.8px - 1px) !important;
}

#wcag-toolbar .wcag-toolbar-preset-profile__icon {
    display: inline-grid;
    width: 42.4px;
    height: 42.4px;
    place-items: center;
    border-radius: 50%;
    background: var(--wcag-toolbar-accent-soft);
    color: var(--wcag-toolbar-accent);
}

#wcag-toolbar .wcag-toolbar-preset-profile__icon svg {
    width: 24.8px;
    height: 24.8px;
    stroke-width: 1.8;
}

#wcag-toolbar .wcag-toolbar-preset-profile__copy {
    display: grid;
    min-width: 0;
    gap: 2.88px;
    padding-inline-end: 22.4px;
}

#wcag-toolbar .wcag-toolbar-preset-profile__copy strong {
    color: var(--wcag-toolbar-ink);
    font-size: 14.72px;
    line-height: 1.25;
}

#wcag-toolbar .wcag-toolbar-preset-profile__copy > span {
    color: var(--wcag-toolbar-muted);
    font-size: 12.16px;
    line-height: 1.35;
}

#wcag-toolbar .wcag-toolbar-preset-profile__check {
    position: absolute;
    top: 8.8px;
    right: 8.8px;
    display: inline-grid;
    width: 23.2px;
    height: 23.2px;
    place-items: center;
    border-radius: 50%;
    background: var(--wcag-toolbar-control-accent);
    color: var(--wcag-toolbar-on-accent);
}

#wcag-toolbar .wcag-toolbar-preset-profile__check[hidden] { display: none; }
#wcag-toolbar .wcag-toolbar-preset-profile__check svg { width: 14.4px; height: 14.4px; stroke-width: 2.5; }

#wcag-toolbar .wcag-toolbar-profile-utilities {
    display: grid;
    grid-template-columns: minmax(224px, .82fr) minmax(0, 1.45fr);
    align-items: stretch;
    gap: 12.8px;
}

#wcag-toolbar .wcag-toolbar-profile-panel {
    min-width: 0;
    border: 1px solid var(--wcag-toolbar-line);
    border-radius: 11.2px;
    background: var(--wcag-toolbar-surface);
    padding: 13.6px;
}

#wcag-toolbar .wcag-toolbar-profile-panel > .wcag-toolbar-choice-group {
    margin: 0;
}

#wcag-toolbar .wcag-toolbar-profile-storage > legend,
#wcag-toolbar .wcag-toolbar-profile-manager > h4 {
    margin: 0 0 10.4px;
    padding: 0;
    color: var(--wcag-toolbar-ink);
    font-size: 15.2px;
    font-weight: 750;
    line-height: 1.3;
}

#wcag-toolbar .wcag-toolbar-profile-storage > .wcag-toolbar-choice-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

#wcag-toolbar .wcag-toolbar-profile-storage .wcag-toolbar-choice-card {
    min-height: 52px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 10.4px;
    padding: 10.4px 12px;
    text-align: start;
}

#wcag-toolbar .wcag-toolbar-profile-storage .wcag-toolbar-choice-card::before {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    border: 2px solid var(--wcag-toolbar-control-border);
    border-radius: 50%;
    background: var(--wcag-toolbar-surface);
    box-shadow: inset 0 0 0 3.2px var(--wcag-toolbar-surface);
    content: "";
}

#wcag-toolbar .wcag-toolbar-profile-storage .wcag-toolbar-choice-card:has(input:checked) {
    padding: calc(10.4px - 1px) calc(12px - 1px);
}

#wcag-toolbar .wcag-toolbar-profile-storage .wcag-toolbar-choice-card:has(input:checked)::before {
    border-color: var(--wcag-toolbar-control-accent);
    background: var(--wcag-toolbar-control-accent);
}

#wcag-toolbar .wcag-toolbar-profile-manager > p {
    margin: 0 0 11.2px;
    color: var(--wcag-toolbar-muted);
    font-size: 12.48px;
    line-height: 1.4;
}

#wcag-toolbar .wcag-toolbar-profile-manager > .wcag-toolbar-setting-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 6.4px 8.8px;
    min-height: 0;
    border: 0;
    padding: 0;
}

#wcag-toolbar .wcag-toolbar-profile-manager > .wcag-toolbar-setting-row > label {
    grid-column: 1 / -1;
    color: var(--wcag-toolbar-ink);
    font-size: 12.48px;
    font-weight: 650;
    line-height: 1.3;
}

#wcag-toolbar .wcag-toolbar-profile-manager > .wcag-toolbar-setting-row > button {
    min-height: 44px;
    white-space: nowrap;
}

#wcag-toolbar .wcag-toolbar-profile-list { display: grid; gap: 9.6px; margin: 12.8px 0 0; padding: 0; list-style: none; }
#wcag-toolbar .wcag-toolbar-profile-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; border: 1px solid var(--wcag-toolbar-line); border-radius: 8.8px; padding: 8.8px 10.4px; }
#wcag-toolbar .wcag-toolbar-profile-manager input[type="text"],
#wcag-toolbar .wcag-toolbar-profile-item input[type="text"] {
    min-height: 44px;
    border: 1px solid var(--wcag-toolbar-line) !important;
    border-radius: 7.2px !important;
    background: var(--wcag-toolbar-surface) !important;
    padding: 8px 10.4px !important;
    color: var(--wcag-toolbar-ink) !important;
}
#wcag-toolbar .wcag-toolbar-profile-item button {
    min-height: 44px;
    border: 1px solid var(--wcag-toolbar-line) !important;
    border-radius: 7.2px !important;
    background: var(--wcag-toolbar-surface) !important;
    padding: 8px 11.2px !important;
    color: var(--wcag-toolbar-ink) !important;
}
#wcag-toolbar .wcag-toolbar-profile-item > .wcag-toolbar-field-error { grid-column: 1 / -1; }

html.wcag-strong-focus :where(.wcag-presentation-scope:is(a, area[href], button, input, select, textarea, summary, iframe, object, embed, audio[controls], video[controls], [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"])), .wcag-presentation-scope :where(a, area[href], button, input, select, textarea, summary, iframe, object, embed, audio[controls], video[controls], [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"]))):focus-visible {
    outline: 4px solid #ffffff !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 8px #111827 !important;
    transition: none !important;
}

html.wcag-emphasize-current-control :where(.wcag-presentation-scope:is(a, area[href], button, input, select, textarea, summary, iframe, object, embed, audio[controls], video[controls], [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"])), .wcag-presentation-scope :where(a, area[href], button, input, select, textarea, summary, iframe, object, embed, audio[controls], video[controls], [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"]))):focus-visible {
    border-radius: 4px !important;
    box-shadow: 0 0 0 6px rgb(250 204 21 / 78%), 0 0 0 9px rgb(17 24 39 / 72%) !important;
    transition: none !important;
}

html.wcag-strong-focus.wcag-emphasize-current-control :where(.wcag-presentation-scope:is(a, area[href], button, input, select, textarea, summary, iframe, object, embed, audio[controls], video[controls], [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"])), .wcag-presentation-scope :where(a, area[href], button, input, select, textarea, summary, iframe, object, embed, audio[controls], video[controls], [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"]))):focus-visible {
    outline: 4px solid #ffffff !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 8px #111827, 0 0 0 13px rgb(250 204 21 / 78%), 0 0 0 16px rgb(17 24 39 / 72%) !important;
    transition: none !important;
}

#wcag-reading-line {
    position: fixed;
    z-index: 99990;
    right: 0;
    left: 0;
    height: var(--wcag-reading-line-height, 3em);
    border-top: 2px solid rgb(29 78 216 / 70%);
    border-bottom: 2px solid rgb(29 78 216 / 70%);
    background: rgb(255 235 59 / 18%);
    pointer-events: none;
}

#wcag-reading-mask {
    position: fixed;
    z-index: 99989;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

#wcag-reading-mask .wcag-reading-mask__window {
    position: absolute;
    right: 0;
    left: 0;
    box-sizing: border-box;
    height: var(--wcag-reading-mask-height, 3em);
    border-top: 1px solid rgb(255 255 255 / 55%);
    border-bottom: 1px solid rgb(255 255 255 / 55%);
    background: transparent;
    box-shadow: 0 0 0 100vmax rgb(15 23 42 / 62%);
}

body.wp-admin #wcag-toolbar-preview-readable-content > #wcag-reading-mask {
    position: absolute;
}

.wcag-admin-option-unavailable {
    display: none !important;
}

.wcag-read-aloud-current {
    border-radius: 4.8px !important;
    outline: 2.88px solid #1d4ed8 !important;
    outline-offset: 1.92px !important;
    box-shadow: inset 5.6px 0 0 #1d4ed8, 0 0 0 5.6px rgb(29 78 216 / 14%) !important;
}

html:is(.wcag-colors-muted, .wcag-colors-grayscale, .wcag-colors-custom, .wcag-contrast-increased-light, .wcag-contrast-increased-dark, .wcag-contrast-system) :where(.wcag-presentation-scope.wcag-read-aloud-current, .wcag-presentation-scope .wcag-read-aloud-current) {
    outline-color: var(--wcag-page-mode-link) !important;
    box-shadow: inset 5.6px 0 0 var(--wcag-page-mode-link), 0 0 0 5.6px color-mix(in srgb, var(--wcag-page-mode-link) 14%, transparent) !important;
}

::highlight(wcag-read-aloud-boundary) {
    background: #fde68a;
    color: #111827;
    text-decoration: underline;
    text-decoration-thickness: .12em;
}

#wcag-read-aloud-compact-player {
    --wcag-compact-control-size: 56px;
    --wcag-compact-control-icon-size: 24px;
    --wcag-compact-function-icon-size: 52px;
    --wcag-compact-function-icon-svg-size: 29.6px;
    position: fixed;
    z-index: 100002;
    right: 16px;
    bottom: 16px;
    display: grid;
    width: min(432px, calc(100vw - 32px));
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
        "icon copy"
        "controls controls";
    align-items: start;
    column-gap: 12px;
    row-gap: 10.4px;
    border: 1px solid var(--wcag-toolbar-control-border, #8795a8);
    border-radius: 16px;
    background: var(--wcag-toolbar-surface, #ffffff);
    padding: 16px 17.6px 17.6px;
    color: var(--wcag-toolbar-ink, #0f172a);
    box-shadow: var(--wcag-toolbar-floating-shadow, 0 16px 40px rgb(15 23 42 / 28%));
}

#wcag-read-aloud-compact-player[hidden] { display: none !important; }
#wcag-read-aloud-compact-player .wcag-read-aloud-compact__copy { min-width: 0; }
#wcag-read-aloud-compact-player .wcag-read-aloud-compact__copy strong,
#wcag-read-aloud-compact-player .wcag-read-aloud-compact__copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#wcag-read-aloud-compact-player .wcag-read-aloud-compact__controls { display: flex; gap: 5.6px; }

#wcag-read-aloud-compact-player button {
    display: inline-flex !important;
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid var(--wcag-toolbar-control-border, #8795a8);
    border-radius: 7.2px;
    background: var(--wcag-toolbar-surface, #ffffff);
    padding: 0 !important;
    color: var(--wcag-toolbar-ink, #0f172a);
    line-height: 1 !important;
    text-align: center !important;
    cursor: pointer;
}

#wcag-reading-mode-dialog {
    --wcag-reader-text: #172033;
    --wcag-reader-link: #1d4ed8;
    --wcag-reader-border: #d8dee8;
    --wcag-reader-mark-bg: #fef08a;
    --wcag-reader-mark-text: #111827;
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border: 0;
    background: #ffffff;
    color: var(--wcag-reader-text);
    padding: 0;
}

#wcag-reading-mode-dialog::backdrop { background: rgb(15 23 42 / 72%); }

#wcag-reading-mode-dialog .wcag-reading-mode__header {
    position: sticky;
    z-index: 2;
    top: 0;
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--wcag-reader-border);
    background: inherit;
    padding: 12px clamp(16px, 4vw, 48px);
}

#wcag-reading-mode-dialog .wcag-reading-mode__content {
    width: min(var(--wcag-reader-width, 736px), calc(100% - 32px));
    margin: 0 auto;
    padding: clamp(32px, 7vw, 80px) 0;
    font-family: var(--wcag-reader-font, system-ui, sans-serif);
    font-size: clamp(16.8px, 16px + .2vw, 19.52px);
    line-height: var(--wcag-reader-line-height, 1.75);
}

#wcag-reading-mode-dialog[data-width="narrow"] { --wcag-reader-width: 576px; }
#wcag-reading-mode-dialog[data-width="medium"] { --wcag-reader-width: 736px; }
#wcag-reading-mode-dialog[data-width="wide"] { --wcag-reader-width: 992px; }
#wcag-reading-mode-dialog[data-font="serif"] { --wcag-reader-font: Georgia, 'Times New Roman', serif; }
#wcag-reading-mode-dialog[data-spacing="large"] { --wcag-reader-line-height: 2; }
#wcag-reading-mode-dialog[data-theme="warm"] {
    --wcag-reader-text: #2f281e;
    --wcag-reader-link: #92400e;
    --wcag-reader-border: #c8bda8;
    background: #fff7e8;
}
#wcag-reading-mode-dialog[data-theme="dark"] {
    --wcag-reader-text: #f8fafc;
    --wcag-reader-link: #93c5fd;
    --wcag-reader-border: #64748b;
    background: #111827;
}

#wcag-reading-mode-dialog :is(
    .wcag-reading-mode-header,
    .wcag-reading-mode__header,
    .wcag-reading-mode-content,
    .wcag-reading-mode__content
),
#wcag-reading-mode-dialog :is(
    .wcag-reading-mode-header,
    .wcag-reading-mode__header,
    .wcag-reading-mode-content,
    .wcag-reading-mode__content
) :where(*) {
    color: var(--wcag-reader-text) !important;
    -webkit-text-fill-color: currentColor !important;
    text-shadow: none !important;
}

#wcag-reading-mode-dialog .wcag-reading-mode__content :where(h1, h2, h3, h4, h5, h6) { margin-block: 1.55em .65em; color: inherit; line-height: 1.2; }
#wcag-reading-mode-dialog .wcag-reading-mode__content :where(p, ul, ol, blockquote, table, figure) { margin-block: 0 1.15em; }
#wcag-reading-mode-dialog :is(.wcag-reading-mode-content, .wcag-reading-mode__content) a,
#wcag-reading-mode-dialog :is(.wcag-reading-mode-content, .wcag-reading-mode__content) a:visited {
    color: var(--wcag-reader-link) !important;
    -webkit-text-fill-color: currentColor !important;
    text-decoration: underline;
    text-decoration-thickness: .1em;
    text-underline-offset: .15em;
}
#wcag-reading-mode-dialog :is(.wcag-reading-mode-content, .wcag-reading-mode__content) mark {
    background: var(--wcag-reader-mark-bg) !important;
    color: var(--wcag-reader-mark-text) !important;
    -webkit-text-fill-color: var(--wcag-reader-mark-text) !important;
}
#wcag-reading-mode-dialog .wcag-reading-mode__image-alt {
    border-inline-start: 4px solid currentColor;
    padding-inline-start: 16px;
    font-style: italic;
}
#wcag-reading-mode-dialog .wcag-reading-mode__image-alt--inline {
    display: inline;
    border: 0;
    padding: 0;
}

@container wcag-toolbar (max-width: 624px) {
    #wcag-toolbar .wcag-toolbar-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #wcag-toolbar .wcag-toolbar-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #wcag-toolbar .wcag-toolbar-color-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #wcag-toolbar .wcag-toolbar-contrast-badge { grid-column: 1 / -1; }
}

@container wcag-toolbar (max-width: 432px) {
    #wcag-toolbar .wcag-toolbar-header { min-height: 70.4px; padding: 11.2px 16px; }
    #wcag-toolbar .wcag-toolbar-header-icon { width: 37.6px; height: 37.6px; }
    #wcag-toolbar .wcag-toolbar-header-icon svg { width: 21.6px; height: 21.6px; }
    #wcag-toolbar .wcag-toolbar-title { font-size: 16px; }
    #wcag-toolbar .wcag-toolbar-description, #wcag-toolbar .wcag-toolbar-profile-status > span:first-child { display: none; }
    #wcag-toolbar .wcag-toolbar-content { padding: 16px; }
    #wcag-toolbar .wcag-toolbar-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

    #wcag-toolbar .wcag-toolbar-tool-card {
        min-height: 85.6px;
        gap: 5.6px;
        padding: 7.2px !important;
    }

    #wcag-toolbar .wcag-toolbar-tool-card.is-active,
    #wcag-toolbar .wcag-toolbar-tool-card[data-wcag-active="true"] { padding: calc(7.2px - 1px) !important; }
    #wcag-toolbar .wcag-toolbar-tool-card__icon { width: 32px; height: 32px; }
    #wcag-toolbar .wcag-toolbar-tool-card__icon svg { width: 26.4px; height: 26.4px; }
    #wcag-toolbar .wcag-toolbar-tool-card__title { font-size: 11.52px; }
    #wcag-toolbar .wcag-toolbar-tool-card__value { display: none; }
    #wcag-toolbar .wcag-toolbar-tool-card.is-active .wcag-toolbar-tool-card__value,
    #wcag-toolbar .wcag-toolbar-tool-card[data-wcag-active="true"] .wcag-toolbar-tool-card__value {
        position: absolute;
        display: block;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }
    #wcag-toolbar .wcag-toolbar-tool-card[data-wcag-tool="text-size"] .wcag-toolbar-tool-card__value,
    #wcag-toolbar .wcag-toolbar-tool-card[data-wcag-tool="reduce-motion"] .wcag-toolbar-tool-card__value {
        position: static;
        display: block;
        width: auto;
        height: auto;
        overflow: visible;
        clip: auto;
        clip-path: none;
        white-space: normal;
        font-size: 10.4px;
    }

    #wcag-toolbar .wcag-toolbar-tool-card__check {
        top: 4px;
        right: 4px;
        width: 19.2px;
        height: 19.2px;
    }

    #wcag-toolbar .wcag-toolbar-text-stepper { width: fit-content; max-width: 100%; grid-template-columns: 36px minmax(64px, auto) 36px; }
    #wcag-toolbar .wcag-toolbar-text-stepper button { min-width: 36px; min-height: 44px; font-size: 16px !important; }
    #wcag-toolbar .wcag-toolbar-text-stepper output { font-size: 14px; }
    #wcag-toolbar #wcag-toolbar-view-contrast .wcag-toolbar-choice-card { min-height: 156px; }
    #wcag-toolbar .wcag-toolbar-contrast-preview { min-height: 68px; }
    #wcag-toolbar .wcag-toolbar-contrast-preview__pane { padding: 7.2px 8px; }
    #wcag-toolbar .wcag-toolbar-contrast-preview__pane > strong { font-size: 21.6px; }
    #wcag-toolbar .wcag-toolbar-view-status { min-height: 44.8px; margin-top: 12px; font-size: 12px; }
    #wcag-toolbar .wcag-toolbar-active-preferences { padding: 12px; }
    #wcag-toolbar .wcag-toolbar-active-preferences__summary {
        align-items: stretch;
        flex-direction: column;
        gap: 10.4px;
    }
    #wcag-toolbar .wcag-toolbar-active-preferences__message { font-size: 14.4px; }
    #wcag-toolbar .wcag-toolbar-active-preferences__toggle { width: 100%; }
    #wcag-toolbar .wcag-toolbar-active-preferences__list { gap: 8px; margin-top: 11.2px; padding-top: 11.2px; }
    #wcag-toolbar .wcag-toolbar-active-preference {
        min-height: 52px;
        grid-template-columns: 35.2px minmax(0, max-content) 44px;
    }
    #wcag-toolbar .wcag-toolbar-active-preference__icon { width: 35.2px; }
    #wcag-toolbar .wcag-toolbar-active-preference__copy {
        gap: 1.6px;
        padding-inline-end: 5.6px;
    }
    #wcag-toolbar .wcag-toolbar-active-preference__title { font-size: 11.84px; }
    #wcag-toolbar .wcag-toolbar-active-preference__value { font-size: 10.88px; }
    #wcag-toolbar .wcag-toolbar-inner > #wcag-toolbar-notice.wcag-toolbar-notice {
        min-height: 56px;
        flex-wrap: wrap;
        padding: 9.6px 16px calc(9.6px + 4px);
    }
    #wcag-toolbar .wcag-toolbar-player__buttons { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    #wcag-toolbar .wcag-toolbar-player__button { min-height: 56px; }
    #wcag-toolbar .wcag-toolbar-player__button--primary { width: 68px; height: 68px; min-height: 68px; }
    #wcag-toolbar .wcag-toolbar-footer-shell { grid-template-columns: 48px 48px minmax(0, 1fr); gap: 8.8px; padding: 12px 16px; }
}

@media (max-width: 768px) {
    #wcag-toolbar.wcag-toolbar-mobile-sheet {
        top: auto !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        max-width: none !important;
        max-height: min(88dvh, 800px);
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 24px 24px 0 0 !important;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet #wcag-toolbar-close.wcag-toolbar-close--mobile-only { display: inline-flex !important; }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-sheet-handle {
        top: 8px;
        width: 41.6px;
        height: 4.8px;
        border-radius: 999px;
        background: #aab2bd;
    }
}

@media (max-width: 340px) {
    #wcag-toolbar .wcag-toolbar-overview-grid { grid-template-columns: minmax(0, 1fr); }
    #wcag-toolbar #wcag-toolbar-view-contrast .wcag-toolbar-choice-grid {
        grid-template-columns: minmax(0, 1fr);
        grid-auto-rows: auto;
    }
    #wcag-toolbar .wcag-toolbar-color-fields { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    #wcag-toolbar *, #wcag-toolbar *::before, #wcag-toolbar *::after,
    #wcag-read-aloud-compact-player *, #wcag-reading-mode-dialog * {
        scroll-behavior: auto !important;
        transition-duration: .001ms !important;
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media (forced-colors: active) {
    #wcag-toolbar .wcag-toolbar-tool-card.is-active,
    #wcag-toolbar .wcag-toolbar-choice-card:has(input:checked),
    #wcag-toolbar .wcag-toolbar-view-status,
    .wcag-read-aloud-current {
        border: 3px solid Highlight !important;
        background: Canvas !important;
        color: CanvasText !important;
        forced-color-adjust: auto;
    }

    #wcag-toolbar .wcag-toolbar-tool-card__check, #wcag-toolbar .wcag-toolbar-switch__track { forced-color-adjust: auto; }

    #wcag-toolbar .wcag-toolbar-inner > #wcag-toolbar-notice.wcag-toolbar-notice {
        border-bottom: 2px solid CanvasText !important;
        background: Canvas !important;
        color: CanvasText !important;
    }
}

/* Runtime markup alignment. These selectors intentionally follow the stable
   PHP classes in class-wcag-functions-toolbar.php. */
#wcag-toolbar .wcag-toolbar-heading {
    display: block;
    flex: 1 1 auto;
}

#wcag-toolbar .wcag-toolbar-profile {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 7.2px;
    margin-inline-start: auto;
    border: 0 !important;
    border-radius: 8.8px !important;
    background: transparent !important;
    padding: 7.2px 10.4px !important;
    max-width: min(256px, 42%);
    color: var(--wcag-toolbar-header-text) !important;
    font-weight: 650;
    cursor: pointer;
}

#wcag-toolbar .wcag-toolbar-profile svg { width: 18.4px; height: 18.4px; }
#wcag-toolbar .wcag-toolbar-profile > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#wcag-toolbar .wcag-toolbar-profile [data-wcag-profile-name] {
    color: var(--wcag-toolbar-header-action) !important;
    font-weight: 700;
}
#wcag-toolbar.is-detail-view .wcag-toolbar-profile { display: none; }
#wcag-toolbar .wcag-toolbar-tool-card__description { display: none; }
#wcag-toolbar .wcag-toolbar-tool-card__copy { display: block; min-width: 0; }
#wcag-toolbar .wcag-toolbar-tool-card__chevron { display: none; }

#wcag-toolbar .wcag-toolbar-dialog-actions {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 12px;
}

#wcag-toolbar .wcag-toolbar-dialog-actions:has(> [data-wcag-tool="keyboard-help"]:not([hidden])) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr);
}

#wcag-toolbar .wcag-toolbar-dialog-actions > button { width: 100%; }

#wcag-toolbar .wcag-toolbar-dialog-actions[data-wcag-default-dialog-actions] {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

#wcag-toolbar .wcag-toolbar-dialog-actions[data-wcag-default-dialog-actions] > button {
    width: fit-content;
    max-width: 100%;
    flex: 0 0 auto;
}

#wcag-toolbar .wcag-toolbar-dialog-actions[data-wcag-default-dialog-actions] > #wcag-toolbar-done {
    margin-inline-start: auto;
}

#wcag-toolbar .wcag-toolbar-view-header {
    position: sticky;
    top: -25.6px;
    z-index: 3;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: 12.8px;
    margin: -25.6px -28px 18.4px;
    border-bottom: 1px solid var(--wcag-toolbar-line);
    background: var(--wcag-toolbar-bg, #ffffff);
    padding: 17.6px 28px 14.4px;
}

#wcag-toolbar.is-detail-view .wcag-toolbar-header > :is(
    .wcag-toolbar-header-icon,
    .wcag-toolbar-heading,
    .wcag-toolbar-profile
) {
    display: none !important;
}

#wcag-toolbar .wcag-toolbar-header > .wcag-toolbar-view-header {
    position: static;
    z-index: auto;
    min-width: 0;
    flex: 1 1 auto;
    margin: 0;
    border: 0;
    background: transparent !important;
    padding: 0;
}

#wcag-toolbar .wcag-toolbar-view-header > div { min-width: 0; }
#wcag-toolbar .wcag-toolbar-view-header__title-row {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 13.6px;
}
#wcag-toolbar .wcag-read-aloud-header-status {
    flex: 0 0 auto;
    color: var(--wcag-toolbar-success);
    font-size: 13.76px;
    font-weight: 650;
}
#wcag-toolbar .wcag-toolbar-view-header__icon {
    display: inline-grid;
    width: 44px;
    height: 44px;
    place-items: center;
    color: var(--wcag-toolbar-ink);
}
#wcag-toolbar .wcag-toolbar-view-header__icon svg { width: 32px; height: 32px; stroke-width: 1.8; }
#wcag-toolbar .wcag-toolbar-view-title { display: inline-block; max-width: 100%; margin: 0; color: var(--wcag-toolbar-ink); font-size: 20.48px; font-weight: 760; line-height: 1.25; }
#wcag-toolbar .wcag-toolbar-view-title:focus-visible {
    border-radius: 3.2px;
    outline: 3px solid var(--wcag-toolbar-focus-inner, #ffffff) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 6px var(--wcag-toolbar-focus-outer, #111827) !important;
}
#wcag-toolbar .wcag-toolbar-view-description { margin: 2.88px 0 0; color: var(--wcag-toolbar-muted); font-size: 13.76px; line-height: 1.4; }
#wcag-toolbar.wcag-read-aloud-active [data-wcag-view-header="read-aloud"] .wcag-toolbar-view-description { display: none; }

#wcag-toolbar .wcag-toolbar-back {
    width: auto;
    min-width: 48px;
    min-height: 48px;
    padding: 8.8px 11.2px !important;
}

#wcag-toolbar .wcag-toolbar-back svg { width: 20.8px; height: 20.8px; }
#wcag-toolbar .wcag-toolbar-view-status:empty { display: none; }
#wcag-toolbar .wcag-toolbar-choice-group { min-width: 0; margin: 0 0 21.6px; border: 0; padding: 0; }
#wcag-toolbar .wcag-toolbar-choice-group > legend { margin: 0 0 11.2px; padding: 0; color: var(--wcag-toolbar-ink); font-weight: 750; }

#wcag-toolbar .wcag-toolbar-keyboard-groups {
    display: grid;
    gap: 19.2px;
}

#wcag-toolbar .wcag-toolbar-keyboard-group { min-width: 0; }
#wcag-toolbar .wcag-toolbar-keyboard-group__title {
    margin: 0 0 10.4px !important;
    padding: 0 !important;
    color: var(--wcag-toolbar-ink) !important;
    font-size: 15.2px !important;
    font-weight: 750 !important;
    line-height: 1.35 !important;
    text-shadow: none !important;
}

#wcag-toolbar .wcag-toolbar-keyboard-list,
#wcag-toolbar .wcag-toolbar-shortcut-list {
    display: grid;
    gap: 8.8px;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

#wcag-toolbar .wcag-toolbar-keyboard-row {
    display: grid;
    grid-template-columns: minmax(192px, auto) minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    min-width: 0;
    margin: 0 !important;
    border: 1px solid var(--wcag-toolbar-control-border) !important;
    border-radius: 11.2px;
    background: var(--wcag-toolbar-surface) !important;
    padding: 11.52px 12.8px;
    color: var(--wcag-toolbar-ink) !important;
    text-shadow: none !important;
}

#wcag-toolbar .wcag-toolbar-keyboard-row::before,
#wcag-toolbar .wcag-toolbar-keyboard-row::marker { content: none !important; }
#wcag-toolbar .wcag-toolbar-keyboard-row > :is(dt, dd) {
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    color: var(--wcag-toolbar-ink) !important;
    font-size: 14.08px !important;
    line-height: 1.4 !important;
    text-shadow: none !important;
}
#wcag-toolbar .wcag-toolbar-keyboard-row > dt { font-weight: 700 !important; }
#wcag-toolbar .wcag-toolbar-keyboard-row > dd { overflow-wrap: anywhere; }

#wcag-toolbar .wcag-toolbar-key-combination {
    display: inline-flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 4.8px;
}

#wcag-toolbar .wcag-toolbar-key-combination kbd {
    display: inline-flex;
    min-width: 36.8px;
    min-height: 34.4px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--wcag-toolbar-control-border) !important;
    border-bottom-width: 2px !important;
    border-radius: 7.2px !important;
    background: var(--wcag-toolbar-subtle) !important;
    padding: 5.12px 8.8px !important;
    color: var(--wcag-toolbar-ink) !important;
    box-shadow: 0 1px 2px rgb(15 23 42 / 20%) !important;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace !important;
    font-size: 12.8px !important;
    font-weight: 750 !important;
    line-height: 1 !important;
    text-shadow: none !important;
    -webkit-text-fill-color: currentColor !important;
    white-space: nowrap;
}

#wcag-toolbar .wcag-toolbar-key-separator {
    color: var(--wcag-toolbar-muted) !important;
    font-size: 13.12px;
    font-weight: 750;
    line-height: 1;
}

#wcag-toolbar .wcag-toolbar-keyboard-group > .wcag-toolbar-field-hint {
    margin: 0 !important;
    border: 1px solid var(--wcag-toolbar-line);
    border-radius: 11.2px;
    background: var(--wcag-toolbar-surface);
    padding: 12px 12.8px;
    color: var(--wcag-toolbar-muted) !important;
    font-size: 13.76px !important;
    line-height: 1.45 !important;
    text-shadow: none !important;
}

#wcag-toolbar .wcag-toolbar-choice-card__copy { display: grid; gap: 3.2px; }
#wcag-toolbar .wcag-toolbar-choice-card__copy > span { color: var(--wcag-toolbar-muted); font-size: 12.16px; line-height: 1.35; }

#wcag-toolbar .wcag-toolbar-choice-card__check {
    position: absolute;
    top: 8.8px;
    right: 8.8px;
    display: none;
    width: 23.2px;
    height: 23.2px;
    place-items: center;
    border-radius: 50%;
    background: var(--wcag-toolbar-control-accent);
    color: var(--wcag-toolbar-on-accent);
}

#wcag-toolbar .wcag-toolbar-choice-card:has(input:checked) .wcag-toolbar-choice-card__check { display: inline-grid; }
#wcag-toolbar .wcag-toolbar-choice-card__check svg { width: 14.4px; height: 14.4px; }

/* Reading mode uses compact segmented controls inside four peer settings.
   The native radio remains the focusable control and drives every visual state. */
#wcag-toolbar .wcag-reading-mode-settings {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

#wcag-toolbar .wcag-reading-mode-setting {
    display: grid;
    min-width: 0;
    grid-template-rows: auto auto;
    align-content: start;
    gap: 10.4px;
    margin: 0;
    border: 1px solid var(--wcag-toolbar-line);
    border-radius: 11.2px;
    padding: 12.8px;
}

#wcag-toolbar .wcag-reading-mode-setting > legend {
    margin: 0;
    padding: 0 1.6px;
    color: var(--wcag-toolbar-ink);
    font-weight: 750;
}

#wcag-toolbar .wcag-reading-mode-options {
    display: grid;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--wcag-toolbar-control-border, var(--wcag-toolbar-line));
    border-radius: 8.8px;
}

#wcag-toolbar .wcag-reading-mode-options--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

#wcag-toolbar #wcag-toolbar-view-reading-mode .wcag-reading-mode-option {
    min-width: 0;
    min-height: 76px;
    flex-direction: row;
    gap: 8px;
    margin: 0 !important;
    border: 0 !important;
    border-inline-start: 1px solid var(--wcag-toolbar-control-border, var(--wcag-toolbar-line)) !important;
    border-radius: 0 !important;
    background: var(--wcag-toolbar-surface) !important;
    padding: 10.4px 8px !important;
    font-weight: 650;
}

#wcag-toolbar #wcag-toolbar-view-reading-mode .wcag-reading-mode-option:first-child {
    border-inline-start: 0 !important;
    border-start-start-radius: 7.2px !important;
    border-end-start-radius: 7.2px !important;
}

#wcag-toolbar #wcag-toolbar-view-reading-mode .wcag-reading-mode-option:last-child {
    border-start-end-radius: 7.2px !important;
    border-end-end-radius: 7.2px !important;
}

#wcag-toolbar #wcag-toolbar-view-reading-mode .wcag-reading-mode-option:has(input:checked) {
    border-color: var(--wcag-toolbar-control-accent) !important;
    background: var(--wcag-toolbar-accent-soft) !important;
    padding: 10.4px 8px !important;
    color: var(--wcag-toolbar-accent-strong, var(--wcag-toolbar-accent)) !important;
    box-shadow: inset 0 0 0 2px var(--wcag-toolbar-control-accent) !important;
}

#wcag-toolbar .wcag-reading-mode-option__text {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    gap: 7.2px;
}

#wcag-toolbar #wcag-toolbar-view-reading-mode .wcag-toolbar-choice-card__check {
    position: static;
    width: 23.2px;
    height: 23.2px;
    flex: 0 0 23.2px;
    border: 2px solid currentColor;
    background: transparent;
    color: inherit;
}

#wcag-toolbar #wcag-toolbar-view-reading-mode .wcag-reading-mode-setting--theme .wcag-reading-mode-option {
    min-height: 92px;
    flex-direction: column;
    gap: 6.4px;
    padding: 7.2px 5.6px !important;
}

#wcag-toolbar #wcag-toolbar-view-reading-mode .wcag-reading-mode-setting--theme .wcag-reading-mode-option:has(input:checked) {
    padding: 7.2px 5.6px !important;
}

html:not(.wcag-toolbar-pointer-focus) #wcag-toolbar #wcag-toolbar-view-reading-mode .wcag-reading-mode-option:has(input:focus-visible) {
    outline: 3px solid var(--wcag-toolbar-focus-inner, #ffffff) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 6px var(--wcag-toolbar-focus-outer, #111827) !important;
}

html:not(.wcag-toolbar-pointer-focus) #wcag-toolbar #wcag-toolbar-view-reading-mode .wcag-reading-mode-option:has(input:checked):has(input:focus-visible) {
    box-shadow: inset 0 0 0 2px var(--wcag-toolbar-control-accent), 0 0 0 6px var(--wcag-toolbar-focus-outer, #111827) !important;
}

#wcag-toolbar .wcag-reading-mode-theme-preview {
    --wcag-reading-preview-background: #ffffff;
    --wcag-reading-preview-line: #64748b;
    display: grid;
    width: min(100%, 72px);
    min-height: 42.4px;
    align-content: center;
    justify-items: center;
    gap: 4.8px;
    border: 1px solid #94a3b8;
    border-radius: 5.6px;
    background: var(--wcag-reading-preview-background);
}

#wcag-toolbar .wcag-reading-mode-theme-preview--warm {
    --wcag-reading-preview-background: #fff7e6;
    --wcag-reading-preview-line: #72552f;
}

#wcag-toolbar .wcag-reading-mode-theme-preview--dark {
    --wcag-reading-preview-background: #111827;
    --wcag-reading-preview-line: #cbd5e1;
}

#wcag-toolbar .wcag-reading-mode-theme-preview > span {
    width: 70%;
    height: 2.08px;
    border-radius: 999px;
    background: var(--wcag-reading-preview-line);
}

#wcag-toolbar .wcag-reading-mode-theme-preview > span:nth-child(2) { width: 56%; }

#wcag-toolbar .wcag-reading-mode-start-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12.8px;
    margin-top: 12.8px;
    border: 1px solid var(--wcag-toolbar-line);
    border-radius: 11.2px;
    padding: 8.8px;
}

#wcag-toolbar .wcag-reading-mode-selection {
    min-width: 0;
    margin: 0 !important;
    padding-inline: 5.6px;
    color: var(--wcag-toolbar-ink) !important;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

#wcag-toolbar .wcag-reading-mode-selection > strong { margin-inline-end: 4px; }

#wcag-toolbar #wcag-reading-start {
    width: auto;
    min-width: 240px;
    justify-self: end;
    white-space: nowrap;
}

#wcag-toolbar #wcag-reading-start svg { width: 21.6px; height: 21.6px; }

/* Native checkbox is the semantic switch. Its visual track remains the actual
   focusable input, so high-contrast and forced-colors modes retain state. */
#wcag-toolbar .wcag-toolbar-setting-row.wcag-toolbar-switch {
    position: relative;
    display: flex;
    width: 100%;
    height: auto;
}

#wcag-toolbar .wcag-toolbar-setting-row > span:first-child { display: block; min-width: 0; }
#wcag-toolbar .wcag-toolbar-setting-row > span:first-child > strong,
#wcag-toolbar .wcag-toolbar-setting-row > span:first-child > small { display: block; }
#wcag-toolbar .wcag-toolbar-setting-row > span:first-child > small {
    margin-top: 1.92px;
    color: var(--wcag-toolbar-muted);
    font-size: 12.16px;
    line-height: 1.4;
}

#wcag-toolbar .wcag-toolbar-setting-row.wcag-toolbar-switch > input[type="checkbox"] {
    position: relative;
    display: block;
    width: 48px;
    height: 26.4px;
    min-width: 48px;
    flex: 0 0 auto;
    overflow: visible;
    clip: auto;
    clip-path: none;
    border: 1px solid var(--wcag-toolbar-switch-off, #64748b) !important;
    border-radius: 999px !important;
    appearance: none;
    background: var(--wcag-toolbar-switch-off, #64748b) !important;
    padding: 0 !important;
    cursor: pointer;
}

#wcag-toolbar .wcag-toolbar-setting-row.wcag-toolbar-switch > input[type="checkbox"]::after {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--wcag-toolbar-surface);
    box-shadow: 0 1px 3px rgb(15 23 42 / 30%);
    content: "";
    transition: transform .18s ease;
}

#wcag-toolbar .wcag-toolbar-setting-row.wcag-toolbar-switch > input[type="checkbox"]:checked {
    border-color: var(--wcag-toolbar-control-accent) !important;
    background: var(--wcag-toolbar-control-accent) !important;
}

#wcag-toolbar .wcag-toolbar-setting-row.wcag-toolbar-switch > input[type="checkbox"]:checked::after { background: var(--wcag-toolbar-on-accent); transform: translateX(21.44px); }

#wcag-toolbar .wcag-toolbar-custom-colors {
    display: grid;
    gap: 16px;
    margin: 0 0 19.2px;
    border: 1px solid var(--wcag-toolbar-line);
    border-radius: 16px;
    background: var(--wcag-toolbar-surface);
    padding: 16px;
}

#wcag-toolbar .wcag-toolbar-custom-colors[hidden] { display: none !important; }
#wcag-toolbar .wcag-toolbar-custom-colors__title { margin: 0; font-size: 16.8px; line-height: 1.3; }
#wcag-toolbar .wcag-toolbar-custom-colors__fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 256px), 1fr)); gap: 13.6px; }

#wcag-toolbar .wcag-toolbar-color-field {
    display: grid;
    min-width: 0;
    gap: 8.8px;
    border: 1px solid var(--wcag-toolbar-line);
    border-radius: 12.8px;
    background: var(--wcag-toolbar-surface);
    padding: 13.6px;
}

#wcag-toolbar .wcag-toolbar-color-field__label { font-weight: 650; }
#wcag-toolbar .wcag-toolbar-color-field .wcag-toolbar-field-error { margin: 0; }

#wcag-toolbar .wcag-toolbar-color-control {
    display: grid;
    min-width: 0;
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: center;
    gap: 9.6px;
}

#wcag-toolbar .wcag-toolbar-color-swatch {
    display: grid;
    width: 64px;
    min-width: 44px;
    height: 55.2px;
    place-items: stretch;
    overflow: hidden;
    border: 1px solid var(--wcag-toolbar-control-border, var(--wcag-toolbar-line)) !important;
    border-radius: 8.8px;
    background: var(--wcag-toolbar-surface) !important;
    padding: 0 !important;
    cursor: pointer;
}

#wcag-toolbar .wcag-toolbar-color-swatch__sample { display: block; width: 100%; height: 100%; background: var(--wcag-color-swatch, #171717); }
#wcag-toolbar .wcag-toolbar-color-control input[type="text"] { width: 100%; min-width: 0; min-height: 55.2px; border: 1px solid var(--wcag-toolbar-control-border, var(--wcag-toolbar-line)) !important; border-radius: 8.8px !important; background: var(--wcag-toolbar-surface) !important; padding: 10.4px 12.8px !important; box-shadow: none !important; font: inherit; }

#wcag-toolbar .wcag-toolbar-contrast-result {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(144px, auto) minmax(176px, 1fr);
    align-items: center;
    gap: 0;
    border: 1px solid var(--wcag-toolbar-line);
    border-radius: 12.8px;
    background: var(--wcag-toolbar-surface);
    padding: 12px;
    color: var(--wcag-toolbar-text);
}

#wcag-toolbar .wcag-toolbar-contrast-result__sample,
#wcag-toolbar .wcag-toolbar-contrast-result__metric,
#wcag-toolbar .wcag-toolbar-contrast-result__status {
    display: flex;
    min-width: 0;
    min-height: 48px;
    align-items: center;
    gap: 10.4px;
    padding: 0 12.8px;
}

#wcag-toolbar .wcag-toolbar-contrast-result__sample { padding-inline-start: 0; }
#wcag-toolbar .wcag-toolbar-contrast-result__sample > strong { display: grid; min-width: 68px; min-height: 48px; place-items: center; border: 1px solid var(--wcag-toolbar-control-border, var(--wcag-toolbar-line)); border-radius: 8px; background: var(--wcag-sample-background); color: var(--wcag-sample-text); font-size: 27.2px; line-height: 1; }
#wcag-toolbar .wcag-toolbar-contrast-result__metric { justify-content: space-between; border-inline: 1px solid var(--wcag-toolbar-line); }
#wcag-toolbar .wcag-toolbar-contrast-result__ratio { white-space: nowrap; font-size: 19.2px; }
#wcag-toolbar .wcag-toolbar-contrast-result__status { justify-content: center; color: var(--wcag-toolbar-success, #047857); }
#wcag-toolbar .wcag-toolbar-contrast-result__icon { display: inline-flex; flex: 0 0 auto; }
#wcag-toolbar .wcag-toolbar-contrast-result__icon svg { width: 26.4px; height: 26.4px; }
#wcag-toolbar .wcag-toolbar-contrast-result__warning { grid-column: 1 / -1; margin: 11.2px 2.4px 0; border-top: 1px solid var(--wcag-toolbar-line); padding-top: 11.2px; color: var(--wcag-toolbar-warning, #9a3412); font-size: 13.12px; }
#wcag-toolbar .wcag-toolbar-contrast-result[data-level="too-low"] .wcag-toolbar-contrast-result__status { color: var(--wcag-toolbar-danger, #b42318); }
#wcag-toolbar .wcag-toolbar-contrast-result[data-level="aa-large"] .wcag-toolbar-contrast-result__status { color: var(--wcag-toolbar-warning, #9a3412); }

#wcag-toolbar .wcag-toolbar-color-picker-layer {
    position: absolute;
    inset: 0;
    z-index: 12;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
}

#wcag-toolbar .wcag-toolbar-color-picker-layer[hidden] { display: none !important; }
#wcag-toolbar .wcag-toolbar-color-picker {
    position: absolute;
    top: 12px;
    left: 12px;
    display: grid;
    width: min(352px, calc(100% - 24px));
    max-height: calc(100% - 24px);
    gap: 14.4px;
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--wcag-toolbar-control-border, var(--wcag-toolbar-line));
    border-radius: 13.6px;
    background: var(--wcag-toolbar-surface);
    box-shadow: 0 16px 40px rgb(15 23 42 / 24%);
    padding: 14.4px;
    color: var(--wcag-toolbar-text);
    pointer-events: auto;
}

#wcag-toolbar .wcag-toolbar-color-picker__header { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; }
#wcag-toolbar .wcag-toolbar-color-picker__header > strong { font-size: 16px; }
#wcag-toolbar .wcag-toolbar-color-picker__close { display: grid; width: 44px; min-width: 44px; height: 44px; place-items: center; border: 0 !important; border-radius: 8.8px; background: transparent !important; color: inherit; padding: 0 !important; }
#wcag-toolbar .wcag-toolbar-color-picker__close svg { width: 21.6px; height: 21.6px; }
#wcag-toolbar .wcag-toolbar-color-picker__preview { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 11.2px; }
#wcag-toolbar .wcag-toolbar-color-picker__preview > span { display: block; height: 51.2px; border: 1px solid var(--wcag-toolbar-control-border, var(--wcag-toolbar-line)); border-radius: 8.8px; background: var(--wcag-color-picker-preview, #171717); }
#wcag-toolbar .wcag-toolbar-color-picker__preview output { min-width: 0; font-weight: 700; letter-spacing: .02em; }
#wcag-toolbar .wcag-toolbar-color-picker__controls { display: grid; gap: 4px; }
#wcag-toolbar .wcag-toolbar-color-picker__controls label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-weight: 650; }
#wcag-toolbar .wcag-toolbar-color-picker__controls label output { font-weight: 500; }
#wcag-toolbar .wcag-toolbar-color-picker__controls input[type="range"] { --wcag-color-picker-track: linear-gradient(90deg, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000); width: 100%; min-height: 44px; margin: 0 0 4.8px; appearance: none; border: 0 !important; background: transparent !important; padding: 0 !important; accent-color: var(--wcag-toolbar-control-accent); }
#wcag-toolbar .wcag-toolbar-color-picker__controls input[type="range"]::-webkit-slider-runnable-track { height: 10.4px; border: 1px solid var(--wcag-toolbar-control-border, var(--wcag-toolbar-line)); border-radius: 999px; background: var(--wcag-color-picker-track); }
#wcag-toolbar .wcag-toolbar-color-picker__controls input[type="range"]::-webkit-slider-thumb { width: 23.2px; height: 23.2px; margin-top: -7.2px; appearance: none; border: 2px solid var(--wcag-toolbar-surface); border-radius: 50%; background: var(--wcag-toolbar-control-accent); box-shadow: 0 0 0 1px var(--wcag-toolbar-text); }
#wcag-toolbar .wcag-toolbar-color-picker__controls input[type="range"]::-moz-range-track { height: 10.4px; border: 1px solid var(--wcag-toolbar-control-border, var(--wcag-toolbar-line)); border-radius: 999px; background: var(--wcag-color-picker-track); }
#wcag-toolbar .wcag-toolbar-color-picker__controls input[type="range"]::-moz-range-thumb { width: 23.2px; height: 23.2px; border: 2px solid var(--wcag-toolbar-surface); border-radius: 50%; background: var(--wcag-toolbar-control-accent); box-shadow: 0 0 0 1px var(--wcag-toolbar-text); }
#wcag-toolbar .wcag-toolbar-color-picker__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10.4px; }
#wcag-toolbar .wcag-toolbar-color-picker__actions > button { width: 100%; min-width: 0; }

#wcag-toolbar .wcag-focus-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12.8px;
}

#wcag-toolbar .wcag-focus-group {
    min-width: 0;
    margin: 0;
    border: 1px solid var(--wcag-toolbar-line);
    border-radius: 12px;
    padding: 12.8px;
}

#wcag-toolbar .wcag-focus-group > legend {
    max-width: calc(100% - 8px);
    margin: 0;
    padding: 0 5.6px;
    color: var(--wcag-toolbar-ink);
    font-size: 16.8px;
    font-weight: 750;
    line-height: 1.3;
}

#wcag-toolbar .wcag-focus-group__options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(136px, 100%), 1fr));
    grid-auto-rows: 1fr;
    gap: 10.4px;
}

#wcag-toolbar .wcag-toolbar-choice-card.wcag-focus-option {
    display: grid;
    min-height: 156px;
    grid-template-rows: 76px auto;
    align-content: start;
    align-items: start;
    justify-content: stretch;
    gap: 8.8px;
    margin: 0 !important;
    padding: 10.4px;
    text-align: left;
}

#wcag-toolbar .wcag-toolbar-choice-card.wcag-focus-option:has(input:checked) {
    padding: calc(10.4px - 1px);
}

#wcag-toolbar .wcag-focus-option__preview {
    position: relative;
    display: grid;
    width: 100%;
    height: 76px;
    place-items: center;
    align-content: center;
    gap: 8.8px;
    overflow: hidden;
    border: 1px solid var(--wcag-toolbar-line);
    border-radius: 8.8px;
    background: var(--wcag-toolbar-subtle, #f8fafc);
    color: var(--wcag-toolbar-ink);
}

#wcag-toolbar .wcag-focus-option__preview-button {
    display: inline-grid;
    min-width: 72.8px;
    min-height: 37.6px;
    place-items: center;
    border: 2px solid currentColor;
    border-radius: 6.08px;
    background: var(--wcag-toolbar-surface);
    color: var(--wcag-toolbar-ink);
    font-size: 12.48px;
    line-height: 1;
}

#wcag-toolbar .wcag-focus-option__preview--strong-ring .wcag-focus-option__preview-button {
    box-shadow: 0 0 0 2px var(--wcag-toolbar-surface), 0 0 0 4px var(--wcag-toolbar-ink);
}

#wcag-toolbar .wcag-focus-option__preview--yellow-highlight .wcag-focus-option__preview-button {
    box-shadow: 0 0 0 4px #facc15, 0 0 0 6px var(--wcag-toolbar-ink);
}

#wcag-toolbar .wcag-focus-option__preview-line {
    position: relative;
    z-index: 1;
    display: block;
    width: 72%;
    height: 2px;
    border-radius: 999px;
    background: var(--wcag-toolbar-ink);
}

#wcag-toolbar .wcag-focus-option__preview--reading-line .wcag-focus-option__preview-line:nth-child(2) {
    box-shadow: 0 0 0 6.72px #fde68a;
}

#wcag-toolbar .wcag-focus-option__preview--reading-mask {
    background: linear-gradient(
        to bottom,
        color-mix(in srgb, var(--wcag-toolbar-ink) 18%, var(--wcag-toolbar-surface)) 0 34%,
        var(--wcag-toolbar-surface) 34% 66%,
        color-mix(in srgb, var(--wcag-toolbar-ink) 18%, var(--wcag-toolbar-surface)) 66% 100%
    );
}

#wcag-toolbar .wcag-focus-option__preview--reading-mask .wcag-focus-option__preview-line:not(:nth-child(2)) {
    opacity: .35;
}

#wcag-toolbar .wcag-focus-option__copy {
    display: grid;
    min-width: 0;
    gap: 3.2px;
}

#wcag-toolbar .wcag-focus-option__copy strong,
#wcag-toolbar .wcag-focus-option__copy small {
    display: block;
}

#wcag-toolbar .wcag-focus-option__copy strong {
    color: var(--wcag-toolbar-ink);
    font-size: 13.76px;
    line-height: 1.25;
}

#wcag-toolbar .wcag-focus-option__copy small {
    color: var(--wcag-toolbar-muted);
    font-size: 11.52px;
    line-height: 1.35;
}

#wcag-toolbar .wcag-read-aloud-player {
    display: grid;
    gap: 14.4px;
}

#wcag-toolbar .wcag-read-aloud-player__heading {
    display: block;
}

#wcag-toolbar .wcag-read-aloud-player__heading > span { display: none; }

#wcag-toolbar .wcag-read-aloud-player__heading h4,
#wcag-toolbar .wcag-read-aloud-player__heading p { margin: 0; }
#wcag-toolbar .wcag-read-aloud-player__heading h4 {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}
#wcag-toolbar .wcag-read-aloud-player__heading p {
    color: var(--wcag-toolbar-ink);
    font-size: 18.4px;
    font-weight: 750;
    line-height: 1.35;
}

#wcag-toolbar #wcag-toolbar-view-read-aloud:has(#wcag-read-aloud-player:not([hidden])) > .wcag-toolbar-view-status {
    display: none;
}

#wcag-toolbar .wcag-read-aloud-player__progress {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 7.2px 12.8px;
}

#wcag-toolbar .wcag-read-aloud-player__position {
    grid-column: 1 / -1;
    color: var(--wcag-toolbar-muted);
    font-size: 14.4px;
}

#wcag-toolbar .wcag-read-aloud-player__percentage {
    min-width: 51.2px;
    color: var(--wcag-toolbar-ink);
    text-align: end;
}

#wcag-toolbar .wcag-read-aloud-player__segment-window {
    min-width: 0;
    height: 116px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--wcag-toolbar-line);
    border-left: 5px solid var(--wcag-toolbar-accent);
    border-radius: 10.4px;
    background: var(--wcag-toolbar-accent-soft);
    scrollbar-gutter: stable;
    scrollbar-width: thin;
}

#wcag-toolbar .wcag-read-aloud-player__segment-window:focus-visible {
    outline: 3px solid var(--wcag-toolbar-focus-inner, #ffffff);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px var(--wcag-toolbar-focus-outer, #111827);
}

#wcag-toolbar .wcag-read-aloud-player__segment {
    min-height: 100%;
    margin: 0 !important;
    padding: 16px 18.4px !important;
    color: var(--wcag-toolbar-ink);
    font-size: 16.8px;
    font-style: normal;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

#wcag-toolbar .wcag-read-aloud-player__controls {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    gap: 12px;
}

#wcag-toolbar .wcag-read-aloud-player__controls button {
    display: inline-flex;
    width: 100%;
    height: 100%;
    min-height: 80px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5.6px;
    border: 1px solid var(--wcag-toolbar-control-border, var(--wcag-toolbar-line)) !important;
    border-radius: 10.4px !important;
    background: var(--wcag-toolbar-surface) !important;
    padding: 8.8px 8px !important;
    color: var(--wcag-toolbar-ink) !important;
    cursor: pointer;
}

#wcag-toolbar .wcag-read-aloud-player__controls button svg { width: 28px; height: 28px; }

#wcag-toolbar .wcag-read-aloud-player__controls [data-wcag-action="read-aloud-toggle"] {
    width: 100%;
    height: 100%;
    min-height: 80px;
    justify-self: stretch;
    border: 1px solid var(--wcag-toolbar-control-accent) !important;
    border-radius: 10.4px !important;
    background: var(--wcag-toolbar-control-accent) !important;
    color: var(--wcag-toolbar-on-accent) !important;
    box-shadow: none !important;
    padding: 7.2px 5.6px !important;
    font-size: inherit !important;
    line-height: 1.2;
}

#wcag-toolbar .wcag-read-aloud-settings {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    border: 1px solid var(--wcag-toolbar-control-border, var(--wcag-toolbar-line));
    border-radius: 10.4px;
}

#wcag-toolbar .wcag-read-aloud-setting {
    display: grid;
    min-width: 0;
    min-height: 100px;
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    gap: 8px;
    border: 0;
    border-radius: 0;
    padding: 11.2px 12.8px;
}

#wcag-toolbar .wcag-read-aloud-setting + .wcag-read-aloud-setting {
    border-inline-start: 1px solid var(--wcag-toolbar-control-border, var(--wcag-toolbar-line));
}

#wcag-toolbar .wcag-read-aloud-setting > :is(label, span:first-child) {
    margin: 0 !important;
    padding: 0 !important;
    color: var(--wcag-toolbar-ink);
    font-weight: 600;
    line-height: 1.3;
}

#wcag-toolbar .wcag-read-aloud-setting > select {
    width: 100%;
    height: 46px;
    min-width: 0;
    min-height: 46px;
    border-color: var(--wcag-toolbar-control-border, var(--wcag-toolbar-line)) !important;
}

#wcag-toolbar .wcag-read-aloud-page-position {
    display: grid;
    gap: 7.2px;
}

#wcag-toolbar .wcag-read-aloud-page-position > h5 {
    margin: 0 !important;
    color: var(--wcag-toolbar-muted);
    font-size: 13.12px;
    font-weight: 700;
    line-height: 1.3;
}

#wcag-toolbar .wcag-read-aloud-jump-action,
#wcag-toolbar .wcag-read-aloud-follow-setting {
    width: 100%;
    min-width: 0;
    min-height: 72px;
}

#wcag-toolbar .wcag-read-aloud-jump-action {
    border-color: var(--wcag-toolbar-control-border, var(--wcag-toolbar-line)) !important;
}

#wcag-toolbar .wcag-read-aloud-follow-setting {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10.4px;
    border: 1px solid var(--wcag-toolbar-control-border, var(--wcag-toolbar-line)) !important;
    border-radius: 8.8px !important;
    background: var(--wcag-toolbar-surface) !important;
    padding: 8.8px 11.2px !important;
    color: var(--wcag-toolbar-ink) !important;
    text-align: left;
    cursor: pointer;
}

#wcag-toolbar .wcag-read-aloud-follow-setting[aria-pressed="true"] {
    border-color: var(--wcag-toolbar-control-border, var(--wcag-toolbar-line)) !important;
    background: var(--wcag-toolbar-surface) !important;
    color: var(--wcag-toolbar-ink) !important;
    box-shadow: none !important;
}

#wcag-toolbar .wcag-read-aloud-follow-setting__icon {
    display: inline-grid;
    place-items: center;
}

#wcag-toolbar .wcag-read-aloud-follow-setting__icon svg {
    width: 21.6px;
    height: 21.6px;
}

#wcag-toolbar .wcag-read-aloud-follow-setting__copy {
    display: grid;
    min-width: 0;
    gap: 2.4px;
}

#wcag-toolbar .wcag-read-aloud-follow-setting__copy strong,
#wcag-toolbar .wcag-read-aloud-follow-setting__copy small {
    display: block;
}

#wcag-toolbar .wcag-read-aloud-follow-setting__copy strong {
    font-size: 14.08px;
    line-height: 1.25;
}

#wcag-toolbar .wcag-read-aloud-follow-setting__copy small {
    color: var(--wcag-toolbar-muted);
    font-size: 11.52px;
    line-height: 1.35;
}

#wcag-toolbar .wcag-read-aloud-follow-setting__state {
    color: var(--wcag-toolbar-ink);
    font-size: 12.48px;
    font-weight: 650;
}

#wcag-toolbar .wcag-read-aloud-follow-setting__track {
    position: relative;
    display: block;
    width: 48px;
    height: 26.4px;
    border: 1px solid var(--wcag-toolbar-switch-off, #64748b);
    border-radius: 999px;
    background: var(--wcag-toolbar-switch-off, #64748b);
}

#wcag-toolbar .wcag-read-aloud-follow-setting__track > span {
    position: absolute;
    top: 2px;
    left: 2px;
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--wcag-toolbar-surface);
    box-shadow: 0 1px 3px rgb(15 23 42 / 30%);
    transition: transform .18s ease;
}

#wcag-toolbar .wcag-read-aloud-rate-stepper {
    display: grid;
    height: 46px;
    min-height: 46px;
    grid-template-columns: 44px minmax(68px, auto) 44px;
    overflow: visible;
    border: 1px solid var(--wcag-toolbar-control-border, var(--wcag-toolbar-line));
    border-radius: 8px;
    background: var(--wcag-toolbar-surface);
}

#wcag-toolbar .wcag-read-aloud-rate-stepper button {
    position: relative;
    display: inline-grid;
    min-width: 44px;
    min-height: 44px;
    place-items: center;
    border: 0 !important;
    border-radius: 0 !important;
    background: var(--wcag-toolbar-surface) !important;
    padding: 0 !important;
    color: var(--wcag-toolbar-ink) !important;
    cursor: pointer;
}

#wcag-toolbar .wcag-read-aloud-rate-stepper button:first-child { border-right: 1px solid var(--wcag-toolbar-control-border, var(--wcag-toolbar-line)) !important; border-radius: 7.2px 0 0 7.2px !important; }
#wcag-toolbar .wcag-read-aloud-rate-stepper button:last-child { border-left: 1px solid var(--wcag-toolbar-control-border, var(--wcag-toolbar-line)) !important; border-radius: 0 7.2px 7.2px 0 !important; }
#wcag-toolbar .wcag-read-aloud-rate-stepper button svg { width: 18.4px; height: 18.4px; }
#wcag-toolbar .wcag-read-aloud-rate-stepper output {
    display: inline-flex;
    min-width: 68px;
    align-items: center;
    justify-content: center;
    padding: 0 7.2px;
    color: var(--wcag-toolbar-ink);
    font-size: 15.2px;
    font-weight: 750;
}

#wcag-read-aloud-compact-player {
    grid-template-columns: auto minmax(0, 1fr);
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__icon {
    grid-area: icon;
    display: inline-grid;
    width: var(--wcag-compact-function-icon-size);
    height: var(--wcag-compact-function-icon-size);
    place-items: center;
    border-radius: 50%;
    background: var(--wcag-toolbar-accent-soft, #eff6ff);
    color: var(--wcag-toolbar-control-accent, #1d4ed8);
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__icon svg {
    display: block;
    width: var(--wcag-compact-function-icon-svg-size);
    height: var(--wcag-compact-function-icon-svg-size);
    stroke-width: 1.8;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__copy {
    display: grid;
    min-width: 0;
    grid-area: copy;
    gap: 3.2px;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__copy h2,
#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__copy p { margin: 0; }
#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__copy h2 {
    overflow: hidden;
    min-width: 0;
    color: var(--wcag-toolbar-ink, #0f172a);
    font-size: 16.8px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__copy p {
    overflow: hidden;
    color: var(--wcag-toolbar-muted, #475569);
    font-size: 12.48px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__heading-row {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 6.4px;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__status {
    overflow: hidden;
    max-width: 100%;
    flex: 0 1 auto;
    border: 1px solid var(--wcag-toolbar-success-border, #ccebdd);
    border-radius: 999px;
    background: var(--wcag-toolbar-success-soft, #ecfdf5);
    padding: 2.4px 5.6px;
    color: var(--wcag-toolbar-success, #047857);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__title {
    min-height: 15.6px;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__progress {
    display: grid;
    min-width: 0;
    gap: 3.2px;
    margin-top: 1.6px;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__progress progress {
    width: 100%;
    height: 5.6px;
    margin: 0;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__progress-meta {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 6.4px;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__percent {
    flex: none;
    color: var(--wcag-toolbar-muted, #475569);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__controls {
    position: relative;
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    grid-area: controls;
    align-items: center;
    justify-content: center;
    column-gap: 12px;
    row-gap: 8px;
    padding-bottom: 0;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__transport-controls,
#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__utility-controls {
    display: grid;
    align-items: center;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__transport-controls {
    grid-template-columns: repeat(3, var(--wcag-compact-control-size));
    gap: 0;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__transport-controls > button,
#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__utility-controls > button {
    width: var(--wcag-compact-control-size);
    height: var(--wcag-compact-control-size);
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__transport-controls > button,
#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__utility-controls > button,
#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__follow-control > button {
    flex-basis: var(--wcag-compact-control-size);
    border-radius: 8.8px;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__transport-controls > button {
    position: relative;
    border-radius: 0;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__transport-controls > button:first-child {
    border-radius: 8.8px 0 0 8.8px;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__transport-controls > button:last-child {
    border-radius: 0 8.8px 8.8px 0;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__transport-controls > button + button {
    margin-inline-start: -1px;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__transport-controls > button:focus-visible {
    z-index: 1;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__utility-controls {
    grid-template-columns: var(--wcag-compact-control-size) var(--wcag-compact-control-size) auto;
    gap: 6px;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__controls button > :is([data-wcag-pause-icon], [data-wcag-resume-icon]) {
    display: inline-grid;
    width: var(--wcag-compact-control-icon-size);
    height: var(--wcag-compact-control-icon-size);
    place-items: center;
    margin: 0;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__controls button svg {
    display: block;
    width: var(--wcag-compact-control-icon-size);
    height: var(--wcag-compact-control-icon-size);
    flex: none;
    margin: 0 !important;
    stroke-width: 2;
    vertical-align: middle;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__follow-control {
    position: relative;
    display: inline-grid;
    width: auto;
    min-width: 72px;
    height: var(--wcag-compact-control-size);
    justify-items: center;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__follow-control > button {
    display: inline-flex;
    width: auto;
    min-width: 72px;
    height: var(--wcag-compact-control-size);
    align-items: center;
    justify-content: center;
    gap: 4.8px;
    padding: 0 7.2px !important;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__follow-caption {
    display: none;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__follow-state {
    display: inline-flex;
    width: auto;
    height: auto;
    align-items: center;
    gap: 2px;
    margin: 0;
    font-size: 11px;
    font-weight: 750;
    line-height: 1;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__follow-check {
    display: none;
    width: 14px;
    height: 14px;
    place-items: center;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-follow-toggle[aria-pressed="true"] .wcag-read-aloud-compact-player__follow-check {
    display: inline-grid;
}

#wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__follow-check svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
}

#wcag-reading-mode-dialog .wcag-reading-mode-shell { min-height: 100%; background: inherit; }

#wcag-reading-mode-dialog .wcag-reading-mode-header,
#wcag-reading-mode-dialog .wcag-reading-mode__header {
    position: sticky;
    z-index: 2;
    top: 0;
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--wcag-reader-border);
    background: inherit;
    padding: 12px clamp(16px, 4vw, 48px);
}

#wcag-reading-mode-dialog .wcag-reading-mode-header h2,
#wcag-reading-mode-dialog .wcag-reading-mode-header span { margin: 0; }

#wcag-reading-mode-dialog .wcag-toolbar-secondary-action {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px solid currentColor;
    border-radius: 8.8px;
    appearance: none;
    background: transparent;
    padding: 8.8px 12.8px;
    color: inherit;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

#wcag-reading-mode-dialog .wcag-toolbar-secondary-action svg { width: 20px; height: 20px; flex: none; }

#wcag-reading-mode-dialog .wcag-reading-mode-content,
#wcag-reading-mode-dialog .wcag-reading-mode__content {
    width: min(var(--wcag-reader-width, 736px), calc(100% - 32px));
    margin: 0 auto;
    padding: clamp(32px, 7vw, 80px) 0;
    font-family: var(--wcag-reader-font, system-ui, sans-serif);
    font-size: clamp(16.8px, 16px + .2vw, 19.52px);
    line-height: var(--wcag-reader-line-height, 1.75);
    min-width: 0;
    overflow-wrap: anywhere;
}

#wcag-reading-mode-dialog .wcag-reading-mode__table-scroll {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
}

#wcag-reading-mode-dialog .wcag-reading-mode__table-scroll:focus-visible {
    outline: 3px solid #ffffff !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 6px #111827 !important;
}

#wcag-reading-mode-dialog .wcag-reading-mode__table-scroll > table {
    width: max-content;
    min-width: 100%;
}

#wcag-reading-mode-dialog .wcag-reading-mode__code-scroll {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    white-space: pre;
}

#wcag-reading-mode-dialog .wcag-reading-mode__code-scroll:focus-visible {
    outline: 3px solid #ffffff !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 6px #111827 !important;
}

@media (forced-colors: active) {
    #wcag-reading-mode-dialog {
        border-color: CanvasText !important;
        background: Canvas !important;
        color: CanvasText !important;
        forced-color-adjust: auto;
    }

    #wcag-reading-mode-dialog :is(
        .wcag-reading-mode-header,
        .wcag-reading-mode__header,
        .wcag-reading-mode-content,
        .wcag-reading-mode__content
    ),
    #wcag-reading-mode-dialog :is(
        .wcag-reading-mode-header,
        .wcag-reading-mode__header,
        .wcag-reading-mode-content,
        .wcag-reading-mode__content
    ) :where(*) {
        color: CanvasText !important;
        -webkit-text-fill-color: currentColor !important;
    }

    #wcag-reading-mode-dialog :is(.wcag-reading-mode-content, .wcag-reading-mode__content) a,
    #wcag-reading-mode-dialog :is(.wcag-reading-mode-content, .wcag-reading-mode__content) a:visited {
        color: LinkText !important;
    }

    #wcag-reading-mode-dialog :is(.wcag-reading-mode-content, .wcag-reading-mode__content) mark {
        background: Highlight !important;
        color: HighlightText !important;
        -webkit-text-fill-color: HighlightText !important;
    }

    #wcag-reading-mode-dialog .wcag-reading-mode__table-scroll:focus-visible,
    #wcag-reading-mode-dialog .wcag-reading-mode__code-scroll:focus-visible {
        outline: 3px solid Highlight !important;
        box-shadow: none !important;
        forced-color-adjust: auto;
    }
}

#wcag-toolbar [data-wcag-speech-unavailable="true"][aria-disabled="true"],
#wcag-read-aloud-compact-player [data-wcag-speech-unavailable="true"][aria-disabled="true"] {
    cursor: not-allowed;
    opacity: .58;
}

#wcag-toolbar :where(button, input, select, textarea):disabled,
#wcag-toolbar :where(button, input, select, textarea)[aria-disabled="true"] {
    cursor: not-allowed !important;
    opacity: .55;
}

#wcag-toolbar .wcag-toolbar-choice-card:has(input:disabled) {
    border-style: dashed;
    background: var(--wcag-toolbar-surface, #ffffff) !important;
    background: color-mix(in srgb, var(--wcag-toolbar-surface) 82%, var(--wcag-toolbar-line)) !important;
    color: var(--wcag-toolbar-muted);
    cursor: not-allowed;
}

#wcag-toolbar .wcag-toolbar-choice-card:has(input:disabled) .wcag-toolbar-choice-card__check { display: none; }
#wcag-toolbar .wcag-toolbar-text-stepper button:disabled {
    background: var(--wcag-toolbar-surface, #ffffff) !important;
}
#wcag-toolbar .wcag-toolbar-footer a { display: inline-flex; min-height: 44px; align-items: center; }

@container wcag-toolbar (max-width: 688px) {
    #wcag-toolbar .wcag-focus-groups { grid-template-columns: minmax(0, 1fr); }
    #wcag-toolbar .wcag-toolbar-profile-utilities { grid-template-columns: minmax(0, 1fr); }
    #wcag-toolbar .wcag-toolbar-profile-storage > .wcag-toolbar-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container wcag-toolbar (max-width: 624px) {
    #wcag-toolbar .wcag-reading-mode-settings { grid-template-columns: minmax(0, 1fr); }
    #wcag-toolbar .wcag-toolbar-contrast-result { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #wcag-toolbar .wcag-toolbar-contrast-result__metric { border-inline: 0; border-inline-start: 1px solid var(--wcag-toolbar-line); }
    #wcag-toolbar .wcag-toolbar-contrast-result__status { grid-column: 1 / -1; border-top: 1px solid var(--wcag-toolbar-line); margin-top: 9.6px; padding-top: 9.6px; }
    #wcag-toolbar .wcag-toolbar-color-adjustments__grid { grid-template-columns: minmax(0, 1fr); }
    #wcag-toolbar .wcag-toolbar-color-adjustment { min-height: 88px; }
    #wcag-toolbar #wcag-toolbar-view-read-aloud .wcag-toolbar-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #wcag-toolbar #wcag-toolbar-view-read-aloud .wcag-toolbar-choice-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
    #wcag-toolbar .wcag-read-aloud-follow-actions { grid-template-columns: minmax(0, 1fr); }
}

@container wcag-toolbar (max-width: 576px) {
    #wcag-toolbar .wcag-toolbar-preset-profiles__grid { grid-template-columns: minmax(0, 1fr); }
    #wcag-toolbar .wcag-toolbar-profile-manager > .wcag-toolbar-setting-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
        gap: 8px;
    }
    #wcag-toolbar .wcag-toolbar-profile-manager > .wcag-toolbar-setting-row > :is(input, button) { width: 100%; }
    #wcag-toolbar .wcag-toolbar-profile-item { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #wcag-toolbar .wcag-toolbar-profile-item > input { grid-column: 1 / -1; width: 100%; min-width: 0; }
    #wcag-toolbar .wcag-toolbar-profile-item > button { width: 100%; }
    #wcag-toolbar .wcag-toolbar-profile-item__actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-column: 1 / -1;
        gap: 8px;
    }
    #wcag-toolbar .wcag-toolbar-profile-item__actions button { width: 100%; min-width: 0; }
}

@container wcag-toolbar (max-width: 432px) {
    #wcag-toolbar .wcag-reading-mode-start-row { grid-template-columns: minmax(0, 1fr); }
    #wcag-toolbar #wcag-reading-start { width: 100%; min-width: 0; justify-self: stretch; }
    #wcag-toolbar .wcag-toolbar-profile span { display: none; }
    #wcag-toolbar .wcag-toolbar-profile { width: 44px; min-width: 44px; flex-shrink: 0; justify-content: center; padding: 0 !important; }
    #wcag-toolbar .wcag-toolbar-preset-profiles__grid { grid-template-columns: minmax(0, 1fr); }
    #wcag-toolbar .wcag-toolbar-profile-storage > .wcag-toolbar-choice-grid { grid-template-columns: minmax(0, 1fr); }
    #wcag-toolbar .wcag-toolbar-dialog-actions { grid-template-columns: 52px 52px minmax(0, 1fr); }
    #wcag-toolbar .wcag-toolbar-dialog-actions:has(> [data-wcag-tool="keyboard-help"]:not([hidden])) { grid-template-columns: 52px 52px 52px minmax(0, 1fr); }
    #wcag-toolbar .wcag-toolbar-dialog-actions.wcag-read-aloud-footer-actions { grid-template-columns: minmax(0, 1fr); }
    #wcag-toolbar .wcag-read-aloud-footer-actions :is(.wcag-read-aloud-footer-status, [data-wcag-action="done"]) { display: none; }
    #wcag-toolbar .wcag-read-aloud-footer-actions > [data-wcag-action="stop-read-aloud"] { width: 100%; min-width: 0; }
    #wcag-toolbar .wcag-toolbar-dialog-actions .wcag-toolbar-hide-control,
    #wcag-toolbar .wcag-toolbar-dialog-actions #wcag-toolbar-hide { width: 52px; min-width: 52px; }
    #wcag-toolbar .wcag-toolbar-dialog-actions :is(#wcag-toolbar-reset, [data-wcag-tool="keyboard-help"], #wcag-toolbar-hide) span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    #wcag-toolbar .wcag-toolbar-custom-colors { padding: 12.8px; }
    #wcag-toolbar .wcag-toolbar-contrast-result { grid-template-columns: minmax(0, 1fr); }
    #wcag-toolbar .wcag-toolbar-contrast-result :is(.wcag-toolbar-contrast-result__sample, .wcag-toolbar-contrast-result__metric, .wcag-toolbar-contrast-result__status) { grid-column: 1; justify-content: flex-start; border: 0; margin: 0; padding: 8.8px 0; }
    #wcag-toolbar .wcag-toolbar-contrast-result :is(.wcag-toolbar-contrast-result__metric, .wcag-toolbar-contrast-result__status) { border-top: 1px solid var(--wcag-toolbar-line); }
    #wcag-toolbar .wcag-toolbar-contrast-result__metric { justify-content: space-between; }
    #wcag-toolbar .wcag-toolbar-color-mode-card { min-height: 132px; padding: 9.6px; }
    #wcag-toolbar .wcag-toolbar-color-mode-card:has(input:checked) { padding: calc(9.6px - 1px); }
    #wcag-toolbar .wcag-toolbar-color-adjustment {
        min-height: 84px;
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 9.6px;
        padding: 11.2px 12px;
    }
    #wcag-toolbar .wcag-toolbar-color-adjustment:has(input:checked) { padding: calc(11.2px - 1px) calc(12px - 1px); }
    #wcag-toolbar .wcag-toolbar-color-adjustment:has(input:disabled) { padding-top: 21.6px; }
    #wcag-toolbar .wcag-toolbar-color-adjustment__icon { width: 40px; height: 40px; }
    #wcag-toolbar .wcag-read-aloud-player__controls {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5.6px;
    }
    #wcag-toolbar .wcag-read-aloud-player__controls button {
        min-height: 64px;
        padding: 5.6px !important;
        font-size: 11.52px !important;
    }
    #wcag-toolbar .wcag-read-aloud-player__controls [data-wcag-action="read-aloud-toggle"] {
        width: 64px;
        height: 64px;
        min-height: 64px;
    }
    #wcag-toolbar .wcag-read-aloud-player__controls [data-wcag-action="stop-read-aloud"] { display: none; }
    #wcag-toolbar .wcag-read-aloud-player__controls :is(
        [data-wcag-action="read-aloud-previous"],
        [data-wcag-action="read-aloud-next"]
    ) > span,
    #wcag-toolbar .wcag-read-aloud-player__controls [data-wcag-toggle-label] {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
    #wcag-toolbar .wcag-read-aloud-player__segment-window { height: 108px; }
    #wcag-toolbar .wcag-read-aloud-player__segment { min-height: 100%; padding: 12px 13.6px !important; font-size: 15.2px; }
    #wcag-toolbar .wcag-read-aloud-settings { grid-template-columns: minmax(0, 1fr); }
    #wcag-toolbar .wcag-read-aloud-setting { min-height: 88px; }
    #wcag-toolbar .wcag-read-aloud-setting + .wcag-read-aloud-setting { border-top: 1px solid var(--wcag-toolbar-control-border, var(--wcag-toolbar-line)); border-inline-start: 0; }
    #wcag-toolbar .wcag-toolbar-view-header {
        top: -16px;
        margin: -16px -16px 16px;
        padding: 13.6px 16px 12px;
    }
    #wcag-toolbar .wcag-toolbar-view-description { display: none; }
    #wcag-toolbar .wcag-toolbar-back { width: 48px; min-width: 48px; padding: 0 !important; }
    #wcag-toolbar .wcag-toolbar-back span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
    #wcag-toolbar .wcag-toolbar-view-header__title-row { flex-wrap: wrap; gap: 1.6px 8.8px; }
    #wcag-toolbar .wcag-read-aloud-header-status { flex-basis: 100%; }
    #wcag-toolbar .wcag-toolbar-keyboard-row {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
        gap: 8px;
    }
    #wcag-toolbar .wcag-toolbar-overview-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
    #wcag-toolbar .wcag-toolbar-profile-manager > .wcag-toolbar-setting-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
        gap: 8px;
    }
    #wcag-toolbar .wcag-toolbar-profile-manager > .wcag-toolbar-setting-row > :is(input, button) { width: 100%; }
    #wcag-toolbar .wcag-toolbar-profile-item { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #wcag-toolbar .wcag-toolbar-profile-item > input { grid-column: 1 / -1; width: 100%; min-width: 0; }
    #wcag-toolbar .wcag-toolbar-profile-item > button { width: 100%; }
    #wcag-toolbar .wcag-toolbar-profile-item__actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-column: 1 / -1;
        gap: 8px;
    }
    #wcag-toolbar .wcag-toolbar-profile-item__actions button { width: 100%; min-width: 0; }
}

@container wcag-toolbar (max-width: 320px) {
    #wcag-toolbar .wcag-toolbar-header {
        gap: 8.8px;
    }

    #wcag-toolbar .wcag-toolbar-header-icon {
        display: none;
    }

    #wcag-toolbar .wcag-toolbar-title {
        overflow-wrap: normal;
        word-break: normal;
        hyphens: none;
    }

    #wcag-toolbar .wcag-toolbar-view-header {
        grid-template-columns: 48px 40px minmax(0, 1fr);
        gap: 9.6px;
    }

    #wcag-toolbar .wcag-toolbar-view-header__icon { width: 40px; height: 40px; }
    #wcag-toolbar .wcag-toolbar-view-header__icon svg { width: 28px; height: 28px; }

    #wcag-toolbar .wcag-toolbar-back {
        width: 48px;
        min-width: 48px;
        padding: 0 !important;
    }

    #wcag-toolbar .wcag-toolbar-back span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    #wcag-toolbar .wcag-toolbar-choice-grid { grid-template-columns: minmax(0, 1fr); }
    #wcag-toolbar #wcag-toolbar-view-read-aloud .wcag-toolbar-choice-grid { grid-template-columns: minmax(0, 1fr); }
    #wcag-toolbar #wcag-toolbar-view-read-aloud .wcag-toolbar-choice-grid > :last-child:nth-child(odd) { grid-column: auto; }
    #wcag-toolbar .wcag-toolbar-view-header__title-row { align-items: flex-start; flex-direction: column; gap: 1.6px; }
    #wcag-toolbar .wcag-toolbar-choice-card { overflow-wrap: anywhere; }
    #wcag-toolbar .wcag-toolbar-overview-grid > :last-child:nth-child(odd) { grid-column: auto; }
    #wcag-toolbar .wcag-toolbar-color-control { grid-template-columns: 52px minmax(0, 1fr); }
    #wcag-toolbar .wcag-toolbar-color-swatch { width: 52px; }
}

@media (forced-colors: active) {
    #wcag-toolbar .wcag-toolbar-profile-storage .wcag-toolbar-choice-card::before {
        border-color: ButtonText;
        background: Canvas;
        box-shadow: inset 0 0 0 3.2px Canvas;
        forced-color-adjust: auto;
    }

    #wcag-toolbar .wcag-toolbar-profile-storage .wcag-toolbar-choice-card:has(input:checked)::before {
        border-color: Highlight;
        background: Highlight;
    }

    #wcag-toolbar .wcag-toolbar-color-swatch__sample,
    #wcag-toolbar .wcag-toolbar-color-picker__preview > span,
    #wcag-toolbar .wcag-toolbar-contrast-result__sample > strong { forced-color-adjust: none; }
    #wcag-toolbar .wcag-toolbar-color-picker__controls input[type="range"] { forced-color-adjust: auto; }
    #wcag-toolbar .wcag-toolbar-color-picker { border-color: CanvasText; box-shadow: none; }
    html:not(.wcag-toolbar-pointer-focus) #wcag-toolbar #wcag-toolbar-view-reading-mode .wcag-reading-mode-option:has(input:focus-visible) {
        outline-color: Highlight !important;
        box-shadow: none !important;
        forced-color-adjust: auto;
    }
}

@media (max-width: 680px) {
    #wcag-read-aloud-compact-player {
        right: 8px;
        bottom: 8px;
        width: min(432px, calc(100vw - 16px));
        column-gap: 10.4px;
        row-gap: 8.8px;
        padding: 11.2px 16px 16px;
    }
}

@media (max-width: 520px) {
    #wcag-read-aloud-compact-player {
        --wcag-compact-control-size: 44px;
        --wcag-compact-control-icon-size: 20px;
        --wcag-compact-function-icon-size: 42px;
        --wcag-compact-function-icon-svg-size: 25.6px;
        right: 8px;
        bottom: 8px;
        left: 8px;
        width: auto;
        column-gap: 12px;
        row-gap: 10.4px;
        padding: 10px;
    }

    #wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__copy { gap: 3.2px; }
    #wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__copy h2 { font-size: 16px; }
    #wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__copy p,
    #wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__percent { font-size: 12px; }
    #wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__heading-row { gap: 5.6px; }
    #wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__status { padding: 2.4px 5.6px; font-size: 11px; }
    #wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__title { min-height: 15.6px; }
    #wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__progress { gap: 3.2px; margin-top: 2.4px; }
    #wcag-read-aloud-compact-player .wcag-read-aloud-compact-player__progress progress { height: 5.6px; }
}

/* The active mobile Read aloud controller is a persistent, non-modal bottom
   sheet. It deliberately has no backdrop or focus trap so the source page and
   explicit paragraph navigation remain available during playback. */
#wcag-read-aloud-compact-player.wcag-read-aloud-compact-player--mobile-sheet {
    --wcag-compact-control-size: 44px;
    --wcag-compact-control-icon-size: 20px;
    --wcag-compact-function-icon-size: 42px;
    --wcag-compact-function-icon-svg-size: 25.6px;
    width: auto;
    max-width: none;
    max-height: calc(100dvh - 8px);
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
    padding-top: 12px;
    padding-right: calc(16px + env(safe-area-inset-right, 0px));
    padding-bottom: calc(14.4px + env(safe-area-inset-bottom, 0px));
    padding-left: calc(16px + env(safe-area-inset-left, 0px));
    box-shadow: 0 -16px 40px rgb(15 23 42 / 24%);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

body.wcag-read-aloud-mobile-player-visible.wcag-read-aloud-mobile-player-trigger-bottom #wcag-toolbar-trigger-wrap {
    transform: translateY(calc(-1 * var(--wcag-read-aloud-mobile-player-offset, 0px))) !important;
}

/* Viewport fallback for mobile browsers without container-query support. */
@media (max-width: 620px) {
    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-profile-utilities { grid-template-columns: minmax(0, 1fr); }
    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-profile-storage > .wcag-toolbar-choice-grid { grid-template-columns: minmax(0, 1fr); }
    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-preset-profiles__grid { grid-template-columns: minmax(0, 1fr); }
    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-profile-manager > .wcag-toolbar-setting-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
        gap: 8px;
    }
    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-profile-manager > .wcag-toolbar-setting-row > :is(input, button) { width: 100%; }
    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-profile-item { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-profile-item > input { grid-column: 1 / -1; width: 100%; min-width: 0; }
    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-profile-item > button { width: 100%; }
    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-profile-item__actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-column: 1 / -1;
        gap: 8px;
    }
    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-profile-item__actions button { width: 100%; min-width: 0; }
}

/* Mobile-sheet chrome must not depend on container-query support. The explicit
   viewport fallback keeps the fixed header and footer usable in older iPhone
   Safari versions while the container rules above still govern embedded sizes. */
@media (max-width: 768px) {
    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-header {
        display: grid;
        grid-template-areas:
            "icon heading close"
            "profile profile profile";
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        min-height: 0;
        align-items: center;
        gap: 8.8px 11.2px;
        padding: 24.8px 16px 12px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-header-icon {
        grid-area: icon;
        width: 44px;
        height: 44px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-header-icon svg {
        width: 23.2px;
        height: 23.2px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-heading {
        display: block;
        min-width: 0;
        grid-area: heading;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-title {
        overflow-wrap: normal;
        word-break: normal;
        hyphens: manual;
        font-size: 16.8px;
        line-height: 1.2;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-description {
        display: none;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-profile {
        display: inline-flex;
        width: 100%;
        max-width: none;
        min-width: 0;
        min-height: 44px;
        grid-area: profile;
        justify-content: flex-start;
        margin: 0;
        border: 1px solid var(--wcag-toolbar-line) !important;
        background: var(--wcag-toolbar-surface) !important;
        padding: 7.2px 10.4px !important;
        text-align: start;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-profile > span {
        display: block;
        min-width: 0;
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet #wcag-toolbar-close {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        grid-area: close;
        padding: 0 !important;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet.is-detail-view .wcag-toolbar-header {
        grid-template-areas: "view close";
        grid-template-columns: minmax(0, 1fr) 44px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-header > .wcag-toolbar-view-header {
        min-width: 0;
        grid-area: view;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-view-description {
        display: none;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet [data-wcag-view-header="focus"] .wcag-toolbar-view-description {
        display: block;
        grid-column: 2 / -1;
        grid-row: 2;
        margin-top: 4px;
        font-size: 12.48px;
        line-height: 1.35;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet [data-wcag-view-header="focus"] .wcag-toolbar-view-header__copy {
        display: contents;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet [data-wcag-view-header="focus"] .wcag-toolbar-view-header__title-row {
        grid-column: 3;
        grid-row: 1;
        align-self: center;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-header:has([data-wcag-view-header="focus"]) > #wcag-toolbar-close {
        align-self: start;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-back {
        width: 44px;
        min-width: 44px;
        padding: 0 !important;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-back span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-footer-shell {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
        padding: 10.4px 12px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-dialog-actions[data-wcag-default-dialog-actions] {
        display: flex;
        width: 100%;
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-dialog-actions[data-wcag-default-dialog-actions] > #wcag-toolbar-reset,
    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-dialog-actions[data-wcag-default-dialog-actions] > [data-wcag-tool="keyboard-help"],
    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-dialog-actions[data-wcag-default-dialog-actions] > .wcag-toolbar-hide-control,
    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-dialog-actions[data-wcag-default-dialog-actions] #wcag-toolbar-hide {
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0 !important;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-dialog-actions[data-wcag-default-dialog-actions] > #wcag-toolbar-reset span,
    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-dialog-actions[data-wcag-default-dialog-actions] > [data-wcag-tool="keyboard-help"] span,
    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-dialog-actions[data-wcag-default-dialog-actions] #wcag-toolbar-hide span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-dialog-actions[data-wcag-default-dialog-actions] > #wcag-toolbar-done {
        width: auto;
        min-width: 0;
        margin-inline-start: auto;
        padding: 8.8px 13.6px !important;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-footer-shell > .wcag-toolbar-footer {
        min-height: 44px;
        padding: 0;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-footer a {
        min-height: 44px;
        padding: 4px 7.2px !important;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-content {
        padding: 14.4px 16px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet.wcag-toolbar-custom-scrollbar .wcag-toolbar-content {
        padding-inline-end: 23.2px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet.wcag-read-aloud-active [data-wcag-view-header="read-aloud"] {
        grid-template-columns: 44px 36px minmax(0, 1fr);
        gap: 8.8px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet [data-wcag-view-header="read-aloud"] .wcag-toolbar-view-header__icon {
        width: 36px;
        height: 36px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet [data-wcag-view-header="read-aloud"] .wcag-toolbar-view-header__icon svg {
        width: 28px;
        height: 28px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet [data-wcag-view-header="read-aloud"] .wcag-toolbar-view-header__title-row {
        flex-wrap: nowrap;
        align-items: center;
        gap: 8.8px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet [data-wcag-view-header="read-aloud"] .wcag-toolbar-view-title {
        font-size: 17.28px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-read-aloud-header-status {
        max-width: 100%;
        flex: 0 1 auto;
        flex-basis: auto;
        border: 1px solid var(--wcag-toolbar-success-border);
        border-radius: 999px;
        background: var(--wcag-toolbar-success-soft);
        padding: 2.88px 8px;
        font-size: 11.52px;
        line-height: 1.35;
        white-space: nowrap;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-read-aloud-player {
        gap: 12px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-read-aloud-player__heading p {
        font-size: 16px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-read-aloud-player__progress {
        gap: 5.6px 10.4px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-read-aloud-player__position {
        grid-column: 1;
        font-size: 13.12px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-read-aloud-player__progress progress {
        grid-column: 1;
        grid-row: 2;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-read-aloud-player__percentage {
        grid-column: 2;
        grid-row: 1 / span 2;
        min-width: 40px;
        align-self: end;
        padding-bottom: 0.8px;
        font-size: 13.76px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-read-aloud-player__segment-window {
        height: 108px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-read-aloud-player__segment {
        min-height: 100%;
        padding: 12.8px 14.4px !important;
        font-size: 15.36px;
        line-height: 1.45;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-read-aloud-player__controls {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-read-aloud-player__controls button,
    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-read-aloud-player__controls [data-wcag-action="read-aloud-toggle"] {
        display: inline-flex;
        width: 100%;
        height: 100%;
        min-height: 72px;
        justify-self: stretch;
        border-width: 1px !important;
        border-radius: 10.4px !important;
        padding: 7.2px 4px !important;
        font-size: 12px !important;
        line-height: 1.2;
        box-shadow: none !important;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-read-aloud-player__controls [data-wcag-action="read-aloud-toggle"] {
        border-color: var(--wcag-toolbar-control-accent) !important;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-read-aloud-player__controls button svg {
        width: 24.8px;
        height: 24.8px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-read-aloud-player__controls :is(
        [data-wcag-action="read-aloud-previous"],
        [data-wcag-action="read-aloud-next"]
    ) > span,
    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-read-aloud-player__controls [data-wcag-toggle-label] {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip: auto;
        clip-path: none;
        white-space: normal;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-read-aloud-player__controls [data-wcag-action="stop-read-aloud"] {
        display: inline-flex;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet [data-wcag-action="go-to-current-paragraph"] {
        width: 100%;
        min-height: 52px;
        padding: 7.2px 10.4px !important;
        font-size: 13.76px !important;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-read-aloud-follow-actions {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-read-aloud-follow-setting {
        min-height: 60px;
        padding: 7.2px 10.4px !important;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-focus-groups {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-focus-group {
        padding: 11.2px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-choice-card.wcag-focus-option {
        min-height: 148px;
        grid-template-rows: 68px auto;
        gap: 8px;
        padding: 8.8px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-choice-card.wcag-focus-option:has(input:checked) {
        padding: calc(8.8px - 1px);
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-focus-option__preview {
        height: 68px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-focus-option__preview-button {
        min-width: 60.8px;
        min-height: 32px;
        font-size: 11.52px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-dialog-actions.wcag-read-aloud-footer-actions {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: center;
        gap: 8px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-read-aloud-footer-status {
        display: inline-flex;
        min-height: 28px;
        grid-column: 1 / -1;
        white-space: normal;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-read-aloud-footer-status > span:last-child {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-read-aloud-footer-actions > button,
    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-read-aloud-footer-actions > [data-wcag-action="done"] {
        display: inline-flex;
        width: 100%;
        min-width: 0;
    }

    /* Some Android browsers expose a CSS viewport wider than the compact
       container-query threshold. Mobile cards must still keep the same dense,
       centred composition instead of inheriting the tall desktop geometry. */
    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        gap: 10.4px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-tool-card,
    #wcag-toolbar.wcag-toolbar-mobile-sheet [data-wcag-open-view].wcag-toolbar-tool-card {
        min-height: 100px;
        justify-content: center;
        gap: 6.4px;
        padding: 10.4px !important;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-tool-card.is-active,
    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-tool-card[aria-pressed="true"],
    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-tool-card[data-wcag-active="true"] {
        padding: calc(10.4px - 1px) !important;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-tool-card__icon {
        width: 36px;
        height: 36px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-tool-card__icon svg {
        width: 29.6px;
        height: 29.6px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-tool-card__title {
        font-size: 13.12px;
        line-height: 1.25;
    }
}

@media (max-width: 340px) {
    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-overview-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-overview-grid > :last-child:nth-child(odd) {
        grid-column: auto;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-read-aloud-follow-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-header {
        grid-template-areas:
            "heading close"
            "profile profile";
        grid-template-columns: minmax(0, 1fr) 44px;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-header-icon {
        display: none;
    }

    #wcag-toolbar.wcag-toolbar-mobile-sheet .wcag-toolbar-heading {
        text-align: center;
    }
}

/* ==========================================================================
   17. Fixed Toolbar theme surfaces

   Every Toolbar-owned surface receives `wcag-toolbar-theme-surface` and one
   of the two theme classes. These fixed tokens intentionally outrank legacy
   inline customization values while leaving visitor page-color preferences
   completely separate.
   ========================================================================== */

.wcag-toolbar-theme-surface.wcag-theme-light {
    color-scheme: light;
    --wcag-toolbar-bg: #ffffff !important;
    --wcag-toolbar-header-bg: #ffffff !important;
    --wcag-toolbar-footer-bg: #ffffff !important;
    --wcag-toolbar-surface: #ffffff !important;
    --wcag-toolbar-subtle: #f8fafc !important;
    --wcag-toolbar-text: #0f172a !important;
    --wcag-toolbar-ink: #0f172a !important;
    --wcag-toolbar-header-text: #0f172a !important;
    --wcag-toolbar-footer-text: #0f172a !important;
    --wcag-toolbar-muted: #475569 !important;
    --wcag-toolbar-line: #d8dee8 !important;
    --wcag-toolbar-control-border: #8795a8 !important;
    --wcag-toolbar-accent: #1d4ed8 !important;
    --wcag-toolbar-control-accent: #1d4ed8 !important;
    --wcag-toolbar-accent-strong: #1e40af !important;
    --wcag-toolbar-accent-hover: #1e40af !important;
    --wcag-toolbar-accent-soft: #eff6ff !important;
    --wcag-toolbar-accent-transparent: #eff6ff !important;
    --wcag-toolbar-accent-transparent-hover: #dbeafe !important;
    --wcag-toolbar-on-accent: #ffffff !important;
    --wcag-toolbar-link-color: #1e40af !important;
    --wcag-toolbar-header-action: #1d4ed8 !important;
    --wcag-toolbar-footer-link: #1e40af !important;
    --wcag-toolbar-action-color: #1d4ed8 !important;
    --wcag-toolbar-success: #047857 !important;
    --wcag-toolbar-success-soft: #ecfdf5 !important;
    --wcag-toolbar-success-border: #ccebdd !important;
    --wcag-toolbar-warning: #9a3412 !important;
    --wcag-toolbar-warning-soft: #fff7ed !important;
    --wcag-toolbar-warning-border: #c2410c !important;
    --wcag-toolbar-danger: #b42318 !important;
    --wcag-toolbar-danger-soft: #fff1f0 !important;
    --wcag-toolbar-danger-border: #d92d20 !important;
    --wcag-toolbar-focus-inner: #ffffff !important;
    --wcag-toolbar-focus-outer: #111827 !important;
    --wcag-toolbar-switch-off: #64748b !important;
    --wcag-toolbar-switch-off-thumb: #ffffff !important;
    --wcag-toolbar-control-thumb: #ffffff !important;
    --wcag-toolbar-floating-shadow: 0 16px 40px rgb(15 23 42 / 28%) !important;
    --wcag-toolbar-overlay-color: rgb(15 23 42 / 58%) !important;
}

.wcag-toolbar-theme-surface.wcag-theme-dark {
    color-scheme: dark;
    --wcag-toolbar-bg: #0f172a !important;
    --wcag-toolbar-header-bg: #0f172a !important;
    --wcag-toolbar-footer-bg: #0f172a !important;
    --wcag-toolbar-surface: #1e293b !important;
    --wcag-toolbar-subtle: #111827 !important;
    --wcag-toolbar-text: #f8fafc !important;
    --wcag-toolbar-ink: #f8fafc !important;
    --wcag-toolbar-header-text: #f8fafc !important;
    --wcag-toolbar-footer-text: #f8fafc !important;
    --wcag-toolbar-muted: #cbd5e1 !important;
    --wcag-toolbar-line: #718096 !important;
    --wcag-toolbar-control-border: #718096 !important;
    --wcag-toolbar-accent: #60a5fa !important;
    --wcag-toolbar-control-accent: #60a5fa !important;
    --wcag-toolbar-accent-strong: #93c5fd !important;
    --wcag-toolbar-accent-hover: #93c5fd !important;
    --wcag-toolbar-accent-soft: #172554 !important;
    --wcag-toolbar-accent-transparent: #172554 !important;
    --wcag-toolbar-accent-transparent-hover: #1e3a8a !important;
    --wcag-toolbar-on-accent: #0f172a !important;
    --wcag-toolbar-link-color: #93c5fd !important;
    --wcag-toolbar-header-action: #93c5fd !important;
    --wcag-toolbar-footer-link: #93c5fd !important;
    --wcag-toolbar-action-color: #60a5fa !important;
    --wcag-toolbar-success: #86efac !important;
    --wcag-toolbar-success-soft: #052e16 !important;
    --wcag-toolbar-success-border: #4ade80 !important;
    --wcag-toolbar-warning: #fde68a !important;
    --wcag-toolbar-warning-soft: #451a03 !important;
    --wcag-toolbar-warning-border: #facc15 !important;
    --wcag-toolbar-danger: #fca5a5 !important;
    --wcag-toolbar-danger-soft: #450a0a !important;
    --wcag-toolbar-danger-border: #f87171 !important;
    --wcag-toolbar-focus-inner: #0f172a !important;
    --wcag-toolbar-focus-outer: #93c5fd !important;
    --wcag-toolbar-switch-off: #718096 !important;
    --wcag-toolbar-switch-off-thumb: #f8fafc !important;
    --wcag-toolbar-control-thumb: #0f172a !important;
    --wcag-toolbar-floating-shadow: 0 16px 40px rgb(0 0 0 / 55%) !important;
    --wcag-toolbar-overlay-color: rgb(15 23 42 / 58%) !important;
    scrollbar-color: #718096 #0f172a;
}

#wcag-toolbar.wcag-toolbar-theme-surface {
    border-color: var(--wcag-toolbar-line) !important;
    background: var(--wcag-toolbar-bg) !important;
    color: var(--wcag-toolbar-ink) !important;
}

#wcag-toolbar.wcag-toolbar-mobile-sheet.wcag-toolbar-visual-viewport-frame.wcag-toolbar-theme-surface {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* The native dialog open state is authoritative. Keep this late and specific
   so host-theme dialog resets cannot leave only the modal overlay visible. */
#wcag-toolbar[open].wcag-toolbar-open.wcag-toolbar-theme-surface {
    display: flex !important;
    z-index: 100000 !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

#wcag-toolbar[open].wcag-toolbar-open.wcag-toolbar-theme-surface:not(.wcag-toolbar-mobile-sheet) {
    height: auto !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    transform: none !important;
}

#wcag-toolbar[open].wcag-toolbar-open.wcag-toolbar-theme-surface:not(.wcag-toolbar-mobile-sheet) > .wcag-toolbar-inner {
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding-bottom: 0 !important;
    transform: none !important;
}

:is(
    #wcag-read-aloud-compact-player,
    #wcag-toolbar-notice,
    #wcag-toolbar-score-tooltip,
    .wcag-toolbar-score-tooltip
).wcag-toolbar-theme-surface {
    border: 1px solid var(--wcag-toolbar-control-border) !important;
    background: var(--wcag-toolbar-surface) !important;
    color: var(--wcag-toolbar-ink) !important;
    box-shadow: var(--wcag-toolbar-floating-shadow) !important;
}

#wcag-read-aloud-compact-player.wcag-toolbar-theme-surface.wcag-read-aloud-compact-player--mobile-sheet {
    border-bottom: 0 !important;
    box-shadow: 0 -16px 40px rgb(15 23 42 / 24%) !important;
}

#wcag-read-aloud-compact-player.wcag-toolbar-theme-surface button {
    border-color: var(--wcag-toolbar-control-border) !important;
    background: var(--wcag-toolbar-surface) !important;
    color: var(--wcag-toolbar-ink) !important;
}

#wcag-read-aloud-compact-player.wcag-toolbar-theme-surface .wcag-read-aloud-follow-toggle[aria-pressed="true"] {
    border-color: var(--wcag-toolbar-control-accent) !important;
    background: var(--wcag-toolbar-accent-soft) !important;
    color: var(--wcag-toolbar-accent-strong) !important;
    box-shadow: none !important;
}

#wcag-read-aloud-compact-player.wcag-toolbar-theme-surface .wcag-read-aloud-compact-player__transport-controls [data-wcag-action="read-aloud-toggle"] {
    border-color: var(--wcag-toolbar-control-accent) !important;
    background: var(--wcag-toolbar-control-accent) !important;
    color: var(--wcag-toolbar-on-accent) !important;
}

@media (hover: hover) {
    #wcag-toolbar.wcag-toolbar-theme-surface :is(.wcag-toolbar-color-mode-card, .wcag-toolbar-color-adjustment):hover:not(:has(input:checked)):not(:has(input:disabled)) {
        border-color: var(--wcag-toolbar-control-accent) !important;
        background: var(--wcag-toolbar-accent-soft) !important;
        color: var(--wcag-toolbar-accent-strong) !important;
    }

    #wcag-toolbar.wcag-toolbar-theme-surface .wcag-read-aloud-player__controls button:hover:not(:disabled):not([data-wcag-action="read-aloud-toggle"]) {
        border-color: var(--wcag-toolbar-control-accent) !important;
        background: var(--wcag-toolbar-accent-soft) !important;
        color: var(--wcag-toolbar-accent-strong) !important;
        box-shadow: 0 5.6px 14.4px rgb(29 78 216 / 14%) !important;
    }

    #wcag-toolbar.wcag-toolbar-theme-surface .wcag-read-aloud-player__controls [data-wcag-action="read-aloud-toggle"]:hover:not(:disabled) {
        border-color: var(--wcag-toolbar-accent-hover) !important;
        background: var(--wcag-toolbar-accent-hover) !important;
        color: var(--wcag-toolbar-on-accent) !important;
        box-shadow: 0 5.6px 14.4px rgb(29 78 216 / 20%) !important;
    }

    #wcag-read-aloud-compact-player.wcag-toolbar-theme-surface .wcag-read-aloud-compact-player__controls button:hover:not(:disabled) {
        border-color: var(--wcag-toolbar-control-accent) !important;
        background: var(--wcag-toolbar-accent-soft) !important;
        color: var(--wcag-toolbar-accent-strong) !important;
        box-shadow: 0 5.6px 14.4px rgb(29 78 216 / 14%) !important;
    }

    #wcag-read-aloud-compact-player.wcag-toolbar-theme-surface .wcag-read-aloud-follow-toggle[aria-pressed="true"]:hover:not(:disabled) {
        border-color: var(--wcag-toolbar-accent-hover) !important;
        background: var(--wcag-toolbar-accent-soft) !important;
        color: var(--wcag-toolbar-accent-strong) !important;
        box-shadow: 0 5.6px 14.4px rgb(29 78 216 / 20%) !important;
    }

    #wcag-read-aloud-compact-player.wcag-toolbar-theme-surface .wcag-read-aloud-compact-player__transport-controls [data-wcag-action="read-aloud-toggle"]:hover:not(:disabled) {
        border-color: var(--wcag-toolbar-accent-hover) !important;
        background: var(--wcag-toolbar-accent-hover) !important;
        color: var(--wcag-toolbar-on-accent) !important;
    }
}

#wcag-toolbar-notice.wcag-toolbar-theme-surface .wcag-toolbar-notice__undo {
    border-color: var(--wcag-toolbar-control-accent) !important;
    background: var(--wcag-toolbar-control-accent) !important;
    color: var(--wcag-toolbar-on-accent) !important;
}

#wcag-toolbar.wcag-toolbar-theme-surface :where(button, input, select, textarea, a):focus-visible,
#wcag-read-aloud-compact-player.wcag-toolbar-theme-surface :where(button, input, select, textarea, a):focus-visible,
#wcag-toolbar.wcag-toolbar-theme-surface #wcag-toolbar-close:focus-visible,
#wcag-toolbar.wcag-toolbar-theme-surface .wcag-toolbar-choice-card:has(input:focus-visible),
#wcag-toolbar.wcag-toolbar-theme-surface .wcag-toolbar-view-title:focus-visible,
#wcag-toolbar.wcag-toolbar-theme-surface .wcag-toolbar-switch input:focus-visible + .wcag-toolbar-switch__track,
#wcag-toolbar.wcag-toolbar-theme-surface .wcag-toolbar-setting-row.wcag-toolbar-switch > input[type="checkbox"]:focus-visible,
#wcag-toolbar-notice.wcag-toolbar-theme-surface .wcag-toolbar-notice__undo:focus-visible {
    outline: 3px solid var(--wcag-toolbar-focus-inner) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 6px var(--wcag-toolbar-focus-outer) !important;
}

@media (forced-colors: active) {
    #wcag-toolbar.wcag-toolbar-custom-scrollbar .wcag-toolbar-content {
        scrollbar-width: auto;
        -ms-overflow-style: auto;
    }

    #wcag-toolbar.wcag-toolbar-custom-scrollbar .wcag-toolbar-content::-webkit-scrollbar {
        width: auto;
        height: auto;
        display: block;
    }

    #wcag-toolbar .wcag-toolbar-scrollbar {
        display: none !important;
    }

    .wcag-toolbar-theme-surface,
    .wcag-toolbar-theme-surface :where(button, input, select, textarea, a, progress, kbd) {
        forced-color-adjust: auto;
    }

    #wcag-toolbar.wcag-toolbar-theme-surface,
    #wcag-read-aloud-compact-player.wcag-toolbar-theme-surface,
    #wcag-toolbar-notice.wcag-toolbar-theme-surface,
    #wcag-toolbar-score-tooltip.wcag-toolbar-theme-surface,
    .wcag-toolbar-score-tooltip.wcag-toolbar-theme-surface,
    #wcag-toolbar.wcag-toolbar-theme-surface :where(
        .wcag-toolbar-header,
        .wcag-toolbar-content,
        .wcag-toolbar-view-header,
        .wcag-toolbar-footer-shell,
        .wcag-toolbar-tool-card,
        .wcag-toolbar-choice-card,
        .wcag-toolbar-setting-row,
        .wcag-toolbar-color-control,
        .wcag-toolbar-control-group,
        .wcag-toolbar-keyboard-row,
        .wcag-toolbar-key-combination kbd,
        .wcag-toolbar-preset-profile,
        .wcag-focus-group,
        .wcag-focus-option__preview,
        .wcag-read-aloud-player__segment-window,
        .wcag-read-aloud-follow-setting,
        .wcag-read-aloud-player__controls button
    ),
    #wcag-read-aloud-compact-player.wcag-toolbar-theme-surface button {
        border-color: CanvasText !important;
        background: Canvas !important;
        color: CanvasText !important;
        box-shadow: none !important;
    }

    #wcag-toolbar.wcag-toolbar-theme-surface :where(
        .wcag-toolbar-primary-action,
        .wcag-toolbar-tool-card.is-active,
        .wcag-toolbar-tool-card[aria-pressed="true"],
        .wcag-toolbar-preset-profile[aria-pressed="true"],
        .wcag-toolbar-choice-card:has(input:checked)
    ),
    #wcag-toolbar-notice.wcag-toolbar-theme-surface .wcag-toolbar-notice__undo {
        border-color: Highlight !important;
        background: Highlight !important;
        color: HighlightText !important;
    }

    #wcag-read-aloud-compact-player.wcag-toolbar-theme-surface .wcag-read-aloud-compact-player__transport-controls [data-wcag-action="read-aloud-toggle"],
    #wcag-read-aloud-compact-player.wcag-toolbar-theme-surface .wcag-read-aloud-follow-toggle[aria-pressed="true"] {
        border-color: Highlight !important;
        background: Highlight !important;
        color: HighlightText !important;
    }

    #wcag-toolbar .wcag-toolbar-choice-card:has(input:focus-visible),
    #wcag-toolbar .wcag-toolbar-view-title:focus-visible,
    #wcag-toolbar.wcag-toolbar-theme-surface :where(button, input, select, textarea, a):focus-visible,
    #wcag-read-aloud-compact-player.wcag-toolbar-theme-surface :where(button, input, select, textarea, a):focus-visible,
    #wcag-toolbar-notice.wcag-toolbar-theme-surface .wcag-toolbar-notice__undo:focus-visible {
        outline-color: Highlight !important;
        box-shadow: none !important;
        forced-color-adjust: auto;
    }

    #wcag-toolbar .wcag-toolbar-content[role="region"]:focus-visible {
        outline-color: Highlight !important;
        box-shadow: none !important;
        forced-color-adjust: auto;
    }

    html.wcag-strong-focus :where(.wcag-presentation-scope:is(a, area[href], button, input, select, textarea, summary, iframe, object, embed, audio[controls], video[controls], [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"])), .wcag-presentation-scope :where(a, area[href], button, input, select, textarea, summary, iframe, object, embed, audio[controls], video[controls], [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"]))):focus-visible,
    html.wcag-emphasize-current-control :where(.wcag-presentation-scope:is(a, area[href], button, input, select, textarea, summary, iframe, object, embed, audio[controls], video[controls], [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"])), .wcag-presentation-scope :where(a, area[href], button, input, select, textarea, summary, iframe, object, embed, audio[controls], video[controls], [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"]))):focus-visible {
        outline: 3px solid Highlight !important;
        outline-offset: 3px !important;
        box-shadow: none !important;
        transition: none !important;
        forced-color-adjust: auto;
    }

    #wcag-toolbar .wcag-toolbar-setting-row.wcag-toolbar-switch > input[type="checkbox"],
    #wcag-toolbar .wcag-focus-option__control > input[type="checkbox"] {
        appearance: auto;
        background: Canvas !important;
        forced-color-adjust: auto;
    }

    #wcag-toolbar .wcag-read-aloud-follow-setting__track {
        border-color: CanvasText;
        background: Canvas;
        forced-color-adjust: auto;
    }

    #wcag-toolbar .wcag-read-aloud-follow-toggle[aria-pressed="true"] .wcag-read-aloud-follow-setting__track {
        border-color: Highlight;
        background: Highlight;
    }
}

@media (prefers-reduced-motion: reduce) {
    #wcag-toolbar .wcag-toolbar-scrollbar,
    #wcag-toolbar .wcag-toolbar-scrollbar__thumb {
        transition: none !important;
    }
}

/* WebKit can expose :focus-visible after a programmatic focus transfer that
 * follows touch input. Keep the DOM focus handoff, but reserve the visual ring
 * for keyboard modality; the class is removed before every keyboard event. */
html.wcag-toolbar-pointer-focus #wcag-toolbar-trigger:focus,
html.wcag-toolbar-pointer-focus #wcag-toolbar :where(button, input, select, textarea, a, [tabindex]):focus,
html.wcag-toolbar-pointer-focus #wcag-read-aloud-compact-player :where(button, input, select, textarea, a, [tabindex]):focus,
html.wcag-toolbar-pointer-focus #wcag-toolbar-notice :where(button, a, [tabindex]):focus,
html.wcag-toolbar-pointer-focus #wcag-toolbar-restore:focus,
html.wcag-toolbar-pointer-focus #wcag-toolbar .wcag-toolbar-choice-card:has(input:focus),
html.wcag-toolbar-pointer-focus #wcag-toolbar .wcag-switch-input:focus + .wcag-switch-slider,
html.wcag-toolbar-pointer-focus #wcag-toolbar .wcag-switch-input:focus + .wcag-switch-card,
html.wcag-toolbar-pointer-focus #wcag-toolbar .wcag-toolbar-switch input:focus + .wcag-toolbar-switch__track,
html.wcag-toolbar-pointer-focus #wcag-toolbar .wcag-toolbar-setting-row.wcag-toolbar-switch > input[type="checkbox"]:focus {
    outline: none !important;
    box-shadow: none !important;
}
