/* Контент завод — оформление.
   Тёплый светлый фон, графитовое меню, коралловый акцент «завода».
   Шрифт Manrope лежит у нас (static/fonts) — без внешних сайтов. */

@font-face { font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(/static/fonts/manrope-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(/static/fonts/manrope-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212; }

:root {
  --bg: #f5f3ef;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #17171c;
  --ink-2: #3a3a44;
  --muted: #7b7a82;
  --line: #e8e5df;
  --line-2: #f0ede8;
  --accent: #ff5a36;
  --accent-2: #ff8a3d;
  --accent-soft: #fff1ec;
  --accent-ink: #ffffff;
  --ok: #1f9d55;   --ok-soft: #e7f6ee;
  --warn: #b7791f; --warn-soft: #fff5e1;
  --err: #d64545;  --err-soft: #fdeeee;
  --info: #2f6fdb; --info-soft: #eaf1fd;
  --side: #16161b;
  --side-2: #22222a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(23, 23, 28, .04), 0 4px 16px rgba(23, 23, 28, .05);
  --shadow-lg: 0 8px 30px rgba(23, 23, 28, .10);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
a:hover { color: var(--accent); }
::selection { background: #ffd8cc; }

/* ---------- каркас ---------- */
.layout { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--side); color: #c9c8d0; padding: 22px 14px; display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 18px rgba(255, 90, 54, .35); }
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -.01em; line-height: 1.1; }
.brand-name small { display: block; font-weight: 500; font-size: 11px; color: #8d8c96; letter-spacing: .02em; }
.nav { display: flex; align-items: center; gap: 11px; text-decoration: none; padding: 9px 12px; border-radius: 10px;
  color: #c9c8d0; font-weight: 600; font-size: 14px; transition: background .15s, color .15s; }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .75; }
.nav:hover { background: var(--side-2); color: #fff; }
.nav.on { background: var(--side-2); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav.on svg { opacity: 1; color: var(--accent); }
.nav .count { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  padding: 1px 7px; border-radius: 99px; }
.side .sep { margin: 18px 12px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: #6d6c76; font-weight: 700; }
.me { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid #2a2a33; display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #34343e; color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 13px; flex: none; }
.me .who { min-width: 0; flex: 1; font-size: 13px; line-height: 1.3; }
.me .who a { color: #fff; text-decoration: none; font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who span { color: #8d8c96; font-size: 12px; }
.me button { background: none; border: 0; color: #8d8c96; cursor: pointer; padding: 6px; border-radius: 8px; }
.me button:hover { background: var(--side-2); color: #fff; }
.me button svg { width: 18px; height: 18px; display: block; }
.ws-switch select { width: 100%; background: var(--side-2); color: #fff; border: 1px solid #2f2f38; border-radius: 8px;
  padding: 7px 9px; font: inherit; font-size: 13px; margin: 0 0 8px; }

main { padding: 34px 40px 80px; max-width: 1160px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
h1 { font-size: 30px; line-height: 1.15; letter-spacing: -.02em; font-weight: 800; margin: 0 0 6px; }
h2 { font-size: 18px; letter-spacing: -.01em; font-weight: 800; margin: 30px 0 12px; }
h3 { font-size: 15px; font-weight: 800; margin: 0 0 6px; }
.lead { font-size: 15px; color: var(--muted); margin: 6px 0 0; max-width: 680px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 600;
  font-size: 13px; margin-bottom: 10px; }

/* ---------- карточки ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px;
  margin-bottom: 16px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); text-decoration: none; display: block; }
.stat:hover { color: inherit; border-color: #dcd8d0; }
.stat .n { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat .l { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat.hot .n { color: var(--accent); }
.stat.bad .n { color: var(--err); }

/* ---------- таблицы и списки ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; padding-top: 4px; }
.list-item { display: flex; gap: 14px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line-2); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.preview { white-space: pre-wrap; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  color: var(--ink-2); }
a.preview, .post-link { text-decoration: none; }
.net { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 9px;
  flex: none; color: #fff; font-weight: 800; font-size: 12px; }
.net svg { width: 16px; height: 16px; }
.net.telegram { background: #2aabee; }
.net.vk { background: #0077ff; }
.net.ai { background: linear-gradient(135deg, #d97757, #b9572f); }
.net.media { background: linear-gradient(135deg, #7c5cff, #b05cff); }

/* ---------- формы ---------- */
label { display: block; font-weight: 700; font-size: 14px; margin: 16px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=datetime-local], input[type=date], select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit;
  background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 90, 54, .12); }
textarea { min-height: 240px; resize: vertical; line-height: 1.6; }
input[type=file] { font: inherit; font-size: 14px; }
.help { font-size: 13px; color: var(--muted); margin-top: 6px; }
.req { color: var(--accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 17px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--surface); font: inherit; font-weight: 700; font-size: 14px; color: var(--ink);
  cursor: pointer; text-decoration: none; transition: transform .05s, background .15s, border-color .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { border-color: #d6d2ca; color: var(--ink); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff;
  box-shadow: 0 6px 16px rgba(255, 90, 54, .28); }
.btn.primary:hover { color: #fff; box-shadow: 0 8px 22px rgba(255, 90, 54, .36); }
.btn.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.danger { color: var(--err); }
.btn.danger:hover { background: var(--err-soft); border-color: #f3caca; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn.lg { padding: 13px 22px; font-size: 15px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
form.inline { display: inline; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; margin: 6px 0; }

/* ---------- статусы ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px;
  font-weight: 700; background: #f0eee9; color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.badge.ok, .badge.published { background: var(--ok-soft); color: var(--ok); }
.badge.error, .badge.failed { background: var(--err-soft); color: var(--err); }
.badge.awaiting_approval, .badge.unchecked { background: var(--warn-soft); color: var(--warn); }
.badge.queued, .badge.publishing { background: var(--info-soft); color: var(--info); }
.badge.cancelled, .badge.draft { background: #f0eee9; color: var(--muted); }
.err-text { color: var(--err); font-size: 13px; margin-top: 4px; }

/* ---------- сообщения ---------- */
.flash { display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; padding: 13px 18px;
  border-radius: 12px; margin-bottom: 22px; box-shadow: var(--shadow-lg); font-weight: 600; animation: drop .25s ease-out; }
.flash::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
.errors { background: var(--err-soft); color: var(--err); padding: 12px 16px; border-radius: 12px; font-weight: 600; margin-bottom: 10px; }
.warns { background: var(--warn-soft); color: #7a5200; padding: 12px 16px; border-radius: 12px; margin: 12px 0; font-size: 14px; }

/* ---------- подсказки ---------- */
details.hint { background: linear-gradient(135deg, #fff8f0, #fff3ea); border: 1px solid #fbe0cc; border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 20px; }
details.hint summary { cursor: pointer; font-weight: 800; list-style: none; display: flex; align-items: center; gap: 10px; }
details.hint summary::-webkit-details-marker { display: none; }
details.hint summary::before { content: "?"; display: grid; place-items: center; width: 22px; height: 22px; flex: none;
  border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; font-weight: 800; }
details.hint summary::after { content: "Скрыть"; margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 600; }
details.hint:not([open]) summary::after { content: "Показать"; }
details.hint .body { margin: 10px 0 2px 32px; color: var(--ink-2); font-size: 14px; }
details.hint .body p { margin: 6px 0; }
details.hint .body ul, details.hint .body ol { margin: 6px 0; padding-left: 18px; }
.tip { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: #ece9e3; color: var(--muted);
  font-size: 11px; font-weight: 800; cursor: help; margin-left: 4px; vertical-align: 1px; position: relative; }
.tip:hover::after, .tip:focus::after { content: attr(data-tip); position: absolute; left: 50%; bottom: 140%; transform: translateX(-50%);
  width: 240px; background: var(--ink); color: #fff; padding: 9px 11px; border-radius: 9px; font-size: 12px; font-weight: 500;
  line-height: 1.45; z-index: 20; box-shadow: var(--shadow-lg); text-align: left; }

/* ---------- мастер первых шагов ---------- */
.onboard { background: linear-gradient(135deg, #1b1b21, #2b2228); color: #fff; border: 0; position: relative; overflow: hidden; }
.onboard::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 90, 54, .45), transparent 70%); }
.onboard h2 { margin: 0 0 4px; color: #fff; }
.onboard .muted { color: #a7a5ae; }
.progress { height: 6px; background: rgba(255, 255, 255, .12); border-radius: 99px; overflow: hidden; margin: 14px 0 6px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; }
.steps { list-style: none; padding: 0; margin: 10px 0 0; counter-reset: s; position: relative; z-index: 1; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr auto; gap: 14px; align-items: center;
  padding: 13px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255, 255, 255, .1); font-weight: 800; font-size: 14px; }
.steps li.done::before { content: "✓"; background: rgba(31, 157, 85, .25); color: #6fe3a1; }
.steps li.next::before { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.steps li.done .t { color: #8e8c96; text-decoration: line-through; }
.steps .t { font-weight: 700; }
.steps .d { font-size: 13px; color: #a7a5ae; }
.steps .btn { border-color: rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .06); color: #fff; }
.steps .btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }

/* ---------- пустые экраны ---------- */
.empty { text-align: center; padding: 34px 14px; color: var(--muted); }
.empty .ico { width: 52px; height: 52px; border-radius: 16px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; margin: 0 auto 12px; }
.empty .ico svg { width: 24px; height: 24px; }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }

/* ---------- подключения ---------- */
.svc { display: flex; flex-direction: column; gap: 8px; height: 100%; }
.svc .top { display: flex; align-items: center; gap: 12px; }
.svc .title { font-weight: 800; font-size: 16px; }
.svc .purpose { color: var(--muted); font-size: 14px; flex: 1; }
.svc .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.svc.connected { border-color: #cfe9d9; }
.cat-hint { color: var(--muted); font-size: 14px; margin: -6px 0 12px; }
ol.howto { counter-reset: h; list-style: none; padding: 0; margin: 4px 0 0; }
ol.howto li { counter-increment: h; position: relative; padding: 8px 0 8px 40px; }
ol.howto li::before { content: counter(h); position: absolute; left: 0; top: 6px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: 13px; }

/* ---------- выбор режима, каналы ---------- */
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice label { margin: 0; font-weight: 500; border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer;
  background: var(--surface); font-size: 13px; color: var(--muted); }
.choice label b { display: block; color: var(--ink); font-size: 14px; margin-bottom: 2px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.chan { display: flex; gap: 12px; align-items: center; border: 2px solid var(--line); border-radius: 12px; padding: 11px 13px;
  margin: 8px 0; font-weight: 600; cursor: pointer; background: var(--surface); }
.chan:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.chan input { width: 18px; height: 18px; accent-color: var(--accent); }
.chan .grow { flex: 1; }
.chan .sub { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }

/* ---------- редактор поста ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.phone { background: linear-gradient(180deg, #dfe8ef, #d5dee6); border-radius: 26px; padding: 16px; position: sticky; top: 24px;
  box-shadow: var(--shadow); }
.phone .cap { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #6b7a87; margin: 0 0 10px 4px; }
.phone .bubble { background: #fff; border-radius: 16px 16px 16px 4px; padding: 12px 14px; white-space: pre-wrap; word-wrap: break-word;
  font-size: 14px; max-height: 560px; overflow: auto; box-shadow: 0 1px 1px rgba(0, 0, 0, .06); }
.phone .bubble .ph { color: #a5aab0; }
.phone .imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin: -4px -6px 10px; border-radius: 12px; overflow: hidden; }
.phone .imgs img { width: 100%; height: 110px; object-fit: cover; display: block; }
.phone .imgs img:only-child { grid-column: span 2; height: auto; max-height: 260px; }
.phone .imgs video { grid-column: span 2; width: 100%; max-height: 320px; display: block; background: #000; }
.limits { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; margin-top: 8px; font-weight: 700; }
.limits span { padding: 3px 9px; border-radius: 99px; background: var(--ok-soft); color: var(--ok); }
.limits span.over { background: var(--err-soft); color: var(--err); }
.limits span.warn { background: var(--warn-soft); color: var(--warn); }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.thumbs figure { margin: 0; width: 104px; text-align: center; }
.thumbs .clip { width: 260px; }
.thumbs video { width: 100%; max-height: 300px; border-radius: 12px; background: #000; display: block; margin-bottom: 4px; }
.thumbs img { width: 104px; height: 104px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); display: block; margin-bottom: 4px; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 16px; text-align: center; color: var(--muted); font-size: 14px;
  background: var(--surface-2); }
.actionbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line-2); }
.actionbar .note { font-size: 13px; color: var(--muted); flex: 1; min-width: 200px; }

/* ---------- контент-план ---------- */
.cal-head { display: flex; align-items: center; gap: 10px; }
.cal-head .month { font-size: 20px; font-weight: 800; min-width: 180px; text-align: center; letter-spacing: -.01em; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal .dow { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; padding: 0 6px; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-height: 118px; padding: 8px; display: flex;
  flex-direction: column; gap: 5px; position: relative; }
.day.out { background: transparent; border-style: dashed; opacity: .5; }
.day.today { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 90, 54, .12); }
.day.past { background: var(--surface-2); }
.day .num { font-size: 13px; font-weight: 800; color: var(--ink-2); display: flex; justify-content: space-between; align-items: center; }
.day.today .num span:first-child { background: var(--accent); color: #fff; border-radius: 7px; padding: 0 7px; }
.day .add { opacity: 0; transition: opacity .15s; }
.day:hover .add { opacity: 1; }
.day .add button { border: 0; background: var(--accent-soft); color: var(--accent); width: 22px; height: 22px; border-radius: 7px;
  font-weight: 800; cursor: pointer; line-height: 1; }
.chip { display: block; text-decoration: none; font-size: 12px; line-height: 1.35; padding: 5px 7px; border-radius: 8px;
  background: #f3f1ec; border-left: 3px solid #c9c5bd; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--ink-2); }
.chip:hover { color: var(--ink); filter: brightness(.97); }
.chip.published { background: var(--ok-soft); border-color: var(--ok); }
.chip.queued, .chip.publishing { background: var(--info-soft); border-color: var(--info); }
.chip.awaiting_approval { background: var(--warn-soft); border-color: var(--warn); }
.chip.failed { background: var(--err-soft); border-color: var(--err); }
.chip.draft { background: #f3f1ec; border-color: #c9c5bd; border-left-style: dashed; }
.chip .tm { font-weight: 800; margin-right: 4px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 14px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- вход ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: radial-gradient(circle at 20% 20%, rgba(255, 90, 54, .55), transparent 45%),
  radial-gradient(circle at 80% 70%, rgba(255, 138, 61, .35), transparent 50%), #16161b;
  color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art .brand { padding: 0; }
.auth-art h2 { font-size: 40px; line-height: 1.08; letter-spacing: -.03em; margin: 0 0 14px; max-width: 460px; }
.auth-art p { color: #bdbbc4; max-width: 420px; margin: 0; font-size: 16px; }
.auth-art ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 10px; }
.auth-art li { display: flex; gap: 10px; align-items: center; color: #e2e1e6; font-weight: 600; }
.auth-art li::before { content: "✓"; width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, .1);
  display: grid; place-items: center; font-size: 12px; color: var(--accent-2); }
.auth-form { display: grid; place-items: center; padding: 32px 20px; }
.auth-form .box { width: 100%; max-width: 380px; }
.auth-form h1 { font-size: 28px; }

/* ---------- адаптив ---------- */
@media (max-width: 1000px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .editor { grid-template-columns: 1fr; }
  .phone { position: static; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 12px; gap: 4px; }
  .side .sep, .me .who span { display: none; }
  .brand { padding: 4px 8px; width: 100%; }
  .nav { padding: 8px 10px; }
  .nav span.lbl { font-size: 13px; }
  .me { width: 100%; border-top: 0; padding: 8px; }
  main { padding: 22px 16px 60px; }
  h1 { font-size: 24px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 22px; }
  .auth-art h2 { font-size: 28px; }
  .auth-art ul { display: none; }
  .choice { grid-template-columns: 1fr; }
  .cal { grid-template-columns: 1fr; }
  .cal .dow, .day.out { display: none; }
  .day { min-height: 0; }
  .day .add { opacity: 1; }
  .card { padding: 16px; }
  table { font-size: 14px; }
}
img.avatar { object-fit: cover; }
a.avatar { text-decoration: none; }
.avatar-lg { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--accent); }
.avatar-xl { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: 36px; font-weight: 800; }
/* иконки без явного размера не должны растягиваться */
main svg { width: 18px; height: 18px; flex: none; }
.drop > svg { width: 28px; height: 28px; color: var(--muted); }
.back svg { width: 16px; height: 16px; }
.empty .ico svg { width: 24px; height: 24px; }
.net svg { width: 16px; height: 16px; }

/* ---------- переключатель проектов ---------- */
details.proj { margin: 0 0 14px; position: relative; }
details.proj summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 9px 10px;
  border-radius: 12px; background: var(--side-2); border: 1px solid #2f2f38; color: #fff; }
details.proj summary::-webkit-details-marker { display: none; }
details.proj summary svg { width: 16px; height: 16px; margin-left: auto; color: #8d8c96; flex: none; }
.proj-mark { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; font-weight: 800;
  background: linear-gradient(135deg, #3b3b46, #2a2a33); color: #fff; font-size: 13px; }
.proj-mark.sm { width: 26px; height: 26px; font-size: 12px; border-radius: 8px; }
.proj-name { min-width: 0; font-weight: 700; font-size: 14px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-name small { display: block; font-size: 11px; color: #8d8c96; font-weight: 600; }
.proj-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; background: #1f1f26; border: 1px solid #2f2f38;
  border-radius: 12px; padding: 6px; box-shadow: 0 12px 30px rgba(0, 0, 0, .4); }
.proj-menu form { margin: 0; }
.proj-menu button, .proj-menu a { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; background: none;
  color: #d8d7de; font: inherit; font-size: 14px; font-weight: 600; text-align: left; border-radius: 8px; cursor: pointer; text-decoration: none; }
.proj-menu button:hover, .proj-menu a:hover { background: var(--side-2); color: #fff; }
.proj-menu button.on { color: #fff; }
.proj-menu .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-menu small { display: block; font-size: 11px; color: #8d8c96; font-weight: 500; }
.proj-menu svg { width: 16px; height: 16px; flex: none; color: var(--accent); }
.proj-menu a { border-top: 1px solid #2f2f38; border-radius: 0 0 8px 8px; margin-top: 4px; padding-top: 10px; color: #c9c8d0; }
.copy-box { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px dashed var(--accent);
  border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.copy-box input { border: 0; background: transparent; padding: 4px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.copy-box input:focus { box-shadow: none; }
.project-card { display: flex; flex-direction: column; gap: 10px; }
.project-card .top { display: flex; align-items: center; gap: 12px; }
.project-card .proj-mark { width: 42px; height: 42px; font-size: 17px; border-radius: 12px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.project-card.current { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 90, 54, .12); }
.kv { display: flex; gap: 14px; font-size: 13px; color: var(--muted); font-weight: 600; }
.kv b { color: var(--ink); }
details.ch-settings { margin: -4px 0 8px 44px; padding: 0 0 12px; border-bottom: 1px solid var(--line-2); }
details.ch-settings summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--muted); }
details.ch-settings summary::-webkit-details-marker { display: none; }
details.ch-settings summary svg { width: 14px; height: 14px; }
details.ch-settings[open] summary { color: var(--accent); margin-bottom: 4px; }
.net.max { background: linear-gradient(135deg, #3d7bff, #8a3dff); }
.net.ok { background: #ee8208; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin svg { animation: spin 1.6s linear infinite; }
.wizard-steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.wizard-steps a { text-decoration: none; padding: 7px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; font-weight: 700; color: var(--muted); }
.wizard-steps a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.wizard-steps a.done { color: var(--ok); border-color: #cfe9d9; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips label { margin: 0; font-weight: 600; font-size: 14px; border: 2px solid var(--line); border-radius: 99px; padding: 6px 13px; cursor: pointer; background: var(--surface); }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.ai-panel { background: linear-gradient(135deg, #1b1b21, #2b2228); color: #fff; border: 0; }
.ai-panel h3 { color: #fff; }
.ai-panel .muted, .ai-panel .help { color: #a7a5ae; }
.ai-panel input, .ai-panel textarea { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); color: #fff; }
.ai-panel .btn:not(.primary) { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.16); color: #fff; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.tabs button { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.mem { border-left: 3px solid var(--line); padding: 8px 12px; margin: 10px 0; background: var(--surface-2); border-radius: 0 10px 10px 0; }
.mem.rule { border-color: var(--accent); }
.mem.edit { border-color: var(--info); }
.mem.rejected { border-color: var(--err); }
.mem.liked { border-color: var(--ok); }
.mem pre { white-space: pre-wrap; font: inherit; font-size: 13px; margin: 4px 0; max-height: 160px; overflow: auto; }
.review-wrap { max-width: 760px; margin: 0 auto; padding: 28px 16px 60px; }
.review-head { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.review-text { white-space: pre-wrap; font-size: 15px; line-height: 1.6; margin: 12px 0; }
.review-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-top: 12px; }
.review-imgs img { width: 100%; border-radius: 10px; object-fit: cover; aspect-ratio: 1; }
.review-imgs video { grid-column: 1 / -1; width: 100%; max-height: 420px; border-radius: 10px; background: #000; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filters select { width: auto; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.lib-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none;
  box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; display: flex; flex-direction: column; }
.lib-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: inherit; }
.lib-thumb { position: relative; aspect-ratio: 1; background: linear-gradient(135deg, #2b2228, #16161b); overflow: hidden; }
.lib-thumb.fmt-story { aspect-ratio: 4/5; }
.lib-thumb img, .lib-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-ph { position: absolute; inset: 0; padding: 16px; color: #fff; font-weight: 800; font-size: 16px; line-height: 1.3; display: flex; align-items: flex-end; }
.lib-fmt { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 800;
  padding: 3px 8px; border-radius: 99px; }
.lib-body { padding: 12px 14px; }
.lib-title { font-weight: 700; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.slide-ed { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 10px 0; background: var(--surface-2); position: relative; }
.slide-ed .num { position: absolute; top: 10px; right: 12px; font-weight: 800; color: var(--muted); font-size: 12px; }
.slide-ed textarea { min-height: 80px; }
.ref-pick { margin: 0; cursor: pointer; }
.ref-pick input { position: absolute; opacity: 0; }
.ref-pick img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 3px solid transparent; }
.ref-pick:has(input:checked) img { border-color: var(--accent); }
input[type=color] { width: 40px; height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: #fff; }
.thumbs figure .badge { margin: 2px 0; }
.voice-wrap { position: relative; }
.voice-wrap textarea, .voice-wrap input { padding-right: 46px; }
.mic { position: absolute; right: 8px; top: 8px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-size: 15px; line-height: 1; }
.mic:hover { border-color: var(--accent); }
.mic.on { background: var(--accent); border-color: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
.mic:disabled { opacity: .35; cursor: not-allowed; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(255, 90, 54, .25); } }
.ai-panel .mic { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); }
.bars { display: flex; gap: 8px; align-items: flex-end; height: 200px; padding: 10px 0 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bar-pair { flex: 1; width: 100%; display: flex; gap: 3px; align-items: flex-end; justify-content: center; }
.bar { width: 42%; border-radius: 6px 6px 0 0; min-height: 2px; position: relative; }
.bar.a { background: var(--accent); }
.bar.n { background: #c9c5bd; }
.bar b { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--ink-2); }
.bar-l { font-size: 11px; color: var(--muted); margin-top: 6px; }
@media (max-width: 820px) { .card table { display: block; overflow-x: auto; } }

/* ---------- плотный вид: все внутренние страницы ---------- */
main .page-head { margin-bottom: 14px; }
main h1 { font-size: 24px; }
main .lead { font-size: 14px; margin-top: 2px; }
main .card { padding: 14px 16px; margin-bottom: 12px; border-radius: 14px; }
main .card-head { margin-bottom: 6px; }
main h3 { font-size: 15px; }
main h3.sub { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 4px; }
main h2 { font-size: 16px; margin: 18px 0 8px; }
main label { font-size: 13px; margin: 10px 0 4px; }
main input[type=text], main input[type=datetime-local], main select, main textarea { padding: 8px 10px; font-size: 14px; border-radius: 9px; }
main input[type=datetime-local] { max-width: 230px !important; }
main textarea { min-height: 160px; }
main .btn { padding: 7px 13px; font-size: 13px; border-radius: 9px; }
main .btn.sm { padding: 5px 10px; font-size: 12px; }
main .actionbar { padding-top: 12px; margin-top: 12px; gap: 8px; }
main .chan { padding: 7px 10px; margin: 5px 0; }
main .drop { padding: 10px; }
main .drop > svg { width: 20px; height: 20px; }
main .thumbs img { width: 84px; height: 84px; }
main .thumbs figure { width: 84px; }
main .chips label { padding: 4px 11px; font-size: 13px; }
main .slide-ed { padding: 8px 10px; margin: 6px 0; }
main .slide-ed textarea { min-height: 56px; }
main .editor { gap: 14px; grid-template-columns: minmax(0, 1fr) 280px; }
main .phone { padding: 12px; border-radius: 20px; }
main .help { font-size: 12px; margin-top: 3px; }
main .mem { padding: 6px 10px; margin: 6px 0; }
.chip-off { display: inline-block; padding: 4px 11px; border-radius: 99px; border: 2px dashed var(--line); font-size: 13px;
  font-weight: 600; color: var(--muted); text-decoration: none; }
.chip-off:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- компактная доработка всего интерфейса ---------- */
.layout { grid-template-columns: 228px 1fr; }
.side { padding: 16px 10px; }
.brand { padding: 2px 8px 14px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; }
.brand-name { font-size: 15px; }
.nav { padding: 7px 10px; font-size: 13.5px; gap: 10px; border-radius: 9px; }
.nav svg { width: 16px; height: 16px; }
.side .sep { margin: 12px 10px 4px; font-size: 10.5px; }
details.proj summary { padding: 7px 9px; }
.proj-mark { width: 26px; height: 26px; font-size: 12px; }
main { padding: 22px 28px 60px; max-width: 1200px; }
main .page-head { margin-bottom: 14px; align-items: center; }
main h1 { font-size: 22px; letter-spacing: -.015em; }
main .lead { font-size: 13.5px; }
main .stats { gap: 10px; margin-bottom: 14px; }
main .stat { padding: 12px 14px; border-radius: 12px; }
main .stat .n { font-size: 24px; }
main .stat .l { font-size: 12px; }
main .grid { gap: 10px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
main .grid-2 { gap: 12px; }
main .list-item { padding: 9px 0; gap: 10px; }
main th, main td { padding: 8px 8px; }
main .empty { padding: 18px 10px; font-size: 13px; }
main .empty .ico { width: 40px; height: 40px; border-radius: 12px; margin-bottom: 8px; }
main .empty b { font-size: 14px; }
main .badge { padding: 2px 8px; font-size: 11px; }
main .net { width: 26px; height: 26px; border-radius: 8px; }
main .net svg { width: 14px; height: 14px; }
main .choice label { padding: 9px 11px; font-size: 12px; }
main .choice label b { font-size: 13px; }
main .flash { padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px; }
main .onboard h2 { font-size: 17px; }
main .steps li { padding: 9px 0; grid-template-columns: 28px 1fr auto; gap: 10px; }
main .steps li::before { width: 26px; height: 26px; font-size: 12px; }
main .lib-grid { gap: 10px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
main .lib-body { padding: 9px 11px; }
main .lib-title { font-size: 13px; }
main .cal { gap: 6px; }
main .day { min-height: 96px; padding: 6px; border-radius: 10px; }
main .chip { font-size: 11.5px; padding: 4px 6px; }
main .wizard-steps a { padding: 5px 10px; font-size: 12px; }
main .svc .title { font-size: 14px; }
main .svc .purpose { font-size: 13px; }
main ol.howto li { padding: 5px 0 5px 34px; font-size: 14px; }
main ol.howto li::before { width: 22px; height: 22px; font-size: 12px; top: 4px; }

/* подсказки — тонкая строка, раскрываются по клику */
details.hint { padding: 8px 12px; margin-bottom: 12px; border-radius: 10px; background: #fff8f2; }
details.hint summary { font-size: 13px; font-weight: 700; gap: 8px; color: var(--ink-2); }
details.hint summary::before { width: 18px; height: 18px; font-size: 11px; }
details.hint summary::after { font-size: 11px; }
details.hint .body { margin: 6px 0 2px 26px; font-size: 13px; }
details.hint .body li { margin: 2px 0; }

/* фильтры и тулбары — в одну строку */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.filters select, .filters input { padding: 6px 10px; font-size: 13px; border-radius: 9px; }

@media (max-width: 820px) { main { padding: 16px 14px 50px; } }
.row > .voice-wrap { flex: 1; min-width: 200px; }
.voice-wrap > input, .voice-wrap > textarea { width: 100%; }
main .ai-panel { padding: 12px 14px; }
.ai-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ai-row form.grow { flex: 1 1 380px; display: flex; gap: 8px; align-items: center; }
.ai-row .tools { display: flex; gap: 6px; flex-wrap: wrap; }
.ai-tag { font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ai-tag svg { width: 15px; height: 15px; color: var(--accent-2); }
.inline-empty { font-size: 13px; color: var(--muted); padding: 4px 0; }
.ai-row { display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; align-items: center; }
.ai-row form.grow { display: flex; gap: 8px; align-items: center; min-width: 0; }
.ai-row form.grow .voice-wrap { flex: 1; }
.ai-row .tools { grid-column: 2; }
.ai-row > .btn { grid-column: 2; justify-self: start; }

/* ---------- телефон: меню — одна прокручиваемая строка (правила в конце, чтобы перебить общие) ---------- */
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 40; height: auto; flex-direction: row; flex-wrap: nowrap; overflow-x: auto;
    padding: 8px; gap: 4px; align-items: center; scrollbar-width: none; }
  .side::-webkit-scrollbar { display: none; }
  .side .sep, .me .who, .brand-name { display: none; }
  .brand { width: auto; padding: 2px 4px; flex: none; }
  details.proj { margin: 0; flex: none; position: static; }
  details.proj summary { padding: 5px 7px; }
  .proj-name { max-width: 110px; }
  .proj-menu { position: fixed; left: 8px; right: 8px; top: 54px; }
  .nav { flex: none; padding: 7px 10px; }
  .nav.on { box-shadow: inset 0 -3px 0 var(--accent); }
  .me { width: auto; border: 0; padding: 0 2px; margin: 0; flex: none; }
  main { padding: 14px 12px 50px; }
  main .page-head { flex-direction: column; align-items: stretch; }
  main .stats { grid-template-columns: repeat(2, 1fr); }
  .editor, main .editor, .grid-2, main .grid-2 { grid-template-columns: 1fr; }
  .lib-grid, main .lib-grid { grid-template-columns: repeat(2, 1fr); }
  .ai-row { grid-template-columns: 1fr; }
  .ai-row .tools, .ai-row > .btn { grid-column: 1; }
  .choice, main .choice { grid-template-columns: 1fr !important; }
}
.spark { width: 100%; height: 22px; color: var(--accent); display: block; margin-top: 2px; }
table.heat { border-collapse: separate; border-spacing: 3px; width: 100%; }
table.heat th { font-size: 10px; padding: 0 2px; text-align: center; border: 0; }
table.heat td { height: 22px; border-radius: 5px; border: 0; padding: 0; }
.rbar { flex: 0 0 120px; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.rbar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.inbox-item { padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.inbox-item:last-child { border-bottom: 0; }
.inbox-item.hidden { opacity: .5; }
.inbox-text { white-space: pre-wrap; font-size: 14px; margin: 6px 0 8px 36px; }
.inbox-item form.row, .inbox-item > form { margin-left: 36px; }
.nav .count { margin-left: auto; }
.brand-logo { width: 30px; height: 30px; border-radius: 9px; object-fit: contain; background: #fff; flex: none; }
.auth-art .brand-logo { width: 36px; height: 36px; }
