.commentary-dialog {
  width: min(980px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 32px));
  overflow: auto;
  padding: 0;
  background: #fff;
  border: 1px solid #d9dde3;
}

.commentary-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 44px;
  align-items: center;
  gap: 18px;
  padding: 24px 26px;
  border-bottom: 1px solid #e4e7eb;
}

.commentary-head h2 {
  margin: 3px 0 0;
  font-size: clamp(22px, 3vw, 34px);
}

.commentary-live-state {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 112px;
  color: #707783;
  font-size: 12px;
  font-weight: 900;
}

.commentary-live-state i,
.commentary-dock-main i {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #aeb4bd;
}

.commentary-live-state[data-status="live"] {
  color: #d51e36;
}

.commentary-live-state[data-status="live"] i,
.commentary-dock-main i {
  background: #e21d38;
  box-shadow: 0 0 0 5px rgba(226, 29, 56, .12);
  animation: commentary-pulse 1.6s ease-in-out infinite;
}

.commentary-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid #e4e7eb;
}

.commentary-overview > div {
  min-width: 0;
  padding: 19px 24px;
  border-right: 1px solid #e4e7eb;
}

.commentary-overview > div:last-child {
  border-right: 0;
}

.commentary-overview span,
.commentary-manager-head span,
.commentary-device > span,
.commentary-volume > span {
  display: block;
  margin-bottom: 6px;
  color: #737b87;
  font-size: 10px;
  font-weight: 900;
}

.commentary-overview strong {
  display: block;
  overflow: hidden;
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commentary-main {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, .88fr);
}

.commentary-console {
  padding: 28px 26px 30px;
}

.commentary-manager {
  padding: 28px 26px 30px;
  border-left: 1px solid #e4e7eb;
  background: #f7f8fa;
}

.commentary-connection {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 20px;
  min-height: 108px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e4e7eb;
}

.commentary-connection span {
  display: block;
  margin-bottom: 5px;
  color: #737b87;
  font-size: 12px;
  font-weight: 800;
}

.commentary-connection strong {
  display: block;
  font-size: 19px;
}

.commentary-signal {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  width: 76px;
  height: 48px;
}

.commentary-signal i {
  width: 6px;
  height: calc(6px + var(--level, 0) * 4px);
  min-height: 6px;
  max-height: 44px;
  border-radius: 2px 2px 0 0;
  background: #d8dce2;
  transition: height 80ms linear, background 80ms linear;
}

.commentary-signal i.active {
  background: #e8b21e;
}

.commentary-device,
.commentary-volume {
  display: block;
  margin-top: 22px;
}

.commentary-device select {
  width: 100%;
}

.commentary-volume span {
  display: flex;
  justify-content: space-between;
}

.commentary-volume input {
  width: 100%;
  accent-color: #e8b21e;
}

.commentary-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 25px;
}

.commentary-controls button {
  min-height: 46px;
}

.commentary-manager-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.commentary-manager-head > div:last-child {
  display: flex;
  gap: 7px;
}

.commentary-manager-head button {
  min-height: 38px;
  padding: 0 14px;
}

.commentary-staff {
  display: grid;
  gap: 1px;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid #dfe3e8;
  border-radius: 6px;
  background: #dfe3e8;
}

.commentary-staff-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 9px 12px;
  background: #fff;
}

.commentary-staff-row strong,
.commentary-staff-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commentary-staff-row small {
  margin-top: 2px;
  color: #777f8a;
  font-size: 10px;
}

.commentary-staff-row button {
  min-width: 80px;
  min-height: 34px;
}

.commentary-dock {
  position: fixed;
  z-index: 1150;
  left: 18px;
  bottom: 18px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  max-width: min(430px, calc(100vw - 36px));
  min-height: 58px;
  border: 1px solid #20242b;
  border-radius: 7px;
  background: #101216;
  color: #fff;
  box-shadow: 0 14px 38px rgba(0, 0, 0, .24);
}

.commentary-dock.hidden {
  display: none;
}

.commentary-dock button {
  border: 0;
  border-right: 1px solid #343942;
  border-radius: 0;
  background: transparent;
  color: inherit;
}

.commentary-dock-main {
  min-width: 220px;
  padding: 9px 16px;
  text-align: left;
}

.commentary-dock-main span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ff5368;
  font-size: 10px;
  font-weight: 900;
}

.commentary-dock-main strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commentary-dock-icon {
  min-width: 58px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 900;
}

@keyframes commentary-pulse {
  50% { opacity: .55; }
}

@media (max-width: 760px) {
  .commentary-dialog {
    width: 100%;
    max-height: 100%;
    min-height: 100%;
    border: 0;
    border-radius: 0;
  }

  .commentary-head {
    grid-template-columns: minmax(0, 1fr) 44px;
    padding: 18px;
  }

  .commentary-live-state {
    grid-column: 1;
    grid-row: 2;
  }

  .commentary-head > .icon-button {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .commentary-overview {
    grid-template-columns: repeat(2, 1fr);
  }

  .commentary-overview > div:nth-child(2) {
    border-right: 0;
  }

  .commentary-overview > div:nth-child(-n + 2) {
    border-bottom: 1px solid #e4e7eb;
  }

  .commentary-overview strong {
    font-size: 13px;
  }

  .commentary-main {
    grid-template-columns: 1fr;
  }

  .commentary-manager {
    border-top: 1px solid #e4e7eb;
    border-left: 0;
  }

  .commentary-connection {
    grid-template-columns: 1fr;
  }

  .commentary-signal {
    width: 100%;
  }

  .commentary-signal i {
    flex: 1;
  }

  .commentary-controls button {
    flex: 1 1 140px;
  }

  .commentary-dock {
    right: 12px;
    bottom: 12px;
    left: 12px;
    max-width: none;
  }

  .commentary-dock-main {
    min-width: 0;
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .commentary-live-state i,
  .commentary-dock-main i {
    animation: none;
  }
}
