/* ═══════════════════════════════════════════════════════════════════════
   DESIGN TOKENS — Единая дизайн-система Mini App
   Все цвета вычисляются из Telegram themeParams через theme.ts (--n-*)
   Никаких хардкодных хеш-классов telegram-ui — только смысловые переменные
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* ── Spacing ── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  /* ── Border Radius ── */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 999px;

  /* ── Shadows ── */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.18);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.24);
  --shadow-glow: 0 0 24px var(--n-acc-glow, rgba(121, 40, 202, 0.35));

  /* ── Transitions ── */
  --transition-fast: 120ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* ── Z-index ── */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 300;
  --z-toast: 400;

  /* ── Layout ── */
  --header-h: 56px;
  --tabbar-h: 64px;
  --tabbar-space: calc(var(--tabbar-h) + var(--tgui--safe_area_inset_bottom, env(safe-area-inset-bottom, 0px)));
}

/* ═══════════════════════════════════════════════════════════════════════
   NEON THEME — Фон, glow-пятна, стеклянные поверхности
   Адаптируется под светлые/тёмные темы пользователя
   ═══════════════════════════════════════════════════════════════════════ */

body.neon-theme {
  background: linear-gradient(135deg,
    var(--n-bg-a, #0f0c20),
    var(--n-bg-b, #150b24),
    var(--n-bg-c, #060913)
  ) fixed;
}

body.neon-theme::before,
body.neon-theme::after {
  content: "";
  position: fixed;
  z-index: 0;
  width: 60vw;
  height: 60vw;
  max-width: 520px;
  max-height: 520px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(10px);
}

body.neon-theme::before {
  top: -12%;
  left: -12%;
  background: radial-gradient(circle, var(--n-glow1, rgba(138, 43, 226, 0.22)) 0%, transparent 70%);
  animation: neonFloat 22s infinite alternate;
}

body.neon-theme::after {
  bottom: -14%;
  right: -14%;
  background: radial-gradient(circle, var(--n-glow2, rgba(0, 240, 255, 0.12)) 0%, transparent 70%);
  animation: neonFloat 17s infinite alternate-reverse;
}

@keyframes neonFloat {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, 50px) scale(1.18); }
}

/* ═══════════════════════════════════════════════════════════════════════
   TELEGRAM-UI THEME OVERRIDES — Проброс наших токенов в tgui переменные
   ═══════════════════════════════════════════════════════════════════════ */

body.neon-theme .approot {
  --tgui--bg_color: transparent;
  --tgui--text_color: var(--n-ink, #e8eaf2);
  --tgui--hint_color: var(--n-hint, #8a8da4);
  --tgui--subtitle_text_color: var(--n-hint, #8a8da4);
  --tgui--section_header_text_color: var(--n-acc, #a78bfa);
  --tgui--link_color: var(--n-acc2, #b983ff);
  --tgui--accent_text_color: var(--n-acc, #b983ff);
  --tgui--button_color: var(--n-acc, #7928ca);
  --tgui--button_text_color: var(--n-btn-text, #ffffff);
  --tgui--secondary_bg_color: var(--n-glass, rgba(255, 255, 255, 0.045));
  --tgui--section_bg_color: var(--n-glass, rgba(255, 255, 255, 0.045));
  --tgui--card_bg_color: var(--n-glass, rgba(255, 255, 255, 0.05));
  --tgui--tertiary_bg_color: var(--n-glass2, rgba(255, 255, 255, 0.07));
  --tgui--quartenary_bg_color: var(--n-glass, rgba(255, 255, 255, 0.05));
  --tgui--header_bg_color: transparent;
  --tgui--divider: var(--n-glass-border, rgba(255, 255, 255, 0.08));
  --tgui--outline: var(--n-glass-border, rgba(255, 255, 255, 0.10));
  --tgui--skeleton: var(--n-glass2, rgba(255, 255, 255, 0.07));
  --tgui--secondary_fill: var(--n-fill, rgba(157, 0, 255, 0.14));
  --tgui--segmented_control_active_bg: var(--n-acc, rgba(121, 40, 202, 0.9));
  --tgui--secondary_hint_color: var(--n-hint, #7c7f96);
  --tgui--plain_background: var(--n-glass2, rgba(255, 255, 255, 0.08));
  --tgui--plain_foreground: var(--n-ink, #e8eaf2);
  --tgui--surface_dark: var(--n-bar, rgba(15, 12, 32, 0.9));
  --tgui--surface_primary: var(--n-bar, rgba(24, 16, 46, 0.97));
  --tgui--destructive_text_color: var(--n-danger, #ff5470);
  --tgui--destructive_background: rgba(255, 60, 90, 0.16);
  --tgui--toast_accent_color: var(--n-acc, #9d00ff);
  --tgui--primary_code_highlight: var(--n-acc, #b983ff);
  --tgui--secondary_code_highlight: var(--n-acc2, #ff4ecd);
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════════════════════════
   BASE LAYOUT
   ═══════════════════════════════════════════════════════════════════════ */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--tg-theme-bg-color, #fff);
  color: var(--tg-theme-text-color, #000);
  font-family: var(--tgui--font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  -webkit-font-smoothing: antialiased;
}

.shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 100vh;
}

.stage {
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(var(--space-2) + var(--tabbar-space));
  -webkit-overflow-scrolling: touch;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4) var(--space-1);
  background: var(--tgui--header_bg_color, var(--tgui--secondary_bg_color));
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--tgui--divider, transparent);
}

/* Градиентный заголовок — из цветов темы пользователя */
.grad-text {
  background: linear-gradient(45deg, var(--n-acc, #b983ff), var(--n-acc2, #ff4ecd));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ═══════════════════════════════════════════════════════════════════════
   GLASS PANELS — Стеклянные секции и карточки
   ═══════════════════════════════════════════════════════════════════════ */

.glass-section,
body.neon-theme section {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: var(--tgui--section_bg_color, var(--n-glass, rgba(255, 255, 255, 0.045)));
  border: 1px solid var(--n-glass-border, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.glass-card {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: var(--tgui--card_bg_color, var(--n-glass, rgba(255, 255, 255, 0.05)));
  border: 1px solid var(--n-glass-border, rgba(255, 255, 255, 0.07));
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* ═══════════════════════════════════════════════════════════════════════
   TABBAR — Нижняя навигация
   ═══════════════════════════════════════════════════════════════════════ */

.glass-tabbar {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--n-bar, rgba(15, 12, 32, 0.72));
  border-top: 1px solid var(--n-glass-border, rgba(255, 255, 255, 0.07));
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  padding-bottom: var(--tgui--safe_area_inset_bottom, env(safe-area-inset-bottom, 0px));
}

/* Хеш-классы tgui 2.1.13: пункт меню и его подпись, иначе подписи обрезаются */
.glass-tabbar .tgui-64cd0db020a9bacf {
  min-width: 0;
  padding: 8px 2px 12px;
  gap: 4px;
}

.glass-tabbar .tgui-aeab497081949a15 {
  max-width: 100%;
  overflow: visible;
  text-overflow: clip;
  font-size: 11px;
  letter-spacing: -0.2px;
}

/* ═══════════════════════════════════════════════════════════════════════
   TOOLBAR — Компактный ряд контролов (селекты, сегменты, кнопки)
   ═══════════════════════════════════════════════════════════════════════ */

.toolbar {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
}

/* FormInput обёртка у Select/Input — равные доли */
.toolbar .tgui-form-input-wrapper {
  padding: 0;
  flex: 1 1 0;
  min-width: 0;
}

/* Select — компактный, без растягивания строки */
.toolbar .tgui-select {
  padding: 8px 30px 8px 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar .tgui-select-chevron {
  right: 10px;
}

/* SegmentedControl в toolbar — фиксированная ширина */
.toolbar .tgui-segmented-control {
  flex: 0 0 auto;
  width: 128px;
  height: 36px;
}

.toolbar .tgui-segmented-control-item {
  padding: 4px 10px;
}

.toolbar .tgui-button {
  flex: 0 0 auto;
}

/* ═══════════════════════════════════════════════════════════════════════
   BUTTONS — Фирменные кнопки-пилюли (filled mode)
   ═══════════════════════════════════════════════════════════════════════ */

.tgui-button.filled,
.tgui-button[tgui-mode="filled"] {
  background: linear-gradient(90deg, var(--n-acc, #7928ca), var(--n-acc2, #ff0080));
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-glow);
  border: none;
  color: var(--n-btn-text, #fff);
  font-weight: 600;
}

.tgui-button.filled:active,
.tgui-button[tgui-mode="filled"]:active {
  transform: scale(0.98);
}

/* ═══════════════════════════════════════════════════════════════════════
   MODAL — Лист модалки в тон теме
   ═══════════════════════════════════════════════════════════════════════ */

.tgui-modal-sheet {
  background: linear-gradient(165deg, var(--n-bg-b, #171029), var(--n-bg-c, #0b0818));
  border: 1px solid var(--n-glass-border, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   POST CARD — Карточка поста в модерации/одобренных
   ═══════════════════════════════════════════════════════════════════════ */

.postcard {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  position: relative;
  background: var(--tgui--bg_color, #fff);
}

/* Мягкий градиент-переход сверху медиа — как нижняя стеклянная панель */
.postcard::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(180deg,
    var(--tgui--bg_color, #fff) 0%,
    color-mix(in srgb, var(--tgui--bg_color, #fff) 55%, transparent) 45%,
    transparent 100%
  );
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  mask-image: linear-gradient(180deg, #000 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 100%);
  pointer-events: none;
  z-index: 2;
}

.media {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  background: #000;
  max-height: 62dvh;
}

.media::-webkit-scrollbar { display: none; }

.media .slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.media img,
.media video {
  max-width: 100%;
  max-height: 62dvh;
  object-fit: contain;
  display: block;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px 0 0;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tgui--section_header_text_color, #999);
  opacity: 0.35;
  transition: opacity var(--transition-fast);
}

.dot.on { opacity: 1; }

.postinfo { padding: var(--space-2) var(--space-4); }

.caption-text {
  font-size: 15px;
  line-height: 1.35;
  white-space: pre-wrap;
  margin-bottom: var(--space-1);
  color: var(--tgui--text_color);
}

.meta { display: block; font-size: 13px; color: var(--tgui--hint_color); }
.meta a { color: var(--tgui--link_color); text-decoration: none; }
.meta a:active { opacity: 0.7; }

.mono { font-family: ui-monospace, SFMono-Regular, monospace; font-size: 11px; opacity: 0.7; }

.banner {
  margin-top: var(--space-2);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  background: rgba(255, 159, 10, 0.12);
  color: var(--tgui--destructive_text_color, #e0a52e);
  font-size: 13px;
}

/* Action row — прилипает к низу над таббаром */
.actrow {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  margin-top: auto;
  position: sticky;
  bottom: var(--tabbar-space);
  z-index: var(--z-sticky);
  background: var(--tgui--card_bg_color, var(--tgui--bg_color, #fff));
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--tgui--divider, transparent);
}

.actrow .tgui-button { min-width: 0; }
.actrow .actmore { flex: 0 0 auto; min-width: 40px; }

/* ═══════════════════════════════════════════════════════════════════════
   APPROVED GRID — Сетка одобренных постов
   ═══════════════════════════════════════════════════════════════════════ */

.agrid {
  display: grid;
  gap: 3px;
  padding: 0 4px;
}

.atile {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--tgui--secondary_bg_color);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.atile:active { transform: scale(0.98); }

.atile img,
.atile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.atile-count {
  position: absolute;
  right: 4px;
  bottom: 4px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-full);
  padding: 1px 6px;
}

.atile-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.atile-video {
  inset: auto auto 4px 4px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 11px;
  border-radius: var(--radius-full);
  padding: 2px 6px;
}

/* Cell select — ограничиваем ширину в after */
.cell-sel { display: flex; max-width: 210px; min-width: 70px; }
.cell-sel .tgui-form-input-wrapper { flex: 1; min-width: 0; }
.cell-sel .tgui-select {
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 8px 30px 8px 12px;
  font-size: 14px;
}
.cell-sel .tgui-select-chevron { right: 10px; }

/* ═══════════════════════════════════════════════════════════════════════
   SEGMENT ROW — Одиночный сегмент-переключатель на всю строку
   ═══════════════════════════════════════════════════════════════════════ */

.seg-row { padding: 0 var(--space-4); }
.seg-row .tgui-segmented-control { height: 36px; }

/* ═══════════════════════════════════════════════════════════════════════
   ICON PLUS CELL — Иконка плюса в строке подключения канала
   ═══════════════════════════════════════════════════════════════════════ */

.icon-plus-cell {
  font-size: 22px;
  font-weight: 500;
  width: 28px;
  line-height: 20px;
  text-align: center;
  display: inline-block;
}

/* ═══════════════════════════════════════════════════════════════════════
   FADE ANIMATION — Контент слегка меркнет при обновлении
   ═══════════════════════════════════════════════════════════════════════ */

.fading {
  opacity: 0.55;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════
   SELECT OPEN — Прячем таббар когда открыт выпадающий список
   ═══════════════════════════════════════════════════════════════════════ */

body.sel-open .glass-tabbar { display: none; }

/* ═══════════════════════════════════════════════════════════════════════
   HTML BODY — Рендеринг HTML из бота (статистика, справка, импорт)
   ═══════════════════════════════════════════════════════════════════════ */

.html-body { font-size: 14px; line-height: 1.4; color: var(--tgui--text_color); }
.html-body b, .html-body strong { font-weight: 600; }
.html-body a { color: var(--tgui--link_color); text-decoration: none; }
.html-body code {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
  background: var(--tgui--secondary_bg_color);
  border-radius: 4px;
  padding: 1px 4px;
}
.html-body pre {
  background: var(--tgui--tertiary_bg_color);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  overflow-x: auto;
  font-size: 12px;
}
.html-body pre code { background: transparent; padding: 0; }

.ellip {
  display: inline-block;
  max-width: 60vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* ═══════════════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════════════ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-muted { color: var(--tgui--hint_color); }
.text-accent { color: var(--n-acc); }
.text-danger { color: var(--n-danger); }
.text-success { color: var(--stat-app, #3ddc84); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }

.mt-auto { margin-top: auto; }
.mb-2 { margin-bottom: var(--space-2); }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.shadow { box-shadow: var(--shadow-md); }
.shadow-glow { box-shadow: var(--shadow-glow); }

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
  :root {
    --space-4: 12px;
    --space-5: 16px;
  }
  .toolbar { gap: 4px; }
  .toolbar .tgui-segmented-control { width: 100px; }
  .cell-sel { max-width: 160px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   ГЛАВНАЯ — плитки и список разделов
   ═══════════════════════════════════════════════════════════════════════ */

.home {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 16px 8px;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 84px;
  gap: 8px;
}

.home-tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: 0 14px;
  border: 1px solid var(--n-glass-border, rgba(255, 255, 255, 0.08));
  border-radius: 18px;
  background: var(--n-glass, rgba(255, 255, 255, 0.05));
  color: var(--n-ink, #e8eaf2);
  font: inherit;
  text-align: left;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform var(--transition-fast);
}

.home-tile:active:not(:disabled) { transform: scale(0.98); }
.home-tile:disabled { opacity: 0.5; cursor: default; }

.home-tile--primary {
  grid-row: span 2;
  justify-content: space-between;
  padding: 16px;
  border: 0;
  background: var(--n-acc, #6ab2f2);
  color: var(--n-on-acc, #0e1a24);
  box-shadow: var(--shadow-glow);
}

/* Автопостинг включён: подсветка слабее, чем у основной плитки */
.home-tile--on {
  border-color: var(--n-acc, #6ab2f2);
  box-shadow: 0 0 10px var(--n-glow1, rgba(106, 178, 242, 0.22));
}
.home-tile--on .home-tile-state { color: var(--n-acc, #6ab2f2); }

.home-tile--row {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 600;
}
.home-tile--row svg { flex: none; color: var(--n-acc, #6ab2f2); }

@media (max-width: 345px) {
  .home-tile--row { font-size: 12.5px; }
}

.home-tile-title { font-size: 20px; font-weight: 700; }
.home-tile-value { font-size: 28px; line-height: 1.1; font-weight: 700; }
.home-tile-state { font-size: 22px; line-height: 1.1; font-weight: 700; }
.home-tile-label { font-size: 13px; color: var(--n-hint, #8a8da4); }

.home-cell-icon { display: flex; color: var(--n-acc, #6ab2f2); }
.home-cell-arrow { display: flex; color: var(--n-hint, #8a8da4); }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* ═══════════════════════════════════════════════════════════════════════
   MODERATION — карточка поста и её окна
   ═══════════════════════════════════════════════════════════════════════ */

/* Типы тегов: едва заметный оттенок поверх обычного фона, текст не меняется */
:root {
  --tag-character: #4fb286;
  --tag-copyright: #a78bda;
  --tag-artist: #e0a458;
}
.tagtint--character { background-color: color-mix(in srgb, var(--tag-character) 9%, var(--n-sheet, #17212b)) !important; }
.tagtint--copyright { background-color: color-mix(in srgb, var(--tag-copyright) 9%, var(--n-sheet, #17212b)) !important; }
.tagtint--artist { background-color: color-mix(in srgb, var(--tag-artist) 9%, var(--n-sheet, #17212b)) !important; }

.mod-author { font-size: 16px; font-weight: 600; margin-bottom: 2px; color: var(--n-ink); }
.mod-author a { color: inherit; text-decoration: none; }

.mod-tagfield { padding: 0 var(--space-4) var(--space-2); }
.mod-chips { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.mod-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 30px;
  max-width: 100%;
  padding-left: 10px;
  border-radius: 15px;
  background: var(--n-glass2);
  color: var(--n-ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.mod-chip button {
  width: 30px;
  height: 30px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--n-hint);
  cursor: pointer;
}
.mod-chip--off { opacity: 0.6; }
.mod-chipinput {
  flex: 1;
  min-width: 96px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 15px;
  outline: 0;
  background: transparent;
  color: var(--n-ink);
  font: inherit;
  font-size: 16px;
}
.mod-chipinput:focus { border-color: var(--n-acc); }
.mod-hints {
  display: flex;
  flex-direction: column;
  margin-bottom: 6px;
  border: 1px solid var(--n-glass-border);
  border-radius: 12px;
  background: var(--n-glass2);
  overflow: hidden;
}
.mod-hint {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-bottom: 1px solid var(--n-glass-border);
  background: transparent;
  color: var(--n-ink);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.mod-hint:last-child { border-bottom: 0; }

.mod-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 0 var(--space-4) var(--space-2);
}
.mod-tool {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--n-glass2);
  color: var(--n-ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.mod-tool svg { color: var(--n-acc); flex: none; }
.mod-tool--lit { border-color: var(--n-acc); background: var(--n-fill); font-weight: 600; }

.mod-actions.actrow { justify-content: stretch; padding: var(--space-2) var(--space-4); }
.mod-act {
  width: 52px;
  height: 52px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--n-glass-border);
  border-radius: 14px;
  background: transparent;
  color: var(--n-ink);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}
.mod-act:disabled { opacity: 0.5; cursor: default; }
.mod-act--wide { width: auto; flex: 1; }
.mod-act--main {
  width: auto;
  flex: 1;
  border: 0;
  background: var(--n-acc);
  color: var(--n-on-acc);
  font-size: 16px;
  font-weight: 700;
}
.mod-value { font-size: 13px; color: var(--n-hint); }

.mod-sheet {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px 16px;
}
.mod-sheet-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mod-sheet-note { display: block; color: var(--n-hint); padding: 0 4px; line-height: 1.35; }

.mod-sitetag {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--n-glass2);
}
.mod-sitetag-hint { font-size: 12px; color: var(--n-hint); }
.mod-sitetag-name { font-size: 16px; font-weight: 600; color: var(--n-ink); overflow-wrap: anywhere; }
.mod-field-title { font-size: 13px; color: var(--n-hint); }
.mod-groups { display: flex; flex-wrap: wrap; gap: 6px; }
.mod-group {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--n-glass-border);
  border-radius: 19px;
  background: transparent;
  color: var(--n-ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.mod-group--on { border-color: transparent; background: var(--n-acc); color: var(--n-on-acc); font-weight: 700; }
.mod-group:disabled:not(.mod-group--on) { opacity: 0.5; cursor: default; }
.mod-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--n-ink);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.mod-checkbox {
  width: 20px;
  height: 20px;
  flex: none;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--n-hint);
  border-radius: 6px;
  color: var(--n-on-acc);
}
.mod-checkbox--on { border-color: var(--n-acc); background: var(--n-acc); }
.mod-checkbox--warn.mod-checkbox--on { border-color: var(--tag-artist); background: var(--tag-artist); color: #0e1a24; }

.mod-taglist {
  display: flex;
  flex-direction: column;
  max-height: 42vh;
  overflow-y: auto;
  border-radius: 12px;
  background: var(--n-glass);
}
.mod-taglist-row {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  border-bottom: 1px solid var(--n-glass-border);
  background: transparent;
  color: var(--n-ink);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.mod-taglist-row:last-child { border-bottom: 0; }
.mod-taglist-name { min-width: 0; overflow-wrap: anywhere; }
.mod-warn { font-size: 13px; line-height: 1.35; color: var(--tag-artist); padding: 0 4px; }
.mod-warnbtn {
  height: 52px;
  flex: none;
  border: 0;
  border-radius: 14px;
  background: var(--tag-artist);
  color: #0e1a24;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.mod-warnbtn:disabled { opacity: 0.45; cursor: default; }

.mod-albumlist {
  display: flex;
  flex-direction: column;
  max-height: 52vh;
  overflow-y: auto;
  border-radius: 12px;
  background: var(--n-glass);
}
.mod-albumrow {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 0 4px 0 6px;
  border-bottom: 1px solid var(--n-glass-border);
  background: var(--tgui--bg_color);
}
.mod-albumrow:last-child { border-bottom: 0; }
.mod-albumrow--off { opacity: 0.6; }
.mod-grip {
  width: 44px;
  height: 56px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--n-hint);
  /* Иначе браузер заберёт жест себе и начнёт прокручивать окно */
  touch-action: none;
  cursor: grab;
}
.mod-thumb {
  position: relative;
  width: 52px;
  height: 52px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  overflow: hidden;
  background: var(--n-glass2);
  color: var(--n-hint);
  font-size: 15px;
  font-weight: 700;
}
.mod-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mod-thumb-num {
  position: absolute;
  left: 3px;
  bottom: 3px;
  min-width: 16px;
  padding: 0 3px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  font-size: 11px;
  text-align: center;
}
.mod-albumrow-id { flex: 1; min-width: 0; font-size: 13px; color: var(--n-ink); overflow-wrap: anywhere; }
.mod-albumrow-btn {
  width: 44px;
  height: 44px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--n-hint);
  cursor: pointer;
}

/* Лист модалки: --tgui--bg_color в теме прозрачный, поэтому фон нужен свой.
   Хеш-классы прибиты версией telegram-ui 2.1.13. */
.tgui-cc76354712c6e8d9 {
  background-color: var(--n-sheet, #17212b) !important;
  z-index: var(--z-modal) !important;
}
.tgui-3197096cb603b35a { z-index: calc(var(--z-modal) - 1) !important; }

.mod-actions.actrow { background: var(--n-sheet, #17212b); border-radius: 0; }

.mod-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-top: -8px; }
.mod-sheet-title { margin: 0; font-size: 18px; font-weight: 700; color: var(--n-ink); }
.mod-sheet--top { padding-bottom: 0; }
.mod-taglist, .mod-albumlist { scrollbar-width: thin; scrollbar-color: var(--n-hint) transparent; }

.mod-sheetbtn {
  min-height: 46px;
  padding: 0 6px;
  border: 1px solid var(--n-glass-border);
  border-radius: 14px;
  background: transparent;
  color: var(--n-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.mod-sheetbtn:disabled { opacity: 0.5; cursor: default; }

/* ═══════════════════════════════════════════════════════════════════════
   MODERATION MEDIA — арт занимает всё место над кнопками
   Карточка тянется на высоту экрана, всё остальное прижато к низу.
   ═══════════════════════════════════════════════════════════════════════ */

.postcard .media-wrap {
  flex: 1 1 0;
  min-height: 180px;
  position: relative;
  display: flex;
  flex-direction: column;
}
.postcard .media { flex: 1 1 0; min-height: 0; max-height: none; }

/* Карточка и так во весь экран: «прилипание» кнопок к низу не нужно —
   с отступом под таббар оно поднимало их на строку «Надпись/Автор/Теги» */
.postcard .mod-actions.actrow { position: relative; bottom: auto; }
.postcard .media .slide { position: relative; overflow: hidden; }

/* Поля по бокам — размытая и притемнённая копия арта */
.postcard .slide-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(28px) brightness(0.5) saturate(1.3);
  transform: scale(1.25);
  pointer-events: none;
}
.postcard .slide-open {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.postcard .media .slide-open img,
.postcard .media video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.postcard .media video { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Точки альбома — поверх арта, а не отдельной строкой */
.postcard .dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  padding: 0;
  pointer-events: none;
}
.postcard .dot { background: #fff; box-shadow: 0 0 3px rgba(0, 0, 0, 0.6); opacity: 0.45; }
.postcard .dot.on { opacity: 1; }

/* Теги: не больше двух строк, остальное — прокруткой */
.mod-chips--scroll {
  max-height: 65px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.mod-chips--scroll::-webkit-scrollbar { display: none; }
.mod-tagfield .mod-chipinput { display: block; width: 100%; box-sizing: border-box; margin-top: 5px; }

/* Просмотр на весь экран: крестик слева сверху */
.viewer .yarl__toolbar {
  inset-inline-start: 0;
  inset-inline-end: auto;
  padding-top: calc(8px + var(--tg-content-safe-area-inset-top, 0px) + var(--tg-safe-area-inset-top, env(safe-area-inset-top, 0px)));
}
.viewer .yarl__toolbar .yarl__button {
  margin: 4px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  filter: none;
}

/* ═══════════════════════════════════════════════════════════════════════
   APPROVED — следующий пост, разделы по админам, очередь на постинг
   ═══════════════════════════════════════════════════════════════════════ */

.apv { display: flex; flex-direction: column; padding: 0 var(--space-4); }
.apv-sub { padding: 0 var(--space-4) var(--space-2); font-size: 13px; color: var(--n-hint); }
.apv .apv-sub { padding: 0 0 var(--space-2); }
.apv-sub a { color: var(--n-acc); text-decoration: none; }

.apv-sorts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  margin-bottom: 12px;
  padding: 3px;
  border-radius: 12px;
  background: var(--n-glass2);
}
.apv-sort {
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--n-hint);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.apv-sort--on { background: var(--n-fill); color: var(--n-ink); }

.apv-next {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  background: var(--n-glass2);
  border: 1px solid var(--n-glass-border);
}
.apv-next-art { flex: none; padding: 0; border: 0; background: transparent; cursor: pointer; }
.apv-next-thumb {
  position: relative;
  display: block;
  width: 104px;
  height: 128px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--n-glass-border);
}
.apv-next-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.apv-next-when { font-size: 12px; font-weight: 600; color: var(--n-acc); }
.apv-next-author {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--n-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.apv-next-meta { margin-top: 2px; font-size: 12px; color: var(--n-hint); }
.apv-next-actions { margin-top: auto; display: flex; gap: 6px; padding-top: 8px; }

.apv-btn {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.apv-btn:disabled { opacity: 0.5; }
.apv-btn--icon {
  width: 44px;
  flex: none;
  border: 1px solid var(--n-glass-border);
  background: transparent;
  color: var(--n-ink);
}
.apv-btn--main { flex: 1; border: 0; background: var(--n-acc); color: var(--n-on-acc, #fff); }

/* Миниатюры: картинка или видео на всю площадь */
.apv-next-thumb img, .apv-next-thumb video,
.apv-tile-art img, .apv-tile-art video,
.apv-row-thumb img, .apv-row-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.apv-badge {
  position: absolute;
  padding: 1px 6px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  pointer-events: none;
}
.apv-badge--album { right: 4px; top: 4px; }
.apv-badge--date { left: 4px; bottom: 4px; }

.apv-avatar {
  width: 32px;
  height: 32px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  object-fit: cover;
  background: var(--n-fill);
  color: var(--n-ink);
  font-size: 14px;
  font-weight: 700;
}

.apv-sections { display: flex; flex-direction: column; gap: 16px; padding-top: 16px; }
.apv-section { display: flex; flex-direction: column; gap: 8px; }
.apv-section-head { display: flex; align-items: center; gap: 10px; }
.apv-section-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.apv-section-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--n-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.apv-section-meta { font-size: 12px; color: var(--n-hint); }
.apv-all {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  padding: 0 4px 0 10px;
  border: 0;
  background: transparent;
  color: var(--n-acc);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.apv-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.apv-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--n-glass2);
  cursor: pointer;
}
.apv-tile-art { position: absolute; inset: 0; display: block; }
.apv-tile--more { color: var(--n-ink); font: inherit; font-size: 18px; font-weight: 700; }

.apv-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 4px 6px;
}
.apv-list-title { font-size: 13px; font-weight: 600; color: var(--n-acc); }
.apv-list-note { font-size: 12px; color: var(--n-hint); }
.apv-list {
  border-radius: 12px;
  background: var(--n-glass2);
  overflow: hidden;
}
.apv-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--n-glass-border);
}
.apv-row:last-child { border-bottom: 0; }
.apv-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0 7px 12px;
  border: 0;
  background: transparent;
  color: var(--n-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.apv-row-time {
  flex: none;
  width: 52px;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  font-weight: 600;
  color: var(--n-hint);
}
.apv-row-time small { font-size: 11px; font-weight: 400; }
.apv-row-thumb {
  position: relative;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--n-glass-border);
}
.apv-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.apv-row-author {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.apv-row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  color: var(--n-hint);
  white-space: nowrap;
  overflow: hidden;
}
.apv-row-meta .apv-avatar { width: 16px; height: 16px; font-size: 9px; }
.apv-grip { flex: none; touch-action: none; }
.apv-badge--video { left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 4px 8px; }

/* Пост из «Одобренных»: когда выйдет — мелкой строкой под заголовком.
   Поверх градиента .postcard::before, иначе текст размоется */
.post-queueline {
  position: relative;
  z-index: 3;
  padding: 0 var(--space-4) 6px;
  font-size: 12px;
  color: var(--n-hint);
}

/* ═══════════════════════════════════════════════════════════════════════
   STATS — период кнопками, фильтры-чипы, плитки, график, доли по админам
   ═══════════════════════════════════════════════════════════════════════ */

.stx {
  --stx-app: var(--n-acc);
  --stx-rej: #f5b461;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 var(--space-4);
}
.stx-periods { margin-bottom: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stx-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.stx-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 36px;
  border: 1px solid var(--n-glass-border);
  border-radius: 18px;
  color: var(--n-ink);
}
.stx-chip--on { border-color: var(--n-acc); background: var(--n-fill); }
.stx-chip select {
  appearance: none;
  -webkit-appearance: none;
  height: 100%;
  max-width: 200px;
  padding: 0 30px 0 14px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  text-overflow: ellipsis;
  cursor: pointer;
}
.stx-chip select option { background: var(--n-sheet, #17212b); color: var(--n-ink); }
.stx-chip svg { position: absolute; right: 10px; pointer-events: none; color: var(--n-hint); }

.stx-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.stx-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px;
  border-radius: 14px;
  background: var(--n-glass2);
}
.stx-tile b { font-size: 24px; font-weight: 700; color: var(--n-ink); }
.stx-tile span { font-size: 12px; color: var(--n-hint); }
.stx-tile b.stx-c-app { color: var(--stx-app); }
.stx-tile b.stx-c-rej { color: var(--stx-rej); }

.stx-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: var(--n-glass2);
}
.stx-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--n-ink);
}
.stx-legend { display: flex; gap: 10px; font-weight: 400; color: var(--n-hint); }
.stx-legend span { display: inline-flex; align-items: center; gap: 4px; }
.stx-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.stx-dot--app { background: var(--stx-app); }
.stx-dot--rej { background: var(--stx-rej); }
.stx-chart { width: 100%; height: auto; display: block; }
.stx-grid { stroke: var(--n-glass-border); stroke-width: 1; }
.stx-tick { fill: var(--n-hint); font-size: 9px; }
.stx-app { fill: var(--stx-app); }
.stx-rej { fill: var(--stx-rej); }

.stx-head { margin-bottom: -6px; padding-left: 4px; font-size: 13px; font-weight: 600; color: var(--n-acc); }
.stx-list { display: flex; flex-direction: column; border-radius: 12px; background: var(--n-glass2); overflow: hidden; }
.stx-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--n-glass-border);
}
.stx-row:last-child { border-bottom: 0; }
.stx-ava {
  width: 32px;
  height: 32px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  object-fit: cover;
  background: var(--n-fill);
  color: var(--n-ink);
  font-size: 12px;
  font-weight: 700;
}
.stx-ava--site { border-radius: 8px; }
.stx-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.stx-row-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.stx-row-name {
  font-weight: 600;
  color: var(--n-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stx-row-counts { flex: none; color: var(--n-hint); }
.stx-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--stx-rej); }
.stx-bar span { background: var(--stx-app); }

.stx-more {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: var(--n-glass2);
  color: var(--n-ink);
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}
.stx-more > svg { color: var(--n-acc); }
.stx-more-label { flex: 1; }
.stx-more-count { font-size: 13px; color: var(--n-hint); }
.stx-more-arrow { display: flex; color: var(--n-hint); transition: transform var(--transition-fast); }
.stx-more-arrow--open { transform: rotate(90deg); }

/* ═══════════════════════════════════════════════════════════════════════
   POSTING — шапка, «Как часто» на экране, список настроек, «Сохранить»
   ═══════════════════════════════════════════════════════════════════════ */

.pst { display: flex; flex-direction: column; gap: 14px; padding: 0 var(--space-4); }
.pst-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-radius: 16px;
  background: var(--n-fill);
  border: 1px solid var(--n-glass-border);
}
.pst-info b { font-size: 16px; color: var(--n-ink); }
.pst-info span { font-size: 13px; color: var(--n-hint); }
.pst-info .pst-info-warn { color: #f5b461; }

.pst-block { display: flex; flex-direction: column; gap: 8px; }
.pst-head { padding-left: 4px; font-size: 13px; font-weight: 600; color: var(--n-acc); }
.pst-modes { margin-bottom: 0; }

.pst-stepper {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--n-glass2);
}
.pst-stepper-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 15px; color: var(--n-ink); }
.pst-stepper-text small { font-size: 12px; color: var(--n-hint); }
.pst-step {
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid var(--n-glass-border);
  border-radius: 12px;
  background: transparent;
  color: var(--n-ink);
  font: inherit;
  font-size: 22px;
  cursor: pointer;
}
.pst-step-value { min-width: 48px; text-align: center; font-size: 20px; font-weight: 700; color: var(--n-ink); }

.pst-times {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--n-glass2);
}
.pst-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pst-chip {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding-left: 12px;
  border-radius: 18px;
  background: var(--n-fill);
  color: var(--n-ink);
  font-size: 15px;
  font-weight: 600;
}
.pst-chip button {
  width: 32px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--n-hint);
  cursor: pointer;
}
.pst-add {
  height: 36px;
  padding: 0 14px;
  border: 1px dashed var(--n-glass-border);
  border-radius: 18px;
  background: transparent;
  color: var(--n-acc);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}
.pst-add:disabled { opacity: 0.5; }
.pst-time-input {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--n-acc);
  border-radius: 18px;
  background: transparent;
  color: var(--n-ink);
  font: inherit;
  font-size: 15px;
  color-scheme: dark;
}
.pst-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.pst-day {
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: var(--n-fill);
  color: var(--n-hint);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.pst-day--on { background: var(--n-acc); color: var(--n-on-acc); }

.pst-list { display: flex; flex-direction: column; border-radius: 12px; background: var(--n-glass2); overflow: hidden; }
.pst-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 0 14px;
  border: 0;
  border-bottom: 1px solid var(--n-glass-border);
  background: transparent;
  color: var(--n-ink);
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}
.pst-row:last-child { border-bottom: 0; }
.pst-row > svg:first-child { color: var(--n-acc); }
.pst-row > svg:last-child { color: var(--n-hint); }
.pst-row-label { flex: 1; }
.pst-row-value { font-size: 14px; color: var(--n-hint); }

.pst-save {
  height: 52px;
  border: 0;
  border-radius: 14px;
  background: var(--n-acc);
  color: var(--n-on-acc);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.pst-save:disabled { opacity: 0.45; cursor: default; }

/* Окна поверх экрана: выбор значения снизу, предупреждение по центру */
.pst-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.55);
}
.pst-overlay--center { justify-content: center; padding: 24px; }
.pst-sheet {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 80dvh;
  overflow-y: auto;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  border-radius: 18px 18px 0 0;
  background: var(--n-sheet, #17212b);
}
.pst-sheet-head { display: flex; align-items: center; justify-content: space-between; }
.pst-sheet-head h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--n-ink); }
.pst-sheet-head button {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--n-hint);
  cursor: pointer;
}
.pst-sheet-note { margin: 0; font-size: 13px; line-height: 1.4; color: var(--n-hint); }
.pst-radio {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 6px 14px;
  border: 0;
  border-bottom: 1px solid var(--n-glass-border);
  background: transparent;
  color: var(--n-ink);
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}
.pst-radio:last-child { border-bottom: 0; }
.pst-radio:disabled { opacity: 0.45; cursor: default; }
.pst-radio-dot {
  width: 20px;
  height: 20px;
  flex: none;
  box-sizing: border-box;
  border: 2px solid var(--n-glass-border);
  border-radius: 50%;
}
.pst-radio-dot--on { border-color: var(--n-acc); box-shadow: inset 0 0 0 4px var(--n-sheet, #17212b); background: var(--n-acc); }
.pst-radio-text { display: flex; flex-direction: column; gap: 2px; }
.pst-radio-text small { font-size: 12px; color: var(--n-hint); }

.pst-dialog {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  border-radius: 18px;
  background: var(--n-sheet, #17212b);
}
.pst-dialog h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--n-ink); }
.pst-dialog p { margin: 0 0 8px; font-size: 14px; line-height: 1.4; color: var(--n-hint); }
.pst-dialog .pst-save { height: 48px; font-size: 15px; }
.pst-dialog-skip {
  height: 48px;
  border: 1px solid var(--n-glass-border);
  border-radius: 12px;
  background: transparent;
  color: #f5b461;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
