:root {
  --bg: #101216;
  --panel: #181b21;
  --panel-2: #1f232b;
  --line: #2b303a;
  --text: #e6e8ec;
  --dim: #9099a8;
  --accent: #f5a524;
  --accent-ink: #1a1405;
  --ok: #3dd68c;
  --warn: #f5a524;
  --bad: #e5484d;
  --rec: #e5484d;
  --radius: 10px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-size: 15px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; }
.boot { padding: 40px; color: var(--dim); }

button, input, select, textarea { font: inherit; color: inherit; }
button {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 12px; cursor: pointer; white-space: nowrap;
}
button:hover:not(:disabled) { border-color: #4a5160; background: #262b35; }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.primary:hover:not(:disabled) { background: #ffb93d; border-color: #ffb93d; }
button.ghost { background: transparent; border-color: transparent; color: var(--dim); padding: 4px 8px; }
button.ghost:hover:not(:disabled) { color: var(--text); background: var(--panel-2); }
button.danger:hover:not(:disabled) { color: var(--bad); border-color: var(--bad); }
input[type=text], input[type=number], input[type=date], select, textarea {
  background: #12151a; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; min-width: 0;
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label { color: var(--dim); font-size: 13px; }

/* ---- общий каркас ---- */
.top {
  display: flex; align-items: center; gap: 14px; padding: 10px 18px;
  border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 20;
}
.top .brand { font-weight: 700; color: var(--text); letter-spacing: .2px; }
.top .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.top .who { color: var(--dim); font-size: 13px; }
.pill { font-size: 12px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--dim); }
.pill.ok { color: var(--ok); border-color: #1f5a41; }
.pill.bad { color: var(--bad); border-color: #6b2428; }
.pill.rec { color: #fff; background: var(--rec); border-color: var(--rec); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .55; } }

.page { max-width: 900px; margin: 0 auto; padding: 22px 16px 60px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.dim { color: var(--dim); }
.small { font-size: 13px; }

/* ---- список выпусков ---- */
.ep-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.ep { display: flex; align-items: center; gap: 12px; }
.ep .num { font-weight: 700; color: var(--accent); min-width: 48px; font-variant-numeric: tabular-nums; }
.ep .name { flex: 1; min-width: 0; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.new-ep { margin-top: 18px; }
.new-ep .row > div { display: flex; flex-direction: column; gap: 4px; }

/* ---- студия ---- */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 18px; padding: 16px 18px 90px; max-width: 1500px; margin: 0 auto; }
.script { min-width: 0; }
.mixer { position: sticky; top: 62px; align-self: start; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 136px); overflow-y: auto; }
@media (max-width: 980px) {
  .studio { grid-template-columns: 1fr; }
  .mixer { position: static; max-height: none; order: -1; }
}

.sec { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
.sec.active { border-color: var(--accent); background: #1e1b13; box-shadow: 0 0 0 1px var(--accent) inset; }
.sec.locked { border-left-color: #5b8def; }
.sec-head { display: flex; align-items: center; gap: 6px; padding: 8px 8px 0 8px; }
.sec-num { width: 34px; height: 30px; border-radius: 8px; padding: 0; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--dim); }
.sec.active .sec-num { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.sec-title { flex: 1; font-weight: 600; font-size: 16px; background: transparent !important; border-color: transparent !important; }
.sec-title:hover { border-color: var(--line) !important; }
.sec-info { font-size: 12px; color: var(--dim); white-space: nowrap; }
.sec.active .sec-info { color: var(--accent); font-weight: 600; }
.sec.locked .sec-info { color: #8fb1ff; }
.sec-body {
  display: block; width: calc(100% - 16px); margin: 4px 8px 8px; resize: none; overflow: hidden; min-height: 44px;
  line-height: 1.5; background: transparent !important; border-color: transparent !important; white-space: pre-wrap;
}
.sec-body:hover { border-color: var(--line) !important; }
.sec-body[readonly], .sec-title[readonly] { opacity: .75; }
.sec.active .sec-body { font-size: 17px; }
.add-sec { width: 100%; border-style: dashed; color: var(--dim); padding: 10px; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: flex; gap: 10px; align-items: center; justify-content: center;
  padding: 10px 16px; background: rgba(16, 18, 22, .92); backdrop-filter: blur(6px); border-top: 1px solid var(--line);
}
.nav .now { min-width: 0; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); }
.nav .now b { color: var(--accent); }

/* ---- микшер ---- */
.mixer h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--dim); margin-bottom: 8px; }
.rec-box { display: flex; align-items: center; gap: 12px; }
.rec-btn { flex: 1; padding: 11px; font-weight: 700; border-radius: 10px; }
.rec-btn .dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--rec); margin-right: 8px; vertical-align: -1px; }
.rec-btn.on { background: var(--rec); border-color: var(--rec); color: #fff; }
.rec-btn.on .dot { background: #fff; border-radius: 2px; }
.rec-time { font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 600; min-width: 84px; text-align: right; }
.rec-time.on { color: var(--rec); }
.rec-note { margin-top: 8px; font-size: 12px; color: var(--dim); }

.strip { padding: 8px 0; border-top: 1px solid var(--line); }
.strip:first-of-type { border-top: 0; padding-top: 0; }
.strip-head { display: flex; align-items: center; gap: 8px; }
.led { width: 9px; height: 9px; border-radius: 50%; background: #4a5160; flex: none; }
.led.ok { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.led.warn { background: var(--warn); }
.led.bad { background: var(--bad); box-shadow: 0 0 6px var(--bad); }
.strip-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip-state { font-size: 12px; color: var(--dim); }
.meter { height: 9px; background: #0b0d10; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; margin: 6px 0 4px; position: relative; }
.meter > i {
  display: block; height: 100%; width: 0; transition: width .09s linear;
  background: linear-gradient(90deg, #2fbf7a 0%, #3dd68c 62%, #f5a524 82%, #e5484d 100%); background-size: 340px 100%;
}
.strip-foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.strip-foot input[type=range] { width: 90px; accent-color: var(--accent); margin-left: auto; }

.mic-grid { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px 10px; align-items: center; }
.mic-grid select { width: 100%; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.checks label { display: flex; align-items: center; gap: 5px; color: var(--text); font-size: 13px; }
.mic-actions { display: flex; gap: 8px; margin-top: 10px; }
.mic-actions button { flex: 1; }
button.muted { background: var(--bad); border-color: var(--bad); color: #fff; }
.hint { font-size: 12px; color: var(--dim); margin-top: 8px; line-height: 1.4; }

.take { padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.take:first-of-type { border-top: 0; padding-top: 0; }
.take-files { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.take-files span { color: var(--dim); }

/* ---- уведомления ---- */
#toasts { position: fixed; right: 16px; bottom: 70px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: 10px 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, .4); }
.toast.bad { border-left-color: var(--bad); }

table.users { width: 100%; border-collapse: collapse; margin-top: 10px; }
table.users td { padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: middle; }
table.users input { width: 100%; font-size: 12px; }
.mic-grid .row { flex-wrap: nowrap; }
.mic-grid .row select { width: auto; flex: 1; }
