:root {
  --bg: #0f1115;
  --card: #171a21;
  --line: #262b36;
  --text: #e8eaf0;
  --muted: #8a91a2;
  --accent: #c8f53a;      /* салатовый Levin Tools */
  --accent-text: #17181b;
  --live: #3ccf6e;
  --warn: #f08a3c;
  --err: #ff6b6b;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  /* Страница не «ездит» резинкой на телефоне (Андрей, 09.11.2026); прокрутка остаётся, только если всё не влезает на экран */
  overscroll-behavior: none;
}

body {
  min-height: 100vh;
  min-height: 100dvh; /* высота экрана телефона без панелей браузера */
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 16px 32px;
}

.card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px 16px;
}

.card.wide { max-width: 760px; }

.topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand picture { display: flex; flex: none; }
.brand-logo { display: block; height: 26px; width: auto; } /* логотип Levin Remote Studio (горизонтальный, для тёмного фона) */
.brand-sep { width: 1px; height: 16px; background: var(--line); flex: none; }



h1 {
  font-size: 22px;
  line-height: 1.25;
  margin: 14px 0 18px;
  word-break: break-word;
}

h2 { font-size: 17px; margin: 22px 0 10px; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--muted);
}

input[type=password], input[type=text], select {
  width: 100%;
  font: inherit;
  font-size: 17px;
  color: var(--text);
  background: #0f1218;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

input[type=range] { width: 100%; accent-color: var(--accent); height: 28px; }

.btn {
  font: inherit;
  border: 1px solid var(--line);
  background: #222733;
  color: var(--text);
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.btn.danger { color: var(--err); }
.btn.big { width: 100%; font-size: 18px; padding: 14px 16px; }
.btn.small { padding: 6px 10px; font-size: 14px; }

.row { margin: 22px 0 18px; } /* от Lossless до кнопки столько же, сколько от плиток статистики до Lossless (38 px) */

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 16px;
}
.status .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--muted);
  flex: none;
}
.status.live .dot { background: var(--live); box-shadow: 0 0 0 4px rgba(60, 207, 110, .18); }
.status.wait .dot { background: var(--warn); }
.status.off .dot { background: var(--muted); }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 6px; /* статистика идёт сразу после статуса; Quality с Lossless поднят ближе к ней (Андрей, 09.11.2026) */
}
.stats div {
  background: #12151b;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  min-width: 0;
}
.stats dt { font-size: 12px; color: var(--muted); }
.stats dd { margin: 2px 0 0; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.msg { min-height: 1.4em; margin: 14px 0 0; color: var(--muted); font-size: 15px; }
.msg.err { color: var(--err); }

.muted { color: var(--muted); }

/* ---- админка ---- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

.linkbox {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #12151b;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  margin: 6px 0 0;
}
.linkbox input {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  padding: 6px 8px;
  background: transparent;
  border: none;
}

.sessions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sessions li {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #13161c;
}
.sessions .head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.sessions .name { font-weight: 600; word-break: break-word; }
.sessions .name .sysname { font-weight: 400; font-size: 13px; }
.sessions .lamp { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-left: 8px; vertical-align: middle;
  border: 1px solid var(--line); background: transparent; }
.sessions .lamp.on { background: #3ddc84; border-color: #3ddc84; box-shadow: 0 0 6px rgba(61, 220, 132, .7); }
.sessions .meta { color: var(--muted); font-size: 14px; margin-top: 4px; }
.sessions .actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.sessions .actions .vol { flex: 1 1 120px; max-width: 220px; height: 24px; margin: 0; }

.bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* Переговорная связь — кнопка Talk (блок 23, эскиз утверждён 09.11.2026) */
.tbwrap { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 6px 0 12px; }
.tb {
  width: 84px; height: 84px; border-radius: 50%;
  border: 3px solid var(--err); background: rgba(255, 107, 107, .10);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
  transition: background .12s, box-shadow .12s, transform .08s;
}
.tb svg { width: 38px; height: 38px; fill: var(--err); transition: fill .12s; }
.tb:active { transform: scale(.97); }
.tb:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.tb.on { background: var(--err); box-shadow: 0 0 0 8px rgba(255, 107, 107, .22); animation: tb-pulse 1.2s ease-in-out infinite; }
.tb.on svg { fill: #fff; }
@keyframes tb-pulse { 0%, 100% { box-shadow: 0 0 0 8px rgba(255, 107, 107, .22); } 50% { box-shadow: 0 0 0 14px rgba(255, 107, 107, .10); } }
.tbcap { font-size: 13px; color: var(--muted); min-height: 1.4em; }
.tb.off { border-color: #3a3f4b; background: #161920; cursor: default; }
.tb.off svg { fill: #3a3f4b; }

/* Producer Talkback — страница с одной кнопкой (блок 25, эскиз утверждён 10.11.2026) */
body.producer { padding: 0; align-items: stretch; }
.pr-screen { width: 100%; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); }
.pr-top { display: flex; align-items: center; justify-content: space-between; }
.pr-state { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.pr-state .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.pr-state.live { color: var(--live); }
.pr-state.live .dot { background: var(--live); box-shadow: 0 0 0 4px rgba(60, 207, 110, .18); }
.pr-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.pr-field { width: 100%; max-width: 360px; }
.pr-field input { font-size: 28px; letter-spacing: .35em; text-align: center; padding: 14px 12px; border-radius: 12px; }
.pr-center .btn.big { max-width: 360px; }
.pr-tb {
  width: min(64vw, 280px); height: min(64vw, 280px); border-radius: 50%;
  border: 4px solid var(--err); background: rgba(255, 107, 107, .10);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
  transition: background .12s, box-shadow .12s, transform .08s;
}
.pr-tb svg { width: 42%; height: 42%; fill: var(--err); transition: fill .12s; }
.pr-tb:active { transform: scale(.97); }
.pr-tb.on { background: var(--err); box-shadow: 0 0 0 14px rgba(255, 107, 107, .22); animation: pr-pulse 1.2s ease-in-out infinite; }
.pr-tb.on svg { fill: #fff; }
.pr-tb.off { border-color: #3a3f4b; background: #161920; cursor: default; }
.pr-tb.off svg { fill: #3a3f4b; }
@keyframes pr-pulse { 0%, 100% { box-shadow: 0 0 0 14px rgba(255, 107, 107, .22); } 50% { box-shadow: 0 0 0 22px rgba(255, 107, 107, .10); } }
.pr-cap { font-size: 16px; color: var(--muted); min-height: 1.4em; }
.pr-msg { text-align: center; }
.pr-install { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14px; color: var(--muted); display: flex; flex-direction: column; gap: 10px; }
.pr-install-row { display: flex; gap: 8px; justify-content: flex-end; }
/* телефон вверх ногами — переворачиваем всё содержимое (iPhone сам на 180° не поворачивает) */
.pr-screen.flipped { transform: rotate(180deg); }
