/* radio.css — резервный контур "Радио".
   Стилистика повторяет личный чат (mes_mail.pug): фон #e6ddd4, белые пузыри,
   зелёный акцент #198754, пилюля-композер снизу. */

* { box-sizing: border-box; }

.rj-screen {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 8px 0;
  background: #e6ddd4;
  color: #111b21;
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  height: 100dvh;
  overflow: hidden;
}

.rj-screen[hidden] { display: none !important; }

/* ------------------------------------------------------------------ шапка */
.rj-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.rj-round {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cfc6bc;
  border-radius: 50%;
  background: #fff;
  color: #3b4a54;
  cursor: pointer;
}

.rj-round:hover:not(:disabled) { background: #f4f0ec; }

.rj-round:disabled,
.rj-round.rj-off {
  background: #ded6cd;
  border-color: #ded6cd;
  color: #9aa4ad;
  cursor: not-allowed;
}

.rj-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.rj-status { font-size: 11px; font-weight: 400; color: #667781; }
.rj-status.rj-ok { color: #0b6b3a; }
.rj-status.rj-bad { color: #a12020; }

.rj-me {
  flex: 0 0 auto;
  font-size: 11px;
  color: #667781;
  max-width: 34%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------------------------------------- собеседники */
.rj-peers {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  min-height: 30px;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.rj-peers::-webkit-scrollbar { display: none; }

.rj-peer {
  flex: 0 0 auto;
  padding: 5px 12px;
  border: 1px solid #cfc6bc;
  border-radius: 999px;
  background: #fff;
  color: #111b21;
  font-size: 12.5px;
  cursor: pointer;
}

.rj-peer.rj-active {
  background: #198754;
  border-color: #198754;
  color: #fff;
  font-weight: 600;
}

.rj-nope { font-size: 11.5px; color: #8a5a00; padding: 4px 2px; }

/* ----------------------------------------------------------------- правила */
.rj-rules {
  flex: 0 0 auto;
  background: #fff8e8;
  border: 1px solid #f0dcb0;
  border-radius: 10px;
  font-size: 11.5px;
  color: #6b551f;
}

.rj-rules > summary {
  padding: 5px 10px;
  cursor: pointer;
  font-weight: 600;
  color: #8a5a00;
  list-style: none;
  user-select: none;
}

.rj-rules > summary::-webkit-details-marker { display: none; }

.rj-rules > summary::after {
  content: "▸";
  float: right;
  transition: transform .15s;
}

.rj-rules[open] > summary::after { transform: rotate(90deg); }

.rj-rules-body {
  padding: 0 10px 8px;
  line-height: 1.5;
}

/* ----------------------------------------------------------------- брокеры */
.rj-brokers {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 0 2px;
}

.rj-broker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  color: #667781;
}

.rj-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cdd3d8;
  display: inline-block;
  flex: 0 0 auto;
}

.rj-dot.rj-sub.rj-on { background: #198754; box-shadow: 0 0 4px rgba(25, 135, 84, .7); }
.rj-dot.rj-sub.rj-wait { background: #e0a800; }
.rj-dot.rj-echo.rj-on { background: #198754; box-shadow: 0 0 6px rgba(25, 135, 84, .9); }

.rj-bname { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------- лента */
.rj-wall {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 2px 96px;
  overscroll-behavior: contain;
}

.rj-row { display: flex; margin-bottom: 4px; }
.rj-row.rj-right { justify-content: flex-end; }
.rj-row.rj-left { justify-content: flex-start; }

.rj-bubble {
  max-width: 82%;
  padding: 5px 8px 4px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 1px rgba(11, 20, 26, .12);
  word-break: break-word;
  overflow-wrap: anywhere;
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.rj-row.rj-right .rj-bubble {
  background: #e3fad4;
  border-bottom-right-radius: 4px;
}

.rj-row.rj-left .rj-bubble {
  border-bottom-left-radius: 4px;
}

.rj-text { font-size: 13px; line-height: 1.3; white-space: pre-wrap; }

.rj-time {
  flex: 0 0 auto;
  font-size: 9.5px;
  color: #667781;
  white-space: nowrap;
}

.rj-row.rj-right .rj-time { color: #4f7a4e; }

.rj-empty {
  color: #9aa4ad;
  font-size: 12px;
  text-align: center;
  padding: 34px 0;
}

/* --------------------------------------------------------------- композер */
.rj-composer-wrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, #e6ddd4 72%, rgba(230, 221, 212, 0));
}

.rj-composer {
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(11, 20, 26, .14);
  padding: 3px 4px 3px 12px;
  overflow: hidden;
}

.rj-count {
  height: 3px;
  border-radius: 2px;
  background: #eceff1;
  overflow: hidden;
  margin: 0 2px 3px;
}

#radio_count_fill {
  display: block;
  height: 100%;
  width: 100%;
  background: #198754;
  transition: width 1s linear;
}

.rj-composer-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rj-composer-row input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 6px 2px;
  font-size: 14px;
  color: #111b21;
}

.rj-composer-row input::placeholder { color: #9aa4ad; }

.rj-count-text {
  flex: 0 0 auto;
  font-size: 10.5px;
  color: #667781;
  min-width: 34px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rj-send {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #198754;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}

.rj-send img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 50%;
}

.rj-send.rj-busy { background: #cdd3d8; cursor: not-allowed; }
.rj-send:disabled { cursor: not-allowed; }

/* ------------------------------------------------------------------ модалка */
.rj-modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 28, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
}

.rj-modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .3);
}

.rj-modal-title { margin: 0 0 16px; font-size: 15px; line-height: 1.45; }

.rj-modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

.rj-btn {
  padding: 9px 14px;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid #cfd6dd;
  background: #fff;
  color: #1f2328;
  cursor: pointer;
}

.rj-btn-go {
  background: #198754;
  border-color: #198754;
  color: #fff;
  font-weight: 600;
}

.rj-btn:disabled { opacity: .6; cursor: progress; }

@media (max-width: 420px) {
  .rj-title { font-size: 14px; }
  .rj-me { display: none; }
  .rj-bname { max-width: 74px; }
}
