.spk {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  align-items: center;
  width: 100%;
}

.spk-summary {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  align-items: baseline;
  justify-content: center;
  text-align: center;
  color: var(--c-ink-muted);
  font-size: var(--text-sm);
}

.spk-total {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.spk-total strong {
  color: var(--c-ink);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-lg);
  letter-spacing: -0.01em;
}

/* The quiet people are the finding, so the note about them is not a footnote. */
.spk-quiet-note {
  font-weight: 600;
  color: var(--c-ink);
}

/* --- The people ----------------------------------------------------------- */

.spk-list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.spk-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.spk-main {
  font: inherit;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-height: var(--tap-target);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  cursor: pointer;

  background: var(--c-paper);
  color: var(--c-ink);
  border: 1px solid var(--c-line);
  border-left: 4px solid var(--hue);
  border-radius: var(--radius);
  transition: background-color 120ms ease, border-color 120ms ease;
}

.spk-main:hover {
  background: var(--hue-tint);
}

.spk-name {
  font-weight: 600;
}

.spk-bar {
  display: block;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--c-line);
  overflow: hidden;
}

.spk-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--hue);
  transition: width 400ms linear;
}

.spk-time {
  flex: none;
  min-width: 5ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--c-ink);
}

.spk-share {
  flex: none;
  min-width: 4ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: var(--text-sm);
  color: var(--c-ink-muted);
}

/* Whoever holds the floor is unmistakable, and their clock is visibly alive. */
.spk-row.is-active .spk-main {
  background: var(--hue-tint);
  border-color: var(--hue);
  box-shadow: 0 0 0 2px var(--hue);
}

.spk-row.is-active .spk-name {
  font-weight: 700;
}

.spk-row.is-active .spk-time {
  color: var(--hue);
}

.spk-row.is-active .spk-name::after {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-left: var(--space-2);
  border-radius: 50%;
  background: var(--hue);
  animation: speaking-pulse 1.2s ease-in-out infinite;
}

@keyframes speaking-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spk-row.is-active .spk-name::after {
    animation: none;
  }
}

/* Someone who has not spoken is stated, not just left at zero — that is the
   whole reason to run this. */
.spk-row.is-quiet .spk-main {
  border-left-color: var(--c-line);
  border-style: dashed;
}

.spk-row.is-quiet .spk-name {
  color: var(--c-ink-muted);
}

.spk-row.is-quiet:not(.is-active) .spk-time {
  color: var(--c-ink-muted);
}

/* --- Setup ---------------------------------------------------------------- */

.spk-names {
  width: 100%;
  max-width: 24rem;
  border-top: 1px solid var(--c-line);
  padding-top: var(--space-6);
}

.spk-names textarea {
  font: inherit;
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--c-ink);
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  width: 100%;
  resize: vertical;
  min-height: 7rem;
}

.spk-hint {
  margin: 0;
  color: var(--c-ink-muted);
  font-size: var(--text-sm);
  text-align: center;
  text-wrap: balance;
}

.spk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
}

/* --- Fullscreen ----------------------------------------------------------- */

.toy.is-fullscreen .spk {
  justify-content: center;
  height: 100%;
}

.toy.is-fullscreen .spk-name {
  font-size: var(--text-lg);
}

.toy.is-fullscreen .spk-names,
.toy.is-fullscreen .spk-hint {
  opacity: 0;
  transition: opacity 200ms ease;
}

.toy.is-fullscreen .spk-names:focus-within,
.toy.is-fullscreen:hover .spk-names,
.toy.is-fullscreen:hover .spk-hint {
  opacity: 1;
}
