:root {
    --ll-a11y-text-scale: 1;
}

html,
body {
    font-size: calc(16px * var(--ll-a11y-text-scale));
}

html[data-ll-contrast='high'] {
    filter: contrast(1.35);
}

html[data-ll-contrast='invert'] {
    filter: invert(1) hue-rotate(180deg);
}

html[data-ll-contrast='desaturate'] {
    filter: saturate(0.3);
}

html.ll-a11y-spacing-wide body * {
    letter-spacing: 0.08em !important;
    word-spacing: 0.12em !important;
}

html.ll-a11y-line-height-wide body * {
    line-height: 1.8 !important;
}

html.ll-a11y-highlight-links a {
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 2px !important;
}

html.ll-a11y-highlight-focus *:focus-visible {
    outline: 3px solid #ffc400 !important;
    outline-offset: 2px !important;
}

html.ll-a11y-pause-animations *,
html.ll-a11y-pause-animations *::before,
html.ll-a11y-pause-animations *::after {
    animation-play-state: paused !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
}

html.ll-a11y-readable-font body,
html.ll-a11y-readable-font input,
html.ll-a11y-readable-font button,
html.ll-a11y-readable-font textarea,
html.ll-a11y-readable-font select {
    font-family: Arial, Helvetica, sans-serif !important;
}

.ll-skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 99999;
    background: #111;
    color: #fff;
    padding: 8px 10px;
    border-radius: 4px;
    transform: translateY(-200%);
}

.ll-skip-link:focus {
    transform: translateY(0);
}

.ll-accessibility {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 99998;
    font-size: 16px !important;
    line-height: 1.4 !important;
    letter-spacing: normal;
    word-spacing: normal;
    font-family: "Helvetica Neue", Arial, sans-serif !important;
}

.ll-accessibility *,
.ll-accessibility *::before,
.ll-accessibility *::after {
    box-sizing: border-box;
    font-size: inherit !important;
    line-height: inherit !important;
}

.ll-accessibility__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    cursor: pointer;
    background: #0a2540;
    color: #fff;
    font-weight: 700;
}

.ll-accessibility__trigger svg {
    display: block;
}

.ll-accessibility__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ll-accessibility__panel {
    width: min(90vw, 360px);
    background: #fff;
    color: #111;
    margin-top: 10px;
    border-radius: 10px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.2);
    padding: 14px;
}

.ll-accessibility__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ll-accessibility__header h2 {
    margin: 0;
    font-size: 20px;
}

.ll-accessibility__controls {
    display: grid;
    gap: 10px;
}

.ll-accessibility__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ll-accessibility__row button,
.ll-accessibility__row select,
.ll-accessibility__header button,
.ll-accessibility__reset {
    border: 1px solid #d6d6d6;
    border-radius: 6px;
    background: #fff;
    padding: 6px 8px;
    cursor: pointer;
}

.ll-accessibility__option.is-active {
    background: #0a2540 !important;
    border-color: #0a2540 !important;
    color: #fff !important;
}

.ll-accessibility__reset {
    margin-top: 12px;
    width: 100%;
}

/* Keep the widget UI stable while page-level a11y transforms apply. */
html.ll-a11y-spacing-wide .ll-accessibility,
html.ll-a11y-spacing-wide .ll-accessibility * {
    letter-spacing: normal !important;
    word-spacing: normal !important;
}

html.ll-a11y-line-height-wide .ll-accessibility,
html.ll-a11y-line-height-wide .ll-accessibility * {
    line-height: 1.4 !important;
}

html.ll-a11y-readable-font .ll-accessibility,
html.ll-a11y-readable-font .ll-accessibility * {
    font-family: "Helvetica Neue", Arial, sans-serif !important;
}

/* Keep control sizing fixed when global text scaling is enabled. */
html .ll-accessibility select,
html .ll-accessibility option,
html .ll-accessibility button,
html .ll-accessibility label,
html .ll-accessibility span,
html .ll-accessibility h2 {
    font-size: 16px !important;
    line-height: 1.4 !important;
}
