html {
    font-size: calc(100% * var(--ttm-af-font-scale, 1));
}

html.ttm-af-font-active {
    font-size: calc(100% * var(--ttm-af-font-scale, 1)) !important;
}

html.ttm-af-font-active body {
    font-size: 1em !important;
}

html.ttm-af-line body,
html.ttm-af-letter body,
html.ttm-af-word body {
    line-height: calc(1.5 + var(--ttm-af-line-height, 0));
    letter-spacing: var(--ttm-af-letter-spacing, normal);
    word-spacing: var(--ttm-af-word-spacing, normal);
}

html.ttm-af-dyslexia body,
html.ttm-af-dyslexia body :where(p, li, span, a, button, label, input, textarea, select) {
    font-family: "OpenDyslexic", "Comic Sans MS", "Segoe UI", sans-serif !important;
}

html.ttm-af-contrast-light {
    filter: brightness(1.08) contrast(1.08);
}

html.ttm-af-contrast-dark {
    filter: invert(1) hue-rotate(180deg);
}

html.ttm-af-contrast-dark img,
html.ttm-af-contrast-dark video,
html.ttm-af-contrast-dark iframe,
html.ttm-af-contrast-dark picture {
    filter: invert(1) hue-rotate(180deg);
}

html.ttm-af-contrast-high {
    filter: contrast(1.45);
}

html.ttm-af-gray {
    filter: grayscale(1);
}

html.ttm-af-invert {
    filter: invert(1);
}

html.ttm-af-blueLight {
    filter: sepia(0.25) saturate(1.05) brightness(1.02);
}

html.ttm-af-sat-low {
    filter: saturate(0.45);
}

html.ttm-af-sat-high {
    filter: saturate(1.55);
}

html.ttm-af-cb-protanopia {
    filter: url("#ttm-af-protanopia");
}

html.ttm-af-cb-deuteranopia {
    filter: url("#ttm-af-deuteranopia");
}

html.ttm-af-cb-tritanopia {
    filter: url("#ttm-af-tritanopia");
}

html.ttm-af-hideImages :is(
    img,
    video,
    picture,
    svg,
    canvas,
    iframe[src*="youtube"],
    iframe[src*="vimeo"],
    [style*="background-image"],
    .w-background-video,
    figure
) {
    visibility: hidden !important;
}

html.ttm-af-textColor body,
html.ttm-af-textColor body :where(p, li, span, a, button, label, input, textarea, select, td, th, div:not([class*="heading"])) {
    color: var(--ttm-af-text-color) !important;
}

html.ttm-af-titleColor :is(h1, h2, h3, h4, h5, h6, [role="heading"]) {
    color: var(--ttm-af-title-color) !important;
}

html.ttm-af-bgColor,
html.ttm-af-bgColor body {
    background-color: var(--ttm-af-bg-color) !important;
}

html.ttm-af-links a {
    outline: 2px solid #ffbf00 !important;
    outline-offset: 2px !important;
    text-decoration: underline !important;
}

html.ttm-af-headings :is(h1, h2, h3, h4, h5, h6) {
    outline: 2px solid #174ea6 !important;
    outline-offset: 3px !important;
}

html.ttm-af-reading {
    max-width: 75ch;
    margin-inline: auto;
}

html.ttm-af-focus :is(header, footer, nav, aside) {
    opacity: 0.22;
}

html.ttm-af-motion *,
html.ttm-af-motion *::before,
html.ttm-af-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
}

html.ttm-af-cursor body > :not(ttm-accessflow-toolbar),
html.ttm-af-cursorContrast body > :not(ttm-accessflow-toolbar) {
    cursor: none !important;
}

ttm-accessflow-toolbar,
ttm-accessflow-toolbar * {
    cursor: pointer !important;
}

#ttm-af-cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    width: 44px;
    height: 44px;
    border: 3px solid #174ea6;
    border-radius: 50%;
    background: rgba(23, 78, 166, 0.18);
    pointer-events: none;
    z-index: 2147482998;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
}

#ttm-af-cursor-ring.contrast {
    border-color: #ffbf00;
    background: rgba(0, 0, 0, 0.72);
    box-shadow: 0 0 0 2px #ffffff;
}

#ttm-af-ruler {
    position: fixed;
    left: 0;
    right: 0;
    top: -2px;
    height: 4px;
    background: #174ea6;
    opacity: 0.75;
    z-index: 2147482999;
    pointer-events: none;
}

#ttm-af-magnifier-lens {
    position: fixed;
    top: 0;
    left: 0;
    width: min(280px, calc(100vw - 24px));
    max-height: 120px;
    padding: 10px 12px;
    border: 2px solid #174ea6;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.96);
    color: #171923;
    font: 18px/1.45 system-ui, sans-serif;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    pointer-events: none;
    z-index: 2147482999;
    transform: translate(-50%, calc(-100% - 16px));
    overflow: hidden;
    word-break: break-word;
}

@media (prefers-color-scheme: dark) {
    #ttm-af-magnifier-lens {
        background: rgba(23, 25, 35, 0.96);
        color: #f5f7fb;
    }
}
