:root {
  --bg: #09090b; --side: #18181b; --card: #18181b; --row: rgba(9,9,11,.6); --line: #27272a; --line-2: #3f3f46;
  --text: #fafafa; --text-2: #d4d4d8; --muted: #a1a1aa; --dim: #71717a;
  --accent: #a970ff; --accent-h: #9a5cf5; --twitch: #9146ff; --twitch-h: #772ce8;
  --danger: #ff6568; --danger-bg: #9f0712; --ok: #4ade80; --warn: #fcbb00; --pink: #f472b6;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: "Inter", system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); }
ul { list-style: none; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: var(--line); padding: 1px 6px; border-radius: 5px; color: #d8c4ff; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- кнопки и поля ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px; font-weight: 500; white-space: nowrap; transition: background .15s, color .15s; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 15px; height: 15px; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-h); }
.btn--ghost { background: var(--line); color: var(--text-2); }
.btn--ghost:hover { background: var(--line-2); color: #fff; }
.btn--danger { background: var(--danger-bg); color: #fff; }
.btn--danger:hover { background: #bf000f; }
.btn--twitch { background: var(--twitch); color: #fff; }
.btn--twitch:hover { background: var(--twitch-h); }
.btn--sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.input { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; outline: none; width: 100%; transition: border-color .15s; }
.input:focus { border-color: var(--line-2); }
textarea.input { resize: vertical; min-height: 80px; }
select.input { cursor: pointer; }
.ibtn { width: 30px; height: 30px; border-radius: 8px; display: inline-grid; place-items: center; color: var(--muted); transition: .15s; flex-shrink: 0; }
.ibtn:hover { background: var(--line); color: var(--text); }
.ibtn--danger:hover { color: var(--danger); }
.ibtn svg { width: 16px; height: 16px; }

.switch { position: relative; width: 38px; height: 22px; flex-shrink: 0; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 22px; transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 4px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--dim); transition: .2s; }
.switch input:checked + span { background: var(--line-2); }
.switch input:checked + span::after { transform: translateX(16px); background: #fff; }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--line); color: var(--text-2); white-space: nowrap; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex-shrink: 0; }
.pill.ok i { background: var(--ok); }
.pill.warn i { background: var(--warn); }
.pill.bad i { background: var(--danger); }
.tag { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 5px; background: var(--line); color: var(--muted); }
.tag--reward { background: rgba(169,112,255,.18); color: #d8c4ff; }
.tag--prio { background: rgba(252,187,0,.15); color: var(--warn); }
.tag--spotify { background: rgba(30,215,96,.14); color: #1ed760; }
.tag--yandex { background: rgba(255,204,0,.14); color: #ffcc00; }

/* ---------- каркас ---------- */
.top { position: fixed; top: 0; left: 0; right: 0; height: 52px; z-index: 30; background: var(--side); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 12px; }
.top .menu-btn { width: 32px; height: 32px; border-radius: 8px; background: var(--line); color: var(--text-2); display: grid; place-items: center; }
.top .menu-btn:hover { background: var(--line-2); }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; }
.logo__ico { width: 28px; height: 28px; border-radius: 7px; background: var(--line); display: grid; place-items: center; color: var(--accent); }
.top__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--line-2); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; text-transform: uppercase; }

.side { position: fixed; top: 52px; bottom: 0; left: 0; width: 208px; background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 25; transition: transform .2s; }
.side__title { font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; padding: 14px 20px 8px; }
.side nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; overflow-y: auto; }
.navl { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text-2); font-size: 13px; transition: .15s; }
.navl:hover { background: var(--line); }
.navl.active { background: var(--line); color: #fff; }
.navl svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--muted); }
.navl .count { margin-left: auto; font-size: 11px; color: var(--muted); }
.navl--pink { color: var(--pink); } .navl--pink svg { color: var(--pink); }
.side__sep { height: 12px; }
.side__foot { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 12px 10px; display: flex; flex-direction: column; gap: 8px; }
.me { display: flex; align-items: center; gap: 10px; padding-left: 2px; min-width: 0; }
.me .avatar { flex-shrink: 0; }
.me b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me b { font-size: 13px; display: block; }
.me > div span { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.side__status { display: flex; flex-wrap: wrap; gap: 4px; }
.side__status .pill { font-size: 11px; padding: 2px 8px; }
.shade { position: fixed; inset: 0; background: rgba(9,9,11,.75); z-index: 24; display: none; }

.main { margin-left: 208px; padding: 64px 20px 40px; min-height: 100vh; }
.view { display: none; }
.view.active { display: block; }
.wrap { max-width: 1240px; margin: 0 auto; }
.wrap--narrow { max-width: 820px; margin: 0 auto; }
h2.h { font-size: 18px; font-weight: 700; margin: 24px 0 12px; }
h2.h:first-child { margin-top: 12px; }

/* ---------- карточки ---------- */
.card { background: var(--card); border-radius: 10px; overflow: hidden; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; min-height: 46px; }
.card__head h3 { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.card__head h3 svg { width: 16px; height: 16px; color: var(--muted); }
.card__body { padding: 0 14px 14px; }
.empty-state { display: grid; place-items: center; text-align: center; padding: 36px 16px; color: var(--text-2); }
.empty-state svg { width: 120px; height: 120px; color: var(--dim); margin-bottom: 12px; }
.empty-state b { font-size: 17px; display: block; color: #fff; margin-bottom: 4px; }
.empty { color: var(--muted); text-align: center; padding: 16px; font-size: 13px; }

.tabs { display: flex; background: var(--card); border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.tabs button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px; color: var(--text-2); font-size: 14px; transition: .15s; }
.tabs button svg { width: 18px; height: 18px; }
.tabs button.active { background: var(--line); color: #fff; }
.tabs button:hover:not(.active) { background: rgba(39,39,42,.5); }

/* ---------- медиаплеер ---------- */
.curbar { display: flex; align-items: center; gap: 12px; }
.curbar__t { flex: 1; min-width: 0; padding: 0 14px 12px; color: var(--muted); font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.curbar__t.has { color: #fff; font-style: normal; }
.mp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; align-items: start; }
.mp-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.screen { position: relative; aspect-ratio: 16 / 9; background: #000; }
.screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ctrl { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.prog { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.prog__bar { flex: 1; height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; cursor: pointer; }
.prog__bar i { display: block; height: 100%; width: 0; background: var(--accent); }
.ctrl__row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.ctrl__mid { display: flex; gap: 6px; align-items: center; }
.cbtn { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--line); color: var(--text-2); transition: .15s; }
.cbtn:hover { background: var(--line-2); color: #fff; }
.cbtn--main { width: 38px; height: 38px; background: var(--line-2); color: #fff; }
.cbtn--main:hover { background: #52525b; }
.cbtn svg { width: 15px; height: 15px; }
.vol { display: flex; align-items: center; gap: 8px; justify-self: end; color: var(--muted); }
.vol input { width: 90px; accent-color: #d4d4d8; }
.vol b { font-size: 11px; width: 26px; text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; font-weight: 500; }
.linkbox { display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 8px; padding: 6px 6px 6px 12px; }
.linkbox input { flex: 1; background: none; border: 0; outline: none; font-size: 13px; color: var(--text-2); min-width: 0; }
.note { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 12px; border-radius: 8px; background: var(--row); font-size: 12px; color: var(--muted); }
.note svg { width: 14px; height: 14px; flex-shrink: 0; }
.addform { display: flex; gap: 8px; }
.addform .input { flex: 1; }
.warnbar { margin: 0 14px 12px; padding: 8px 12px; border-radius: 8px; background: rgba(159,7,18,.35); color: #ffa3a3; font-size: 12px; }

/* ---------- списки треков ---------- */
.tracks { display: flex; flex-direction: column; gap: 6px; }
.track { display: grid; grid-template-columns: 22px 64px 1fr auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; background: var(--row); }
.track__n { color: var(--muted); font-weight: 600; font-size: 12px; text-align: center; }
.track__img { width: 64px; height: 36px; border-radius: 5px; object-fit: cover; background: var(--line); display: block; }
.track__body { min-width: 0; }
.track__t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; font-size: 13px; }
.track__t:hover { text-decoration: underline; }
.track__m { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin-top: 1px; }
.track__a { display: flex; gap: 0; }
.tracks--nonum .track { grid-template-columns: 64px 1fr auto; }
.qinfo { text-align: right; font-size: 11px; font-weight: 600; color: var(--text-2); line-height: 1.3; }

/* ---------- настройки ---------- */
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 208px; gap: 24px; max-width: 1080px; margin: 0 auto; align-items: start; }
.toc { position: sticky; top: 64px; }
.toc__t { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 6px; padding: 8px 0 10px 8px; }
.toc nav { background: var(--card); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.toc a { padding: 6px 8px; border-radius: 6px; font-size: 12px; color: var(--text-2); }
.toc a:hover, .toc a.active { background: var(--line); color: #fff; font-weight: 600; }
.rows { background: var(--card); border-radius: 10px; padding: 4px 16px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); min-height: 44px; }
.row:last-child { border-bottom: 0; }
.row__t { font-size: 14px; color: var(--text-2); }
.row__d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.row .input { width: 90px; text-align: right; padding: 5px 10px; }
.row .input--wide { width: 240px; text-align: left; }
.row select.input { width: 210px; text-align: left; }
.row--col { flex-direction: column; align-items: stretch; }
.row--col .input { width: 100%; text-align: left; }
.hms { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.hms input { width: 40px !important; text-align: center !important; padding: 5px 2px !important; font-variant-numeric: tabular-nums; }
.subtabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 12px 0 10px; border-bottom: 1px solid var(--line); }
.subtabs button { padding: 6px 14px; border-radius: 6px; font-size: 13px; color: var(--text-2); }
.subtabs button.active { background: var(--line); color: #fff; }
.subtabs button:hover:not(.active) { background: rgba(39,39,42,.5); }
.hint { font-size: 12px; color: var(--muted); padding: 10px 0 2px; }
.choices { display: flex; flex-direction: column; gap: 8px; padding: 10px 0; }
.choice { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 8px; background: var(--row); border: 1px solid transparent; cursor: pointer; }
.choice:hover { background: #111113; }
.choice.on { border-color: #166534; }
.choice svg.ci { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.choice b { font-size: 13px; font-weight: 600; display: block; }
.choice small { font-size: 11px; color: var(--muted); }
.choice .rad { margin-left: auto; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--muted); flex-shrink: 0; display: grid; place-items: center; }
.choice.on .rad { border-color: #fff; background: #fff; color: #000; }
.choice.on .rad::after { content: "✓"; font-size: 11px; font-weight: 800; }
.choice .rec { color: var(--ok); font-weight: 400; font-size: 11px; }
.cmdtable { width: 100%; border-collapse: collapse; font-size: 13px; margin: 6px 0 10px; }
.cmdtable th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--muted); padding: 8px 6px; background: var(--row); }
.cmdtable td { padding: 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cmdtable .input { padding: 5px 8px; width: 100%; text-align: left; }
.cmdtable select.input { width: 120px; }
.cmdtable .num { width: 70px; }
.cmdtable code { white-space: nowrap; }
.rewards { display: flex; flex-direction: column; gap: 8px; padding: 10px 0; }
.reward { border-radius: 8px; background: var(--row); }
.reward__head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; font-weight: 600; font-size: 13px; }
.reward__head svg { width: 15px; height: 15px; }
.reward__head .pm { margin-left: auto; font-size: 18px; font-weight: 400; color: var(--muted); transition: transform .2s; }
.reward.open .pm { transform: rotate(45deg); }
.reward__body { display: none; padding: 0 14px 14px; gap: 10px; flex-wrap: wrap; align-items: end; }
.reward.open .reward__body { display: flex; }
.reward__body label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.reward__body .input { width: auto; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--line); color: var(--text-2); font-size: 12px; }
.chip button { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.chip button:hover { background: var(--danger-bg); color: #fff; }

.modlist { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; }
.modlink { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 8px; background: var(--row); border-left: 2px solid var(--line-2); cursor: pointer; }
.modlink:hover { background: #111113; }
.modlink svg { width: 18px; height: 18px; flex-shrink: 0; }
.modlink b { display: block; font-size: 13px; }
.modlink small { color: var(--muted); font-size: 11px; }
.modlink .chev { margin-left: auto; }

.acc { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 8px; background: var(--row); flex-wrap: wrap; }
.acc__ico { width: 38px; height: 38px; border-radius: 50%; background: var(--twitch); display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.acc__body { flex: 1; min-width: 160px; }
.codebox { margin-top: 6px; padding: 12px; border-radius: 8px; background: var(--bg); border: 1px dashed var(--accent); width: 100%; font-size: 13px; }
.codebox b.code { font-size: 22px; letter-spacing: .2em; font-family: ui-monospace, Consolas, monospace; display: block; margin: 4px 0; }
.steps { list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: 13px; padding: 6px 0; }
.steps li { counter-increment: s; position: relative; padding-left: 30px; min-height: 20px; line-height: 20px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--line); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--text); }
.steps li .btn { vertical-align: middle; }

.widget-preview { position: relative; height: 320px; border-radius: 10px; overflow: hidden; background:
  repeating-conic-gradient(#1f1f23 0% 25%, #16161a 0% 50%) 50% / 24px 24px; }
.widget-preview iframe { width: 100%; height: 100%; border: 0; }

/* ---------- журнал ---------- */
.log { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.log li { display: flex; gap: 10px; padding: 6px 8px; border-radius: 6px; }
.log li:nth-child(odd) { background: var(--row); }
.log time { color: var(--muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.log .warn { color: var(--warn); }
.log .ok { color: var(--ok); }
.log .chat { color: #d8c4ff; }

/* ---------- всплывашки ---------- */
.toast { position: fixed; left: 50%; bottom: 18px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .2s; background: var(--line); padding: 10px 16px; border-radius: 8px; z-index: 99; max-width: calc(100% - 24px); font-size: 13px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger-bg); }
.conn { position: fixed; inset: 0; background: rgba(9,9,11,.85); display: none; place-items: center; z-index: 98; text-align: center; padding: 20px; }
.conn.show { display: grid; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) { .mp-grid { grid-template-columns: 1fr; } .settings-layout { grid-template-columns: 1fr; } .toc { display: none; } }
@media (max-width: 860px) {
  .side { transform: translateX(-100%); }
  body.menu-open .side { transform: none; }
  body.menu-open .shade { display: block; }
  .main { margin-left: 0; padding: 64px 12px 32px; }
  .row { flex-wrap: wrap; }
  .row .input--wide, .row select.input { width: 100%; }
  .cmdtable { display: block; overflow-x: auto; }
}

/* ---------- ДОК (OBS) ---------- */
body.dock { font-size: 13px; }
.dock-wrap { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.dock-head { display: flex; align-items: center; gap: 8px; }
.dock-head .logo { font-size: 15px; margin-right: auto; gap: 8px; }
.dock-head .logo__ico { width: 24px; height: 24px; }
.dock .card__head { padding: 8px 10px; min-height: 38px; }
.dock .card__body { padding: 0 10px 10px; }
.dock .track { grid-template-columns: 18px 1fr auto; padding: 5px 6px; gap: 6px; }
.dock .track__img { display: none; }
.dock .tracks--nonum .track { grid-template-columns: 1fr auto; }
.dock .tabs button { font-size: 12px; padding: 7px 4px; }
.dock .row { padding: 7px 0; min-height: 38px; }
.dock .row__t { font-size: 12px; }
.dock .rows { padding: 2px 10px; }
.dock-now { display: flex; gap: 10px; align-items: center; padding: 10px; }
.dock-now img { width: 72px; height: 40px; border-radius: 5px; object-fit: cover; background: var(--line); flex-shrink: 0; }
.dock-now__t { font-weight: 600; font-size: 13px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.dock-player { aspect-ratio: 16 / 9; background: #000; position: relative; }
.dock-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.dock-toggles { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 2px; }
.dock-toggles label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12px; color: var(--text-2); }
.dock .ctrl { padding: 0 10px 10px; }
.dock .vol input { width: 70px; }

/* свернуть меню на широком экране */
@media (min-width: 861px) {
  body.side-hidden .side { transform: translateX(-100%); }
  body.side-hidden .main { margin-left: 0; }
  .main { transition: margin-left .2s; }
}
