:root {
  color-scheme: dark;
  --bg: #0b1020;
  --panel: rgba(21, 27, 47, .9);
  --panel-2: #1c2440;
  --text: #f3f5ff;
  --muted: #a9b1ca;
  --accent: #8ea2ff;
  --good: #65d49a;
  --warn: #ffc96b;
  --bad: #ff7c8d;
  --border: rgba(255,255,255,.11);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0%, rgba(103, 84, 255, .25), transparent 35%),
    radial-gradient(circle at 90% 15%, rgba(0, 194, 255, .16), transparent 35%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
main { width: min(980px, calc(100% - 28px)); margin: 30px auto; }
h1 { margin: 0 0 8px; font-size: clamp(29px, 5vw, 46px); line-height: 1.05; }
h2 { margin: 0 0 14px; font-size: 20px; }
.lead { margin: 0 0 24px; color: var(--muted); line-height: 1.55; }
.card {
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 20px 55px rgba(0,0,0,.24);
  backdrop-filter: blur(12px);
}
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.full { grid-column: 1 / -1; }
label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 13px; font-weight: 750; }
input, select, textarea, button { font: inherit; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  background: var(--panel-2);
  color: var(--text);
  padding: 12px 13px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(142, 162, 255, .17);
}
textarea { min-height: 118px; resize: vertical; line-height: 1.5; }
button {
  border: 0;
  border-radius: 13px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 800;
  color: #0b1020;
  background: var(--accent);
  transition: transform .12s ease, opacity .12s ease;
}
button:hover:not(:disabled) { transform: translateY(-1px); }
button:disabled { cursor: not-allowed; opacity: .5; }
button.secondary { color: var(--text); background: #2a3458; border: 1px solid var(--border); }
button.danger { color: white; background: #b83d55; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.status-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.pill { padding: 7px 10px; border-radius: 999px; background: #252e4e; color: var(--muted); font-size: 13px; border: 1px solid var(--border); }
.pill.good { color: var(--good); }
.pill.warn { color: var(--warn); }
.pill.bad { color: var(--bad); }
.interim { min-height: 54px; padding: 14px; border-radius: 14px; background: rgba(255,255,255,.035); color: #cfd5eb; font-style: italic; line-height: 1.45; }
.notice { padding: 12px 14px; margin-top: 14px; border-left: 4px solid var(--warn); background: rgba(255, 201, 107, .08); color: #eed9b1; border-radius: 10px; line-height: 1.45; font-size: 14px; }
.log { max-height: 220px; overflow: auto; padding: 12px; border-radius: 12px; background: #090d19; color: #c9d0e6; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; }
.range-row { display: grid; grid-template-columns: 1fr 54px; gap: 10px; align-items: center; }
.tiny { color: var(--muted); font-size: 12px; line-height: 1.45; }
.link-box { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.listener-hero { text-align: center; padding: 34px 20px; }
.listener-hero .big { font-size: clamp(24px, 5vw, 40px); font-weight: 850; margin: 12px 0; }
.meter { height: 12px; border-radius: 999px; background: #090d19; overflow: hidden; margin-top: 15px; }
.meter > span { display: block; height: 100%; width: 0%; background: currentColor; transition: width .12s linear; }
code { color: #dbe0ff; }
.hidden { display: none !important; }
@media (max-width: 700px) {
  .grid { grid-template-columns: 1fr; }
  .full { grid-column: auto; }
  .link-box { grid-template-columns: 1fr; }
  main { margin-top: 18px; }
  .card { padding: 16px; border-radius: 16px; }
}

input[type="password"] { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }


/* Упрощённая страница слушателя */
.listener-page {
  width: min(560px, calc(100% - 28px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 20px 0;
}
.listener-minimal {
  width: 100%;
  margin: 0;
}
.listener-room,
.listener-volume {
  max-width: 420px;
  margin: 0 auto;
  text-align: left;
}
.listener-connect-actions,
.listener-status-row {
  justify-content: center;
}
.listener-connect-actions {
  margin-top: 18px;
}
.listener-volume {
  margin-top: 20px;
}
.listener-volume output {
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
