/* ========================
   WIDGET CONTAINER
========================= */
#a11y-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;

    font-family: system-ui, Arial, sans-serif;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 10px;

    cursor: grab;
}

/* dragging state */
#a11y-widget:active {
    cursor: grabbing;
}

/* ========================
   TOGGLE BUTTON
========================= */
#a11y-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #005ea5;
    color: #fff;
    border: none;
    font-size: 20px;

    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
/* ========================
   PANEL (FIXED + RELIABLE)
========================= */
#a11y-panel {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 10000;

    width: 300px;
    max-height: 70vh;
    overflow-y: auto;

    background: #fff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);

    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: 0.2s ease;
}

#a11y-panel.open {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

/* ========================
   BUTTONS
========================= */
#a11y-panel button {
    width: 100%;
    margin: 6px 0;
    padding: 10px;

    border-radius: 6px;
    border: 1px solid #ccc;

    background: #f5f5f5;
    cursor: pointer;
    font-size: 14px;
}

#a11y-panel button:hover {
    background: #e8e8e8;
}

/* ========================
   FOCUS
========================= */
button:focus {
    outline: 3px solid #ffbf47;
    outline-offset: 2px;
}

/* ========================
   MODES
========================= */
.large-text {
    font-size: 1.4rem;
}

.readable-font {
    font-family: Verdana, Arial, sans-serif;
}

body.high-contrast {
    background: #000 !important;
    color: #fff !important;
}

body.high-contrast a {
    color: #00ffff !important;
}

.reduce-motion * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

.calm-mode {
    background: #f0f8ff !important;
}

/* ========================
   TEXT HIGHLIGHTING
========================= */
.tts-highlight {
    background: #fff3a0 !important;
    color: #000 !important;
    transition: background 0.2s ease;
}

/* word highlight */
.tts-word-active {
    background: yellow !important;
    color: black !important;
    padding: 2px;
    border-radius: 3px;
}