/* Кабинет ботов. Расположение — как в кабинете PuzzleBot (меню разделов слева, путь в шапке,
   диалоги в три колонки), оформление — фирменное RAZRABOT: серый фон, белые плашки с чёрной обводкой,
   синий #0085F8, Montserrat. Без теней-размытий и градиентов. */
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/static/montserrat-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/static/montserrat-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+25B2, U+25BC, U+FEFF, U+FFFD; }

:root {
  --bg: #f1f1f1; --panel: #fff; --ink: #000; --text: #111; --muted: #6b6b6b; --line: #e3e3e3;
  --blue: #0085f8; --blue-dark: #0059a7; --blue-soft: #e6f2ff; --gray: #e7e7e7;
  --ok: #0f7b3e; --err: #d1242f; --stroke: 2px solid var(--ink); --thin: 1.5px solid var(--line); --r: 20px;
  --top: 64px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
       font: 500 15px/1.5 "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }
h1 { font-size: 26px; font-weight: 600; text-transform: uppercase; letter-spacing: .01em; margin: 0 0 18px; line-height: 1.2; }
h2 { font-size: 22px; font-weight: 600; text-transform: uppercase; margin: 0; }
h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin: 22px 0 8px; }
.muted { color: var(--muted); font-weight: 500; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
      stroke-linecap: round; stroke-linejoin: round; }
.ic.fill { fill: currentColor; stroke: none; }

/* ---------- шапка: логотип · Личный кабинет / бот ▾ / раздел · справа пользователь ---------- */
.top { height: var(--top); display: flex; align-items: center; gap: 22px; padding: 0 24px; background: var(--panel);
       border-bottom: var(--stroke); position: sticky; top: 0; z-index: 20; }
.brand img { height: 34px; display: block; }
.crumbs { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; font-size: 15px; }
.crumbs .sep { color: #b9b9b9; font-weight: 500; }
.crumbs a, .crumbs summary { color: var(--muted); display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.crumbs a:hover, .crumbs summary:hover { color: var(--ink); }
.crumbs .botname { color: var(--ink); font-weight: 700; }
.crumbs .cur { color: var(--blue); }
.crumbs .cur.plain { color: var(--muted); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs .accent { color: var(--blue); }
.crumbs .ic { width: 18px; height: 18px; }
.me { margin-left: auto; display: flex; gap: 20px; align-items: center; }
.me a { color: var(--ink); font-weight: 600; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
.me a:hover, .me a.on { color: var(--blue); }
.me .ic { width: 18px; height: 18px; }
.me .who { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.me form { margin: 0; }
.me button.link { color: var(--muted); font-size: 14px; }
.me button.link:hover { color: var(--ink); }

/* выпадающие меню (details) */
.drop { position: relative; }
.drop > summary { list-style: none; cursor: pointer; user-select: none; }
.drop > summary::-webkit-details-marker { display: none; }
.drop > summary:not(.icon-btn)::after { content: ""; display: inline-block; border: 5px solid transparent;
  border-top-color: currentColor; border-bottom: 0; margin-left: 2px; }
.drop .menu { position: absolute; top: calc(100% + 8px); left: 0; z-index: 40; background: var(--panel); border: var(--stroke);
              border-radius: 14px; padding: 8px; min-width: 230px; max-height: 70vh; overflow: auto; }
.drop .menu.right { left: auto; right: 0; }
.drop .menu a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; color: var(--ink);
                font-weight: 600; font-size: 14px; white-space: nowrap; }
.drop .menu a:hover, .drop .menu a.on { background: var(--blue-soft); color: var(--blue-dark); }
.menu.form { padding: 14px 16px; min-width: 250px; }
.menu.form .mh { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 4px 0 8px; }
.menu.form .mh ~ .mh { margin-top: 14px; }
.menu.form select { width: 100%; }
.menu.form button { margin-top: 14px; width: 100%; }
.chk { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.chk input { width: 18px; height: 18px; accent-color: var(--blue); margin: 0; }

/* ---------- каркас: меню разделов слева, страница справа ---------- */
.shell { display: flex; min-height: calc(100dvh - var(--top)); }
.side { width: 220px; flex: none; padding: 22px 12px; position: sticky; top: var(--top); height: calc(100dvh - var(--top));
        overflow: auto; border-right: var(--thin); }
.side a, .side-bot { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 12px; color: var(--ink);
                     font-weight: 600; font-size: 15px; }
.side-bot { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.side-bot span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side a:hover { background: var(--gray); color: var(--ink); }
.side a.on { background: var(--blue-dark); color: #fff; }
.side hr { border: 0; border-top: var(--thin); margin: 14px 12px; }
.side a.all { color: var(--muted); font-size: 14px; }
main { flex: 1; min-width: 0; padding: 26px 32px 56px; }
main.full { padding: 18px 22px; }
.page-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { margin: 0; }

/* панель инструментов: «Применить фильтр», «Изменить вид столбцов», счётчик, поиск справа */
.toolbar { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar summary.act, .dlist-head summary.act { color: var(--blue); font-weight: 600; font-size: 14px; }
.toolbar summary.act:hover { color: var(--blue-dark); }
summary.act.dark { color: var(--ink); }
summary .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); vertical-align: middle; }
.count { font-size: 14px; color: var(--muted); font-weight: 500; }
.count b { color: var(--ink); }
.search { margin-left: auto; position: relative; display: flex; align-items: center; }
.search .ic, .dsearch .ic { position: absolute; left: 12px; color: #9a9a9a; width: 18px; height: 18px; pointer-events: none; }
.search input { padding-left: 38px; width: 260px; }

/* ---------- кнопки и поля ---------- */
button, .btn { font: 600 14px/1 "Montserrat", sans-serif; text-transform: uppercase; letter-spacing: .02em;
               background: var(--blue); color: #fff; border: var(--stroke); border-radius: 14px;
               padding: 12px 22px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
               transition: transform .08s; }
button:hover, .btn:hover { background: var(--blue-dark); color: #fff; }
button:active, .btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--gray); color: var(--ink); }
.btn.ghost:hover { background: #dcdcdc; color: var(--ink); }
.btn.small, button.small { padding: 9px 16px; font-size: 13px; border-radius: 12px; }
.btn.wide { width: 100%; }
button.link { background: none; border: 0; padding: 0; text-transform: none; color: var(--blue); font-weight: 600; }
button.link:hover { background: none; color: var(--blue-dark); }
button.danger { color: var(--err); }
button.plain { background: none; border: 0; padding: 0; color: inherit; text-transform: none; letter-spacing: 0;
               font: inherit; text-align: left; border-radius: 0; }
button.plain:hover { background: none; color: inherit; }
.icon-btn { width: 40px; height: 40px; padding: 0; border-radius: 12px; display: inline-grid; place-items: center;
            background: var(--blue); color: #fff; border: var(--stroke); cursor: pointer; flex: none; }
.icon-btn.ghost { background: var(--panel); color: var(--ink); border: var(--thin); }
.icon-btn.ghost:hover { background: var(--gray); color: var(--ink); }
input, select, textarea { font: 500 15px "Montserrat", sans-serif; color: var(--text); background: var(--panel);
                          border: var(--stroke); border-radius: 14px; padding: 10px 14px; }
input::placeholder, textarea::placeholder { color: #9a9a9a; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--blue-soft); border-color: var(--blue); }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.filters input[name=q] { flex: 1 1 320px; max-width: 520px; }

/* ---------- кружки с инициалами ---------- */
.ava { width: 46px; height: 46px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
       color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .02em; }
.ava.sm { width: 32px; height: 32px; font-size: 12px; }
.ava.lg { width: 72px; height: 72px; font-size: 24px; }
.ava.a0 { background: #0085f8; } .ava.a1 { background: #0059a7; } .ava.a2 { background: #111; }
.ava.a3 { background: #4f6d8f; } .ava.a4 { background: #2a9df4; } .ava.a5 { background: #6b6b6b; }

/* ---------- таблицы (Модерация, Таблицы, Доступ) ---------- */
.table-wrap { border: var(--stroke); border-radius: 16px; overflow: auto; background: var(--panel); }
.grid { width: 100%; border-collapse: collapse; }
.grid th, .grid td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.grid th { font-size: 13px; font-weight: 700; white-space: nowrap; background: var(--panel); position: sticky; top: 0; z-index: 1;
           border-bottom: var(--stroke); }
.grid th a { color: var(--ink); }
.grid th a:hover { color: var(--blue); }
.grid th .arr { font-size: 9px; margin-left: 5px; color: #b9b9b9; vertical-align: 1px; }
.grid th a:hover .arr { color: var(--blue); }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tbody tr { cursor: pointer; }
.grid.static tbody tr { cursor: default; }
.grid tbody tr:nth-child(even) td { background: #fafafa; }
.grid tbody tr:hover td { background: var(--blue-soft); }
.grid tbody tr.empty { cursor: default; }
.grid tr.gone td { color: var(--muted); }
.grid td.num { font-variant-numeric: tabular-nums; }
.grid td.nw { white-space: nowrap; }
.grid td a { color: var(--ink); font-weight: 600; }
.grid td a.ulink { color: var(--blue); text-decoration: underline; font-weight: 500; }
.who-cell { display: inline-flex; align-items: center; gap: 12px; font-weight: 600; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 280px; font-size: 14px; }
.grid .act-col { width: 56px; text-align: right; }
.rowmenu .icon-btn { width: 34px; height: 34px; }
.rowmenu .ic { width: 18px; height: 18px; }
.grid.hide-c-cat .c-cat, .grid.hide-c-msgs .c-msgs, .grid.hide-c-created .c-created, .grid.hide-c-seen .c-seen,
.grid.hide-c-out .c-out, .grid.hide-c-id .c-id { display: none; }
.tag { display: inline-block; padding: 2px 10px; margin: 2px 4px 2px 0; border-radius: 999px;
       border: 1.5px solid var(--ink); font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--panel); }
.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.pager a { min-width: 38px; text-align: center; padding: 7px 10px; border-radius: 10px; border: var(--stroke);
           background: var(--panel); color: var(--ink); font-weight: 600; }
.pager a.on, .pager a:hover { background: var(--blue); color: #fff; }

/* ---------- диалоги: список слева, переписка справа ---------- */
.dlg { display: grid; grid-template-columns: 360px minmax(0, 1fr); height: calc(100dvh - var(--top) - 36px); min-height: 480px;
       background: var(--panel); border: var(--stroke); border-radius: var(--r); overflow: hidden; }
.dlist { display: flex; flex-direction: column; min-height: 0; border-right: var(--thin); }
.dlist-head { padding: 18px 20px 10px; }
.dlist-head h1 { margin: 0 0 6px; }
.dsearch { position: relative; display: flex; align-items: center; border-top: var(--thin); border-bottom: var(--thin); }
.dsearch input { border: 0; border-radius: 0; width: 100%; padding: 12px 16px 12px 40px; font-size: 14px; }
.dsearch input:focus { outline: 0; background: #fafafa; }
.ditems { overflow-y: auto; flex: 1; }
.ditem { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; align-items: center;
         padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--text); }
.ditem .ava { grid-row: span 2; }
.ditem b { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ditem .cat { color: var(--muted); font-size: 12px; font-weight: 500; max-width: 120px; white-space: nowrap; overflow: hidden;
              text-overflow: ellipsis; text-align: right; }
.ditem p { margin: 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ditem .you { color: var(--blue); font-weight: 600; }
.ditem time { color: var(--muted); font-size: 12px; text-align: right; white-space: nowrap; }
.ditem:hover { background: #f7f9fc; color: var(--text); }
.ditem.on { background: var(--blue-soft); box-shadow: inset 4px 0 0 var(--blue); }
.more, .older { display: block; text-align: center; padding: 14px; font-weight: 600; font-size: 14px; }
.dnone { padding: 24px; color: var(--muted); text-align: center; margin: 0; }

.dchat { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.dchat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 22px; border-bottom: var(--thin); }
.dchat-head .back { display: none; }
.dchat-who { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-width: 0; cursor: pointer; }
.dchat-who .name { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dchat-who .cats { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dchat-who:hover .name { color: var(--blue); }
.dchat-head .acts { margin-left: auto; display: flex; gap: 8px; }
.dmsgs { flex: 1; overflow-y: auto; padding: 14px 26px 18px; background: #f7f7f7; }
.day { text-align: center; margin: 16px 0 8px; }
.day span { font-size: 12px; font-weight: 600; color: var(--muted); }
.msg { display: flex; align-items: flex-end; gap: 10px; margin: 8px 0; }
.msg.out { flex-direction: row-reverse; }
.msg .bubble { max-width: min(72%, 640px); padding: 10px 14px; border-radius: 16px 16px 16px 4px; border: var(--stroke);
               background: var(--panel); white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.msg.out .bubble { background: var(--blue); color: #fff; border-radius: 16px 16px 4px 16px; }
.msg.out .bubble a { color: #fff; text-decoration: underline; }
.msg .kb { display: grid; gap: 4px; margin-top: 10px; }
.msg .kb div { display: flex; gap: 4px; }
.msg .kb span { flex: 1; min-width: 0; padding: 6px 8px; border-radius: 8px; background: rgba(255, 255, 255, .2);
  font-size: 13px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.operator .bubble { background: var(--blue-dark); }
.msg .bubble i { display: block; font-style: normal; font-size: 11px; font-weight: 700; text-transform: uppercase;
                 letter-spacing: .04em; opacity: .75; margin-bottom: 2px; }
.msg time { font-size: 11px; color: var(--muted); font-weight: 600; padding-bottom: 3px; flex: none; }
.msg.press .bubble { border: 1.5px dashed #9a9a9a; background: transparent; color: var(--muted); font-size: 13px; padding: 6px 12px; }
.msg.press .bubble b { color: var(--ink); }
.msg.note { justify-content: center; }
.msg.note span { font-size: 12px; color: var(--muted); background: var(--gray); border-radius: 999px; padding: 3px 12px; }
.flash { margin: 0; padding: 8px 22px; font-size: 14px; border-top: var(--thin); }
.dcompose { display: flex; gap: 10px; align-items: flex-end; padding: 10px 12px 10px 22px; border-top: var(--thin); }
.dcompose textarea { flex: 1; border: 0; border-radius: 0; resize: none; padding: 10px 0; max-height: 180px; line-height: 1.45; }
.dcompose textarea:focus { outline: 0; }
.dcompose .send .ic { margin-left: -2px; }
.dcompose-off { margin: 0; padding: 14px 22px; color: var(--muted); font-size: 14px; }
.dempty { flex: 1; display: grid; place-content: center; justify-items: center; gap: 10px; color: #b9b9b9; text-align: center; }
.dempty .ic { width: 64px; height: 64px; stroke-width: 1.5; }
.dempty p { margin: 0; font-weight: 600; }
.ok { color: var(--ok); font-weight: 600; } .err { color: var(--err); font-weight: 600; }

/* ---------- окно «Пользователь» ---------- */
dialog#umodal { border: var(--stroke); border-radius: 24px; padding: 0; width: min(560px, calc(100vw - 32px));
                max-height: calc(100dvh - 48px); background: var(--panel); color: var(--text); }
dialog#umodal::backdrop { background: rgba(0, 0, 0, .35); }
.umodal { padding: 22px 24px 26px; }
.umodal header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.umodal .x { font-size: 26px; line-height: 1; font-weight: 500; }
.ucard { display: flex; gap: 18px; align-items: center; border: var(--thin); border-radius: 16px; padding: 16px; }
.ucard div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ucard b { font-size: 17px; }
.umodal .btn.wide { margin: 12px 0 18px; }
.mtabs { display: flex; gap: 6px; margin-bottom: 14px; }
.mtabs button { background: var(--gray); color: var(--ink); border: 0; border-radius: 12px; padding: 10px 16px; font-size: 13px; }
.mtabs button:hover { background: #dcdcdc; color: var(--ink); }
.mtabs button.on { background: var(--blue-dark); color: #fff; }
.mpane { border: var(--thin); border-radius: 16px; padding: 16px 18px; }
.ubot { display: flex; gap: 8px; align-items: center; font-weight: 700; text-transform: uppercase; margin-bottom: 12px; }
.lbl { color: var(--muted); font-size: 14px; }
.tags { margin: 4px 0 12px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }
.kv.vars dt { font-family: ui-monospace, Menlo, monospace; font-size: 13px; color: var(--ink); }

/* ---------- личный кабинет: карточки ботов ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 32px; padding-right: 14px; }
.card { position: relative; display: block; padding: 22px 24px; background: var(--panel); border: var(--stroke);
        border-radius: var(--r); color: var(--ink); box-shadow: 10px 0 0 -2px var(--blue), 10px 0 0 0 var(--ink);
        transition: transform .12s, box-shadow .12s; }
.card:hover { transform: translate(-2px, -2px); box-shadow: 14px 4px 0 -2px var(--blue), 14px 4px 0 0 var(--ink); color: var(--ink); }
.card b { display: block; font-size: 20px; font-weight: 700; text-transform: uppercase; margin-bottom: 16px; }
.card .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.card .stat strong { display: block; font-size: 30px; font-weight: 700; line-height: 1.05; color: var(--blue); }
.card .stat span { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }

/* ---------- вход ---------- */
.login { position: relative; max-width: 560px; margin: 72px auto; }
.login .plate { position: absolute; inset: 0 -22px 0 22px; background: var(--blue); border: var(--stroke); border-radius: 36px; }
.login .face { position: relative; background: var(--panel); border: var(--stroke); border-radius: 36px; padding: 44px 44px 36px; }
.login h1 { font-size: 30px; line-height: 1.15; }
.login p { font-size: 16px; }
.login .btn { margin: 18px 0 10px; padding: 16px 28px; font-size: 15px; background: var(--gray); color: var(--ink); width: 100%; text-align: center; }
.login .btn:hover { background: var(--blue); color: #fff; }

.admin-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.admin-form label { margin-right: 12px; white-space: nowrap; font-weight: 600; }

/* ---------- телефон ---------- */
/* ---------- категории: выделение строк, окно пользователя, «Настройка категорий» ---------- */
.grid th.sel, .grid td.sel { width: 40px; padding-right: 0; }
.grid td.sel input, .grid th.sel input { width: 18px; height: 18px; accent-color: var(--blue); cursor: pointer; }
.act-link { color: var(--blue); font-weight: 600; font-size: 14px; }
.ucats, .urun { margin: 4px 0 16px; }
.ucats .chips { margin: 8px 0 10px; }
.ucats .chip span { padding: 5px 11px; font-size: 13px; }
.urun-row { display: flex; gap: 8px; margin-top: 8px; }
.urun-row input { flex: 1; min-width: 0; }
p.small { font-size: 12px; margin: 6px 0 0; }
.catrow form { display: flex; gap: 8px; align-items: center; margin: 0; }
.catrow input[name=name] { flex: 1; min-width: 160px; padding: 7px 12px; }

/* ---------- Статистика: плитки, графики, путь новых людей ---------- */
.periods { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.periods a { padding: 7px 14px; border-radius: 999px; border: var(--thin); font-weight: 600; font-size: 14px; color: var(--ink); background: var(--panel); }
.periods a.on { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
h2.sh { font-size: 15px; margin: 26px 0 12px; }
h2.sh i, .chart h3 i { font-style: normal; font-weight: 500; color: var(--muted); text-transform: none; margin-left: 6px; font-size: 13px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--panel); border: var(--stroke); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.tile span { font-size: 13px; font-weight: 600; color: var(--muted); }
.tile b { font-size: 26px; line-height: 1.1; color: var(--ink); }
.tile i { font-style: normal; font-size: 12px; color: var(--muted); }
.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; margin-top: 14px; }
.chart { background: var(--panel); border: var(--stroke); border-radius: 16px; padding: 14px 16px 10px; min-width: 0; }
.chart h3 { font-size: 14px; margin: 0 0 8px; text-transform: none; }
svg.bars { width: 100%; height: 150px; display: block; overflow: visible; }
svg.bars .bar { fill: var(--blue); }
svg.bars .grid { stroke: #ececec; stroke-width: 1; }
svg.bars .base { stroke: #cfcfcf; stroke-width: 1; }
svg.bars .ax { fill: var(--muted); font-size: 11px; font-family: "Montserrat", sans-serif; }
svg.bars .hit { fill: transparent; cursor: default; }
svg.bars .hit:hover { fill: rgba(0, 133, 248, .08); }
.chart-tip { position: fixed; z-index: 50; pointer-events: none; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600;
             padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
details.tview summary { cursor: pointer; color: var(--blue); font-size: 13px; font-weight: 600; margin-top: 6px; }
table.mini { font-size: 13px; }
table.mini td, table.mini th { padding: 6px 10px; }
.table-wrap.narrow { max-width: 640px; }
.small-line { font-size: 13px; margin: 0 0 10px; }
.fn { display: grid; grid-template-columns: 130px 1fr 54px 44px; align-items: center; gap: 10px; margin: 10px 0; font-size: 14px; }
.fn span { font-weight: 600; }
.fn-bar { height: 14px; background: #f1f1f1; border-radius: 4px; overflow: hidden; }
.fn-bar i { display: block; height: 100%; background: var(--blue); border-radius: 0 4px 4px 0; min-width: 2px; }
.fn b { text-align: right; }
.fn em { font-style: normal; color: var(--muted); font-size: 13px; text-align: right; }

/* ---------- Постинг: карточки по дням и форма поста ---------- */
.ph-right { margin-left: auto; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.back-link .ic { width: 16px; height: 16px; }
.badge { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--gray); }
.badge.st-scheduled, .badge.st-sending { background: var(--blue-soft); color: var(--blue-dark); }
.badge.st-sent { background: #e5f4ea; color: var(--ok); }
.pday { display: flex; align-items: baseline; gap: 14px; margin: 26px 0 12px; padding-bottom: 8px; border-bottom: var(--thin); }
.pday b { font-size: 16px; }
.pday span { color: var(--muted); font-size: 14px; font-weight: 500; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.pcard { display: flex; flex-direction: column; background: var(--panel); border: var(--stroke); border-radius: 16px; overflow: hidden;
         color: var(--ink); min-height: 170px; transition: transform .08s; }
.pcard:hover { color: var(--ink); transform: translateY(-2px); }
.pc-top { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--gray); font-weight: 700; font-size: 14px; }
.pcard.st-scheduled .pc-top, .pcard.st-sending .pc-top { background: var(--blue-soft); }
.pcard.st-scheduled .pc-st, .pcard.st-sending .pc-st { color: var(--blue); }
.pcard.st-sent .pc-top { background: #e5f4ea; }
.pcard.st-sent .pc-st { color: var(--ok); }
.pc-time { display: inline-flex; align-items: center; gap: 6px; }
.pc-time .ic, .pc-rep .ic { width: 16px; height: 16px; }
.pc-rep { display: flex; align-items: center; gap: 6px; padding: 7px 14px; background: #eef8e6; font-size: 13px; font-weight: 700; }
.pc-body { padding: 12px 14px; flex: 1; font-size: 14px; }
.pc-body p { margin: 4px 0 0; color: var(--text); line-height: 1.4; }
.pc-body p.muted { color: var(--muted); }
.pc-foot { padding: 8px 14px 12px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.pform fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.pbox { background: var(--panel); border: var(--stroke); border-radius: 18px; padding: 18px 22px 20px; margin-bottom: 16px; max-width: 860px; }
.pbox h2 { font-size: 15px; margin: 0 0 12px; }
.pbox .muted { font-size: 14px; margin: 0 0 12px; }
.fld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.fld > span { font-weight: 700; font-size: 14px; }
.fld > span i { font-style: normal; font-weight: 500; color: var(--muted); margin-left: 6px; }
.fld textarea { resize: vertical; line-height: 1.45; }
.fld.inline { flex-direction: row; align-items: center; gap: 12px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 7px 14px; border-radius: 999px; border: var(--thin); font-size: 14px; font-weight: 600; background: var(--panel); }
.chip input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip.neg input:checked + span { background: var(--ink); border-color: var(--ink); }
.chip input:focus-visible + span { outline: 3px solid var(--blue-soft); }
details.sub summary { cursor: pointer; color: var(--blue); font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.days { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 0 28px; }
.days input[type=time] { width: 120px; }
.pbox .chk input[type=datetime-local] { margin-left: 10px; }
.pactions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; max-width: 860px; }
.pactions.second { margin-top: 12px; }
.pactions form { margin: 0; }
code.tok { display: inline-block; margin-top: 6px; padding: 6px 10px; background: #fff; border-radius: 8px; font-size: 14px; user-select: all; word-break: break-all; }
p.note code { font-size: 13px; word-break: break-all; }
p.note { background: var(--blue-soft); border-radius: 14px; padding: 12px 16px; font-size: 14px; max-width: 860px; }
.pflash { border-radius: 14px; padding: 12px 16px; margin: 0 0 14px; max-width: 860px; font-size: 14px; font-weight: 600; }
.pflash.ok { background: #e5f4ea; color: var(--ok); }
.pflash.err { background: #fde8e8; color: var(--err); }

@media (max-width: 860px) {
  :root { --top: 56px; }
  .top { padding: 0 16px; gap: 12px; }
  .brand img { height: 28px; }
  .crumbs { overflow-x: auto; gap: 8px; font-size: 14px; scrollbar-width: none; }
  .crumbs .home, .crumbs .home + .sep { display: none; }
  .crumbs .drop .menu { position: fixed; left: 16px; right: 16px; top: calc(var(--top) + 6px); min-width: 0; }
  .me .nm, .me a span { display: none; }
  .me { gap: 14px; }
  .shell { flex-direction: column; }
  .side { width: auto; height: auto; position: sticky; top: var(--top); z-index: 10; display: flex; gap: 6px; padding: 8px 16px;
          overflow-x: auto; border-right: 0; border-bottom: var(--thin); background: var(--bg); scrollbar-width: none; }
  .side-bot, .side hr { display: none; }
  .side a { flex: none; padding: 8px 12px; font-size: 14px; }
  main { padding: 18px 16px 40px; }
  main.full { padding: 10px 10px 12px; }
  .toolbar { gap: 14px; }
  .search { margin-left: 0; width: 100%; }
  .search input { width: 100%; }
  .drop .menu.right { right: 0; }
  .dlg { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - var(--top) - 56px - 22px); min-height: 0; border-radius: 16px; }
  .dlg.open .dlist { display: none; }
  .dlg:not(.open) .dchat { display: none; }
  .dlist { border-right: 0; }
  .dchat-head { padding: 10px 12px; }
  .dchat-head .back { display: inline-grid; }
  .dmsgs { padding: 10px 12px 14px; }
  .msg .bubble { max-width: 84%; }
  .dcompose { padding: 8px 8px 8px 14px; }
  .cards { grid-template-columns: 1fr; }
  .pgrid { grid-template-columns: 1fr; }
  .pbox { padding: 16px; }
  .days { margin-left: 0; }
  .login .face { padding: 30px 24px; }
  .login .plate { inset: 0 -10px 0 10px; }
}
