:root {
    --a11y-widget-primary: #005a9c;
    --a11y-widget-primary-dark: #003f6d;
    --a11y-widget-focus: #ffbf00;
}

.accessibility-widget {
    position: fixed;
    right: 24px;
    bottom: 96px;
    z-index: 10001;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.4;
}

.accessibility-widget button {
    font: inherit;
}

.accessibility-widget button:focus-visible {
    outline: 3px solid var(--a11y-widget-focus);
    outline-offset: 3px;
}

.accessibility-widget__trigger {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    padding: 10px 16px;
    border: 0;
    border-radius: 999px;
    background: var(--a11y-widget-primary);
    color: #fff;
    box-shadow: 0 5px 16px rgba(0, 48, 84, .28);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
}

.accessibility-widget__trigger:hover,
.accessibility-widget__trigger[aria-expanded="true"] {
    background: var(--a11y-widget-primary-dark);
}

.accessibility-widget__trigger svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.accessibility-widget__panel {
    position: absolute;
    right: 0;
    bottom: 60px;
    width: min(360px, calc(100vw - 32px));
    max-height: min(680px, calc(100vh - 120px));
    overflow-y: auto;
    padding: 18px;
    border: 1px solid #c8d3dd;
    border-radius: 16px;
    background: #fff;
    color: #172b3a;
    box-shadow: 0 12px 30px rgba(8, 37, 61, .27);
}

.accessibility-widget__panel[hidden] {
    display: none;
}

.accessibility-widget__panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #d9e1e7;
}

.accessibility-widget__eyebrow {
    margin: 0 0 3px;
    color: #426174;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.accessibility-widget__panel h2,
.accessibility-widget__panel h3 {
    margin: 0;
    color: #172b3a;
    font-family: inherit;
}

.accessibility-widget__panel h2 {
    font-size: 21px;
    font-weight: 700;
}

.accessibility-widget__panel h3 {
    font-size: 14px;
    font-weight: 700;
}

.accessibility-widget__close {
    display: inline-grid;
    width: 36px;
    height: 36px;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid #9aabb7;
    border-radius: 50%;
    background: #fff;
    color: #172b3a;
    cursor: pointer;
}

.accessibility-widget__close:hover {
    background: #edf4f8;
}

.accessibility-widget__close svg,
.accessibility-widget__option svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.accessibility-widget__controls {
    display: grid;
    gap: 15px;
    padding: 16px 0;
}

.accessibility-widget__group {
    display: grid;
    gap: 9px;
}

.accessibility-widget__button-row {
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    align-items: center;
    overflow: hidden;
    border: 1px solid #9aabb7;
    border-radius: 9px;
}

.accessibility-widget__button-row button {
    min-height: 40px;
    border: 0;
    background: #edf4f8;
    color: #123e61;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
}

.accessibility-widget__button-row button:hover:not(:disabled) {
    background: #d8e9f3;
}

.accessibility-widget__button-row button:disabled {
    color: #80909a;
    cursor: not-allowed;
}

.accessibility-widget__button-row output {
    padding: 0 6px;
    color: #172b3a;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

.accessibility-widget__button-row--cursor output {
    font-size: 12px;
}

.accessibility-widget__option,
.accessibility-widget__reset {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid #9aabb7;
    border-radius: 9px;
    background: #fff;
    color: #172b3a;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    text-align: left;
}

.accessibility-widget__option:hover,
.accessibility-widget__option[aria-pressed="true"] {
    border-color: var(--a11y-widget-primary);
    background: #e6f2f8;
    color: #003f6d;
}

.accessibility-widget__link-button {
    justify-self: start;
    padding: 0;
    border: 0;
    background: transparent;
    color: #005a9c;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.accessibility-widget__reset {
    width: 100%;
    justify-content: center;
    border-color: #005a9c;
    background: #005a9c;
    color: #fff;
}

.accessibility-widget__reset:hover {
    background: #003f6d;
}

.accessibility-widget__status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.accessibility-cursor {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2147483647;
    width: var(--a11y-cursor-size, 28px);
    height: var(--a11y-cursor-size, 28px);
    border: 3px solid #ffbf00;
    border-radius: 50%;
    background: rgba(0, 0, 0, .18);
    box-shadow: 0 0 0 2px #000;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.accessibility-cursor.is-visible {
    opacity: 1;
}

html[data-a11y-line-height="wide"] [data-a11y-readable] {
    line-height: 1.85 !important;
}

html[data-a11y-line-height="very-wide"] [data-a11y-readable] {
    line-height: 2.15 !important;
}

html.a11y-text-scale-active [data-a11y-readable] {
    font-size: var(--a11y-text-font-size) !important;
}

html[data-a11y-contrast="true"] body {
    background: #000 !important;
    color: #fff !important;
}

html[data-a11y-contrast="true"] body :where(h1, h2, h3, h4, h5, h6, p, li, a, button, input, textarea, select, label, legend, td, th, caption, figcaption, blockquote, small, summary, dt, dd, span) {
    color: #fff !important;
    text-shadow: none !important;
}

html[data-a11y-contrast="true"] body :where(section, article, aside, nav, header, footer, main, div, form, fieldset, table, tr, td, th, button, input, textarea, select) {
    border-color: #fff !important;
}

html[data-a11y-contrast="true"] body :where(section, article, aside, nav, header, footer, main, div, form, fieldset, table, tr, td, th, button, input, textarea, select):not(.accessibility-widget):not(.accessibility-widget *) {
    background-color: #000 !important;
    background-image: none !important;
}

html[data-a11y-contrast="true"] body a:not(.accessibility-widget *) {
    color: #ffdf4f !important;
    text-decoration: underline !important;
}

html[data-a11y-contrast="true"] body :focus-visible {
    outline: 3px solid #ffdf4f !important;
    outline-offset: 3px !important;
}

@media (max-width: 640px) {
    .accessibility-widget {
        right: 12px;
        bottom: 82px;
    }

    .accessibility-widget__trigger-text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .accessibility-widget__trigger {
        width: 50px;
        justify-content: center;
        padding: 10px;
    }

    .accessibility-widget__panel {
        bottom: 58px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .accessibility-widget *,
    .accessibility-cursor {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}
