/* ==========================================================================
   Think-aloud test recorder (Peter, 28 Sep 2026)
   js/test-recorder.js: a TESTER's face and voice, recorded alongside the
   screen replay, with consent first. Two parts:
   .testrec-card  the consent card, a centred .modal (modal.css) made narrow
   .testrec-pill  the "Recording" indicator, fixed beside the sidebar
   ========================================================================== */

/* the consent card: the shared modal, narrow, one paragraph and two buttons */
.testrec-card {
  width: 440px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.testrec-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-bg-subtle, #f5f5f5);
  color: var(--color-text);
}
.testrec-card__icon > svg { width: 22px; height: 22px; }
.testrec-card__text {
  margin: 0;
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--color-text);
}
.testrec-card__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-2, 8px);
}

/* the indicator: always on while something records. Left and bottom are set by
   the script from the sidebar's live edge, so an expanded sidebar or the phone's
   tab bar never covers it; the values here are the fallback. */
.testrec-pill {
  position: fixed;
  left: 100px;
  bottom: 16px;
  z-index: 9000;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 14px;
  border-radius: 999px;
  background: var(--color-surface);
  border: var(--border-width, 1px) solid var(--color-border);
  box-shadow: var(--shadow-dropdown);
  font-size: var(--text-sm);
  color: var(--color-text);
  white-space: nowrap;
}
.testrec-pill[hidden] { display: none; }
.testrec-pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-danger);
  animation: testrecPulse 1.6s ease-in-out infinite;
}
.testrec-pill__stop {
  border: none;
  background: var(--color-bg-subtle, #f5f5f5);
  color: var(--color-text);
  font: inherit;
  font-weight: var(--weight-medium);
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.testrec-pill__stop:hover { background: var(--color-border); }   /* provisional */
.testrec-pill__stop:focus-visible { outline: 2px solid var(--color-text); outline-offset: 2px; }

@keyframes testrecPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
@media (prefers-reduced-motion: reduce) {
  .testrec-pill__dot { animation: none; }
}
@media (max-width: 640px) {
  .testrec-card { padding: 24px; }
  .testrec-pill { left: 12px; }
}

/* consent comes first: the card dims everything, the support chat that opens itself on a first visit included
   (the chat panel sits at the modal's own 9998, later in the page, so it would paint over the scrim) */
#testrec-consent { z-index: 10000; }
