:root { --fg: #1d1f23; --muted: #6b7078; --line: #d8dbe0; --accent: #2457c5; --bad: #b3261e; --good: #1e7a3c; --bg: #fafafa; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--fg); background: var(--bg); }
main { padding: 16px 24px 48px; max-width: 1200px; }
.top { display: flex; gap: 24px; align-items: center; padding: 10px 24px; background: #fff; border-bottom: 1px solid var(--line); }
.top nav { display: flex; gap: 16px; flex: 1; }
a { color: var(--accent); text-decoration: none; }
a.on, .tabs a.on { font-weight: 600; text-decoration: underline; }
.tabs { display: inline-flex; gap: 12px; margin-right: 16px; }
h1 { font-size: 22px; margin: 8px 0 12px; }
h2 { font-size: 17px; margin: 20px 0 8px; }
table { border-collapse: collapse; width: 100%; background: #fff; margin-bottom: 12px; }
th, td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
th { background: #f0f2f5; font-weight: 600; }
td.num { text-align: right; white-space: nowrap; }
.muted { color: var(--muted); }
.error { color: var(--bad); }
.ok { color: var(--good); }
.live { color: var(--bad); font-weight: 600; }
.flash { background: #eef4ff; border: 1px solid #c5d6f7; padding: 8px 12px; border-radius: 4px; }
.narrow { max-width: 420px; }
form.inline { display: inline; }
form.row, .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
input, select, textarea, button { font: inherit; }
input.short { width: 6em; }
textarea { width: 100%; }
label { display: block; margin: 6px 0; }
button { padding: 4px 12px; border: 1px solid var(--line); border-radius: 4px; background: #fff; cursor: pointer; }
button:hover { border-color: var(--accent); }
button.danger { color: var(--bad); }
button.link { border: none; background: none; color: var(--accent); padding: 0; }
.cards { display: flex; flex-wrap: wrap; gap: 12px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px 14px; flex: 1 1 260px; }
.post { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; margin-bottom: 10px; }
.post.st-awaiting_approval { border-left: 4px solid var(--accent); }
.post.st-error { border-left: 4px solid var(--bad); }
.post .body { white-space: pre-wrap; margin: 8px 0; }
.post .actions details { margin-top: 6px; }
.post summary { cursor: pointer; color: var(--accent); }
.status { font-weight: 600; }
pre.bible { white-space: pre-wrap; background: #fff; border: 1px solid var(--line); padding: 12px; max-height: 70vh; overflow: auto; }
.journal code { white-space: pre-wrap; word-break: break-word; font-size: 13px; }

/* --- страница «Каналы» (задание 15): карточки; цвета — классами, style="" запрещён CSP --- */
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.btn { display: inline-block; padding: 4px 12px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--accent); }
.btn:hover { border-color: var(--accent); }
.btn.primary, button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 12px; }
.filters select, .filters input { max-width: 100%; min-width: 0; padding: 4px 6px; }
.group { margin-top: 24px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.ch { background: #fff; border: 1px solid var(--line); border-left-width: 4px; border-radius: 6px; padding: 12px 14px; min-width: 0; overflow-wrap: anywhere; }
.ch.st-no_bible, .ch.st-profile { border-left-color: #c77d0a; }
.ch.st-unbound, .ch.st-no_rights { border-left-color: var(--bad); }
.ch.st-test { border-left-color: var(--accent); }
.ch.st-approval, .ch.st-auto { border-left-color: var(--good); }
.ch.is-paused { opacity: .85; }
.ch-head { display: flex; gap: 10px; align-items: center; }
.ch-title { min-width: 0; }
.ch-name { font-weight: 600; font-size: 16px; }
.ava { flex: none; width: 48px; height: 48px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 22px; }
.ava-0 { background: #2457c5; } .ava-1 { background: #1e7a3c; } .ava-2 { background: #b3261e; } .ava-3 { background: #7a3fb0; }
.ava-4 { background: #c77d0a; } .ava-5 { background: #0e7c86; } .ava-6 { background: #a1316b; } .ava-7 { background: #4a5568; }
.small { font-size: 13px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0 4px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid transparent; }
.badge.t-ok { background: #e4f4ea; color: var(--good); }
.badge.t-bad { background: #fbe9e7; color: var(--bad); }
.badge.t-warn { background: #fff3dc; color: #8a5300; }
.badge.t-info { background: #e8effc; color: var(--accent); }
.badge.t-muted { background: #eceef1; color: var(--muted); }
.hint { margin: 4px 0; font-size: 14px; }
.hint.step { background: #fff3dc; border-radius: 4px; padding: 6px 8px; }
.msg { margin: 6px 0; background: #eef4ff; border: 1px solid #c5d6f7; border-radius: 4px; padding: 4px 8px; font-size: 14px; }
.nums { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 12px; margin: 10px 0 6px; }
.nums div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dotted var(--line); }
.nums dt { color: var(--muted); font-size: 13px; }
.nums dd { margin: 0; font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.actions .btn, .actions button { padding: 6px 12px; }
.errors { background: #fbe9e7; border: 1px solid #f0b8b2; border-radius: 4px; padding: 8px 12px; margin-bottom: 12px; }
.errors ul { margin: 4px 0 0; padding-left: 20px; }
.narrow-form { max-width: 520px; }
.form input:not([type=file]), .form select, .form textarea { width: 100%; padding: 6px 8px; }
@media (max-width: 480px) {
  main { padding: 12px 12px 40px; }
  .top { flex-wrap: wrap; gap: 8px 16px; padding: 8px 12px; }
  .top nav { flex-wrap: wrap; gap: 8px 14px; flex-basis: 100%; order: 3; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .filters select, .filters input { flex: 1 1 100%; }
  table { display: block; overflow-x: auto; }
}
