.webinar-standby-backdrop {
  overflow: hidden;
  z-index: 12;
  background:
    linear-gradient(135deg, rgba(210, 228, 251, 0.16) 0 1px, transparent 1px 100%),
    linear-gradient(45deg, rgba(210, 228, 251, 0.08) 0 1px, transparent 1px 100%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07), transparent 22%, transparent 78%, rgba(255, 255, 255, 0.04)),
    linear-gradient(180deg, rgba(254, 212, 136, 0.12), transparent 34%, rgba(4, 22, 39, 0.4)),
    linear-gradient(135deg, #041627 0%, #122a40 54%, #07131f 100%);
  background-size: 92px 92px, 118px 118px, auto, auto, auto;
}

.webinar-standby-backdrop::before,
.webinar-standby-backdrop::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.webinar-standby-backdrop::before {
  left: 8%;
  right: 8%;
  bottom: -16%;
  height: 58%;
  border: 1px solid rgba(210, 228, 251, 0.18);
  border-radius: 22px;
  background:
    linear-gradient(90deg, transparent 0%, rgba(210, 228, 251, 0.16) 50%, transparent 100%),
    repeating-linear-gradient(90deg, rgba(210, 228, 251, 0.16) 0 1px, transparent 1px 42px),
    repeating-linear-gradient(0deg, rgba(210, 228, 251, 0.12) 0 1px, transparent 1px 34px);
  box-shadow: 0 0 80px rgba(210, 228, 251, 0.16), inset 0 0 48px rgba(255, 255, 255, 0.06);
  opacity: 0.72;
  transform: perspective(900px) rotateX(56deg);
  transform-origin: center bottom;
}

.webinar-standby-backdrop::after {
  left: 16%;
  right: 16%;
  top: 18%;
  height: 42%;
  border: 1px solid rgba(210, 228, 251, 0.24);
  border-radius: 18px;
  background:
    linear-gradient(120deg, rgba(210, 228, 251, 0.18), transparent 28%),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 28px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
  opacity: 0.88;
}

.webinar-prelive-overlay {
  background: rgba(4, 22, 39, 0.32);
}

.webinar-prelive-overlay:hover {
  background: rgba(4, 22, 39, 0.38);
}

.room-access-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 32px;
  background: linear-gradient(180deg, #f8fafc 0%, #edf3f7 100%);
  color: #041627;
  font-family: Manrope, Arial, sans-serif;
}

.room-access-panel {
  display: grid;
  grid-template-columns: 0.92fr 1fr;
  width: min(100%, 1120px);
  min-height: 640px;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 48px rgba(4, 22, 39, 0.12);
}

.room-access-visual {
  position: relative;
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: space-between;
  padding: 36px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(4, 22, 39, 0.16), rgba(4, 22, 39, 0.86)),
    linear-gradient(90deg, rgba(4, 22, 39, 0.72), rgba(4, 22, 39, 0.1)),
    url("assets/aspb-hero-consultation.png") center / cover;
  color: #fff;
}

.room-access-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.08) 50%, transparent 100%);
  opacity: 0.64;
}

.room-access-brand,
.room-access-visual-copy,
.room-access-visual-list {
  position: relative;
  z-index: 1;
}

.room-access-brand {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.room-access-brand span {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.room-access-brand small {
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  text-align: right;
}

.room-access-visual-copy {
  max-width: 420px;
}

.room-access-visual-copy p {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  font-weight: 800;
}

.room-access-visual-copy h2 {
  margin: 0;
  color: #fff;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.14;
  text-wrap: balance;
}

.room-access-visual-list {
  display: grid;
  gap: 12px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.room-access-visual-list span {
  display: flex;
  align-items: center;
  gap: 10px;
}

.room-access-visual-list i {
  display: inline-grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  font-size: 18px;
  font-style: normal;
}

.room-access-entry {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 38px 48px;
}

.room-access-back {
  display: inline-flex;
  width: fit-content;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  color: #4d5965;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.room-access-back .material-symbols-outlined {
  font-size: 18px;
}

.room-access-eyebrow {
  margin: 0 0 10px;
  color: #2966a3;
  font-size: 13px;
  font-weight: 800;
}

.room-access-title {
  margin: 0 0 14px;
  color: #041627;
  font-size: 40px;
  font-weight: 800;
  line-height: 1.08;
  text-wrap: balance;
}

.room-access-text {
  max-width: 600px;
  margin: 0;
  color: #44474c;
  font-size: 17px;
  line-height: 1.58;
  text-wrap: pretty;
}

.room-access-steps {
  display: grid;
  margin: 22px 0;
  border-top: 1px solid rgba(4, 22, 39, 0.1);
  border-bottom: 1px solid rgba(4, 22, 39, 0.1);
}

.room-access-steps div {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 13px;
  align-items: center;
  min-height: 52px;
  padding: 10px 0;
}

.room-access-steps div + div {
  border-top: 1px solid rgba(4, 22, 39, 0.08);
}

.room-access-steps span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #e9f3ff;
  color: #2966a3;
  font-size: 13px;
  font-weight: 900;
}

.room-access-steps p {
  margin: 0;
  color: #1d2b38;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.42;
}

.room-access-primary {
  display: inline-flex;
  width: 100%;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 8px;
  background: #041627;
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  font-weight: 800;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.room-access-primary:hover {
  background: #102f4c;
  box-shadow: 0 10px 18px rgba(4, 22, 39, 0.16);
  transform: translateY(-1px);
}

.room-access-primary:active {
  transform: scale(0.99);
}

.room-access-primary .material-symbols-outlined {
  font-size: 21px;
}

.room-access-note {
  margin: 12px 0 0;
  color: #5d6772;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.room-access-recovery {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(4, 22, 39, 0.1);
}

.room-access-recovery--open {
  margin-top: 20px;
  padding-top: 0;
  border-top: 0;
}

.room-access-recovery summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  list-style: none;
  color: #041627;
}

.room-access-recovery summary::-webkit-details-marker {
  display: none;
}

.room-access-recovery summary span {
  font-size: 18px;
  font-weight: 800;
}

.room-access-recovery summary strong {
  color: #2966a3;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.room-access-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
}

.room-access-label {
  display: grid;
  gap: 7px;
  color: #041627;
  font-size: 13px;
  font-weight: 700;
}

.room-access-input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(4, 22, 39, 0.16);
  border-radius: 8px;
  background: #fff;
  color: #041627;
  font: inherit;
  font-weight: 500;
}

.room-access-input::placeholder {
  color: #5e6368;
}

.room-access-submit {
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: #041627;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  white-space: nowrap;
  transition: background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.room-access-submit:hover {
  background: #102f4c;
  box-shadow: 0 10px 18px rgba(4, 22, 39, 0.16);
}

.room-access-submit:active {
  transform: scale(0.99);
}

.room-access-submit:disabled {
  cursor: wait;
  opacity: 0.72;
}

.room-access-status {
  grid-column: 1 / -1;
  min-height: 20px;
  margin: 0;
  color: #5e6368;
  font-size: 13px;
  line-height: 1.45;
}

.room-access-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.room-access-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #4d5965;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.room-access-secondary {
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(4, 22, 39, 0.14);
  border-radius: 8px;
  color: #041627;
}

.room-access-secondary .material-symbols-outlined {
  font-size: 18px;
}

@media (max-width: 980px) {
  .room-access-overlay {
    padding: 20px;
  }

  .room-access-panel {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .room-access-visual {
    min-height: 280px;
    padding: 28px;
  }

  .room-access-entry {
    padding: 32px;
  }

  .room-access-title {
    font-size: 32px;
  }

  .room-access-form {
    grid-template-columns: 1fr;
  }

  .room-access-submit {
    white-space: normal;
  }
}

@media (max-width: 620px) {
  .room-access-overlay {
    align-items: flex-start;
    padding: 12px;
  }

  .room-access-panel {
    width: 100%;
  }

  .room-access-visual {
    min-height: 220px;
    padding: 22px;
  }

  .room-access-brand {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .room-access-brand small {
    text-align: left;
  }

  .room-access-visual-copy h2 {
    font-size: 24px;
  }

  .room-access-visual-list {
    display: none;
  }

  .room-access-entry {
    padding: 26px 20px 24px;
  }

  .room-access-back {
    margin-bottom: 18px;
  }

  .room-access-title {
    font-size: 28px;
  }

  .room-access-text {
    font-size: 15px;
  }

  .room-access-recovery summary {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .room-access-primary,
  .room-access-submit {
    transition: none;
  }
}

#customSeekBarContainer {
  background: transparent !important;
  box-shadow: none !important;
}

#customSeekBarContainer::before,
#customSeekBarAvailable,
#customSeekBarProgress,
.custom-seek-hover {
  top: 50% !important;
  bottom: auto !important;
  height: 5px !important;
  min-height: 5px !important;
  max-height: 5px !important;
  transform: translateY(-50%) !important;
}

#customSeekBarContainer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

#customSeekBarProgress {
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.34) !important;
}

#customSeekBarThumb,
#customLiveEdgeMarker {
  width: 12px !important;
  height: 12px !important;
}

@media (max-width: 640px) {
  #customPlayerControls {
    padding: 12px;
    padding-top: 34px;
  }

  #customVolumeSlider {
    display: none;
  }
}

/* ===== Анимация появления сообщений в основном чате (chatMsgIn ссылается live-chat.js) ===== */
@keyframes chatMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Полноэкранный live-чат поверх плеера (как в YouTube) =====
   Виден только в fullscreen (класс .fs-chat-visible навешивает live-chat.js).
   Новые сообщения добавляются сверху, старые сдвигаются вниз и затухают по mask-градиенту. */
#fsChatOverlay {
  position: absolute;
  top: 4%;
  right: 0;
  bottom: 104px; /* не перекрывать customPlayerControls (z-30) */
  width: clamp(280px, 30%, 400px);
  padding: 0 16px 0 8px;
  display: none;
  flex-direction: column;
  justify-content: flex-start;
  z-index: 24; /* выше overlays (z-20), ниже окна спикера (z-25) и контролов (z-30):
                  при активных слайдах окно спикера всегда поверх чата без магических чисел */
  pointer-events: none; /* не блокировать видео и контролы */
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 52%, rgba(0,0,0,0) 100%);
          mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 52%, rgba(0,0,0,0) 100%);
}
#fsChatOverlay.fs-chat-visible { display: flex; }

#fsChatOverlayList {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fs-chat-msg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 12px;
  background: rgba(10, 14, 22, 0.46);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  animation: fsChatIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
  will-change: transform, opacity;
}
.fs-chat-msg-q { background: rgba(30, 64, 175, 0.5); }
.fs-chat-msg-mod { background: rgba(15, 118, 110, 0.5); border-left: 3px solid #2dd4bf; }

.fs-chat-avatar {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}

.fs-chat-body {
  min-width: 0;
  line-height: 1.35;
}
.fs-chat-author {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  margin-right: 5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.fs-chat-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.92);
  word-wrap: break-word;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

@keyframes fsChatIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
  #fsChatOverlay { width: 62%; top: 6%; bottom: 84px; }
  .fs-chat-text { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .fs-chat-msg { animation: none; }
}
