/* MISSION CONTROL — Pulse Voices */

.stream-v2 {
  --voice-enterprise: 117, 91, 177;
  --voice-connector: 62, 132, 96;
  --voice-knowledge: 69, 105, 169;
  --voice-runtime: 175, 116, 56;
  --voice-recovery: 166, 68, 72;

  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(39, 48, 58, 0.10);
  border-radius: 22px;
  background:
    radial-gradient(circle at 5% 0%, rgba(117, 91, 177, 0.07), transparent 28%),
    radial-gradient(circle at 94% 10%, rgba(62, 132, 96, 0.08), transparent 30%),
    linear-gradient(135deg, #f4f5ef 0%, #edf1eb 54%, #f6f4ef 100%);
  box-shadow: 0 14px 34px rgba(58, 66, 54, 0.08);
}

.stream-v2__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 44px;
  padding: 2px 4px 11px;
  border-bottom: 1px solid rgba(39, 48, 58, 0.08);
}

.stream-v2__brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.stream-v2__brand > div {
  display: grid;
  gap: 1px;
}

.stream-v2__brand strong {
  color: #182028;
  font-size: 15px;
  font-weight: 660;
  letter-spacing: 0.015em;
}

.stream-v2__eyebrow,
.stream-v2__meta,
.stream-v2-voice-chip,
.stream-v2-memory__voice,
.stream-v2-memory__time,
.stream-v2-memory__context {
  font-family: "IBM Plex Mono", "JetBrains Mono", monospace;
  text-transform: uppercase;
}

.stream-v2__eyebrow {
  color: rgba(31, 40, 48, 0.48);
  font-size: 8px;
  font-weight: 780;
  letter-spacing: 0.16em;
}

.stream-v2__live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(var(--voice-connector), 0.92);
  box-shadow:
    0 0 0 5px rgba(var(--voice-connector), 0.10),
    0 0 18px rgba(var(--voice-connector), 0.18);
}

.stream-v2__meta {
  display: flex;
  gap: 7px;
  color: rgba(31, 40, 48, 0.48);
  font-size: 9px;
  font-weight: 730;
  letter-spacing: 0.08em;
}

.stream-v2__meta span {
  padding: 4px 7px;
  border: 1px solid rgba(39, 48, 58, 0.075);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
}

.stream-v2__voice-register {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.stream-v2-voice-chip {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  gap: 6px;
  padding: 7px 8px;
  border: 1px solid rgba(39, 48, 58, 0.075);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.30);
  color: rgba(31, 40, 48, 0.58);
}

.stream-v2-voice-chip__glyph {
  font-size: 12px;
  line-height: 1;
}

.stream-v2-voice-chip__label {
  overflow: hidden;
  font-size: 8px;
  font-weight: 780;
  letter-spacing: 0.09em;
  text-overflow: ellipsis;
}

.stream-v2-voice-chip__count {
  font-size: 10px;
  font-weight: 760;
}

.stream-v2-voice-chip--enterprise .stream-v2-voice-chip__glyph,
.stream-v2-voice-chip--enterprise .stream-v2-voice-chip__count {
  color: rgb(var(--voice-enterprise));
}

.stream-v2-voice-chip--connector .stream-v2-voice-chip__glyph,
.stream-v2-voice-chip--connector .stream-v2-voice-chip__count {
  color: rgb(var(--voice-connector));
}

.stream-v2-voice-chip--knowledge .stream-v2-voice-chip__glyph,
.stream-v2-voice-chip--knowledge .stream-v2-voice-chip__count {
  color: rgb(var(--voice-knowledge));
}

.stream-v2-voice-chip--runtime .stream-v2-voice-chip__glyph,
.stream-v2-voice-chip--runtime .stream-v2-voice-chip__count {
  color: rgb(var(--voice-runtime));
}

.stream-v2-voice-chip--recovery .stream-v2-voice-chip__glyph,
.stream-v2-voice-chip--recovery .stream-v2-voice-chip__count {
  color: rgb(var(--voice-recovery));
}

.stream-v2__timeline {
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(39, 48, 58, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.40);
}

.stream-v2-memory {
  --voice-rgb: var(--voice-knowledge);

  position: relative;
  display: grid;
  grid-template-columns: 112px 68px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  min-height: 54px;
  padding: 10px 14px;
  border-top: 1px solid rgba(39, 48, 58, 0.055);
  cursor: pointer;
  transition:
    background 130ms ease,
    transform 130ms ease;
}

.stream-v2-memory:first-child {
  border-top: 0;
}

.stream-v2-memory::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px 0;
  width: 2px;
  border-radius: 999px;
  background: rgba(var(--voice-rgb), 0.70);
}

.stream-v2-memory:hover {
  background: rgba(var(--voice-rgb), 0.055);
}

.stream-v2-memory--enterprise {
  --voice-rgb: var(--voice-enterprise);
}

.stream-v2-memory--connector {
  --voice-rgb: var(--voice-connector);
}

.stream-v2-memory--knowledge {
  --voice-rgb: var(--voice-knowledge);
}

.stream-v2-memory--runtime {
  --voice-rgb: var(--voice-runtime);
}

.stream-v2-memory--recovery {
  --voice-rgb: var(--voice-recovery);
}

.stream-v2-memory--high-gravity {
  min-height: 68px;
  padding-top: 13px;
  padding-bottom: 13px;
  background:
    linear-gradient(90deg, rgba(var(--voice-rgb), 0.075), transparent 54%);
}

.stream-v2-memory--high-gravity::before {
  width: 4px;
  background: rgba(var(--voice-rgb), 0.92);
  box-shadow: 0 0 16px rgba(var(--voice-rgb), 0.18);
}

.stream-v2-memory__voice {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
  padding-top: 2px;
  color: rgb(var(--voice-rgb));
}

.stream-v2-memory__glyph {
  width: 15px;
  font-size: 12px;
  line-height: 1;
  text-align: center;
}

.stream-v2-memory__speaker {
  overflow: hidden;
  font-size: 9px;
  font-weight: 820;
  letter-spacing: 0.11em;
  text-overflow: ellipsis;
}

.stream-v2-memory__time {
  padding-top: 2px;
  color: rgba(24, 31, 39, 0.52);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.025em;
}

.stream-v2-memory__body {
  min-width: 0;
}

.stream-v2-memory__action {
  color: #151c25;
  font-size: 13px;
  line-height: 1.18;
  font-weight: 660;
}

.stream-v2-memory--high-gravity .stream-v2-memory__action {
  color: rgb(var(--voice-rgb));
  font-size: 15px;
}

.stream-v2-memory__subject {
  margin-top: 3px;
  color: rgba(35, 44, 53, 0.70);
  font-size: 11px;
  line-height: 1.34;
  font-weight: 430;
  overflow-wrap: anywhere;
}

.stream-v2-memory__context {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 6px;
  color: rgba(35, 44, 53, 0.42);
  font-size: 8px;
  font-weight: 690;
  letter-spacing: 0.075em;
}

.stream-v2-memory__context span {
  position: relative;
}

.stream-v2-memory__context span + span::before {
  content: "·";
  position: absolute;
  left: -7px;
  color: rgba(35, 44, 53, 0.24);
}

.stream-v2-memory__reference {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stream-v2__state {
  display: grid;
  gap: 5px;
  padding: 24px;
  color: rgba(35, 44, 53, 0.66);
}

.stream-v2__state strong {
  color: #151c25;
  font-size: 14px;
  font-weight: 690;
}

.stream-v2__state span {
  font-size: 12px;
}

.stream-v2__state--error {
  color: rgb(var(--voice-recovery));
}

body[data-theme="night"] .stream-v2 {
  background:
    radial-gradient(circle at 5% 0%, rgba(var(--voice-enterprise), 0.12), transparent 28%),
    radial-gradient(circle at 94% 10%, rgba(var(--voice-connector), 0.11), transparent 30%),
    linear-gradient(135deg, #071210 0%, #0a1916 52%, #0c1514 100%);
  border-color: rgba(134, 174, 150, 0.15);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

body[data-theme="night"] .stream-v2__header,
body[data-theme="night"] .stream-v2-memory {
  border-color: rgba(134, 174, 150, 0.09);
}

body[data-theme="night"] .stream-v2__brand strong,
body[data-theme="night"] .stream-v2-memory__action,
body[data-theme="night"] .stream-v2__state strong {
  color: rgba(238, 247, 240, 0.95);
}

body[data-theme="night"] .stream-v2__eyebrow,
body[data-theme="night"] .stream-v2__meta,
body[data-theme="night"] .stream-v2-memory__time,
body[data-theme="night"] .stream-v2-memory__context {
  color: rgba(157, 190, 168, 0.62);
}

body[data-theme="night"] .stream-v2__meta span,
body[data-theme="night"] .stream-v2-voice-chip {
  border-color: rgba(134, 174, 150, 0.12);
  background: rgba(255, 255, 255, 0.025);
}

body[data-theme="night"] .stream-v2__timeline {
  border-color: rgba(134, 174, 150, 0.12);
  background: rgba(5, 16, 14, 0.82);
}

body[data-theme="night"] .stream-v2-memory:hover {
  background: rgba(var(--voice-rgb), 0.09);
}

body[data-theme="night"] .stream-v2-memory--high-gravity {
  background:
    linear-gradient(90deg, rgba(var(--voice-rgb), 0.12), transparent 54%);
}

body[data-theme="night"] .stream-v2-memory__subject,
body[data-theme="night"] .stream-v2__state {
  color: rgba(212, 229, 218, 0.70);
}

body[data-theme="night"] .stream-v2-memory__context span + span::before {
  color: rgba(180, 208, 189, 0.22);
}

@media (max-width: 980px) {
  .stream-v2__voice-register {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stream-v2-memory {
    grid-template-columns: 100px 58px minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .stream-v2__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .stream-v2__voice-register {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stream-v2-memory {
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 5px 10px;
  }

  .stream-v2-memory__time {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .stream-v2-memory__body {
    grid-column: 1 / -1;
  }

  .stream-v2-memory__reference {
    max-width: 180px;
  }
}
