/* Basic layout for the accessibility toolbar */
:root {
    --disa-accent: #57b7e5;
    /* match wheelchair icon */
    --disa-focus: #1a73e8;
    --disa-panel-bg: #ffffff;
    --disa-card-bg: #ffffff;
    --disa-card-border: #dfe3f7;
    --disa-shadow: 0 10px 25px rgba(24, 20, 61, .15);
}

.disa-toolbar {
    position: fixed;
    bottom: 16px;
    left: 16px;
    z-index: 999999;
    font-family: Arial, Helvetica, sans-serif;
}

.disa-toggle {
    background: var(--disa-accent);
    color: #fff;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--disa-shadow);
}

.disa-toggle:focus {
    outline: 3px solid var(--disa-focus);
    outline-offset: 2px;
}

.disa-toggle-icon {
    line-height: 1;
    display: block;
}

.disa-toggle-icon svg {
    width: 28px;
    height: 28px;
    display: block;
}

.disa-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.disa-panel {
    position: fixed;
    bottom: 86px;
    left: 8px;
    width: 320px;
    max-width: calc(100vw - 16px);
    background: var(--disa-panel-bg);
    color: #111;
    border-radius: 12px;
    border: 1px solid #e8ebfb;
    box-shadow: var(--disa-shadow);
    padding: 14px;
    overflow-y: auto;
    max-height: calc(100vh - 140px);
}

.disa-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #dde3fb;
    background: #fff;
    color: #3b3f66;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.disa-close:hover {
    background: #f6f8ff;
}

.disa-close:focus {
    outline: 3px solid var(--disa-focus);
    outline-offset: 2px;
}

.disa-section {
    margin-bottom: 12px;
}

.disa-section-title {
    margin: 2px 6px 10px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #495079;
}

.disa-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 10px;
}

.disa-card {
    background: var(--disa-card-bg);
    border: 1.5px solid var(--disa-card-border);
    border-radius: 12px;
    padding: 14px 10px;
    text-align: center;
    font-size: 12px;
    line-height: 1.25;
    cursor: pointer;
    transition: box-shadow .15s ease, border-color .15s ease, transform .05s ease;
}

.disa-card strong {
    display: block;
    margin-top: 6px;
}

.disa-card span {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    color: #3f3d56;
}

.disa-ico {
    font-size: 18px;
    line-height: 1;
}

.disa-ico::before {
    display: block;
}

/* Icons using emoji for portability */
.disa-ico-title::before {
    content: 'T';
    font-weight: 700;
}

.disa-ico-link::before {
    content: '\1F517';
}

.disa-ico-font::before {
    content: 'P';
    font-weight: 700;
}

.disa-ico-moon::before {
    content: '\1F319';
}

/* ðŸŒ™ */
.disa-ico-sun::before {
    content: '\1F506';
}

/* ðŸ”† */
.disa-ico-flag::before {
    content: '\1F6A9';
}

/* ðŸš© */
.disa-ico-sat-high::before {
    content: '\1F7E6';
}

/* ðŸŸ¦ */
.disa-ico-sat-low::before {
    content: '\25A2';
}

/* â–¢ */
.disa-ico-mono::before {
    content: '\26AA';
}

/* âšª */
.disa-ico-guide::before {
    content: '\1F4CF';
}

/* ðŸ“ */
.disa-ico-stop::before {
    content: '\25FC';
}

/* â—¼ */
.disa-ico-cursor::before {
    content: '\1F5B1';
}

/* ðŸ–± */
.disa-ico-tts::before {
    content: '\1F508';
}

/* ðŸ”ˆ */
.disa-ico-tts-hover::before {
    content: '\1F50A';
}

/* ðŸ”Š */
.disa-ico-play::before {
    content: '\25B6';
}

/* â–¶ */
.disa-ico-pause::before {
    content: '\23F8';
}

/* â¸ */
/* Stop uses .disa-ico-stop (â—¼) already */
.disa-card:focus {
    outline: none;
    border-color: var(--disa-focus);
    box-shadow: 0 0 0 3px rgba(76, 111, 255, .35);
}

.disa-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(24, 20, 61, .10);
}

.disa-card.active {
    border-color: var(--disa-accent);
    box-shadow: inset 0 0 0 2px var(--disa-accent);
}

.disa-fontsize {
    background: #fafbff;
    border-radius: 12px;
    border: 1px solid #e8ebfb;
    padding: 10px;
    margin: 0 6px 12px;
}

.disa-card-title {
    font-weight: 600;
    margin-bottom: 6px;
}

.disa-fontsize-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.disa-btn {
    background: #ffffff;
    border: 2px solid #dee5ff;
    color: #111;
    border-radius: 20px;
    width: 36px;
    height: 36px;
    font-size: 18px;
    cursor: pointer;
}

.disa-fontsize-label {
    font-weight: 700;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
}

.disa-fontsize-label:focus {
    outline: 3px solid var(--disa-focus);
    outline-offset: 2px;
}

/* Reading guide bar */
.disa-reading-guide {
    position: fixed;
    left: 0;
    width: 100vw;
    height: 42px;
    background: rgba(255, 205, 0, .25);
    pointer-events: none;
    z-index: 999998;
    display: none;
}

body.disa-reading-guide-enabled .disa-reading-guide {
    display: block;
}

/* Accessibility feature classes applied to <body> */
/* Font size scaling */
html.disa-fontsize {
    /* value handled inline on html style via JS */
}

/* Readable font */
body.disa-readable-font,
body.disa-readable-font * {
    font-family: Arial, Helvetica, "Segoe UI", Tahoma, sans-serif !important;
}

/* Highlight titles */
body.disa-highlight-title h1,
body.disa-highlight-title h2,
body.disa-highlight-title h3,
body.disa-highlight-title h4,
body.disa-highlight-title h5,
body.disa-highlight-title h6 {
    background: #fff7cc !important;
    padding: .15em .25em !important;
    outline: 2px solid #f2a100 !important;
}

/* Highlight links */
body.disa-highlight-links a {
    outline: 3px solid #f2a100 !important;
    background: #fff7cc !important;
    text-decoration: underline !important;
}

/* Contrast schemes */
body.disa-dark-contrast {
    background: #111 !important;
    color: #eee !important;
}

body.disa-dark-contrast a {
    color: #ffcc00 !important;
}

body.disa-light-contrast {
    background: #fff !important;
    color: #111 !important;
}

body.disa-light-contrast a {
    color: #1a73e8 !important;
}

body.disa-high-contrast {
    background: #000 !important;
    color: #ffff00 !important;
}

body.disa-high-contrast a {
    color: #00ffff !important;
}

/* Saturation & monochrome via filter */
html.disa-sat-high {
    filter: saturate(2) !important;
}

html.disa-sat-low {
    filter: saturate(0.5) !important;
}

html.disa-mono {
    filter: grayscale(100%) !important;
}

/* Stop animations */
body.disa-stop-animations *,
body.disa-stop-animations *::before,
body.disa-stop-animations *::after {
    -webkit-animation: none !important;
    animation: none !important;
    -webkit-transition: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

/* Big cursor with data-URI SVG (fallbacks to auto) */
body.disa-big-cursor,
body.disa-big-cursor * {
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><circle cx='6' cy='6' r='6' fill='black'/></svg>") 0 0, auto !important;
}

/* Ensure base elements keep readable on extreme modes */
body.disa-dark-contrast img,
body.disa-high-contrast img {
    opacity: .9
}

/* Responsive grid: 3 kolom pada layar lebar */
@media (min-width: 640px) {
    .disa-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Panel hidden state */
.disa-panel[hidden] {
    display: none;
}

/* Text-to-Speech mini controller */
.disa-tts {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 16px;
    background: #ffffff;
    border: 1px solid #e8ebfb;
    border-radius: 999px;
    box-shadow: var(--disa-shadow);
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.disa-tts[hidden] {
    display: none;
}

.disa-tts-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #dde3fb;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.disa-tts-btn:focus {
    outline: 3px solid var(--disa-focus);
    outline-offset: 2px;
}

.disa-tts-status {
    font-size: 12px;
    color: #4b4f68;
    margin-left: 4px;
    min-width: 90px;
}