/* VKora — пульт редакции сети пабликов.
   Шрифты: Unbounded — заголовки и крупные числа, Onest — всё остальное (оба OFL, свои файлы).
   Палитра: ночной синий пульт, мятный — действие, коралловый — «эфир»: что идёт сейчас. */

@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/static/fonts/onest-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/static/fonts/onest-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url(/static/fonts/unbounded-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url(/static/fonts/unbounded-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f2f4f8;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --surface-3: #eceff5;
  --ink: #121726;
  --ink-2: #343c50;
  --dim: #5d6679;
  --faint: #8a93a6;
  --line: #e0e4ed;
  --line-2: #ebeef4;
  --accent: #0a7a68;
  --accent-fill: #16a68b;
  --accent-fill-hover: #12937a;
  --accent-ink: #032019;
  --accent-soft: #e2f4ef;
  --onair: #ef4f3a;
  --onair-soft: #fde8e4;
  --info: #2b5ea8;
  --info-bg: #e8f0fb;
  --ok: #1d8553;
  --ok-bg: #e3f3ea;
  --warn: #965800;
  --warn-bg: #fff1d9;
  --stop: #c2342b;
  --stop-bg: #fdebe8;
  /* Боковая панель — тёмный «пульт» в обеих темах */
  --side-bg: #0f1526;
  --side-line: #1d2640;
  --side-ink: #c5cee0;
  --side-dim: #7d89a3;
  --side-hover: #18213a;
  --side-on-bg: #1f2c4b;
  --side-on: #ffffff;
  --radius: 14px;
  --radius-md: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(18, 23, 38, 0.05), 0 6px 18px -10px rgba(18, 23, 38, 0.18);
  --shadow-lift: 0 2px 4px rgba(18, 23, 38, 0.06), 0 14px 32px -14px rgba(18, 23, 38, 0.28);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent-fill) 35%, transparent);
  --font: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --display: 'Unbounded', 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0e19;
    --surface: #10172a;
    --surface-2: #141c33;
    --surface-3: #1a2440;
    --ink: #e7ecf6;
    --ink-2: #c4ccdc;
    --dim: #8f9bb4;
    --faint: #6b7792;
    --line: #222c46;
    --line-2: #1a2339;
    --accent: #45d6b8;
    --accent-fill: #2fc4a6;
    --accent-fill-hover: #4ad3b7;
    --accent-ink: #03221b;
    --accent-soft: #0f2f2c;
    --onair: #ff6e5a;
    --onair-soft: #3a1b18;
    --info: #86b4ff;
    --info-bg: #14233f;
    --ok: #57d391;
    --ok-bg: #0f2a1e;
    --warn: #f3b44e;
    --warn-bg: #2f2310;
    --stop: #ff7a6e;
    --stop-bg: #34171a;
    --side-bg: #070b15;
    --side-line: #161f36;
    --side-hover: #121a30;
    --side-on-bg: #18233f;
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset, 0 8px 24px -16px rgba(0, 0, 0, 0.7);
    --shadow-lift: 0 18px 40px -18px rgba(0, 0, 0, 0.85);
    color-scheme: dark;
  }
}

/* ------------------------------------------------------------------ основа */

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--font);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
}
a:hover {
  text-decoration: underline;
}
h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
}
h1 {
  font: 600 26px/1.15 var(--display);
  letter-spacing: -0.01em;
}
h2 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.005em;
}
h3 {
  font-size: 13px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
  margin: 18px 0 8px;
}
p {
  margin: 0 0 10px;
}
img {
  max-width: 100%;
}
code,
.mono,
pre {
  font-family: var(--mono);
  font-size: 0.86em;
}
code {
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 1px 6px;
}
pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}
:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 6px;
}
::selection {
  background: color-mix(in srgb, var(--accent-fill) 30%, transparent);
}
.icon {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -3px;
}
.icon-sm {
  width: 15px;
  height: 15px;
  vertical-align: -2px;
}
.icon-lg {
  width: 22px;
  height: 22px;
}

.dim {
  color: var(--dim);
}
.faint {
  color: var(--faint);
}
.small {
  font-size: 13px;
}
.tiny {
  font-size: 12px;
}
.nowrap {
  white-space: nowrap;
}
.right {
  text-align: right;
}
.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.tnum {
  font-variant-numeric: tabular-nums;
}
.err {
  color: var(--stop);
}
.tone-ok {
  color: var(--ok);
}
.tone-warn {
  color: var(--warn);
}
.tone-stop {
  color: var(--stop);
}
.tone-accent {
  color: var(--accent);
}
.top-gap {
  margin-top: 16px;
}
.top-gap-sm {
  margin-top: 8px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ каркас */

.shell {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
}
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 14px 16px;
  background: var(--side-bg);
  color: var(--side-ink);
  border-right: 1px solid var(--side-line);
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 10px;
  color: #fff;
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  /* Логотип заказчика — картинка с прозрачными углами */
  display: block;
  width: 34px;
  height: 34px;
  flex: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}
.brand-name {
  display: block;
  font: 600 18px/1 var(--display);
  letter-spacing: -0.01em;
}
.brand small,
.brand-tag {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: var(--side-dim);
  letter-spacing: 0.01em;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--side-ink);
  font-weight: 500;
}
.nav a .icon {
  color: var(--side-dim);
}
.nav a:hover {
  background: var(--side-hover);
  color: #fff;
  text-decoration: none;
}
.nav a.on {
  background: var(--side-on-bg);
  color: var(--side-on);
}
.nav a.on .icon {
  color: #45d6b8;
}
.nav-label {
  flex: 1;
}
.nav-sep {
  margin: 16px 10px 6px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--side-dim);
}
.badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 700;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  background: #2a3757;
  color: #fff;
}
.badge-accent {
  background: #2fc4a6;
  color: #03221b;
}
.badge-stop {
  background: var(--onair);
  color: #fff;
}
.me {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 6px 0;
  border-top: 1px solid var(--side-line);
}
.me-link {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 10px;
  color: var(--side-ink);
}
.me-link:hover,
.me-link.on {
  background: var(--side-hover);
  text-decoration: none;
}
.me-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #24314f;
  color: #fff;
  font-weight: 650;
  flex: none;
}
.me-name {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.me-link small {
  display: block;
  color: var(--side-dim);
  font-size: 12px;
}
.side .btn-icon {
  color: var(--side-dim);
}
.side .btn-icon:hover {
  color: #fff;
  background: var(--side-hover);
}

.main {
  min-width: 0;
  width: 100%;
  max-width: 1320px;
  padding: 30px 40px 72px;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-head > div:first-child {
  flex: 1 1 380px;
  min-width: 0;
}
.subtitle {
  margin: 8px 0 0;
  color: var(--dim);
  max-width: 760px;
}
.page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.eyebrow {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

/* Мобильная шапка и нижнее меню — только на узком экране */
.topbar,
.tabbar,
.scrim {
  display: none;
}

/* ------------------------------------------------------------------ кнопки */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.12s,
    border-color 0.12s,
    color 0.12s,
    box-shadow 0.12s;
}
.btn:hover {
  background: var(--surface-3);
  text-decoration: none;
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.55;
  cursor: progress;
}
.btn-primary {
  background: var(--accent-fill);
  border-color: transparent;
  color: var(--accent-ink);
}
.btn-primary:hover {
  background: var(--accent-fill-hover);
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-2);
}
.btn-ghost:hover {
  background: var(--surface-3);
}
.btn-danger {
  background: var(--stop-bg);
  border-color: transparent;
  color: var(--stop);
}
.btn-danger:hover {
  background: color-mix(in srgb, var(--stop) 18%, var(--surface));
}
.btn-sm {
  min-height: 32px;
  padding: 5px 11px;
  font-size: 13px;
  border-radius: 9px;
}
.btn-lg {
  min-height: 46px;
  padding: 11px 20px;
  font-size: 15px;
}
.btn-block {
  width: 100%;
}
.btn-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
}
.btn-icon:hover {
  background: var(--surface-3);
  color: var(--ink);
}
.inline-form {
  display: inline;
  margin: 0;
}

/* Переключатель «работает / пауза»: кнопка-форма, выглядит как тумблер */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.switch-track {
  position: relative;
  width: 40px;
  height: 24px;
  border-radius: 12px;
  background: var(--line);
  transition: background 0.15s;
  flex: none;
}
.switch-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s;
}
.switch[aria-pressed='true'] .switch-track {
  background: var(--accent-fill);
}
.switch[aria-pressed='true'] .switch-track::after {
  transform: translateX(16px);
}
.switch:hover .switch-track {
  filter: brightness(1.05);
}

/* ------------------------------------------------------------------ формы */

/* :where — без веса: стили компонентов ниже спокойно уточняют поля */
:where(input:not([type='checkbox']):not([type='radio']):not([type='file'])),
:where(select),
:where(textarea) {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14.5px;
  transition:
    border-color 0.12s,
    box-shadow 0.12s;
}
textarea {
  line-height: 1.55;
  resize: vertical;
}
select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a93a6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-fill);
  box-shadow: var(--ring);
}
input::placeholder,
textarea::placeholder {
  color: var(--faint);
}
input[type='checkbox'],
input[type='radio'] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent-fill);
  vertical-align: -3px;
  margin: 0;
}
input[type='file'] {
  font: inherit;
  font-size: 13px;
  color: var(--dim);
}
input[type='file']::file-selector-button {
  margin-right: 10px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
label {
  font-weight: 600;
  font-size: 14px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.field-wide {
  grid-column: 1 / -1;
}
/* Пометка в поле (состояние аккаунта и т. п.) — по ширине текста, а не полосой на всё поле */
.field > .chip {
  align-self: flex-start;
}
.hint {
  display: block;
  color: var(--dim);
  font-size: 13px;
  line-height: 1.5;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
  cursor: pointer;
}
.check input {
  margin-top: 2px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}
.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  grid-column: 1 / -1;
}
.row-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.row-form > input,
.row-form > select {
  flex: 1 1 200px;
  width: auto;
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.row > * {
  min-width: 0;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.stack-sm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.code-input {
  font: 600 22px/1 var(--mono) !important;
  letter-spacing: 0.35em;
  text-align: center;
}

/* Выбор варианта карточкой: режим постов, источник стиля */
.choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}
.choice {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 14px 13px 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-weight: 500;
  cursor: pointer;
  transition:
    border-color 0.12s,
    background 0.12s;
}
.choice:hover {
  border-color: color-mix(in srgb, var(--accent-fill) 45%, var(--line));
}
.choice input {
  position: absolute;
  left: 15px;
  top: 16px;
}
.choice b {
  font-weight: 650;
}
.choice span {
  color: var(--dim);
  font-size: 13px;
  line-height: 1.45;
}
.choice:has(input:checked) {
  border-color: var(--accent-fill);
  background: var(--accent-soft);
}

/* ------------------------------------------------------------------ карточки и сетки */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 18px;
  min-width: 0;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -2px 0 14px;
}
.card-head h2 {
  display: flex;
  align-items: center;
  gap: 9px;
}
.card-head h2 .icon {
  color: var(--dim);
}
.card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.card-flat {
  box-shadow: none;
  background: var(--surface-2);
}
.card-pad-0 {
  padding: 0;
  overflow: hidden;
}
.card-pad-0 > .card-head {
  margin: 0;
  padding: 18px 22px 14px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.grid-2 > .card,
.grid-2 > .stack > .card,
.grid-3 > .card {
  margin-bottom: 0;
}
.grid-2 + .grid-2,
.grid-2 + .card,
.card + .grid-2,
.grid-3 + .card {
  margin-top: 18px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.grid-main {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.grid-main > .card,
.grid-main > .stack > .card {
  margin-bottom: 0;
}
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 26px 16px;
  color: var(--dim);
  text-align: center;
}
.empty .icon {
  width: 26px;
  height: 26px;
  color: var(--faint);
}
.empty b {
  color: var(--ink);
  font-weight: 650;
}

/* ------------------------------------------------------------------ метки */

.chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  background: var(--surface-3);
  color: var(--ink-2);
  white-space: nowrap;
  max-width: 100%;
}
/* Длинная пометка (тема поста, название серии) переносится, а не уходит за край карточки */
.draft-title .chip,
.chips .chip {
  white-space: normal;
  overflow-wrap: anywhere;
  border-radius: 12px;
}
a.chip:hover {
  text-decoration: none;
  filter: brightness(0.97);
}
.chip-ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.chip-warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.chip-stop {
  background: var(--stop-bg);
  color: var(--stop);
}
.chip-info {
  background: var(--info-bg);
  color: var(--info);
}
.chip-accent {
  background: var(--accent-soft);
  color: var(--accent);
}
.chip-dim {
  background: var(--surface-3);
  color: var(--dim);
}
.chip-onair {
  background: var(--onair-soft);
  color: var(--onair);
}
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
  flex: none;
}
.dot-ok {
  background: var(--ok);
}
.dot-warn {
  background: var(--warn);
}
.dot-stop {
  background: var(--stop);
}
.dot-onair {
  background: var(--onair);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--onair) 55%, transparent);
  animation: onair 2.4s ease-out infinite;
}
@keyframes onair {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--onair) 55%, transparent);
  }
  70% {
    box-shadow: 0 0 0 7px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

/* ------------------------------------------------------------------ таблицы */

.tbl-wrap {
  overflow-x: auto;
  margin: 0 -22px;
  padding: 0 22px;
}
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.tbl th {
  padding: 0 10px 10px;
  text-align: left;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.tbl th.num {
  text-align: right;
}
.tbl td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: top;
}
.tbl tr:last-child td {
  border-bottom: 0;
}
.tbl th:first-child,
.tbl td:first-child {
  padding-left: 0;
}
.tbl th:last-child,
.tbl td:last-child {
  padding-right: 0;
}
.tbl tbody tr:hover td {
  background: color-mix(in srgb, var(--surface-3) 45%, transparent);
}
.row-off td {
  color: var(--dim);
}
.post-cell {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.post-cell .thumb {
  width: 56px;
  height: 56px;
  border-radius: 9px;
  object-fit: cover;
  flex: none;
  background: var(--surface-3);
}
.thumb {
  border-radius: 9px;
}
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
}

/* ------------------------------------------------------------------ вкладки */

.tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 12px 12px;
  color: var(--dim);
  font-weight: 600;
  white-space: nowrap;
}
.tabs a:hover {
  color: var(--ink);
  text-decoration: none;
}
.tabs a.on {
  color: var(--ink);
}
.tabs a.on::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent-fill);
}
.tabs .count {
  color: var(--faint);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.seg-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface-3);
  gap: 2px;
}
.seg-switch a {
  padding: 5px 11px;
  border-radius: 8px;
  color: var(--dim);
  font-size: 13px;
  font-weight: 600;
}
.seg-switch a:hover {
  color: var(--ink);
  text-decoration: none;
}
.seg-switch a.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* ------------------------------------------------------------------ списки */

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.list > li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-2);
}
.list > li:last-child {
  border-bottom: 0;
}
.list > li:first-child {
  padding-top: 2px;
}
.list.compact > li {
  padding: 8px 0;
}
.list-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.list-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex: none;
  text-align: right;
}
.list-side.row {
  flex-direction: row;
  align-items: center;
}
.kv {
  display: grid;
  grid-template-columns: minmax(120px, max-content) 1fr;
  gap: 10px 18px;
  margin: 0 0 16px;
}
.kv dt {
  color: var(--dim);
}
.kv dd {
  margin: 0;
  min-width: 0;
}
.kv-wide {
  grid-template-columns: minmax(180px, max-content) 1fr;
}
.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 16px;
  border-left: 2px solid var(--line);
}
.timeline li {
  position: relative;
  padding: 0 0 12px 4px;
}
.timeline li::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent-fill);
}
.attempts {
  margin: 0;
  padding-left: 18px;
}
.dont {
  margin: 0;
  padding-left: 18px;
}
.dont li {
  margin-bottom: 4px;
}
.health {
  list-style: none;
  margin: 0;
  padding: 0;
}
.health li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
}
.health li:last-child {
  border-bottom: 0;
}

/* ------------------------------------------------------------------ сообщения */

.flash {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 15px;
  margin-bottom: 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14px;
}
.flash > .icon {
  margin-top: 2px;
}
.flash-ok {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 20%, transparent);
}
.flash-error {
  background: var(--stop-bg);
  color: var(--stop);
  border-color: color-mix(in srgb, var(--stop) 22%, transparent);
}
.flash-info {
  background: var(--info-bg);
  color: var(--ink-2);
  border-color: color-mix(in srgb, var(--info) 18%, transparent);
}
.flash-info a {
  font-weight: 600;
}
.flash.small {
  font-size: 13px;
}
.alerts {
  list-style: none;
  margin: 0;
  padding: 0;
}
.alert {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-2);
}
.alert:last-child {
  border-bottom: 0;
}
.alert-body {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: baseline;
}

/* «Требует внимания»: каждое дело — с объяснением и кнопкой */
.attn {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.attn li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.attn-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  flex: none;
  background: var(--warn-bg);
  color: var(--warn);
}
.attn-stop .attn-icon {
  background: var(--stop-bg);
  color: var(--stop);
}
.attn-info .attn-icon {
  background: var(--info-bg);
  color: var(--info);
}
.attn-accent .attn-icon {
  background: var(--accent-soft);
  color: var(--accent);
}
.attn-text {
  flex: 1;
  min-width: 0;
}
.attn-text b {
  display: block;
  font-weight: 650;
}
.attn-text span {
  color: var(--dim);
  font-size: 13.5px;
}
.calm {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--ok-bg);
  color: var(--ok);
  font-weight: 600;
}

/* ------------------------------------------------------------------ цифры */

.stats,
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  transition:
    border-color 0.12s,
    transform 0.12s;
}
a.stat:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--accent-fill) 45%, var(--line));
}
.stat-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--dim);
}
.stat-value {
  font: 600 28px/1.15 var(--display);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-value small {
  font: 500 15px var(--font);
  color: var(--dim);
  letter-spacing: 0;
}
.stat-hint {
  font-size: 13px;
  color: var(--dim);
}

/* ------------------------------------------------------------------ «Эфир»: сутки сети на одной шкале */

.air {
  position: relative;
  --label: 168px;
}
.air-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.air-row {
  display: grid;
  grid-template-columns: var(--label) 1fr;
  align-items: center;
  gap: 12px;
  min-height: 30px;
}
.air-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.air-name > span:not(.avatar) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.air-track {
  position: relative;
  height: 30px;
  border-radius: 8px;
  background: repeating-linear-gradient(
    to right,
    var(--surface-2) 0,
    var(--surface-2) calc(100% / 24 - 1px),
    var(--line-2) calc(100% / 24 - 1px),
    var(--line-2) calc(100% / 24)
  );
}
.air-past {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 8px 0 0 8px;
  background: color-mix(in srgb, var(--surface-3) 70%, transparent);
}
.air-mark {
  position: absolute;
  top: 7px;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border-radius: 50%;
  background: var(--accent-fill);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-fill) 60%, transparent);
}
a.air-mark:hover {
  transform: scale(1.18);
}
.air-mark-planned {
  background: var(--surface);
  border: 2px solid var(--accent-fill);
  box-shadow: none;
}
.air-mark-failed {
  background: var(--stop);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--stop) 60%, transparent);
}
.air-axis {
  display: grid;
  grid-template-columns: var(--label) 1fr;
  gap: 12px;
  margin-top: 6px;
}
.air-hours {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.air-now {
  position: absolute;
  top: -6px;
  bottom: 18px;
  width: 2px;
  margin-left: -1px;
  background: var(--onair);
  border-radius: 2px;
  pointer-events: none;
}
.air-now::before {
  content: attr(data-time);
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--onair);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.air {
  padding-top: 22px;
}
.air-overlay {
  position: absolute;
  top: 16px;
  bottom: 48px;
  left: calc(var(--label) + 12px);
  right: 0;
  pointer-events: none;
}
.air-overlay .air-now {
  top: 0;
  bottom: 0;
}
.air-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--dim);
}
.air-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.air-legend .air-mark {
  position: static;
  margin: 0;
  width: 12px;
  height: 12px;
}

/* Лента постов: аватар, паблик, текст, время */
.feed {
  list-style: none;
  margin: 0;
  padding: 0;
}
.feed li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-2);
}
.feed li:first-child {
  padding-top: 0;
}
.feed li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.feed-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.feed-main > span {
  color: var(--dim);
  font-size: 13.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.feed-title {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 650;
  color: var(--ink);
}
.feed-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex: none;
  text-align: right;
}
.feed-stats {
  display: inline-flex;
  gap: 10px;
  color: var(--dim);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.feed-stats span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Публикации: лента по дням */
.day + .day {
  margin-top: 22px;
}
.day-label {
  margin: 0 0 10px 2px;
}
.plan-rows {
  list-style: none;
  margin: 0;
}
.plan-row {
  display: grid;
  grid-template-columns: 52px 58px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-2);
}
.plan-row:last-child {
  border-bottom: 0;
}
.plan-time {
  padding-top: 2px;
  font-size: 16px;
}
.plan-time a {
  color: var(--ink);
}
.plan-thumb {
  position: relative;
  display: block;
  width: 58px;
  height: 58px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-3);
}
.plan-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.plan-thumb span {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--faint);
}
.plan-thumb i {
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 0 5px;
  border-radius: 6px;
  background: rgba(10, 14, 25, 0.75);
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}
.plan-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.plan-pub {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  color: var(--dim);
  font-size: 13px;
  font-weight: 600;
}
.plan-pub .avatar {
  width: 18px;
  height: 18px;
  font-size: 10px;
}
.plan-text {
  color: var(--ink);
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.plan-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
@media (max-width: 700px) {
  .plan-row {
    grid-template-columns: 46px minmax(0, 1fr);
    padding: 12px 14px;
  }
  .plan-thumb {
    display: none;
  }
  .plan-side {
    grid-column: 2;
    align-items: flex-start;
  }
}

/* Состояние системы — тихая строка внизу, подробности — по наведению и по ссылке */
.sysbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 18px;
  padding: 12px 4px 0;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 13px;
}
.sysbar span,
.sysbar a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.sysbar a {
  color: var(--dim);
}
.sysbar a:hover {
  color: var(--ink);
}

/* ------------------------------------------------------------------ паблики */

.avatar {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-3);
  flex: none;
}
.avatar-empty,
.avatar-stack {
  color: var(--dim);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
}
/* Картинка поверх буквы: пока не загрузилась или не скачалась — видна буква */
.avatar-stack {
  position: relative;
  overflow: hidden;
}
.avatar-stack img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.avatar-letter {
  line-height: 1;
}
.pub {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  min-width: 0;
}
.pub:hover {
  text-decoration: none;
}
.pub:hover .pub-name {
  color: var(--accent);
}
.pub > span:not(.avatar) {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.pub-name {
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pub small {
  color: var(--dim);
  font-size: 12.5px;
}
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}
.toolbar .search {
  position: relative;
  flex: 1 1 260px;
}
.toolbar .search .icon {
  position: absolute;
  left: 12px;
  top: 11px;
  color: var(--faint);
}
.toolbar .search input {
  padding-left: 38px;
}
.toolbar select {
  width: auto;
  flex: 0 1 220px;
}
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.filters > input {
  flex: 1 1 260px;
  width: auto;
}
.filters > select {
  width: auto;
  flex: 0 1 200px;
}
.roster td {
  vertical-align: middle;
}
.roster .col-check {
  width: 34px;
}
.mode,
.nowrap-dim {
  white-space: nowrap;
}
.mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
}
.mode .icon {
  color: var(--dim);
}
.state-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.state-cell small {
  color: var(--dim);
  font-size: 12.5px;
}
.bulkbar {
  position: sticky;
  bottom: 16px;
  z-index: 5;
  display: none;
  flex-direction: column;
  gap: 10px;
  margin: 14px auto 0;
  padding: 12px 12px 12px 18px;
  border-radius: 14px;
  background: var(--side-bg);
  color: #fff;
  box-shadow: var(--shadow-lift);
}
.bulkbar.show {
  display: flex;
}
.bulk-main,
.bulk-set {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.bulk-main b {
  margin-right: auto;
  font-weight: 650;
}
.bulk-set {
  gap: 8px 22px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #aab4cf;
  font-size: 13px;
}
.bulk-set label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: inherit;
  font: inherit;
}
.bulkbar select {
  width: auto;
  min-height: 34px;
  padding-block: 4px;
  background-color: #1a2440;
  border-color: #2a3a60;
  color: #fff;
}
.bulkbar .btn {
  border-color: transparent;
}
.bulkbar .btn:not(.btn-primary) {
  background: #1f2c4b;
  color: #fff;
}
.bulkbar .btn:not(.btn-primary):hover {
  background: #2a3a60;
}
.bulkbar input {
  width: 70px !important;
  min-height: 34px !important;
  background: #1a2440 !important;
  border-color: #2a3a60 !important;
  color: #fff !important;
}

/* Источники картинок с ключом */
.keyed-sources {
  display: grid;
  gap: 12px;
}
.keyed .row {
  margin: 6px 0 0 26px;
}
.keyed .row > input {
  flex: 1;
  max-width: 460px;
}

/* Рамки проверки в форме карточки стиля */
.limits-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 20px;
}
.limits-form .row > input {
  flex: 1;
}
@media (max-width: 700px) {
  .limits-form {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Шапка паблика */
.pub-head {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.pub-head .avatar {
  width: 64px;
  height: 64px;
  font-size: 22px;
}
.pub-head-main {
  flex: 1;
  min-width: 260px;
}
.pub-head-main h1 {
  font-size: 24px;
}
.pub-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  margin-top: 8px;
  color: var(--dim);
  font-size: 14px;
}
.pub-meta a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.pub-head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.autopilot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.autopilot small {
  display: block;
  color: var(--dim);
  font-weight: 500;
  font-size: 12.5px;
}

/* Шаги подготовки: настоящая последовательность — поэтому с номерами */
.stepper {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  counter-reset: step;
}
.stepper li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 14px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  counter-increment: step;
  font-size: 13.5px;
}
.stepper li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--dim);
  font-size: 12px;
  font-weight: 700;
}
.stepper li b {
  font-weight: 650;
  color: var(--ink);
}
.stepper li span {
  color: var(--dim);
}
.stepper li.done {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent-fill) 35%, transparent);
}
.stepper li.done::before {
  content: '✓';
  background: var(--accent-fill);
  border-color: var(--accent-fill);
  color: var(--accent-ink);
}
.stepper li.next {
  border-color: var(--accent-fill);
  background: var(--surface);
  box-shadow: var(--ring);
}
.stepper li .btn {
  align-self: flex-start;
  margin-top: 4px;
}

/* Поля, нужные только артам или только кадрам, прячутся, пока выбран другой режим */
.content-form:has(input[name='post_mode'][value='text']:checked) .art-only {
  display: none;
}
.content-form:not(:has(input[name='image_source'][value='frames']:checked)) .frames-only {
  display: none;
}
.content-form:not(:has(input[name='image_source'][value='anime']:checked)) .anime-only {
  display: none;
}
.kind-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 20px;
}
.kind-checks .check {
  font-weight: 400;
}
@media (max-width: 640px) {
  .kind-checks {
    grid-template-columns: 1fr;
  }
}
.choice b {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Старый список готовности — оставлен для совместимости */
.checklist,
.steps {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}
.steps {
  display: block;
  padding-left: 20px;
  list-style: decimal;
}
.steps li {
  margin-bottom: 8px;
}
.checklist li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--dim);
}
.checklist li.done {
  color: var(--ink);
}
.tick {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  font-size: 12px;
}
.checklist li.done .tick {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
  color: var(--accent-ink);
}

/* Факты о паблике плиткой */
.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--line);
}
.facts div {
  padding: 12px 14px;
  background: var(--surface);
}
.facts dt {
  font-size: 12.5px;
  color: var(--dim);
  font-weight: 600;
}
.facts dd {
  margin: 3px 0 0;
  font: 600 18px/1.2 var(--display);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.facts dd small {
  font: 500 13px var(--font);
  color: var(--dim);
}

.style-text {
  white-space: pre-wrap;
  line-height: 1.6;
}
.bind {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  margin: 10px 0 4px;
  border-radius: 12px;
  border: 1px dashed color-mix(in srgb, var(--accent-fill) 60%, transparent);
  background: var(--accent-soft);
}
.secret {
  display: inline-block;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 9px;
  font: 600 17px var(--mono);
  letter-spacing: 0.08em;
  background: var(--surface);
  border: 1px solid var(--line);
  user-select: all;
}
.bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
  padding-top: 8px;
}
.bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
}
.bar span {
  width: 100%;
  min-height: 2px;
  border-radius: 4px 4px 1px 1px;
  background: var(--surface-3);
}
.bar-on span {
  background: var(--accent-fill);
}
.bar small {
  margin-top: 4px;
  font-size: 10px;
  color: var(--faint);
}

/* ------------------------------------------------------------------ черновик: как пост в VK */

.draft {
  padding: 0;
  overflow: hidden;
}
.draft-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-2);
}
.draft-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.draft-title .pub-name {
  color: var(--ink);
  font-size: 15.5px;
}
.draft-title .pub-name:hover {
  color: var(--accent);
  text-decoration: none;
}
.draft .chip .icon-sm {
  width: 13px;
  height: 13px;
}
.draft > .card-head {
  margin: 0;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-2);
}
.draft > .flash,
.draft > p {
  margin: 14px 20px 0;
}
.draft-image > a > img {
  max-height: 420px;
}
.draft-image small {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.draft-body {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
}
.post {
  padding: 18px 20px 20px;
  min-width: 0;
}
.post-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.post-head b {
  display: block;
  font-weight: 650;
}
.post-head small {
  color: var(--dim);
}
.post-text {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}
a + .post-text,
.post-image + .post-text {
  margin-top: 16px;
}
.post-image {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  border-radius: 12px;
  background: var(--surface-3);
}
.draft-image {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.draft-image > a > img,
.draft-image > img {
  display: block;
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--surface-3);
}
.draft-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 6px;
}
.draft-gallery .thumb {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
}
.draft-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 9px;
}
.thumb-x {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(10, 14, 25, 0.72);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.thumb-x:hover {
  background: var(--stop);
}
.noimg {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 140px;
  padding: 14px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  color: var(--dim);
  text-align: center;
  font-size: 13.5px;
}
.noimg small {
  display: block;
  font-size: 12px;
}
.image-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.draft-text {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px 20px;
  border-left: 1px solid var(--line-2);
  background: var(--surface-2);
  min-width: 0;
}
.actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.decline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.decision-label {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ------------------------------------------------------------------ телеграм, коды, разное */

.tglink {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.qr {
  display: block;
  width: 200px;
  height: 200px;
  padding: 10px;
  border-radius: 12px;
  background: #fff;
}
/* Код рисуется своего размера — вписываем его в белую подложку, иначе он наезжает на ссылку под ним */
.qr svg {
  display: block;
  width: 100%;
  height: 100%;
}
.issued {
  color: var(--dim);
  font-size: 13px;
}
.catalog {
  max-height: 340px;
  overflow: auto;
}
details > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-2);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
details > summary::-webkit-details-marker {
  display: none;
}
details > summary::before {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s;
  margin: 0 4px 0 1px;
  flex: none;
}
details[open] > summary::before {
  transform: rotate(45deg);
}
details > summary.small {
  font-size: 13px;
}
details > summary.dim {
  color: var(--dim);
}
.json {
  max-height: 420px;
  overflow: auto;
  padding: 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
}
.topics .row-off .list-main {
  opacity: 0.55;
}
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.seg {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--faint);
}
.seg-photo {
  background: var(--accent-fill);
}
.seg-video {
  background: var(--info);
}
.seg-link {
  background: var(--warn);
}
.seg-poll {
  background: var(--onair);
}
.seg-other,
.seg-none {
  background: var(--line);
}

/* ------------------------------------------------------------------ вход */

body.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(1100px 520px at 12% -10%, color-mix(in srgb, var(--accent-fill) 16%, transparent), transparent 60%),
    radial-gradient(900px 480px at 110% 110%, color-mix(in srgb, var(--onair) 10%, transparent), transparent 60%),
    var(--bg);
}
.auth-box {
  width: 100%;
  max-width: 420px;
  padding: 30px 30px 26px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lift);
}
.auth-box h1 {
  font-size: 22px;
  margin: 22px 0 18px;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.auth-brand b {
  display: block;
  font: 600 19px/1 var(--display);
}
.auth-brand small {
  display: block;
  margin-top: 5px;
  color: var(--dim);
  font-size: 12.5px;
}
.auth-box .btn-primary {
  width: 100%;
  min-height: 44px;
}

/* ------------------------------------------------------------------ узкие экраны */

@media (max-width: 1180px) {
  .main {
    padding: 26px 26px 72px;
  }
  .grid-main {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  .grid-2,
  .grid-3,
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .draft-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .draft-text {
    border-left: 0;
    border-top: 1px solid var(--line-2);
  }
  .roster .col-hide {
    display: none;
  }
}

@media (max-width: 860px) {
  .shell {
    display: block;
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px 10px 16px;
    background: var(--side-bg);
    color: #fff;
  }
  .topbar .brand {
    padding: 0;
  }
  .topbar .brand-mark {
    width: 28px;
    height: 28px;
  }
  .topbar .brand-name {
    font-size: 16px;
  }
  .topbar .btn-icon {
    color: #fff;
  }
  .side {
    position: fixed;
    z-index: 40;
    inset: 0 auto 0 0;
    width: min(300px, 86vw);
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-lift);
  }
  body.nav-open .side {
    transform: none;
  }
  .scrim {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(5, 8, 16, 0.55);
  }
  body.nav-open .scrim {
    display: block;
  }
  .tabbar {
    position: fixed;
    z-index: 20;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
  .tabbar a {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 2px;
    border-radius: 10px;
    color: var(--dim);
    font-size: 11.5px;
    font-weight: 600;
  }
  .tabbar a.on {
    color: var(--accent);
  }
  .tabbar a:hover {
    text-decoration: none;
  }
  .tabbar .badge {
    position: absolute;
    top: 0;
    left: calc(50% + 6px);
    height: 17px;
    min-width: 17px;
    font-size: 10.5px;
  }
  .main {
    padding: 20px 16px 96px;
  }
  h1 {
    font-size: 22px;
  }
  .page-head {
    align-items: flex-start;
    margin-bottom: 16px;
  }
  .card {
    padding: 16px;
    border-radius: 12px;
  }
  .tbl-wrap {
    margin: 0 -16px;
    padding: 0 16px;
  }
  /* Над нижним меню, а не под ним */
  .bulkbar {
    bottom: calc(74px + env(safe-area-inset-bottom));
    padding: 12px;
  }
  .bulk-main b {
    flex-basis: 100%;
  }
  .air {
    --label: 104px;
  }
  .kv {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px 0;
  }
  .kv dd {
    margin-bottom: 10px;
  }
}

@media (max-width: 700px) {
  .roster .col-hide-sm {
    display: none;
  }
  .roster .switch > span:not(.switch-track),
  .roster .state-cell small {
    display: none;
  }
  .roster th {
    letter-spacing: 0.02em;
  }
}

@media (max-width: 560px) {
  .stepper {
    gap: 6px;
  }
  .stepper li {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    padding: 10px 12px;
  }
  .stepper li > span {
    flex-basis: 100%;
    padding-left: 34px;
    font-size: 13px;
  }
  .stepper li > .btn,
  .stepper li > .inline-form {
    margin: 4px 0 0 34px;
  }
  .stepper li.done > span {
    display: none;
  }
  .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stats,
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .stat {
    padding: 13px 14px;
  }
  .stat-value {
    font-size: 23px;
  }
  .page-actions {
    width: 100%;
  }
  .attn li {
    flex-wrap: wrap;
  }
  .attn li .btn,
  .attn li form {
    width: 100%;
  }
  .attn li form .btn {
    width: 100%;
  }
  .air-row,
  .air-axis {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
  .air-axis > span {
    display: none;
  }
  .air-overlay {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Перевод реплик комикса в подробностях черновика */
.comic-lines {
  margin: 10px 0 2px;
  font-size: 14px;
}
.comic-lines summary {
  cursor: pointer;
  color: var(--dim);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.comic-lines ol {
  margin: 8px 0 0;
  padding-left: 22px;
  display: grid;
  gap: 4px;
}

/* Ссылка-приглашение для телеграма сотрудника */
.tg-invite {
  display: grid;
  gap: 4px;
  max-width: 340px;
}
.tg-invite code {
  word-break: break-all;
  user-select: all;
}
.tg-invite .btn {
  justify-self: start;
}

/* Телефон: широкая таблица (сотрудники, аккаунты, журналы) листается внутри своей карточки,
   а страница остаётся по ширине экрана */
@media (max-width: 760px) {
  .card {
    overflow-x: auto;
  }
}

/* Телефон: таблица складывается в карточки строк — всё видно без прокрутки вбок.
   У ячейки с data-label подпись слева; tbl-inline — ячейки в одну строку (дата и состояние, цифры) */
@media (max-width: 760px) {
  .tbl-stack thead {
    display: none;
  }
  .tbl-stack,
  .tbl-stack tbody,
  .tbl-stack tr {
    display: block;
    width: 100%;
  }
  .tbl-stack tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--line-2);
  }
  .tbl-stack tr:last-child {
    border-bottom: 0;
  }
  .tbl-stack td {
    display: block;
    padding: 3px 0;
    border: 0;
    text-align: left;
    white-space: normal;
  }
  .tbl-stack td.tbl-inline {
    display: inline-block;
    margin-right: 14px;
  }
  .tbl-stack td[data-label]::before {
    content: attr(data-label);
    color: var(--dim);
    font-size: 12.5px;
    margin-right: 6px;
  }
  .tbl-stack td:empty {
    display: none;
  }
  .tbl-stack .tbl-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 8px;
  }
}

/* Переход к месту на странице (#u34, #images…) не прячет цель под закреплённой шапкой телефона */
[id] {
  scroll-margin-top: 88px;
}
