/* ===== Accessibility Widget ===== */
:root{
  --access-toggle-bg: #1f3b4d;
  --access-toggle-color: #ffffff;
  --access-focus: #facc15;

  /* button placement defaults */
  --access-top: 20px;
  --access-right: 20px;
  --access-left: auto;
  --access-bottom: auto;
}

.access-menu {
  position: fixed;
  top: var(--access-top);
  right: var(--access-right);
  left: var(--access-left);
  bottom: var(--access-bottom);
  z-index: 99999;
  font-family: inherit;
}

/* Button 32x32 exactly */
.access-toggle {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: var(--access-toggle-bg);
  color: var(--access-toggle-color);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0,0,0,.35);
}

.access-toggle svg{
  width: 18px;
  height: 18px;
  display: block;
}

.access-toggle:focus-visible {
  outline: 3px solid var(--access-focus);
  outline-offset: 3px;
}

.access-panel {
  margin-top: 10px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
  padding: 12px 14px;
  width: 190px;
  border: 1px solid rgba(0,0,0,.08);
}

.access-header {
  margin-bottom: 10px;
  font-size: 14px;
}

.access-item {
  width: 100%;
  margin: 6px 0;
  padding: 9px 10px;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  cursor: pointer;
}

.access-item[aria-pressed="true"] {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

.access-item:focus-visible {
  outline: 2px solid var(--access-focus);
  outline-offset: 2px;
}

.access-reset {
  margin-top: 10px;
  background: #fee2e2;
  border-color: #fecaca;
}

.access-reset:hover {
  background: #fecaca;
}

.access-note {
  margin-top: 10px;
  font-size: 11px;
  color: #6b7280;
  max-width: 220px;
}

/* ===== Accessibility modes ===== */
html.access-grayscale { filter: grayscale(100%); }

html.access-contrast-high,
html.access-contrast-high body {
  background: #000 !important;
  color: #fff !important;
}

html.access-contrast-high a { color: #ffeb3b !important; }

html.access-invert { filter: invert(100%); }

html.access-light-bg,
html.access-light-bg body * {
  background-color: #ffffff !important;
  color: #000000 !important;
}

html.access-light-bg a { color: #0000EE !important; }
html.access-light-bg img { filter: brightness(1.15); }

html.access-underline-links a { text-decoration: underline !important; }

html.access-readable-font,
html.access-readable-font * {
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif !important;
}
