/* Постомат — дизайн-система MVP */
:root {
  --bg: #f7f8fb;
  --card: #ffffff;
  --ink: #17203a;
  --muted: #67718a;
  --line: #e3e7f0;
  --accent: #4f46e5;
  --accent-ink: #ffffff;
  --accent-soft: #eef0ff;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --ok: #059669;
  --ok-soft: #e7f7f0;
  --tg: #229ed9;
  --vk: #0077ff;
  --max: #7c3aed;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23, 32, 58, .05), 0 8px 24px rgba(23, 32, 58, .06);
  color-scheme: light;
}

/* Тёмная тема. Один источник значений — CSS-переменные в тёмном наборе.
   Путь 1: системный auto — media query на html, пока JS/инлайн-скрипт не решил иначе.
   Путь 2: класс .dark на html — ставится инлайн-скриптом в head (учитывает и системную тему, и выбор «тёмная» из localStorage). */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not(.dark) {
    color-scheme: dark;
    --bg: #12151f;
    --card: #1b2030;
    --ink: #e7eaf3;
    --muted: #9aa3ba;
    --line: #2c3247;
    --accent: #8b93ff;
    --accent-ink: #10132b;
    --accent-soft: #23284a;
    --danger: #f87171;
    --danger-soft: #3a1e24;
    --ok: #34d399;
    --ok-soft: #16302a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    /* брендовые и статусные цвета читаются на тёмном без правок */
  }
}
html.dark {
  color-scheme: dark;
  --bg: #12151f;
  --card: #1b2030;
  --ink: #e7eaf3;
  --muted: #9aa3ba;
  --line: #2c3247;
  --accent: #8b93ff;
  --accent-ink: #10132b;
  --accent-soft: #23284a;
  --danger: #f87171;
  --danger-soft: #3a1e24;
  --ok: #34d399;
  --ok-soft: #16302a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
}
html.dark .demo-banner { background: #332a14; color: #f5c86b; border-color: #4a3d1c; }
html.dark .upsell { border-color: #4a3d1c; background: #2a2417; }
html.dark .status-wait, html.dark .status-scheduled, html.dark .status-publishing, html.dark .status-partial { background: #332a14; color: #f5c86b; }
html.dark .badge-tg { background: #16303f; color: #5ec2f0; }
html.dark .badge-vk { background: #14283f; color: #6aa8ff; }
html.dark .badge-max { background: #291a45; color: #b18cff; }
html.dark .dropzone { background: #171b29; border-color: #3a3f63; }
html.dark .cta-section .btn-primary { background: #fff; color: #4338ca; }
html.dark .feedback-dialog { background: var(--card); color: var(--ink); }
html.dark .feedback-dialog::backdrop { background: rgba(0, 0, 0, .6); }
html.dark code { background: var(--accent-soft); }
html.dark .onb-fill, html.dark .cal-dot, html.dark .cal-today { border-color: var(--accent); }
html.dark .cal-today { box-shadow: 0 0 0 2px rgba(139, 147, 255, .3); }
/* для системного auto (пока нет JS или его отключили) — те же правки через media query */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]):not(.dark) .demo-banner { background: #332a14; color: #f5c86b; border-color: #4a3d1c; }
  html:not([data-theme="light"]):not(.dark) .upsell { border-color: #4a3d1c; background: #2a2417; }
  html:not([data-theme="light"]):not(.dark) .status-wait,
  html:not([data-theme="light"]):not(.dark) .status-scheduled,
  html:not([data-theme="light"]):not(.dark) .status-publishing,
  html:not([data-theme="light"]):not(.dark) .status-partial { background: #332a14; color: #f5c86b; }
  html:not([data-theme="light"]):not(.dark) .badge-tg { background: #16303f; color: #5ec2f0; }
  html:not([data-theme="light"]):not(.dark) .badge-vk { background: #14283f; color: #6aa8ff; }
  html:not([data-theme="light"]):not(.dark) .badge-max { background: #291a45; color: #b18cff; }
  html:not([data-theme="light"]):not(.dark) .dropzone { background: #171b29; border-color: #3a3f63; }
  html:not([data-theme="light"]):not(.dark) .cta-section .btn-primary { background: #fff; color: #4338ca; }
  html:not([data-theme="light"]):not(.dark) .feedback-dialog { background: var(--card); color: var(--ink); }
  html:not([data-theme="light"]):not(.dark) .feedback-dialog::backdrop { background: rgba(0, 0, 0, .6); }
  html:not([data-theme="light"]):not(.dark) code { background: var(--accent-soft); }
  html:not([data-theme="light"]):not(.dark) .onb-fill,
  html:not([data-theme="light"]):not(.dark) .cal-dot,
  html:not([data-theme="light"]):not(.dark) .cal-today { border-color: var(--accent); }
  html:not([data-theme="light"]):not(.dark) .cal-today { box-shadow: 0 0 0 2px rgba(139, 147, 255, .3); }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 2rem; letter-spacing: -.02em; }
h2 { font-size: 1.45rem; letter-spacing: -.01em; margin-top: 1.2em; }
h3 { font-size: 1.1rem; }
p { margin: .4em 0 .9em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--accent-soft); padding: .1em .35em; border-radius: 6px; font-size: .92em; }
mark { background: var(--accent-soft); color: var(--accent); font-weight: 600; padding: 0 .1em; border-radius: 4px; }
.small { font-size: .85rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 760px; }
.container.narrow-wide { max-width: 880px; }

/* Навигация */
.nav { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-weight: 700; font-size: 1.15rem; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.logo:hover { text-decoration: none; }
.logo-mark { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), #9333ea); color: #fff; font-size: .95rem; }
.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links a { color: var(--ink); font-size: .95rem; }
.nav-links a.active { color: var(--accent); font-weight: 600; }
.inline-form { display: inline; }

.demo-banner { background: #fff7e6; color: #8a5a00; border: 1px solid #f2e3bd; border-radius: 10px; margin-top: 12px; padding: 8px 14px; font-size: .85rem; }

.flash { border-radius: 10px; padding: 10px 14px; margin: 12px 0; font-size: .95rem; }
.flash a[data-undo] { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.flash-ok { background: var(--ok-soft); color: var(--ok); border: 1px solid #bfe8d7; }
.flash-err { background: var(--danger-soft); color: var(--danger); border: 1px solid #f5c6c6; }

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 10px 18px; font-size: .95rem; font-weight: 600; cursor: pointer; transition: .15s; text-decoration: none !important; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #4338ca; }
.btn-ghost { background: transparent; color: var(--accent); border-color: #c9cdf5; }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger { background: transparent; color: var(--danger); border-color: #f0b9b9; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-lg { padding: 14px 26px; font-size: 1.05rem; border-radius: 12px; }
.btn-sm { padding: 6px 12px; font-size: .85rem; border-radius: 8px; }
.btn-block { width: 100%; }
.linklike { background: none; border: none; color: var(--muted); cursor: pointer; font: inherit; padding: 0; }
.linklike:hover { color: var(--danger); }

/* Hero */
.hero { padding: 64px 0 40px; }
.hero .container { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.hero-text h1 { font-size: 2.4rem; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 60ch; }
.hero-actions { display: flex; gap: 12px; margin: 22px 0 10px; flex-wrap: wrap; }
.hero-note { font-size: .9rem; }
.platform-badges { display: flex; gap: 10px; margin-top: 14px; }

.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--accent-soft); color: var(--accent); }
.badge-tg { background: #e3f2fb; color: var(--tg); }
.badge-vk { background: #e3edff; color: var(--vk); }
.badge-max { background: #f0e8ff; color: var(--max); }

.hero-card { display: flex; flex-direction: column; gap: 12px; }
.mock-post { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; animation: float 6s ease-in-out infinite; }
.mock-post:nth-child(2) { animation-delay: 1.5s; }
.mock-post:nth-child(3) { animation-delay: 3s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.mock-head { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.mock-time { font-size: .78rem; color: var(--muted); margin-top: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-tg { background: var(--tg); } .dot-vk { background: var(--vk); } .dot-max { background: var(--max); }
.ok { color: var(--ok); font-weight: 600; }

/* Секции и карточки */
.section { padding: 44px 0; }
.section-alt { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.grid { display: grid; gap: 18px; }
.grid > * { min-width: 0; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card h3 { margin-top: 0; }
.card-title { font-weight: 700; font-size: 1.05rem; margin: 6px 0; line-height: 1.35; }
.steps .step { position: relative; }
.step-num { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 8px; }
.card.mini { padding: 18px; }

/* FAQ */
details.faq-item { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 10px 0; }
details.faq-item summary { cursor: pointer; font-weight: 600; }
details.faq-item p { color: var(--muted); margin-bottom: 0; }
/* Прямая ссылка на вопрос: видна при наведении на открытый/закрытый пункт FAQ */
.faq-anchor { opacity: 0; margin-left: 6px; font-weight: 400; text-decoration: none; transition: opacity .15s; }
details.faq-item:hover .faq-anchor, .faq-anchor:focus-visible { opacity: .6; }
.faq-anchor:hover { opacity: 1 !important; text-decoration: none; }

/* CTA */
.cta-section { background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; }
.cta-section h2 { color: #fff; }
.cta-section .lead { color: #e5e2ff; }
.cta-section .btn-primary { background: #fff; color: var(--accent); }

/* Футер */
.footer { border-top: 1px solid var(--line); background: var(--card); padding: 32px 0 20px; margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-size: .92rem; }
.footer-copy { margin-top: 18px; font-size: .82rem; padding-bottom: 0; }

/* Аутентификация */
.auth-box { max-width: 420px; margin: 40px auto; }
label { display: block; font-weight: 600; font-size: .92rem; margin: 14px 0 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="datetime-local"], input[type="number"], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: var(--card); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { resize: vertical; }

/* Кабинет */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.stat-row { margin-bottom: 24px; }
.stat .stat-num { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; }
/* стат-карточки-ссылки: вся карточка кликабельна, подчёркивание как у обычного текста */
a.stat { color: inherit; text-decoration: none; transition: .15s; }
a.stat:hover { text-decoration: none; border-color: var(--accent); }
.empty-state { text-align: center; padding: 40px 20px; }
.upsell { border-color: #f2e3bd; background: #fffdf5; margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:last-child td { border-bottom: none; }
.clamp { max-width: 340px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.status { display: inline-flex; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.status-ok { background: var(--ok-soft); color: var(--ok); }
.status-err { background: var(--danger-soft); color: var(--danger); }
.status-wait { background: #fff3d6; color: #92610a; }
.status-draft { background: var(--accent-soft); color: var(--accent); }
.status-scheduled { background: #fff3d6; color: #92610a; }
.status-publishing { background: #fff3d6; color: #92610a; }
.status-published { background: var(--ok-soft); color: var(--ok); }
.status-partial { background: #fff3d6; color: #92610a; }
.status-failed { background: var(--danger-soft); color: var(--danger); }

.filter-tabs { display: flex; gap: 6px; margin: 16px 0; flex-wrap: wrap; }
.filter-tabs a { padding: 7px 14px; border-radius: 999px; font-size: .9rem; color: var(--muted); border: 1px solid transparent; }
.filter-tabs a.active { background: var(--card); border-color: var(--line); color: var(--accent); font-weight: 600; }
.filter-tabs a:hover { text-decoration: none; color: var(--accent); }

/* Композер */
.composer label { margin-top: 16px; }
.channel-checks { display: flex; gap: 10px; flex-wrap: wrap; }
.check-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; cursor: pointer; font-weight: 500; background: var(--card); margin: 0 0 8px 0; }
.check-pill:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.check-pill input { width: auto; }
.composer-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.media-previews { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.media-previews img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.composer-schedule { margin-top: 8px; }
.utm-block { border: 1px solid var(--line); border-radius: 10px; padding: 4px 16px 12px; margin-top: 16px; }
.utm-block legend { padding: 0 6px; }
.notify-forms h4 { margin: 8px 0 0; }

/* Гайды */
.guide-list { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.guide-card { display: block; color: inherit; }
.guide-card:hover { text-decoration: none; border-color: var(--accent); }
.prose { font-size: 1.02rem; }
.prose h2 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: .35em 0; }
.prose table { margin: 14px 0; font-size: .92rem; }
.guide-cta { background: var(--accent-soft); border: 1px solid #d8dbff; border-radius: var(--radius); padding: 16px 20px; margin: 26px 0; }

/* Тарифы */
.pricing-grid { margin-top: 26px; align-items: start; }
.price-card { position: relative; }
.price-popular { border-color: var(--accent); border-width: 2px; }
.price-current { border-color: var(--ok); border-width: 2px; }
.price-flag { position: absolute; top: -12px; left: 18px; background: var(--accent); color: #fff; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.price-current .price-flag { background: var(--ok); }
.price { font-size: 1.9rem; font-weight: 800; margin: 6px 0; }
.price .muted { font-size: .95rem; font-weight: 500; }
.price-features { list-style: none; padding: 0; margin: 12px 0 18px; }
.price-features li { padding: 5px 0 5px 24px; position: relative; font-size: .93rem; }
.price-features li::before { content: "✓"; position: absolute; left: 2px; color: var(--ok); font-weight: 700; }
.buy-buttons { display: flex; flex-direction: column; gap: 8px; }
.promo-form { display: flex; gap: 10px; flex-wrap: wrap; }
.promo-form input[type="text"] { max-width: 260px; }

.connect-grid { margin-top: 24px; align-items: start; }
.connect-grid ol { padding-left: 18px; margin: 8px 0 14px; }

/* Виджет «Написать нам» */
.feedback-fab { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: #fff; border: none; border-radius: 999px; padding: 13px 20px; font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; box-shadow: 0 8px 24px rgba(79, 70, 229, .35); transition: transform .15s, background .15s; }
.feedback-fab:hover { background: #4338ca; transform: translateY(-2px); }
.feedback-dialog { border: none; border-radius: var(--radius); box-shadow: 0 24px 64px rgba(23, 32, 58, .25); padding: 0; width: min(440px, calc(100vw - 32px)); }
.feedback-dialog::backdrop { background: rgba(23, 32, 58, .45); }
.feedback-form { padding: 24px; position: relative; }
.feedback-form h2 { margin-top: 0; }
.feedback-close { position: absolute; top: 12px; right: 12px; background: none; border: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--muted); padding: 6px; }
.feedback-close:hover { color: var(--ink); }
.hp-field { position: absolute; left: -9999px; height: 0; width: 0; opacity: 0; }
.dropzone { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border: 1.5px dashed #c9cdf5; border-radius: 10px; padding: 12px 14px; margin-top: 4px; background: #fbfbff; }
.dropzone input[type="file"] { width: auto; max-width: 210px; font-size: .85rem; }
.dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-btn { color: var(--accent); font-weight: 600; }
.dropzone-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dropzone-list .file-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); border-radius: 999px; padding: 3px 10px; font-size: .8rem; }
.feedback-success { background: var(--ok-soft); color: var(--ok); border-radius: 10px; padding: 12px 16px; margin-top: 12px; font-weight: 600; }

/* OAuth-кнопки */
.oauth-block { margin-top: 18px; }
.oauth-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; margin: 14px 0 10px; }
.oauth-divider::before, .oauth-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.oauth-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.oauth-btn { flex: 1; min-width: 110px; }
.tg-widget { margin-top: 12px; }

/* Рефералка */
.ref-link-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ref-link-row input { flex: 1; min-width: 220px; font-family: monospace; font-size: .9rem; }
.ref-share { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.rules-list li { margin: .4em 0; }
.breadcrumbs { font-size: .85rem; color: var(--muted); margin-bottom: 10px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs span { color: var(--ink); }

/* Доступность и снижение движения */
:focus-visible { outline: 3px solid #9aa2ff; outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  .mock-post { animation: none !important; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Адаптив: блок 900px должен идти ДО блока 600px, чтобы на телефонах работало правило «1 колонка» */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .hero .container { grid-template-columns: 1fr; }
  .hero-text h1 { font-size: 1.9rem; }
}

/* Мобильная навигация: горизонтальная лента со скроллом — 11+ пунктов не занимают три экрана */
@media (max-width: 600px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .nav-inner { height: auto; padding: 10px 0; flex-wrap: wrap; gap: 8px; }
  .nav-links {
    gap: 4px; font-size: .85rem; flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a:not(.btn) { display: inline-flex; padding: 6px 10px; white-space: nowrap; scroll-snap-align: start; border-radius: 8px; }
  .nav-links a.active:not(.btn) { background: var(--accent-soft, #eef2ff); }
  .nav-links .inline-form, .nav-links .theme-toggle { flex: 0 0 auto; align-self: center; }
  .nav-links a { color: var(--ink); }
  .dash-head { flex-direction: column; align-items: flex-start; }
  h1 { font-size: 1.6rem; }
  .feedback-fab { right: 12px; bottom: 12px; padding: 12px 16px; }
}

@media (max-width: 640px) {
  .connect-grid { grid-template-columns: 1fr; }
}

/* Шаблоны: выбор шаблона в композере */
.template-picker { margin-bottom: 14px; }
.template-picker select { max-width: 320px; }

/* Календарь публикаций */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 16px; }
.cal-dow { text-align: center; font-size: .78rem; font-weight: 600; color: var(--muted); padding: 4px 0; }
.cal-cell { min-height: 96px; background: var(--card, #fff); border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: 6px 7px; overflow: hidden; }
.cal-out { opacity: .38; }
.cal-today { border-color: #6d7cff; box-shadow: 0 0 0 2px rgba(109, 124, 255, .25); }
.cal-day { font-size: .8rem; font-weight: 600; margin-bottom: 4px; color: var(--muted); }
.cal-post { display: flex; align-items: center; gap: 5px; font-size: .74rem; line-height: 1.25; margin: 3px 0; padding: 3px 5px; background: var(--accent-soft, #eef0ff); border-radius: 6px; color: var(--ink); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-time { flex: none; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--accent); font-size: .7rem; }

/* Быстрый перенос публикации из календаря: details-меню под карточкой поста */
.cal-move summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin: 2px 0 0; border: 1px solid var(--line, #e5e7eb); border-radius: 6px; font-size: .75rem; color: var(--muted); cursor: pointer; user-select: none; }
.cal-move summary::-webkit-details-marker { display: none; }
.cal-move summary:hover { border-color: var(--accent); color: var(--accent); }
.cal-move-btns { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 2px; }
.cal-move-btns .linklike { white-space: nowrap; }
.cal-copy-btns { margin-top: 2px; }

/* Печатная версия публичного отчёта: чистый лист для заказчика без навигации и кнопок */
@media print {
  .nav, .footer, .feedback-fab, .btn, .theme-toggle, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .table-wrap { border: 1px solid #ccc; box-shadow: none; }
  a { color: #000; text-decoration: none; }
  .section { padding: 12px 0; }
  .container { max-width: 100%; padding: 0 10px; }
}
.cal-dot { width: 6px; height: 6px; border-radius: 50%; background: #6d7cff; flex: none; }
@media (max-width: 700px) {
  .calendar-grid { grid-template-columns: repeat(2, 1fr); }
  .cal-dow { display: none; }
  .cal-cell { min-height: 64px; }
}

/* Оглавление статьи */
.toc { background: var(--accent-soft, #eef0ff); border-radius: 12px; padding: 14px 18px; margin: 14px 0 20px; font-size: .92rem; }
.toc strong { display: block; margin-bottom: 6px; }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin: 3px 0; }
.toc a.toc-cur { color: var(--accent); font-weight: 600; }

/* Якоря не прячутся под sticky-шапкой при переходе по оглавлению */
[id] { scroll-margin-top: 76px; }

/* Changelog */
.changelog-entry { margin-bottom: 18px; }
.changelog-entry h2 { margin-top: 4px; }

/* Поиск по публикациям */
.search-form { display: flex; gap: 8px; align-items: center; margin: 10px 0 4px; }
.search-form input[type="search"] { max-width: 340px; flex: 1; }

/* Онбординг-чеклист */
.onboarding { margin-top: 14px; }
.onb-track { height: 8px; background: var(--line, #e5e7eb); border-radius: 999px; overflow: hidden; margin: 8px 0 12px; }
.onb-fill { height: 100%; background: #6d7cff; border-radius: 999px; transition: width .3s; }
.onb-list { list-style: none; padding: 0; margin: 0; }
.onb-list li { padding: 4px 0; }
.onb-done { color: #16a34a; }
.onb-todo a { font-weight: 600; }

/* Пауза канала: приглушённая плашка в композере */
.pill-paused { opacity: .5; }

/* Уже прикреплённые медиа при редактировании */
.existing-media-item { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; margin-right: 10px; font-size: .78rem; }
.existing-media-item img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line, #e5e7eb); }

/* Быстрые слоты */
.quick-slots { margin-top: 6px; }

/* Мобильный композер: цели нажатия ≥44px, действия и поля — во всю ширину */
@media (max-width: 600px) {
  .composer .check-pill { padding: 10px 14px; min-height: 44px; }
  .composer input[type="text"], .composer input[type="datetime-local"], .composer select { width: 100%; min-height: 44px; }
  .composer .composer-actions { flex-direction: column; }
  .composer .composer-actions .btn { width: 100%; padding: 12px 16px; }
  .composer .quick-slots { line-height: 2; }
  .composer input[type="file"] { font-size: .85rem; }
  .filter-tabs a { padding: 8px 12px; }
  .post-preview .pv-avatar { width: 36px; height: 36px; }
  /* Список публикаций на телефоне: действия поста крупнее и не слипаются */
  .table-wrap .row-actions { gap: 12px; }
  .table-wrap .row-actions a, .table-wrap .row-actions .linklike { padding: 8px 0; font-size: .92rem; }
}

/* Серия постов */
.series-select { padding: 4px 6px; border: 1px solid var(--line, #e5e7eb); border-radius: 8px; }
.series-form { display: inline-flex; gap: 4px; align-items: center; }

/* Кликабельный день в календаре */
.cal-day-link { color: var(--muted); text-decoration: none; padding: 0 4px; border-radius: 4px; }
.cal-day-link:hover { background: var(--accent-soft, #eef0ff); color: var(--ink); }

/* Skip-link: виден только при фокусе с клавиатуры (навигация Tab'ом) */
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 0; z-index: 100; font-weight: 600; }
.skip-link:focus { left: 0; }

/* Активный раздел в шапке */
.nav-cur { color: var(--accent); font-weight: 600; }

/* Переключатель темы: три пиктограммы (система / светлая / тёмная) */
.theme-toggle { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.theme-toggle button { background: none; border: none; cursor: pointer; font: inherit; font-size: .9rem; line-height: 1; padding: 5px 8px; border-radius: 999px; color: var(--muted); }
.theme-toggle button:hover { color: var(--ink); }
.theme-toggle button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.setting-label { display: block; font-weight: 600; font-size: .92rem; }
.cal-past { color: var(--muted); opacity: .6; }
/* Сохранить пост как шаблон: сворачиваемый блок в композере */
details.save-as-template { border: 1px dashed var(--line); border-radius: 10px; padding: 8px 16px; margin-top: 16px; }
details.save-as-template summary { cursor: pointer; }
details.save-as-template summary:hover { color: var(--ink); }
/* Массовое удаление постов: панель над таблицей */
.bulk-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
/* Предпросмотр карточки поста в композере */
.post-preview { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--bg); max-width: 420px; }
.pv-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pv-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; }
.pv-channel { font-weight: 600; font-size: .92rem; }
.pv-text { white-space: pre-wrap; word-break: break-word; margin: 6px 0; }

/* Перелинковка в статьях: соседние статьи и «Читайте также» */
.pn-nav { display: flex; justify-content: space-between; gap: 18px; margin: 22px 0; }
.pn-nav > div { max-width: 48%; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 12px 0 18px; align-items: start; }
.related-grid .guide-card h3 { font-size: 1rem; margin-top: 0; }
.related-grid .guide-card .card-title { font-size: 1rem; margin-top: 0; }
@media (max-width: 900px) { .related-grid { grid-template-columns: 1fr; } }

/* Короткая выжимка в начале статьи: читатель экономит время, AI-ассистентам удобно цитировать */
.tldr { background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; padding: 10px 16px; margin: 10px 0 18px; }
.tldr strong { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 2px; }
.tldr p { margin: 0; color: var(--ink); }

/* Баннер согласия на аналитику (152-ФЗ): фиксированный внизу, до выбора виден на всех страницах */
.consent-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60;
  max-width: 720px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--card, #fff); color: var(--ink);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.14);
  padding: 12px 16px;
}
.consent-banner p { margin: 0; flex: 1 1 320px; font-size: .9rem; }
.consent-actions { display: flex; gap: 8px; }

/* Постраничная навигация в списке публикаций */
.pager { display: flex; align-items: center; gap: 14px; margin: 18px 0; flex-wrap: wrap; }
.pager a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; }
.pager a:hover { text-decoration: none; color: var(--accent); border-color: var(--accent); }

/* Баннер «тариф истекает» в кабинете */
.plan-warn { background: var(--warn-soft, #fff7e6); border: 1px solid #f0c36d; color: var(--ink); border-radius: 10px; padding: 9px 14px; margin-bottom: 14px; font-size: .92rem; }
.plan-warn a { font-weight: 600; }

/* Гео кликов в списке коротких ссылок: details внутри ячейки таблицы */
.geo-box { display: inline-block; }
.geo-box summary { cursor: pointer; }
.geo-box div { margin-top: 4px; white-space: nowrap; }

/* Фильтр списка публикаций по каналу — вторая строка табов */
.channel-tabs { margin-top: 8px; }
.channel-tabs a { font-size: .88rem; }

/* Заголовок секции с правой ссылкой (дашборд: календарь/ICS) */
.dash-head h2 { margin: 0; }

/* ===== Фаза 83 ===== */

/* Полоска месячной квоты в композере */
.quota-strip { height: 8px; background: var(--line, #e5e7eb); border-radius: 999px; overflow: hidden; margin: 10px 0 6px; max-width: 420px; }
.quota-fill { height: 100%; background: #6d7cff; border-radius: 999px; transition: width .3s; }
.quota-fill.quota-low { background: var(--danger, #dc2626); }

/* Меню переноса поста на другой день в календаре (как cal-copy) */
.cal-copy-btns { flex-wrap: wrap; }

/* Подсветка дня-цели при drag&drop в календаре */
.cal-cell.cal-drop { outline: 2px dashed var(--accent, #6d7cff); outline-offset: -3px; background: var(--accent-soft, #eef0ff); }
.cal-post[draggable="true"] { cursor: grab; }

/* Сетка медиа-библиотеки */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.media-item { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.media-item img { width: 100%; height: 130px; object-fit: cover; border-radius: 8px; background: var(--line, #e5e7eb); }
.media-meta { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.media-meta p { margin: 0; }

/* Выбор из библиотеки в композере — тот же размер превью, что у existing-media */
.library-grid .existing-media-item { position: relative; }
.library-picker { margin-top: 8px; }
.library-picker summary { cursor: pointer; }

/* ===== Фаза 84 ===== */

/* Аналитика: столбчатые диаграммы на чистом CSS (30 дней / 24 часа) */
.chart-bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 6px; }
.chart-bars.chart-hours { height: 90px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.chart-fill { width: 100%; min-height: 2px; background: var(--accent, #6d7cff); border-radius: 3px 3px 0 0; }
.chart-fill[style*="height: 0%"] { background: var(--line, #e5e7eb); }
.chart-col.chart-best .chart-fill { background: var(--ok, #16a34a); }
.chart-label { font-size: 9px; color: var(--muted, #6b7280); margin-top: 4px; white-space: nowrap; }
.chart-hours .chart-label { font-size: 8px; }

/* Миниатюра медиа в списке публикаций */
.post-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; display: block; background: var(--line, #e5e7eb); }
.post-thumb-empty { width: 44px; height: 44px; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--muted, #6b7280); font-size: 18px; background: var(--bg-soft, #f3f4f6); }

/* Праздничный день в календаре */
.cal-cell.cal-holiday { background: var(--accent-soft, #fff7ed); }
.cal-cell.cal-holiday .cal-daynum { color: var(--danger, #dc2626); font-weight: 600; }

/* Кнопка копирования текста поста */
.copy-btn { cursor: pointer; }
