/* Accessibility Suite (Cobalt) v2.1.0 — stronger styles */
:root{ --acs-font-scale:1; --acs-panel-bg:#fff; --acs-panel-fg:#111; --acs-brand:#0a66c2; --acs-focus:#005fcc; }
html{ font-size: calc(16px * var(--acs-font-scale)); }

/* Link underlines and highlights (force with !important to beat theme overrides) */
body.acs-underline-links a{ text-decoration: underline !important; text-underline-offset: 2px !important; }
body.acs-highlight-links a{ outline: 2px solid currentColor !important; outline-offset: 2px !important; }
body.acs-highlight-headings h1,
body.acs-highlight-headings h2,
body.acs-highlight-headings h3,
body.acs-highlight-headings h4,
body.acs-highlight-headings h5,
body.acs-highlight-headings h6{ background:#fffa9e !important; box-shadow:0 0 0 2px #e6d800 inset !important; }

/* Dyslexia-friendly and spacing (apply broadly) */
body.acs-dyslexia *:not(i):not(svg):not(code):not(pre):not(kbd){ font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif !important; }
body.acs-text-spacing p,
body.acs-text-spacing li,
body.acs-text-spacing a,
body.acs-text-spacing span,
body.acs-text-spacing div,
body.acs-text-spacing input,
body.acs-text-spacing textarea,
body.acs-text-spacing label{ letter-spacing:.03em !important; word-spacing:.12em !important; }
body.acs-line-height p,
body.acs-line-height li,
body.acs-line-height a,
body.acs-line-height span,
body.acs-line-height div,
body.acs-line-height input,
body.acs-line-height textarea,
body.acs-line-height label{ line-height:1.8 !important; }

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

/* Big cursor */
html.acs-big-cursor, body.acs-big-cursor{ cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48"><polygon points="0,0 0,48 12,36 24,48 28,44 16,32 28,32" fill="black"/></svg>') 0 0, auto !important; }
body.acs-big-cursor *{ cursor: inherit !important; }

/* Theme filters (robust to override-heavy themes) */
body.acs-theme-dark{ filter: invert(1) hue-rotate(180deg) !important; }
body.acs-theme-dark img,
body.acs-theme-dark video,
body.acs-theme-dark iframe,
body.acs-theme-dark picture,
body.acs-theme-dark canvas{ filter: invert(1) hue-rotate(180deg) !important; }

/* Light and Yellow/Black enforce colors widely (heavy-handed as expected for an overlay) */
body.acs-theme-light, body.acs-theme-light *{ color:#000 !important; background:#fff !important; }
body.acs-theme-yellow, body.acs-theme-yellow *{ color:#000 !important; background:#ff0 !important; border-color:#000 !important; box-shadow:none !important; }

/* Grayscale & Invert filters (media fix) */
html.acs-grayscale, body.acs-grayscale{ filter: grayscale(1) !important; }
html.acs-invert, body.acs-invert{ filter: invert(1) hue-rotate(180deg) !important; }
body.acs-grayscale img, body.acs-invert img,
body.acs-grayscale video, body.acs-invert video,
body.acs-grayscale iframe, body.acs-invert iframe,
body.acs-grayscale canvas, body.acs-invert canvas{ filter: invert(1) hue-rotate(180deg) !important; }

/* Reading mask & guide */
.acs-mask{ position:fixed; left:0; top:0; right:0; bottom:0; pointer-events:none; z-index: 9997; }
.acs-mask::before, .acs-mask::after{ content:''; position:absolute; left:0; right:0; background: rgba(0,0,0,.5); }
.acs-mask::before{ top:0; height:40%; } .acs-mask::after{ bottom:0; height:40%; }
.acs-mask .acs-hole{ position:absolute; left:0; right:0; top:40%; height:20%; pointer-events:none; }
.acs-guide{ position:fixed; left:0; right:0; height:2px; background:#f00; top:50%; z-index:9998; pointer-events:none; opacity:.7; }

/* Widget */
.acs-widget{ position:fixed; z-index: 9999; }
.acs-widget[data-position="bottom-right"]{ right: 16px; bottom: 16px; }
.acs-widget[data-position="bottom-left"]{ left: 16px; bottom: 16px; }

.acs-launcher{ width:56px; height:56px; border-radius:50%; background:var(--acs-brand); color:#fff; border:none; cursor:pointer; display:flex; align-items:center; justify-content:center; box-shadow:0 6px 16px rgba(0,0,0,.2); }
.acs-launcher:focus-visible{ outline:3px solid var(--acs-focus); outline-offset:3px; }
.acs-launcher-icon{ font-size:28px; line-height:1; }

.acs-panel{ position:fixed; right:16px; bottom:80px; width:360px; max-width:calc(100vw - 32px); background:var(--acs-panel-bg); color:var(--acs-panel-fg); border-radius:12px; box-shadow:0 20px 40px rgba(0,0,0,.25); padding:12px; }
.acs-widget[data-position="bottom-left"] .acs-panel{ left:16px; right:auto; }
.acs-panel-header{ display:flex; align-items:center; justify-content:space-between; }
.acs-panel h2{ margin:0 0 4px; font-size:18px; }
.acs-close{ border:none; background:transparent; font-size:28px; line-height:1; cursor:pointer; }
.acs-help{ font-size:12px; color:#555; }

.acs-section{ margin-top:10px; }
.acs-section h3{ font-size:14px; margin:8px 0; }
.acs-controls{ display:flex; flex-wrap:wrap; gap:8px; }

.acs-btn{ padding:6px 10px; border:1px solid #333; border-radius:8px; background:#f7f7f7; cursor:pointer; }
.acs-btn:focus-visible{ outline:3px solid var(--acs-focus); outline-offset:2px; }
.acs-btn.acs-danger{ border-color:#b00020; }

.acs-switch{ display:flex; align-items:center; gap:6px; font-size:14px; }

.screen-reader-text{ position:absolute !important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
