﻿/* Панель модерации в стиле Telegram (ночная тема). Сначала телефон: открывается как Mini App. */
:root {
  --bg: #0e1621;          /* фон чата */
  --surface: #17212b;     /* шапка, списки, шторка */
  --surface-2: #1e2c3a;   /* поля ввода, плашки */
  --bubble: #182533;      /* входящее сообщение */
  --bubble-hi: #1f3144;
  --line: #0a121b;
  --hairline: rgba(255, 255, 255, .06);
  --text: #f5f5f5;
  --muted: #7f91a4;
  --accent: #5eb5f7;      /* ссылки и выделение */
  --accent-strong: #3e8fd4;
  --ok: #5fcf7b; --ok-bg: rgba(95, 207, 123, .14);
  --bad: #ef5b62; --bad-bg: rgba(239, 91, 98, .14);
  --warn: #f0b252; --warn-bg: rgba(240, 178, 82, .14);
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }  /* иначе display у слоёв перебивает hidden, и скрытый слой ловит нажатия */
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.38 var(--font); overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12.5px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }

.app { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr);
       height: var(--tg-viewport-stable-height, 100dvh); max-width: 860px; margin: 0 auto; background: var(--bg); }

/* ── Шапка и разделы ── */
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface); }
.topbar h1 { font-size: 16.5px; line-height: 1.2; }
.topbar p { margin: 2px 0 0; }
.titles { min-width: 0; }
.titles h1, .titles p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar.chat-avatar { --size: 42px; background: url("chat.jpg") center / cover, linear-gradient(180deg, #72d5fd, #2a9ef1);
               color: transparent; text-shadow: none; }

/* Нижняя панель разделов, как в Telegram для iOS: полупрозрачная, иконка над подписью, активный — синий */
.tabbar { display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(23, 33, 43, .86);
          backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
          border-top: .5px solid rgba(255, 255, 255, .1); padding: 5px 4px calc(4px + env(safe-area-inset-bottom)); z-index: 5; }
.tabbar button { display: grid; justify-items: center; gap: 2px; background: none; border: 0; padding: 2px 0;
                 color: #8d99a6; font-size: 10.5px; font-weight: 500; letter-spacing: .01em; transition: color .15s; }
.tabbar svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
              transition: transform .2s var(--ease); }
.tabbar button[aria-selected="true"] { color: var(--accent); }
.tabbar button[aria-selected="true"] svg { fill: rgba(94, 181, 247, .18); }
.tabbar button:active svg { transform: scale(.88); }
main { min-height: 0; position: relative; overflow: hidden; }
/* Крупный заголовок раздела, как в iOS */
.large-title { padding: 2px 4px 0; display: grid; gap: 2px; }
.large-title h2 { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.large-title p { margin: 0; }
.seg.wide { display: grid; grid-template-columns: 1fr 1fr; }
.seg.wide button { padding: 8px 12px; }
.top-block { display: grid; gap: 10px; }
.section-head { margin-top: 10px; }
.section-head h3 { font-size: 17px; }
/* Ячейки действий, как строки в настройках iOS */
.cells { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: 14px; overflow: hidden; }
.cells li + li .cell { border-top: .5px solid rgba(255, 255, 255, .08); }
.cell { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: none; border: 0; color: var(--text);
        text-align: left; transition: background .15s; }
.cell:active { background: rgba(255, 255, 255, .05); }
.cell:disabled { opacity: .6; }
.cell-icon { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 8px; display: grid; place-items: center; font-size: 17px; }
.cell-icon.red { background: rgba(239, 91, 98, .22); }
.cell-icon.blue { background: rgba(94, 181, 247, .22); }
.cell-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.cell-text strong { font-weight: 500; font-size: 15.5px; }
.chevron { color: #5d6b79; font-size: 24px; line-height: 1; }
/* «Написать от лица бота» в шторке */
.sheet-title { font-size: 18px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.say-photo { position: relative; justify-self: start; }
.say-photo img { display: block; max-width: min(100%, 260px); max-height: 220px; border-radius: 12px; object-fit: cover; }
.say-photo-remove { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0;
                    background: rgba(0, 0, 0, .65); color: #fff; font-size: 13px; }
.say-preview-wrap { display: grid; gap: 8px; }
.say-preview-img { max-width: 100%; max-height: 30vh; border-radius: 12px; object-fit: contain; justify-self: center; }
/* Раздел прибит к краям main: процентная высота внутри grid в WebView на iPhone не считается,
   раздел вырастал на всю длину списка и не прокручивался */
.view { position: absolute; inset: 0; }


/* ── Аватарки ── */
.avatar { --size: 36px; width: var(--size); height: var(--size); flex: 0 0 var(--size); border-radius: 50%; border: 0; padding: 0;
          display: inline-grid; place-items: center; color: #fff; font-weight: 600; font-size: calc(var(--size) * .4);
          letter-spacing: .02em; text-shadow: 0 1px 1px rgba(0, 0, 0, .15); user-select: none; }
.avatar.has-photo { background-size: cover !important; background-position: center !important; color: transparent; text-shadow: none; }
button.avatar { transition: transform .15s var(--ease); }
button.avatar:active { transform: scale(.92); }
.avatar-gap { width: 34px; flex: 0 0 34px; }

/* ── Лента чата ── */
.chat { display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); }
.page > * { min-width: 0; }
/* Поиск и календарь в одной строке, фильтры — под ними на всю ширину */
.chat-tools { grid-template-columns: minmax(0, 1fr) auto; }
.chat-tools .chips { grid-column: 1 / -1; }
.date-pick { position: relative; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); color: var(--accent);
             display: grid; place-items: center; }
.date-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; cursor: pointer; }
.date-pick:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.chips .date-chip { background: var(--accent-strong); color: #fff; }
/* Фильтры-иконки: компактно, подпись — во всплывающей подсказке и для экранного диктора */
.chips .icon-chip { min-width: 44px; padding: 6px 10px; font-size: 16px; line-height: 1.2; }
.chat-tools { display: grid; gap: 8px; padding: 8px 12px 10px; background: var(--surface); border-bottom: 1px solid var(--line);
              box-shadow: 0 2px 8px rgba(0, 0, 0, .25); z-index: 2; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 12px; padding: 0 12px; }
.search input { flex: 1; min-width: 0; background: none; border: 0; padding: 9px 0; outline: none; }
.search input::placeholder { color: var(--muted); }
.search .count { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: 0 0 auto; border: 0; border-radius: 999px; padding: 6px 12px; background: var(--surface-2); color: var(--text);
                font-size: 13.5px; font-weight: 500; transition: background .2s, color .2s; }
.chips button[aria-pressed="true"] { background: var(--accent-strong); color: #fff; }

.feed { overflow-y: auto; overscroll-behavior: contain; padding: 10px 10px 18px;
        background:
          radial-gradient(1200px 600px at 110% -10%, rgba(94, 181, 247, .07), transparent 60%),
          radial-gradient(900px 500px at -20% 110%, rgba(130, 110, 255, .06), transparent 60%),
          var(--bg); }
.service, .day { display: flex; justify-content: center; margin: 10px 0; }
.service { color: var(--muted); font-size: 13px; }
.day span { background: rgba(23, 33, 43, .85); color: #dfe7ef; font-size: 13px; font-weight: 500; padding: 4px 10px;
            border-radius: 999px; backdrop-filter: blur(6px); }
.msg { display: flex; align-items: flex-end; gap: 8px; margin-top: 2px; min-width: 0; }
.msg.first { margin-top: 8px; }
.bubble { position: relative; max-width: min(78%, 480px); min-width: 120px; background: var(--bubble); border-radius: 14px;
          padding: 6px 10px 6px; box-shadow: 0 1px 1px rgba(0, 0, 0, .3); cursor: pointer; transition: background .15s; }
.bubble:hover { background: var(--bubble-hi); }
.bubble.tail { border-bottom-left-radius: 4px; }
.bubble .author { display: block; background: none; border: 0; padding: 0 0 2px; font-weight: 600; font-size: 14px;
                  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.bubble .author:hover { text-decoration: underline; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; padding-right: 54px; }
.meta { position: absolute; right: 10px; bottom: 5px; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.quote { --q: var(--accent); display: grid; border-left: 3px solid var(--q); background: color-mix(in srgb, var(--q) 10%, transparent);
         border-radius: 6px; padding: 3px 8px; margin: 2px 0 5px; font-size: 13.5px; }
.quote b { color: var(--q); font-weight: 600; }
.quote span { color: #c7d1db; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Пропорция задана заранее: фото догружаются, а лента не прыгает */
.bubble.has-media { width: min(78%, 340px); }
.media { position: relative; margin: 4px -6px 6px; border-radius: 10px; overflow: hidden; background: var(--surface-2);
         aspect-ratio: 4 / 3; }
.media img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.media.loaded img { opacity: 1; }
.media:not(.loaded)::before { content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .05) 50%, transparent 70%) var(--surface-2);
  background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
.media.failed::before { animation: none; content: "фото недоступно"; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.media.video::after { content: "▶"; position: absolute; inset: 0; margin: auto; width: 48px; height: 48px; border-radius: 50%;
                      display: grid; place-items: center; background: rgba(0, 0, 0, .5); color: #fff; font-size: 18px; }
.media .badge { position: absolute; left: 8px; top: 8px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px;
                padding: 2px 8px; border-radius: 999px; }
.media-chip { display: inline-block; margin: 3px 0 5px; padding: 4px 10px; border-radius: 8px; background: var(--surface-2);
              color: var(--muted); font-size: 13px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 5px 54px 2px 0; }
.tag { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: #c7d1db; }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.kind-sale { background: rgba(95, 207, 123, .12); color: #7fdc97; }
.tag.kind-buy { background: rgba(94, 181, 247, .13); color: var(--accent); }
.tag.kind-exchange, .tag.kind-ad { background: rgba(130, 110, 255, .15); color: #b3a6ff; }

/* Удалённое — на своём месте, но приглушено и подписано */
.bubble.deleted { background:
    repeating-linear-gradient(135deg, rgba(239, 91, 98, .06) 0 10px, transparent 10px 20px), #1a2230;
  box-shadow: inset 0 0 0 1px rgba(239, 91, 98, .28); }
.bubble.deleted > :not(.deleted-note):not(.meta) { opacity: .45; }
.bubble.deleted .media { filter: grayscale(.85); }
/* Значок корзины в углу — видно, не вчитываясь */
.bubble.deleted::after { content: "🗑"; position: absolute; top: -7px; right: -7px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; background: var(--bad); box-shadow: 0 2px 6px rgba(0, 0, 0, .45); }
.deleted-note { display: flex; gap: 6px; align-items: flex-start; margin: 8px 54px 1px 0; padding: 4px 8px; border-radius: 8px;
  background: rgba(239, 91, 98, .14); color: #ff8a8f; font-size: 12.5px; line-height: 1.3; width: fit-content; }

.jump { position: absolute; right: 14px; bottom: 16px; width: 44px; height: 44px; border-radius: 50%; border: 0;
        background: var(--surface); color: var(--text); font-size: 20px; box-shadow: 0 4px 14px rgba(0, 0, 0, .45);
        opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none; transition: .2s var(--ease); }
.jump.show { opacity: 1; transform: none; pointer-events: auto; }

/* ── Страницы: топы, предупреждения, управление ── */
/* overflow-anchor: none — иначе браузер при подгрузке держит кнопку «Показать ещё» на месте экрана,
   новые строки уходят выше незаметно, и кажется, что кнопка не работает */
/* grid-auto-rows: max-content — список с overflow: hidden иначе сжимается до высоты экрана и обрезается:
   прокручивать становится нечего */
.page { overflow-y: auto; overflow-anchor: none; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
        padding: 14px 12px calc(56px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: minmax(0, 1fr);
        grid-auto-rows: max-content; align-content: start; gap: 12px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 4px; }
.page-head h2 { font-size: 19px; }
.page-head p { margin: 2px 0 0; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; flex: 0 0 auto; }
.seg button { border: 0; background: none; color: var(--muted); padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 13.5px; }
.seg button[aria-pressed="true"] { background: var(--accent-strong); color: #fff; }

.people, .warnings { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.people li, .warnings li { border-bottom: 1px solid var(--hairline); }
.people li:last-child, .warnings li:last-child { border-bottom: 0; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; transition: background .15s; }
.person:hover, .warning:hover { background: rgba(255, 255, 255, .03); }
.place { width: 26px; flex: 0 0 26px; text-align: center; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.place.medal { font-size: 22px; }
.who { flex: 1; min-width: 0; display: grid; gap: 2px; }
.who strong, .who .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { --w: 0%; display: block; height: 4px; border-radius: 4px; margin-top: 4px; background: var(--surface-2); position: relative; overflow: hidden; }
.bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: inherit;
              background: linear-gradient(90deg, var(--accent-strong), var(--accent)); }
.score { text-align: right; display: grid; justify-items: end; }
.score strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.score span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.warning { display: flex; gap: 12px; padding: 11px 14px; cursor: pointer; transition: background .15s; }
.warning .line { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; }
.warning .line > :first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.warning .line > :last-child { flex: 0 0 auto; }
.warning .label { color: var(--warn); font-size: 13.5px; }
.snippet { margin: 3px 0 0; color: #b9c5d1; font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }

/* ── Не в основном чате ── */
.icon-btn { width: 40px; height: 40px; flex: 0 0 40px; border: 0; border-radius: 12px; background: var(--surface-2); color: var(--text);
            font-size: 17px; display: grid; place-items: center; transition: transform .12s var(--ease), opacity .2s; }
.icon-btn:active { transform: scale(.92); }
.icon-btn:disabled { opacity: .35; }
.icon-btn.spinning { animation: spin .9s linear infinite; }
.out-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.out-bar .btn { padding: 10px 8px; font-size: 14px; }
.out-bar .wide { grid-column: 1 / -1; }
.out-bar .btn:disabled { opacity: .5; }
.outsiders { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.outsider { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-bottom: 1px solid var(--hairline);
            transition: background .15s; }
.outsider:last-child { border-bottom: 0; }
.outsider.selected { background: rgba(94, 181, 247, .08); }
.outsider .who.plain { background: none; border: 0; padding: 0; text-align: left; }
.row-actions { display: flex; gap: 6px; }
.check { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; border: 2px solid var(--muted); background: none; padding: 0;
         display: grid; place-items: center; transition: background .15s, border-color .15s; }
.check.on { background: var(--accent-strong); border-color: var(--accent-strong); }
.check.on::after { content: ""; width: 10px; height: 6px; border: 2px solid #fff; border-top: 0; border-right: 0;
                   transform: translateY(-1px) rotate(-45deg); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.pill { display: inline-block; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: #c7d1db; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.accent { background: rgba(94, 181, 247, .14); color: var(--accent); }

.card { background: var(--surface); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; }
.card-head { display: flex; gap: 12px; align-items: flex-start; }
.card-head h3 { font-size: 16px; margin-bottom: 4px; }
.card-head p { margin: 0; }
.card-head > div { min-width: 0; }
.card .pill { white-space: normal; }
.card-icon { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--surface-2); }
textarea { width: 100%; resize: vertical; min-height: 96px; background: var(--surface-2); border: 1px solid transparent; border-radius: 12px; padding: 10px 12px; outline: none; }
textarea:focus { border-color: var(--accent-strong); }
.say-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
#say-count.over { color: var(--bad); }

/* ── Кнопки ── */
.btn { border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 600; background: var(--surface-2); color: var(--text);
       transition: transform .12s var(--ease), filter .15s, background .15s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent-strong); color: #fff; }
.btn.danger { background: rgba(239, 91, 98, .16); color: #ff7d83; }
.btn.soft { background: rgba(94, 181, 247, .12); color: var(--accent); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.wide { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--accent); text-align: left; }
.link:hover { text-decoration: underline; }
.chip { border: 0; border-radius: 999px; padding: 3px 10px; background: var(--surface-2); color: var(--muted); }

/* ── Шторка ── */
.backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, 0); display: flex; align-items: flex-end; justify-content: center;
            transition: background .22s; }
.backdrop.open { background: rgba(0, 0, 0, .55); }
.sheet { width: 100%; max-width: 640px; max-height: 92%; overflow-y: auto; overscroll-behavior: contain; background: var(--surface);
         border-radius: 20px 20px 0 0; padding: 8px 16px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 14px;
         transform: translateY(100%); transition: transform .26s var(--ease); box-shadow: 0 -10px 40px rgba(0, 0, 0, .4); }
.backdrop.open .sheet { transform: none; }
.grabber { width: 38px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .18); margin: 2px auto 4px; }
.loader { width: 28px; height: 28px; margin: 22px auto; border-radius: 50%; border: 3px solid var(--surface-2);
          border-top-color: var(--accent); animation: spin .8s linear infinite; list-style: none; }
@keyframes spin { to { transform: rotate(1turn); } }

.profile { display: grid; justify-items: center; gap: 8px; text-align: center; padding-top: 6px; }
.profile h2 { font-size: 20px; overflow-wrap: anywhere; }
.profile-pills { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.profile-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { background: var(--surface-2); border-radius: 12px; padding: 10px 4px; display: grid; justify-items: center; gap: 2px; }
.stat strong { font-size: 19px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 12px; }
.section { display: grid; gap: 10px; }
.section h4 { font-size: 14px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ban-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
/* Бан: сроки — красноватые «плитки», чтобы не путать с остальными кнопками карточки */
.section.ban { padding: 12px; border-radius: 16px; background: rgba(239, 91, 98, .06); box-shadow: inset 0 0 0 1px rgba(239, 91, 98, .18); }
.ban-term { border: 0; border-radius: 12px; padding: 12px 6px; font-weight: 600; font-size: 14px; color: #ff9196;
            background: rgba(239, 91, 98, .13); transition: transform .12s var(--ease), background .2s; }
.ban-term:active { transform: scale(.96); background: rgba(239, 91, 98, .24); }
.ban-term.forever { background: var(--bad); color: #fff; }
.custom-ban { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "label label" "stepper go"; gap: 8px 8px;
              align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(239, 91, 98, .16); }
.custom-label { grid-area: label; }
.stepper { grid-area: stepper; display: flex; align-items: center; background: var(--surface-2); border-radius: 12px; overflow: hidden; }
.stepper .step { width: 40px; height: 44px; border: 0; background: none; color: var(--text); font-size: 20px; line-height: 1; }
.stepper .step:active { background: rgba(255, 255, 255, .06); }
.stepper-value { display: flex; align-items: baseline; gap: 4px; padding: 0 2px; }
.stepper-value input { width: 3.2ch; background: none; border: 0; outline: none; color: var(--text); font: inherit; font-weight: 700;
                       font-size: 16px; text-align: right; -moz-appearance: textfield; appearance: textfield; padding: 0; }
.stepper-value input::-webkit-outer-spin-button, .stepper-value input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-value .unit { color: var(--muted); font-size: 13px; min-width: 4ch; }
.custom-go { grid-area: go; height: 44px; }
.mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mini-list li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 14px; }
.mini-list .date { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }

.post-head { display: flex; gap: 12px; align-items: center; }
.author.big { background: none; border: 0; padding: 0; font-size: 16.5px; font-weight: 600; color: var(--text); text-align: left; }
.status { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.status span { color: #c7d1db; font-size: 13.5px; }
.status.ok { background: var(--ok-bg); } .status.ok strong { color: var(--ok); }
.status.bad { background: var(--bad-bg); } .status.bad strong { color: var(--bad); }
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.album .media { margin: 0; aspect-ratio: 1; }
.fulltext { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bubble); border-radius: 14px; padding: 10px 12px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row-actions .btn { flex: 1; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; display: grid; gap: 10px; border-left: 2px solid var(--surface-2); }
.timeline li { display: grid; gap: 1px; position: relative; font-size: 14px; overflow-wrap: anywhere; }
.timeline li::before { content: ""; position: absolute; left: -20px; top: 6px; width: 10px; height: 10px; border-radius: 50%;
                       background: var(--surface-2); box-shadow: 0 0 0 3px var(--surface); }
.timeline li.deleted::before, .timeline li.withdrawn::before { background: var(--bad); }
.timeline li.warning::before { background: var(--warn); }
.timeline li.resolved::before, .timeline li.new::before { background: var(--ok); }
.timeline time { color: var(--muted); font-size: 12.5px; }

/* ── Подтверждение и уведомление ── */
.confirm { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px;
           background: rgba(0, 0, 0, 0); transition: background .18s; }
.confirm.open { background: rgba(0, 0, 0, .6); }
.dialog { width: 100%; max-width: 380px; background: var(--surface); border-radius: 18px; padding: 20px 18px 14px; display: grid; gap: 10px;
          transform: scale(.94); opacity: 0; transition: .18s var(--ease); box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.confirm.open .dialog { transform: none; opacity: 1; }
.dialog h3 { font-size: 17px; }
.dialog p { margin: 0; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.say-preview { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 40vh; overflow-y: auto; background: var(--bubble);
               border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 40; max-width: calc(100% - 32px);
         transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: rgba(30, 44, 58, .97); color: var(--text);
         padding: 10px 16px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); transition: .22s var(--ease); font-size: 14px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { box-shadow: inset 3px 0 0 var(--ok), 0 8px 24px rgba(0, 0, 0, .45); }
.toast.bad { box-shadow: inset 3px 0 0 var(--bad), 0 8px 24px rgba(0, 0, 0, .45); }

/* ── Вход не из Telegram ── */
.locked { height: 100%; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; padding: 24px; }
.locked .lock-icon { font-size: 52px; }
.locked h1 { font-size: 22px; }
.locked p { margin: 0; max-width: 360px; }

@media (min-width: 700px) {
  .bubble { max-width: 64%; }
  .page { padding: 18px 20px 32px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
