/* Сайт публикации RTA Media. Цвета и шрифт — как у страницы входа (rta-auth). */
:root {
  --violet: #8900FF;
  --pink: #FB2177;
  --red: #FF004E;
  --accent: #FC3A79;
  --grad: linear-gradient(97deg, var(--violet), var(--pink) 55%, var(--red));

  --bg: #0E0E11;
  --surface: #17171C;
  --surface2: #1D1D24;
  --line: #26262E;
  --line2: #33333D;
  --ink: #F1F1F1;
  --muted: #8E8E99;

  --ok: #3DDC97;
  --ok-bg: rgba(61, 220, 151, .1);
  --warn: #FFC857;
  --warn-bg: rgba(255, 200, 87, .1);
  --bad: #FF6B8E;
  --bad-bg: rgba(255, 0, 78, .1);
  --info: #9EA7FF;
  --info-bg: rgba(137, 0, 255, .14);
  --r: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.glow {
  position: fixed; width: 620px; height: 620px; border-radius: 50%;
  background: conic-gradient(from 210deg, var(--violet), var(--pink), var(--red), var(--violet));
  filter: blur(110px); opacity: .14; top: -300px; right: -220px; pointer-events: none; z-index: 0;
}

/* ── Верхняя панель ─────────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(14, 14, 17, .82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top-in {
  max-width: 1100px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 22px;
}
.top img { height: 22px; display: block; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand span { font-size: 13px; color: var(--muted); padding-left: 12px; border-left: 1px solid var(--line2); }
nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
nav a {
  color: var(--muted); padding: 7px 12px; border-radius: 9px; font-size: 14px; font-weight: 500;
}
nav a:hover { color: var(--ink); background: var(--surface2); text-decoration: none; }
nav a.on { color: var(--ink); background: var(--surface2); }
nav .count {
  display: inline-block; min-width: 19px; padding: 0 6px; margin-left: 6px; border-radius: 10px;
  background: var(--grad); color: #fff; font-size: 12px; line-height: 19px; text-align: center;
}
.who { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.who b { color: var(--ink); font-weight: 600; }
.role {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 2px 8px; border-radius: 6px;
  background: var(--info-bg); color: var(--info);
}

/* ── Каркас ─────────────────────────────────────────────────────── */
main { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 32px 20px 64px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
h2 { margin: 0 0 14px; font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
h3 { margin: 0 0 8px; font-size: 15px; font-weight: 650; }
.sub { color: var(--muted); margin: 6px 0 0; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px;
}
.card + .card, .stack > * + * { margin-top: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.cols { display: grid; gap: 16px; grid-template-columns: 1.6fr 1fr; align-items: start; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } .top-in { flex-wrap: wrap; } }

/* ── Кнопки ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px; border: 1px solid transparent;
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  background: var(--grad); color: #fff; transition: filter .15s, transform .05s; white-space: nowrap;
}
.btn:hover { filter: brightness(1.1); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; border-color: var(--line2); color: var(--ink); }
.btn.ghost:hover { background: var(--surface2); }
.btn.ok { background: #1E9E6A; }
.btn.danger { background: transparent; border-color: rgba(255, 0, 78, .45); color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn.wide { width: 100%; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ── Метки статусов ─────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--surface2); color: var(--muted);
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.off { background: var(--surface2); color: var(--muted); }

/* ── Карточка проекта ───────────────────────────────────────────── */
.proj { display: flex; flex-direction: column; gap: 14px; }
.proj-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.proj-title { font-size: 17px; font-weight: 650; color: var(--ink); }
.proj-title:hover { color: var(--accent); text-decoration: none; }
.kind { font-size: 13px; color: var(--muted); }
.meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.meta b { color: var(--ink); font-weight: 600; }
.proj-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }

.empty {
  text-align: center; padding: 56px 24px; border: 1px dashed var(--line2); border-radius: var(--r); color: var(--muted);
}
.empty h2 { color: var(--ink); margin-bottom: 6px; }
.empty p { margin: 0 0 22px; }

/* ── Переключатель вкл/выкл ─────────────────────────────────────── */
.switch { display: inline-flex; align-items: center; gap: 10px; }
.switch button {
  position: relative; width: 46px; height: 26px; border-radius: 13px; border: 0; cursor: pointer; padding: 0;
  background: var(--line2); transition: background .2s;
}
.switch button::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: left .2s;
}
.switch button.on { background: #1E9E6A; }
.switch button.on::after { left: 23px; }
.switch span { font-size: 13.5px; font-weight: 600; }
.switch button:disabled { opacity: .4; cursor: not-allowed; }

/* ── Формы ──────────────────────────────────────────────────────── */
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 7px; }
.field { margin-bottom: 18px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
input[type=text], input[type=password], textarea, select {
  width: 100%; padding: 11px 13px; background: #101015; border: 1px solid var(--line); border-radius: 10px;
  color: var(--ink); font-family: inherit; font-size: 14.5px; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 92px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(252, 58, 121, .16);
}
.kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.kinds label {
  margin: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  color: var(--ink); font-weight: 500; font-size: 14px; display: flex; gap: 8px; align-items: center;
}
.kinds input { accent-color: var(--accent); }
.kinds label:has(input:checked) { border-color: var(--accent); background: rgba(252, 58, 121, .07); }

.drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 30px 18px; border: 1.5px dashed var(--line2); border-radius: 12px; text-align: center;
  background: #121217; cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(252, 58, 121, .05); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .big { font-size: 15px; font-weight: 600; color: var(--ink); }
.drop .file { font-size: 13.5px; color: var(--ok); font-weight: 600; }
.drop svg { color: var(--accent); }

/* ── Шаги «как это работает» ────────────────────────────────────── */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; display: grid; gap: 14px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.steps li::before {
  content: counter(s); width: 30px; height: 30px; border-radius: 50%; background: var(--grad); color: #fff;
  font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center;
}
.steps b { display: block; color: var(--ink); }
.steps span { color: var(--muted); font-size: 14px; }

/* ── Таймлайн статуса версии ────────────────────────────────────── */
.flow { display: flex; gap: 0; margin: 4px 0 6px; flex-wrap: wrap; }
.flow div {
  flex: 1; min-width: 120px; padding: 10px 12px 10px 0; font-size: 13px; color: var(--muted); position: relative;
  border-top: 3px solid var(--line2);
}
.flow div.done { border-top-color: #1E9E6A; color: var(--ink); }
.flow div.now { border-image: var(--grad) 1; color: var(--ink); font-weight: 650; }
.flow div.fail { border-top-color: var(--red); color: var(--bad); font-weight: 650; }

/* ── Проверки ───────────────────────────────────────────────────── */
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checks li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface2); }
.checks li b { display: block; font-weight: 600; font-size: 14px; }
.checks li span { font-size: 13px; color: var(--muted); word-break: break-word; }
.checks .ico { font-size: 15px; line-height: 1.4; }
.checks .error { background: var(--bad-bg); }
.checks .warn { background: var(--warn-bg); }

/* ── Разница версий ─────────────────────────────────────────────── */
.dstat { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.dstat span { padding: 5px 11px; border-radius: 8px; background: var(--surface2); font-size: 13px; font-weight: 600; }
.files { list-style: none; padding: 0; margin: 0 0 14px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.files li { padding: 3px 0; }
.files .a { color: var(--ok); } .files .r { color: var(--bad); } .files .c { color: var(--warn); }
details.patch { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; overflow: hidden; }
details.patch summary {
  cursor: pointer; padding: 9px 13px; background: var(--surface2); font-family: ui-monospace, Consolas, monospace;
  font-size: 13px; display: flex; justify-content: space-between; gap: 10px;
}
details.patch summary .pm { color: var(--muted); }
details.patch summary .pm .p { color: var(--ok); } details.patch summary .pm .m { color: var(--bad); }
pre.diff { margin: 0; padding: 10px 0; overflow-x: auto; font: 12.5px/1.5 ui-monospace, Consolas, monospace; background: #0B0B0E; }
pre.diff div { padding: 0 13px; white-space: pre; }
pre.diff .p { background: rgba(61, 220, 151, .1); color: #9BF0C9; }
pre.diff .m { background: rgba(255, 0, 78, .1); color: #FFA3BC; }
pre.diff .h { color: var(--info); }

/* ── Таблицы ────────────────────────────────────────────────────── */
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 0 12px 10px 0; border-bottom: 1px solid var(--line); }
table.t td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
.tw { overflow-x: auto; }

/* ── Плашки ─────────────────────────────────────────────────────── */
.note { padding: 13px 16px; border-radius: 11px; font-size: 14px; border: 1px solid var(--line); background: var(--surface2); }
.note.ok { background: var(--ok-bg); border-color: rgba(61, 220, 151, .3); }
.note.warn { background: var(--warn-bg); border-color: rgba(255, 200, 87, .3); }
.note.bad { background: var(--bad-bg); border-color: rgba(255, 0, 78, .32); }
.note.info { background: var(--info-bg); border-color: rgba(137, 0, 255, .35); }
.note b { color: var(--ink); }
.sim { margin-bottom: 20px; }

.secret {
  font-family: ui-monospace, Consolas, monospace; font-size: 17px; letter-spacing: .04em; padding: 12px 14px;
  background: #0B0B0E; border-radius: 10px; border: 1px solid var(--line2); user-select: all; margin: 8px 0;
}

.feed { list-style: none; padding: 0; margin: 0; }
.feed li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; display: grid; grid-template-columns: 130px 1fr; gap: 12px; }
.feed li:last-child { border-bottom: 0; }
.feed time { color: var(--muted); font-size: 13px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.stat b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.stat span { font-size: 13px; color: var(--muted); }

/* ── Вход ───────────────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login { position: relative; width: 100%; max-width: 400px; padding: 38px 34px 30px; }
.login img { height: 30px; margin-bottom: 28px; display: block; }
.login .btn { width: 100%; padding: 13px; font-size: 15px; }

/* ── Пользователи и доступы ─────────────────────────────────────── */
.ulist { display: grid; gap: 12px; }
.urow { padding: 18px 22px; }
.urow.pend { border-color: rgba(255, 200, 87, .55); box-shadow: 0 0 0 1px rgba(255, 200, 87, .15) inset; }
.uhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.uwho { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.uname {
  width: auto !important; min-width: 260px; padding: 2px 6px !important; margin-left: -6px;
  font-size: 17px !important; font-weight: 650; background: transparent !important; border-color: transparent !important;
}
.uname:hover, .uname:focus { border-color: var(--line) !important; background: #101015 !important; }
.umeta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ulogin { font-family: ui-monospace, Consolas, monospace; font-size: 13.5px; color: var(--ink); background: var(--surface2); padding: 2px 8px; border-radius: 6px; }
.umeta select { width: auto; padding: 4px 8px; font-size: 13px; border-radius: 8px; }
.ublock { display: grid; grid-template-columns: 170px 1fr; gap: 12px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.ulabel { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding-top: 7px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 6px 12px; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--line2); color: var(--ink); font-size: 13.5px; font-weight: 500; user-select: none;
}
.chip input { accent-color: var(--accent); margin: 0; }
.chip:has(input:checked) { border-color: var(--accent); background: rgba(252, 58, 121, .1); }
.chip.admin:has(input:checked) { border-color: var(--info); background: var(--info-bg); }
.chip.proj:has(input:checked) { border-color: var(--ok); background: var(--ok-bg); }
.chip:has(input:disabled) { opacity: .55; cursor: default; }
.ufoot { padding-top: 12px; border-top: 1px solid var(--line); }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px) { .ublock { grid-template-columns: 1fr; } .cols3 { grid-template-columns: 1fr; } .uname { min-width: 0; } }
.chip { flex-direction: row; white-space: nowrap; }
.chip input { width: auto; flex: none; }

/* ── Карточка проекта: низ в две строки, ничего не вылезает ─────── */
.proj-foot { flex-direction: column; align-items: stretch; gap: 12px; }
.proj-foot .btn { width: 100%; }
.switch-off { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.switch-off svg { flex: none; opacity: .7; }
.proj-top > div:first-child { min-width: 0; }
.proj-title { overflow-wrap: anywhere; }
.meta { row-gap: 8px; }
.meta span { display: inline-flex; align-items: center; gap: 6px; }
.foot-btns { display: flex; gap: 8px; }
.foot-btns .btn { flex: 1; width: auto; }
td.dl { width: 32px; text-align: right; }
td.dl a { color: var(--muted); display: inline-flex; padding: 4px; border-radius: 6px; }
td.dl a:hover { color: var(--ink); background: var(--surface2); }
.btn svg { flex: none; }
@media (max-width: 480px) { .foot-btns { flex-direction: column; } }
/* Колонки сетки не растягиваются содержимым (таблица прокручивается внутри своей обёртки). */
.cols > *, .grid > *, .stack > * { min-width: 0; }
html, body { overflow-x: hidden; }
.grid { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
@media (max-width: 480px) { .grid { grid-template-columns: 1fr; } }
td.nw, .nw { white-space: nowrap; }
.tag { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 600; color: var(--ok); background: var(--ok-bg); padding: 1px 7px; border-radius: 6px; }
/* ── Телефон: шапка в две строки — логотип и выход, ниже меню с прокруткой ── */
@media (max-width: 860px) {
  .top-in { flex-wrap: wrap; gap: 8px 14px; padding: 10px 16px; }
  .brand span { display: none; }
  .who { margin-left: auto; }
  nav { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; gap: 2px; padding-bottom: 2px; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  nav a { white-space: nowrap; padding: 6px 10px; }
  main { padding: 22px 16px 48px; }
  h1 { font-size: 24px; }
  .head .btn { width: 100%; }
  .card { padding: 18px 16px; }
}
.ctl textarea { min-height: 44px; }
@media (max-width: 860px) { nav { flex: 0 0 100%; } }
@media (max-width: 600px) { .hide-sm { display: none; } }
@media (max-width: 600px) { table.t .pill { white-space: normal; } }
