/* ── Accessibility (IS 5568 / WCAG 2.0) ── */

.skip-link {
  position: absolute;
  top: -120px;
  inset-inline-start: 1rem;
  z-index: 10001;
  padding: 0.65rem 1rem;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: var(--radius);
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.skip-link:focus {
  top: 1rem;
}

.sr-only,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

html.a11y-high-contrast :focus-visible {
  outline-color: #fff;
}

.a11y-widget {
  position: relative;
}

.floating-widgets {
  position: fixed;
  inset-inline-start: 1rem;
  bottom: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 0.65rem;
}

.floating-fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

.floating-fab .material-icons {
  font-size: 1.375rem;
  line-height: 1;
}

.floating-fab:hover,
.floating-fab:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.ai-advisor-fab {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.ai-advisor-fab:hover,
.ai-advisor-fab:focus-visible {
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
  color: var(--accent);
}

.a11y-fab {
  font: inherit;
}

.a11y-panel {
  position: absolute;
  inset-inline-start: 0;
  bottom: calc(100% + 0.5rem);
  width: min(280px, calc(100vw - 2rem));
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.a11y-panel[hidden] {
  display: none;
}

.a11y-panel-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.a11y-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.a11y-btn {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  text-align: start;
  cursor: pointer;
}

.a11y-btn:hover,
.a11y-btn:focus-visible {
  border-color: var(--accent);
}

.a11y-btn.is-active {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent);
}

.a11y-panel-footer {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
}

.a11y-panel-footer a {
  color: var(--accent);
}

html.a11y-font-lg {
  font-size: 106.25%;
}

html.a11y-font-xl {
  font-size: 118.75%;
}

html.a11y-high-contrast {
  --bg: #000;
  --surface: #000;
  --surface-2: #111;
  --border: #fff;
  --text: #fff;
  --muted: #e0e0e0;
  --accent: #ffeb3b;
  --accent-hover: #fff176;
  --accent-rgb: 255, 235, 59;
  --accent-text: #000;
  --success: #69f0ae;
  --error: #ff5252;
  --warning: #ffd54f;
  --input-bg: #111;
  --input-border: #fff;
}

html.a11y-high-contrast .btn-primary {
  background: #ffeb3b;
  color: #000;
  border-color: #ffeb3b;
}

html.a11y-underline-links a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

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

[role="alert"] {
  outline: none;
}

@media (max-width: 480px) {
  .floating-widgets {
    inset-inline-start: 0.75rem;
    bottom: 0.75rem;
  }
}
