/* R12: a dedicated, modern live-discussion widget for the right sidebar. */

.live-discussion {
  position: relative;
  padding: 0;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--accent-main) 20%, var(--border));
  background: var(--surface);
}

.live-discussion::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: -72px;
  right: -54px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent-main) 12%, transparent);
  filter: blur(2px);
  pointer-events: none;
}

.live-discussion__head {
  position: relative;
  z-index: 1;
  padding: 17px 17px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--accent-main) 14%, var(--border));
  background:
    radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--accent-main) 15%, transparent), transparent 48%),
    linear-gradient(145deg, color-mix(in srgb, var(--accent-main) 7%, var(--surface)) 0%, var(--surface) 72%);
}

.live-discussion__eyebrow {
  min-height: 24px;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.live-discussion__badge {
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--accent-main) 25%, transparent);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: color-mix(in srgb, var(--accent-main) 10%, var(--surface));
  color: var(--accent-main);
  font-size: 9px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .12em;
}

.live-discussion__pulse {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-main) 30%, transparent);
  animation: prikola-r12-live-pulse 2s ease-out infinite;
}

@keyframes prikola-r12-live-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-main) 34%, transparent); }
  65%, 100% { box-shadow: 0 0 0 7px transparent; }
}

.live-discussion__head-link {
  width: 28px;
  height: 28px;
  border: 1px solid color-mix(in srgb, var(--accent-main) 18%, var(--border));
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--text-soft);
  transition: color .16s ease, border-color .16s ease, background-color .16s ease, transform .16s ease;
}

.live-discussion__head-link:hover,
.live-discussion__head-link:focus-visible {
  border-color: color-mix(in srgb, var(--accent-main) 45%, var(--border));
  background: var(--accent-main-soft);
  color: var(--accent-main);
  transform: translateX(2px);
}

.live-discussion__head-link .i-svg {
  width: 15px;
  height: 15px;
}

.live-discussion__title {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -.035em;
}

.live-discussion__subtitle {
  max-width: 205px;
  margin: 5px 0 0;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.4;
}

.live-discussion__feed {
  position: relative;
  z-index: 1;
  padding: 9px 10px 4px;
}

.live-comment {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 9px;
  padding: 9px 7px 11px 4px;
}

.live-comment + .live-comment {
  border-top: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
}

.live-comment__rail {
  position: relative;
  min-width: 0;
}

.live-comment__avatar-wrap {
  position: relative;
  width: 36px;
  height: 36px;
  display: block;
}

.live-comment__avatar {
  width: 36px;
  height: 36px;
  border: 2px solid var(--surface);
  border-radius: 12px;
  display: block;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--border), 0 4px 11px rgba(20, 24, 33, .08);
}

.live-comment__activity {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent-main);
}

.live-comment__body {
  min-width: 0;
}

.live-comment__meta {
  min-width: 0;
  min-height: 19px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.live-comment__author,
.live-comment__author a {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-comment__author a:hover,
.live-comment__author a:focus-visible {
  color: var(--accent-main);
}

.live-comment__time {
  flex: 0 0 auto;
  color: var(--text-fade);
  font-size: 9px;
  line-height: 1.3;
  white-space: nowrap;
}

.live-comment__bubble {
  position: relative;
  margin-top: 4px;
  padding: 8px 9px;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  border-radius: 4px 12px 12px 12px;
  background: var(--surface-2);
}

.live-comment__bubble::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -5px;
  width: 8px;
  height: 8px;
  border-top: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  background: var(--surface-2);
  clip-path: polygon(100% 0, 100% 100%, 0 0);
}

.live-comment__text {
  max-height: 4.2em;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.live-comment__text > :first-child { margin-top: 0; }
.live-comment__text > :last-child { margin-bottom: 0; }

.live-comment__text img,
.live-comment__text video,
.live-comment__text iframe,
.live-comment__text .comments-image-gallery {
  display: none !important;
}

.live-comment__post {
  min-width: 0;
  margin-top: 6px;
  padding: 5px 6px 5px 8px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
  transition: color .16s ease, background-color .16s ease;
}

.live-comment__post:hover,
.live-comment__post:focus-visible {
  background: var(--accent-main-soft);
  color: var(--accent-main);
}

.live-comment__post-copy {
  min-width: 0;
  display: block;
}

.live-comment__post-label {
  display: block;
  margin-bottom: 1px;
  color: var(--text-fade);
  font-size: 8px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.live-comment__post-title {
  display: block;
  overflow: hidden;
  font-size: 10px;
  line-height: 1.3;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-comment__post-arrow {
  width: 13px;
  height: 13px;
  margin-left: auto;
  flex: 0 0 13px;
  color: var(--text-fade);
  transition: color .16s ease, transform .16s ease;
}

.live-comment__post:hover .live-comment__post-arrow,
.live-comment__post:focus-visible .live-comment__post-arrow {
  color: var(--accent-main);
  transform: translateX(2px);
}

.live-discussion__all {
  min-height: 42px;
  margin: 2px 12px 13px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--accent-main) 18%, var(--border));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: color-mix(in srgb, var(--accent-main) 6%, var(--surface));
  color: var(--text);
  font-size: 11px;
  font-weight: 750;
  transition: color .16s ease, border-color .16s ease, background-color .16s ease;
}

.live-discussion__all:hover,
.live-discussion__all:focus-visible {
  border-color: color-mix(in srgb, var(--accent-main) 42%, var(--border));
  background: var(--accent-main-soft);
  color: var(--accent-main);
}

.live-discussion__all .i-svg {
  width: 14px;
  height: 14px;
}

.theme-dark .live-discussion {
  border-color: color-mix(in srgb, var(--accent-main) 24%, var(--border));
}

.theme-dark .live-comment__avatar {
  box-shadow: 0 0 0 1px var(--border), 0 5px 14px rgba(0, 0, 0, .24);
}

@media (prefers-reduced-motion: reduce) {
  .live-discussion__pulse {
    animation: none;
  }

  .live-discussion__head-link,
  .live-comment__post-arrow {
    transition: none;
  }
}
