html,
body {
    transform: none !important;
    filter: none !important;
}

/* ── Floating trigger button ── */
#acc-trigger {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 10000;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    /* background: #1a3a6b; */
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    transition: background 0.2s, transform 0.15s;
}
#acc-trigger:hover {
    background: #254f96;
    transform: scale(1.07);
}
#acc-trigger:focus-visible {
    outline: 3px solid #FFD700;
    outline-offset: 3px;
}

/* ── Overlay: hidden at all times (background stays scrollable) ── */
#acc-overlay {
    display: none;
}

/* ── Panel: slides in from LEFT ── */
#acc-panel {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: 100vh;
    background: #fff;
    z-index: 10002;
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
#acc-panel.acc-open {
    left: 0;
}

/* ── Panel header ── */
.acc-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 14px 14px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
    flex-shrink: 0;
}
.acc-panel-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    flex: 1;
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: 0.1px;
}
.acc-panel-close,
.acc-panel-reset {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}
.acc-panel-close { color: #e53e3e; }
.acc-panel-reset { color: #3b82f6; }
.acc-panel-close:hover { background: #fee2e2; }
.acc-panel-reset:hover { background: #eff6ff; }
.acc-panel-close:focus-visible,
.acc-panel-reset:focus-visible {
    outline: 2px solid #1a3a6b;
    outline-offset: 2px;
}

/* ── Options list ── */
.acc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
}
.acc-list li {
    border-bottom: 1px solid #f1f3f5;
}
.acc-list li:last-child {
    border-bottom: none;
}

/* ── Individual option button ── */
.acc-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 18px;
    background: #f9fafb;
    border: none;
    cursor: pointer;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    color: #2d3748;
    text-align: left;
    transition: background 0.15s, color 0.15s;
    line-height: 1.4;
}
.acc-item:hover {
    background: #eef2ff;
    color: #1a3a6b;
}
.acc-item:focus-visible {
    outline: 2px solid #1a3a6b;
    outline-offset: -2px;
    background: #eef2ff;
}
.acc-item[aria-checked="true"] {
    background: #1a3a6b;
    color: #fff;
}
.acc-item[aria-checked="true"] .acc-item-icon {
    color: #FFD700;
}
.acc-item[aria-checked="true"]:hover {
    background: #254f96;
}

.acc-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    flex-shrink: 0;
    color: #4a5568;
    transition: color 0.15s;
}
.acc-item-label {
    flex: 1;
    font-weight: 500;
}

/* ── Reading ruler ── */
#acc-reading-ruler {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    height: 40px;
    background: rgba(26, 58, 107, 0.15);
    border-top: 2px solid rgba(26, 58, 107, 0.5);
    border-bottom: 2px solid rgba(26, 58, 107, 0.5);
    pointer-events: none;
    z-index: 9999;
    transition: top 0.05s linear;
}
#acc-reading-ruler.acc-active {
    display: block;
}

/* ── Big cursor ── */
body.acc-big-cursor,
body.acc-big-cursor * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' stroke='%23fff' stroke-width='1' d='M4 3l16 10-8 1.5-4.5 7.5z'/%3E%3C/svg%3E") 0 0, auto !important;
}

/* ============================================================
   Body-level accessibility overrides
   Applied via data-acc-* attributes on <body>
   ============================================================ */

/* Font size is applied directly via document.documentElement.style.fontSize in JS.
   All rem/em-based sizes in your site will scale automatically. */

/* Text spacing */
body[data-acc-spacing="increase"] p,
body[data-acc-spacing="increase"] li,
body[data-acc-spacing="increase"] span,
body[data-acc-spacing="increase"] td,
body[data-acc-spacing="increase"] th,
body[data-acc-spacing="increase"] div {
    letter-spacing: 0.12em !important;
    word-spacing: 0.16em !important;
    line-height: 1.9 !important;
}
body[data-acc-spacing="decrease"] p,
body[data-acc-spacing="decrease"] li,
body[data-acc-spacing="decrease"] span,
body[data-acc-spacing="decrease"] td,
body[data-acc-spacing="decrease"] div {
    letter-spacing: -0.02em !important;
    word-spacing: -0.03em !important;
    line-height: 1.3 !important;
}

/* ── Invert colours & Grey hues ──────────────────────────────
   IMPORTANT: filters are applied to #acc-page-wrap (a div that
   wraps all page content EXCEPT the toolbar panel/trigger).
   This prevents the filter from creating a new stacking context
   on <body>, which would trap position:fixed elements and make
   the panel scroll with the page.
   ──────────────────────────────────────────────────────────── */

/* ============================================================
   VISUAL FILTER LAYERS
   Uses backdrop-filter instead of filter
   so fixed elements remain fixed
   ============================================================ */

#acc-page-wrap {
    position: relative;
    isolation: isolate;
}

/* Shared overlay base */
#acc-page-wrap::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
}

/* ── Invert only ── */
#acc-page-wrap[data-acc-invert="1"]::before {
    backdrop-filter: invert(1) hue-rotate(180deg);
    -webkit-backdrop-filter: invert(1) hue-rotate(180deg);
}

/* ── Greyscale only ── */
#acc-page-wrap[data-acc-greyscale="1"]::before {
    backdrop-filter: grayscale(100%);
    -webkit-backdrop-filter: grayscale(100%);
}

/* ── BOTH invert + greyscale ── */
#acc-page-wrap[data-acc-invert="1"][data-acc-greyscale="1"]::before {
    backdrop-filter: invert(1) hue-rotate(180deg) grayscale(100%);
    -webkit-backdrop-filter: invert(1) hue-rotate(180deg) grayscale(100%);
}

/* ============================================================
   Keep accessibility UI above overlay
   ============================================================ */

#acc-panel,
#acc-trigger,
#acc-reading-ruler {
    position: fixed !important;
    z-index: 999999 !important;

    isolation: isolate;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Underline links */
body[data-acc-underline="1"] a {
    text-decoration: underline !important;
    text-underline-offset: 3px !important;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 480px) {
    #acc-panel {
        width: 100vw;
        left: -100vw;
    }
    #acc-trigger {
        bottom: 16px;
        left: 16px;
        width: 46px;
        height: 46px;
    }
}