.receipt-btn {
  border: 1px solid #29547e;
  border-radius: 7px;
  background: transparent;
  color: #5caaff;
  padding: 7px 10px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.analytics-controls { display: flex; gap: 9px; }
.analytics-controls select { border: 1px solid #dce5ee; border-radius: 9px; padding: 10px 12px; background: #fff; color: #41546b; font: 700 11px "DM Sans"; }
.client-analytics-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.client-analytics-metrics article { padding: 19px; border: 1px solid #dce5ee; border-radius: 13px; background: #fff; }
.client-analytics-metrics small, .client-analytics-metrics strong { display: block; }
.client-analytics-metrics small { color: #7a8a9e; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.client-analytics-metrics strong { margin-top: 5px; color: #07192d; font: 800 27px Manrope; }
.client-chart-shell { padding: 22px; border: 1px solid #dce5ee; border-radius: 14px; background: #fff; }
#clientAudienceChart { display: none; width: 100%; height: 250px; }
#clientAudienceChart.has-data { display: block; }
.client-chart-grid { stroke: #e6edf4; stroke-width: 1; vector-effect: non-scaling-stroke; }
.client-chart-area { fill: url(#clientChartGradient); }
.client-chart-average { fill: none; stroke: #147cff; stroke-width: 3; vector-effect: non-scaling-stroke; }
.client-chart-peak { fill: none; stroke: #13b9b3; stroke-width: 1.5; stroke-dasharray: 6 6; vector-effect: non-scaling-stroke; }
.client-chart-empty { padding: 80px 20px; color: #8292a4; text-align: center; font-size: 11px; }
.client-analytics-foot { display: flex; justify-content: space-between; gap: 16px; padding-top: 13px; border-top: 1px solid #edf1f5; color: #77899d; font-size: 10px; }

@media (max-width: 760px) {
  .analytics-controls { width: 100%; flex-direction: column; }
  .client-analytics-metrics { grid-template-columns: 1fr 1fr; }
  .client-analytics-foot { flex-direction: column; }
}

.receipt-btn:hover {
  background: rgba(24, 127, 255, 0.12);
}

.pill.wait {
  background: rgba(255, 184, 77, 0.12);
  color: #ffb84d;
}

.signal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #42566d;
}

.signal-dot.live {
  background: #29d394;
  box-shadow: 0 0 0 5px rgba(41, 211, 148, 0.1);
}

.stream-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.stream-actions button {
  flex: 1;
  border: 1px solid #29547e;
  border-radius: 8px;
  padding: 10px 12px;
  color: #dceeff;
  background: #102944;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.stream-actions .listen-btn {
  border-color: #167fff;
  background: #167fff;
  color: #fff;
}

.stream-actions button:disabled {
  border-color: #24384e;
  background: #122033;
  color: #60758b;
  cursor: not-allowed;
}

.stream-player {
  position: fixed;
  z-index: 20;
  right: 24px;
  bottom: 24px;
  left: 24px;
  display: grid;
  grid-template-columns: auto minmax(140px, 1fr) minmax(260px, 520px) auto;
  align-items: center;
  gap: 18px;
  width: min(920px, calc(100% - 48px));
  margin: auto;
  padding: 15px 18px;
  border: 1px solid #28547d;
  border-radius: 15px;
  background: rgba(7, 19, 33, 0.97);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
}

.player-live {
  color: #29d394;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
}

.player-live span {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: #29d394;
}

.player-copy small,
.player-copy strong {
  display: block;
}

.player-copy small {
  color: #71869d;
  font-size: 8px;
  letter-spacing: .12em;
}

.player-copy strong {
  margin-top: 3px;
  font-size: 13px;
}

.stream-player audio {
  width: 100%;
  height: 36px;
}

#closePlayer {
  border: 0;
  background: transparent;
  color: #89a0b8;
  font-size: 24px;
  cursor: pointer;
}

@media (max-width: 700px) {
  .stream-player {
    grid-template-columns: 1fr auto;
  }

  .player-live {
    display: none;
  }

  .stream-player audio {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

.stream-actions {
  flex-wrap: wrap;
}

.stream-actions .encoder-data-btn {
  flex-basis: 100%;
  border-color: #2c5c89;
  background: transparent;
}

.encoder-access {
  position: relative;
  width: min(720px, calc(100% - 32px));
  max-height: min(90vh, 780px);
  overflow: auto;
  border: 1px solid rgba(68, 151, 255, .34);
  border-radius: 24px;
  padding: 0;
  background: linear-gradient(155deg, #0d2238 0%, #071521 62%, #081827 100%);
  color: #eff7ff;
  box-shadow: 0 38px 110px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 255, 255, .025) inset;
}

.encoder-access[open] {
  animation: encoderIn .2s ease-out;
}

@keyframes encoderIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.encoder-access::backdrop {
  background: rgba(1, 7, 13, .82);
  backdrop-filter: blur(8px);
}

.encoder-glow {
  position: absolute;
  top: -125px;
  left: -85px;
  width: 340px;
  height: 260px;
  border-radius: 50%;
  background: rgba(24, 127, 255, .18);
  filter: blur(58px);
  pointer-events: none;
}

.encoder-dialog-head {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 22px;
  padding: 28px 30px 23px;
}

.encoder-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.encoder-signal-icon {
  display: grid;
  flex: 0 0 52px;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(80, 166, 255, .42);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(31, 139, 255, .28), rgba(24, 127, 255, .08));
  box-shadow: 0 12px 28px rgba(0, 72, 166, .2);
}

.encoder-signal-icon svg {
  width: 28px;
  stroke: #55acff;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.encoder-dialog-head .eyebrow {
  margin: 0 0 5px;
}

.encoder-dialog-head h2 {
  margin: 0;
  overflow: hidden;
  font: 800 clamp(22px, 4vw, 29px)/1.08 Manrope;
  letter-spacing: -.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.encoder-dialog-head h2 + p {
  margin: 7px 0 0;
  color: #7f97af;
  font-size: 12px;
}

.encoder-close {
  display: grid;
  flex: 0 0 38px;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid #203d5b;
  border-radius: 12px;
  background: rgba(7, 21, 34, .72);
  color: #8da6bd;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.encoder-close:hover {
  border-color: #3c6f9e;
  background: #102944;
  color: #fff;
}

.encoder-close:focus-visible,
.encoder-password button:focus-visible,
.encoder-dialog-actions button:focus-visible {
  outline: 2px solid #57adff;
  outline-offset: 2px;
}

.encoder-connection {
  position: relative;
  margin: 0 28px;
  padding: 18px 19px 17px;
  border: 1px solid rgba(55, 126, 194, .32);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(18, 48, 77, .86), rgba(9, 28, 46, .74));
}

.connection-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  color: #65d8b2;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
}

.connection-label > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #35d49c;
  box-shadow: 0 0 0 5px rgba(53, 212, 156, .09);
}

.connection-grid {
  display: grid;
  grid-template-columns: 2fr .65fr .9fr;
  gap: 10px;
}

.connection-grid label,
.credential-row label,
.encoder-password {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.connection-grid label > span,
.credential-row label > span,
.encoder-password > span {
  color: #6f88a1;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.connection-grid input {
  min-width: 0;
  border: 0;
  padding: 0;
  outline: 0;
  background: transparent;
  color: #eaf5ff;
  font: 700 12px "DM Sans", sans-serif;
}

.connection-grid label:not(:first-child) {
  padding-left: 13px;
  border-left: 1px solid rgba(68, 108, 146, .35);
}

.encoder-credentials {
  margin: 22px 28px 0;
}

.encoder-section-title {
  margin: 0 0 12px;
  color: #b6c9db;
  font-size: 11px;
  font-weight: 700;
}

.credential-row {
  display: grid;
  grid-template-columns: .75fr 1.25fr;
  gap: 10px;
  margin-bottom: 10px;
}

.credential-row label,
.encoder-password {
  padding: 12px 14px;
  border: 1px solid #1f3a55;
  border-radius: 12px;
  background: rgba(5, 17, 29, .62);
}

.credential-row input,
.encoder-password input {
  min-width: 0;
  width: 100%;
  border: 0;
  padding: 0;
  outline: 0;
  background: transparent;
  color: #eaf5ff;
  font: 700 13px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.encoder-password {
  border-color: rgba(43, 128, 216, .55);
  background: linear-gradient(110deg, rgba(15, 47, 77, .78), rgba(7, 23, 37, .78));
  box-shadow: 0 0 0 1px rgba(24, 127, 255, .04) inset;
}

.encoder-password > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.encoder-password button {
  border: 0;
  border-radius: 8px;
  padding: 7px 12px;
  background: rgba(24, 127, 255, .15);
  color: #67b2ff;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.encoder-password button:hover {
  background: rgba(24, 127, 255, .25);
  color: #fff;
}

.encoder-warning {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 14px 28px 0;
  padding: 10px 13px;
  border: 1px solid rgba(255, 184, 77, .16);
  border-radius: 11px;
  background: rgba(255, 184, 77, .055);
  color: #a9b9c9;
  font-size: 10px;
  line-height: 1.45;
}

.encoder-warning > span:first-child {
  color: #ffbd58;
  font-size: 11px;
}

.encoder-warning strong {
  display: block;
  color: #efc67f;
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.encoder-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  padding: 19px 28px 23px;
  border-top: 1px solid rgba(42, 72, 101, .48);
  background: rgba(4, 14, 24, .45);
}

.encoder-dialog-actions button {
  border: 1px solid #284864;
  border-radius: 10px;
  padding: 11px 16px;
  background: #10263c;
  color: #a9bdd0;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.encoder-dialog-actions button:hover {
  border-color: #3c6e9a;
  transform: translateY(-1px);
}

#copyClientEncoder {
  border-color: #167fff;
  background: linear-gradient(135deg, #1887ff, #0868df);
  color: white;
  box-shadow: 0 10px 24px rgba(8, 104, 223, .22);
}

#copyClientEncoder::before {
  content: "⧉";
  margin-right: 7px;
}

@media (max-width: 600px) {
  .encoder-access {
    width: calc(100% - 20px);
    max-height: calc(100vh - 20px);
    border-radius: 19px;
  }

  .encoder-dialog-head {
    padding: 22px 20px 19px;
  }

  .encoder-signal-icon {
    display: none;
  }

  .encoder-dialog-head h2 {
    max-width: calc(100vw - 115px);
  }

  .encoder-connection,
  .encoder-credentials {
    margin-right: 18px;
    margin-left: 18px;
  }

  .connection-grid {
    grid-template-columns: 1fr 1fr;
    row-gap: 14px;
  }

  .connection-grid label:first-child {
    grid-column: 1 / -1;
  }

  .connection-grid label:nth-child(2) {
    padding-left: 0;
    border-left: 0;
  }

  .credential-row {
    grid-template-columns: 1fr;
  }

  .encoder-warning {
    margin-right: 18px;
    margin-left: 18px;
  }

  .encoder-dialog-actions {
    padding: 17px 18px 20px;
  }

  .encoder-dialog-actions button {
    flex: 1;
    padding-right: 10px;
    padding-left: 10px;
  }
}
