/* Система — оформление ника и значка в чате (превью / будущая интеграция) */

.system-badge-inline {
  display: inline-block;
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 4px;
  flex-shrink: 0;
}

.system-badge-inline svg,
.system-badge-inline object,
.system-badge-inline img {
  width: 14px;
  height: 14px;
  display: block;
  pointer-events: none;
}

/* Ник «Система» — холодный, не как у водителей */
.chat-author.is-system,
.chat-author.system-identity {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-variant: small-caps;
  color: #99f6e4;
  text-shadow:
    0 0 8px rgba(45, 212, 191, 0.35),
    0 0 1px rgba(204, 251, 241, 0.5);
  animation: system-nick-breathe 3.2s ease-in-out infinite;
}

/* Тонкие «скобки» вокруг ника — маркер служебного автора */
.chat-author.is-system::before,
.chat-author.system-identity::before {
  content: "‹";
  margin-right: 2px;
  font-weight: 400;
  letter-spacing: 0;
  opacity: 0.55;
  color: #5eead4;
}

.chat-author.is-system::after,
.chat-author.system-identity::after {
  content: "›";
  margin-left: 2px;
  font-weight: 400;
  letter-spacing: 0;
  opacity: 0.55;
  color: #5eead4;
}

/* Разовая анимация при появлении нового сообщения */
.chat-author.is-system.is-system-enter,
.chat-author.system-identity.is-system-enter {
  animation: system-nick-enter 0.75s ease-out, system-nick-breathe 3.2s ease-in-out 0.75s infinite;
}

@keyframes system-nick-breathe {
  0%, 100% {
    opacity: 0.88;
    text-shadow:
      0 0 6px rgba(45, 212, 191, 0.25),
      0 0 1px rgba(204, 251, 241, 0.4);
  }
  50% {
    opacity: 1;
    text-shadow:
      0 0 12px rgba(45, 212, 191, 0.45),
      0 0 2px rgba(204, 251, 241, 0.65);
  }
}

@keyframes system-nick-enter {
  0% {
    opacity: 0.2;
    letter-spacing: 0.28em;
    filter: brightness(1.4);
  }
  40% {
    opacity: 1;
    letter-spacing: 0.1em;
  }
  100% {
    letter-spacing: 0.14em;
    filter: none;
  }
}

/* Линия-скан при входе сообщения (на всю мета-строку) */
.feed-meta-line.is-system-meta {
  position: relative;
  overflow: hidden;
}

.feed-meta-line.is-system-meta::after {
  content: "";
  position: absolute;
  left: -40%;
  top: 0;
  width: 28%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(153, 246, 228, 0.22),
    transparent
  );
  animation: system-scan-line 0.85s ease-out 1;
  pointer-events: none;
}

@keyframes system-scan-line {
  0% { left: -35%; opacity: 0; }
  20% { opacity: 1; }
  100% { left: 110%; opacity: 0; }
}

/* Пузырь системного сообщения — лёгкая рамка */
.bubble.is-system-message {
  border-color: rgba(45, 212, 191, 0.28);
  background: linear-gradient(135deg, #0f1a18 0%, #121820 55%, #101820 100%);
  box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.06);
}

.bubble.is-system-message p {
  color: #d2ebe6;
}
