/* Hide legacy Negishim / old accessibility button */
.accessibility_component,
.accessibility_co,
.btn_accessibility,
.accessibility_component .btn_accessibility,
#accessibilityDiv,
.nagishim-accessiblity,
[class*="accessibility_pro"] {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* New accessibility widget */
#s4u-a11y-root {
    position: fixed;
    left: 16px;
    bottom: 20px;
    z-index: 2147483000;
    font-family: 'Heebo', 'Segoe UI', Tahoma, Arial, sans-serif;
    direction: rtl;
    -webkit-user-select: none;
    user-select: none;
}

#s4u-a11y-btn {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: #1e88e5;
    color: #fff;
    box-shadow: 0 3px 10px rgba(30, 136, 229, 0.45);
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    touch-action: none;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

#s4u-a11y-btn:hover,
#s4u-a11y-btn:focus {
    background: #1565c0;
    box-shadow: 0 4px 14px rgba(21, 101, 192, 0.5);
    outline: none;
}

#s4u-a11y-btn.s4u-dragging {
    cursor: grabbing;
    opacity: 0.92;
}

#s4u-a11y-btn svg {
    width: 22px;
    height: 22px;
    fill: #fff;
    pointer-events: none;
}

#s4u-a11y-panel {
    display: none;
    position: absolute;
    bottom: 52px;
    left: 0;
    width: min(240px, calc(100vw - 24px));
    max-height: min(70vh, 420px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border: 1px solid rgba(30, 136, 229, 0.25);
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(20, 40, 80, 0.18);
    padding: 12px;
    color: #243041;
    box-sizing: border-box;
    z-index: 1;
}

#s4u-a11y-panel.open {
    display: block;
}

@media (max-width: 575px) {
    #s4u-a11y-btn {
        width: 48px;
        height: 48px;
    }

    #s4u-a11y-btn svg {
        width: 24px;
        height: 24px;
    }
}

#s4u-a11y-panel h3 {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 700;
    color: #1565c0;
}

#s4u-a11y-panel .s4u-a11y-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

#s4u-a11y-panel button.s4u-opt {
    border: 1px solid #d5e3f5;
    background: #f5f9fd;
    border-radius: 8px;
    padding: 8px 6px;
    font-size: 13px;
    cursor: pointer;
    color: #243041;
    transition: background 0.15s ease, border-color 0.15s ease;
}

#s4u-a11y-panel button.s4u-opt:hover,
#s4u-a11y-panel button.s4u-opt.active {
    background: #e3f0fc;
    border-color: #1e88e5;
    color: #0d47a1;
}

#s4u-a11y-panel .s4u-a11y-link {
    display: block;
    margin-top: 10px;
    text-align: center;
    font-size: 13px;
    color: #1565c0;
    text-decoration: none;
}

#s4u-a11y-panel .s4u-a11y-link:hover {
    text-decoration: underline;
}

/* Page states */
html.s4u-a11y-contrast,
html.s4u-a11y-contrast body {
    background: #000 !important;
    color: #fff !important;
}

html.s4u-a11y-contrast a {
    color: #ffe066 !important;
}

html.s4u-a11y-grayscale body {
    filter: grayscale(1);
}

html.s4u-a11y-underline a {
    text-decoration: underline !important;
}

html.s4u-a11y-readable body,
html.s4u-a11y-readable body * {
    letter-spacing: 0.04em !important;
    word-spacing: 0.08em !important;
    line-height: 1.7 !important;
}
