:root {
    --bmah-main-color: #000000;
    --bmah-font-color: #1d1d1f;
    --bmah-font-color-light: #ffffff;
    --bmah-bg-color: #f9f9f9;
    --bmah-bg-color-alt: #f0f0f0;
    --bmah-border-color: #e5e5e5;
    --bmah-active-color: #e8e8ed;
    --bmah-active-accent: #0066cc;
    --bmah-menu-width: 320px;
    --bmah-button-size: 56px;
    --bmah-border-radius: 16px;
    --bmah-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --bmah-menu-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    --bmah-z-index: 2147483647;
}

#bmah-widget-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
}

#bmah-widget-container * {
    box-sizing: border-box;
}

#bmah-widget-container #bmah-accessibility-button {
    width: var(--bmah-button-size);
    height: var(--bmah-button-size);
    border: none;
    border-radius: 50%;
    box-shadow: var(--bmah-box-shadow);
    background-color: var(--bmah-main-color);
    cursor: pointer;
    position: fixed;
    z-index: var(--bmah-z-index);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s ease;
    padding: 0;
}

#bmah-widget-container #bmah-accessibility-button:hover {
    transform: scale(1.1);
}

#bmah-widget-container #bmah-accessibility-button.active-main {
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.1);
}

#bmah-widget-container #bmah-accessibility-button svg {
    width: 28px;
    height: 28px;
    fill: var(--bmah-font-color-light);
}

#bmah-widget-container #bmah-accessibility-menu {
    width: var(--bmah-menu-width);
    position: fixed;
    background-color: var(--bmah-bg-color);
    border: 1px solid var(--bmah-border-color);
    border-radius: var(--bmah-border-radius);
    box-shadow: var(--bmah-menu-shadow);
    z-index: var(--bmah-z-index);
    display: none;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(10px) scale(0.98);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#bmah-widget-container #bmah-accessibility-menu.open {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
}

#bmah-widget-container .bmah-menu-header {
    padding: 16px;
    background-color: var(--bmah-bg-color);
    color: var(--bmah-font-color);
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid var(--bmah-border-color);
    margin: 0;
}

#bmah-widget-container .bmah-menu-description {
    background-color: var(--bmah-bg-color-alt);
    font-size: 13px;
    color: #666;
    padding: 12px 16px;
    border-bottom: 1px solid var(--bmah-border-color);
    margin: 0;
    line-height: 1.4;
}

#bmah-widget-container .bmah-menu-footer {
    border-top: 1px solid var(--bmah-border-color);
    font-size: 11px;
    padding: 10px;
    background-color: var(--bmah-bg-color-alt);
    color: #888;
    text-align: center;
    margin: 0;
}

#bmah-widget-container .bmah-menu-footer a {
    color: var(--bmah-active-accent);
    text-decoration: none;
    font-weight: 500;
}

#bmah-widget-container .bmah-menu-footer a:hover {
    text-decoration: underline;
}

#bmah-widget-container .bmah-menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px;
    max-height: 60vh;
    overflow-y: auto;
}

#bmah-widget-container .bmah-menu-item {
    background: #ffffff;
    border: 1px solid var(--bmah-border-color);
    border-radius: 8px;
    padding: 12px 10px;
    text-align: center;
    font-size: 13px;
    cursor: pointer;
    color: var(--bmah-font-color);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#bmah-widget-container .bmah-menu-item:hover {
    background-color: #f5f5f5;
    border-color: #d0d0d0;
}

#bmah-widget-container .bmah-menu-item.active {
    background-color: var(--bmah-active-color);
    border-color: var(--bmah-active-accent);
    color: var(--bmah-active-accent);
    font-weight: 600;
}

#bmah-widget-container .bmah-menu-item.active .bmah-icon svg {
    fill: var(--bmah-active-accent);
}

#bmah-widget-container .bmah-menu-item.bmah-full-width {
    grid-column: span 2;
    flex-direction: row;
}

#bmah-widget-container .bmah-menu-item .bmah-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#bmah-widget-container .bmah-menu-item .bmah-icon svg {
    width: 100%;
    height: 100%;
    fill: #555;
    transition: fill 0.2s ease;
}

/* Global Effect Classes */

html.bmah-high-contrast {
    filter: contrast(150%);
}

html.bmah-grayscale {
    filter: grayscale(100%);
}

html.bmah-protanopia {
    filter: url('#bmah-filter-protanopia') !important;
}

html.bmah-deuteranopia {
    filter: url('#bmah-filter-deuteranopia') !important;
}

html.bmah-tritanopia {
    filter: url('#bmah-filter-tritanopia') !important;
}

html.bmah-hide-images img,
html.bmah-hide-images video,
html.bmah-hide-images canvas,
html.bmah-hide-images [role="img"] {
    opacity: 0 !important;
    visibility: hidden !important;
}

html.bmah-hide-images .bmah-hidden-bg {
    background-image: none !important;
    background-color: #eee !important;
}

html.bmah-dyslexia-font {
    font-family: "Comic Sans MS", "Chalkboard SE", "Comic Neue", sans-serif !important;
}

html.bmah-dyslexia-font * {
    font-family: inherit !important;
    line-height: 1.6 !important;
    letter-spacing: 0.05em !important;
}

html.bmah-link-highlight a,
html.bmah-link-highlight button,
html.bmah-link-highlight [role="button"],
html.bmah-link-highlight input[type="submit"],
html.bmah-link-highlight input[type="button"] {
    text-decoration: underline !important;
    font-weight: bold !important;
    background-color: #ffeb3b !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
}

html.bmah-stop-projects * {
    animation: none !important;
    transition: none !important;
}

#bmah-reading-guide {
    position: fixed;
    left: 0;
    width: 100%;
    height: 30px;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 2147483646;
    display: none;
    border-top: 2px solid yellow;
    border-bottom: 2px solid yellow;
}

html.bmah-reading-guide-active #bmah-reading-guide {
    display: block;
}