:root {
  --bg: #f6f7f9; --panel: #fff; --text: #1d2330; --muted: #6b7280; --line: #e3e6eb;
  --accent: #3b5bdb; --accent-soft: #e7ecff; --ok: #2b8a3e; --ok-soft: #e6f4ea;
  --warn: #b35c00; --warn-soft: #fff1e0; --bad: #c92a2a; --bad-soft: #fdeaea;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161b; --panel: #1c1f26; --text: #e6e8ec; --muted: #9aa1ad; --line: #2c313b;
    --accent: #7c95ff; --accent-soft: #252d4a; --ok: #69db7c; --ok-soft: #1f3326;
    --warn: #ffb35c; --warn-soft: #3a2c1a; --bad: #ff8787; --bad-soft: #3a1f22;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
header .in { max-width: 1200px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
header .brand { font-weight: 700; }
header nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
header nav a { padding: 6px 10px; border-radius: 6px; color: var(--text); }
header nav a.on { background: var(--accent-soft); color: var(--accent); }
main { max-width: 1200px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 17px; margin: 28px 0 10px; }
.flash { background: var(--accent-soft); border: 1px solid var(--line); padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); font-size: 13px; }
.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.post-title { font-weight: 600; }
.post-text { white-space: pre-wrap; margin-top: 6px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.thumb { width: 96px; height: 72px; object-fit: cover; border-radius: 6px; background: var(--line); flex: none; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.actions form { margin: 0; }
button, .btn { font: inherit; font-size: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--text);
  padding: 5px 12px; border-radius: 6px; cursor: pointer; display: inline-block; }
button:hover, .btn:hover { border-color: var(--accent); text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--bad); }
label { display: block; font-weight: 600; margin: 14px 0 4px; font-size: 14px; }
label.inline { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; margin: 6px 14px 0 0; }
input[type=text], input[type=search], input[type=tel], input[type=number], input[type=password], input[type=url], input[type=datetime-local], select, textarea {
  width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); }
textarea { min-height: 120px; resize: vertical; }
.hint { color: var(--muted); font-size: 13px; margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }
table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
table.compact th, table.compact td { padding: 3px 8px; font-size: 13px; line-height: 1.25; vertical-align: middle; }
table.compact { table-layout: fixed; }
table.sources .c-check { width: 4%; }
table.sources .c-name { width: 28%; }
table.sources .c-type { width: 14%; }
table.sources .c-where { width: 14%; }
table.sources .c-flow { width: 16%; }
table.sources .c-poll { width: 14%; }
table.sources .c-act { width: 10%; }
table.sources th { white-space: nowrap; }
table.sources .clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.sources .err { color: var(--bad); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.sources button { padding: 2px 8px; font-size: 12px; }
table.sources .badge { margin-left: 4px; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { padding: 4px 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--text); background: var(--panel); font-size: 14px; }
.tabs a.on { border-color: var(--accent); color: var(--accent); }
.orig { background: var(--bg); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; font-size: 14px; max-height: 420px; overflow: auto; }
.login { max-width: 360px; margin: 10vh auto; }
.empty { color: var(--muted); padding: 20px; text-align: center; border: 1px dashed var(--line); border-radius: 10px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.dot.on { background: var(--ok); } .dot.off { background: var(--bad); }
@media (max-width: 1000px) {
  header .in { gap: 6px 12px; }
  header nav { order: 3; flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  header nav a { white-space: nowrap; }
  header .brand { flex: 1; }
}

/* «Наши каналы»: канал — одна строка, поля правятся прямо в таблице */
table.targets .c-pick { width: 30px; }
table.targets .c-st { width: 64px; }
table.targets .c-name { width: 24%; }
table.targets .c-id { width: 170px; }
table.targets .c-act { width: 290px; }
table.targets input { padding: 3px 6px; font-size: 13px; }
table.targets .acts { white-space: nowrap; text-align: right; }
table.targets .acts form { display: inline; margin: 0; }
table.targets button { padding: 2px 8px; font-size: 12px; }
table.targets tr.off input { color: var(--muted); }

/* Продвижение: действия кампании прямо в строке списка */
td.row-acts { white-space: nowrap; }
td.row-acts form { display: inline; margin: 0; }
td.row-acts button, td.row-acts .btn { padding: 2px 8px; font-size: 12px; }

/* Удаление каналов: галочки и кнопка «Удалить каналы» */
.del-bar { margin-bottom: 10px; }
.pick-row { align-items: center; gap: 10px; flex-wrap: nowrap; }
.pick-row > .card { min-width: 0; }
.pick-row > .card { margin-bottom: 10px; }
.pick-row > input[type=checkbox] { margin-bottom: 10px; }
