/* AvtoPostinger — веб-панель: тёмное «стекло» (как в LivePostinger и ProPostinger).
   Полупрозрачные блоки на неподвижном цветном фоне; размытие (дорогое для видеокарты) — только у меню.
   Меню: слева или снизу (html[data-menu], выбор на экране «Ещё»); уже 900 px «слева» — выезжает по ☰.
   Светлая тема — html[data-theme="light"] (в конце файла): те же переменные цветов плюс правки прямых цветов. */

:root {
  color-scheme: dark;
  --bg: #0b0f16;
  --card: rgba(255, 255, 255, .055);
  --card2: rgba(255, 255, 255, .09);
  --line: rgba(255, 255, 255, .095);
  --track: rgba(255, 255, 255, .08);
  --solid: #161b24;
  --hi: rgba(255, 255, 255, .06);
  --text: #e5e8ee;
  --muted: #9aa3b3;
  --accent: #6d9cf5;
  --accent-t: #a9c5fa;
  --btn: #3a64c4;
  --ok: #4cc382;   --ok-soft: #16301f;
  --warn: #e2b14a; --warn-soft: #352a12;
  --bad: #f07272;  --bad-soft: #3a1c1e;
  --k-task: #5b9bf0;  --k-task-soft: #172a40;
  --k-react: #3cc6b4; --k-react-soft: #12322f;
  --k-warm: #f2884d;  --k-warm-soft: #3a2316;
  --k-clean: #a99ff3; --k-clean-soft: #25224a;
  --shadow: inset 0 1px 0 var(--hi), 0 1px 2px rgba(0, 0, 0, .3), 0 8px 26px rgba(0, 0, 0, .22);
  --tabbar: 66px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }   /* без увеличения двойным касанием; щипок работает */
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  overflow-x: hidden;
}
/* неподвижный фон: четыре мягких цветных пятна */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vmax 45vmax at 8% 0%, rgba(91, 155, 240, .24), transparent 70%),
    radial-gradient(50vmax 40vmax at 100% 18%, rgba(157, 146, 240, .24), transparent 70%),
    radial-gradient(55vmax 42vmax at 85% 100%, rgba(60, 198, 180, .24), transparent 70%),
    radial-gradient(40vmax 30vmax at 0% 95%, rgba(242, 136, 77, .13), transparent 70%);
}
a { color: #8fb4f8; }
a:hover { color: #b9d0fb; }
h1, h2, h3 { margin: 0; line-height: 1.25; overflow-wrap: anywhere; }
.row > strong, .row > span { overflow-wrap: anywhere; min-width: 0; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 18px; height: 18px; flex: none; }

/* ---------- блоки ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  padding: 16px; min-width: 0;
}
.card.list { padding: 4px 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.grow { flex: 1 1 auto; min-width: 0; }
.cols { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.cols > .main-col { flex: 3 1 440px; min-width: 0; }
.cols > .side-col { flex: 2 1 300px; min-width: 0; }
.sec-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 2px 0; }
.sec-title h2 { flex: 1 1 auto; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile .label { color: var(--muted); font-size: 13px; font-weight: 600; }
.tile .big { font-size: 32px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tile .sub { font-size: 13px; color: var(--muted); }
.tile .sub.ok { color: var(--ok); font-weight: 600; }

.kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); min-width: 0; }
.kv:first-child { border-top: 0; }
.kv > :first-child { min-width: 0; overflow-wrap: anywhere; }
.kv .end { flex: none; text-align: right; }
/* длинное значение (расписание) переносится, подпись слева остаётся целой */
.kv.kv-wrap > :first-child { flex: none; }
.kv.kv-wrap .end { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; }
.item-title { font-weight: 600; overflow-wrap: anywhere; }
.item-sub { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.src-link { color: var(--accent-t); text-decoration: none; white-space: nowrap; }
.src-link:hover, .src-link:focus-visible { text-decoration: underline; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600; background: var(--card2); color: var(--muted); white-space: nowrap;
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.task { background: var(--k-task-soft); color: var(--k-task); }
.pill.react { background: var(--k-react-soft); color: var(--k-react); }
.pill.clean { background: var(--k-clean-soft); color: var(--k-clean); }
.pill.warm { background: var(--k-warm-soft); color: var(--k-warm); }
.pill.src { font-size: 14px; padding: 5px 12px; white-space: normal; overflow-wrap: anywhere; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }

.bar { display: flex; height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; }
.bar.thick { height: 10px; }
.bar i { display: block; height: 100%; border-radius: 99px; width: 0; }
.bar i.fresh { background: var(--k-warm); }
.bar i.hist { background: var(--k-task); }
.bar i.clean { background: var(--k-clean); }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.legend .dot.fresh { color: var(--k-warm); }
.legend .dot.hist { color: var(--k-task); }

/* столбики по дням */
.days { display: flex; align-items: flex-end; gap: 3px; height: 96px; padding-top: 6px; }
/* столбик дня = каналы друг на друге (снизу вверх), между частями — зазор 2 px */
.days .col { flex: 1 1 0; min-width: 0; min-height: 2px; display: flex; flex-direction: column-reverse; gap: 2px;
  border-radius: 4px 4px 1px 1px; overflow: hidden; }
.days .col.zero { background: var(--track); }
.days .col i { flex: 1 1 0; min-height: 2px; }
.days .col:hover { filter: brightness(1.18); }
/* цвета каналов (проверены на различимость, в т.ч. при дальтонизме, на тёмном фоне) */
.s1 { background: #3987e5; } .s2 { background: #d95926; } .s3 { background: #199e70; } .s4 { background: #c98500; }
.s5 { background: #d55181; } .s6 { background: #008300; } .s7 { background: #9085e9; } .s8 { background: #e66767; }
/* строка или блок под курсором просто подсвечивается (без анимации — меньше работы браузеру) — по всей панели:
   посты, задачи, каналы, источники, аккаунты, копии, «Из моих чатов», режимы, группы (класс .post) */
.post { transition: background-color .15s; }
.kv.post, .acc-row.post { margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 10px; }
.acc-row.post:first-child { padding-top: 10px; }
.post:hover { background-color: var(--card2); }
.chat-btn, .mode-opt, .grp-head { transition: background-color .15s; }
.chat-btn:hover:not(:disabled), .mode-opt:hover:not(:has(input:checked)), .grp-head:hover { background-color: var(--card2); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: 0; }
.days-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

.next-big { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.next-big .big { font-size: 34px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; font-size: 13px; }
.grid3 strong { display: block; font-size: 15px; }
.subs-n { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.delta-up { color: var(--ok); font-weight: 600; }
.delta-down { color: var(--bad); font-weight: 600; }
.sig { white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 12px; padding: 12px 14px;
       background: rgba(0, 0, 0, .28); border: 1px solid var(--line); }
.empty { color: var(--muted); padding: 14px 2px; }
.card > .empty { padding: 6px 0; }
.error-box { color: var(--bad); }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 6px 14px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--card2); color: var(--text);
  font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { color: var(--text); }
.btn.primary { background: var(--btn); border-color: var(--btn); color: #fff; }
.btn.ghost { min-height: 36px; padding: 4px 12px; font-size: 14px; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.wide { width: 100%; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--track); max-width: 100%; }
.seg button {
  min-height: 36px; min-width: 44px; padding: 4px 12px; border: 0; border-radius: 9px; background: transparent;
  color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: #2a3140; color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.show-n { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
/* компактный «Показывать» в нижней строке блока очереди */
@media (min-width: 900px) {                        /* на телефоне кнопки остаются под палец (44 px) */
  .show-n.sm { gap: 6px; font-size: 13px; }
  .show-n.sm .seg { padding: 3px; border-radius: 10px; gap: 2px; }
  .show-n.sm .seg button { min-height: 28px; min-width: 34px; padding: 2px 8px; font-size: 13px; border-radius: 8px; }
}
.q-foot { padding-top: 10px; padding-bottom: 10px; }
.switch {
  position: relative; width: 52px; height: 30px; flex: none; border-radius: 99px; border: 1px solid var(--line);
  background: var(--track); cursor: pointer; padding: 0;
}
.switch::before { content: ""; position: absolute; inset: -8px; }   /* место для пальца ≥ 44 px */
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--muted); transition: transform .15s ease, background .15s ease;
}
.switch[aria-checked="true"] { background: var(--btn); border-color: var(--btn); }
.switch[aria-checked="true"]::after { transform: translateX(22px); background: #fff; }
.link-btn { background: none; border: 0; padding: 10px 0 8px; color: #8fb4f8; font: inherit; font-weight: 600;
            font-size: 14px; cursor: pointer; text-decoration: none; display: inline-block; }
.link-btn:hover { color: #b9d0fb; }

@media (hover: hover) and (pointer: fine) {
  .card:hover { border-color: rgba(109, 156, 245, .3); }
  .btn:hover { border-color: rgba(109, 156, 245, .5); }
  .tile:hover { transform: translateY(-2px); }
  .tile { transition: transform .18s ease; }
}

/* ---------- каркас: меню и страница ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: center;
  padding: 4px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  background: rgba(22, 27, 36, .72); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
}
.nav .brand { display: none; }
.nav .tabs { display: flex; gap: 4px; width: 100%; max-width: 960px; }
.nav .tab {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-height: 56px; border-radius: 12px; color: var(--muted); text-decoration: none;
  font-size: 12px; font-weight: 600; position: relative;
}
.nav .tab svg { width: 22px; height: 22px; flex: none; }
.nav .tab .lbl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }   /* длинная подпись не наезжает на соседние */
.nav .tab .cnt { display: none; }
.nav .tab[aria-current="page"] { color: var(--accent-t); background: rgba(109, 156, 245, .14); }
.nav .tab:hover { color: var(--text); }
.page { width: 100%; max-width: 1400px; margin: 0 auto; padding: 16px 16px calc(var(--tabbar) + 24px + env(safe-area-inset-bottom, 0px)); }
.head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 4px 2px 14px; }
.head .logo { display: inline-flex; }
.head h1 { flex: 1 1 auto; min-width: 0; }
.logo-box {
  width: 32px; height: 32px; border-radius: 9px; background: var(--btn); color: #fff; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.view { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

@media (max-width: 899px) {
  h1 { font-size: 22px; }
  .btn, .seg button, .link-btn { min-height: 44px; }
  .btn.ghost { min-height: 44px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile .big { font-size: 26px; }
  .card { padding: 14px; }
  .card.list { padding: 4px 14px; }
}
.narrow-only { display: none; }
@media (max-width: 899px) {
  .wide-only { display: none !important; }
  .narrow-only { display: block; }
}
/* «Очередь» блоками: задачи плитками рядом (на телефоне — одна колонка) */
.q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; align-items: start; }
.q-grid > section { min-width: 0; }
.q-grid .sec-title h2 { flex-basis: 100%; }
@media (max-width: 360px) {
  .nav .tab { font-size: 11px; }
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* меню слева (только на широком экране) */
@media (min-width: 900px) {
  html[data-menu="left"] .nav {
    top: 0; right: auto; bottom: 0; width: 248px; flex-direction: column; justify-content: flex-start; gap: 4px;
    padding: 18px 12px; border-top: 0; border-right: 1px solid var(--line);
    background: rgba(22, 27, 36, .5); -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  html[data-menu="left"] .nav .brand {
    display: flex; align-items: center; gap: 10px; padding: 2px 10px 16px; color: var(--text);
    font-weight: 700; font-size: 17px; text-decoration: none;
  }
  html[data-menu="left"] .nav .brand .ver { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
  html[data-menu="left"] .nav .tabs { flex-direction: column; gap: 2px; max-width: none; }
  html[data-menu="left"] .nav .tab {
    flex: none; flex-direction: row; justify-content: flex-start; gap: 10px; min-height: 44px; padding: 0 12px;
    border-radius: 10px; font-size: 15px; font-weight: 550;
  }
  html[data-menu="left"] .nav .tab svg { width: 18px; height: 18px; }
  html[data-menu="left"] .nav .tab .cnt { display: inline-flex; margin-left: auto; }
  html[data-menu="left"] .nav .tab:hover { background: rgba(255, 255, 255, .06); }
  html[data-menu="left"] .nav .tab[aria-current="page"] { background: rgba(109, 156, 245, .16); }
  html[data-menu="left"] .page { padding: 22px 24px 32px 272px; }
  html[data-menu="left"] .head .logo { display: none; }
  html[data-menu="left"] .nav .side-toggle { display: inline-flex; }

  /* свёрнутое меню: узкая полоса с одними значками (подписи — во всплывающей подсказке) */
  html[data-menu="left"][data-side="closed"] .nav { width: 68px; padding: 14px 8px; }
  html[data-menu="left"][data-side="closed"] .nav .brand-text,
  html[data-menu="left"][data-side="closed"] .nav .tab .lbl,
  html[data-menu="left"][data-side="closed"] .nav .tab .cnt { display: none; }
  html[data-menu="left"][data-side="closed"] .nav .brand { padding: 2px 0 12px; justify-content: center; }
  html[data-menu="left"][data-side="closed"] .nav .side-head { flex-direction: column; gap: 8px; }
  html[data-menu="left"][data-side="closed"] .nav .tab { justify-content: center; padding: 0; }
  html[data-menu="left"][data-side="closed"] .nav .tab svg { width: 22px; height: 22px; }
  html[data-menu="left"][data-side="closed"] .page { padding-left: 92px; }
}
.nav .side-head { display: none; }
.nav .side-toggle { display: none; }
@media (min-width: 900px) {
  html[data-menu="left"] .nav .side-head { display: flex; align-items: center; gap: 4px; }
  html[data-menu="left"] .nav .side-head .brand { flex: 1 1 auto; min-width: 0; }
  .side-toggle {
    width: 44px; height: 44px; flex: none; align-items: center; justify-content: center; border-radius: 10px;
    border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; padding: 0;
  }
  .side-toggle:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
  .side-toggle svg { width: 20px; height: 20px; }
}

/* телефон, меню слева: нижней полоски нет — ☰ в шапке открывает меню сбоку поверх страницы;
   нажали раздел, тёмный фон или Esc — закрылось (как в ProPostinger) */
.menu-btn { display: none; }
.side-bg { display: none; }
@media (max-width: 899px) {
  html[data-menu="left"] .menu-btn {
    display: inline-flex; width: 44px; height: 44px; flex: none; align-items: center; justify-content: center;
    border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--text);
    padding: 0; cursor: pointer;
  }
  html[data-menu="left"] .menu-btn svg { width: 22px; height: 22px; }
  html[data-menu="left"] .head .logo { display: none; }
  html[data-menu="left"] .page { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
  html[data-menu="left"] .toast { bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
  html[data-menu="left"] .nav {
    top: 0; right: auto; bottom: 0; width: min(280px, 84vw); z-index: 70;
    flex-direction: column; justify-content: flex-start; gap: 4px; overflow-y: auto; overscroll-behavior: contain;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 12px calc(20px + env(safe-area-inset-bottom, 0px));
    border-top: 0; border-right: 1px solid var(--line); background: rgba(22, 27, 36, .97);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
    transform: translateX(-100%); visibility: hidden; transition: transform .22s ease, visibility 0s .22s;
  }
  html[data-menu="left"].side-open .nav { transform: none; visibility: visible; transition: transform .22s ease, visibility 0s; }
  html[data-menu="left"].side-open body { overflow: hidden; }
  html[data-menu="left"].side-open .side-bg {
    display: block; position: fixed; inset: 0; z-index: 65; background: rgba(8, 12, 20, .55);
  }
  html[data-menu="left"] .nav .side-head { display: flex; align-items: center; }
  html[data-menu="left"] .nav .brand {
    display: flex; align-items: center; gap: 10px; padding: 2px 10px 16px; color: var(--text);
    font-weight: 700; font-size: 17px; text-decoration: none;
  }
  html[data-menu="left"] .nav .brand .ver { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
  html[data-menu="left"] .nav .tabs { flex-direction: column; gap: 2px; max-width: none; }
  html[data-menu="left"] .nav .tab {
    flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 48px; padding: 0 12px;
    border-radius: 10px; font-size: 16px; font-weight: 550; letter-spacing: 0;
  }
  html[data-menu="left"] .nav .tab svg { width: 20px; height: 20px; }
  html[data-menu="left"] .nav .tab .cnt { display: inline-flex; margin-left: auto; }
  html[data-menu="left"] .nav .tab[aria-current="page"] { background: rgba(109, 156, 245, .16); }
}
@media (prefers-reduced-motion: reduce) { html[data-menu="left"] .nav { transition: none !important; } }

/* ---------- всплывающее сообщение ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar) + 18px + env(safe-area-inset-bottom, 0px)); z-index: 20;
  transform: translateX(-50%); max-width: min(92vw, 460px); padding: 10px 16px; border-radius: 12px;
  background: rgba(22, 27, 36, .95); border: 1px solid var(--line); box-shadow: 0 8px 26px rgba(0, 0, 0, .45);
  font-size: 14px; text-align: center;
}
.toast.bad { border-color: rgba(240, 114, 114, .5); }
@media (min-width: 900px) { html[data-menu="left"] .toast { bottom: 24px; } }

/* ---------- вход (login.html, tg.html) ---------- */
.solo { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.solo .card { width: min(100%, 420px); padding: 28px 24px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.solo h1 { font-size: 22px; }
.solo p { margin: 0; color: var(--muted); }
.solo .error { color: var(--bad); }
.solo .error:empty { display: none; }

/* ---------- формы (страница задачи и правка в карточках) ---------- */
.input {
  width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(0, 0, 0, .28); color: var(--text); font: inherit; min-width: 0;
}
.input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
select.input { cursor: pointer; }
.resign-mini { padding: 10px 12px; border-radius: 12px; background: var(--track); }
.src-search { max-width: 420px; }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.4; }
/* Телефон: шрифт полей не мельче 16px — иначе iPhone при нажатии на поле увеличивает и сдвигает страницу */
@media (max-width: 899px), (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]), textarea, select, [contenteditable="true"] { font-size: 16px !important; }
}
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace; font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-weight: 600; font-size: 14px; }
.field-hint { margin: 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.field-hint.pre { white-space: pre-wrap; background: rgba(0, 0, 0, .2); border-radius: 10px; padding: 8px 10px; }
.field-err { margin: 0; color: var(--bad); font-size: 13px; font-weight: 600; white-space: pre-line; overflow-wrap: anywhere; }
.has-err .input, .has-err .checks, .has-err .modes, .has-err .grp-list { border-color: var(--bad); }
.form-err { margin: 0; color: var(--bad); font-weight: 600; white-space: pre-line; overflow-wrap: anywhere;
            border-color: rgba(240, 114, 114, .5); }
.warn-text { margin: 0; color: var(--warn); font-size: 13px; overflow-wrap: anywhere; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.choice { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.num-in { width: 9em; flex: none; }
.blk-title { display: flex; align-items: center; gap: 10px; }
.blk-n {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex: none;
  border-radius: 8px; background: var(--k-task-soft); color: var(--k-task); font-size: 14px;
}
.checks { display: flex; flex-direction: column; gap: 2px; max-height: 360px; overflow-y: auto;
          border: 1px solid transparent; border-radius: 10px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 8px; border-radius: 10px; cursor: pointer; }
.check:hover { background: var(--card2); }
.check input, .mode-opt input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--btn); }
.check-text, .mode-text, .toggle-label, .chat-title { min-width: 0; overflow-wrap: anywhere; }
.modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px;
         border: 1px solid transparent; border-radius: 12px; }
.mode-opt {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; min-width: 0;
  border: 1px solid var(--line); background: rgba(0, 0, 0, .18); cursor: pointer;
}
.mode-opt input { margin-top: 2px; }
.mode-opt:has(input:checked) { border-color: var(--accent); background: rgba(109, 156, 245, .12); }
.mode-text { display: flex; flex-direction: column; gap: 2px; }
.toggle { display: flex; flex-direction: column; gap: 4px; }
.toggle-row { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.toggle-label { cursor: pointer; }
.toggle .field-hint, .toggle .field-err { padding-left: 64px; }
.sub-box, .inline-edit { padding: 12px; border-radius: 12px; background: rgba(0, 0, 0, .2); border: 1px solid var(--line); }
.link-row .input { flex: 1 1 200px; width: auto; }
.chat-list { display: flex; flex-direction: column; gap: 4px; }
.chat-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 10px; text-align: left;
  border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; cursor: pointer;
}
.chat-btn:disabled { opacity: .5; cursor: wait; }
.chat-mark { flex: none; }
.pager { justify-content: space-between; }
.kb { display: flex; flex-direction: column; gap: 6px; }
.kb-row { display: flex; gap: 6px; min-width: 0; }
.kb-btn {
  flex: 1 1 0; min-width: 0; min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  color: #fff; font: inherit; font-weight: 600; cursor: pointer; overflow-wrap: anywhere;
}
.kb-plain { background: #2a3140; border-color: var(--line); }
.kb-red { background: #a3363d; }
.kb-green { background: #1d7346; }
.kb-blue { background: #2f5bb5; }
.kb-link { font-size: 12px; opacity: .8; }
.form-actions { padding-top: 4px; }
.job-line { margin: 0; color: var(--accent-t); font-weight: 600; }
.job-line .spin { display: inline-block; animation: ap-spin 2.4s linear infinite; }
@keyframes ap-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .job-line .spin { animation: none; } }
.job-note { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 10px;
            white-space: pre-line; overflow-wrap: anywhere; }
.job-note.ok { background: var(--ok-soft); color: var(--ok); }
.job-note.bad { background: var(--bad-soft); color: var(--bad); }
.job-note .link-btn { padding: 0; min-height: 0; flex: none; }
.btn.danger-fill { background: #b8434a; border-color: #b8434a; color: #fff; }
.toast { white-space: pre-line; }
@media (hover: hover) and (pointer: fine) {
  .chat-btn:hover { border-color: rgba(109, 156, 245, .5); }
  .kb-btn:hover { filter: brightness(1.15); }
}

/* ---------- окно подтверждения (AP.confirm) ---------- */
.modal {
  position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(5, 8, 12, .62);
}
.modal-card { width: min(100%, 440px); background: var(--solid); }
.modal-text { margin: 0; font-size: 16px; white-space: pre-line; overflow-wrap: anywhere; }
.modal-btns { justify-content: flex-end; }

/* ---------- AvtoPostinger: посты, контент-план, каналы ---------- */
.post-row { cursor: pointer; }
.post-row .item-sub { display: flex; flex-wrap: wrap; gap: 2px 8px; }
.post-text { white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 12px; padding: 12px 14px;
             background: rgba(0, 0, 0, .28); border: 1px solid var(--line); margin: 4px 0 6px; }
.post-open { padding: 6px 0 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.err-text { color: var(--bad); font-size: 13px; white-space: pre-line; overflow-wrap: anywhere; }
.flags { display: flex; flex-wrap: wrap; gap: 6px; }
.time-col { flex: none; width: 3.4em; font-weight: 700; font-variant-numeric: tabular-nums; }
.day-today h2::after { content: " · сегодня"; color: var(--accent-t); font-size: 14px; font-weight: 600; }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; align-items: start; }
.rights { display: flex; flex-wrap: wrap; gap: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.bar-row:first-child { border-top: 0; }
.bar-row .bar { grid-column: 1 / -1; }
.search { max-width: 360px; }
.user-row .end { flex-wrap: nowrap; }
.card.list .user-row { margin: 0 -16px; padding: 10px 16px; transition: background-color .12s; }   /* подсветка — на всю ширину карточки */
.card.list .user-row:hover { background-color: rgba(109, 156, 245, .12); }
.card.list .user-row:last-child { border-radius: 0 0 14px 14px; }
@media (max-width: 899px) { .card.list .user-row { margin: 0 -14px; padding: 10px 14px; } }

/* ---------- редактор оформленного текста (AP.richEdit, перенесён из LivePostinger) ---------- */
.rt-tools { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--track); }
.rt-btn {
  min-width: 44px; min-height: 40px; padding: 4px 10px; border: 0; border-radius: 9px; background: transparent;
  color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.rt-btn:hover { background: rgba(255, 255, 255, .06); }
.rt-btn[aria-pressed="true"] { background: #2a3140; color: var(--accent-t); box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.rt-btn.rt-b { font-weight: 800; }
.rt-btn.rt-i { font-style: italic; }
.rt-btn.rt-u { text-decoration: underline; }
.rt-btn.rt-s { text-decoration: line-through; }
.rt-area { min-height: 84px; }
.rt-foot { gap: 6px 10px; }
.rt-count.over { color: var(--bad); font-weight: 700; }
.rt-prev { min-height: 44px; }
.rt-prev a { color: #8fb4f8; }
.rt-prev blockquote, .rt-quote { margin: 4px 0; padding: 2px 0 2px 10px; border-left: 3px solid var(--accent); }
.rt-prev code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px;
                background: rgba(255, 255, 255, .08); border-radius: 5px; padding: 0 4px; }
.rt-prev pre { margin: 4px 0; padding: 8px 10px; border-radius: 8px; background: rgba(255, 255, 255, .06);
               white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.rt-spoiler { background: #4a5163; color: transparent; border-radius: 4px; cursor: pointer; }
.rt-spoiler.shown { background: rgba(255, 255, 255, .08); color: inherit; }
.rt-spoiler a, .rt-spoiler code { color: inherit; }

/* ---------- редактор поста (#/edit) ---------- */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.ed-prev { position: sticky; top: 12px; }
.tg-post { display: flex; flex-direction: column; gap: 6px; max-width: 420px; }
.tg-bubble { padding: 8px 12px 10px; border-radius: 14px 14px 14px 4px; background: #182533; border: 1px solid var(--line); }
.tg-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; min-height: 0; }
.tg-photo { display: block; max-width: 100%; max-height: 360px; border-radius: 14px; object-fit: cover; }
.tg-file { padding: 10px 12px; border-radius: 12px; background: #182533; border: 1px solid var(--line); overflow-wrap: anywhere; }
.tg-kb .kb-btn { min-height: 34px; font-size: 14px; cursor: default; }
.btn-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 150px auto; gap: 8px; align-items: center; }
.btn-item { gap: 6px; padding: 10px; }
.btn-same { min-height: 36px; padding: 2px 4px; font-size: 14px; }
@media (max-width: 640px) { .btn-fields { grid-template-columns: minmax(0, 1fr) auto; } .btn-fields .input[type="url"] { grid-column: 1 / -1; grid-row: 2; } .btn-fields .btn-color { grid-column: 1; grid-row: 3; } }
.btn[aria-pressed="true"] { border-color: var(--accent); color: var(--text); }
@media (max-width: 760px) { .ed-prev { position: static; } }

/* ---------- выпадающие списки: тёмные, как панель (без этого Windows рисует серый список) ---------- */
select.input { background-color: #121722; }
select.input option, select.input optgroup { background-color: #161b24; color: var(--text); }
select.input option:checked { background-color: #2a3a5c; }

/* ---------- чипы-переключатели (каналы, закреп, дни недели, слоты) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--card2); color: var(--muted); font: inherit; font-size: 14px;
  font-weight: 600; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { background: rgba(58, 100, 196, .35); border-color: var(--accent); color: var(--text); }
.chip:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 899px) { .chip { min-height: 40px; } }
.inline-field { display: flex; align-items: center; gap: 10px; min-width: 0; }
.inline-field > span { flex: none; font-weight: 600; font-size: 14px; }
.inline-field .input { min-height: 40px; }
.grid2.tight { gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ---------- окно поста (AP.editPost) ---------- */
html.ed-open, html.ed-open body { overflow: hidden; }     /* страница под окном поста не прокручивается */
.ed-body, .ed-form, .ed-side { overscroll-behavior: contain; }
html.ed-open .toast { z-index: 40; }
.ed-overlay {
  position: fixed; inset: 0; z-index: 25; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(5, 8, 12, .66);
}
.ed-dialog {
  display: flex; flex-direction: column; width: min(100%, 1240px); height: min(100%, 900px); min-height: 0;
  background: #121722; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  overflow: hidden;
}
.ed-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.ed-x {
  width: 40px; height: 40px; flex: none; border-radius: 10px; border: 1px solid var(--line); background: var(--card2);
  color: var(--text); font: inherit; font-size: 18px; cursor: pointer;
}
.ed-x:hover { background: rgba(255, 255, 255, .12); }
.ed-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 400px; }
.ed-form { overflow-y: auto; padding: 16px 18px 24px; gap: 16px; }
.ed-side { overflow-y: auto; padding: 16px 18px 24px; border-left: 1px solid var(--line); background: rgba(0, 0, 0, .14);
           display: flex; flex-direction: column; gap: 18px; }
.ed-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 18px;
           border-top: 1px solid var(--line); background: #10141d; }
.ed-foot .field-err { flex: 1 1 260px; }
.ed-foot .btn.danger { margin-right: auto; }
.ed-foot .field-err:not([hidden]) + .btn.danger { margin-right: 0; }
.ed-overlay.dragging .ed-dialog { outline: 3px dashed var(--accent); outline-offset: -8px; }
.ed-preview .tg-post { max-width: 100%; }
@media (max-width: 899px) {
  /* окно — ровно в видимой части экрана (без клавиатуры): --vvh / --vvt ставит core.js */
  .ed-overlay { padding: 0; top: var(--vvt, 0px); bottom: auto; height: var(--vvh, 100%); }
  .ed-dialog { width: 100%; height: 100%; border-radius: 0; border: 0; }
  .ed-head { padding: 10px 12px; }
  .ed-body { display: flex; flex-direction: column; overflow-y: auto; }
  .ed-form, .ed-side { overflow: visible; padding: 12px; }
  .ed-side { border-left: 0; border-top: 1px solid var(--line); }
  .ed-when { order: -1; }
  .ed-foot { padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); }
}

/* переключатель вида окна в шапке: «☰ Обычный · ▭ Вкладки» (на телефоне — только значки) */
.ed-head .ed-view { flex: none; flex-wrap: nowrap; padding: 3px; gap: 2px; border-radius: 10px; }
.ed-head .ed-view button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; min-width: 40px;
                           padding: 2px 10px; border-radius: 8px; font-size: 13px; }
/* вид «Вкладки»: предпросмотр сверху, под ним вкладки, видна одна часть поста */
.ed-tabs .ed-body { display: flex; flex-direction: column; overflow: hidden; }
.ed-top { flex: 0 1 auto; max-height: 42%; overflow-y: auto; overscroll-behavior: contain; padding: 14px 18px;
          border-bottom: 1px solid var(--line); background: rgba(0, 0, 0, .14); }
.ed-top .ed-preview { max-width: 520px; margin: 0 auto; }
.ed-top .ed-preview > h3, .ed-top .ed-preview > .field-hint { display: none; }
/* предпросмотр не сжимается под длинной вкладкой (иначе реакции уходили под вкладки); длинный текст — 4 строки,
   чтобы вложение и кнопки под постом всегда были видны */
.ed-tabs .ed-top { flex: none; }
.ed-top .tg-text { display: -webkit-box; -webkit-line-clamp: 4; line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ed-tabbar { flex: none; display: flex; gap: 6px; overflow-x: auto; padding: 8px 18px; border-bottom: 1px solid var(--line);
             scrollbar-width: none; }
.ed-tabbar::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .ed-tabbar { justify-content: center; } }
.ed-tab { flex: none; min-height: 34px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line);
          background: var(--card2); color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
          white-space: nowrap; }
.ed-tab[aria-selected="true"] { background: var(--btn); border-color: transparent; color: #fff; }
.ed-tabs .ed-form { flex: 1 1 0; min-height: 0; overflow-y: auto; }
.ed-tabs .ed-form > * { width: 100%; max-width: 760px; margin-left: auto; margin-right: auto; }
.ed-tabs .ed-when > h3 { display: none; }
@media (max-width: 899px) {
  .ed-view-l { display: none; }
  .ed-head .ed-view button { min-height: 34px; padding: 2px 8px; }
  .ed-top { max-height: 36%; padding: 10px 12px; }
  .ed-tabbar { padding: 8px 12px; }
  .ed-tab { min-height: 38px; }
  .ed-tabs .ed-form { overflow-y: auto; padding: 12px; }
}
html[data-theme="light"] .ed-top { background: rgba(15, 23, 42, .035); }

/* вложение */
.drop { padding: 12px; border-radius: 12px; border: 1px dashed rgba(255, 255, 255, .22); background: rgba(0, 0, 0, .18); }
.drop.busy { border-style: solid; }
.up-bar { width: 100%; height: 8px; accent-color: var(--btn); }
.media-row { padding: 8px 10px; border-radius: 12px; background: rgba(0, 0, 0, .18); border: 1px solid var(--line); }

/* «Когда»: календарь и время всегда открыты */
.when { display: flex; flex-direction: column; gap: 12px; }
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.cal-title { flex: 1; text-align: center; font-size: 15px; }
.cal-nav {
  width: 36px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: var(--card2); color: var(--text);
  font: inherit; font-size: 18px; line-height: 1; cursor: pointer;
}
.cal-nav:disabled { opacity: .35; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-dow { text-align: center; font-size: 12px; color: var(--muted); padding: 2px 0; }
.cal-day, .tm {
  min-height: 34px; border-radius: 9px; border: 1px solid transparent; background: rgba(255, 255, 255, .04);
  color: var(--text); font: inherit; font-size: 14px; font-variant-numeric: tabular-nums; cursor: pointer; padding: 0;
}
.cal-day:hover:not(:disabled), .tm:hover:not(:disabled) { background: rgba(255, 255, 255, .1); }
.cal-day.today { border-color: rgba(109, 156, 245, .55); }
.cal-day[aria-pressed="true"], .tm[aria-pressed="true"] { background: var(--btn); border-color: var(--btn); color: #fff; font-weight: 700; }
.cal-day:disabled, .tm:disabled { color: rgba(255, 255, 255, .22); background: transparent; cursor: default; }
.when-time { display: flex; flex-direction: column; gap: 6px; }
.tm-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; }
.tm-grid.mins { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.when-sel { margin: 0; font-weight: 700; }
/* окно поста, вид «Вкладки» на широком экране: календарь слева, часы и минуты справа — без лишней прокрутки */
@media (min-width: 900px) {
  .ed-tabs .when { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 18px; align-items: start; }
  .ed-tabs .when > .when-sel { grid-column: 1 / -1; }
  .ed-tabs .when .cal-day, .ed-tabs .when .tm { min-height: 30px; }
  .ed-tabs .when .tm-grid.hours { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .ed-tabs .when .tm-grid.mins { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.queue-next { margin: 0; font-size: 16px; }
.slots { gap: 6px; }

/* расписание канала (страница канала) */
.sch-every { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 420px) { .sch-every { grid-template-columns: 1fr 1fr; } }
.ed-when .seg { display: flex; flex-wrap: nowrap; width: 100%; }
.ed-when .seg button { flex: 1 1 0; min-width: 0; padding: 4px 6px; white-space: nowrap; }

/* ---------- конструктор реакций и порядок кнопок (окно поста) ---------- */
.btn-move { display: flex; gap: 4px; }
.btn-move .btn { min-width: 36px; padding-left: 8px; padding-right: 8px; }
.btn-move .btn:disabled { opacity: .35; cursor: default; }
.rx { gap: 10px; }
.rx-quick { align-items: center; }
.rx-q { min-width: 40px; font-size: 18px; padding-left: 6px; padding-right: 6px; justify-content: center; }
.rx-own { width: 84px; min-height: 36px; padding: 4px 8px; }
.rx-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.rx-dot { min-width: 40px; justify-content: center; font-size: 16px; }
.rx-del { color: var(--bad); }
.rx-kb { padding: 10px; border: 1px dashed var(--line); border-radius: 12px; }
.rx-kb .kb-btn { min-height: 38px; font-size: 18px; }
.rx-kb .kb-btn[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.rx-empty { margin: 0; padding: 10px; border: 1px dashed var(--line); border-radius: 12px; }
.rx-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 10px;
            border-radius: 12px; background: rgba(58, 100, 196, .12); }
.rx-tools .chip:disabled { opacity: .35; }
button.link-btn[data-k="back-post"] { align-self: flex-start; text-align: left; }

/* ---------- вид «Списком / Блоками», подсказка под заголовком, вкладки над списком ---------- */
.show-n { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.page-hint { margin: 0; min-width: 220px; }
.list-tabs { display: flex; }
.users-top { align-items: center; }
.users-top .grow { min-width: 220px; }
.ch-list { gap: 12px; }
.ch-row h3 { margin: 0; }
.ch-row .metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 2fr); gap: 12px; }
.ch-row .metric { min-width: 0; }
.ch-row .metric-v { font-weight: 700; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .wide-only { display: none !important; }
  .ch-row .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ch-grid.view-grid { grid-template-columns: 1fr; }
}
.ov-all { margin-top: 12px; }
.show-n.wide-only { margin-left: auto; }
.post-still .item-sub { display: flex; flex-wrap: wrap; gap: 2px 8px; }

/* «Чей обзор»: кнопки, выбранный пользователь, поиск с подсказками */
.ov-who { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-width: 0; }
.ov-picked { display: inline-flex; align-items: center; gap: 6px; padding-right: 4px; }
.ov-x { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 2px 8px; border-radius: 8px; min-height: 28px; }
.ov-x:hover { background: rgba(255, 255, 255, .08); }
.ov-search { position: relative; width: 300px; max-width: 100%; }
.ov-found { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); padding: 4px; display: flex;
            flex-direction: column; gap: 2px; max-height: 340px; overflow-y: auto; }
.ov-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; padding: 8px 10px;
           border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; cursor: pointer; }
.ov-item:hover, .ov-item:focus-visible { background: rgba(58, 100, 196, .25); }
.ov-none { margin: 0; padding: 8px 10px; }
/* поиск пользователя сжимается, чтобы «＋ Создать пост» стояла с ним в одной строке; на телефоне «Чей обзор» —
   строкой выше, поиск и кнопка — строкой ниже */
.ov-head { flex-wrap: wrap; }
.ov-head .ov-who { display: contents; }
.ov-head .ov-search { width: auto; flex: 1 1 140px; max-width: 300px; min-width: 0; }
.ov-head > .btn { flex: none; }
@media (max-width: 640px) {
  .ov-head > .grow { display: none; }
  .ov-head .ov-search { max-width: none; }
  .ov-head .seg { display: flex; flex: 1 1 100%; flex-wrap: nowrap; }
  .ov-head .seg button { flex: 1 1 0; min-width: 0; min-height: 36px; white-space: nowrap; }
  .ov-head .ov-search input, .ov-head > .btn { min-height: 44px; }
}
.ov-found.card { background: #121722; backdrop-filter: none; box-shadow: 0 12px 32px rgba(0, 0, 0, .5); }
.post-id { color: var(--muted); font-weight: 600; margin-right: 8px; font-variant-numeric: tabular-nums; }
.posts-search { min-width: 220px; max-width: 360px; margin-left: auto; }
/* каналы: подключение и действия */
.ch-add { border-color: rgba(120, 160, 255, .35); }
.ch-step { gap: 6px; padding-top: 4px; }
.ch-step-t { font-weight: 600; }
.ch-found { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; align-items: center; }
.ch-actions { margin-top: 10px; flex-wrap: wrap; }
/* пользователь: управление */
.adm-manage h3 { margin: 8px 0 0; font-size: 15px; }
.adm-limits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.adm-lim { gap: 4px; }
/* FAQ */
.faq-top { align-items: center; }
.faq-search { min-width: 220px; }
.faq-list { gap: 10px; }
.faq-item { padding: 10px 14px; gap: 8px; }
.faq-match { border-color: rgba(109, 156, 245, .55); }
.faq-head { align-items: center; flex-wrap: nowrap; }
.faq-q { display: flex; gap: 10px; align-items: baseline; flex: 1; min-width: 0; text-align: left; background: none; border: 0;
  color: var(--text); font: inherit; font-weight: 600; font-size: 16px; padding: 6px 0; cursor: pointer; }
.faq-arrow { color: var(--muted); width: 12px; flex: none; }
.faq-tools { flex: none; gap: 4px; }
.faq-a { padding: 2px 0 6px 22px; }
.faq-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.faq-sim .chip { text-align: left; }
.faq-rest { margin-top: 6px; }
.faq-dialog { width: min(100%, 720px); max-height: calc(100vh - 32px); overflow: auto; }
.faq-langs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.faq-lang { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: inherit; font-weight: 600;
  padding: 8px 14px; cursor: pointer; }
.faq-lang[aria-selected="true"] { color: var(--text); border-bottom-color: #e2a93b; }
.faq-label { font-weight: 600; }
.faq-tagbox { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.faq-tagbox .faq-tag-in { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.faq-tags { padding: 8px; min-height: 20px; }
.faq-tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 8px; border: 1px solid var(--line);
  border-radius: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.faq-tag-x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.faq-tag-x:hover { color: var(--text); }
.faq-flags { flex: none; gap: 14px; align-items: flex-end; margin-right: 6px; }
.faq-flag { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.faq-flag-t { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.faq-off .faq-q { opacity: .55; }
.faq-img, .faq-pic { display: block; max-width: min(100%, 520px); max-height: 360px; border-radius: 10px; border: 1px solid var(--line);
                     object-fit: contain; }
.faq-pic { max-height: 220px; }
.faq-pic[hidden] { display: none; }
.welcome-box { max-width: 820px; }
@media (max-width: 640px) { .faq-head { flex-wrap: wrap; } .faq-tools { width: 100%; justify-content: flex-end; }
  .faq-flags + .faq-tools { width: auto; margin-left: auto; align-self: flex-end; }
  .faq-head:has(.faq-flags) .faq-q { flex-basis: 100%; }
  .faq-flags { gap: 10px; margin: 4px 0 0 22px; } }

/* ---------- «Переводы» (админ) ---------- */
.tr-top { flex-wrap: wrap; gap: 10px; align-items: center; }
.tr-top .tr-group { width: auto; min-width: 150px; }
.tr-search { min-width: 180px; }
.tr-wrap { padding: 0; overflow-x: auto; }
.tr-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tr-table th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 700; padding: 12px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tr-table td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; white-space: pre-line; }
.tr-table tbody tr:first-child td { border-top: 0; }
.tr-table tbody tr:hover td { background: var(--card2); }
.tr-grp { color: var(--muted); white-space: nowrap; }
.tr-key-cell { min-width: 180px; color: var(--muted); }
.tr-cell { min-width: 140px; }
.tr-custom { color: var(--accent-t); }
.tr-none { color: var(--muted); opacity: .6; font-style: italic; }
.tr-act { width: 1%; text-align: right; }
.tr-foot { flex-wrap: wrap; gap: 10px; align-items: center; }
.tr-foot .tr-size { width: auto; min-width: 72px; }
.tr-pages { gap: 4px; flex-wrap: wrap; }
.tr-page { min-width: 36px; padding: 4px 8px; }
.tr-page[aria-current="page"] { background: var(--btn); border-color: var(--btn); color: #fff; }
.tr-dialog { max-width: 720px; width: 100%; max-height: calc(100vh - 32px); overflow-y: auto; }
.tr-key { padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); white-space: pre-line; overflow-wrap: anywhere; }
.tr-area { min-height: 64px; resize: vertical; font: inherit; }
@media (max-width: 720px) {
  .tr-table thead { display: none; }
  .tr-table, .tr-table tbody, .tr-table tr, .tr-table td { display: block; width: 100%; }
  .tr-table tr { padding: 8px 0; border-top: 1px solid var(--line); }
  .tr-table tbody tr:first-child { border-top: 0; }
  .tr-table td { border: 0; padding: 4px 14px; }
  .tr-table td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; color: var(--muted); font-weight: 700; font-style: normal; }
  .tr-act { text-align: left; }
}

/* ---------- поддержка ---------- */
/* счётчик новых сообщений в меню: жёлтая рамка; в нижнем меню — кружок у значка */
.pill.cnt.alert { background: var(--warn-soft); color: var(--warn); border: 1px solid rgba(226, 177, 74, .55); border-radius: 6px; padding: 0 7px; }
.nav .tab .cnt.alert { display: inline-flex; position: absolute; top: 4px; left: calc(50% + 6px); font-size: 11px; line-height: 16px; padding: 0 5px; }
@media (min-width: 900px) {
  html[data-menu="left"] .nav .tab .cnt.alert { position: static; font-size: 13px; line-height: 20px; padding: 0 7px; }
  html[data-menu="left"][data-side="closed"] .nav .tab .cnt.alert { display: inline-flex; position: absolute; top: 2px; left: auto; right: 4px; font-size: 10px; line-height: 14px; padding: 0 4px; }
}
.faq-intro h2 { margin: 0; }
.faq-intro p { margin: 0; }
.faq-support { align-items: center; border-color: rgba(226, 177, 74, .45); }
.faq-support p { margin: 0; min-width: 200px; }
.sup-list { gap: 0; padding: 4px 14px; }
.sup-mine .sup-list { padding: 0; }
.sup-row { display: flex; flex-direction: column; gap: 3px; padding: 10px 0; color: var(--text); text-decoration: none; border-top: 1px solid var(--line); min-width: 0; }
.sup-list > .sup-row:first-child { border-top: 0; }
.sup-row:hover .sup-row-head .grow, .sup-row:focus-visible .sup-row-head .grow { text-decoration: underline; }
.sup-row-head { gap: 8px; }
.sup-unread .sup-row-head b { color: var(--warn); }
.sup-preview { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup-top { align-items: center; }
.sup-mine-head { align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.sup-mine-head h2 { margin: 0; }
.sup-more { align-items: center; gap: 12px; }
.sup-chat { gap: 10px; max-height: min(62vh, 640px); overflow-y: auto; padding: 2px 2px 6px; }
.sup-msg { align-self: flex-start; max-width: min(85%, 640px); padding: 8px 12px; border-radius: 12px 12px 12px 4px;
  background: var(--card2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.sup-msg.mine { align-self: flex-end; border-radius: 12px 12px 4px 12px; background: rgba(109, 156, 245, .16); border-color: rgba(109, 156, 245, .3); }
.sup-msg.staff:not(.mine) { background: var(--ok-soft); border-color: rgba(76, 195, 130, .3); }
.sup-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.sup-img img { display: block; max-width: 100%; max-height: 320px; border-radius: 8px; }
.sup-photo { gap: 6px; }
.sup-file { overflow-wrap: anywhere; }
.sup-actions { align-items: center; }
.sup-dialog { width: min(100%, 600px); max-height: calc(100vh - 32px); overflow: auto; }

/* ---------- уведомления (#/notices) ---------- */
.nt-list { gap: 0; padding: 4px 14px; }
.nt-item { display: flex; padding: 12px 0; border-top: 1px solid var(--line); min-width: 0; }
.nt-list > .nt-item:first-child { border-top: 0; }
.nt-body { gap: 4px; min-width: 0; }
.nt-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.nt-unread .nt-text { font-weight: 600; }
.nt-unread .nt-body > .muted { color: var(--warn); }
.nt-links { gap: 6px 14px; flex-wrap: wrap; }

/* ---------- шапка сайта: на всю ширину экрана (справа от бокового меню), прилипает к верху.
   Слева заголовок; справа ☀️/🌙, 🔔, язык, аккаунт ---------- */
:root { --headbg: rgba(11, 15, 22, .78); }
.head {
  position: sticky; top: 0; z-index: 22; flex-wrap: nowrap; margin: 0;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: var(--headbg);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
}
.head h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 900px) {
  html[data-menu="left"] .head { margin-left: 248px; padding: 12px 24px; }
  html[data-menu="left"][data-side="closed"] .head { margin-left: 68px; }
  html[data-menu="left"] .page { padding-top: 20px; max-width: none; margin: 0; }   /* как шапка — на всю ширину */
  html[data-menu="left"] .view { max-width: 1320px; margin: 0 auto; }   /* содержимое — по центру, не растягивается */
  /* шапка — на всю ширину, но заголовок и кнопки стоят над содержимым (24 px отступы страницы + 1320 px) */
  html[data-menu="left"] .head { padding-left: max(24px, calc((100vw - 248px - 1368px) / 2 + 24px));
    padding-right: max(24px, calc((100vw - 248px - 1368px) / 2 + 24px)); }
  html[data-menu="left"][data-side="closed"] .head { padding-left: max(24px, calc((100vw - 68px - 1368px) / 2 + 24px));
    padding-right: max(24px, calc((100vw - 68px - 1368px) / 2 + 24px)); }
}
.top-acts { position: relative; display: flex; align-items: center; gap: 6px; flex: none; margin-left: auto; }
.top-drop { position: static; }
.top-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 40px; height: 40px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.top-btn:hover { border-color: rgba(109, 156, 245, .5); }
.top-btn[aria-expanded="true"] { border-color: var(--accent); }
.top-btn svg { width: 20px; height: 20px; flex: none; }
.top-btn .caret { width: 16px; height: 16px; color: var(--muted); }
#theme-btn .i-sun { color: #f2b632; }
#theme-btn .i-moon { display: none; color: #5b6fb0; }
html[data-theme="light"] #theme-btn .i-sun { display: none; }
html[data-theme="light"] #theme-btn .i-moon { display: block; }
.top-cnt {
  position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px;
  background: #e5484d; color: #fff; font-size: 11px; font-weight: 700; line-height: 19px; text-align: center;
  font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px var(--bg);
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--btn); color: #fff; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.avatar svg { width: 16px; height: 16px; }
.acct-btn { padding: 0 8px 0 5px; }
.acct-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 899px) {
  .acct-name, .acct-btn .caret, .lang-btn svg { display: none; }
  .acct-btn { padding: 0 5px; }
  .top-acts { gap: 4px; }
}

/* выпадающий список под кнопкой шапки (по правому краю кнопок) */
.pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 23; width: min(380px, calc(100vw - 24px));
  max-height: min(78vh, 640px); overflow-y: auto; overscroll-behavior: contain; padding: 8px;
  background: var(--solid); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 44px rgba(0, 0, 0, .45);
  display: flex; flex-direction: column; gap: 6px;
}
.pop[hidden] { display: none; }
.lang-pop, .acct-pop { width: 230px; }
.pop-head { padding: 6px 8px; font-weight: 700; }
.acct-pop .pop-head { margin: -8px -8px 2px; padding: 10px 14px; border-radius: 14px 14px 0 0; background: var(--btn);
  color: #fff; text-align: center; }
.pop-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 6px 10px; border-radius: 10px;
  border: 0; background: transparent; color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.pop-item:hover, .pop-item:focus-visible { background: var(--card2); color: var(--text); }
.pop-item svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.pop-item[aria-pressed="true"] { background: rgba(109, 156, 245, .16); font-weight: 650; }
.pop-item .flag { width: 22px; text-align: center; }
/* 🔔: карточки новых уведомлений */
.bp-list { display: flex; flex-direction: column; gap: 6px; }
.bp-item {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 8px 10px 10px; border-radius: 12px;
  background: var(--card2); border: 1px solid var(--line); border-left: 3px solid var(--k-task);
}
.bp-item.bp-post { border-left-color: var(--bad); }
.bp-item.bp-audience { border-left-color: var(--ok); }
.bp-item.bp-account { border-left-color: var(--warn); }
.bp-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bp-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12px; color: var(--muted); }
.bp-kind { color: var(--accent-t); font-weight: 600; }
.bp-new { color: var(--warn); font-weight: 700; }
.bp-text { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bp-link { font-size: 13px; font-weight: 600; color: var(--accent-t); text-decoration: none; }
.bp-link:hover { text-decoration: underline; }
.bp-x { flex: none; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  font-size: 20px; line-height: 1; cursor: pointer; }
.bp-x:hover { background: var(--card2); color: var(--text); }
.bp-empty { text-align: center; }
.bp-foot { display: flex; gap: 8px; position: sticky; bottom: -8px; margin: 0 -8px -8px; padding: 8px;
  background: var(--solid); border-top: 1px solid var(--line); }
.bp-foot .btn { flex: 1 1 0; min-width: 0; padding: 6px 8px; }
.bp-foot .btn.primary { flex: 1.5 1 0; }
/* настройки уведомлений: вид × «на сайте» / «в Telegram» */
.np-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px 18px; align-items: center; }
.np-grid .np-col { font-size: 13px; color: var(--muted); font-weight: 600; text-align: center; }
.np-grid .np-on { justify-self: center; }

/* ---------- светлая тема (кнопка ☀️/🌙 в шапке, html[data-theme="light"]) ---------- */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2f8;
  --card: rgba(255, 255, 255, .82);
  --card2: rgba(15, 23, 42, .055);
  --line: rgba(15, 23, 42, .12);
  --track: rgba(15, 23, 42, .07);
  --solid: #ffffff;
  --hi: rgba(255, 255, 255, .8);
  --text: #1b2230;
  --muted: #5b6577;
  --accent: #3a6fd8;
  --accent-t: #2c5cc0;
  --btn: #3a64c4;
  --ok: #17824b;   --ok-soft: #dcf2e5;
  --warn: #9a6400; --warn-soft: #fbefd0;
  --bad: #c43838;  --bad-soft: #fbe2e2;
  --k-task: #2e6cd0;  --k-task-soft: #dce8fb;
  --k-react: #0f8676; --k-react-soft: #d3f1ec;
  --k-warm: #c0561b;  --k-warm-soft: #fbe4d6;
  --k-clean: #6a5dd4; --k-clean-soft: #e6e3fb;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 6px 20px rgba(15, 23, 42, .06);
  --headbg: rgba(238, 242, 248, .85);
}
html[data-theme="light"] body::before {
  background:
    radial-gradient(60vmax 45vmax at 8% 0%, rgba(91, 155, 240, .16), transparent 70%),
    radial-gradient(50vmax 40vmax at 100% 18%, rgba(157, 146, 240, .14), transparent 70%),
    radial-gradient(55vmax 42vmax at 85% 100%, rgba(60, 198, 180, .14), transparent 70%),
    radial-gradient(40vmax 30vmax at 0% 95%, rgba(242, 136, 77, .08), transparent 70%);
}
html[data-theme="light"] a, html[data-theme="light"] .link-btn, html[data-theme="light"] .rt-prev a { color: #2c5cc0; }
html[data-theme="light"] a:hover, html[data-theme="light"] .link-btn:hover { color: #1d469f; }
html[data-theme="light"] a.btn, html[data-theme="light"] a.pop-item { color: var(--text); }
html[data-theme="light"] a.btn.primary, html[data-theme="light"] .btn.primary:hover { color: #fff; }
html[data-theme="light"] .bp-link, html[data-theme="light"] .src-link { color: var(--accent-t); }
html[data-theme="light"] .input, html[data-theme="light"] select.input { background-color: #fff; }
html[data-theme="light"] select.input option, html[data-theme="light"] select.input optgroup { background-color: #fff; }
html[data-theme="light"] select.input option:checked { background-color: #dbe6fb; }
html[data-theme="light"] .sig, html[data-theme="light"] .post-text, html[data-theme="light"] .field-hint.pre,
html[data-theme="light"] .sub-box, html[data-theme="light"] .inline-edit, html[data-theme="light"] .mode-opt,
html[data-theme="light"] .drop, html[data-theme="light"] .media-row, html[data-theme="light"] .tr-key,
html[data-theme="light"] .ed-side { background: rgba(15, 23, 42, .035); }
html[data-theme="light"] .drop { border-color: rgba(15, 23, 42, .25); }
html[data-theme="light"] .seg button[aria-pressed="true"], html[data-theme="light"] .rt-btn[aria-pressed="true"] {
  background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .18); }
html[data-theme="light"] .nav { background: rgba(255, 255, 255, .82); }
@media (min-width: 900px) { html[data-theme="light"][data-menu="left"] .nav { background: rgba(255, 255, 255, .6); } }
@media (max-width: 899px) { html[data-theme="light"][data-menu="left"] .nav { background: rgba(255, 255, 255, .98);
  box-shadow: 0 12px 40px rgba(15, 23, 42, .18); } }
html[data-theme="light"] .nav .tab:hover, html[data-theme="light"] .side-toggle:hover, html[data-theme="light"] .rt-btn:hover,
html[data-theme="light"] .ed-x:hover, html[data-theme="light"] .ov-x:hover { background: rgba(15, 23, 42, .06); }
html[data-theme="light"] .menu-btn { background: rgba(15, 23, 42, .04); }
html[data-theme="light"] .toast { background: rgba(255, 255, 255, .98); box-shadow: 0 8px 26px rgba(15, 23, 42, .18); }
html[data-theme="light"] .modal, html[data-theme="light"] .ed-overlay { background: rgba(30, 40, 60, .42); }
html[data-theme="light"] .ed-dialog { background: #f7f9fc; box-shadow: 0 20px 60px rgba(15, 23, 42, .25); }
html[data-theme="light"] .ed-foot { background: #eef2f8; }
html[data-theme="light"] .kb-plain { background: #dfe5ee; color: var(--text); }
html[data-theme="light"] .rt-prev code, html[data-theme="light"] .rt-prev pre { background: rgba(15, 23, 42, .06); }
html[data-theme="light"] .rt-spoiler { background: #9aa3b3; }
html[data-theme="light"] .rt-spoiler.shown { background: rgba(15, 23, 42, .06); }
html[data-theme="light"] .tg-bubble, html[data-theme="light"] .tg-file { background: #fff; }
html[data-theme="light"] .chip[aria-pressed="true"] { background: rgba(58, 100, 196, .16); }
html[data-theme="light"] .cal-day, html[data-theme="light"] .tm { background: rgba(15, 23, 42, .04); }
html[data-theme="light"] .cal-day:hover:not(:disabled), html[data-theme="light"] .tm:hover:not(:disabled) { background: rgba(15, 23, 42, .09); }
html[data-theme="light"] .cal-day[aria-pressed="true"], html[data-theme="light"] .tm[aria-pressed="true"] { background: var(--btn); }
html[data-theme="light"] .cal-day:disabled, html[data-theme="light"] .tm:disabled { color: rgba(15, 23, 42, .28); background: transparent; }
html[data-theme="light"] .ov-found.card { background: #fff; box-shadow: 0 12px 32px rgba(15, 23, 42, .18); }
html[data-theme="light"] .pop { box-shadow: 0 16px 44px rgba(15, 23, 42, .2); }

/* контент-план: в кнопках «← Раньше · Сегодня · Позже →» — дни, которые они покажут; на телефоне — ряд на всю ширину */
.plan-btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; line-height: 1.2;
            min-height: 46px; padding: 4px 12px; }
.plan-range { font-size: 12px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 640px) {
  .plan-nav > .plan-btn { flex: 1 1 0; min-width: 0; padding: 4px 6px; }
  .plan-nav > .grow { display: none; }
  .plan-nav > .search { flex: 1 1 100%; max-width: none; }
}

/* ---------- Настройки: разделы из компактных карточек ---------- */
.set-group { gap: 10px; }
.set-group + .set-group { margin-top: 10px; }
.set-sec { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.set-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.set-card { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; min-width: 0; }
.set-title { margin: 0; font-size: 15px; font-weight: 700; }
.set-lines { display: flex; flex-direction: column; gap: 3px; flex: 1 1 auto; }
.set-line { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-btns { gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.set-dialog { width: min(100%, 560px); max-height: calc(100vh - 32px); overflow: auto; }
.set-dialog[data-k="set-dialog:welcome"] { width: min(100%, 760px); }
.set-dialog[data-k="set-dialog:landing"] { width: min(100%, 760px); }
.set-dialog[data-k="set-dialog:legal"] { width: min(100%, 860px); }
.lp-ed-list { gap: 8px; }
.lp-ed-parts { gap: 18px; }
.lp-ed-row { gap: 8px; align-items: flex-start; flex-wrap: nowrap; }
.lp-ed-row .link-btn { padding: 10px 4px; }
.lp-ed-fields { display: grid; gap: 6px; min-width: 0; }
.lp-ed-n2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
@media (max-width: 599px) { .lp-ed-n2 { grid-template-columns: minmax(0, 1fr); } }
.set-body > .card { background: none; border: 0; padding: 0; box-shadow: none; max-width: none; }
.set-body > .card > h2:first-child { display: none; }
@media (max-width: 1200px) { .set-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .set-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .set-grid { grid-template-columns: minmax(0, 1fr); } }
.adm-refresh { margin-top: 10px; }

/* ---------- идеи: кнопка в шапке и раздел «Идеи» ---------- */
.idea-btn { padding: 0 14px; border-radius: 999px; }
.idea-btn svg { width: 18px; height: 18px; }
.idea-dialog { width: min(100%, 560px); }
.idea-dialog textarea { min-height: 140px; resize: vertical; }
.idea-head { gap: 8px 12px; }
.idea-who { font-weight: 700; }
.idea-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.idea-seen { opacity: .5; }
.idea-seen .idea-text { text-decoration: line-through; }
@media (max-width: 899px) { .idea-lbl { display: none; } .idea-btn { padding: 0 8px; border-radius: 10px; } }

/* аудит 01.11.2026: всплывающие сообщения — всегда над окнами (раньше прятались под затемнением окна) */
.toast { z-index: 40; }

/* ---------- страница входа (login.html + js/login.js): слева описание, справа вход, ниже — что умеет ---------- */
.lp-body { background: radial-gradient(1200px 600px at 0% 0%, rgba(109, 156, 245, .10), transparent 60%), var(--bg); }
.lp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); max-width: 1320px; margin: 0 auto; }   /* по высоте содержимого — ниже сразу возможности */
.lp-hero { padding: 48px clamp(16px, 4vw, 56px) 48px; display: flex; flex-direction: column; gap: 22px; border-right: 1px solid var(--line); }
.lp-brand { display: flex; align-items: center; gap: 12px; font-size: 20px; }
.lp-brand .logo-box { width: 40px; height: 40px; border-radius: 11px; }
.lp-title { font-size: clamp(30px, 4vw, 46px); line-height: 1.12; margin: 36px 0 0; letter-spacing: -.01em; }
.lp-sub { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.55; max-width: 560px; }
.lp-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.lp-points li { position: relative; padding-left: 22px; }
.lp-points li::before { content: ""; position: absolute; left: 0; top: .5em; width: 8px; height: 8px; border-radius: 50%; background: #3ecf8e; }
.lp-points li:nth-child(3n+2)::before { background: var(--accent); }
.lp-points li:nth-child(3n)::before { background: #f5c451; }
.lp-stats { display: flex; flex-wrap: wrap; gap: 18px 48px; margin-top: auto; padding-top: 22px; border-top: 1px solid var(--line); }
.lp-stat b { display: block; font-size: 26px; }
.lp-stat span { color: var(--muted); font-size: 13px; }
.lp-side { padding: 48px clamp(16px, 4vw, 56px) 48px; display: flex; flex-direction: column; }
.lp-lang { position: relative; display: flex; justify-content: flex-end; min-height: 38px; }   /* место под кнопку языка до скрипта */
.lp-lang-btn { font: inherit; font-size: 14px; color: var(--text); background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.lp-lang-btn:hover { border-color: var(--accent); }
.lp-lang-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 20; min-width: 190px; display: flex;
  flex-direction: column; padding: 6px; background: var(--solid); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35); }
.lp-lang-menu[hidden] { display: none; }
.lp-lang-menu a { color: var(--text); text-decoration: none; font-size: 14px; padding: 9px 12px; border-radius: 8px; }
.lp-lang-menu a:hover { background: var(--card); }
.lp-lang-menu a.on { font-weight: 700; background: var(--card); }
.lp-login { margin: 64px 0 0; width: min(100%, 400px); align-self: center; display: flex; flex-direction: column; gap: 14px; }
.lp-login h2 { font-size: 30px; margin: 0; }
.lp-login p { margin: 0; }
.lp-error { color: var(--bad); }
.lp-error:empty { display: none; }
.lp-tg { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; border: 0; border-radius: 10px;
  background: #1a78ad; color: #fff; font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; }
.lp-tg:hover:not(:disabled) { background: #156592; }   /* белый текст на синем — контраст не ниже 4.5 (PageSpeed) */
a.lp-tg { text-decoration: none; }
.lp-tg[aria-disabled="true"] { opacity: .6; cursor: progress; }
.lp-alt { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 10px; background: transparent;
  color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.lp-alt:hover:not(:disabled) { background: var(--card); }
.lp-alt:disabled { opacity: .6; cursor: progress; }
.lp-tg:disabled { opacity: .6; cursor: progress; }
.lp-tg svg { width: 22px; height: 22px; }
.lp-note.bad { color: var(--bad); }
.lp-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.lp-or::before, .lp-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.lp-bot { color: var(--accent-t); text-decoration: none; font-weight: 600; }
.lp-more { max-width: 1320px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 56px) 64px; display: flex; flex-direction: column; gap: 22px; border-top: 1px solid var(--line); }
.lp-more h2 { font-size: 26px; margin: 12px 0 0; }
.lp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.lp-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.lp-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.lp-card h3 { margin: 0 0 8px; font-size: 17px; }
.lp-card p { margin: 0; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
@media (max-width: 899px) {
  .lp { display: flex; flex-direction: column; min-height: 0; }
  .lp-side { display: contents; }               /* на телефоне языки — вверху страницы, вход — под описанием */
  .lp { position: relative; }
  .lp-lang { position: absolute; top: 26px; right: 16px; z-index: 5; }    /* на телефоне — справа от названия */
  .lp-login { padding: 0 16px; }
  .lp-hero { border-right: 0; padding-top: 24px; gap: 16px; }
  .lp-title { margin-top: 8px; }
  .lp-login { margin: 18px auto; }
  .lp-grid, .lp-two { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- документы: подвал страницы входа и страницы /privacy, /terms (legal.html + js/legal.js) ---------- */
.lp-foot { max-width: 1320px; margin: 0 auto; padding: 22px clamp(16px, 4vw, 56px) calc(28px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.lp-foot a { color: var(--muted); text-decoration: none; }
.lp-foot a:hover { color: var(--text); text-decoration: underline; }
.lg-page { max-width: 860px; margin: 0 auto; padding: 24px 16px calc(40px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 18px; }
.lg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lg-brand { color: var(--text); text-decoration: none; }
.lg-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.lg-tab { padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.lg-tab:hover { color: var(--text); }
.lg-tab.on { color: var(--accent-t); background: rgba(109, 156, 245, .14); border-color: transparent; }
.lg-doc { padding: clamp(18px, 4vw, 36px); }
.lg-title { font-size: clamp(24px, 4vw, 32px); margin: 0; line-height: 1.2; }
.lg-date { margin: 8px 0 0; }
.lg-body { margin-top: 18px; line-height: 1.6; overflow-wrap: anywhere; }
.lg-body p { margin: 0 0 12px; }
.lg-body .lg-h { font-size: 18px; margin: 26px 0 10px; }
.lg-body .lg-list { margin: 0 0 12px; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.lg-foot { margin: 0; }
.lg-foot a { color: var(--accent-t); text-decoration: none; font-weight: 600; }
.lg-ed-body { min-height: 320px; font-size: 14px; line-height: 1.5; resize: vertical; }
