:where(a, button, input, select, textarea, [role="radio"]):focus-visible {
  outline: 3px solid rgba(198, 40, 40, 0.28);
  outline-offset: 2px;
}

/* Text inputs: styles.css resets border/box-shadow/outline on
   input:not([type="checkbox"]):not([type="radio"]):not(.sr-only) (0,3,1), which
   beats input:focus and the zero-specificity :where() ring above, so a focused
   text field showed nothing at all. Same selector plus :focus (0,4,1) wins and
   the ring is visible. The Copilot composer is a textarea with its own
   :has(textarea:focus) indicator, so it is not touched. */
input:not([type="checkbox"]):not([type="radio"]):not(.sr-only):focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.28);
}

#viewTitle:focus {
  outline: none;
}

.nav-toggle,
.sidebar-backdrop {
  display: none;
}

@media (max-width: 900px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-height: 40px;
    padding: 0;
  }

  .side {
    position: fixed;
    z-index: 50;
    inset: 0 auto 0 0;
    width: min(300px, 86vw);
    height: 100dvh;
    transform: translateX(-105%);
    /* Off-screen is not enough: a closed drawer's links would still take
       Tab stops. Hidden removes them; the delay keeps it visible while it
       slides out. */
    visibility: hidden;
    transition: transform 160ms ease, visibility 0s linear 160ms;
    overflow-y: auto;
  }

  .sidebar-open .side {
    transform: translateX(0);
    visibility: visible;
    transition-delay: 0s;
  }

  .sidebar-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    z-index: 40;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    background: rgba(28, 25, 23, 0.42);
  }

  .topbar > div:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .side {
    transition: none;
  }
}
