/* ── Header Bar ────────────────────────────────────────── */

header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 1.2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}
header h1 {
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
}

.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  display: none;
  animation: blink 1.2s ease-in-out infinite;
}
.rec-dot.on {
  display: inline-block;
}
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.2;
  }
}

#lastHeard {
  font-size: 0.78rem;
  color: var(--green);
  font-style: italic;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
}
#lastHeard.on {
  opacity: 1;
}

/* Backend / DTW status pills */
.pills {
  display: flex;
  gap: 0.4rem;
}
.pill {
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  white-space: nowrap;
  transition: all 0.25s;
}
.pill.ok {
  color: var(--green);
  border-color: rgba(34, 197, 94, 0.4);
}
.pill.warn {
  color: var(--yellow);
  border-color: rgba(234, 179, 8, 0.3);
}
.pill.busy {
  color: var(--blue);
  border-color: rgba(59, 130, 246, 0.4);
}

/* DTW spinner — tiny inline animation */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.spinner {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 1.5px solid rgba(59, 130, 246, 0.3);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 3px;
}

.hdr-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
#wordCountEl {
  font-size: 0.72rem;
  color: var(--text-dim);
}
.btn-xs {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 6px;
  padding: 0.22rem 0.55rem;
  font-size: 0.72rem;
  cursor: pointer;
}
.btn-xs:hover {
  border-color: var(--text-dim);
  color: var(--text);
}
