.local-lamahuraanaccessibility {
    --lamahuraan-accent: #5b0f8f;
    --lamahuraan-panel-bg: #fff;
    --lamahuraan-panel-text: #1f2933;
    --lamahuraan-panel-muted: #52606d;
    --lamahuraan-panel-border: #d9e2ec;
    --lamahuraan-tile-bg: #f5f8fb;
    position: fixed;
    z-index: 1055;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.local-lamahuraanaccessibility[data-position="bottomright"] {
    right: 1rem;
    bottom: 1rem;
}

.local-lamahuraanaccessibility[data-position="bottomleft"] {
    left: 1rem;
    bottom: 1rem;
}

.local-lamahuraanaccessibility[data-position="topright"] {
    right: 1rem;
    top: 1rem;
}

.local-lamahuraanaccessibility[data-position="topleft"] {
    left: 1rem;
    top: 1rem;
}

.local-lamahuraanaccessibility__trigger {
    width: 4rem;
    height: 4rem;
    border: 0.25rem solid #fff;
    border-radius: 50%;
    background: var(--lamahuraan-accent);
    color: #fff;
    box-shadow: 0 0.75rem 1.75rem rgba(17, 24, 39, 0.28);
    cursor: pointer;
    display: grid;
    place-items: center;
}

.local-lamahuraanaccessibility__trigger:focus-visible,
.local-lamahuraanaccessibility button:focus-visible,
.local-lamahuraanaccessibility select:focus-visible {
    outline: 0.2rem solid #111827;
    outline-offset: 0.15rem;
}

.local-lamahuraanaccessibility__trigger-icon {
    font-weight: 700;
    letter-spacing: 0;
    font-size: 0.95rem;
}

.local-lamahuraanaccessibility__panel {
    position: absolute;
    width: min(26rem, calc(100vw - 2rem));
    max-height: min(576px, calc(100vh - 112px));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: var(--lamahuraan-panel-text);
    background: var(--lamahuraan-panel-bg);
    border: 0.1rem solid var(--lamahuraan-panel-border);
    border-radius: 0.5rem;
    box-shadow: 0 1.5rem 3.5rem rgba(15, 23, 42, 0.28);
}

.local-lamahuraanaccessibility[data-position="bottomright"] .local-lamahuraanaccessibility__panel,
.local-lamahuraanaccessibility[data-position="topright"] .local-lamahuraanaccessibility__panel {
    right: 0;
}

.local-lamahuraanaccessibility[data-position="bottomleft"] .local-lamahuraanaccessibility__panel,
.local-lamahuraanaccessibility[data-position="topleft"] .local-lamahuraanaccessibility__panel {
    left: 0;
}

.local-lamahuraanaccessibility[data-position="bottomright"] .local-lamahuraanaccessibility__panel,
.local-lamahuraanaccessibility[data-position="bottomleft"] .local-lamahuraanaccessibility__panel {
    bottom: 5rem;
}

.local-lamahuraanaccessibility[data-position="topright"] .local-lamahuraanaccessibility__panel,
.local-lamahuraanaccessibility[data-position="topleft"] .local-lamahuraanaccessibility__panel {
    top: 5rem;
}

.local-lamahuraanaccessibility__header {
    background: var(--lamahuraan-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
}

.local-lamahuraanaccessibility__header h2 {
    margin: 0;
    color: inherit;
    font-size: 1.05rem;
    line-height: 1.3;
}

.local-lamahuraanaccessibility__close {
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 50%;
    color: var(--lamahuraan-accent);
    background: #fff;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
}

.local-lamahuraanaccessibility__body {
    overflow: auto;
    padding: 1rem;
}

.local-lamahuraanaccessibility__section + .local-lamahuraanaccessibility__section {
    margin-top: 1rem;
}

.local-lamahuraanaccessibility__section h3 {
    margin: 0 0 0.6rem;
    font-size: 0.95rem;
    line-height: 1.3;
}

.local-lamahuraanaccessibility__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.local-lamahuraanaccessibility__tile,
.local-lamahuraanaccessibility__action {
    min-height: 3.1rem;
    border: 0.08rem solid var(--lamahuraan-panel-border);
    border-radius: 0.4rem;
    color: var(--lamahuraan-panel-text);
    background: var(--lamahuraan-tile-bg);
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.55rem 0.65rem;
    text-align: center;
}

.local-lamahuraanaccessibility__tile[aria-pressed="true"],
.local-lamahuraanaccessibility__action[aria-pressed="true"] {
    background: var(--lamahuraan-accent);
    border-color: var(--lamahuraan-accent);
    color: #fff;
}

.local-lamahuraanaccessibility__control {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0;
    border-bottom: 0.08rem solid var(--lamahuraan-panel-border);
}

.local-lamahuraanaccessibility__control span {
    font-weight: 600;
}

.local-lamahuraanaccessibility__control button {
    min-width: 2.2rem;
    min-height: 2.2rem;
    border: 0.08rem solid var(--lamahuraan-panel-border);
    border-radius: 0.35rem;
    background: #fff;
    cursor: pointer;
}

.local-lamahuraanaccessibility__select {
    width: 100%;
    min-height: 2.35rem;
    border: 0.08rem solid var(--lamahuraan-panel-border);
    border-radius: 0.35rem;
    background: #fff;
    color: var(--lamahuraan-panel-text);
}

.local-lamahuraanaccessibility__footer {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    border-top: 0.08rem solid var(--lamahuraan-panel-border);
    color: var(--lamahuraan-panel-muted);
    font-size: 0.75rem;
    line-height: 1.35;
}

.lamahuraan-reading-guide {
    position: fixed;
    left: 0;
    right: 0;
    height: 0.22rem;
    z-index: 1054;
    pointer-events: none;
    background: #facc15;
    box-shadow: 0 0 0 0.12rem rgba(0, 0, 0, 0.55);
}

.lamahuraan-reading-mask {
    position: fixed;
    inset: 0;
    z-index: 1053;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.68) 0,
        rgba(0, 0, 0, 0.68) calc(var(--lamahuraan-mask-y, 50vh) - 4rem),
        transparent calc(var(--lamahuraan-mask-y, 50vh) - 4rem),
        transparent calc(var(--lamahuraan-mask-y, 50vh) + 4rem),
        rgba(0, 0, 0, 0.68) calc(var(--lamahuraan-mask-y, 50vh) + 4rem),
        rgba(0, 0, 0, 0.68) 100%
    );
}

html.lamahuraan-readable-font body {
    font-family: Arial, Helvetica, sans-serif !important;
}

html.lamahuraan-dyslexia-font body {
    font-family: Verdana, Tahoma, Arial, sans-serif !important;
}

html.lamahuraan-highlight-links a {
    outline: 0.15rem solid #f59e0b !important;
    outline-offset: 0.12rem !important;
    background-color: rgba(254, 240, 138, 0.6) !important;
}

html.lamahuraan-highlight-titles h1,
html.lamahuraan-highlight-titles h2,
html.lamahuraan-highlight-titles h3,
html.lamahuraan-highlight-titles h4,
html.lamahuraan-highlight-titles h5,
html.lamahuraan-highlight-titles h6 {
    outline: 0.15rem solid #38bdf8 !important;
    outline-offset: 0.12rem !important;
}

html.lamahuraan-highlight-focus :focus {
    outline: 0.22rem solid #ef4444 !important;
    outline-offset: 0.18rem !important;
}

html.lamahuraan-highlight-hover *:hover {
    outline: 0.16rem solid #22c55e !important;
    outline-offset: 0.08rem !important;
}

html.lamahuraan-hide-images img,
html.lamahuraan-hide-images picture,
html.lamahuraan-hide-images svg,
html.lamahuraan-hide-images video {
    visibility: hidden !important;
}

html.lamahuraan-stop-animation *,
html.lamahuraan-stop-animation *::before,
html.lamahuraan-stop-animation *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001s !important;
}

html.lamahuraan-large-cursor,
html.lamahuraan-large-cursor * {
    cursor: crosshair !important;
}

html.lamahuraan-contrast-high {
    filter: contrast(1.45) !important;
}

html.lamahuraan-contrast-dark {
    background: #000 !important;
    filter: invert(1) hue-rotate(180deg) !important;
}

html.lamahuraan-contrast-light {
    filter: brightness(1.12) contrast(1.18) !important;
}

html.lamahuraan-monochrome {
    filter: grayscale(1) !important;
}

html.lamahuraan-invert {
    filter: invert(1) hue-rotate(180deg) !important;
}

html.lamahuraan-saturation-high {
    filter: saturate(1.7) !important;
}

html.lamahuraan-saturation-low {
    filter: saturate(0.45) !important;
}

html.lamahuraan-cb-protanopia {
    filter: sepia(0.35) saturate(0.75) hue-rotate(-25deg) !important;
}

html.lamahuraan-cb-deuteranopia {
    filter: sepia(0.25) saturate(0.7) hue-rotate(35deg) !important;
}

html.lamahuraan-cb-tritanopia {
    filter: sepia(0.25) saturate(0.8) hue-rotate(145deg) !important;
}

html.lamahuraan-read-mode main,
html.lamahuraan-read-mode #page-content,
html.lamahuraan-read-mode [role="main"] {
    max-width: 48rem !important;
    margin-left: auto !important;
    margin-right: auto !important;
    font-size: 1.08em !important;
    line-height: 1.75 !important;
}

html.lamahuraan-muted media,
html.lamahuraan-muted audio,
html.lamahuraan-muted video {
    volume: 0;
}

@media (max-width: 36rem) {
    .local-lamahuraanaccessibility {
        right: 0.75rem;
        bottom: 0.75rem;
        left: auto;
        top: auto;
    }

    .local-lamahuraanaccessibility__trigger {
        width: 3.5rem;
        height: 3.5rem;
    }

    .local-lamahuraanaccessibility__panel {
        position: fixed;
        left: 0.75rem;
        right: 0.75rem;
        bottom: 4.8rem;
        top: auto;
        width: auto;
        max-height: calc(100vh - 6rem);
    }
}
