/* Prime Audio Lab · accessibility and mobile quality gate.
   Loaded after the base stylesheet so fixes stay isolated to Audio Lab. */

/* Small helper copy previously dipped below WCAG AA contrast on the dark cards. */
.tip,
.export-pack > small,
.compare-box small {
  color: #7f8aa0;
}

/* Keep the two file pickers keyboard reachable without changing their visual treatment. */
.drop,
.midi-upload {
  position: relative;
}

.drop input,
.midi-upload input {
  display: block !important;
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input[type="range"]:focus-visible,
.drop:focus-within,
.midi-upload:focus-within {
  outline: 2px solid #8fb7ff;
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    border-bottom: 0;
  }

  .tab {
    min-width: 0;
    min-height: 44px;
    padding: 10px 8px;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 10px;
    background: #0b0f17;
    line-height: 1.2;
    white-space: normal;
    text-align: center;
  }

  .tab.active {
    border-color: rgba(139, 92, 246, .42);
    background: rgba(139, 92, 246, .09);
  }

  .tab.active::after {
    display: none;
  }

  /* Touch-target guardrail: secondary actions were visually clear but several
     rendered below a comfortable phone target. Keep the same compact design
     while making interactive controls reliably tappable. */
  .btn,
  .actions a,
  .actions button,
  .midi-buttons .btn,
  .arr-actions .btn,
  .synth-buttons .btn,
  .mini-download,
  .midi-upload {
    min-height: 44px;
  }

  .actions a,
  .actions button {
    display: grid;
    place-items: center;
  }

  .controls select,
  .synth-grid select,
  .synth-transport select,
  .track-row select {
    min-height: 44px;
  }
}

/* Audio Lab has animated meters, transitions and hover feedback. Respect the
   OS-level reduced-motion preference without changing audio/MIDI behavior. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0ms !important;
  }
}
