/* ── Skip link ── */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: #1e429f;
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 8px 8px;
  font-weight: 700;
  font-size: .9rem;
  text-decoration: none;
  z-index: 10000;
  transition: top .15s;
}
.skip-link:focus { top: 0; }

/* ── Focus styles (keyboard navigation) ── */
:focus-visible {
  outline: 3px solid #1a56db;
  outline-offset: 3px;
  border-radius: 4px;
}
/* Remove outline for mouse users without hiding it for keyboard users */
:focus:not(:focus-visible) { outline: none; }

/* Inputs keep a distinct focus ring */
input:focus-visible,
button:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid #1a56db;
  outline-offset: 2px;
}

/* ── Screen-reader only utility ── */
.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;
}

/* ── Ensure muted text meets WCAG AA (4.5:1) ── */
/* Override --muted (#64748b fails on light bg) with #4e5d6c which passes */
:root { --muted: #4e5d6c; }

/* ── Sidebar child menu ── */
.sidebar-child-list {
  list-style: none;
  margin: 2px 0 6px 15px;
  padding: 3px 0 3px 14px;
  border-left: 1.5px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sidebar-child-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border-radius: 6px;
  text-decoration: none;
  font-size: .795rem;
  font-weight: 500;
  color: #64748b;
  transition: background .15s, color .15s;
}
.sidebar-child-link::before {
  content: '';
  flex-shrink: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: background .15s;
}
.sidebar-child-link:hover { background: #e0e7ff; color: #1e429f; }
.sidebar-child-link:hover::before { background: #1a56db; }
.sidebar-child-link.active { background: #dbeafe; color: #1a56db; font-weight: 600; }
.sidebar-child-link.active::before { background: #1a56db; }
/* Parent link when a child page is active */
.sidebar-link.open { background: #f1f5f9; color: #1e429f; }

/* ── High-contrast / forced-colors support ── */
@media (forced-colors: active) {
  .sidebar-link.active,
  .sidebar-link.open { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .sidebar-child-link.active { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .skip-link { forced-color-adjust: none; background: ButtonFace; color: ButtonText; border: 2px solid ButtonText; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
